diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-25 16:43:00 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-25 16:43:00 +0100 |
commit | 907f2193692b7167e6570ea90f9fbfee4260ca13 (patch) | |
tree | 50f491cc5c4098b238ba308c3b2de1cfeaee291a /docview | |
parent | 4331749d924fe50be3b33e9fc5a2ccd98ef3cacf (diff) | |
download | fpGUI-907f2193692b7167e6570ea90f9fbfee4260ca13.tar.xz |
docview: extended "File Info" output to include font encoding information.
Diffstat (limited to 'docview')
-rw-r--r-- | docview/src/HelpFile.pas | 1 | ||||
-rw-r--r-- | docview/src/frm_main.pas | 17 |
2 files changed, 13 insertions, 5 deletions
diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index c013412c..6e1a40d6 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -130,6 +130,7 @@ type property Title: string read _Title; property Topics[ Index: longint ]: TTopic read GetTopic; property TopicList: TList read _Topics; + property FontTable: TList read _FontTable; property TopicCount: longint read GetTopicCount; property StringResourceIDCount: integer read GetStringResourceIDCount; property NumericResourceIDCount: integer read GetNumericResourceIDCount; diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 17507f51..4c13be14 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -148,7 +148,7 @@ type procedure miHelpAboutFPGui(Sender: TObject); procedure miHelpCmdLineParams(Sender: TObject); procedure miHelpUsingDocView(Sender: TObject); - procedure miDebugHeader(Sender: TObject); + procedure miShowFileInfoClicked(Sender: TObject); procedure miDebugHex(Sender: TObject); procedure miToolsFindByResourceID(Sender: TObject); procedure miToolsFindTopifByName(Sender: TObject); @@ -732,11 +732,12 @@ begin OpenFile(OWN_HELP_MARKER, '', True); end; -procedure TMainForm.miDebugHeader(Sender: TObject); +procedure TMainForm.miShowFileInfoClicked(Sender: TObject); var f: THelpFile; - i: integer; + i, j: integer; sl: TStringList; + pFontSpec: pTHelpFontSpec; begin RichView.Clear; sl := TStringList.Create; @@ -750,7 +751,13 @@ begin Add('<b><u>Filename:</u></b> <blue>' + f.Filename + '</blue>'); Add('<b>Title:</b> ' + f.Title); Add('<b>File size:</b> ' + IntToStr(fpgFileSize(f.Filename)) + ' bytes'); - Add('<b>INF/HLP file version</b> ' + f.FormatVersion); + Add('<b>INF/HLP file version:</b> ' + f.FormatVersion); + Add('<b>Font table:</b> '); + for j := 0 to f.FontTable.Count-1 do + begin + pFontSpec := f.FontTable[j]; + Add(Format(' %s (%d x %d), codepage: %d', [pFontSpec^.FaceName, pFontSpec^.Width, pFontSpec^.Height, pFontSpec^.Codepage])); + end; Add('<b>Dictionary count:</b> ' + IntToStr(f.DictionaryCount)); Add('<b>Topic count:</b> ' + IntToStr(f.TopicCount)); Add('<b>Index count:</b> ' + IntToStr(f.Index.Count)); @@ -3232,7 +3239,7 @@ begin begin Name := 'miTools'; SetPosition(428, 96, 120, 20); - AddMenuItem('Show file info', '', @miDebugHeader); + AddMenuItem('Show file info', '', @miShowFileInfoClicked); AddMenuItem('Find topic by resource ID', '', @miToolsFindByResourceID); AddMenuItem('Find topic by resource name', '', @miToolsFindTopifByName); miDebugHexInfo := AddMenuItem('Toggle hex INF values in contents', '', @miDebugHex); |