summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-04-06 17:07:04 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-04-06 17:07:04 +0200
commite87b941b37c07ffa72367e3acafe84fa2cc80928 (patch)
tree7aff5a48a38f4bd198454327d779b700ad5d2a88
parente41645ceebe725ce3f47ab7fce462097b2d37e08 (diff)
downloadfpGUI-e87b941b37c07ffa72367e3acafe84fa2cc80928.tar.xz
Docview: new debug item to dump the INF dictionary to file.
-rw-r--r--docview/src/frm_main.pas22
1 files changed, 22 insertions, 0 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas
index c7d0cb69..b6e8a747 100644
--- a/docview/src/frm_main.pas
+++ b/docview/src/frm_main.pas
@@ -135,6 +135,7 @@ type
procedure miToolsFindByResourceID(Sender: TObject);
procedure miToolsFindTopifByName(Sender: TObject);
procedure miTopicPropertiesClicked(Sender: TObject);
+ procedure miDumpDictionaryClicked(Sender: TObject);
procedure miFileSaveTopicAsIPF(Sender: TObject);
procedure OnMRUMenuItemClick(Sender: TObject);
procedure btnShowIndex(Sender: TObject);
@@ -714,6 +715,26 @@ begin
end;
End;
+procedure TMainForm.miDumpDictionaryClicked(Sender: TObject);
+var
+ i: integer;
+ j: integer;
+ f: THelpFile;
+ sl: TStringList;
+begin
+ for i := 0 to CurrentOpenFiles.Count-1 do
+ begin
+ f := THelpFile(CurrentOpenFiles[i]);
+ sl := TStringList.Create;
+ for j := 0 to f.DictionaryCount-1 do
+ begin
+ sl.Add('"' + f.DictionaryWords[j] + '"');
+ end;
+ sl.SaveToFile(GetTempDir + fpgExtractFileName(f.Filename) + '.dictionary');
+ end;
+ sl.Free;
+end;
+
procedure TMainForm.miFileSaveTopicAsIPF(Sender: TObject);
var
F: TextFile;
@@ -3014,6 +3035,7 @@ begin
miDebugHexInfo := AddMenuItem('Toggle hex INF values in contents', '', @miDebugHex);
AddMenuItem('View source of RichView component', '', @ViewSourceMIOnClick);
AddMenuItem('Current topic properties', '', @miTopicPropertiesClicked);
+ AddMenuItem('Dump dictionary to file in temp directory', '', @miDumpDictionaryClicked);
end;
miHelp := TfpgPopupMenu.Create(self);