//---------------------------------------------------------------------------
#ifndef TEMainFrmH
#define TEMainFrmH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "RichView.hpp"
#include "RVEdit.hpp"
#include "RVScroll.hpp"
#include "RVStyle.hpp"
#include <Graphics.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TfrmTemplateEditor : public TForm
{
__published:	// IDE-managed Components
        TRichViewEdit *rve;
        TRVStyle *RVStyle1;
        TMainMenu *MainMenu1;
        TMenuItem *mitFile;
        TMenuItem *mitSave;
        TMenuItem *N1;
        TMenuItem *mitExit;
        TMenuItem *mitInsert;
        TMenuItem *mitName;
        TMenuItem *mitCode;
        TMenuItem *N2;
        TMenuItem *mitNumber;
        TMenuItem *mitDate;
        TMenuItem *mitView;
        TMenuItem *mitShowNever;
        TMenuItem *mitShowCurrent;
        TMenuItem *mitShowAlways;
        TImageList *ImageList1;
        TPopupMenu *pmField;
        TMenuItem *mitToName;
        TMenuItem *mitToCode;
        TPopupMenu *pmSeq;
        TMenuItem *mitDecimal;
        TMenuItem *mitLowerAlpha;
        TMenuItem *mitUpperAlpha;
        TMenuItem *mitLowerRoman;
        TMenuItem *mitUpperRoman;
        TMenuItem *N3;
        TMenuItem *mitContinue;
        TMenuItem *mitResetTo;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall mitSaveClick(TObject *Sender);
        void __fastcall mitExitClick(TObject *Sender);
        void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
        void __fastcall mitNameClick(TObject *Sender);
        void __fastcall mitCodeClick(TObject *Sender);
        void __fastcall mitDateClick(TObject *Sender);
        void __fastcall mitNumberClick(TObject *Sender);
        void __fastcall mitShowNeverClick(TObject *Sender);
        void __fastcall mitShowCurrentClick(TObject *Sender);
        void __fastcall mitShowAlwaysClick(TObject *Sender);
        void __fastcall rveCaretMove(TObject *Sender);
        void __fastcall rveSmartPopupClick(TCustomRichView *Sender,
          TCustomControl *Button);
        void __fastcall pmSeqPopup(TObject *Sender);
        void __fastcall mitNumberTypeClick(TObject *Sender);
        void __fastcall mitResetToClick(TObject *Sender);
        void __fastcall mitContinueClick(TObject *Sender);
        void __fastcall mitToNameClick(TObject *Sender);
        void __fastcall mitToCodeClick(TObject *Sender);
        void __fastcall pmFieldPopup(TObject *Sender);
private:	// User declarations
        void SetNumberTypeToMenu(TRVSeqType NumberType);
        void InsertField(const AnsiString FieldCode, const AnsiString DisplayString);
        void ChangeFieldTo(const AnsiString FieldCode, const AnsiString DisplayString);
        void ResetCurrentSeqTo(int Value, bool Reset);
public:		// User declarations
        __fastcall TfrmTemplateEditor(TComponent* Owner);
        void ChangeDate(TDate Date);        
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmTemplateEditor *frmTemplateEditor;
//---------------------------------------------------------------------------
#endif
