Unit 'msesyntaxedit' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#msegui]

tsyntaxedit

[Properties (by Name)] [Methods (by Name)]

Text edit widget with syntax highlighting

Declaration

Source position: msesyntaxedit.pas line 52

type tsyntaxedit = class(tundotextedit)

public

  constructor create(); override;

  destructor destroy; override;

  procedure setsyntaxdef();

  procedure refreshsyntax();

  function charatpos();

  function charbeforepos();

  function wordatpos();

  procedure indent();

  procedure unindent();

  procedure removelink;

  procedure showlink();

  procedure selectword();

  function matchbracket();

  function matchpairword();

  property pairwords: pairwordsty; [rw]

  property syntaxpainterhandle: Integer; [r]

  function syntaxchanging;

  property autoindent: Boolean; [rw]

  property markbrackets: Boolean; [rw]

  property markpairwords: Boolean; [rw]

  property caseinsensitive: Boolean; [rw]

published

  property syntaxpainter: tsyntaxpainter; [rw]

  property options: syntaxeditoptionsty; [rw]

  property pairmarkbkgcolor: colorty; [rw]

  property pairmaxrowcount: int32; [rw]

end;

Inheritance

tsyntaxedit

  

Text edit widget with syntax highlighting

|

tundotextedit

|

ttextedit,iundo

  

Multi-line text edit widget

|

tcustomtextedit

|

tcustomedit,igridwidget,istatfile,iassistiveclientgridwidget

|

tpublishedwidget,iedit

|

tpublishedwidgetnwr

|

tactionpublishedwidgetnwr

|

tactionwidget

|

twidget

|

tactcomponent,iscrollframe,iface,iassistiveclient

|

tmsecomponent,iactivatorclient

  

Extends the FPC tcomponent with object linking facilities and the like; base of every MSEgui component

|

tcomponent,ievent,iificommand,iificlient

|

tpersistent

|

TObject

Description

Text edit widget with syntax highlighting. A tsyntaxpainter reads a syntax definition file (.sdef) describing the styles and the tokens to highlight; the resulting handle is then assigned with setsyntaxdef.

uses
  main_mfm;

procedure tmainfo.buttonexecute(const sender: TObject);
begin
  edit1.loadfromfile('sample.tex');
end;

procedure tmainfo.formcreate(const sender: TObject);
var
  s: ttextstream;
begin
  s := ttextstream.create('latex.sdef');
  fhandle := painter1.readdeffile(s);
  if fhandle >= 0 then
  begin
    edit1.setsyntaxdef(fhandle);
  end;

  s.free;
end;

procedure tmainfo.formdestroy(const sender: TObject);
begin
  painter1.freedeffile(fhandle);
end;

Documentation generated on: 2026-10-03