From 4f9325c106a1ac0246b57adee2fc1a5453bb0b8c Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 27 Nov 2009 17:07:19 +0200 Subject: Add missing unit for docview. --- docview/src/frm_configuration.pas | 412 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 412 insertions(+) create mode 100644 docview/src/frm_configuration.pas (limited to 'docview/src') diff --git a/docview/src/frm_configuration.pas b/docview/src/frm_configuration.pas new file mode 100644 index 00000000..2e19939b --- /dev/null +++ b/docview/src/frm_configuration.pas @@ -0,0 +1,412 @@ +unit frm_configuration; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_tab, fpg_button, + fpg_label, fpg_edit, fpg_panel, fpg_combobox, fpg_listbox, fpg_checkbox; + +type + + TConfigurationForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: ConfigurationForm} + PageControl1: TfpgPageControl; + btnSave: TfpgButton; + btnCancel: TfpgButton; + tsGeneral: TfpgTabSheet; + tsFontsColor: TfpgTabSheet; + Label1: TfpgLabel; + edtNormalFont: TfpgEdit; + btnNormalFont: TfpgButton; + Label2: TfpgLabel; + edtFixedFont: TfpgEdit; + btnFixedFont: TfpgButton; + btnHelp: TfpgButton; + Panel1: TfpgPanel; + cbIndexStyle: TfpgComboBox; + lblIndexStyle: TfpgLabel; + lblSearchDirs: TfpgLabel; + btnSearchDirAdd: TfpgButton; + lbSearchDirs: TfpgListBox; + btnSearchDirDelete: TfpgButton; + chkEscapeIPFSymbols: TfpgCheckBox; + {@VFD_HEAD_END: ConfigurationForm} + procedure btnNormalFontClicked(Sender: TObject); + procedure btnFixedFontClicked(Sender: TObject); + procedure ConfigurationFormShow(Sender: TObject); + procedure btnHelpClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabSheet); + procedure btnCancelClick(Sender: TObject); + procedure btnSaveClick(Sender: TObject); + procedure btnSearchDirAddClicked(Sender: TObject); + procedure SettingsToGui; + procedure GuiToSettings; + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +procedure ShowConfigForm; + +implementation + +uses + fpg_dialogs, SettingsUnit, dvConstants; + +procedure ShowConfigForm; +var + frm: TConfigurationForm; +begin + frm := TConfigurationForm.Create(nil); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + +{@VFD_NEWFORM_IMPL} + +procedure TConfigurationForm.btnNormalFontClicked(Sender: TObject); +var + f: TfpgString; +begin + f := edtNormalFont.Text; + if SelectFontDialog(f) then + edtNormalFont.Text := f; +end; + +procedure TConfigurationForm.btnFixedFontClicked(Sender: TObject); +var + f: TfpgString; +begin + f := edtFixedFont.Text; + if SelectFontDialog(f) then + edtFixedFont.Text := f; +end; + +procedure TConfigurationForm.ConfigurationFormShow(Sender: TObject); +begin + SettingsToGui; + PageControl1.ActivePage := tsGeneral; + // programatically seting a tab does not fire OnChange event, so we do it mantually + PageControl1Change(self, tsGeneral); +end; + +procedure TConfigurationForm.btnHelpClick(Sender: TObject); +begin + ShowMessage(IntToStr(btnHelp.HelpContext)); +end; + +procedure TConfigurationForm.PageControl1Change(Sender: TObject; + NewActiveSheet: TfpgTabSheet); +begin + if NewActiveSheet = tsGeneral then + begin + btnHelp.HelpContext := hcConfigGeneralTab; + end + else if NewActiveSheet = tsFontsColor then + begin + btnHelp.HelpContext := hcConfigFontsColorTab; + end; +end; + +procedure TConfigurationForm.btnCancelClick(Sender: TObject); +begin + ModalResult := mrCancel; +end; + +procedure TConfigurationForm.btnSaveClick(Sender: TObject); +begin + GuiToSettings; + SaveSettings; + ModalResult := mrOK; +end; + +procedure TConfigurationForm.btnSearchDirAddClicked(Sender: TObject); +var + s: TfpgString; +begin + s := SelectDirDialog(''); + if s <> '' then + lbSearchDirs.Items.Add(s); +end; + +procedure TConfigurationForm.SettingsToGui; +begin + // General + cbIndexStyle.FocusItem := Ord(Settings.IndexStyle); + lbSearchDirs.Items.Assign(Settings.SearchDirectories); + chkEscapeIPFSymbols.Checked := Settings.IPFTopicSaveAsEscaped; + // Fonts & Color + edtNormalFont.Text := Settings.NormalFont.FontDesc; + edtFixedFont.Text := Settings.FixedFont.FontDesc; +end; + +procedure TConfigurationForm.GuiToSettings; +begin + // General + Settings.IndexStyle := TIndexStyle(cbIndexStyle.FocusItem); + Settings.SearchDirectories.Assign(lbSearchDirs.Items); + Settings.IPFTopicSaveAsEscaped := chkEscapeIPFSymbols.Checked; + // Fonts & Color + Settings.NormalFont.Free; + Settings.NormalFont := fpgGetFont(edtNormalFont.Text); + Settings.FixedFont.Free; + Settings.FixedFont := fpgGetFont(edtFixedFont.Text); +end; + +constructor TConfigurationForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + OnShow := @ConfigurationFormShow; +end; + +procedure TConfigurationForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: ConfigurationForm} + Name := 'ConfigurationForm'; + SetPosition(310, 157, 515, 439); + WindowTitle := 'Configuration'; + WindowPosition := wpOneThirdDown; + + PageControl1 := TfpgPageControl.Create(self); + with PageControl1 do + begin + Name := 'PageControl1'; + SetPosition(4, 4, 506, 388); + Anchors := [anLeft,anRight,anTop,anBottom]; + ActivePageIndex := 0; + TabOrder := 0; + OnChange := @PageControl1Change; + end; + + btnSave := TfpgButton.Create(self); + with btnSave do + begin + Name := 'btnSave'; + SetPosition(344, 408, 80, 24); + Text := 'Save'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnSaveClick; + end; + + btnCancel := TfpgButton.Create(self); + with btnCancel do + begin + Name := 'btnCancel'; + SetPosition(428, 408, 80, 24); + Text := 'Cancel'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @btnCancelClick; + end; + + tsGeneral := TfpgTabSheet.Create(PageControl1); + with tsGeneral do + begin + Name := 'tsGeneral'; + SetPosition(3, 24, 500, 361); + Text := 'General'; + end; + + tsFontsColor := TfpgTabSheet.Create(PageControl1); + with tsFontsColor do + begin + Name := 'tsFontsColor'; + SetPosition(3, 24, 500, 361); + Text := 'Fonts & Color'; + end; + + Label1 := TfpgLabel.Create(tsFontsColor); + with Label1 do + begin + Name := 'Label1'; + SetPosition(12, 20, 108, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Normal Font'; + end; + + edtNormalFont := TfpgEdit.Create(tsFontsColor); + with edtNormalFont do + begin + Name := 'edtNormalFont'; + SetPosition(124, 16, 248, 24); + Anchors := [anLeft,anRight,anTop]; + TabOrder := 1; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnNormalFont := TfpgButton.Create(tsFontsColor); + with btnNormalFont do + begin + Name := 'btnNormalFont'; + SetPosition(384, 16, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Select...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @btnNormalFontClicked; + end; + + Label2 := TfpgLabel.Create(tsFontsColor); + with Label2 do + begin + Name := 'Label2'; + SetPosition(12, 52, 104, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Fixed Font'; + end; + + edtFixedFont := TfpgEdit.Create(tsFontsColor); + with edtFixedFont do + begin + Name := 'edtFixedFont'; + SetPosition(124, 48, 248, 24); + Anchors := [anLeft,anRight,anTop]; + TabOrder := 4; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnFixedFont := TfpgButton.Create(tsFontsColor); + with btnFixedFont do + begin + Name := 'btnFixedFont'; + SetPosition(384, 48, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Select...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + OnClick :=@btnFixedFontClicked; + end; + + btnHelp := TfpgButton.Create(self); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(468, 356, 28, 24); + Anchors := [anRight,anBottom]; + Text := '?'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 6; + HelpType := htContext; + OnClick := @btnHelpClick; + end; + + Panel1 := TfpgPanel.Create(tsFontsColor); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(128, 116, 204, 28); + FontDesc := '#Label1'; + Style := bsLowered; + Text := 'Panel'; + end; + + cbIndexStyle := TfpgComboBox.Create(tsGeneral); + with cbIndexStyle do + begin + Name := 'cbIndexStyle'; + SetPosition(12, 32, 160, 22); + FontDesc := '#List'; + Items.Add('Alphabetical'); + Items.Add('FileOnly'); + Items.Add('Full'); + TabOrder := 0; + end; + + lblIndexStyle := TfpgLabel.Create(tsGeneral); + with lblIndexStyle do + begin + Name := 'lblIndexStyle'; + SetPosition(12, 12, 212, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Index style'; + end; + + lblSearchDirs := TfpgLabel.Create(tsGeneral); + with lblSearchDirs do + begin + Name := 'lblSearchDirs'; + SetPosition(12, 64, 216, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Search directories'; + end; + + btnSearchDirAdd := TfpgButton.Create(tsGeneral); + with btnSearchDirAdd do + begin + Name := 'btnSearchDirAdd'; + SetPosition(408, 84, 80, 24); + Text := 'Add...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick :=@btnSearchDirAddClicked; + end; + + lbSearchDirs := TfpgListBox.Create(tsGeneral); + with lbSearchDirs do + begin + Name := 'lbSearchDirs'; + SetPosition(12, 84, 388, 148); + FontDesc := '#List'; + HotTrack := False; + PopupFrame := False; + TabOrder := 5; + Items.Duplicates := dupIgnore; + end; + + btnSearchDirDelete := TfpgButton.Create(tsGeneral); + with btnSearchDirDelete do + begin + Name := 'btnSearchDirDelete'; + SetPosition(408, 116, 80, 24); + Text := 'Remove...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + end; + + chkEscapeIPFSymbols := TfpgCheckBox.Create(tsGeneral); + with chkEscapeIPFSymbols do + begin + Name := 'chkEscapeIPFSymbols'; + SetPosition(12, 244, 480, 20); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#Label1'; + TabOrder := 6; + Text := 'Escape symbols when saving topics as IPF text'; + end; + + {@VFD_BODY_END: ConfigurationForm} + {%endregion} +end; + + +end. -- cgit v1.2.3-70-g09d2 From a883ff792fe84a1e9d19f5c2f8ab587cc55155c3 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 27 Nov 2009 17:12:11 +0200 Subject: Minor change to project file make DocView compile. --- docview/src/docview.lpr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docview/src') diff --git a/docview/src/docview.lpr b/docview/src/docview.lpr index 105414dc..87087b59 100644 --- a/docview/src/docview.lpr +++ b/docview/src/docview.lpr @@ -9,7 +9,7 @@ uses Classes, fpg_main, frm_main, IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, TextSearchQuery, nvUtilities, nvNullObjects, HelpFile, SearchUnit, - fpg_cmdlineparams, fpgui_toolkit, customstyle, IPFFileFormatUnit, HelpWindowDimensions, + fpg_cmdlineparams, IPFFileFormatUnit, HelpWindowDimensions, NewViewConstantsUnit, SettingsUnit, RichTextStyleUnit, CanvasFontManager, ACLStringUtility, RichTextDocumentUnit, RichTextView, RichTextLayoutUnit, RichTextDisplayUnit, dvconstants, dvHelpers, frm_configuration; -- cgit v1.2.3-70-g09d2 From 556c3ed5bc71972cd54198b1a6811832fee59716 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 29 Dec 2009 18:04:25 +0200 Subject: Implemented a toolbar and Prev/Next Topic button behaviour. * stepping through Contents tree is now possible. --- docview/src/frm_main.pas | 176 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 11 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index b5120378..9f968bb7 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -59,6 +59,14 @@ type miBookmarks: TfpgPopupMenu; miHelp: TfpgPopupMenu; miDebug: TfpgPopupMenu; + ToolBar: TfpgBevel; + btnOpen: TfpgButton; + btnPanel: TfpgButton; + btnBack: TfpgButton; + btnFwd: TfpgButton; + btnPrev: TfpgButton; + btnNext: TfpgButton; + btnHelp: TfpgButton; {@VFD_HEAD_END: MainForm} miOpenRecentMenu: TfpgPopupMenu; Files: TList; // current open help files. @@ -78,6 +86,8 @@ type DisplayedIndex: TStringList; // duplicate of index listbox, for fast case insensitive searching CurrentTopic: TTopic; // so we can get easy access to current topic viewed + procedure btnPrevClick(Sender: TObject); + procedure btnNextClick(Sender: TObject); procedure RichViewClickLink(Sender: TRichTextView; Link: string); procedure IndexSearchEditKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); procedure MainFormShow(Sender: TObject); @@ -134,6 +144,7 @@ type procedure SetStatus(const AText: TfpgString); function TranslateEnvironmentVar(AFilenames: TfpgString): TfpgString; procedure RefreshFontSubstitutions; + procedure DisplaySelectedContentsTopic; procedure DisplaySelectedIndexTopic; procedure ProcessCommandLineParams; procedure ShowParamHelp; @@ -193,6 +204,26 @@ begin end end; +procedure TMainForm.btnPrevClick(Sender: TObject); +begin + if CurrentOpenFiles.Count > 0 then + begin + tvContents.GotoNextNodeUp; + tvContents.SetFocus; + DisplaySelectedContentsTopic; + end; +end; + +procedure TMainForm.btnNextClick(Sender: TObject); +begin + if CurrentOpenFiles.Count > 0 then + begin + tvContents.GotoNextNodeDown; + tvContents.SetFocus; + DisplaySelectedContentsTopic; + end; +end; + procedure TMainForm.RichViewClickLink(Sender: TRichTextView; Link: string); var LinkIndex: integer; @@ -1631,7 +1662,7 @@ begin with bvlBody do begin Name := 'bvlBody'; - SetPosition(0, 25, 653, 340); + SetPosition(0, 55, 653, 310); Anchors := [anLeft,anRight,anTop,anBottom]; Shape := bsSpacer; end; @@ -1640,7 +1671,7 @@ begin with PageControl1 do begin Name := 'PageControl1'; - SetPosition(0, 12, 260, 316); + SetPosition(0, 16, 260, 276); ActivePageIndex := 4; TabOrder := 0; Align := alLeft; @@ -1959,7 +1990,7 @@ begin with tsHistory do begin Name := 'tsHistory'; - SetPosition(3, 24, 254, 289); + SetPosition(3, 24, 254, 249); Text := 'History'; end; @@ -1967,7 +1998,7 @@ begin with lbHistory do begin Name := 'lbHistory'; - SetPosition(4, 8, 242, 276); + SetPosition(4, 8, 242, 236); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; HotTrack := False; @@ -1979,7 +2010,7 @@ begin with Splitter1 do begin Name := 'Splitter1'; - SetPosition(265, 4, 8, 284); + SetPosition(265, 120, 8, 168); Align := alLeft; end; @@ -2005,7 +2036,7 @@ begin with miFile do begin Name := 'miFile'; - SetPosition(292, 28, 132, 20); + SetPosition(292, 96, 132, 20); AddMenuItem('Open...', '', @miFileOpenClicked); AddMenuItem('Save current Topic to IPF...', '', @miFileSaveTopicAsIPF); AddMenuItem('Close', '', @miFileCloseClicked); @@ -2019,7 +2050,7 @@ begin with miSettings do begin Name := 'miSettings'; - SetPosition(292, 76, 132, 20); + SetPosition(292, 120, 132, 20); AddMenuItem('Options...', '', @miConfigureClicked); end; @@ -2027,7 +2058,7 @@ begin with miBookmarks do begin Name := 'miBookmarks'; - SetPosition(292, 100, 132, 20); + SetPosition(292, 144, 132, 20); AddMenuItem('Add..', '', nil); AddMenuItem('Show', '', nil); end; @@ -2036,7 +2067,7 @@ begin with miHelp do begin Name := 'miHelp'; - SetPosition(292, 124, 132, 20); + SetPosition(292, 168, 132, 20); AddMenuItem('Contents...', '', nil); AddMenuItem('Help using help', '', nil); AddMenuItem('-', '', nil); @@ -2048,11 +2079,124 @@ begin with miDebug do begin Name := 'miDebug'; - SetPosition(292, 148, 132, 20); + SetPosition(292, 192, 132, 20); AddMenuItem('Debug: Header', '', @miDebugHeader); AddMenuItem('Toggle Hex INF Values in Contents', '', @miDebugHex); end; + ToolBar := TfpgBevel.Create(self); + with ToolBar do + begin + Name := 'ToolBar'; + SetPosition(0, 25, 654, 28); + Anchors := [anLeft,anRight,anTop]; + Style := bsLowered; + Shape := bsBottomLine; + end; + + btnOpen := TfpgButton.Create(ToolBar); + with btnOpen do + begin + Name := 'btnOpen'; + SetPosition(2, 1, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := 0; + ImageName := 'stdimg.open'; + TabOrder := 0; + OnClick := @miFileOpenClicked; + end; + + btnPanel := TfpgButton.Create(ToolBar); + with btnPanel do + begin + Name := 'btnPanel'; + SetPosition(36, 1, 32, 24); + Text := 'pnl'; + AllowAllUp := True; + Embedded := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := ''; + ImageName := ''; + TabOrder := 1; + Enabled := False; + end; + + btnBack := TfpgButton.Create(ToolBar); + with btnBack do + begin + Name := 'btnBack'; + SetPosition(74, 1, 32, 24); + Text := '<'; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + Enabled := False; + end; + + btnFwd := TfpgButton.Create(ToolBar); + with btnFwd do + begin + Name := 'btnFwd'; + SetPosition(108, 1, 32, 24); + Text := '>'; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + Enabled := False; + end; + + btnPrev := TfpgButton.Create(ToolBar); + with btnPrev do + begin + Name := 'btnPrev'; + SetPosition(146, 1, 32, 24); + Text := 'prev'; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick := @btnPrevClick; + end; + + btnNext := TfpgButton.Create(ToolBar); + with btnNext do + begin + Name := 'btnNext'; + SetPosition(180, 1, 32, 24); + Text := 'next'; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + OnClick :=@btnNextClick; + end; + + btnHelp := TfpgButton.Create(ToolBar); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(218, 1, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.help'; + ImageSpacing := 0; + TabOrder := 6; + OnClick := @miHelpProdInfoClicked; + end; + {@VFD_BODY_END: MainForm} {%endregion} @@ -2091,6 +2235,16 @@ begin end; end; +procedure TMainForm.DisplaySelectedContentsTopic; +var + Topic: TTopic; +Begin + if tvContents.Selection = nil then + Exit; + Topic := TTopic(tvContents.Selection.Data); + DisplayTopic(Topic); +End; + procedure TMainForm.DisplaySelectedIndexTopic; var Topic: TTopic; @@ -2098,7 +2252,7 @@ Begin if lbIndex.FocusItem = -1 then exit; Topic := DisplayedIndex.Objects[ lbIndex.FocusItem ] as TTopic; - DisplayTopic( Topic ); + DisplayTopic(Topic); end; procedure TMainForm.ProcessCommandLineParams; -- cgit v1.2.3-70-g09d2 From ae49231e2b1d7f076bbfe0ad034e82c926ed46dd Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 30 Dec 2009 01:01:39 +0200 Subject: History navigation. * Tracks history of topics viewed. * Allows Back and Forward navigation in history. * Icons for remaining toolbar buttons. --- docview/src/arrows.inc | 380 +++++++++++++++++++++++++++++++++++++++++++++++ docview/src/docview.lpi | 6 +- docview/src/frm_main.pas | 180 ++++++++++++++++++---- 3 files changed, 540 insertions(+), 26 deletions(-) create mode 100644 docview/src/arrows.inc (limited to 'docview/src') diff --git a/docview/src/arrows.inc b/docview/src/arrows.inc new file mode 100644 index 00000000..bfe510a5 --- /dev/null +++ b/docview/src/arrows.inc @@ -0,0 +1,380 @@ + +Const + usr_arrow_up : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,227,197,133,218,175,131,219,174,131, + 222,176,132,223,177,132,224,177,132,223,177,131,221,175, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,228,198, 30,189,108, 16,190,102, 18, + 196,106, 19,201,109, 20,203,110, 19,199,108,132,223,177, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,228,198, 41,193,116, 16,191,102, 18, + 198,107, 20,204,111, 21,208,113, 19,202,109,132,224,177, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,227,196, 56,195,124, 16,189,101, 17, + 195,105, 18,199,107, 19,200,108, 18,198,107,132,223,176, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,225,194, 74,199,135, 20,186,102, 16, + 189,101, 16,191,103, 17,192,103, 16,191,102,131,220,175, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, + 58, 4,115, 58, 5,120, 61,162,222,192, 69,193,130, 42,187,114, 14, + 182, 96, 14,184, 97, 14,184, 98, 14,183, 97,130,217,172, 5,121, 62, + 4,115, 58, 4,115, 58, 4,115, 58, 4,118, 58,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 40,138, 88,160,215, + 187,165,219,191,163,219,190,160,220,189, 65,187,125, 58,188,121, 25, + 179,101, 12,176, 92, 12,176, 92, 12,175, 92,129,213,170,128,211,169, + 128,209,168,121,203,160, 31,133, 79, 3,114, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,148, + 100,152,213,181, 81,184,132, 65,181,121, 59,181,119, 52,180,115, 44, + 179,110, 17,170, 92, 10,168, 87, 9,167, 87, 9,166, 86, 23,168, 94, + 114,200,156, 41,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, + 60, 73,161,116,141,209,173, 64,177,119, 52,173,111, 45,172,107, 39, + 171,104, 28,168, 97, 9,161, 83, 7,160, 81, 14,161, 86,106,195,149, + 57,154,104, 3,117, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, + 85, 4,118, 58, 89,172,130,125,202,162, 49,172,108, 40,168,102, 33, + 165, 97, 26,162, 92, 15,158, 84, 8,155, 79, 95,190,141, 72,167,118, + 4,118, 59, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0,118, 59, 3,118, 60,101,182,140,105,194,148, 35,166, 99, 28, + 163, 94, 22,160, 89, 14,157, 84, 80,184,131, 85,178,130, 3,117, 59, + 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,114, 62, 9,118, 62,112,191,150, 82,185,133, 24, + 161, 90, 17,158, 86, 67,179,121,100,187,142, 8,120, 61, 7,118, 59, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 5,113, 59, 16,124, 69,118,195,156, 58, + 175,114, 53,173,111,109,193,150, 15,123, 68, 4,116, 56,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 24,129, 75,117, + 197,156,114,197,154, 23,131, 75, 5,117, 60,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,118, 59, 34, + 139, 85, 34,141, 85, 3,117, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 118, 60, 4,118, 60, 0, 85, 85,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_down : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 109, 54, 5,112, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 57, 35, + 142, 87, 36,149, 90, 3,113, 57,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 22,130, 76,119, + 216,167,120,221,170, 24,137, 79, 5,117, 60,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 5,113, 59, 15,123, 68,114,209,161, 57, + 206,131, 59,211,134,117,221,169, 15,126, 69, 4,116, 56,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,114, 62, 9,119, 63,102,198,149, 72,204,137, 17, + 195,105, 19,200,108, 74,214,143,105,208,157, 9,122, 63, 7,118, 59, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0,118, 59, 5,119, 60, 94,186,138, 85,201,142, 14,185, 98, 16, + 189,101, 17,193,103, 17,194,104, 87,211,148, 89,193,139, 4,118, 60, + 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, + 85, 4,118, 58, 89,175,131,129,211,169, 19,177, 96, 13,179, 94, 14, + 183, 97, 14,185, 98, 15,186, 99, 15,185, 99,100,208,153, 74,175,123, + 4,119, 60, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, + 60, 73,160,116,144,212,177, 71,186,128, 52,183,116, 15,173, 93, 12, + 175, 92, 12,177, 93, 12,178, 94, 12,177, 93, 18,177, 96,108,204,156, + 57,157,105, 3,118, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,149, + 100,154,213,182, 86,186,134, 70,182,125, 63,182,121, 51,180,114, 24, + 173, 96, 10,169, 88, 10,170, 88, 10,169, 88, 10,168, 87, 23,170, 95, + 114,201,156, 40,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 41,138, 88,163,216, + 189,168,219,193,164,218,190,160,216,187, 65,178,121, 58,178,116, 49, + 176,111, 34,170,101, 9,162, 84, 8,161, 83,126,205,165,126,204,164, + 126,203,163,119,198,158, 29,131, 79, 3,114, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, + 58, 4,115, 58, 5,119, 60,162,217,189, 69,179,123, 60,176,116, 50, + 172,109, 42,168,103, 26,162, 92, 6,154, 78,126,202,163, 5,119, 60, + 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,164,218,190, 71,180,124, 62,176,118, 52, + 173,111, 44,169,105, 35,165, 98, 17,158, 86,126,202,163, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,218,191, 73,181,125, 64,177,119, 54, + 173,112, 45,169,105, 36,166, 99, 24,161, 91,126,202,163, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, + 173,112, 46,170,106, 37,166,100, 26,162, 92,127,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, + 173,112, 46,170,106, 36,166, 99, 26,162, 92,127,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,218,191,160,216,187,156,214,184,150, + 212,180,146,210,177,141,208,174,136,206,170,128,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,117, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_left : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 0,102, 51, 3,110, 55,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 89, 45, 27,129, 76, 6,116, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 2,101, 51, 37, + 139, 87,121,206,163, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 54,152,102,117, + 208,161,129,216,172, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,102, 51, 3,114, 58, 69,166,117,111,206,157, 28, + 185,105,128,219,173, 9,125, 65, 4,115, 58, 4,115, 58, 4,115, 58, + 4,115, 58, 4,115, 58, 4,115, 59,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 3, 88, 44, 7,118, 60, 83,176,129, 99,198,148, 20,177, 97, 14, + 182, 96,128,221,174,132,225,178,134,230,181,133,229,180,132,225,178, + 131,221,175,130,217,173, 8,118, 60, 0,102, 51,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,109, + 55, 13,121, 66, 97,185,140, 83,187,134, 12,165, 87, 11,172, 90, 13, + 180, 95, 15,187,100, 17,193,104, 18,198,107, 18,197,106, 17,193,103, + 15,186, 99,127,215,170, 8,117, 60, 0,102, 51,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 0,128, 0, 4,116, 58, 21,130, + 73,108,192,149, 68,179,122, 6,154, 78, 7,160, 82, 9,167, 87, 11, + 174, 91, 13,180, 95, 14,184, 98, 15,187,100, 15,187, 99, 14,184, 98, + 13,179, 95,126,212,168, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,119, 59, 32,138, 84,113,196, + 154, 54,173,112, 13,157, 83, 16,158, 85, 15,158, 84, 15,164, 87, 11, + 167, 87, 10,171, 89, 11,174, 91, 12,176, 92, 12,176, 92, 11,174, 91, + 11,170, 90,132,211,170, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,117, 59, 32,136, 84,116,196, + 155, 62,177,117, 23,161, 90, 28,163, 94, 33,165, 97, 37,167,100, 43, + 171,105, 44,175,107, 40,176,106, 35,175,103, 35,175,103, 41,175,107, + 54,178,114,149,213,180, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,116, 58, 22,128, + 73,116,195,154, 85,186,135, 35,166, 99, 40,168,102, 45,170,106, 50, + 172,109, 54,173,112, 58,175,115, 61,176,117, 63,177,118, 65,178,120, + 65,178,120,154,214,184, 9,118, 62, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,114, + 57, 15,123, 68,108,188,148,107,195,150, 49,172,109, 52,173,111, 57, + 175,114, 62,177,118, 66,178,120, 68,179,122, 71,181,125, 73,181,126, + 74,182,127,159,216,187, 10,118, 63, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 5,117, 58, 8,119, 61, 99,182,139,127,203,164, 66,178,120, 65, + 178,120,157,215,185,161,217,188,163,218,190,164,218,191,166,219,192, + 166,219,192,166,219,192, 10,118, 63, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,118, 59, 4,116, 60, 85,170,126,142,209,175, 82, + 185,132,160,217,188, 11,123, 65, 4,115, 58, 4,115, 58, 4,115, 58, + 4,115, 58, 4,115, 58, 4,117, 59, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0,116, 70, 4,117, 59, 69,158,113,152, + 212,181,165,218,191, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 0,128, 0, 3,116, 58, 52, + 146, 98,159,214,186, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 5, + 117, 60, 37,136, 84, 7,117, 60, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 4,115, 57, 4,116, 58, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_right : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 2, + 82, 42,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 30, + 131, 78, 3, 93, 47,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,122, + 207,164, 41,141, 90, 2,102, 51,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,130, + 216,172,118,214,166, 58,159,107, 4,112, 56,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 57, 4,115, + 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 61,131, + 219,174, 31,198,113,114,222,167, 74,180,127, 4,116, 59,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163,126,203,163,126,203,164,127,207,166,129,212,169,130,216,172,131, + 220,175, 17,195,105, 26,204,115,105,223,163, 90,195,142, 9,119, 62, + 2, 86, 44,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163, 6,154, 78, 6,154, 78, 8,161, 82, 10,168, 87, 12,176, 92, 14, + 183, 97, 16,189,101, 17,193,103, 19,194,105, 89,211,149,103,201,152, + 15,125, 68, 4,110, 56,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163, 6,154, 78, 6,154, 78, 6,156, 79, 8,163, 84, 10,169, 88, 12, + 175, 92, 13,179, 94, 14,182, 96, 14,182, 96, 13,180, 95, 71,196,132, + 112,202,156, 22,131, 74, 3,119, 59, 0,128, 0,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,133,205, + 168, 7,154, 79, 6,154, 78, 6,154, 78, 6,156, 79, 8,161, 82, 9, + 165, 85, 12,170, 88, 18,174, 94, 21,175, 96, 22,173, 97, 19,170, 93, + 58,182,119,117,199,157, 34,139, 85, 4,118, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,151,213, + 181, 52,173,111, 40,168,102, 33,165, 97, 33,165, 97, 39,167,102, 45, + 171,107, 46,173,107, 43,173,106, 39,171,104, 34,169,100, 28,165, 95, + 65,178,120,120,198,159, 34,138, 86, 3,117, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,156,215, + 185, 65,178,120, 65,178,120, 65,178,120, 63,177,118, 61,176,117, 58, + 175,115, 54,173,112, 50,172,109, 45,170,106, 40,168,102, 88,188,137, + 120,197,157, 24,129, 75, 4,115, 58,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,160,217, + 188, 74,182,127, 74,182,127, 73,181,126, 71,181,125, 68,179,122, 66, + 178,120, 62,177,118, 58,175,115, 54,174,112,111,197,152,113,191,151, + 16,124, 69, 3,116, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,166,219, + 192,166,219,192,166,219,192,166,219,192,164,218,191,163,218,190,161, + 217,188, 69,180,123, 71,180,124,130,204,166,103,183,141, 9,118, 61, + 5,114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,117, 58, 4,115, + 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 60,165, + 218,191, 87,187,135,144,210,176, 91,173,131, 3,116, 59, 0,118, 55, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169, + 220,193,155,213,183, 74,161,116, 4,116, 59, 0,106, 64,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,164, + 217,190, 57,149,102, 3,118, 60, 0, 85, 85,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 41, + 137, 88, 5,117, 59,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,117, 59, 3, + 114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index 2996f4cf..49ed38aa 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -32,7 +32,7 @@ - + @@ -171,6 +171,10 @@ + + + + diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 9f968bb7..0735eb47 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -72,6 +72,7 @@ type Files: TList; // current open help files. Debug: boolean; FFileOpenRecent: TfpgMenuItem; + FHistorySelection: Boolean; LoadingFilenameList: TStringList; LoadingFileIndex: integer; @@ -85,7 +86,10 @@ type ContentsLoaded: boolean; 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; + procedure btnBackHistClick(Sender: TObject); + procedure btnFwdHistClick(Sender: TObject); procedure btnPrevClick(Sender: TObject); procedure btnNextClick(Sender: TObject); procedure RichViewClickLink(Sender: TRichTextView; Link: string); @@ -114,9 +118,12 @@ type procedure lbIndexDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure lbIndexKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); procedure lbSearchResultsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbHistoryDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbHistoryKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); procedure btnSearchClicked(Sender: TObject); procedure IndexSearchEditOnChange(Sender: TObject); procedure DisplaySelectedSearchResultTopic; + procedure NavigateToHistoryIndex(AIndex: integer); procedure UpdateLocationPanel; procedure EnableControls; procedure ClearAllWordSequences; @@ -147,6 +154,7 @@ type procedure DisplaySelectedContentsTopic; procedure DisplaySelectedIndexTopic; procedure ProcessCommandLineParams; + procedure SaveNavigatePoint; procedure ShowParamHelp; function FindTopicForLink( Link: THelpLink ): TTopic; function FindTopicByResourceID( ID: word ): TTopic; @@ -187,6 +195,8 @@ const cCreatedBy = 'Created by Graeme Geldenhuys'; cVersion = 'Version 0.7 (alpha)'; +{$I arrows.inc} + {@VFD_NEWFORM_IMPL} procedure TMainForm.MainFormException(Sender: TObject; E: Exception); @@ -204,6 +214,26 @@ begin end end; +procedure TMainForm.btnBackHistClick(Sender: TObject); +begin + if CurrentHistoryIndex > 0 then + begin + NavigateToHistoryIndex(CurrentHistoryIndex - 1); + //lbHistory.FocusItem := CurrentHistoryIndex - 1; + //DisplayTopic(TTopic(lbHistory.Items.Objects[lbHistory.FocusItem])); + end; +end; + +procedure TMainForm.btnFwdHistClick(Sender: TObject); +begin + if CurrentHistoryIndex < lbHistory.Items.Count-1 then + begin + NavigateToHistoryIndex(CurrentHistoryIndex + 1); + //lbHistory.FocusItem := CurrentHistoryIndex + 1; + //DisplayTopic(TTopic(lbHistory.Items.Objects[lbHistory.FocusItem])); + end; +end; + procedure TMainForm.btnPrevClick(Sender: TObject); begin if CurrentOpenFiles.Count > 0 then @@ -602,10 +632,12 @@ procedure TMainForm.PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabS begin if NewActiveSheet = tsIndex then begin - if not IndexLoaded then - LoadIndex; - IndexSearchEdit.SetFocus; - end; + if not IndexLoaded then + LoadIndex; + IndexSearchEdit.SetFocus; + end + else if NewActiveSheet = tsHistory then + lbHistory.FocusItem := CurrentHistoryIndex; end; procedure TMainForm.tvContentsDoubleClick(Sender: TObject; AButton: TMouseButton; @@ -633,6 +665,34 @@ begin DisplaySelectedSearchResultTopic; end; +procedure TMainForm.lbHistoryDoubleClick(Sender: TObject; + AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); +begin + try + FHistorySelection := True; + DisplayTopic(nil); + CurrentHistoryIndex := lbHistory.FocusItem; + finally + FHistorySelection := False; + end; +end; + +procedure TMainForm.lbHistoryKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + try + FHistorySelection := True; + DisplayTopic(nil); + CurrentHistoryIndex := lbHistory.FocusItem; + finally + FHistorySelection := False; + end; + end +end; + procedure TMainForm.btnSearchClicked(Sender: TObject); begin DoSearch; @@ -684,6 +744,18 @@ begin DisplayTopic( Topic ); end; +procedure TMainForm.NavigateToHistoryIndex(AIndex: integer); +begin + try + FHistorySelection := True; + CurrentHistoryIndex := AIndex; + lbHistory.FocusItem := AIndex; + DisplayTopic(TTopic(lbHistory.Items.Objects[AIndex])); + finally + FHistorySelection := False; + end; +end; + procedure TMainForm.UpdateLocationPanel; var i: integer; @@ -1034,9 +1106,8 @@ begin Result := true; lbSearchResults.Items.Clear; - { TODO : page history support } -// PageHistory.Clear; -// CurrentHistoryIndex := -1; + lbHistory.Items.Clear; + CurrentHistoryIndex := -1; // Now that we have successfully loaded the new help file(s) // close the existing one. @@ -1085,9 +1156,8 @@ begin if DisplayFirstTopic then begin LogEvent(LogStartup, 'Display first topic' ); - { TODO -oGraeme : Improved Display Topic method } -// DisplaySelectedContentsTopic; - DisplayTopic(nil); + DisplaySelectedContentsTopic; +// DisplayTopic(nil); end; LogEvent(LogStartup, 'OpenFiles complete' ); @@ -1518,6 +1588,16 @@ Begin Topic := TTopic(lbSearchResults.Items.Objects[lbSearchResults.FocusItem]); ProfileEvent('Got Topic from Search Results listbox'); end; + 4: begin // History tab + if lbHistory.FocusItem = -1 then + begin + ShowMessage('You must select a history item first by clicking it.'); + Exit; //==> + end + else + Topic := TTopic(lbHistory.Items.Objects[lbHistory.FocusItem]); + ProfileEvent('Got Topic from History listbox'); + end; end; end // case.. else @@ -1526,7 +1606,7 @@ Begin if Topic = nil then raise Exception.Create('Unable to locate the Topic'); - CurrentTopic:= Topic; + CurrentTopic := Topic; RichView.Clear; ImageIndices := TList.Create; @@ -1569,6 +1649,7 @@ Begin tvContents.Selection := tvContents.RootNode.FindSubNode(CurrentTopic, True); tvContents.Invalidate; + SaveNavigatePoint; UpdateLocationPanel; end; @@ -1605,8 +1686,28 @@ begin AllFilesWordSequences := TList.Create; CurrentOpenFiles := TList.Create; DisplayedIndex := TStringList.Create; + CurrentHistoryIndex := -1; + FHistorySelection := False; { TODO -oGraeme : Make Debug a menu option } Debug := False; + + // load toolbar images + fpgImages.AddMaskedBMP( + 'dv.arrowleft', @usr_arrow_left, + sizeof(usr_arrow_left), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowright', @usr_arrow_right, + sizeof(usr_arrow_right), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowup', @usr_arrow_up, + sizeof(usr_arrow_up), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowdown', @usr_arrow_down, + sizeof(usr_arrow_down), 0, 0); + end; destructor TMainForm.Destroy; @@ -1627,6 +1728,7 @@ begin Name := 'MainForm'; SetPosition(602, 274, 654, 386); WindowTitle := 'fpGUI Documentation Viewer'; + ShowHint := True; WindowPosition := wpUser; OnCloseQuery := @MainFormCloseQuery; @@ -2004,6 +2106,8 @@ begin HotTrack := False; PopupFrame := False; TabOrder := 0; + OnDoubleClick := @lbHistoryDoubleClick; + OnKeyPress := @lbHistoryKeyPress; end; Splitter1 := TfpgSplitter.Create(bvlBody); @@ -2102,7 +2206,7 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; - Hint := ''; + Hint := 'Open a new help file.'; ImageMargin := 0; ImageName := 'stdimg.open'; TabOrder := 0; @@ -2119,7 +2223,7 @@ begin Embedded := True; FontDesc := '#Label1'; GroupIndex := 1; - Hint := ''; + Hint := 'Display or hide tabs'; ImageName := ''; TabOrder := 1; Enabled := False; @@ -2133,10 +2237,11 @@ begin Text := '<'; Embedded := True; FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; + Hint := 'Previous history item.'; + ImageMargin := 0; + ImageName := 'dv.arrowleft'; TabOrder := 2; - Enabled := False; + OnClick := @btnBackHistClick; end; btnFwd := TfpgButton.Create(ToolBar); @@ -2147,10 +2252,11 @@ begin Text := '>'; Embedded := True; FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; + Hint := 'Next history item.'; + ImageMargin := 0; + ImageName := 'dv.arrowright'; TabOrder := 3; - Enabled := False; + OnClick := @btnFwdHistClick; end; btnPrev := TfpgButton.Create(ToolBar); @@ -2161,8 +2267,9 @@ begin Text := 'prev'; Embedded := True; FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; + Hint := 'Previous Topic.'; + ImageMargin := 0; + ImageName := 'dv.arrowup'; TabOrder := 4; OnClick := @btnPrevClick; end; @@ -2175,8 +2282,9 @@ begin Text := 'next'; Embedded := True; FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; + Hint := 'Next Topic.'; + ImageMargin := 0; + ImageName := 'dv.arrowdown'; TabOrder := 5; OnClick :=@btnNextClick; end; @@ -2189,7 +2297,7 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; - Hint := ''; + Hint := 'Display Product Information.'; ImageMargin := -1; ImageName := 'stdimg.help'; ImageSpacing := 0; @@ -2200,6 +2308,12 @@ begin {@VFD_BODY_END: MainForm} {%endregion} + // remove toolbar button text + btnBack.Text := ''; + btnFwd.Text := ''; + btnNext.Text := ''; + btnPrev.Text := ''; + miOpenRecentMenu := TfpgPopupMenu.Create(nil); with miOpenRecentMenu do begin @@ -2248,7 +2362,7 @@ End; procedure TMainForm.DisplaySelectedIndexTopic; var Topic: TTopic; -Begin +begin if lbIndex.FocusItem = -1 then exit; Topic := DisplayedIndex.Objects[ lbIndex.FocusItem ] as TTopic; @@ -2306,6 +2420,22 @@ begin end; end; +procedure TMainForm.SaveNavigatePoint; +begin + // if we selected an item from history listbox, don't record that save point + if FHistorySelection then + Exit; + + // delete rest of history + while CurrentHistoryIndex < lbHistory.Items.Count-1 do + lbHistory.Items.Delete(CurrentHistoryIndex + 1); + + if CurrentTopic <> nil then + lbHistory.Items.AddObject(CurrentTopic.Title, CurrentTopic); + + inc(CurrentHistoryIndex); +end; + procedure TMainForm.ShowParamHelp; const le = LineEnding; -- cgit v1.2.3-70-g09d2 From a80bbdbcd494e6259827ac1504d381f2d89af888 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 11 Feb 2010 15:34:42 +0200 Subject: Fix compiler warning about type range issues. --- docview/src/HelpTopic.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docview/src') diff --git a/docview/src/HelpTopic.pas b/docview/src/HelpTopic.pas index ea32080b..13dbbc63 100644 --- a/docview/src/HelpTopic.pas +++ b/docview/src/HelpTopic.pas @@ -560,7 +560,7 @@ var BitmapOffset: longword; BitmapFlags: uint8; Link: TInternalHelpLink; - LinkTopicIndex: uint16; + LinkTopicIndex: integer; begin LinkTopicIndex := -1; while true do @@ -629,7 +629,7 @@ var SubEscapeCode: uint8; BitmapOffset: longword; BitmapFlags: uint8; - LinkTopicIndex: uint16; + LinkTopicIndex: integer; begin LinkTopicIndex := -1; while true do -- cgit v1.2.3-70-g09d2 From d03fb89621f4d79824f1c394fc85a0ed008c32b5 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 23 Feb 2010 11:47:09 +0200 Subject: Fix closing of open files. * Files field variable was not used, so removed it * On closing file, it used the Files field variable instead of the CurrentOpenFiles field variable. * Cleared the Search and History tab controls when closing files. --- docview/src/frm_main.pas | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 0735eb47..ae584596 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -69,7 +69,7 @@ type btnHelp: TfpgButton; {@VFD_HEAD_END: MainForm} miOpenRecentMenu: TfpgPopupMenu; - Files: TList; // current open help files. +// Files: TList; // current open help files. Debug: boolean; FFileOpenRecent: TfpgMenuItem; FHistorySelection: Boolean; @@ -1128,8 +1128,6 @@ begin // Now load the various parts of the file(s) // into the user interface - tvContents.RootNode.Clear; - DisplayFiles( tmpHelpFiles, FirstContentsNode ); //if CmdLineParameters.getHelpManagerFlag then @@ -1182,6 +1180,11 @@ var begin tvContents.Selection := nil; tvContents.RootNode.Clear; + + lbSearchResults.Items.Clear; + edSearchText.Clear; + lbHistory.Items.Clear; + RichView.Clear(ADestroying); if not ADestroying then begin @@ -1192,9 +1195,9 @@ begin // First save notes. It's important we do this first // since we scan all notes each time to find the ones // belonging to this file. - for FileIndex := 0 to Files.Count - 1 do + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do begin - lHelpFile := THelpFile(Files[FileIndex]); + lHelpFile := THelpFile(CurrentOpenFiles[FileIndex]); SaveNotes( lHelpFile ); end; @@ -1202,13 +1205,13 @@ begin ClearAllWordSequences; // Now destroy help files - for FileIndex := 0 to Files.Count - 1 do + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do begin - lHelpFile := THelpFile(Files[FileIndex]); + lHelpFile := THelpFile(CurrentOpenFiles[FileIndex]); lHelpFile.Free; end; - Files.Clear; + CurrentOpenFiles.Clear; ClearNotes; end; @@ -1682,7 +1685,7 @@ begin fpgApplication.OnException := @MainFormException; OnShow := @MainFormShow; OnDestroy :=@MainFormDestroy; - Files := TList.Create; +// Files := TList.Create; AllFilesWordSequences := TList.Create; CurrentOpenFiles := TList.Create; DisplayedIndex := TStringList.Create; @@ -1715,7 +1718,7 @@ begin CurrentTopic := nil; // it was a reference only FFileOpenRecent := nil; // it was a reference only miOpenRecentMenu.Free; - DestroyListAndObjects(Files); +// DestroyListAndObjects(Files); DestroyListAndObjects(AllFilesWordSequences); DestroyListAndObjects(CurrentOpenFiles); inherited Destroy; -- cgit v1.2.3-70-g09d2 From 60defb75191abaa22d799c6def465aa14fd2c8da Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 23 Feb 2010 11:48:45 +0200 Subject: New Help menu item to show Command Line Parameter help. * When showing this help, it closes open INF files. --- docview/src/frm_main.pas | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index ae584596..642f4765 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -102,6 +102,7 @@ type procedure miConfigureClicked(Sender: TObject); procedure miHelpProdInfoClicked(Sender: TObject); procedure miHelpAboutFPGui(Sender: TObject); + procedure miHelpCmdLineParams(Sender: TObject); procedure miDebugHeader(Sender: TObject); procedure miDebugHex(Sender: TObject); procedure miFileSaveTopicAsIPF(Sender: TObject); @@ -155,7 +156,7 @@ type procedure DisplaySelectedIndexTopic; procedure ProcessCommandLineParams; procedure SaveNavigatePoint; - procedure ShowParamHelp; + procedure ShowCmdLineParamHelp; function FindTopicForLink( Link: THelpLink ): TTopic; function FindTopicByResourceID( ID: word ): TTopic; function FindTopicByName(const AName: string): TTopic; @@ -382,6 +383,12 @@ begin TfpgMessageDialog.AboutFPGui; end; +procedure TMainForm.miHelpCmdLineParams(Sender: TObject); +begin + CloseFile(False); + ShowCmdLineParamHelp; +end; + procedure TMainForm.miDebugHeader(Sender: TObject); var f: THelpFile; @@ -2177,8 +2184,9 @@ begin SetPosition(292, 168, 132, 20); AddMenuItem('Contents...', '', nil); AddMenuItem('Help using help', '', nil); + AddMenuItem('Command line parameters', '', @miHelpCmdLineParams); AddMenuItem('-', '', nil); - AddMenuItem('About fpGUI Toolkit', '', @miHelpAboutFPGui); + AddMenuItem('About fpGUI Toolkit...', '', @miHelpAboutFPGui); AddMenuItem('Product Information...', '', @miHelpProdInfoClicked); end; @@ -2381,7 +2389,7 @@ begin begin if gCommandLineParams.IsParam('h') then begin - ShowParamHelp; + ShowCmdLineParamHelp; Exit; //==> end else if gCommandLineParams.IsParam('debuglog') then @@ -2439,7 +2447,7 @@ begin inc(CurrentHistoryIndex); end; -procedure TMainForm.ShowParamHelp; +procedure TMainForm.ShowCmdLineParamHelp; const le = LineEnding; var @@ -2450,7 +2458,7 @@ begin + 'Supported command line parameters:' + le + le + '' + ' < Load the help file <' + le - + ' -h Show this help' + le + + ' -h Show this help' + le + ' -k < Search for keyword < in open help files' + le + ' -n < Open Topic with numeric ID equal to <' + le + ' -s < Open Topic with string ID equal to <' + le -- cgit v1.2.3-70-g09d2 From 24baeac6a59e795623b088b93476d80355d1ba72 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 23 Feb 2010 12:23:23 +0200 Subject: Docview: Fix treeview height issue under Windows. --- docview/src/frm_main.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 642f4765..7d84209a 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -1784,7 +1784,7 @@ begin begin Name := 'PageControl1'; SetPosition(0, 16, 260, 276); - ActivePageIndex := 4; + ActivePageIndex := 0; TabOrder := 0; Align := alLeft; OnChange := @PageControl1Change; @@ -1794,7 +1794,7 @@ begin with tsContents do begin Name := 'tsContents'; - SetPosition(3, 24, 254, 301); + SetPosition(3, 24, 254, 249); Text := 'Contents'; end; @@ -1802,7 +1802,7 @@ begin with tvContents do begin Name := 'tvContents'; - SetPosition(4, 32, 242, 264); + SetPosition(4, 32, 242, 212); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#Label1'; ScrollWheelDelta := 60; @@ -1830,7 +1830,7 @@ begin with tsIndex do begin Name := 'tsIndex'; - SetPosition(3, 24, 254, 301); + SetPosition(3, 24, 254, 249); Text := 'Index'; end; @@ -1852,7 +1852,7 @@ begin with lbIndex do begin Name := 'lbIndex'; - SetPosition(4, 32, 242, 264); + SetPosition(4, 32, 242, 212); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; HotTrack := False; -- cgit v1.2.3-70-g09d2 From 4290a12a7478707ab24b602faca78fe1ade8e817 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 23 Feb 2010 12:24:02 +0200 Subject: Add various checks for open files before doing processing. --- docview/src/frm_main.pas | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 7d84209a..ee7cd670 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -307,6 +307,9 @@ end; procedure TMainForm.IndexSearchEditKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); begin + if CurrentOpenFiles.Count = 0 then + Exit; + if (KeyCode = keyEnter) or (KeyCode = keyPEnter) then begin Consumed := True; @@ -331,7 +334,6 @@ begin LoadSettings; CreateMRUMenuItems; ProcessCommandLineParams; - end; procedure TMainForm.MainFormDestroy(Sender: TObject); @@ -602,12 +604,18 @@ end; procedure TMainForm.tvContentsChange(Sender: TObject); begin + if CurrentOpenFiles.Count = 0 then + Exit; + DisplayTopic(nil); end; procedure TMainForm.edSearchTextKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); begin + if CurrentOpenFiles.Count = 0 then + Exit; + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then begin Consumed := True; @@ -623,6 +631,9 @@ end; procedure TMainForm.lbSearchResultsKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); begin + if CurrentOpenFiles.Count = 0 then + Exit; + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then begin Consumed := True; @@ -650,6 +661,9 @@ end; procedure TMainForm.tvContentsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin + if CurrentOpenFiles.Count = 0 then + Exit; + if tvContents.Selection <> nil then DisplayTopic(nil); end; @@ -687,6 +701,9 @@ end; procedure TMainForm.lbHistoryKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); begin + if CurrentOpenFiles.Count = 0 then + Exit; + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then begin Consumed := True; @@ -817,6 +834,9 @@ var FileWordSequences: TList; Query: TTextSearchQuery; begin + if CurrentOpenFiles.Count = 0 then + Exit; + SearchText := Trim(edSearchText.Text); lbSearchResults.Items.Clear; @@ -1330,6 +1350,8 @@ var tmpIndex: TStringList; i: longint; begin + if CurrentOpenFiles.Count = 0 then + Exit; LogEvent(LogStartup, 'Create index' ); SetWaitCursor; LogEvent(LogStartup, ' Get/sort lists' ); @@ -1563,7 +1585,10 @@ var Topic: TTopic; HighlightWordSequences: TList; FileIndex: integer; -Begin +begin + if CurrentOpenFiles.Count = 0 then + Exit; + ProfileEvent('DisplayTopic >>>>'); if ATopic = nil then begin @@ -1717,7 +1742,6 @@ begin fpgImages.AddMaskedBMP( 'dv.arrowdown', @usr_arrow_down, sizeof(usr_arrow_down), 0, 0); - end; destructor TMainForm.Destroy; -- cgit v1.2.3-70-g09d2 From 748a3f6b0e4d1b65874284cdb363e57e28e7ddc6 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 8 Mar 2010 16:55:46 +0200 Subject: Updated the various programs and fpGUI library to use the new generate version file. The VERSION-GEN script generates a VERSION-FILE file which contans the version number of fpGUI. This is now used in DocView, UI Designer and other example applications too. --- docview/src/frm_main.pas | 2 +- examples/apps/docedit/frm_main.pas | 2 +- src/corelib/fpg_main.pas | 2 +- src/corelib/gdi/fpgui_toolkit.lpk | 1 + src/corelib/x11/fpgui_toolkit.lpk | 1 + src/gui/messagedialog.inc | 2 +- uidesigner/vfdmain.pas | 6 +++--- 7 files changed, 9 insertions(+), 7 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index ee7cd670..436b4b7c 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -194,7 +194,7 @@ uses const cLongName = 'fpGUI Documentation Viewer'; cCreatedBy = 'Created by Graeme Geldenhuys'; - cVersion = 'Version 0.7 (alpha)'; + cVersion = 'Version ' + FPGUI_VERSION; {$I arrows.inc} diff --git a/examples/apps/docedit/frm_main.pas b/examples/apps/docedit/frm_main.pas index 04ea3f59..8f3b7369 100644 --- a/examples/apps/docedit/frm_main.pas +++ b/examples/apps/docedit/frm_main.pas @@ -150,7 +150,7 @@ begin ShowMessage(cAppName + #10 + #10 + 'Written by Graeme Geldenhuys - 2007' - + #10 + 'Using the ' + fpGUIName + ' v' + fpGUIVersion + + #10 + 'Using the ' + fpGUIName + ' v' + fpGUI_Version ,'About'); end; diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index ba7a5e3b..eb9106dd 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -59,7 +59,7 @@ const cMessageQueueSize = 1024; // version and name constants - fpGUIVersion = '0.7'; + {$I VERSION-FILE} // this includes the auto generated: fpGUI_Version = xxx fpGUIName = 'fpGUI Toolkit'; const diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk index 58748828..2e7a5fda 100644 --- a/src/corelib/gdi/fpgui_toolkit.lpk +++ b/src/corelib/gdi/fpgui_toolkit.lpk @@ -8,6 +8,7 @@ + diff --git a/src/corelib/x11/fpgui_toolkit.lpk b/src/corelib/x11/fpgui_toolkit.lpk index d47e94e8..d6cc9ecf 100644 --- a/src/corelib/x11/fpgui_toolkit.lpk +++ b/src/corelib/x11/fpgui_toolkit.lpk @@ -7,6 +7,7 @@ + diff --git a/src/gui/messagedialog.inc b/src/gui/messagedialog.inc index 7a04371a..d40b5fca 100644 --- a/src/gui/messagedialog.inc +++ b/src/gui/messagedialog.inc @@ -371,7 +371,7 @@ begin dlg.DefaultButton := mbOK; dlg.Text := dlg.WindowTitle; dlg.InformativeText := LineEnding + LineEnding - + 'This program uses ' + fpGUIName + ' version ' + fpGUIVersion + '.' + + 'This program uses ' + fpGUIName + ' version ' + fpGUI_Version + '.' + LineEnding + LineEnding + fpGUIName + ' is intended for Open Source and Commercial applications. fpGUI' + ' uses the LGPL 2 license with a static linking exception - the same as the Free' diff --git a/uidesigner/vfdmain.pas b/uidesigner/vfdmain.pas index 06112ad6..7468a99f 100644 --- a/uidesigner/vfdmain.pas +++ b/uidesigner/vfdmain.pas @@ -24,6 +24,7 @@ interface uses Classes, SysUtils, + fpg_main, fpg_widget, fpg_dialogs, vfdprops, @@ -33,7 +34,7 @@ uses newformdesigner; const - program_version = '0.7 beta'; + program_version = FPGUI_VERSION; type @@ -84,8 +85,7 @@ implementation uses vfdformparser, fpg_iniutils, - fpg_utils, - fpg_main; + fpg_utils; var DefaultPasExt : String = '.pas'; -- cgit v1.2.3-70-g09d2 From 03299f62453025294633326c3b27bf4cca984417 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 9 Mar 2010 11:16:13 +0200 Subject: docview: Removed a compiler path not used. --- docview/src/docview.lpi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docview/src') diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index 49ed38aa..3e118f62 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -198,8 +198,7 @@ - + -- cgit v1.2.3-70-g09d2 From 904a739fc38028b39db2e27f71216ef7e5b81232 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 9 Mar 2010 11:16:53 +0200 Subject: docview: add compiler helper extrafpc.cfg file. This allows use to easily compile docview from the command line. --- docview/src/extrafpc.cfg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docview/src/extrafpc.cfg (limited to 'docview/src') diff --git a/docview/src/extrafpc.cfg b/docview/src/extrafpc.cfg new file mode 100644 index 00000000..b68bb1b4 --- /dev/null +++ b/docview/src/extrafpc.cfg @@ -0,0 +1,10 @@ +-Sa +-gl +-Xs +-l +-Fiunits/ +-Fu../components/richtext/ +-Fu../../lib/$fpctarget +-Fu. +-FUunits + -- cgit v1.2.3-70-g09d2 From 27564b913691dcf521d278e55ab23d9c3e60836c Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 9 Mar 2010 11:30:46 +0200 Subject: docview: add .gitignore in units directory for dir layout. --- docview/src/units/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 docview/src/units/.gitignore (limited to 'docview/src') diff --git a/docview/src/units/.gitignore b/docview/src/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/docview/src/units/.gitignore @@ -0,0 +1 @@ +* -- cgit v1.2.3-70-g09d2 From 858789d00c5d5ef376cad08b6dce4385a6f7699c Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 11 Mar 2010 09:56:30 +0200 Subject: fixes compilation for docview and fpc 2.5.1 Not sure when it became the case but it makes sense that var parameters must use the exact type and not a descendant class. This patch puts that into effect. --- docview/components/richtext/ACLStringUtility.pas | 2 +- docview/components/richtext/RichTextStyleUnit.pas | 2 +- docview/src/HelpFile.pas | 4 +-- docview/src/HelpTopic.pas | 30 +++++++++++------------ docview/src/SearchUnit.pas | 4 +-- docview/src/TextSearchQuery.pas | 2 +- docview/src/nvUtilities.pas | 6 ++--- 7 files changed, 25 insertions(+), 25 deletions(-) (limited to 'docview/src') diff --git a/docview/components/richtext/ACLStringUtility.pas b/docview/components/richtext/ACLStringUtility.pas index f60aeed0..5ddcb2b7 100644 --- a/docview/components/richtext/ACLStringUtility.pas +++ b/docview/components/richtext/ACLStringUtility.pas @@ -31,7 +31,7 @@ type TSerializableStringList = class(TObject) private - stringList: TStringList; + stringList: TStrings; public constructor Create; destructor Destroy; override; diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index ff70c0d0..64612b0e 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -158,7 +158,7 @@ var ParseIndex: longint; XSizeStr: string; YSizeStr: string; - tmpFontParts : TStringList; + tmpFontParts : TStrings; MarginSize: longint; ParsePoint: longint; diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index af4a2cb9..acba5b14 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -1151,9 +1151,9 @@ var H: longint; i: longint; pFontSpec: pTHelpFontSpec; - tmpSubstitutionItems : TStringList; + tmpSubstitutionItems : TStrings; tmpCounter : integer; - tmpDimensionParts : TStringList; + tmpDimensionParts : TStrings; s: string; PointSize: word; cp: integer; diff --git a/docview/src/HelpTopic.pas b/docview/src/HelpTopic.pas index 13dbbc63..e925dd38 100644 --- a/docview/src/HelpTopic.pas +++ b/docview/src/HelpTopic.pas @@ -559,7 +559,7 @@ var SubEscapeCode: uint8; BitmapOffset: longword; BitmapFlags: uint8; - Link: TInternalHelpLink; + Link: THelpLink;//TInternalHelpLink; LinkTopicIndex: integer; begin LinkTopicIndex := -1; @@ -605,10 +605,10 @@ begin // Don't make it a link if we didn't find a // overall link code, i.e. degrade gracefully. if LinkTopicIndex > -1 then - begin + begin if CreateLink( State.LinkIndex, Link, TInternalHelpLink ) then begin - Link.TopicIndex := LinkTopicIndex; + TInternalHelpLink(Link).TopicIndex := LinkTopicIndex; end; OutputString := GetBeginLink( State.LinkIndex ) @@ -838,9 +838,9 @@ var EscapeLen: uint8; EscapeCode: uint8; - Link: TInternalHelpLink; - FootnoteLink: TFootnoteHelpLink; - LinkByResourceID: THelpLinkByResourceID; + Link: THelpLink; //TInternalHelpLink; + FootnoteLink: THelpLink; //TFootnoteHelpLink; + LinkByResourceID: THelpLink; //THelpLinkByResourceID; Margin: integer; @@ -864,7 +864,7 @@ var ProgramPath: string; ProgramFilename: string; ProgramInfo : TSerializableStringList; - tmpProgramLinkParts : TStringList; + tmpProgramLinkParts : TStrings; OutputString: string; begin @@ -932,17 +932,17 @@ begin CheckForAutoURL( AText, State ); if CreateLink( State.LinkIndex, Link, TInternalHelpLink ) then begin - Link.TopicIndex := pUInt16( pData + 2 )^; + TInternalHelpLink(Link).TopicIndex := pUInt16( pData + 2 )^; if EscapeLen >= 6 then begin - GetExtraLinkData( Link, pData + 4 ); + GetExtraLinkData( TInternalHelpLink(Link), pData + 4 ); end; end; // If it's not an automatic link // then put code in to show it. - if not Link.Automatic then + if not TInternalHelpLink(Link).Automatic then begin OutputString := '' + GetBeginLink( State.LinkIndex ); @@ -956,8 +956,8 @@ begin CheckForAutoURL( AText, State ); if CreateLink( State.LinkIndex, FootnoteLink, TFootnoteHelpLink ) then begin - FootnoteLink.TopicIndex := pUInt16( pData + 2 )^; - State.FootnoteLink := FootnoteLink; + TFootnoteHelpLink(FootnoteLink).TopicIndex := pUInt16( pData + 2 )^; + State.FootnoteLink := TFootnoteHelpLink(FootnoteLink); end; OutputString := '' + GetBeginLink( State.LinkIndex ); @@ -970,11 +970,11 @@ begin CheckForAutoURL( AText, State ); if CreateLink( State.LinkIndex, LinkByResourceID, THelpLinkByResourceID ) then begin - LinkByResourceID.ResourceID := pUInt16( pData + 2 )^; + THelpLinkByResourceID(LinkByResourceID).ResourceID := pUInt16( pData + 2 )^; if EscapeLen >= 6 then begin - GetExtraLinkData( LinkByResourceID, pData + 4 ); + GetExtraLinkData( THelpLinkByResourceID(LinkByResourceID), pData + 4 ); end; end; @@ -2219,7 +2219,7 @@ var ProgramLink: string; ProgramPath: string; - tmpProgramLinkParts : TStringList; + tmpProgramLinkParts : TStrings; OutputString: string; begin diff --git a/docview/src/SearchUnit.pas b/docview/src/SearchUnit.pas index d8f9c6d6..f7a8eb8e 100644 --- a/docview/src/SearchUnit.pas +++ b/docview/src/SearchUnit.pas @@ -202,7 +202,7 @@ var TitleWordIndex: longint; WordRelevance: longint; TitleWordRelevance: longint; - tmpTitleWords : TStringList; + tmpTitleWords : TStrings; i : integer; begin tmpTitleWords := TStringList.Create; @@ -258,7 +258,7 @@ var IndexEntryWordIndex: longint; WordRelevance: longint; IndexEntryWordRelevance: longint; - tmpIndexWords : TStringList; + tmpIndexWords : TStrings; i : integer; begin tmpIndexWords := TStringList.Create; diff --git a/docview/src/TextSearchQuery.pas b/docview/src/TextSearchQuery.pas index 444b27f1..3a8037a2 100644 --- a/docview/src/TextSearchQuery.pas +++ b/docview/src/TextSearchQuery.pas @@ -66,7 +66,7 @@ var TermText: string; CombineMethod: TSearchTermCombineMethod; lTerm: TSearchTerm; - tmpTerms : TStringList; + tmpTerms : TStrings; i : integer; begin inherited Create; diff --git a/docview/src/nvUtilities.pas b/docview/src/nvUtilities.pas index aed9d392..8dc928a1 100644 --- a/docview/src/nvUtilities.pas +++ b/docview/src/nvUtilities.pas @@ -118,7 +118,7 @@ uses Procedure SetLogAspects(const aCommaSeparatedListOfAspectNames : String); Var - tmpAspects : TStringList; + tmpAspects : TStrings; i : Integer; Begin tmpAspects := TStringList.Create; @@ -322,7 +322,7 @@ var tmpRC: longint; tmpSearchResults: TSearchRec; tmpMask: String; - tmpFilterParts : TStringList; + tmpFilterParts : TStrings; tmpDirectory: String; i: integer; begin @@ -357,7 +357,7 @@ end; procedure ParseAndExpandFileNames(const aFileNameString: String; aResult: TStrings); var i: longint; - tmpFileNamesList: TStringList; + tmpFileNamesList: TStrings; tmpItem: String; tmpEnvironmentVarValue: string; begin -- cgit v1.2.3-70-g09d2 From b078d5b33d38c309b898f49a68bc76e922b11db0 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 7 May 2010 13:08:18 +0200 Subject: DocView: Added new Quit toolbar button. --- docview/src/docview.lpi | 3 --- docview/src/frm_main.pas | 67 +++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 55 insertions(+), 15 deletions(-) (limited to 'docview/src') diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index 3e118f62..a362ed8d 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -12,9 +12,6 @@ <UseAppBundle Value="False"/> </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 436b4b7c..0b35732e 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -67,6 +67,7 @@ type btnPrev: TfpgButton; btnNext: TfpgButton; btnHelp: TfpgButton; + btnQuit: TfpgButton; {@VFD_HEAD_END: MainForm} miOpenRecentMenu: TfpgPopupMenu; // Files: TList; // current open help files. @@ -1762,6 +1763,7 @@ begin Name := 'MainForm'; SetPosition(602, 274, 654, 386); WindowTitle := 'fpGUI Documentation Viewer'; + Hint := ''; ShowHint := True; WindowPosition := wpUser; OnCloseQuery := @MainFormCloseQuery; @@ -1772,6 +1774,7 @@ begin Name := 'bvlStatusBar'; SetPosition(0, 366, 653, 20); Anchors := [anLeft,anRight,anBottom]; + Hint := ''; Style := bsLowered; end; @@ -1781,6 +1784,7 @@ begin Name := 'ProgressBar'; SetPosition(501, 2, 150, 16); Anchors := [anRight,anBottom]; + Hint := ''; end; lblStatus := TfpgLabel.Create(bvlStatusBar); @@ -1800,6 +1804,7 @@ begin Name := 'bvlBody'; SetPosition(0, 55, 653, 310); Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; Shape := bsSpacer; end; @@ -1809,6 +1814,7 @@ begin Name := 'PageControl1'; SetPosition(0, 16, 260, 276); ActivePageIndex := 0; + Hint := ''; TabOrder := 0; Align := alLeft; OnChange := @PageControl1Change; @@ -1829,6 +1835,7 @@ begin SetPosition(4, 32, 242, 212); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#Label1'; + Hint := ''; ScrollWheelDelta := 60; ShowImages := True; TabOrder := 0; @@ -1879,6 +1886,7 @@ begin SetPosition(4, 32, 242, 212); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; + Hint := ''; HotTrack := False; PopupFrame := False; TabOrder := 1; @@ -1892,6 +1900,8 @@ begin Name := 'IndexSearchEdit'; SetPosition(4, 4, 152, 24); Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; TabOrder := 2; Text := ''; FontDesc := '#Edit1'; @@ -1923,6 +1933,8 @@ begin Name := 'edSearchText'; SetPosition(4, 20, 210, 26); Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; TabOrder := 1; Text := ''; FontDesc := '#Edit1'; @@ -1946,6 +1958,7 @@ begin SetPosition(12, 68, 192, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 3; Text := 'This section'; Enabled := False; @@ -1958,6 +1971,7 @@ begin SetPosition(12, 88, 192, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 4; Text := 'Marked sections'; Enabled := False; @@ -1971,6 +1985,7 @@ begin Checked := True; FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 5; Text := 'All sections'; Enabled := False; @@ -1983,6 +1998,7 @@ begin SetPosition(12, 128, 192, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 6; Text := 'Index'; Enabled := False; @@ -1995,6 +2011,7 @@ begin SetPosition(12, 148, 192, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 7; Text := 'Marked libraries'; Enabled := False; @@ -2007,6 +2024,7 @@ begin SetPosition(12, 168, 192, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 8; Text := 'All libraries'; Enabled := False; @@ -2019,6 +2037,7 @@ begin SetPosition(4, 220, 242, 76); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; + Hint := ''; HotTrack := False; PopupFrame := False; TabOrder := 9; @@ -2065,6 +2084,7 @@ begin SetPosition(4, 32, 242, 252); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; + Hint := ''; HotTrack := False; PopupFrame := False; TabOrder := 0; @@ -2137,6 +2157,7 @@ begin SetPosition(4, 8, 242, 236); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; + Hint := ''; HotTrack := False; PopupFrame := False; TabOrder := 0; @@ -2229,6 +2250,7 @@ begin Name := 'ToolBar'; SetPosition(0, 25, 654, 28); Anchors := [anLeft,anRight,anTop]; + Hint := ''; Style := bsLowered; Shape := bsBottomLine; end; @@ -2237,13 +2259,14 @@ begin with btnOpen do begin Name := 'btnOpen'; - SetPosition(2, 1, 24, 24); + SetPosition(30, 1, 24, 24); Text := ''; Embedded := True; FontDesc := '#Label1'; Hint := 'Open a new help file.'; - ImageMargin := 0; + ImageMargin := -1; ImageName := 'stdimg.open'; + ImageSpacing := 0; TabOrder := 0; OnClick := @miFileOpenClicked; end; @@ -2252,7 +2275,7 @@ begin with btnPanel do begin Name := 'btnPanel'; - SetPosition(36, 1, 32, 24); + SetPosition(64, 1, 32, 24); Text := 'pnl'; AllowAllUp := True; Embedded := True; @@ -2268,13 +2291,14 @@ begin with btnBack do begin Name := 'btnBack'; - SetPosition(74, 1, 32, 24); + SetPosition(102, 1, 32, 24); Text := '<'; Embedded := True; FontDesc := '#Label1'; Hint := 'Previous history item.'; - ImageMargin := 0; + ImageMargin := -1; ImageName := 'dv.arrowleft'; + ImageSpacing := 0; TabOrder := 2; OnClick := @btnBackHistClick; end; @@ -2283,13 +2307,14 @@ begin with btnFwd do begin Name := 'btnFwd'; - SetPosition(108, 1, 32, 24); + SetPosition(136, 1, 32, 24); Text := '>'; Embedded := True; FontDesc := '#Label1'; Hint := 'Next history item.'; - ImageMargin := 0; + ImageMargin := -1; ImageName := 'dv.arrowright'; + ImageSpacing := 0; TabOrder := 3; OnClick := @btnFwdHistClick; end; @@ -2298,13 +2323,14 @@ begin with btnPrev do begin Name := 'btnPrev'; - SetPosition(146, 1, 32, 24); + SetPosition(174, 1, 32, 24); Text := 'prev'; Embedded := True; FontDesc := '#Label1'; Hint := 'Previous Topic.'; - ImageMargin := 0; + ImageMargin := -1; ImageName := 'dv.arrowup'; + ImageSpacing := 0; TabOrder := 4; OnClick := @btnPrevClick; end; @@ -2313,13 +2339,14 @@ begin with btnNext do begin Name := 'btnNext'; - SetPosition(180, 1, 32, 24); + SetPosition(208, 1, 32, 24); Text := 'next'; Embedded := True; FontDesc := '#Label1'; Hint := 'Next Topic.'; - ImageMargin := 0; + ImageMargin := -1; ImageName := 'dv.arrowdown'; + ImageSpacing := 0; TabOrder := 5; OnClick :=@btnNextClick; end; @@ -2328,7 +2355,7 @@ begin with btnHelp do begin Name := 'btnHelp'; - SetPosition(218, 1, 24, 24); + SetPosition(246, 1, 24, 24); Text := ''; Embedded := True; FontDesc := '#Label1'; @@ -2340,6 +2367,22 @@ begin OnClick := @miHelpProdInfoClicked; end; + btnQuit := TfpgButton.Create(ToolBar); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 1, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 8; + OnClick := @miFileQuitClicked; + end; + {@VFD_BODY_END: MainForm} {%endregion} -- cgit v1.2.3-70-g09d2 From f7475e311deb88ce5bd00778812dc831b2b41302 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graemeg@gmail.com> Date: Sun, 23 May 2010 23:20:17 +0200 Subject: DocView: New 'Open Special' menu option to open environment variables. Environment variables can point to directories containing files or directly pointing to files. --- docview/src/frm_main.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 0b35732e..c00b9a94 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -99,6 +99,7 @@ type procedure MainFormDestroy(Sender: TObject); procedure miFileQuitClicked(Sender: TObject); procedure miFileOpenClicked(Sender: TObject); + procedure miFileOpenSpecialClicked(Sender: TObject); procedure miFileCloseClicked(Sender: TObject); procedure miConfigureClicked(Sender: TObject); procedure miHelpProdInfoClicked(Sender: TObject); @@ -360,6 +361,17 @@ begin FileOpen; end; +procedure TMainForm.miFileOpenSpecialClicked(Sender: TObject); +var + s: TfpgString; +begin + if fpgInputQuery('Open Special...', 'Enter environment variable to open', s) then + begin + if s <> '' then + OpenFile(s, '', True); + end; +end; + procedure TMainForm.miFileCloseClicked(Sender: TObject); begin CloseFile; @@ -2197,6 +2209,7 @@ begin Name := 'miFile'; SetPosition(292, 96, 132, 20); AddMenuItem('Open...', '', @miFileOpenClicked); + AddMenuItem('Open Special...', '', @miFileOpenSpecialClicked); AddMenuItem('Save current Topic to IPF...', '', @miFileSaveTopicAsIPF); AddMenuItem('Close', '', @miFileCloseClicked); AddMenuitem('-', '', nil); -- cgit v1.2.3-70-g09d2 From 1be398ed4730d27d5401b4205ae1946760950702 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Mon, 2 Aug 2010 11:54:45 +0200 Subject: DocView: Improved the toolbar look. * Changed buttons to flat look. * Added divider lines between button groups. * Debug Menu item is now checked or unchecked. * Moved INF Header Info menu item to Help menu. --- docview/src/docview.lpi | 8 +++-- docview/src/frm_main.pas | 77 +++++++++++++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 33 deletions(-) (limited to 'docview/src') diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index a362ed8d..47544ba7 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="8"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> @@ -12,6 +12,9 @@ <Title Value="docview"/> <UseAppBundle Value="False"/> </General> + <VersionInfo> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion="0.0.0.0"/> + </VersionInfo> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -175,7 +178,7 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)/"/> <OtherUnitFiles Value="../components/richtext/"/> @@ -187,6 +190,7 @@ <IncludeAssertionCode Value="True"/> <AllowLabel Value="False"/> <CPPInline Value="False"/> + <UseAnsiStrings Value="False"/> </SyntaxOptions> </Parsing> <CodeGeneration> diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index c00b9a94..bc3ccece 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -61,15 +61,17 @@ type miDebug: TfpgPopupMenu; ToolBar: TfpgBevel; btnOpen: TfpgButton; - btnPanel: TfpgButton; btnBack: TfpgButton; btnFwd: TfpgButton; btnPrev: TfpgButton; btnNext: TfpgButton; btnHelp: TfpgButton; btnQuit: TfpgButton; + Bevel1: TfpgBevel; + Bevel2: TfpgBevel; {@VFD_HEAD_END: MainForm} miOpenRecentMenu: TfpgPopupMenu; + miDebugHexInfo: TfpgMenuItem; // Files: TList; // current open help files. Debug: boolean; FFileOpenRecent: TfpgMenuItem; @@ -440,6 +442,7 @@ end; procedure TMainForm.miDebugHex(Sender: TObject); begin Debug := not Debug; + miDebugHexInfo.Checked := Debug; DisplayTopic(nil); end; @@ -2244,6 +2247,8 @@ begin AddMenuItem('Help using help', '', nil); AddMenuItem('Command line parameters', '', @miHelpCmdLineParams); AddMenuItem('-', '', nil); + AddMenuItem('Show help file header info', '', @miDebugHeader); + AddMenuItem('-', '', nil); AddMenuItem('About fpGUI Toolkit...', '', @miHelpAboutFPGui); AddMenuItem('Product Information...', '', @miHelpProdInfoClicked); end; @@ -2253,8 +2258,7 @@ begin begin Name := 'miDebug'; SetPosition(292, 192, 132, 20); - AddMenuItem('Debug: Header', '', @miDebugHeader); - AddMenuItem('Toggle Hex INF Values in Contents', '', @miDebugHex); + miDebugHexInfo := AddMenuItem('Toggle Hex INF Values in Contents', '', @miDebugHex); end; ToolBar := TfpgBevel.Create(self); @@ -2274,7 +2278,7 @@ begin Name := 'btnOpen'; SetPosition(30, 1, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Open a new help file.'; ImageMargin := -1; @@ -2282,37 +2286,23 @@ begin ImageSpacing := 0; TabOrder := 0; OnClick := @miFileOpenClicked; - end; - - btnPanel := TfpgButton.Create(ToolBar); - with btnPanel do - begin - Name := 'btnPanel'; - SetPosition(64, 1, 32, 24); - Text := 'pnl'; - AllowAllUp := True; - Embedded := True; - FontDesc := '#Label1'; - GroupIndex := 1; - Hint := 'Display or hide tabs'; - ImageName := ''; - TabOrder := 1; - Enabled := False; + Focusable := False; end; btnBack := TfpgButton.Create(ToolBar); with btnBack do begin Name := 'btnBack'; - SetPosition(102, 1, 32, 24); + SetPosition(70, 1, 32, 24); Text := '<'; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Previous history item.'; ImageMargin := -1; ImageName := 'dv.arrowleft'; ImageSpacing := 0; TabOrder := 2; + Focusable := False; OnClick := @btnBackHistClick; end; @@ -2320,15 +2310,16 @@ begin with btnFwd do begin Name := 'btnFwd'; - SetPosition(136, 1, 32, 24); + SetPosition(104, 1, 32, 24); Text := '>'; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Next history item.'; ImageMargin := -1; ImageName := 'dv.arrowright'; ImageSpacing := 0; TabOrder := 3; + Focusable := False; OnClick := @btnFwdHistClick; end; @@ -2336,15 +2327,16 @@ begin with btnPrev do begin Name := 'btnPrev'; - SetPosition(174, 1, 32, 24); + SetPosition(138, 1, 32, 24); Text := 'prev'; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Previous Topic.'; ImageMargin := -1; ImageName := 'dv.arrowup'; ImageSpacing := 0; TabOrder := 4; + Focusable := False; OnClick := @btnPrevClick; end; @@ -2352,15 +2344,16 @@ begin with btnNext do begin Name := 'btnNext'; - SetPosition(208, 1, 32, 24); + SetPosition(172, 1, 32, 24); Text := 'next'; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Next Topic.'; ImageMargin := -1; ImageName := 'dv.arrowdown'; ImageSpacing := 0; TabOrder := 5; + Focusable := False; OnClick :=@btnNextClick; end; @@ -2368,15 +2361,16 @@ begin with btnHelp do begin Name := 'btnHelp'; - SetPosition(246, 1, 24, 24); + SetPosition(218, 1, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := 'Display Product Information.'; ImageMargin := -1; ImageName := 'stdimg.help'; ImageSpacing := 0; TabOrder := 6; + Focusable := False; OnClick := @miHelpProdInfoClicked; end; @@ -2386,7 +2380,7 @@ begin Name := 'btnQuit'; SetPosition(4, 1, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := ''; ImageMargin := -1; @@ -2394,6 +2388,27 @@ begin ImageSpacing := 0; TabOrder := 8; OnClick := @miFileQuitClicked; + Focusable := False; + end; + + Bevel1 := TfpgBevel.Create(ToolBar); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(61, 0, 6, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + Bevel2 := TfpgBevel.Create(ToolBar); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(210, 0, 6, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; end; {@VFD_BODY_END: MainForm} -- cgit v1.2.3-70-g09d2 From 579a1ee09ed495680d944faf59a1f3de696fe882 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graemeg@gmail.com> Date: Fri, 6 Aug 2010 18:52:00 +0200 Subject: docview: implemented external link click support. When end-user clicks on a external link (http, ftp, mailto), then fpgOpenURL() is called. --- docview/src/frm_main.pas | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index bc3ccece..04873d1f 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -267,9 +267,21 @@ var i: integer; lTopic: TTopic; lFound: Boolean; + lURL: TfpgString; begin // TODO: process other types of links (external, application etc...) too! - + if pos('url', Link) > 0 then + begin + // we have a external URL of some kind + // format is always: 'url "<uri>"' +// ShowMessage('Found an external Link' + LineEnding + Link); + lURL := StringReplace(Link, 'url "', '', []); + lURL := UTF8Copy(lURL, 0, UTF8Length(lURL)-1); + fpgOpenURL(lURL); + end + else + begin + // we have a internal INF file link LinkIndex := StrToInt( Link ); lLink := THelpLink(CurrentTopic.Links[LinkIndex]); lTopic := FindTopicForLink(lLink); @@ -287,25 +299,18 @@ begin if lTopic <> nil then begin lFound := True; - writeln('Found Topic! ', lTopic.Title); +// writeln('Found Topic! ', lTopic.Title); break; - end; if lFound then break; end; if lTopic <> nil then begin - writeln('Displaying topic <', lTopic.Title, '>'); +// writeln('Displaying topic <', lTopic.Title, '>'); DisplayTopic(lTopic); end; - //lLink := SourceWindow.Topic.Links[ LinkIndex ]; - // - //PostMsg( Self.Handle, - // WM_FOLLOWLINK, - // longint( Link ), - // longint( SourceWindow ) ); - + end; end; procedure TMainForm.IndexSearchEditKeyPress(Sender: TObject; var KeyCode: word; -- cgit v1.2.3-70-g09d2 From 52d2902b355616876bafbbfebe95bbd7cd6b545e Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Wed, 11 Aug 2010 14:33:50 +0200 Subject: docview: Replaced the fake TImageList with the actual TfpgImageList --- docview/src/HelpFile.pas | 13 +++++-------- docview/src/nvNullObjects.pas | 18 ------------------ 2 files changed, 5 insertions(+), 26 deletions(-) (limited to 'docview/src') diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index acba5b14..ac5e68e7 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -13,6 +13,7 @@ Interface uses Classes ,SysUtils + ,fpg_imagelist ,IPFFileFormatUnit ,HelpTopic // ,HelpBitmap @@ -140,8 +141,7 @@ type property ReferencedFiles: TStringList read _ReferencedFiles; - procedure GetImages( ImageOffsets: TList; - Images: TImageList ); + procedure GetImages( ImageOffsets: TList; Images: TfpgImageList ); function GetImage( ImageOffset: longint ): THelpBitmap; @@ -1057,8 +1057,7 @@ begin end; end; -procedure THelpFile.GetImages( ImageOffsets: TList; - Images: TImageList ); +procedure THelpFile.GetImages( ImageOffsets: TList; Images: TfpgImageList ); var ListIndex: longint; ImageOffset: longint; @@ -1081,13 +1080,11 @@ begin + e.Message );} begin Bitmap := THelpBitmap.Create; - Bitmap.LoadFromResourceName( 'MissingBitmap' ); + Bitmap.LoadFromResourceName( 'MissingBitmap' ); // TODO: Add image resource to DocView end; end; - Images.Add( Bitmap, nil ); - Bitmap.Destroy; - + Images.AddImage(Bitmap); end; end; diff --git a/docview/src/nvNullObjects.pas b/docview/src/nvNullObjects.pas index ee849b12..a97841d0 100644 --- a/docview/src/nvNullObjects.pas +++ b/docview/src/nvNullObjects.pas @@ -10,16 +10,6 @@ uses type EHelpBitmapException = class(Exception); - // forward declaration - THelpBitmap = class; - - - TImageList = class(TObjectList) - public - procedure Add(ABitmap: THelpBitmap; AParam2: TObject); - end; - - THelpBitmap = class(TObject) public constructor CreateFromHelpFile( FileHandle: TFileStream; Offset: longint ); @@ -32,16 +22,8 @@ implementation -{ TImageList } - -procedure TImageList.Add(ABitmap: THelpBitmap; AParam2: TObject); -begin - // -end; - { THelpBitmap } - constructor THelpBitmap.CreateFromHelpFile(FileHandle: TFileStream; Offset: longint); begin inherited Create; -- cgit v1.2.3-70-g09d2 From f24d9240a1a84eb224b03c76d56610f56a329f6e Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Wed, 11 Aug 2010 14:36:40 +0200 Subject: NullObject THelpBitmap is now a TfpgImage descendant. --- docview/src/nvNullObjects.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docview/src') diff --git a/docview/src/nvNullObjects.pas b/docview/src/nvNullObjects.pas index a97841d0..c5e52a22 100644 --- a/docview/src/nvNullObjects.pas +++ b/docview/src/nvNullObjects.pas @@ -5,12 +5,12 @@ unit nvNullObjects; interface uses - contnrs, Classes, SysUtils; + contnrs, Classes, SysUtils, fpg_main; type EHelpBitmapException = class(Exception); - THelpBitmap = class(TObject) + THelpBitmap = class(TfpgImage) public constructor CreateFromHelpFile( FileHandle: TFileStream; Offset: longint ); procedure LoadFromResourceName(const AName: string); -- cgit v1.2.3-70-g09d2 From ea7a1b1c1ebc37a6d1ae9c15b1239200f2dbb2ee Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Wed, 11 Aug 2010 14:37:28 +0200 Subject: docview: improved handling of external links. When a external link is clicked, display a user friendly message that support doesn't exist yet. --- docview/src/frm_main.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 04873d1f..9e853f35 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -270,7 +270,11 @@ var lURL: TfpgString; begin // TODO: process other types of links (external, application etc...) too! - if pos('url', Link) > 0 then + if pos('external', Link) > 0 then + begin + TfpgMessageDialog.Warning('', 'External links are not supported in DocView yet. Please try again with a later build.') + end + else if pos('url', Link) > 0 then begin // we have a external URL of some kind // format is always: 'url "<uri>"' -- cgit v1.2.3-70-g09d2 From 15c057a201db9af730d6ad717301367b5a5c2dfb Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Wed, 11 Aug 2010 17:05:33 +0200 Subject: Converted NewView HelpBitmap unit to DocView * Code is untested but compiles * --- docview/src/HelpBitmap.pas | 564 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 564 insertions(+) create mode 100644 docview/src/HelpBitmap.pas (limited to 'docview/src') diff --git a/docview/src/HelpBitmap.pas b/docview/src/HelpBitmap.pas new file mode 100644 index 00000000..35730fd1 --- /dev/null +++ b/docview/src/HelpBitmap.pas @@ -0,0 +1,564 @@ +unit HelpBitmap; + +interface + +// Encapsulates a bitmap as stored in a IPF file. +// Once created from file data they can be used as a normal bitmap. + +uses + Classes, SysUtils, fpg_main, ctypes, + IPFFileFormatUnit; + +type + EHelpBitmapException = class( Exception ); + + + // Lead part of BITMAPARRAYFILEHEADER + INFBITMAPARRAYHEADER = packed record + usType: uint16; // 'BA', 16706 + cbSize: uint32; // Size of the BITMAPARRAYFILEHEADER structure in bytes. + offNext: uint32; // Offset of the next BITMAPARRAYFILEHEADER structure from the start of the file. + cxDisplay: uint16; // Device width, in pels. + cyDisplay: uint16; // Device height, in pels. + end; + + + INFBITMAPHEADER = packed record + // BITMAP FILE HEADER + usType: uint16; // = 'bM' + cbSize: uint32; + xHotspot: uint16; + yHotspot: uint16; + offBits: uint32; // =size(hdr)+size(palette) + // BITMAP INFO HEADER + cbFIx: uint32; // =size(info_hdr) (usually = 12?) + cx: uint16; // width size + cy: uint16; // height size + cPlanes: uint16; // planes, =1 (always seems to be one) + cBitCount: uint16; // bits per pixel + // followed by RGB triples if <= 8bpp + end; + + TRGB = packed record + Blue: uint8; + Green: uint8; + Red: uint8; + end; + + TRGBA = packed record + Blue: uint8; + Green: uint8; + Red: uint8; + Reserved: uint8; + end; + + + THelpBitmap = class( TfpgImage ) + protected + _Header: INFBITMAPHEADER; + _PaletteColorCount: longint; + _pPalette: ^TRGB; + _BitsSize: longint; + FileHandle: TFileStream; + _UncompressedBlockSize: longint; + function GetPaletteSize: longint; + procedure BitmapError(Msg: string); + procedure DecompressLZW(var Buffer: Pointer; var Count: PtrInt); + procedure ReadBitmapData( Blocks: TList; TotalSize: longint ); + public + constructor CreateFromHelpFile(AFileHandle: TFileStream; Offset: longint); + destructor Destroy; override; + end; + + +var + LZWDecompressBlock: function( pInput: PBYTE; + pOutput: PBYTE; + bytesIn: uint32; + Var bytesOut: uint32; + Var FinalCode: byte ): Boolean; +// APIENTRY; +// 'newview' index 1; + +implementation + +uses + nvUtilities, Math, fpg_imgfmt_bmp; + +const + BFT_bMAP =$4d62; // 'bM' + BFT_BITMAP_ARRAY = $4142; // 'BA' + +type + INFBITMAPDATAHEADER = packed record + ulTotalSize: uint32; + usUncompressedBlockSize: uint16; // bytes per block, after decompression + end; + + TBitmapBlock = class(TObject) + _Data: PBYTE; + _Size: uint16; + _CompressionType: uint8; + destructor Destroy; override; + end; + +destructor TBitmapBlock.Destroy; +begin + FreeMem( _Data ); + inherited Destroy; +end; + +constructor THelpBitmap.CreateFromHelpFile(AFileHandle: TFileStream; Offset: longint); +var + WordsPerLine: longint; + LineSize: longint; + DataHeader: INFBITMAPDATAHEADER; + BytesRead: longint; + + Block: TBitmapBlock; + p: pointer; + Blocks: TList; + BlockIndex: longint; + ImageType: uint16; + BitmapArrayHeader: INFBITMAPARRAYHEADER; + bytes: integer; +begin + FileHandle := AFileHandle; + + FileHandle.Seek(Offset, soBeginning); + bytes := FileHandle.Read(ImageType, sizeof(ImageType)); + if bytes <> SizeOf(ImageType) then + raise EHelpBitmapException.Create( 'Failed to read ImageType.' ); + + if ImageType = BFT_BITMAP_ARRAY then + begin + // skip array header and read first bitmap only + FileHandle.Seek(Sizeof( BitmapArrayHeader ) - sizeof( ImageType ), soCurrent); + end + else + begin + // skip back over imagetype bytes to read header. + FileHandle.Seek(- sizeof( ImageType ), soCurrent); + end; + + // Read bitmap header + bytes := FileHandle.Read(_Header, SizeOf(_Header)); + if bytes <> SizeOf(_Header) then + raise EHelpBitmapException.Create( 'Failed to read Header.' ); + + // Check it's got a valid type + if _Header.usType <> BFT_bMAP then + raise EHelpBitmapException.Create( 'Invalid bitmap header' ); + + _Header.usType := $4d42; // sibyl only accepts 'BM' not 'bM' + + // We can only parse bitmaps with 1 colour plane + // (I can't be bothered and have never seen bitmaps + // with more than 1 color plane) + if _Header.cPlanes <> 1 then + exit; + + _PaletteColorCount := 0; + if _Header.cBitCount < 24 then + _PaletteColorCount := 1 shl _Header.cBitCount; + + // OS/2 always rounds bitmap rows up to a word: + WordsPerLine := ( _Header.cBitCount * _Header.cx + 31 ) div 32; + LineSize := WordsPerLine * 4; + + // Total size of the bitmap pixel data + _BitsSize := LineSize * _Header.cy; + + // Correct header offset - it is wrong in the header (why?) + _Header.OffBits := sizeof( _Header ) + GetPaletteSize; // TODO: Graeme, double check this! + + // Load palette + _pPalette := GetMem( GetPaletteSize ); + bytes := FileHandle.Read(_pPalette, GetPaletteSize); + if bytes <> GetPaletteSize then + raise EHelpBitmapException.Create( 'Failed to read Palette.' ); + + // Read data header + bytes := FileHandle.Read(DataHeader, SizeOf(DataHeader)); + if bytes <> GetPaletteSize then + raise EHelpBitmapException.Create( 'Failed to read DataHeader.' ); + _UncompressedBlockSize := DataHeader.usUncompressedBlockSize; + + // For counting total size, we have already read some bytes: + // the uncompressedblocksize field + BytesRead := sizeof( DataHeader.usUncompressedBlockSize ); + Blocks := TList.Create; + + while BytesRead < DataHeader.ulTotalSize do + begin + Block := TBitmapBlock.Create; + + // Read the block size + FileHandle.Read(Block._Size, SizeOf(Block._Size)); + inc( BytesRead, sizeof( Block._Size ) ); + + // Read the compression type + FileHandle.Read(Block._CompressionType, SizeOf(Block._CompressionType)); + inc( BytesRead, sizeof( Block._CompressionType ) ); + + // since size in the file includes this compression type field, subtract it + dec( Block._Size, sizeof( Block._CompressionType ) ); + + // Now read the block + Block._Data := GetMem( Block._Size ); + FileHandle.Read(Block._Data, Block._Size); + + inc( BytesRead, Block._Size ); + + Blocks.Add( Block ); + + end; + ReadBitmapData( Blocks, sizeof( _Header ) + GetPaletteSize + _BitsSize ); + + for BlockIndex := 0 to Blocks.Count - 1 do + begin + Block := TBitmapBlock(Blocks[ BlockIndex ]); + Block.Free; + end; + + Blocks.Free; +end; + +function THelpBitmap.GetPaletteSize: longint; +begin + Result := sizeof( TRGB ) * _PaletteColorCount; +end; + +procedure THelpBitmap.BitmapError(Msg: string); +begin + //Msg:=Msg+' at position '+IntToStr(s.Position); + //if fStartPos>0 then + // Msg:=Msg+'(BitmapPosition='+IntToStr(fStartPos)+')'; + raise EHelpBitmapException.Create(Msg); +end; + +destructor THelpBitmap.Destroy; +begin + FreeMem( _pPalette ); + inherited Destroy; +end; + +procedure THelpBitmap.DecompressLZW(var Buffer: Pointer; var Count: PtrInt); +type + TLZWString = packed record + Count: integer; + Data: PByte; + end; + PLZWString = ^TLZWString; +const + ClearCode = 256; // clear table, start with 9bit codes + EoiCode = 257; // end of input +var + NewBuffer: PByte; + NewCount: PtrInt; + NewCapacity: PtrInt; + SrcPos: PtrInt; + SrcPosBit: integer; + CurBitLength: integer; + Code: Word; + Table: PLZWString; + TableCapacity: integer; + TableCount: integer; + OldCode: Word; + + function GetNextCode: Word; + var + v: Integer; + begin + Result:=0; + // CurBitLength can be 9 to 12 + //writeln('GetNextCode CurBitLength=',CurBitLength,' SrcPos=',SrcPos,' SrcPosBit=',SrcPosBit,' ',hexstr(PByte(Buffer)[SrcPos],2),' ',hexstr(PByte(Buffer)[SrcPos+1],2),' ',hexstr(PByte(Buffer)[SrcPos+2],2)); + // read two or three bytes + if CurBitLength+SrcPosBit>16 then begin + // read from three bytes + if SrcPos+3>Count then BitmapError('LZW stream overrun'); + v:=PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + v:=v shr (24-CurBitLength-SrcPosBit); + end else begin + // read from two bytes + if SrcPos+2>Count then BitmapError('LZW stream overrun'); + v:=PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + if CurBitLength+SrcPosBit=16 then + inc(SrcPos); + v:=v shr (16-CurBitLength-SrcPosBit); + end; + Result:=v and ((1 shl CurBitLength)-1); + SrcPosBit:=(SrcPosBit+CurBitLength) and 7; + //writeln('GetNextCode END SrcPos=',SrcPos,' SrcPosBit=',SrcPosBit,' Result=',Result,' Result=',hexstr(Result,4)); + end; + + procedure ClearTable; + var + i: Integer; + begin + for i:=0 to TableCount-1 do + ReAllocMem(Table[i].Data,0); + TableCount:=0; + end; + + procedure InitializeTable; + begin + CurBitLength:=9; + ClearTable; + end; + + function IsInTable(Code: word): boolean; + begin + Result:=Code<258+TableCount; + end; + + procedure WriteStringFromCode(Code: integer; AddFirstChar: boolean = false); + var + s: TLZWString; + b: byte; + begin + //WriteLn('WriteStringFromCode Code=',Code,' AddFirstChar=',AddFirstChar,' x=',(NewCount div 4) mod IDF.ImageWidth,' y=',(NewCount div 4) div IDF.ImageWidth,' PixelByte=',NewCount mod 4); + if Code<256 then begin + // write byte + b:=Code; + s.Data:=@b; + s.Count:=1; + end else if Code>=258 then begin + // write string + if Code-258>=TableCount then + BitmapError('LZW code out of bounds'); + s:=Table[Code-258]; + end else + BitmapError('LZW code out of bounds'); + if NewCount+s.Count+1>NewCapacity then begin + NewCapacity:=NewCapacity*2+8; + ReAllocMem(NewBuffer,NewCapacity); + end; + System.Move(s.Data^,NewBuffer[NewCount],s.Count); + //for i:=0 to s.Count-1 do write(HexStr(NewBuffer[NewCount+i],2)); // debug + inc(NewCount,s.Count); + if AddFirstChar then begin + NewBuffer[NewCount]:=s.Data^; + //write(HexStr(NewBuffer[NewCount],2)); // debug + inc(NewCount); + end; + //writeln(',WriteStringFromCode'); // debug + end; + + procedure AddStringToTable(Code, AddFirstCharFromCode: integer); + // add string from code plus first character of string from code as new string + var + b1, b2: byte; + s1, s2: TLZWString; + p: PByte; + begin + //WriteLn('AddStringToTable Code=',Code,' FCFCode=',AddFirstCharFromCode,' TableCount=',TableCount,' TableCapacity=',TableCapacity); + // grow table + if TableCount>=TableCapacity then begin + TableCapacity:=TableCapacity*2+128; + ReAllocMem(Table,TableCapacity*SizeOf(TLZWString)); + end; + // find string 1 + if Code<256 then begin + // string is byte + b1:=Code; + s1.Data:=@b1; + s1.Count:=1; + end else if Code>=258 then begin + // normal string + if Code-258>=TableCount then + BitmapError('LZW code out of bounds'); + s1:=Table[Code-258]; + end else + BitmapError('LZW code out of bounds'); + // find string 2 + if AddFirstCharFromCode<256 then begin + // string is byte + b2:=AddFirstCharFromCode; + s2.Data:=@b2; + s2.Count:=1; + end else begin + // normal string + if AddFirstCharFromCode-258>=TableCount then + BitmapError('LZW code out of bounds'); + s2:=Table[AddFirstCharFromCode-258]; + end; + // set new table entry + Table[TableCount].Count:=s1.Count+1; + p:=nil; + GetMem(p,s1.Count+1); + Table[TableCount].Data:=p; + System.Move(s1.Data^,p^,s1.Count); + // add first character from string 2 + p[s1.Count]:=s2.Data^; + // increase TableCount + inc(TableCount); + case TableCount+259 of + 512,1024,2048: inc(CurBitLength); + 4096: BitmapError('LZW too many codes'); + end; + end; + +begin + if Count=0 then exit; + //WriteLn('TFPReaderTiff.DecompressLZW START Count=',Count); + //for SrcPos:=0 to 19 do + // write(HexStr(PByte(Buffer)[SrcPos],2)); + //writeln(); + + NewBuffer:=nil; + NewCount:=0; + NewCapacity:=Count*2; + ReAllocMem(NewBuffer,NewCapacity); + + SrcPos:=0; + SrcPosBit:=0; + CurBitLength:=9; + Table:=nil; + TableCount:=0; + TableCapacity:=0; + try + repeat + Code:=GetNextCode; + //WriteLn('TFPReaderTiff.DecompressLZW Code=',Code); + if Code=EoiCode then break; + if Code=ClearCode then begin + InitializeTable; + Code:=GetNextCode; + //WriteLn('TFPReaderTiff.DecompressLZW after clear Code=',Code); + if Code=EoiCode then break; + if Code=ClearCode then + BitmapError('LZW code out of bounds'); + WriteStringFromCode(Code); + OldCode:=Code; + end else begin + if Code<TableCount+258 then begin + WriteStringFromCode(Code); + AddStringToTable(OldCode,Code); + OldCode:=Code; + end else if Code=TableCount+258 then begin + WriteStringFromCode(OldCode,true); + AddStringToTable(OldCode,OldCode); + OldCode:=Code; + end else + BitmapError('LZW code out of bounds'); + end; + until false; + finally + ClearTable; + ReAllocMem(Table,0); + end; + + ReAllocMem(NewBuffer,NewCount); + FreeMem(Buffer); + Buffer:=NewBuffer; + Count:=NewCount; +end; + + +procedure THelpBitmap.ReadBitmapData( Blocks: TList; + TotalSize: longint ); +var + BytesWritten: longint; + BytesWrittenFromBlock: longword; + BytesRemainingInBlock: longword; + BytesRemainingInBitmap: longword; + FillerBytesRequired: longint; + lastOutByte: byte; + BitmapOutputPointer: PByte; + Block: TBitmapBlock; + BlockIndex: longint; + BitmapData: PBYTE; + ptr: PByte; +begin + // Allocate memory to store the bitmap + Bitmapdata := GetMem( TotalSize ); + + // Copy header to bitmap + MemCopy( _Header, BitmapData, sizeof( _Header ) ); + + // Copy palette into bitmap + ptr := BitmapData + sizeof( _Header ); + MemCopy( _pPalette, ptr, GetPaletteSize ); + + BytesWritten := 0; + + // Point to start writing to bitmap bits. + BitmapOutputPointer := BitmapData + sizeof( _Header ) + GetPaletteSize; + + for BlockIndex := 0 to Blocks.Count - 1 do + begin + Block := TBitmapBlock(Blocks[ BlockIndex ]); + + case Block._CompressionType of + 0,1: // uncompressed (I'm not sure about 1) + begin + MemCopy( Block._Data, BitmapOutputPointer, Block._Size ); + BytesWrittenFromBlock := Block._Size; + inc( BytesWritten, BytesWrittenFromBlock ); + end; + + 2: // LZW compression + begin + // decompress block + if not Assigned( LZWDecompressBlock )then + raise EHelpBitmapException.Create( 'Cannot decode bitmap - DLL not found' ); + + LZWDecompressBlock( Block._Data, + BitmapOutputPointer, + Block._Size, + BytesWrittenFromBlock, + lastOutByte ); + + inc( BytesWritten, BytesWrittenFromBlock ); + + // If the uncompressed data stopped short then + // copy the final code (byte) into remaining bytes + if ( BytesWrittenFromBlock < _UncompressedBlockSize ) + and ( BytesWritten < _BitsSize ) then + begin + BytesRemainingInBlock := _UncompressedBlockSize - BytesWrittenFromBlock; + BytesRemainingInBitmap := _BitsSize - BytesWritten; + + FillerBytesRequired := Min( BytesRemainingInBlock, + BytesRemainingInBitmap ); + + FillMem( BitmapOutputPointer + BytesWrittenFromBlock, + FillerBytesRequired, + LastOutByte ); + inc( BytesWritten, FillerBytesRequired ); + inc( BytesWrittenFromBlock, FillerBytesRequired ); + end; + end; + else + raise EHelpBitmapException.Create( 'Unrecognised bitmap block type' ); + end; // case + + assert( BytesWrittenFromBlock <= _UncompressedBlockSize ); + assert( BytesWritten <= _BitsSize ); + + if ( BitmapOutputPointer + BytesWrittenFromBlock + > BitmapData + TotalSize ) then + assert( false ); + + inc( BitmapOutputPointer, BytesWrittenFromBlock ); + end; + + + AllocateImage(32, _Header.cx, _Header.cy); + if TotalSize <> ImageDataSize then + writeln('Warning: INF Bitmap size and allocated bitmap size are different. ', TotalSize, ' vs ', ImageDataSize); + Move(BitmapData^, ImageData^, TotalSize); + UpdateImage; + + FreeMem( BitmapData, TotalSize ); +end; + + +end. -- cgit v1.2.3-70-g09d2 From f038b1019731c61de8de52d46e8e7d8f538224ac Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Wed, 11 Aug 2010 17:07:34 +0200 Subject: docview: Replaced fake NullObject unit with HelpBitmap unit. --- docview/src/HelpFile.pas | 11 +++--- docview/src/IPFFileFormatUnit.pas | 6 +--- docview/src/docview.lpi | 74 +++++++++++++++++++-------------------- docview/src/docview.lpr | 4 +-- docview/src/frm_main.pas | 4 +++ docview/src/nvUtilities.pas | 6 ++++ 6 files changed, 56 insertions(+), 49 deletions(-) (limited to 'docview/src') diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index ac5e68e7..bca6aedd 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -16,9 +16,8 @@ uses ,fpg_imagelist ,IPFFileFormatUnit ,HelpTopic -// ,HelpBitmap + ,HelpBitmap ,SearchTable - ,nvNullObjects // Fake various classes like TImageList ; type @@ -190,7 +189,8 @@ uses // DebugUnit, // ACLFileIOUtility, // ACLLanguageUnit; - nvUtilities + fpg_main + ,nvUtilities ,ACLStringUtility ; @@ -1079,8 +1079,9 @@ begin + ': ' + e.Message );} begin - Bitmap := THelpBitmap.Create; - Bitmap.LoadFromResourceName( 'MissingBitmap' ); // TODO: Add image resource to DocView +// Bitmap := THelpBitmap.Create; + Bitmap := THelpBitmap(fpgImages.GetImage('stdimg.dlg.critical')); +// Bitmap.LoadFromResourceName( 'MissingBitmap' ); // TODO: Add image resource to DocView end; end; diff --git a/docview/src/IPFFileFormatUnit.pas b/docview/src/IPFFileFormatUnit.pas index 1acc7857..b954f4c8 100644 --- a/docview/src/IPFFileFormatUnit.pas +++ b/docview/src/IPFFileFormatUnit.pas @@ -2,11 +2,7 @@ Unit IPFFileFormatUnit; {$mode objfpc}{$H+} -// NewView - a new OS/2 Help Viewer -// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) -// This software is released under the Gnu Public License - see readme.txt - -Interface +interface // Definition of IPF file header and other structures diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index 47544ba7..e8a7850b 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -79,101 +79,101 @@ <UnitName Value="nvUtilities"/> </Unit8> <Unit9> - <Filename Value="nvNullObjects.pas"/> + <Filename Value="../docs/inf04.txt"/> <IsPartOfProject Value="True"/> - <UnitName Value="nvNullObjects"/> </Unit9> <Unit10> - <Filename Value="../docs/inf04.txt"/> + <Filename Value="SearchUnit.pas"/> <IsPartOfProject Value="True"/> + <UnitName Value="SearchUnit"/> </Unit10> <Unit11> - <Filename Value="SearchUnit.pas"/> + <Filename Value="../components/richtext/RichTextStyleUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="SearchUnit"/> + <UnitName Value="RichTextStyleUnit"/> </Unit11> <Unit12> - <Filename Value="../components/richtext/RichTextStyleUnit.pas"/> + <Filename Value="../components/richtext/CanvasFontManager.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="RichTextStyleUnit"/> + <UnitName Value="CanvasFontManager"/> </Unit12> <Unit13> - <Filename Value="../components/richtext/CanvasFontManager.pas"/> + <Filename Value="../components/richtext/ACLStringUtility.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="CanvasFontManager"/> + <UnitName Value="ACLStringUtility"/> </Unit13> <Unit14> - <Filename Value="../components/richtext/ACLStringUtility.pas"/> + <Filename Value="../components/richtext/RichTextDocumentUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="ACLStringUtility"/> + <UnitName Value="RichTextDocumentUnit"/> </Unit14> <Unit15> - <Filename Value="../components/richtext/RichTextDocumentUnit.pas"/> + <Filename Value="../components/richtext/RichTextView.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="RichTextDocumentUnit"/> + <UnitName Value="RichTextView"/> </Unit15> <Unit16> - <Filename Value="../components/richtext/RichTextView.pas"/> + <Filename Value="../components/richtext/RichTextLayoutUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="RichTextView"/> + <UnitName Value="RichTextLayoutUnit"/> </Unit16> <Unit17> - <Filename Value="../components/richtext/RichTextLayoutUnit.pas"/> + <Filename Value="../components/richtext/RichTextDisplayUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="RichTextLayoutUnit"/> + <UnitName Value="RichTextDisplayUnit"/> </Unit17> <Unit18> - <Filename Value="../components/richtext/RichTextDisplayUnit.pas"/> + <Filename Value="IPFFileFormatUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="RichTextDisplayUnit"/> + <UnitName Value="IPFFileFormatUnit"/> </Unit18> <Unit19> - <Filename Value="IPFFileFormatUnit.pas"/> + <Filename Value="HelpWindowDimensions.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="IPFFileFormatUnit"/> + <UnitName Value="HelpWindowDimensions"/> </Unit19> <Unit20> - <Filename Value="HelpWindowDimensions.pas"/> + <Filename Value="NewViewConstantsUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="HelpWindowDimensions"/> + <UnitName Value="NewViewConstantsUnit"/> </Unit20> <Unit21> - <Filename Value="NewViewConstantsUnit.pas"/> + <Filename Value="SettingsUnit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="NewViewConstantsUnit"/> + <UnitName Value="SettingsUnit"/> </Unit21> <Unit22> - <Filename Value="SettingsUnit.pas"/> + <Filename Value="dvconstants.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="SettingsUnit"/> + <UnitName Value="dvConstants"/> </Unit22> <Unit23> - <Filename Value="dvconstants.pas"/> + <Filename Value="dvHelpers.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="dvConstants"/> + <UnitName Value="dvHelpers"/> </Unit23> <Unit24> - <Filename Value="dvHelpers.pas"/> + <Filename Value="HelpWindow.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="dvHelpers"/> + <UnitName Value="HelpWindow"/> </Unit24> <Unit25> - <Filename Value="HelpWindow.pas"/> + <Filename Value="../TODO.txt"/> <IsPartOfProject Value="True"/> - <UnitName Value="HelpWindow"/> </Unit25> <Unit26> - <Filename Value="../TODO.txt"/> + <Filename Value="frm_configuration.pas"/> <IsPartOfProject Value="True"/> + <UnitName Value="frm_configuration"/> </Unit26> <Unit27> - <Filename Value="frm_configuration.pas"/> + <Filename Value="arrows.inc"/> <IsPartOfProject Value="True"/> - <UnitName Value="frm_configuration"/> </Unit27> <Unit28> - <Filename Value="arrows.inc"/> + <Filename Value="HelpBitmap.pas"/> <IsPartOfProject Value="True"/> + <UnitName Value="HelpBitmap"/> </Unit28> </Units> </ProjectOptions> diff --git a/docview/src/docview.lpr b/docview/src/docview.lpr index 87087b59..91e50323 100644 --- a/docview/src/docview.lpr +++ b/docview/src/docview.lpr @@ -8,11 +8,11 @@ uses {$ENDIF}{$ENDIF} Classes, fpg_main, frm_main, IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, - TextSearchQuery, nvUtilities, nvNullObjects, HelpFile, SearchUnit, + TextSearchQuery, nvUtilities, HelpFile, SearchUnit, fpg_cmdlineparams, IPFFileFormatUnit, HelpWindowDimensions, NewViewConstantsUnit, SettingsUnit, RichTextStyleUnit, CanvasFontManager, ACLStringUtility, RichTextDocumentUnit, RichTextView, RichTextLayoutUnit, - RichTextDisplayUnit, dvconstants, dvHelpers, frm_configuration; + RichTextDisplayUnit, dvconstants, dvHelpers, frm_configuration, HelpBitmap; procedure MainProc; diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 9e853f35..383b0429 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -1701,6 +1701,10 @@ begin nil {Highlights} ); { TODO -oGraeme : We do not support images yet } +// THelpFile(CurrentTopic.HelpFile).GetImages(ImageOf) +// THelpFile( Topic.HelpFile ).GetImages( ImageOffsets, +// Images ); + ImageIndices.Free; //writeln(lText); diff --git a/docview/src/nvUtilities.pas b/docview/src/nvUtilities.pas index 8dc928a1..568fbc19 100644 --- a/docview/src/nvUtilities.pas +++ b/docview/src/nvUtilities.pas @@ -46,6 +46,7 @@ procedure DeallocateMemory( Var P: pointer ); // Alias method which is the same as Move() but with less confusing name procedure MemCopy(const src; var dest; size: SizeInt); +procedure FillMem( Dest: pointer; Size: longint; Data: Byte ); // Allows for debug output and quite disable of output procedure ProfileEvent(const AString: string); // Return AFilename's size in bytes @@ -212,6 +213,11 @@ begin Move(src, dest, size); end; +procedure FillMem( Dest: pointer; Size: longint; Data: Byte ); +begin + FillChar( Dest^, Size, Data ); +end; + procedure ProfileEvent(const AString: string); begin {$IFDEF DEBUG} -- cgit v1.2.3-70-g09d2 From b7891fb5e43c938f60f20d61ba274be307f8a2ff Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Fri, 13 Aug 2010 16:59:22 +0200 Subject: Added a new bitmap for use where images should have been loaded --- docview/images/missing.bmp | Bin 0 -> 12342 bytes docview/src/missing.inc | 730 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 730 insertions(+) create mode 100644 docview/images/missing.bmp create mode 100644 docview/src/missing.inc (limited to 'docview/src') diff --git a/docview/images/missing.bmp b/docview/images/missing.bmp new file mode 100644 index 00000000..d8189537 Binary files /dev/null and b/docview/images/missing.bmp differ diff --git a/docview/src/missing.inc b/docview/src/missing.inc new file mode 100644 index 00000000..8be26a60 --- /dev/null +++ b/docview/src/missing.inc @@ -0,0 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255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255, + 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255, + 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, + 255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ); -- cgit v1.2.3-70-g09d2 From 823767706b7990567fb8f9a5dd68efa8e30f2064 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Fri, 13 Aug 2010 17:01:52 +0200 Subject: docview: Now manages some images for RichTextView control. The image list contains "missing image" images to indicate where images where supposed to have been displayed. --- docview/src/frm_main.pas | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'docview/src') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 383b0429..3e24c320 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -7,7 +7,8 @@ interface uses SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_tab, fpg_tree, fpg_splitter, fpg_menu, fpg_button, fpg_listbox, - fpg_label, fpg_edit, fpg_radiobutton, fpg_progressbar, + fpg_label, fpg_edit, fpg_radiobutton, fpg_progressbar, fpg_imagelist, + fpg_imgfmt_bmp, HelpFile, RichTextView, HelpTopic; type @@ -76,6 +77,7 @@ type Debug: boolean; FFileOpenRecent: TfpgMenuItem; FHistorySelection: Boolean; + FImages: TfpgImageList; LoadingFilenameList: TStringList; LoadingFileIndex: integer; @@ -201,6 +203,7 @@ const cVersion = 'Version ' + FPGUI_VERSION; {$I arrows.inc} +{$I missing.inc} {@VFD_NEWFORM_IMPL} @@ -347,6 +350,8 @@ begin LoadSettings; CreateMRUMenuItems; ProcessCommandLineParams; + + RichView.Images := FImages; end; procedure TMainForm.MainFormDestroy(Sender: TObject); @@ -1700,10 +1705,11 @@ begin ImageIndices, nil {Highlights} ); + if ImageIndices.Count > 0 then + begin { TODO -oGraeme : We do not support images yet } -// THelpFile(CurrentTopic.HelpFile).GetImages(ImageOf) -// THelpFile( Topic.HelpFile ).GetImages( ImageOffsets, -// Images ); +// THelpFile(CurrentTopic.HelpFile).GetImages(ImageIndices, FImages); + end; ImageIndices.Free; @@ -1741,6 +1747,8 @@ begin end; constructor TMainForm.Create(AOwner: TComponent); +var + img: TfpgImage; begin inherited Create(AOwner); fpgApplication.OnException := @MainFormException; @@ -1755,6 +1763,16 @@ begin { TODO -oGraeme : Make Debug a menu option } Debug := False; + FImages := TfpgImageList.Create; + // store up to three images per Topic - while we don't support INF images + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + + // load toolbar images fpgImages.AddMaskedBMP( 'dv.arrowleft', @usr_arrow_left, @@ -1771,10 +1789,13 @@ begin fpgImages.AddMaskedBMP( 'dv.arrowdown', @usr_arrow_down, sizeof(usr_arrow_down), 0, 0); + end; destructor TMainForm.Destroy; begin + RichView.Images := nil; + FImages.Free; CurrentTopic := nil; // it was a reference only FFileOpenRecent := nil; // it was a reference only miOpenRecentMenu.Free; -- cgit v1.2.3-70-g09d2 From e3660a8f7bf8ab5d7f14b22f418ef419172262f7 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graeme@mastermaths.co.za> Date: Fri, 13 Aug 2010 17:03:24 +0200 Subject: docview: Added include file to project. Some minor code formatting too. --- docview/src/HelpFile.pas | 18 +++++++----------- docview/src/HelpTopic.pas | 5 +---- docview/src/docview.lpi | 6 +++++- 3 files changed, 13 insertions(+), 16 deletions(-) (limited to 'docview/src') diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index bca6aedd..a3801aa5 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -1,12 +1,8 @@ -Unit HelpFile; +unit HelpFile; {$mode objfpc}{$H+} -// NewView - a new OS/2 Help Viewer -// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) -// This software is released under the Gnu Public License - see readme.txt - -Interface +interface // Encapsulates the basic reading of a help file's structure. @@ -653,7 +649,7 @@ type procedure THelpFile.ReadIndex; var - IndexIndex: longint; // I can't resist :-) + IndexIndex: longint; pEntryHeader: pTIndexEntryHeader; EntryText: string; IndexTitleLen: longint; @@ -1097,12 +1093,12 @@ begin + ImageOffset ); except on e: EHelpBitmapException do -{ raise EHelpFileException.Create( 'Error loading help bitmap at' - + IntToStr( ImageOffset ) - + ': ' - + e.Message );} begin result := nil; + raise EHelpFileException.Create( 'Error loading help bitmap at' + + IntToStr( ImageOffset ) + + ': ' + + e.Message ); end; end; end; diff --git a/docview/src/HelpTopic.pas b/docview/src/HelpTopic.pas index e925dd38..a2ae38dc 100644 --- a/docview/src/HelpTopic.pas +++ b/docview/src/HelpTopic.pas @@ -2,10 +2,6 @@ Unit HelpTopic; {$mode objfpc}{$H+} -// NewView - a new OS/2 Help Viewer -// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) -// This software is released under the Gnu Public License - see readme.txt - Interface // This is it - the monster which decodes IPF data. @@ -1065,6 +1061,7 @@ begin BitmapOffset, BitmapFlags, ImageOffsets ); + if State.Spacing AND (OutputString[Length(OutputString)] <> RTF_NewLine) // no space after a line break then diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index e8a7850b..f64b028f 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -32,7 +32,7 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="29"> + <Units Count="30"> <Unit0> <Filename Value="docview.lpr"/> <IsPartOfProject Value="True"/> @@ -175,6 +175,10 @@ <IsPartOfProject Value="True"/> <UnitName Value="HelpBitmap"/> </Unit28> + <Unit29> + <Filename Value="missing.inc"/> + <IsPartOfProject Value="True"/> + </Unit29> </Units> </ProjectOptions> <CompilerOptions> -- cgit v1.2.3-70-g09d2 From 3a4afb8c0f24456796b9522ecae7150400cf3186 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys <graemeg@gmail.com> Date: Sat, 14 Aug 2010 14:07:43 +0200 Subject: docview: move work in implementing image support. * Fixed CreateFromHelpFile so that TFileStream parameter can be stored internall. * Added some extra checks that correct amount of bytes have been read. --- docview/src/HelpBitmap.pas | 50 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'docview/src') diff --git a/docview/src/HelpBitmap.pas b/docview/src/HelpBitmap.pas index 35730fd1..5868f336 100644 --- a/docview/src/HelpBitmap.pas +++ b/docview/src/HelpBitmap.pas @@ -63,10 +63,10 @@ type _UncompressedBlockSize: longint; function GetPaletteSize: longint; procedure BitmapError(Msg: string); - procedure DecompressLZW(var Buffer: Pointer; var Count: PtrInt); + procedure DecompressLZW(var Buffer: Pointer; const Count: integer; var NewBuffer: PByte; var NewCount: integer); procedure ReadBitmapData( Blocks: TList; TotalSize: longint ); public - constructor CreateFromHelpFile(AFileHandle: TFileStream; Offset: longint); + constructor CreateFromHelpFile(var AFileHandle: TFileStream; Offset: longint); destructor Destroy; override; end; @@ -96,9 +96,10 @@ type end; TBitmapBlock = class(TObject) - _Data: PBYTE; + public _Size: uint16; _CompressionType: uint8; + _Data: PBYTE; destructor Destroy; override; end; @@ -108,7 +109,7 @@ begin inherited Destroy; end; -constructor THelpBitmap.CreateFromHelpFile(AFileHandle: TFileStream; Offset: longint); +constructor THelpBitmap.CreateFromHelpFile(var AFileHandle: TFileStream; Offset: longint); var WordsPerLine: longint; LineSize: longint; @@ -123,6 +124,7 @@ var BitmapArrayHeader: INFBITMAPARRAYHEADER; bytes: integer; begin + inherited Create; FileHandle := AFileHandle; FileHandle.Seek(Offset, soBeginning); @@ -173,14 +175,18 @@ begin _Header.OffBits := sizeof( _Header ) + GetPaletteSize; // TODO: Graeme, double check this! // Load palette - _pPalette := GetMem( GetPaletteSize ); - bytes := FileHandle.Read(_pPalette, GetPaletteSize); - if bytes <> GetPaletteSize then - raise EHelpBitmapException.Create( 'Failed to read Palette.' ); + if _Header.cBitCount <= 8 then + begin + _pPalette := GetMem( GetPaletteSize ); + bytes := FileHandle.Read(_pPalette, GetPaletteSize); + if bytes <> GetPaletteSize then + raise EHelpBitmapException.Create( 'Failed to read Palette.' ); + end; // Read data header + FillChar( DataHeader, sizeof( DataHeader ), 0 ); bytes := FileHandle.Read(DataHeader, SizeOf(DataHeader)); - if bytes <> GetPaletteSize then + if bytes <> SizeOf(DataHeader) then raise EHelpBitmapException.Create( 'Failed to read DataHeader.' ); _UncompressedBlockSize := DataHeader.usUncompressedBlockSize; @@ -209,10 +215,9 @@ begin FileHandle.Read(Block._Data, Block._Size); inc( BytesRead, Block._Size ); - Blocks.Add( Block ); - end; + ReadBitmapData( Blocks, sizeof( _Header ) + GetPaletteSize + _BitsSize ); for BlockIndex := 0 to Blocks.Count - 1 do @@ -243,7 +248,7 @@ begin inherited Destroy; end; -procedure THelpBitmap.DecompressLZW(var Buffer: Pointer; var Count: PtrInt); +procedure THelpBitmap.DecompressLZW(var Buffer: Pointer; const Count: Integer; var NewBuffer: PByte; var NewCount: integer); type TLZWString = packed record Count: integer; @@ -254,8 +259,8 @@ const ClearCode = 256; // clear table, start with 9bit codes EoiCode = 257; // end of input var - NewBuffer: PByte; - NewCount: PtrInt; +// NewBuffer: PByte; +// NewCount: PtrInt; NewCapacity: PtrInt; SrcPos: PtrInt; SrcPosBit: integer; @@ -456,9 +461,9 @@ begin end; ReAllocMem(NewBuffer,NewCount); - FreeMem(Buffer); - Buffer:=NewBuffer; - Count:=NewCount; +// FreeMem(Buffer); +// Buffer:=NewBuffer; +// Count:=NewCount; end; @@ -510,11 +515,12 @@ begin if not Assigned( LZWDecompressBlock )then raise EHelpBitmapException.Create( 'Cannot decode bitmap - DLL not found' ); - LZWDecompressBlock( Block._Data, - BitmapOutputPointer, - Block._Size, - BytesWrittenFromBlock, - lastOutByte ); +// DecompressLZW(Block._Data, Block._Size); + //LZWDecompressBlock( Block._Data, + // BitmapOutputPointer, + // Block._Size, + // BytesWrittenFromBlock, + // lastOutByte ); inc( BytesWritten, BytesWrittenFromBlock ); -- cgit v1.2.3-70-g09d2