diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-24 15:33:14 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-24 15:33:14 +0200 |
commit | 4eec9a313b028c137563a0239b22b7e7ad945b38 (patch) | |
tree | d900575e055799774f4c3d68b6c7f077d0ebe5c2 /docview | |
parent | d5961565ddd037a54a3e0dc7a3694c24e66a097f (diff) | |
download | fpGUI-4eec9a313b028c137563a0239b22b7e7ad945b38.tar.xz |
docview: TOC tree view how has popup menu with Expand/Collapse All options.
Diffstat (limited to 'docview')
-rw-r--r-- | docview/src/frm_main.pas | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 6f95a590..cff84d9e 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -58,6 +58,7 @@ type miFile: TfpgPopupMenu; miSettings: TfpgPopupMenu; miBookmarks: TfpgPopupMenu; + miView: TfpgPopupMenu; miHelp: TfpgPopupMenu; miDebug: TfpgPopupMenu; ToolBar: TfpgBevel; @@ -108,6 +109,8 @@ type procedure miFileOpenSpecialClicked(Sender: TObject); procedure miFileCloseClicked(Sender: TObject); procedure miConfigureClicked(Sender: TObject); + procedure miViewExpandAllClicked(Sender: TObject); + procedure miViewCollapseAllClicked(Sender: TObject); procedure miHelpProdInfoClicked(Sender: TObject); procedure miHelpAboutFPGui(Sender: TObject); procedure miHelpCmdLineParams(Sender: TObject); @@ -426,6 +429,16 @@ begin ShowConfigForm; end; +procedure TMainForm.miViewExpandAllClicked(Sender: TObject); +begin + tvContents.FullExpand; +end; + +procedure TMainForm.miViewCollapseAllClicked(Sender: TObject); +begin + tvContents.FullCollapse; +end; + procedure TMainForm.miHelpProdInfoClicked(Sender: TObject); var s: TfpgString; @@ -2310,6 +2323,15 @@ begin AddMenuItem('Show', '', nil); end; + miView := TfpgPopupMenu.Create(self); + with miView do + begin + Name := 'miView'; + SetPosition(292, 216, 132, 20); + AddMenuItem('Expand All', '', @miViewExpandAllClicked); + AddMenuItem('Collapse All', '', @miViewCollapseAllClicked); + end; + miHelp := TfpgPopupMenu.Create(self); with miHelp do begin @@ -2506,6 +2528,8 @@ begin MainMenu.AddMenuItem('&Debug', nil).SubMenu := miDebug; FFileOpenRecent.SubMenu := miOpenRecentMenu; + tvContents.PopupMenu := miView; + // correct default visible tabsheet PageControl1.ActivePageIndex := 0; end; |