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

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "RichViewActions.hpp"
#include "Ruler.hpp"
#include "RVFontCombos.hpp"
#include "RVRuler.hpp"
#include "RVScroll.hpp"
#include "SclRView.hpp"
#include "SclRVRuler.hpp"
#include "SRVPageScroll.hpp"
#include "SRVSkinManager.hpp"
#include "SRVTabSet.hpp"
#include "SRVToolWindow.hpp"
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
#include <ToolWin.hpp>
//---------------------------------------------------------------------------
typedef TSRichViewEdit*PSRichViewEdit;


class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TSplitter *Splitter1;
        TPanel *Panel1;
        TPanel *Panel3;
        TSclRVRuler *SclRVRuler1;
        TPanel *Panel4;
        TRVRulerItemSelector *RVRulerItemSelector1;
        TSclRVRuler *SclRVRuler2;
        TSRichViewEdit *SRichViewEdit1;
        TSRVPageScroll *SRVPageScroll1;
        TStatusBar *stat1;
        TButton *Button1;
        TSRVTabSet *SRVTabSet1;
        TCoolBar *CoolBar1;
        TToolBar *ToolBar1;
        TToolButton *ToolButton11;
        TToolButton *ToolButton1;
        TToolButton *ToolButton2;
        TToolButton *ToolButton3;
        TToolButton *btnQuickPrint;
        TToolButton *ToolButton4;
        TToolButton *ToolButton32;
        TToolButton *ToolButton33;
        TToolButton *ToolButton34;
        TToolButton *ToolButton17;
        TToolButton *ToolButton18;
        TToolButton *ToolButton19;
        TToolButton *ToolButton5;
        TToolButton *ToolButton20;
        TToolButton *ToolButton21;
        TToolButton *ToolButton10;
        TToolButton *ToolButton46;
        TToolButton *ToolButton12;
        TToolButton *ToolButton47;
        TToolButton *ToolButton62;
        TToolButton *ToolButton63;
        TToolBar *ToolBar2;
        TToolButton *ToolButton41;
        TToolButton *ToolButton42;
        TToolButton *ToolButton43;
        TToolButton *ToolButton44;
        TToolButton *ToolButton29;
        TToolButton *ToolButton64;
        TToolButton *ToolButton13;
        TToolButton *ToolButton22;
        TToolButton *ToolButton6;
        TToolButton *ToolButton30;
        TToolButton *ToolButton31;
        TToolButton *ToolButton35;
        TToolButton *ToolButton36;
        TToolButton *ToolButton38;
        TToolButton *ToolButton37;
        TToolButton *ToolButton49;
        TToolButton *ToolButton50;
        TToolButton *ToolButton51;
        TToolButton *ToolButton8;
        TToolButton *ToolButton7;
        TToolButton *ToolButton57;
        TToolButton *ToolButton61;
        TToolButton *ToolButton60;
        TToolButton *ToolButton53;
        TToolButton *ToolButton54;
        TToolButton *ToolButton40;
        TToolButton *ToolButton39;
        TToolBar *ToolBar3;
        TToolButton *ToolButton9;
        TToolButton *ToolButton14;
        TToolButton *ToolButton15;
        TToolButton *ToolButton16;
        TToolButton *ToolButton27;
        TToolButton *ToolButton23;
        TToolButton *ToolButton24;
        TToolButton *ToolButton45;
        TToolButton *ToolButton28;
        TToolButton *ToolButton25;
        TToolButton *ToolButton26;
        TToolBar *ToolBar4;
        TToolButton *ToolButton48;
        TToolButton *ToolButton52;
        TToolButton *ToolButton55;
        TToolButton *ToolButton56;
        TToolButton *ToolButton58;
        TToolButton *ToolButton59;
        TToolBar *ToolBar5;
        TRVFontComboBox *cmbFont;
        TRVFontSizeComboBox *cmbFontSize;
        TToolButton *ToolButton66;
        TToolButton *ToolButton65;
        TToolButton *btnPageFormat;
        TComboBox *cmbZoom;
        TComboBox *cmbUnits;
        TToolBar *ToolBar6;
        TToolButton *ToolButton71;
        TToolButton *ToolButton72;
        TToolButton *ToolButton75;
        TToolButton *ToolButton76;
        TToolButton *ToolButton77;
        TToolButton *ToolButton78;
        TMainMenu *MainMenu1;
        TMenuItem *mitFile;
        TMenuItem *New1;
        TMenuItem *Load1;
        TMenuItem *Save1;
        TMenuItem *SaveAs1;
        TMenuItem *Export1;
        TMenuItem *N1;
        TMenuItem *mitPageSetup;
        TMenuItem *mitPrint;
        TMenuItem *N3;
        TMenuItem *mitExit;
        TMenuItem *mitEdit;
        TMenuItem *Undo1;
        TMenuItem *Redo1;
        TMenuItem *N4;
        TMenuItem *Cut1;
        TMenuItem *Copy1;
        TMenuItem *n2;
        TMenuItem *PasteasText1;
        TMenuItem *PasteSpecial1;
        TMenuItem *N5;
        TMenuItem *Find1;
        TMenuItem *FindNext1;
        TMenuItem *Replace1;
        TMenuItem *N26;
        TMenuItem *CharacterCase1;
        TMenuItem *N20;
        TMenuItem *InsertPageBreak1;
        TMenuItem *RemovePageBreak1;
        TMenuItem *N15;
        TMenuItem *SelectAll1;
        TMenuItem *mitFont;
        TMenuItem *Changefont1;
        TMenuItem *Font1;
        TMenuItem *N7;
        TMenuItem *mitFontStyle;
        TMenuItem *Bold1;
        TMenuItem *Italic1;
        TMenuItem *Underline1;
        TMenuItem *Strikeout1;
        TMenuItem *N27;
        TMenuItem *rvActionSubscript11;
        TMenuItem *rvActionSuperscript11;
        TMenuItem *N14;
        TMenuItem *AllCapitals1;
        TMenuItem *Overline1;
        TMenuItem *mitFontSize;
        TMenuItem *ShrinkFont1;
        TMenuItem *GrowFont1;
        TMenuItem *N13;
        TMenuItem *ShrinkFontByOnePoint1;
        TMenuItem *GrowFontByOnePoint1;
        TMenuItem *extColor1;
        TMenuItem *extBackgroundColor1;
        TMenuItem *mitPara;
        TMenuItem *rvActionParagraph11;
        TMenuItem *ParagraphBorders1;
        TMenuItem *N18;
        TMenuItem *AlignLeft1;
        TMenuItem *AlignCenter1;
        TMenuItem *AlignRight1;
        TMenuItem *Justify1;
        TMenuItem *N25;
        TMenuItem *BulletsandNumbering1;
        TMenuItem *Bullets1;
        TMenuItem *Numbering1;
        TMenuItem *N16;
        TMenuItem *Leftjustify1;
        TMenuItem *N6;
        TMenuItem *DecreaseIndent1;
        TMenuItem *IncreaseIndent1;
        TMenuItem *N17;
        TMenuItem *SingleLineSpacing1;
        TMenuItem *N15LineSpacing1;
        TMenuItem *DoubleLineSpacing1;
        TMenuItem *N30;
        TMenuItem *mitTextFlow;
        TMenuItem *ClearTextFlowatLeftSide1;
        TMenuItem *ClearTextFlowatRightSide1;
        TMenuItem *ClearTextFlowatBothSides1;
        TMenuItem *NormalTextFlow1;
        TMenuItem *N19;
        TMenuItem *ParagraphBackgroundColor1;
        TMenuItem *mitFormat;
        TMenuItem *Background1;
        TMenuItem *BackgroundColor1;
        TMenuItem *N22;
        TMenuItem *FillColor1;
        TMenuItem *N28;
        TMenuItem *RemoveHyperlinks1;
        TMenuItem *N29;
        TMenuItem *ObjectPosition1;
        TMenuItem *Properties1;
        TMenuItem *mitInsert;
        TMenuItem *File1;
        TMenuItem *Picture1;
        TMenuItem *HorizontalLine1;
        TMenuItem *HypertextLink1;
        TMenuItem *InsertSymbol1;
        TMenuItem *N32;
        TMenuItem *Footnote1;
        TMenuItem *Endnote1;
        TMenuItem *EditNote1;
        TMenuItem *ReturntoNote1;
        TMenuItem *mitTable;
        TMenuItem *InsertTable1;
        TMenuItem *N9;
        TMenuItem *InsertColumnLeft1;
        TMenuItem *InsertColumnRight1;
        TMenuItem *N8;
        TMenuItem *InsertRowAbove1;
        TMenuItem *InsertRowBelow1;
        TMenuItem *N10;
        TMenuItem *DeleteRows1;
        TMenuItem *rvActionTableDeleteCols11;
        TMenuItem *DeleteTable1;
        TMenuItem *N12;
        TMenuItem *mitTableSelect;
        TMenuItem *SelectTable1;
        TMenuItem *SelectColumns1;
        TMenuItem *SelectRows1;
        TMenuItem *SelectCell1;
        TMenuItem *N21;
        TMenuItem *mitTableAlignCellContents;
        TMenuItem *AlignCellToTheTop1;
        TMenuItem *AlignCellToTheMiddle1;
        TMenuItem *AlignCellToTheBottom1;
        TMenuItem *DefaultCellVerticalAlignment1;
        TMenuItem *mitTableCellBorders;
        TMenuItem *LeftBorder1;
        TMenuItem *rvActionTableCellTopBorder11;
        TMenuItem *rvActionTableCellRightBorder11;
        TMenuItem *rvActionTableCellBottomBorder11;
        TMenuItem *rvActionTableCellAllBorders11;
        TMenuItem *rvActionTableCellNoBorders11;
        TMenuItem *N11;
        TMenuItem *SplitCells1;
        TMenuItem *MergeCells1;
        TMenuItem *N24;
        TMenuItem *ShowGridLines1;
        TMenuItem *N23;
        TMenuItem *ableProperties1;
        TRVAControlPanel *RVAControlPanel1;
        TRVAPopupMenu *RVAPopupMenu1;
        TColorDialog *ColorDialog1;
        TPopupMenu *pmFakeDropDown;
        TFindDialog *fd;
        TReplaceDialog *rd;
        TPopupMenu *HintTableMenu;
        TMenuItem *SampleHintTablemenu1;
        TImageList *ilDocTypes;
        TSRVSkinManager *SRVSkinManager1;
        TPopupMenu *pmPageFormat;
        TMenuItem *A41;
        TMenuItem *A42;
        TMenuItem *A61;
        TMenuItem *Letter1;
        TMenuItem *Legal1;
        TMenuItem *N1000x1000mm1;
        TMenuItem *N31;
        TMenuItem *PageSetup1;
        TSRVToolWindow *srvtwSearch;
    TToolButton *ToolButton67;
    TToolButton *ToolButton68;
    TMenuItem *Hide1;
    TImageList *ilMenuV;
    TImageList *ilSearchToolWin;
    TImageList *ilMenuH;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall SRichViewEdit1ZoomChanged(TObject *Sender);
        void __fastcall SRichViewEdit1Jump(TObject *Sender, int id);
        void __fastcall SRichViewEdit1ReadHyperlink(
          TCustomRichView *Sender, const UnicodeString Target,
          const UnicodeString Extras, TRVLoadFormat DocFormat, int &StyleNo,
          int &ItemTag, TRVRawByteString &ItemName);
        void __fastcall SRichViewEdit1WriteHyperlink(
          TCustomRichView *Sender, int id, TCustomRVData *RVData,
          int ItemNo, TRVSaveFormat SaveFormat, UnicodeString &Target,
          UnicodeString &Extras);
        void __fastcall SRichViewEdit1KeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall SRichViewEdit1KeyPress(TObject *Sender, char &Key);
        void __fastcall pmFakeDropDownPopup(TObject *Sender);
        void __fastcall SRichViewEdit1CurTextStyleChanged(TObject *Sender);
        void __fastcall cmbFontClick(TObject *Sender);
        void __fastcall cmbFontSizeClick(TObject *Sender);
        void __fastcall cmbKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall RVAControlPanel1ViewChanged(
          TrvCustomAction *Sender, TCustomRichViewEdit *Edit);
        void __fastcall cmbZoomChange(TObject *Sender);
        void __fastcall RVAControlPanel1MarginsChanged(TrvAction *Sender,
          TCustomRichViewEdit *Edit);
        void __fastcall RVAControlPanel1BackgroundChange(TrvAction *Sender,
          TCustomRichViewEdit *Edit);
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall SRichViewEdit1PageScrolled(TObject *Sender);
        void __fastcall SRichViewEdit1CaretMove(TObject *Sender);
        void __fastcall SRichViewEdit1ChangeActiveEditor(
          TSRichViewEdit *Sender, TRichViewEdit *ActiveEditor);
        void __fastcall SRichViewEdit1HMenuClickButton(TObject *Sender,
          TSRVToolButton *ToolButton);
        void __fastcall SRichViewEdit1VMenuClickButton(TObject *Sender,
          TSRVToolButton *ToolButton);
        void __fastcall srvtwSearchClickButton(TObject *Sender,
          TSRVToolButton *ToolButton);
        void __fastcall fdFind(TObject *Sender);
        void __fastcall RVAControlPanel1Download(TrvAction *Sender,
          const UnicodeString Source);
        void __fastcall SRichViewEdit1TableIconClick(
          TSRichViewEdit *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y, int PageNo);
        void __fastcall SclRVRuler1MarginDblClick(TObject *Sender,
          TMarginType Margin);
        void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
        void __fastcall mitExitClick(TObject *Sender);
        void __fastcall SRichViewEdit1CurrentPageChange(TObject *Sender);
        void __fastcall SRichViewEdit1Change(TObject *Sender);
        void __fastcall SRVTabSet1Change(TObject *Sender);
        void __fastcall SRVTabSet1CloseTab(TSRVTabSet *Sender,
          int TabIndex, bool &CanClose);
        void __fastcall SRVTabSet1TabMove(TSRVTabSet *Sender,
          int NewTabIndex, int OldTabIndex);
    void __fastcall cmbUnitsClick(TObject *Sender);
private:	// User declarations
        int VToolButtonIndex;
        bool UpdatingCombos;
        DynamicArray<PSRichViewEdit> Editors;
        TSRichViewEdit* ActiveEditor;
        void __fastcall ColorPickerShow(TObject* Sender);
        void __fastcall ColorPickerHide(TObject* Sender);
        void __fastcall rvActionSave1DocumentFileChange(TObject* Sender,
          TCustomRichViewEdit* Editor, const UnicodeString FileName,
          TrvFileSaveFilter FileFormat, bool IsNew);
        void __fastcall ApplicationHint(TObject* Sender);
        void Localize();
        void AddEditor();
        void SetEditor(int Index);
        void RemoveEditor(int Index);
        void __fastcall OnNewEditor(TObject* Sender);
        void __fastcall OnOpenEditor(TObject* Sender);
        int GetIndexOfEditorByRichViewEdit(TCustomRichViewEdit* rve);
        TrvaDocumentInfo* GetActiveDocInfo();
        TrvaDocumentInfo* GetDocInfo(TCustomRichViewEdit* rve);
        int GetIconIndex(bool IsNew, TrvFileSaveFilter FileFormat, bool Modified);
        void FocusActiveEditor();
        void UpdateIcon(TSRichViewEdit* Editor);
        void __fastcall srvActionThumbnails1Executed(TObject* Sender);
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
