summaryrefslogtreecommitdiff
path: root/docview
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 15:15:06 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 15:15:06 +0200
commitd7c91eb3c135f90679a4b68e3a0d6861c2192251 (patch)
tree089e3150a4053843d8c0f67c33414fa2e68875ee /docview
parent23867b7f559108dbdc33fff51cb7afbe777b001e (diff)
downloadfpGUI-d7c91eb3c135f90679a4b68e3a0d6861c2192251.tar.xz
docview: new option to expand TOC tree view when files are opened.
Diffstat (limited to 'docview')
-rw-r--r--docview/src/frm_configuration.pas19
-rw-r--r--docview/src/frm_main.pas10
2 files changed, 19 insertions, 10 deletions
diff --git a/docview/src/frm_configuration.pas b/docview/src/frm_configuration.pas
index e69226fb..454febca 100644
--- a/docview/src/frm_configuration.pas
+++ b/docview/src/frm_configuration.pas
@@ -34,6 +34,7 @@ type
btnSearchDirDelete: TfpgButton;
chkEscapeIPFSymbols: TfpgCheckBox;
chkStartupHelp: TfpgCheckBox;
+ chkOpenTOC: TfpgCheckBox;
{@VFD_HEAD_END: ConfigurationForm}
procedure btnNormalFontClicked(Sender: TObject);
procedure btnFixedFontClicked(Sender: TObject);
@@ -145,6 +146,7 @@ begin
lbSearchDirs.Items.Assign(Settings.SearchDirectories);
chkEscapeIPFSymbols.Checked := Settings.IPFTopicSaveAsEscaped;
chkStartupHelp.Checked := Settings.StartupHelp;
+ chkOpenTOC.Checked := Settings.OpenWithExpandedContents;
// Fonts & Color
edtNormalFont.Text := Settings.NormalFont.FontDesc;
edtFixedFont.Text := Settings.FixedFont.FontDesc;
@@ -157,6 +159,7 @@ begin
Settings.SearchDirectories.Assign(lbSearchDirs.Items);
Settings.IPFTopicSaveAsEscaped := chkEscapeIPFSymbols.Checked;
Settings.StartupHelp := chkStartupHelp.Checked;
+ Settings.OpenWithExpandedContents := chkOpenTOC.Checked;
// Fonts & Color
Settings.NormalFont.Free;
Settings.NormalFont := fpgGetFont(edtNormalFont.Text);
@@ -175,7 +178,7 @@ begin
{%region 'Auto-generated GUI code' -fold}
{@VFD_BODY_BEGIN: ConfigurationForm}
Name := 'ConfigurationForm';
- SetPosition(310, 157, 515, 439);
+ SetPosition(402, 189, 515, 439);
WindowTitle := 'Configuration';
Hint := '';
WindowPosition := wpOneThirdDown;
@@ -421,7 +424,7 @@ begin
with chkStartupHelp do
begin
Name := 'chkStartupHelp';
- SetPosition(12, 264, 480, 20);
+ SetPosition(12, 268, 480, 20);
Anchors := [anLeft,anRight,anTop];
Checked := True;
FontDesc := '#Label1';
@@ -430,6 +433,18 @@ begin
Text := 'Show DocView help at startup if no files opened';
end;
+ chkOpenTOC := TfpgCheckBox.Create(tsGeneral);
+ with chkOpenTOC do
+ begin
+ Name := 'chkOpenTOC';
+ SetPosition(12, 292, 476, 20);
+ Anchors := [anLeft,anRight,anTop];
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 9;
+ Text := 'Open files with contents expanded';
+ end;
+
{@VFD_BODY_END: ConfigurationForm}
{%endregion}
end;
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas
index ae89331b..6f95a590 100644
--- a/docview/src/frm_main.pas
+++ b/docview/src/frm_main.pas
@@ -1377,13 +1377,7 @@ begin
if Settings.OpenWithExpandedContents then
begin
LogEvent(LogStartup, ' Expand all contents' );
- tvContents.RootNode.Expand;
- node := tvContents.RootNode.Next;
- while node <> nil do
- begin
- node.Expand;
- node := tvContents.RootNode.Next;
- end;
+ tvContents.FullExpand;
end
else
begin
@@ -2321,7 +2315,7 @@ begin
begin
Name := 'miHelp';
SetPosition(292, 168, 132, 20);
- AddMenuItem('Help using DocView', 'F1', @miHelpUsingDocView);
+ AddMenuItem('Help using DocView', '', @miHelpUsingDocView);
AddMenuItem('Command line parameters', '', @miHelpCmdLineParams);
AddMenuItem('-', '', nil);
AddMenuItem('Show help file header info', '', @miDebugHeader);