//---------------------------------------------------------------------------

#ifndef EditFrmH
#define EditFrmH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "ecActns.hpp"
#include "ecExtHighlight.hpp"
#include "ecSpell.hpp"
#include "ecSyntAnal.hpp"
#include "ecSyntMemo.hpp"
#include <ActnList.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TEditorFrame : public TFrame
{
__published:	// IDE-managed Components
    TSyntaxMemo *EditorSlave;
    TSplitter *Splitter2;
    TSyntaxMemo *EditorMaster;
    TSyntTextSource *TextSource;
    TActionList *ActionList1;
    TPopupMenu *PopupMenu1;
    TMenuItem *Copy2;
    TMenuItem *Cut2;
    TMenuItem *Paste2;
    TMenuItem *Delete2;
    TMenuItem *N7;
    TMenuItem *ogglebookmarks1;
    TMenuItem *Bookmark01;
    TMenuItem *Bookmark11;
    TMenuItem *Bookmark21;
    TMenuItem *Bookmark31;
    TMenuItem *Bookmark41;
    TMenuItem *Bookmark51;
    TMenuItem *Bookmark61;
    TMenuItem *Bookmark71;
    TMenuItem *Bookmark81;
    TMenuItem *Bookmark91;
    TMenuItem *Gotobookmarks1;
    TMenuItem *Bookmark02;
    TMenuItem *Bookmark12;
    TMenuItem *Bookmark22;
    TMenuItem *Bookmark32;
    TMenuItem *Bookmark42;
    TMenuItem *Bookmark52;
    TMenuItem *Bookmark62;
    TMenuItem *Bookmark72;
    TMenuItem *Bookmark82;
    TMenuItem *Bookmark92;
    TMenuItem *N1;
    TMenuItem *Undo1;
    TMenuItem *Redo1;
    TecCopy *ecCopy1;
    TecCut *ecCut1;
    TecPaste *ecPaste1;
    TecClear *ecClear1;
    TecSelectAll *ecSelectAll1;
    TecUndo *ecUndo1;
    TecRedo *ecRedo1;
    TecIndent *ecIndent1;
    TecUnindent *ecUnindent1;
    TMenuItem *N2;
    TMenuItem *Indent1;
    TMenuItem *Unindent1;
    TMenuItem *N6;
    TMenuItem *N4;
    TMenuItem *N5;
    TecSpellChecker *ecSpellChecker1;
    THyperlinkHighlighter *HyperlinkHighlighter1;
    void __fastcall ToggleBookmark(TObject *Sender);
    void __fastcall GotoBookmark(TObject *Sender);
    void __fastcall PopupMenu1Popup(TObject *Sender);
    void __fastcall EditorMasterEnter(TObject *Sender);
    void __fastcall EditorMasterSetBookmark(TObject *Sender, Ecsyntmemo::TBookmark *Bookmark,
      bool &Accept);
    void __fastcall FrameResize(TObject *Sender);
    void __fastcall SplitterMouseDown(TObject *Sender, TMouseButton Button,
      TShiftState Shift, int X, int Y);
    void __fastcall EditorMasterGetTokenHint(TObject *Sender,
      int TokenIndex, AnsiString &HintText);
    void __fastcall EditorMasterChange(TObject *Sender);
    void __fastcall EditorMasterCaretPosChanged(TObject *Sender);
    void __fastcall EditorSlaveGetStyleEntry(TObject *Sender, int CurPos,
      TStyleEntries *StyleList, int &NextPos);
    void __fastcall N4Click(TObject *Sender);
    void __fastcall N5Click(TObject *Sender);
    void __fastcall EditorMasterGetLineNumberStr(TObject *Sender, int Line,
      AnsiString &NumberStr);
    void __fastcall EditorMasterGetGutterImage(TObject *Sender,
      const int Line, TList *List);
    void __fastcall SyncEditClick(TObject *Sender, int Line, TShiftState Shift);
  private:
    AnsiString FFileName;
    TNotifyEvent FOnTitleChanged;
    bool FPrevMod;
    TSyntaxMemo* __fastcall CurrentMemo();
    void __fastcall SetFileName(const AnsiString Value);
    bool __fastcall GetModified();
    void __fastcall SetModified(const bool Value);
    AnsiString __fastcall GetTitle();
  protected:
    void __fastcall TitleChanged();
  public:
    __fastcall TEditorFrame(TComponent *AOwner);
    void __fastcall SaveFile(const AnsiString AFileName);
    void __fastcall LoadFile(const AnsiString AFileName);
    bool __fastcall IsTheFile(const AnsiString AFileName);
    bool __fastcall IsNewFile();

    __property AnsiString FileName = {read = FFileName, write = SetFileName};
    __property bool Modified = {read = GetModified, write = SetModified};
    __property AnsiString Title = {read = GetTitle};
    __property TNotifyEvent OnTitleChanged = {read = FOnTitleChanged, write = FOnTitleChanged};
};
//---------------------------------------------------------------------------
#endif
