unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ecSyntAnal, ecSyntMemo, Borland.Vcl.ExtCtrls, Borland.Vcl.Menus,
  Borland.Vcl.ImgList, ecActns, Borland.Vcl.StdActns, Borland.Vcl.ActnList,
  System.ComponentModel, Borland.Vcl.ComCtrls, ecSyntTree;

type
  TForm1 = class(TForm)
    SyntaxTreeView1: TSyntaxTreeView;
    ActionList1: TActionList;
    ecPrintAction1: TecPrintAction;
    actOpen: TAction;
    actSave: TAction;
    ecPageSetupAction1: TecPageSetupAction;
    actSaveAs: TAction;
    ecFullExpand1: TecFullExpand;
    ecCommandRedo: TecCommandAction;
    ecCommandAction1: TecCommandAction;
    ecCommandAction2: TecCommandAction;
    ecFullCollapse1: TecFullCollapse;
    ecCopyAsRTF1: TecCopyAsRTF;
    ecCommandAction3: TecCommandAction;
    HelpContents1: THelpContents;
    ecSearch1: TecSearch;
    ecSearchAgain1: TecSearchAgain;
    ecReplace1: TecReplace;
    ecUserRangeDelete1: TecUserRangeDelete;
    ecUserRangeCollapsable1: TecUserRangeCollapsable;
    ecUserRangeTopLine1: TecUserRangeTopLine;
    ecUserRangeBottomLine1: TecUserRangeBottomLine;
    ecUserRangeLineHighlight1: TecUserRangeLineHighlight;
    ecPreviewAction1: TecPreviewAction;
    ecExportRTFAction1: TecExportRTFAction;
    ecExportHTMLAction1: TecExportHTMLAction;
    ecCustomizeEditorOptionsAction1: TecCustomizeEditorOptionsAction;
    ecCustomizeSyntaxHighlightingAction1: TecCustomizeSyntaxHighlightingAction;
    ecCustomizeLexerPropertiesAction1: TecCustomizeLexerPropertiesAction;
    ecCustomizeKeyMappingAction1: TecCustomizeKeyMappingAction;
    ecCustomizeUserStylesAction1: TecCustomizeUserStylesAction;
    ecToggleNonPrinted1: TecToggleNonPrinted;
    ecToggleWordWrap1: TecToggleWordWrap;
    ecCustomizeLexerLib1: TecCustomizeLexerLib;
    ecToggleSyntTreeSync1: TecToggleSyntTreeSync;
    ecCustomizeAutoReplace1: TecCustomizeAutoReplace;
    ecIncrementalSearch1: TecIncrementalSearch;
    ecFindCurrentWordNextAction1: TecFindCurrentWordNextAction;
    ecFindCurrentWordPriorAction1: TecFindCurrentWordPriorAction;
    PrintSetupAction: TAction;
    FileExitAction: TAction;
    actSaveAll: TAction;
    actClose: TAction;
    actCloseAll: TAction;
    actMDIView: TAction;
    WindowCascade1: TWindowCascade;
    WindowTileHorizontal1: TWindowTileHorizontal;
    WindowTileVertical1: TWindowTileVertical;
    WindowMinimizeAll1: TWindowMinimizeAll;
    WindowArrange1: TWindowArrange;
    actSortTree: TAction;
    ecCopy1: TecCopy;
    ecPaste1: TecPaste;
    ecCut1: TecCut;
    ecClear1: TecClear;
    ecUndo1: TecUndo;
    ecSelectAll1: TecSelectAll;
    ecToggleCollapse1: TecToggleCollapse;
    actDictionaries: TAction;
    actShowHyperlinks: TAction;
    ImageList1: TImageList;
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    New1: TMenuItem;
    Open1: TMenuItem;
    Reopen1: TMenuItem;
    N6: TMenuItem;
    Save1: TMenuItem;
    Saveas1: TMenuItem;
    SaveAll1: TMenuItem;
    Close1: TMenuItem;
    CloseAll1: TMenuItem;
    N2: TMenuItem;
    EncodingMenu: TMenuItem;
    ANSI1: TMenuItem;
    Unicode1: TMenuItem;
    SwapedUnicode1: TMenuItem;
    UTF81: TMenuItem;
    FormatMenu: TMenuItem;
    Default1: TMenuItem;
    Windows1: TMenuItem;
    Unix1: TMenuItem;
    Macintosh1: TMenuItem;
    N9: TMenuItem;
    ExportRTF1: TMenuItem;
    ExportHTML1: TMenuItem;
    N11: TMenuItem;
    PageSetup1: TMenuItem;
    PrintSetup1: TMenuItem;
    actPrintPreview1: TMenuItem;
    Print1: TMenuItem;
    N1: TMenuItem;
    Exit1: TMenuItem;
    Edit1: TMenuItem;
    Undo1: TMenuItem;
    Redo1: TMenuItem;
    N3: TMenuItem;
    Copy1: TMenuItem;
    Cut1: TMenuItem;
    Paste1: TMenuItem;
    Delete1: TMenuItem;
    CopyasRTF1: TMenuItem;
    N4: TMenuItem;
    SelectAll1: TMenuItem;
    Search1: TMenuItem;
    Action11: TMenuItem;
    Findnext1: TMenuItem;
    Replace1: TMenuItem;
    IncrementalSearch1: TMenuItem;
    N14: TMenuItem;
    FindCurrentWordNext1: TMenuItem;
    FindCurrentWordPrior1: TMenuItem;
    View1: TMenuItem;
    actShowNonPrinted1: TMenuItem;
    Wordwrap1: TMenuItem;
    N10: TMenuItem;
    FullExpand1: TMenuItem;
    FullCollapse1: TMenuItem;
    CollapseSelection1: TMenuItem;
    oggleCollapse1: TMenuItem;
    N12: TMenuItem;
    SynchronizeTree1: TMenuItem;
    Sortedtree1: TMenuItem;
    Showhyperlinks1: TMenuItem;
    N7: TMenuItem;
    MDIInterface1: TMenuItem;
    SelLexMenu: TMenuItem;
    Options1: TMenuItem;
    EditorProperties1: TMenuItem;
    actCustomize1: TMenuItem;
    SyntaxHighlignting2: TMenuItem;
    LexerLibrary1: TMenuItem;
    KeyMapping1: TMenuItem;
    Userstyles1: TMenuItem;
    Sharedstyles1: TMenuItem;
    CustomizeAutoReplace1: TMenuItem;
    Dictionaries1: TMenuItem;
    Language1: TMenuItem;
    WindowMenu: TMenuItem;
    Cascade1: TMenuItem;
    ileHorizontally1: TMenuItem;
    ileVertically1: TMenuItem;
    MinimizeAll1: TMenuItem;
    Arrange1: TMenuItem;
    N8: TMenuItem;
    Contents1: TMenuItem;
    N5: TMenuItem;
    About1: TMenuItem;
    Splitter1: TSplitter;
    SyntaxMemo1: TSyntaxMemo;
    SyntaxManager1: TSyntaxManager;
    OD: TOpenDialog;
    SD: TSaveDialog;
    procedure SyntaxManager1LexerChanged(Sender: TObject);
    procedure actOpenExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.actOpenExecute(Sender: TObject);
begin
  OD.Filter := SyntaxManager1.GetFilesFilter;
  if OD.Execute then
   begin
    SyntaxMemo1.LoadFromFile(OD.FileName);
    SyntaxMemo1.SyntaxAnalyzer := SyntaxManager1.AnalyzerForFile(OD.FileName);
   end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
//  SyntaxManager1.LoadFromFile('LexLib.lxl');
end;

procedure TForm1.SyntaxManager1LexerChanged(Sender: TObject);
begin
  SyntaxMemo1.SyntaxAnalyzer := SyntaxManager1.CurrentLexer;
end;

end.
