diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-24 13:03:54 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-24 13:03:54 +0200 |
commit | 4db3daa455aa2832fe7d78347b5e18456f45ee84 (patch) | |
tree | 702b91948a1b7ee395ec00ca57ed0112489f1000 /docview/src | |
parent | 282caf56404b932447e75f0322ff01c8f21c44ec (diff) | |
download | fpGUI-4db3daa455aa2832fe7d78347b5e18456f45ee84.tar.xz |
docview: adds support for opening additional help files.
This new menu option will not close previous help files aready open.
Diffstat (limited to 'docview/src')
-rw-r--r-- | docview/src/frm_main.pas | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 8b4698d1..814556ef 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -92,6 +92,7 @@ type DisplayedIndex: TStringList; // duplicate of index listbox, for fast case insensitive searching CurrentTopic: TTopic; // so we can get easy access to current topic viewed CurrentHistoryIndex: integer; + OpenAdditionalFile: boolean; procedure btnBackHistClick(Sender: TObject); procedure btnFwdHistClick(Sender: TObject); @@ -103,6 +104,7 @@ type procedure MainFormDestroy(Sender: TObject); procedure miFileQuitClicked(Sender: TObject); procedure miFileOpenClicked(Sender: TObject); + procedure miFileOpenAdditionalFileClicked(Sender: TObject); procedure miFileOpenSpecialClicked(Sender: TObject); procedure miFileCloseClicked(Sender: TObject); procedure miConfigureClicked(Sender: TObject); @@ -375,14 +377,23 @@ end; procedure TMainForm.miFileOpenClicked(Sender: TObject); begin + OpenAdditionalFile := False; FileOpen; end; +procedure TMainForm.miFileOpenAdditionalFileClicked(Sender: TObject); +begin + OpenAdditionalFile := True; + FileOpen; + OpenAdditionalFile := False; +end; + procedure TMainForm.miFileOpenSpecialClicked(Sender: TObject); var s: TfpgString; begin - if fpgInputQuery('Open Special...', 'Enter environment variable to open', s) then + OpenAdditionalFile := False; + if fpgInputQuery('Open Special...', 'Enter Environment Variable or Directory Path to open', s) then begin if s <> '' then OpenFile(s, '', True); @@ -1176,7 +1187,8 @@ begin // Now that we have successfully loaded the new help file(s) // close the existing one. - CloseFile; + if not OpenAdditionalFile then + CloseFile; AssignList(tmpHelpFiles, CurrentOpenFiles ); @@ -1771,6 +1783,7 @@ begin DisplayedIndex := TStringList.Create; CurrentHistoryIndex := -1; FHistorySelection := False; + OpenAdditionalFile := False; { TODO -oGraeme : Make Debug a menu option } Debug := False; @@ -2260,6 +2273,7 @@ begin Name := 'miFile'; SetPosition(292, 96, 132, 20); AddMenuItem('Open...', '', @miFileOpenClicked); + AddMenuItem('Open additional file...', '', @miFileOpenAdditionalFileClicked); AddMenuItem('Open Special...', '', @miFileOpenSpecialClicked); AddMenuItem('Save current Topic to IPF...', '', @miFileSaveTopicAsIPF); AddMenuItem('Close', '', @miFileCloseClicked); |