//--------------------------------------------------------------------------- #ifndef mainfrmH #define mainfrmH //--------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include "swdisprtfchap.h" #include #include #include //#include #include #include //#include #include #include #include #include #include #include "TextPanel.h" #include "ModTabPanel.h" class RTFDisp : public SWDisplay { SWDispRTF *edit; public: RTFDisp(SWDispRTF *iedit) { edit = iedit; } RTFDisp() {} char Display(SWModule &imodule) { edit->Display(imodule); } }; /* class HREFDisp : public SWDisplay { THTML *edit; public: HREFDisp(THTML *iedit) { edit = iedit; } HREFDisp() {} char Display(SWModule &imodule) { edit->RequestDoc((char *)imodule); } }; */ class DispExternal : public SWDisplay { public: DispExternal() {} char Display(SWModule &imodule) { SHELLEXECUTEINFO info; info.cbSize = sizeof(SHELLEXECUTEINFO); info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME; info.hwnd = GetFocus(); info.lpVerb = "open"; info.lpFile = (const char *)imodule; info.lpParameters = NULL; info.lpDirectory = NULL; info.nShow = 0; // info.lpClass = ".html"; ShellExecuteEx(&info); // ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL); } }; class ModState { public: ModState(TPageControl *ipc, TTabSheet *iap, SWKey ikey) { pc = ipc; ap = iap; key = ikey; } ModState(); TPageControl *pc; TTabSheet* ap; SWKey key; }; //--------------------------------------------------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components TPanel *pnlTextCom; TSplitter *Splitter2; TPanel *pnlText; TPanel *pnlComment; TSplitter *Splitter1; TPanel *pnlDict; TPageControl *PageControl2; TStatusBar *StatusBar1; TPageControl *PageControl3; TPanel *pnlDictHeader; TLabel *Label1; TRichEdit *DictKeyEdit; TMainMenu *MainMenu1; TMenuItem *Search1; TMenuItem *NewSearchWindow1; TMenuItem *Help1; TMenuItem *About1; TPopupMenu *PopupMenu2; TMenuItem *DictionaryLookup1; TMenuItem *File1; TMenuItem *SaveLayout1; TMenuItem *Exit1; TMenuItem *N1; TDdeServerItem *Search; TDdeServerItem *Lookup; TDdeServerConv *Bible; TPopupMenu *PopupMenu1; TMenuItem *MenuItem1; TMenuItem *Copy1; TMenuItem *CopyasBGreekTransliteration1; TMenuItem *Copy2; TMenuItem *Edit1; TMenuItem *Copy3; TPopupMenu *BookmarkPopup; TMenuItem *AddBookmark1; TMenuItem *N2; TMenuItem *EditBookmarks1; TMenuItem *Options1; TCoolBar *CoolBar1; TImageList *ImageList1; TImage *BackBtnImage; TImage *SearchBtnImage; TToolBar *ToolBar2; TToolButton *ToolButton3; TToolButton *ToolButton4; TPanel *pnlSpeed; TPanel *Panel1; TComboBox *cbBook; TEdit *CHBox; TUpDown *UpDown1; TEdit *VSBox; TUpDown *UpDown2; TSpeedButton *btnLookup; TToolBar *ToolBar1; TImageList *ImageList2; TImage *BookmarkBtnImage; TSpeedButton *Bookmarkbtn; TPopupMenu *PopupMenu3; TMenuItem *MenuItem2; TMenuItem *MenuItem3; TMenuItem *N3; TMenuItem *EditEntry1; TMenuItem *DeleteEntry1; TMenuItem *LinktoVerse1; TUpDown *UpDown3; TComboBox *freeHandLookup; void __fastcall PageControl1Change(TObject *Sender); void __fastcall btnLookupClick(TObject *Sender); void __fastcall PageControl2Change(TObject *Sender); void __fastcall DictKeyEditChange(TObject *Sender); void __fastcall PageControl3Change(TObject *Sender); void __fastcall NewSearchWindow1Click(TObject *Sender); void __fastcall Exit1Click(TObject *Sender); void __fastcall About1Click(TObject *Sender); void __fastcall DictionaryLookup1Click(TObject *Sender); void __fastcall SaveLayout1Click(TObject *Sender); void __fastcall LookupPokeData(TObject *Sender); void __fastcall SearchPokeData(TObject *Sender); void __fastcall UpDown3Click(TObject *Sender, TUDBtnType Button); void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button); void __fastcall BackbtnClick(TObject *Sender); void __fastcall Button1Click(TObject *Sender); void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender); void __fastcall Copy1Click(TObject *Sender); void __fastcall AddBookmark1Click(TObject *Sender); void __fastcall BookmarkItemClick(TObject *Sender); void __fastcall BookmarkbtnClick(TObject *Sender); void __fastcall EditBookmarks1Click(TObject *Sender); void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); void __fastcall Options1Click(TObject *Sender); void __fastcall cbBookChange(TObject *Sender); void __fastcall FormCreate(TObject *Sender); void __fastcall DisplayHint(TObject* Sender) ; void __fastcall PopupMenuPopup(TObject *Sender); void __fastcall createVerseList(TObject *Sender); void __fastcall freeHandLookupKeyPress(TObject *Sender, char &Key); void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); void __fastcall EditEntry1Click(TObject *Sender); void __fastcall DeleteEntry1Click(TObject *Sender); void __fastcall LinktoVerse1Click(TObject *Sender); private: // User declarations list displays; // so we can delete each display we create list modstates; vector ctrlstates; bool logmodstate; bool freshdict; char CreateTextPane(SWModule *mod, char *font = 0); char CreateCommentPane(SWModule *mod); char CreateLDPane(SWModule *mod); void PushState(); void BackState(); void ForwardState(); void BuildRTFHeader(char *buf, char *font, int max); void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree); public: // User declarations TModTabPanel *textTabs; VerseKey DefaultVSKey; SWKey DefaultStrKey; SWMgr *mainmgr; SWConfig *layoutconf; SWConfig *optionsconf; __fastcall TForm1(TComponent* Owner); __fastcall ~TForm1(); // virtual void __fastcall CreateWnd(); void RefreshActiveSheet(TPageControl *ts); void TextKeyChanged(); // updates dependents on TextKeyChanged void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree); void RestoreState(ModState *state); ListKey tmpVerseList; String tmpVerseListCaption; }; //--------------------------------------------------------------------------- extern TForm1 *Form1; //--------------------------------------------------------------------------- #endif