diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-13 23:13:02 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-13 23:15:33 +0200 |
commit | b9d479f21a532e2625d8a8272e1204c3ff5e95de (patch) | |
tree | af905705c4b627bb3b4454577dfbb835ccd4f4d2 /docview/src | |
parent | 90c55b0f029e8e266bdd0424072f93cd4a51a7fb (diff) | |
download | fpGUI-b9d479f21a532e2625d8a8272e1204c3ff5e95de.tar.xz |
Added a new unit and class to describe a "bookmark" object.
Diffstat (limited to 'docview/src')
-rw-r--r-- | docview/src/HelpBookmark.pas | 49 | ||||
-rw-r--r-- | docview/src/docview.lpi | 15 | ||||
-rw-r--r-- | docview/src/docview.lpr | 2 |
3 files changed, 56 insertions, 10 deletions
diff --git a/docview/src/HelpBookmark.pas b/docview/src/HelpBookmark.pas new file mode 100644 index 00000000..1a49cd75 --- /dev/null +++ b/docview/src/HelpBookmark.pas @@ -0,0 +1,49 @@ +unit HelpBookmark; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, + SysUtils, + HelpFile, + HelpTopic; + +type + TBookmark = class(TObject) + private + FContentsTopic: TTopic; + FName: string; + public + constructor Load(var F: TextFile; HelpFile: THelpFile); + procedure Save(var F: TextFile); + property Name: string read FName write FName; + property ContentsTopic: TTopic read FContentsTopic write FContentsTopic; + end; + + +implementation + +{ TBookmark } + +constructor TBookmark.Load(var F: TextFile; HelpFile: THelpFile); +var + s: string; + ContentsTopicIndex: integer; +begin + inherited Create; + ReadLn(F, FName); + ReadLn(F, s); + ContentsTopicIndex := StrToInt(s); + ContentsTopic := HelpFile.Topics[ContentsTopicIndex]; +end; + +procedure TBookmark.Save(var F: TextFile); +begin + +end; + + +end. + diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index deee6be5..f8145b8a 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -31,7 +31,7 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="35"> + <Units Count="36"> <Unit0> <Filename Value="docview.lpr"/> <IsPartOfProject Value="True"/> @@ -201,6 +201,11 @@ <IsPartOfProject Value="True"/> <UnitName Value="HelpNote"/> </Unit34> + <Unit35> + <Filename Value="HelpBookmark.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpBookmark"/> + </Unit35> </Units> </ProjectOptions> <CompilerOptions> @@ -216,7 +221,6 @@ <IncludeAssertionCode Value="True"/> <AllowLabel Value="False"/> <CPPInline Value="False"/> - <UseAnsiStrings Value="False"/> </SyntaxOptions> </Parsing> <CodeGeneration> @@ -224,13 +228,6 @@ <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> - <Linking> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> <Other> <CompilerMessages> <UseMsgFile Value="True"/> diff --git a/docview/src/docview.lpr b/docview/src/docview.lpr index 812c8e43..33e04591 100644 --- a/docview/src/docview.lpr +++ b/docview/src/docview.lpr @@ -11,7 +11,7 @@ uses IPFFileFormatUnit, HelpWindowDimensions, NewViewConstantsUnit, SettingsUnit, RichTextStyleUnit, CanvasFontManager, ACLStringUtility, RichTextDocumentUnit, RichTextView, RichTextLayoutUnit, RichTextDisplayUnit, dvconstants, dvHelpers, - frm_configuration, HelpBitmap, frm_text, frm_note, HelpNote; + frm_configuration, HelpBitmap, frm_text, frm_note, HelpNote, HelpBookmark; {$IFDEF WINDOWS} {$R docview.rc} |