diff options
266 files changed, 18595 insertions, 28119 deletions
@@ -1,4 +1,5 @@ *.[oa] *.ppu *.lps -*.compiled
\ No newline at end of file +*.compiled +*.bak*
\ No newline at end of file diff --git a/docs/build_html.sh b/docs/build_html.sh index f4eb9f31..fd36b7bf 100755 --- a/docs/build_html.sh +++ b/docs/build_html.sh @@ -29,11 +29,14 @@ $app \ --input='-Fi../src/corelib ../src/corelib/fpg_pofiles.pas' --descr=xml/corelib/fpg_pofiles.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_translations.pas' --descr=xml/corelib/fpg_translations.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.xml \ + --input='-Fi../src -Fu../src/corelib/x11/ -Fi../src/corelib/x11/ -Fu../src/gui/ -Fu../src/corelib/ ../src/corelib/fpg_command_intf.pas' --descr=xml/corelib/fpg_command_intf.xml \ --input='-Fi../src/gui ../src/gui/fpg_dialogs.pas' --descr=xml/gui/fpg_dialogs.xml \ --input='-Fi../src/gui ../src/gui/fpg_hyperlink.pas' --descr=xml/gui/fpg_hyperlink.xml \ --input='-Fi../src/gui ../src/gui/fpg_colormapping.pas' --descr=xml/gui/fpg_colormapping.xml \ --input='-Fi../src/gui ../src/gui/fpg_colorwheel.pas' --descr=xml/gui/fpg_colorwheel.xml \ - --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml + --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml \ + --input='-Fi../src/gui ../src/gui/fpg_tree.pas' --descr=xml/gui/fpg_tree.xml + # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ diff --git a/docs/build_ipf.sh b/docs/build_ipf.sh index 57fe2814..14b0693c 100755 --- a/docs/build_ipf.sh +++ b/docs/build_ipf.sh @@ -9,6 +9,7 @@ $app \ --package=fpgui \ --format=ipf \ --output=fpgui.ipf \ + --duplinkeddoc \ --input='-Fi../src/corelib ../src/corelib/fpg_base.pas' --descr=xml/corelib/fpg_base.xml \ --input='-Fi../src/corelib ../src/corelib/x11/fpg_x11.pas' --descr=xml/corelib/x11/fpg_x11.xml \ --input='-Fi../src/corelib ../src/corelib/gdi/fpg_gdi.pas' --descr=xml/corelib/gdi/fpg_gdi.xml \ @@ -27,11 +28,14 @@ $app \ --input='-Fi../src/corelib ../src/corelib/fpg_pofiles.pas' --descr=xml/corelib/fpg_pofiles.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_translations.pas' --descr=xml/corelib/fpg_translations.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.xml \ + --input='-Fi../src -Fu../src/corelib/x11/ -Fi../src/corelib/x11/ -Fu../src/gui/ -Fu../src/corelib/ ../src/corelib/fpg_command_intf.pas' --descr=xml/corelib/fpg_command_intf.xml \ --input='-Fi../src/gui ../src/gui/fpg_dialogs.pas' --descr=xml/gui/fpg_dialogs.xml \ --input='-Fi../src/gui ../src/gui/fpg_hyperlink.pas' --descr=xml/gui/fpg_hyperlink.xml \ --input='-Fi../src/gui ../src/gui/fpg_colormapping.pas' --descr=xml/gui/fpg_colormapping.xml \ --input='-Fi../src/gui ../src/gui/fpg_colorwheel.pas' --descr=xml/gui/fpg_colorwheel.xml \ - --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml + --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml \ + --input='-Fi../src/gui ../src/gui/fpg_tree.pas' --descr=xml/gui/fpg_tree.xml + # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ diff --git a/docs/build_rtf.sh b/docs/build_rtf.sh index 967f1d21..eb879f05 100755 --- a/docs/build_rtf.sh +++ b/docs/build_rtf.sh @@ -31,7 +31,9 @@ $app \ --input='-Fi../src/gui ../src/gui/fpg_hyperlink.pas' --descr=xml/gui/fpg_hyperlink.xml \ --input='-Fi../src/gui ../src/gui/fpg_colormapping.pas' --descr=xml/gui/fpg_colormapping.xml \ --input='-Fi../src/gui ../src/gui/fpg_colorwheel.pas' --descr=xml/gui/fpg_colorwheel.xml \ - --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml + --input='-Fi../src/gui ../src/gui/fpg_button.pas' --descr=xml/gui/fpg_button.xml \ + --input='-Fi../src/gui ../src/gui/fpg_tree.pas' --descr=xml/gui/fpg_tree.xml + # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ # --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ diff --git a/docs/builddocs.pas b/docs/builddocs.pas new file mode 100644 index 00000000..abf1db89 --- /dev/null +++ b/docs/builddocs.pas @@ -0,0 +1,170 @@ +{ + Simple program to buid a documenation script. + It looks for xml description files. Matches those to source files, + and includes those matches in the documentation script. + + TODO: + * Parameter to build script or execute directly fpdoc. + * Make program build Linux shell scripts and Windows Batch scripts. + * Add parameter to include all units, not just those that have documentation + * Order of files are important to fpdoc, so we need some way of indicating the + order in which files must be processed. +} +program builddocs; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, CustApp; + +const + cFPDOC = 'fpdoc'; + cFPDocParameters = ' --package=fpgui --format=ipf --output=fpgui.ipf --content=fpgui.cnt --duplinkeddoc '; + cFilePath = '-Fi../src -Fu../src/corelib/x11/ -Fi../src/corelib/x11/ -Fu../src/gui/ -Fu../src/corelib/ %s'; + cFileLine = ' --input=''%s'' --descr=%s'; + +type + TBuildDocsApp = class(TCustomApplication) + private + FXMLFiles: TStrings; + FPasFiles: TStrings; + FCommand: string; + procedure FileSearch(SearchDir: string; ExtensionMask: string; var FileList: TStrings; Recursive: boolean = True); + function ExtractFileNameOnly(AFilename: string): string; + procedure BuildScript; + protected + procedure DoRun; override; + public + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + procedure WriteHelp; virtual; + end; + +{ TBuildDocsApp } + +procedure TBuildDocsApp.FileSearch(SearchDir: string; ExtensionMask: string; + var FileList: TStrings; Recursive: boolean); +var + Info : TSearchRec; + ExtensionList: TStrings; +begin + SearchDir := IncludeTrailingPathDelimiter(SearchDir); + + ExtensionList := TStringList.Create; + ExtensionList.Delimiter := ';'; + ExtensionList.DelimitedText := ExtensionMask; + + if FindFirst(SearchDir+AllFilesMask, faAnyFile and faDirectory, Info) = 0 then + begin + repeat + if Recursive then + if ((Info.Attr and faDirectory) = faDirectory) and (Info.Name <> '.') and (Info.Name <> '..')then + FileSearch(SearchDir + Info.Name, ExtensionMask, FileList, Recursive); + + if ExtensionList.IndexOf(ExtractFileExt(Info.Name)) <> -1 then + begin + if FileList.IndexOf(SearchDir + Info.Name) = -1 then + FileList.Add(SearchDir + Info.Name); + end; + until FindNext(Info)<>0; + end; + FindClose(Info); + + ExtensionList.Free; +end; + +function TBuildDocsApp.ExtractFileNameOnly(AFilename: string): string; +var + p: integer; +begin + Result := ExtractFileName(AFilename); + p := Length(ExtractFileExt(Result)); + Result := Copy(Result, 1, Length(Result)-p); +end; + +procedure TBuildDocsApp.BuildScript; +var + lPFile, lXFile: string; + i, j: integer; + lFPDoc: string; +begin + lFPDoc := GetEnvironmentVariable('fpdoc'); + if lFPDoc = '' then + lFPDoc := cFPDOC; + FCommand := lFPDoc + cFPDocParameters; + FileSearch('xml/', '.xml', FXMLFiles, True); + FileSearch('../src/', '.pas', FPasFiles, True); + + for i := 0 to FXMLFiles.Count-1 do + begin + lXFile := ExtractFileNameOnly(FXMLFiles[i]); + for j := 0 to FPasFiles.Count-1 do + begin + lPFile := ExtractFileNameOnly(FPasFiles[j]); + if SameText(lXFile, lPFile) then + begin + FCommand := FCommand + ' \' + LineEnding + Format(cFileLine, [Format(cFilePath, [FPasFiles[j]]), FXMLFiles[i]]); + end; + end; + end; + + FXMLFiles.Text := FCommand; + FXMLFiles.SaveToFile('runme2.sh'); +end; + +procedure TBuildDocsApp.DoRun; +var + ErrorMsg: String; +begin + // quick check parameters + ErrorMsg:=CheckOptions('h','help'); + if ErrorMsg<>'' then begin + ShowException(Exception.Create(ErrorMsg)); + Terminate; + Exit; + end; + + // parse parameters + if HasOption('h','help') then begin + WriteHelp; + Terminate; + Exit; + end; + + BuildScript; + + // stop program loop + Terminate; +end; + +constructor TBuildDocsApp.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + StopOnException:=True; + FXMLFiles := TStringList.Create; + FPasFiles := TStringList.Create; +end; + +destructor TBuildDocsApp.Destroy; +begin + FXMLFiles.Free; + FPasFiles.Free; + inherited Destroy; +end; + +procedure TBuildDocsApp.WriteHelp; +begin + { add your help code here } + writeln('Usage: ',ExeName,' -h'); +end; + +var + Application: TBuildDocsApp; + +begin + Application:=TBuildDocsApp.Create(nil); + Application.Title:='Build Docs App'; + Application.Run; + Application.Free; +end. + diff --git a/docs/xml/corelib/fpg_base.xml b/docs/xml/corelib/fpg_base.xml index be47e910..73174601 100644 --- a/docs/xml/corelib/fpg_base.xml +++ b/docs/xml/corelib/fpg_base.xml @@ -1,15 +1,21 @@ <?xml version="1.0"?>
<fpdoc-descriptions>
- <package name="fpGUI">
- <!--
- ====================================================================
- gfxbase
- ====================================================================
--->
+
+<package name="fpGUI">
+<descr><p>fpGUI Toolkit is intended for Open Source and Commercial applications.
+fpGUI uses the LGPL2 license with the static linking exception - the same as
+the Free Pascal Compiler's RTL.</p>
+<p>fpGUI is an Object Pascal toolkit for cross-platform application development.
+It provides single-source portability across Linux, MS Windows, *BSD and
+embedded systems running Embedded Linux and Windows CE.</p>
+<p>
+For more information, see the fpGUI Toolkit website at: <url href="http://opensoft.homeip.net/fpgui/" />
+</p>
+</descr>
+
<module name="fpg_base">
<short>The base unit and starting point of fpGUI</short>
- <descr>
- <p>This unit contains all the abstract classes for the CoreLib code
+ <descr><p>This unit contains all the abstract classes for the CoreLib code
of fpGUI. It also defines many types and constants used throughout the toolkit.
</p>
<p>When implementing support for a completely new windowing system
@@ -46,25 +52,7 @@ etc.). <!-- record type Visibility: default -->
<element name="TRGBTriple">
<short>A record structure holding the RGBA values of a color.</short>
- <descr>This is now marked as "deprecated". Please use TFPColor instead.</descr>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TRGBTriple.Red">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TRGBTriple.Green">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TRGBTriple.Blue">
- <short/>
- <descr/>
+ <descr>This is now marked as "deprecated". Please use <link id="fpg_base.TFPColor">TFPColor</link> instead.</descr>
<seealso/>
</element>
<!-- variable Visibility: default -->
@@ -91,8 +79,8 @@ means no titlebar or window borders are going to be created.</short> </element>
<!-- enumeration value Visibility: default -->
<element name="TWindowType.wtModalForm">
- <short>This windows type is similar to <link id="TWindowType.wtWindow">wtWindow</link>, but grabs focus.</short>
- <descr>This windows is the same as <link id="TWindowType.wtWindow">wtWindow</link>, but grabs the input focus until it has closed. This window normally doesn't appear in the taskbar.</descr>
+ <short>This windows type is similar to <link id="fpg_base.TWindowType.wtWindow">wtWindow</link>, but grabs focus.</short>
+ <descr>This windows is the same as <link id="fpg_base.TWindowType.wtWindow">wtWindow</link>, but grabs the input focus until it has closed. This window normally doesn't appear in the taskbar.</descr>
</element>
<!-- enumeration value Visibility: default -->
<element name="TWindowType.wtPopup">
@@ -183,7 +171,6 @@ it is shown for the first time.</short> <element name="TGradientDirection">
<short>Enum types defining how a gradient must be painted</short>
<descr/>
- <seealso/>
</element>
<!-- enumeration value Visibility: default -->
<element name="TGradientDirection.gdVertical">
@@ -358,2338 +345,9 @@ it is shown for the first time.</short> <seealso/>
</element>
<!-- constant Visibility: default -->
- <element name="keyNul">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyBackSpace">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyTab">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyLinefeed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyReturn">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyEnter">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyEscape">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDelete">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySpace">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyVoid">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyBreak">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyScrollForw">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyScrollBack">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyBoot">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCompose">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySAK">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyUndo">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyRedo">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMenu">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCancel">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPrintScreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyExecute">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyFind">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyBegin">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyClear">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyInsert">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySelect">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMacro">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHelp">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDo">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPause">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyStop">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySysRq">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyModeSwitch">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyUp">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyLeft">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyRight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPrior">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPageUp">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNext">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPageDown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHome">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyEnd">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF0">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF3">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF4">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF5">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF6">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF7">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF8">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF9">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF10">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF11">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF12">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF13">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF14">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF15">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF16">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF17">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF18">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF19">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF20">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF21">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF22">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF23">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF24">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF25">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF26">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF27">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF28">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF29">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF30">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF31">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF32">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF33">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF34">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF35">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF36">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF37">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF38">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF39">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF40">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF41">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF42">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF43">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF44">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF45">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF46">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF47">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF48">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF49">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF50">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF51">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF52">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF53">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF54">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF55">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF56">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF57">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF58">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF59">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF60">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF61">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF62">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF63">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyF64">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP0">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP3">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP4">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP5">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP6">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP7">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP8">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyP9">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPA">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPB">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPC">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPD">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPE">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPPlus">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPMinus">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPSlash">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPAsterisk">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPStar">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPEqual">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPSeparator">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPDecimal">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPParenLeft">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPParenRight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPSpace">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPEnter">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPTab">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPPlusMinus">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPBegin">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF3">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF4">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF5">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF6">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF7">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF8">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPF9">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyShift">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCtrl">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAlt">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMeta">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySuper">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHyper">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAltGr">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCaps">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNum">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyScroll">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyShiftL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyShiftR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCtrlL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCtrlR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAltL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAltR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMetaL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMetaR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySuperL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySuperR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHyperL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHyperR">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyShiftLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCtrlLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAltLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMetaLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keySuperLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyHyperLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyAltGrLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCapsLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNumLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyScrollLock">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadRing">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadCaron">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadOgonek">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadIota">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadDoubleAcute">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadBreve">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadAboveDot">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadBelowDot">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadVoicedSound">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadSemiVoicedSound">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadAcute">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadCedilla">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadCircumflex">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadDiaeresis">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadGrave">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadTilde">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDeadMacron">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNIL">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyEcuSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyColonSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyCruzeiroSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyFFrancSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyLiraSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyMillSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNairaSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyPesetaSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyRupeeSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyWonSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyNewSheqelSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyDongSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="keyEuroSign">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
<element name="FPG_DEFAULT_FONT_DESC">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="UserNamedColorStart">
- <short/>
+ <short>The default base font used in fpGUI</short>
<descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clAqua">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBlack">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCream">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDkGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clFuchsia">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLime">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLtGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMaroon">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clNavy">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOlive">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPurple">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSilver">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clTeal">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clWhite">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clYellow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clNone">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDefault">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMoneyGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSkyBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMedGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clWindowBackground">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBoxColor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clButtonFace">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clShadow1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clShadow2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clHilite1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clHilite2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clText1">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clText2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clText3">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clText4">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSelection">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSelectionText">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clInactiveSel">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clInactiveSelText">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clScrollBar">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clListBox">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGridLines">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGridHeader">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clWidgetFrame">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clInactiveWgFrame">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clTextCursor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clChoiceListBox">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clUnset">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMenuText">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMenuDisabled">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clAliceBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clAntiqueWhite">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clAquamarine">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clAzure">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBeige">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBisque">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBlanchedAlmond">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBlueViolet">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBrown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clBurlyWood">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCadetBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clChartreuse">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clChocolate">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCoral">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCornflowerBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCornsilk">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCrimson">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clCyan">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkCyan">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkGoldenrod">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkKhaki">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkMagenta">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkOliveGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkOrange">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkOrchid">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkSalmon">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkSeaGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkSlateBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkSlateGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkTurquoise">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDarkViolet">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDeepPink">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDeepSkyBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDimGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clDodgerBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clFireBrick">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clFloralWhite">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clForestGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGainsboro">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGhostWhite">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGold">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGoldenrod">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clGreenYellow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clHoneydew">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clHotPink">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clIndianRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clIndigo">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clIvory">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clKhaki">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLavender">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLavenderBlush">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLawnGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLemonChiffon">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightCoral">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightCyan">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightGoldenrodYellow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightGrey">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightPink">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightSalmon">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightSeaGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightSkyBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightSlateGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightSteelBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLightYellow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLimeGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clLinen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMagenta">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumAquamarine">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumOrchid">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumPurple">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumSeaGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumSlateBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumSpringGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumTurquoise">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMediumVioletRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMidnightBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMintCream">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMistyRose">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clMoccasin">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clNavajoWhite">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOldLace">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOliveDrab">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOrange">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOrangeRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clOrchid">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPaleGoldenrod">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPaleGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPaleTurquoise">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPaleVioletRed">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPaleBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPapayaWhip">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPeachPuff">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPeru">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPink">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPlum">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clPowderBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clRosyBrown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clRoyalBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSaddleBrown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSalmon">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSandyBrown">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSeaGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSeashell">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSienna">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSkyBlue2">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSlateBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSlateGray">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSnow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSpringGreen">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clSteelBlue">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clTan">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clThistle">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clTomato">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clTurquoise">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clViolet">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clWheat">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clWhiteSmoke">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- constant Visibility: default -->
- <element name="clYellowGreen">
- <short/>
- <descr/>
- <seealso/>
</element>
<!-- object Visibility: default -->
<element name="TfpgRect">
@@ -2761,97 +419,37 @@ Spreadsheet program etc. <errors/>
<seealso/>
</element>
- <!-- variable Visibility: default -->
- <element name="TfpgRect.Top">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TfpgRect.Left">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TfpgRect.Width">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TfpgRect.Height">
- <short/>
- <descr/>
- <seealso/>
- </element>
+
<!-- procedure Visibility: default -->
<element name="TfpgRect.SetRect">
<short>A convenience function to quickly set a rectangle structure.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetRect.aleft">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetRect.atop">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetRect.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetRect.aheight">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="TfpgRect.Bottom">
<short>Calculates and returns the bottom position of the rectangle.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgRect.Bottom.Result">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="TfpgRect.Right">
<short>Calculates and returns the Right most position of the rectangle.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgRect.Right.Result">
- <short/>
</element>
+
<!-- procedure Visibility: default -->
<element name="TfpgRect.SetBottom">
<short>Sets the bottom value and recalculates the Height value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetBottom.Value">
- <short/>
</element>
+
<!-- procedure Visibility: default -->
<element name="TfpgRect.SetRight">
<short>Sets the Right value and recalculates the Width value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgRect.SetRight.Value">
- <short/>
</element>
+
<!-- record type Visibility: default -->
<element name="TfpgMsgParmMouse">
<short/>
@@ -3005,505 +603,163 @@ Spreadsheet program etc. or widget has a window handle. Widgets are essentially embedded windows without
titlebars or borders inside a main parent window.
</descr>
- <errors/>
- <seealso/>
</element>
+
+<element name="TfpgWindowBase.UpdateWindowPosition">
+<short>Forces fpGUI to act on window position and size properties</short>
+<descr><p>fpGUI implements what is called "delayed resource allocation". It delays
+some action until everything is ready to go. This delayed action applies to setting
+Widget or Form size and position. Why? Imagine you have a complex form
+with lots of anchors, alignments and OnResize event handlers. Now
+somewhere in there you change the size or position of a component.</p>
+
+<code>
+MyWidget.Left := ...
+MyWidget.Top := ...
+MyWidget.Width := ...
+MyWidget.Height := ...
+</code>
+
+<p>If fpGUI acted immediately, as every property is set, it means it
+would have to recalculate all those widget boundaries, and fire all
+OnResize event handlers of the whole form four times. Once for each
+property - as you set them. Not very efficient! To reduce such
+redundant calculations, fpGUI allows you to set all the properties,
+then act on it once you call <var>UpdateWindowPosition</var>. In most cases fpGUI
+can even reduce the API calls needed, because it could pass for
+example Width and Height via one API call. In the case of X11, it can actually do all
+four values in a single API call. Thus improving efficiency and reduces resize calculatios and screen
+redraws.</p>
+</descr>
+</element>
+
+<element name="TfpgWindowBase.Left">
+<short>Specifies the horizontal coordinate of the left edge of a component relative to its parent</short>
+<descr><p><printshort id="TfpgWindowBase.Left"/>. Use the Left property to determine where the left side
+of the control begins or to reposition the left side of the control.
+</p>
+<remark>fpGUI delays acting on the Top, Left, Width and Height properies of a control until the
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
+help.</remark></descr>
+<seealso>
+<link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">TfpgWindowBase.UpdateWindowPosition</link>
+</seealso>
+</element>
+
+<element name="TfpgWindowBase.Top">
+<short>Specifies the vertical (X) coordinate of the top edge of a component relative to its parent</short>
+<descr><p><printshort id="TfpgWindowBase.Top"/>. Use the Top property to determine where the top side
+of the control begins or to reposition the top side of the control.
+</p>
+<remark>fpGUI delays acting on the Top, Left, Width and Height properies of a control until the
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
+help.</remark></descr>
+<seealso>
+<link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">TfpgWindowBase.UpdateWindowPosition</link>
+</seealso>
+</element>
+
+<element name="TfpgWindowBase.Width">
+<short>Specifies the horizontal size of the control or form in pixels</short>
+<descr><p><printshort id="TfpgWindowBase.Width"/>. Use the Width property
+to read or change the width of the control. For TfpgTabSheet controls of for
+controls that have their Align property set to alTop, alBottom or alClient, changing
+this property at runtime has no effect.
+</p>
+<remark>fpGUI delays acting on the Top, Left, Width and Height properies of a control until the
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
+help.</remark></descr>
+<seealso>
+<link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">TfpgWindowBase.UpdateWindowPosition</link>
+</seealso>
+</element>
+
+<element name="TfpgWindowBase.Height">
+<short>Specifies the vertical size of the control or form in pixels</short>
+<descr><p><printshort id="TfpgWindowBase.Height"/>. Use the Height property
+to read or change the height of the control. For TfpgTabSheet controls of for
+controls that have their Align property set to alLeft, alRight or alClient, changing
+this property at runtime has no effect.
+</p>
+<remark>fpGUI delays acting on the Top, Left, Width and Height properies of a control until the
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
+help.</remark></descr>
+<seealso>
+<link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">TfpgWindowBase.UpdateWindowPosition</link>
+</seealso>
+</element>
+
<!-- object Visibility: default -->
<element name="TfpgCanvasBase">
<short>Abstract class used to represent a Canvas for painting</short>
<descr/>
- <errors/>
- <seealso/>
</element>
<!-- object Visibility: default -->
<element name="TfpgImageBase">
<short>Abstract class used to represent a Image</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function Visibility: private -->
- <element name="TfpgImageBase.GetColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgImageBase.GetColor.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.GetColor.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.GetColor.y">
- <short/>
- </element>
- <!-- procedure Visibility: private -->
- <element name="TfpgImageBase.SetColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.SetColor.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.SetColor.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.SetColor.AValue">
- <short/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FHeight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FColorDepth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FMasked">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FImageData">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FImageDataSize">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FMaskData">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgImageBase.FMaskDataSize">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgImageBase.DoFreeImage">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgImageBase.DoInitImage">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImage.acolordepth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImage.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImage.aheight">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImage.aimgdata">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgImageBase.DoInitImageMask">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImageMask.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImageMask.aheight">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.DoInitImageMask.aimgdata">
- <short/>
- </element>
- <!-- constructor Visibility: public -->
- <element name="TfpgImageBase.Create">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- destructor Visibility: public -->
- <element name="TfpgImageBase.Destroy">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgImageBase.Invert">
<short>Inverts the Image</short>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgImageBase.FreeImage">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
+ <descr><printshort id="TfpgImageBase.Invert"/>. This changes the actual
+data of the image. There is no undo function. So if you want to undo this action,
+you must keep copy of the original image before you call <var>Invert</var>.</descr>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgImageBase.AllocateImage">
<short>Allocates OS resources for the Image</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.AllocateImage.acolordepth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.AllocateImage.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.AllocateImage.aheight">
- <short/>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgImageBase.AllocateMask">
<short>Allocates OS resources for the Image Mask</short>
<descr/>
- <errors/>
- <seealso/>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgImageBase.CreateMaskFromSample">
<short>Creates a mask based on the sample point presented by X and Y parameters</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.CreateMaskFromSample.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.CreateMaskFromSample.y">
- <short/>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgImageBase.UpdateImage">
<short>Updates the internal image resources and OS resources from image data</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgImageBase.ImageData">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgImageBase.ImageDataSize">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgImageBase.MaskData">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgImageBase.MaskDataSize">
- <short/>
- <descr/>
- <seealso/>
</element>
+
<!-- property Visibility: public -->
<element name="TfpgImageBase.Width">
<short>Width of the image</short>
<descr/>
- <seealso/>
</element>
<!-- property Visibility: public -->
<element name="TfpgImageBase.Height">
<short>Height of the image</short>
<descr/>
- <seealso/>
</element>
<!-- property Visibility: public -->
<element name="TfpgImageBase.ColorDepth">
<short>Color depth of the image. Currently 24/32-bit is all that is supported.</short>
<descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgImageBase.Masked">
- <short/>
- <descr/>
- <seealso/>
</element>
+
<!-- property Visibility: public -->
<element name="TfpgImageBase.Colors">
<short>Array property to access a specific color of the image based on X and Y co-ordinates</short>
<descr/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.Colors.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgImageBase.Colors.y">
- <short/>
</element>
+
<!-- object Visibility: default -->
<element name="TfpgFontResourceBase">
<short>Encapsulates the resources of a font</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontResourceBase.GetAscent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontResourceBase.GetAscent.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontResourceBase.GetDescent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontResourceBase.GetDescent.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontResourceBase.GetHeight">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontResourceBase.GetHeight.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontResourceBase.GetTextWidth">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontResourceBase.GetTextWidth.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgFontResourceBase.GetTextWidth.txt">
- <short/>
- </element>
- <!-- object Visibility: default -->
- <element name="TfpgFontBase">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgFontBase.FFontDesc">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgFontBase.FFontRes">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontBase.TextWidth">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontBase.TextWidth.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgFontBase.TextWidth.txt">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontBase.Ascent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontBase.Ascent.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontBase.Descent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontBase.Descent.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgFontBase.Height">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgFontBase.Height.Result">
- <short/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgFontBase.FontDesc">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgFontBase.FontRes">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgFontBase.Handle">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- object Visibility: default -->
- <element name="TfpgCustomInterpolation">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgCustomInterpolation.FCanvas">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgCustomInterpolation.FImage">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCustomInterpolation.Initialize">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Initialize.AImage">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Initialize.ACanvas">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCustomInterpolation.Execute">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Execute.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Execute.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Execute.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCustomInterpolation.Execute.h">
- <short/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCustomInterpolation.Canvas">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCustomInterpolation.Image">
- <short/>
- <descr/>
- <seealso/>
</element>
+
<!-- object Visibility: default -->
<element name="TfpgBaseInterpolation">
<short>A abstract class representing a base Interpolation filter.</short>
@@ -3511,2036 +767,189 @@ titlebars or borders inside a main parent window. Gaussian, Sinc etc... These decendant filters are used in the
<link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> function.
</descr>
- <errors/>
<seealso>
<link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link>
</seealso>
</element>
- <!-- variable Visibility: private -->
- <element name="TfpgBaseInterpolation.xfactor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgBaseInterpolation.yfactor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgBaseInterpolation.xsupport">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgBaseInterpolation.ysupport">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgBaseInterpolation.tempimage">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: private -->
- <element name="TfpgBaseInterpolation.Horizontal">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Horizontal.width">
- <short/>
- </element>
- <!-- procedure Visibility: private -->
- <element name="TfpgBaseInterpolation.Vertical">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Vertical.dx">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Vertical.dy">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Vertical.width">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Vertical.height">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgBaseInterpolation.Execute">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Execute.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Execute.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Execute.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Execute.h">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgBaseInterpolation.Filter">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgBaseInterpolation.Filter.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgBaseInterpolation.Filter.x">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgBaseInterpolation.MaxSupport">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgBaseInterpolation.MaxSupport.Result">
- <short/>
- </element>
- <!-- destructor Visibility: public -->
- <element name="TfpgBaseInterpolation.Destroy">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- object Visibility: default -->
- <element name="TfpgMitchelInterpolation">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgMitchelInterpolation.Filter">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgMitchelInterpolation.Filter.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgMitchelInterpolation.Filter.x">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgMitchelInterpolation.MaxSupport">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgMitchelInterpolation.MaxSupport.Result">
- <short/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgCanvasBase.FFastDoubleBuffer">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgCanvasBase.FInterpolation">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: private -->
- <element name="TfpgCanvasBase.SetInterpolation">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetInterpolation.AValue">
- <short/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FBufferedDraw">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FBeginDrawCount">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FWindow">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FColor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FTextColor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FLineWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FLineStyle">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FFont">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgCanvasBase.FPersistentResources">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoSetFontRes">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetFontRes.fntres">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoSetTextColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetTextColor.cl">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoSetColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetColor.cl">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoSetLineStyle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetLineStyle.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetLineStyle.astyle">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoGetWinRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoGetWinRect.r">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoFillRectangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillRectangle.h">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoXORFillRectangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoXORFillRectangle.col">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoXORFillRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoXORFillRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoXORFillRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoXORFillRectangle.h">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoFillTriangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.x1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.y1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.x2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.y2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.x3">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillTriangle.y3">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoDrawRectangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawRectangle.h">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoDrawLine">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawLine.x1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawLine.y1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawLine.x2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawLine.y2">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoDrawImagePart">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.img">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.xi">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.yi">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawImagePart.h">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoDrawString">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawString.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawString.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawString.txt">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoSetClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoSetClipRect.ARect">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgCanvasBase.DoGetClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgCanvasBase.DoGetClipRect.Result">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoAddClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoAddClipRect.ARect">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoClearClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoBeginDraw">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoBeginDraw.awin">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoBeginDraw.buffered">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoPutBufferToScreen">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoPutBufferToScreen.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoPutBufferToScreen.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoPutBufferToScreen.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoPutBufferToScreen.h">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoEndDraw">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgCanvasBase.GetPixel">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgCanvasBase.GetPixel.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GetPixel.X">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GetPixel.Y">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.SetPixel">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetPixel.X">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetPixel.Y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetPixel.AValue">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoDrawArc">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.a1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoDrawArc.a2">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgCanvasBase.DoFillArc">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.a1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DoFillArc.a2">
- <short/>
- </element>
- <!-- constructor Visibility: public -->
- <element name="TfpgCanvasBase.Create">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- destructor Visibility: public -->
- <element name="TfpgCanvasBase.Destroy">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
<!-- procedure Visibility: public -->
<element name="TfpgCanvasBase.DrawRectangle">
<short>Draws a rectangle.</short>
<descr>
<printshort id="TfpgCanvasBase.DrawRectangle"/> You can specify the size of the rectangle via X, Y, Width and Height parameters or via a TfpgRect parameter.</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawRectangle.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawRectangle.r">
- <short/>
</element>
+
<!-- procedure Visibility: public -->
<element name="TfpgCanvasBase.DrawLine">
<short>Draws a line</short>
<descr>
<printshort id="TfpgCanvasbase.DrawLine"/>. This method draws a line from (x1,y1) to (x2,y2), but does not draw the last pixel. All supported backends follow the Microsoft API and doesn't draw the last pixel. This optimises consecutive lines being drawn without overlapping pixels.</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawLine.x1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawLine.y1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawLine.x2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawLine.y2">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.DrawImage">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImage.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImage.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImage.img">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.DrawImagePart">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.img">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.xi">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.yi">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawImagePart.h">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.DrawArc">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.a1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawArc.a2">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.StretchDraw">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.StretchDraw.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.StretchDraw.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.StretchDraw.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.StretchDraw.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.StretchDraw.ASource">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.CopyRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.CopyRect.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.CopyRect.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.CopyRect.ACanvas">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.CopyRect.SourceRect">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.DrawString">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawString.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawString.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.DrawString.txt">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.FillRectangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillRectangle.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillRectangle.r">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.FillTriangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.x1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.y1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.x2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.y2">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.x3">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillTriangle.y3">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.FillArc">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.a1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.FillArc.a2">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.GradientFill">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GradientFill.ARect">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GradientFill.AStart">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GradientFill.AStop">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GradientFill.ADirection">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.XORFillRectangle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.col">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.XORFillRectangle.r">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.SetClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetClipRect.ARect">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgCanvasBase.GetClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgCanvasBase.GetClipRect.Result">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.AddClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.AddClipRect.ARect">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.ClearClipRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.Clear">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.Clear.AColor">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.GetWinRect">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.GetWinRect.r">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.SetColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetColor.AColor">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.SetTextColor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetTextColor.AColor">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.SetLineStyle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetLineStyle.AWidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetLineStyle.AStyle">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.SetFont">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.SetFont.AFont">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.BeginDraw">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.BeginDraw.ABuffered">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.EndDraw">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.EndDraw.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.EndDraw.y">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.EndDraw.w">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.EndDraw.h">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.EndDraw.ARect">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgCanvasBase.FreeResources">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.Color">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.TextColor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.Font">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.Pixels">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.Pixels.X">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgCanvasBase.Pixels.Y">
- <short/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.InterpolationFilter">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.FastDoubleBuffer">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.LineStyle">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgCanvasBase.LineWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgWindowBase.FParent">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- procedure Visibility: private -->
- <element name="TfpgWindowBase.SetMouseCursor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.SetMouseCursor.AValue">
- <short/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FMouseCursor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FWindowType">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FWindowAttributes">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FTop">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FLeft">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FHeight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FMinWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FMinHeight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgWindowBase.FCanvas">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgWindowBase.HandleIsValid">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.HandleIsValid.Result">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoUpdateWindowPosition">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoUpdateWindowPosition.aleft">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoUpdateWindowPosition.atop">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoUpdateWindowPosition.awidth">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoUpdateWindowPosition.aheight">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoAllocateWindowHandle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoAllocateWindowHandle.AParent">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoReleaseWindowHandle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoSetWindowVisible">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoSetWindowVisible.AValue">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoMoveWindow">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoMoveWindow.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoMoveWindow.y">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgWindowBase.DoWindowToScreen">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.DoWindowToScreen.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoWindowToScreen.ASource">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoWindowToScreen.AScreenPos">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoSetWindowTitle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.DoSetWindowTitle.ATitle">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.DoSetMouseCursor">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.SetParent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.SetParent.AValue">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgWindowBase.GetParent">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.GetParent.Result">
- <short/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgWindowBase.GetCanvas">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.GetCanvas.Result">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.AllocateWindowHandle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.ReleaseWindowHandle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.SetWindowTitle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.SetWindowTitle.ATitle">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.SetHeight">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.SetHeight.AValue">
- <short/>
- </element>
- <!-- procedure Visibility: protected -->
- <element name="TfpgWindowBase.SetWidth">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.SetWidth.AValue">
- <short/>
- </element>
- <!-- constructor Visibility: public -->
- <element name="TfpgWindowBase.Create">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.Create.AOwner">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.AfterConstruction">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.AdjustWindowStyle">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.SetWindowParameters">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgWindowBase.Right">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.Right.Result">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgWindowBase.Bottom">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.Bottom.Result">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.UpdateWindowPosition">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.MoveWindow">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.MoveWindow.x">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.MoveWindow.y">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgWindowBase.WindowToScreen">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgWindowBase.WindowToScreen.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.WindowToScreen.ASource">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgWindowBase.WindowToScreen.AScreenPos">
- <short/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.CaptureMouse">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- procedure Visibility: public -->
- <element name="TfpgWindowBase.ReleaseMouse">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.HasHandle">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.WindowType">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.WindowAttributes">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Left">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Top">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Width">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Height">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.MinWidth">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.MinHeight">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Canvas">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.Parent">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgWindowBase.MouseCursor">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- object Visibility: default -->
- <element name="TfpgApplicationBase">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgApplicationBase.FMainForm">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgApplicationBase.FTerminated">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: private -->
- <element name="TfpgApplicationBase.FTopModalForm">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- variable Visibility: protected -->
- <element name="TfpgApplicationBase.FIsInitialized">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- function Visibility: protected -->
- <element name="TfpgApplicationBase.DoGetFontFaceList">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgApplicationBase.DoGetFontFaceList.Result">
- <short/>
- </element>
- <!-- constructor Visibility: public -->
- <element name="TfpgApplicationBase.Create">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="TfpgApplicationBase.Create.AParams">
- <short/>
- </element>
- <!-- function Visibility: public -->
- <element name="TfpgApplicationBase.GetFontFaceList">
- <short/>
- <descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="TfpgApplicationBase.GetFontFaceList.Result">
- <short/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgApplicationBase.IsInitialized">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgApplicationBase.TopModalForm">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgApplicationBase.MainForm">
- <short/>
- <descr/>
- <seealso/>
- </element>
- <!-- property Visibility: public -->
- <element name="TfpgApplicationBase.Terminated">
- <short/>
- <descr/>
- <seealso/>
</element>
+
<!-- function Visibility: default -->
<element name="KeycodeToText">
<short>Returns the text representation of a keycode.</short>
<descr>This is mainly used for debugging, but could also be used for Menu Item keyboard
shortcuts etc.
</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="KeycodeToText.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="KeycodeToText.AKey">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="KeycodeToText.AShiftState">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="CheckClipboardKey">
<short>Detects if the pressed keys represent a Clipboard key shortcut</short>
<descr>Detects if the pressed keys represent a Clipboard key shortcut. If it does, it
returns the correct enum type detected.
</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="CheckClipboardKey.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="CheckClipboardKey.AKey">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="CheckClipboardKey.AShiftstate">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="fpgColorToRGBTriple">
<short>Converts the TfpgColor to TRGBTriple type</short>
- <descr>This function converts the given TfpgColor into a TRGBTriple type.
-</descr>
- <errors/>
+ <descr>This function converts the given TfpgColor into a TRGBTriple type.</descr>
<seealso>
- <link id="TRGBTriple"/>
+ <link id="fpg_base.TRGBTriple">TRGBTriple</link>
</seealso>
</element>
- <!-- function result Visibility: default -->
- <element name="fpgColorToRGBTriple.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgColorToRGBTriple.AColor">
- <short/>
- </element>
+
<!-- function Visibility: default -->
<element name="RGBTripleTofpgColor">
<short>Converts the TRGBTriple to TfpgColor type</short>
<descr>This function converts the given TRGBTriple into a TfpgColor type.
</descr>
- <errors/>
<seealso>
- <link id="TRGBTriple"/>
+ <link id="fpg_base.TRGBTriple">TRGBTriple</link>
</seealso>
</element>
- <!-- function result Visibility: default -->
- <element name="RGBTripleTofpgColor.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="RGBTripleTofpgColor.AColor">
- <short/>
- </element>
<!-- function Visibility: default -->
<element name="fpgGetRed">
<short>Returns the Red portion of a color value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="fpgGetRed.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetRed.AColor">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="fpgGetGreen">
<short>Returns the Green portion of a color value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="fpgGetGreen.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetGreen.AColor">
- <short/>
</element>
<!-- function Visibility: default -->
<element name="fpgGetBlue">
<short>Returns the Blue portion of a color value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="fpgGetBlue.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetBlue.AColor">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="fpgGetAlpha">
<short>Returns the Alpha portion of a color value.</short>
<descr/>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="fpgGetAlpha.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetAlpha.AColor">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="fpgGetAvgColor">
<short>Calculates the average color using the two supplied</short>
<descr>This function calculates and returns the average color by using AColor1
and AColor2. The Alpha value also gets taken into account.
</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="fpgGetAvgColor.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetAvgColor.AColor1">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="fpgGetAvgColor.AColor2">
- <short/>
</element>
+
<!-- function Visibility: default -->
<element name="PtInRect">
<short>Returns true if APoint is inside ARect rectangle</short>
<descr>This function is used to detect if the point APoint is inside the given
rectangle ARect. If it is, the function returns True, otherwise False.
</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- function result Visibility: default -->
- <element name="PtInRect.Result">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="PtInRect.ARect">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="PtInRect.APoint">
- <short/>
</element>
+
<!-- procedure Visibility: default -->
<element name="SortRect">
<short>Fixes the Top, Bottom and Left, Right to always represent a valid rectangle</short>
<descr>This function fixes a rectangle so that the Left point is always smaller than the
Right. And the Top is always smaller than the Bottom.
</descr>
- <errors/>
- <seealso/>
- </element>
- <!-- argument Visibility: default -->
- <element name="SortRect.ARect">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="SortRect.left">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="SortRect.top">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="SortRect.right">
- <short/>
- </element>
- <!-- argument Visibility: default -->
- <element name="SortRect.bottom">
- <short/>
</element>
+
<element name="TfpgCanvasBase.DrawLineClipped">
<short>Draws a line inside a clip rectangle</short>
- <descr>
- <p>
- <printshort id="TfpgCanvasBase.DrawLineClipped"/>. This procedure clips a line to the AClipRect boundaries and
+ <descr><p><printshort id="TfpgCanvasBase.DrawLineClipped"/>. This procedure clips a line to the AClipRect boundaries and
then calls the DrawLine procedure with the clipped coordinates. If the line
lies completely outside of the clip boundary, then the Line routine is not
called. This procedure uses the well known Cohen-Sutherland line clipping
- algorithm to clip each coordinate.
-</p>
- <p>Use this if you did not what to change the Canvas.ClipRegion for some reason.
+ algorithm to clip each coordinate.</p>
+<p>Use this if you do not want to change the Canvas.ClipRegion for some reason.
For a detailed explanation see: http://www.nondot.org/~sabre/graphpro/line6.html
-</p>
- </descr>
+</p></descr>
</element>
+
<element name="TfpgCanvasBase.ClipLine">
<short>Clips the line based on AClipRect boundaries.</short>
<descr>This does not do any drawing, in only clips the line coordinates. This method is used internally by <link id="TfpgCanvasBase.DrawLineClipped"/>.</descr>
</element>
+
<element name="TFileEntry">
<short>A simple data object representing a file</short>
- <descr>
- <printshort id="TFileEntry"/>. Some properties are OS dependant.</descr>
+ <descr><printshort id="TFileEntry"/>. Some properties are OS dependant.</descr>
+
</element>
<element name="TFileEntry.Name">
<short>Name of a file</short>
</element>
+
<element name="TFileEntry.Extension">
<short>The extension of a file</short>
</element>
+
<element name="TFileEntry.Size">
<short>Size of a file in bytes</short>
</element>
+
<element name="TFileEntry.IsLink">
<short>Is this item a symbolic link (on unix-type OSes)</short>
</element>
+
<element name="TFileEntry.LinkTarget">
<short>If it is a symbolic link, LinkTarget is what it points too</short>
</element>
+
<element name="TFileEntry.ModTime">
<short>Last modified timestamp</short>
</element>
+
<element name="TFPColor">
<short>A record structure holding the RGBA values of a color.</short>
<descr>This is the same declaration as the one found in FPImage (include with Free Pascal Compiler). In future when FPImage is integrated with fpGUI, I will remove this declaration.</descr>
</element>
+
+<element name="TfpgPoint.ManhattanLength">
+<short>Quick calculation of the length between points</short>
+<descr><p>Returns the sum of the absolute values of X and Y,
+traditionally known as the "Manhattan length" of the vector from
+the origin to the point. For example:</p>
+<code>
+var
+ oldPosition: TfpgPoint;
+ newPosition: TfpgPoint;
+begin
+ newPosition := MousePosition - oldPosition;
+ if (newPosition.ManhattanLength > 5) then
+ begin
+ // the mouse has moved more than 5 pixels since the oldPosition
+ end;
+end;
+</code>
+<p>
+Accuracy is traded for speed. This is a useful, and quick to calculate, approximation to the
+true length:</p>
+<code>
+ TrueLength := sqrt(power(X, 2) + power(Y, 2));
+</code>
+<p>
+The tradition of "Manhattan length" arises because such distances
+apply to travelers who can only travel on a rectangular grid, like
+the streets of Manhattan.</p>
+<p>For a further explanation of "Manhattan length" see the WikiPedia article at
+<link>http://en.wikipedia.org/wiki/Taxicab_geometry</link></p>
+</descr>
+</element>
+
+
</module>
<!-- fpg_base -->
</package>
diff --git a/docs/xml/corelib/fpg_command_intf.xml b/docs/xml/corelib/fpg_command_intf.xml new file mode 100644 index 00000000..03ec28bb --- /dev/null +++ b/docs/xml/corelib/fpg_command_intf.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<fpdoc-descriptions> +<package name="fpGUI"> + +<module name="fpg_command_intf"> +<short>This unit defines the Command design pattern interfaces used by fpGUI</short> +<descr><p><printshort id="fpg_command_intf"/>. The Command design pattern is similar to +the TActions from Delphi or Lazarus.</p></descr> + +<element name="ICommand"> +<short>This interface represents a Command</short> +<descr><printshort id="ICommand"/>. Currently in only defines one procedure called <var>Execute</var>.</descr> +</element> + + +<element name="ICommandHolder"> +<short>An interface that allows to Get or Set a Command</short> +<descr><printshort id="ICommandHolder"/>. An example of a class that implements this interface +is the <link id="fpg_button.TfpgBaseButton">TfpgBaseButton</link> class.</descr> +</element> + +</module> + +</package> +</fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_constants.xml b/docs/xml/corelib/fpg_constants.xml index e02dd9c7..52377575 100644 --- a/docs/xml/corelib/fpg_constants.xml +++ b/docs/xml/corelib/fpg_constants.xml @@ -6,11 +6,21 @@ <short>All constants used in fpGUI are defined here</short> <descr><p><printshort id="fpg_constants"/>. All the text constants defined here, are also the ones that get translated to multiple languages. Currently fpGUI -and translations for: Afrikaans, German, English (default), Spanish, French, -Italian, Portuguese (Brazil) and Russian.</p> +has translations for:</p> +<ul> +<li>Afrikaans</li> +<li>German</li> +<li>English (default language - but is user selectable)</li> +<li>Spanish</li> +<li>French</li> +<li>Italian</li> +<li>Portuguese (Brazilian)</li> +<li>Russian</li> +</ul> <p>To change the default (compiled in) language used by fpGUI, simply enabled -one of the language DEFINES in the interface section of the fpg_constants unit. -</p> +one of the language DEFINES in the interface section of the fpg_constants unit.</p> +<p>For more details on changing the default language of fpGUI Toolkit, see the topic +"<link id="#fpgui.AdditionalTopics.ChangingDefaultLanguage">Changing the default language</link>".</p> </descr> <element name="fpgAddColon"> <short>A utility function to add a colon at the correct location in a string</short> @@ -26,6 +36,7 @@ one of the language DEFINES in the interface section of the fpg_constants unit. <element name="DOUBLECLICK_DISTANCE"> <short>Maximum distance a mouse pointer can move between two left-clicks and still trigger a double click event</short> </element> + </module> </package> </fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_imgfmt_bmp.xml b/docs/xml/corelib/fpg_imgfmt_bmp.xml index 9bee3087..aad03cc2 100644 --- a/docs/xml/corelib/fpg_imgfmt_bmp.xml +++ b/docs/xml/corelib/fpg_imgfmt_bmp.xml @@ -4,8 +4,7 @@ <module name="fpg_imgfmt_bmp"> <short>BMP image reader implementation</short> -<descr>This unit implements a BMP (Bitmap) image reader. -</descr> +<descr><p>This unit implements a BMP (Bitmap) image reader.</p></descr> <!-- procedure Visibility: default --> <element name="ReadImage_BMP"> @@ -15,9 +14,8 @@ <!-- function Visibility: default --> <element name="LoadImage_BMP"> <short>Load's the image from the file specified.</short> -<descr>This functions loads the BMP image from the file specified and returns -a TfpgImage object representing the BMP file. -</descr> +<descr><p>This functions loads the BMP image from the file specified and returns +a <link id="fpg_main.TfpgImage">TfpgImage</link> object representing the BMP file.</p></descr> </element> <!-- function result Visibility: default --> @@ -32,8 +30,8 @@ a TfpgImage object representing the BMP file. <!-- function Visibility: default --> <element name="CreateImage_BMP"> -<short>Creates a TfpgImage representing a BMP file from data in memory.</short> -<descr>Creates a TfpgImage representing a BMP file from data in memory. +<short>Creates a <link id="fpg_main.TfpgImage">TfpgImage</link> representing a BMP file from data in memory.</short> +<descr><printshort id="CreateImage_BMP"/>. </descr> </element> diff --git a/docs/xml/corelib/fpg_main.xml b/docs/xml/corelib/fpg_main.xml index 574931ed..f98efa3d 100644 --- a/docs/xml/corelib/fpg_main.xml +++ b/docs/xml/corelib/fpg_main.xml @@ -15,7 +15,7 @@ <descr>fpgPostMessage posts a message to the event queue, but doesn't wait for it to compelete. It returns immediately.</descr> <errors/> <seealso> - <link id="fpgSendMessage"/> + <link id="fpg_main.fpgSendMessage"/> </seealso> </element> <!-- procedure Visibility: default --> @@ -24,7 +24,7 @@ <descr>fpgSendMessage sends a message to the event queue and waits for it to complete before it returns.</descr> <errors/> <seealso> - <link id="fpgPostMessage"/> + <link id="fpg_main.fpgPostMessage"/> </seealso> </element> <element name="fpgColorToRGB"> @@ -62,7 +62,7 @@ is simply an index value, but later translated to a real RGB value via the themi <short>Prints rectangle information to console</short> <descr><printshort id="PrintRect"/>. This is a helper function for debugging purposes.</descr> <seealso> - <link id="#fpgui.fpg_base.TfpgRect">TfpgRect</link> + <link id="fpg_base.TfpgRect">TfpgRect</link> </seealso> </element> <element name="TfpgStyle"> @@ -72,6 +72,13 @@ fpGUI will be totally reworked to supply built-in and image based theming.</p><p document named <var>theming_spec.txt</var> in the "docs" folder for details of what is planned.</p></descr> </element> + +<element name="fpgRect"> +<seealso> +<link id="fpg_base.TfpgRect">TfpgRect</link> +</seealso> +</element> + </module> <!-- fpg_main --> </package> diff --git a/docs/xml/corelib/fpg_utils.xml b/docs/xml/corelib/fpg_utils.xml index 2b4f74fe..6c0ad9df 100644 --- a/docs/xml/corelib/fpg_utils.xml +++ b/docs/xml/corelib/fpg_utils.xml @@ -4,16 +4,14 @@ <module name="fpg_utils"> <short>Utility functions.</short> -<descr>Utility functions used throughout fpGUI. Some have common -implementations and some have platform specific implementations. -</descr> +<descr><p>Utility functions used throughout fpGUI. Some have common +implementations and some have platform specific implementations.</p></descr> <!-- function Visibility: default --> <element name="fpgToOSEncoding"> <short>Converts string from fpGUI to OS specific filesystem encoding</short> <descr>This function is specific to filesystem strings like Paths, Filenames - and Directories. -</descr> + and Directories.</descr> </element> <!-- function Visibility: default --> diff --git a/docs/xml/corelib/fpg_widget.xml b/docs/xml/corelib/fpg_widget.xml index cb0ed0f5..6868c78a 100644 --- a/docs/xml/corelib/fpg_widget.xml +++ b/docs/xml/corelib/fpg_widget.xml @@ -1,40 +1,57 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="fpGUI"> - <module name="fpg_widget"> - <short/> - <descr/> - <!-- procedure Visibility: public --> - <element name="TfpgWidget.SetPosition"> - <short>Sets the position and size of the component.</short> - <descr>Sets the position and size of the component. It also fires the Resize message. If you are setting up a component like a button on a form, you don't really want the resize event to fire for the button, before the form is displayed (visible). In that case, rather use the components Top, Left, Width and Height properties.</descr> - </element> - <element name="TfpgWidget.FormDesigner"> - <short>If assigned, then this widget is being editing in the Form Designer</short> - </element> - <element name="TfpgWidget.Parent"> - <short>An alias for Owner.</short> - <descr>Unlike Delphi or Lazarus, fpGUI treats Owner and Parent as the same thing. Owner or Parent manages the life of children, and the parent/child hierarchy defines the visual aspect as well.</descr> - </element> - <element name="TfpgWidget.IsContainer"> - <short>Can this component managed child components.</short> - <descr>This is mainly used in fpGUI UI Designer, to know if you can drop on widget inside another widget.</descr> - </element> - <element name="TfpgWidget.Focusable"> - <short>This determines if the widget is allowed to received keyboard focus.</short> - </element> - <element name="TfpgWidget.Anchors"> - <short>Allows the component to resize or reposition based on its Parent.</short> - <descr> - <p>By default Anchors are set to Top Left.</p> - <p> - <b>NOTE</b> - </p> - <p>Anchoring only takes affect <i>after</i> the component is visible on the screen (when the component has a window handle assigned). So if you create a Button in the constructor and set its Anchor property to Bottom/Right, and then set the size of the Form, the Button will <i>not</i> be repositioned. -</p> - <p>This is by design. fpGUI allows you to setup a window layout without triggering unnecesary events as you set property values for each widget. Only when csLoading is not in ComponentState, then anchoring events will be triggered. This allows the developer or the fpGUI UI Designer to setup a window layout undisturbed.</p> - </descr> - </element> - </module> - </package> +<package name="fpGUI"> +<module name="fpg_widget"> +<short/> +<descr/> + +<element name="TfpgWidget.SetPosition"> +<short>Sets the position and size of the component</short> +<descr><printshort id="TfpgWidget.SetPosition"/>. It also fires the Resize message. If you are setting up a component like a button on a form, you don't really want the resize event to fire for the button, before the form is displayed (visible). In that case, rather use the components Top, Left, Width and Height properties.</descr> +<seealso> +<link id="fpg_base.TfpgWindowBase.UpdateWindowPosition">TfpgWindowBase.UpdateWindowPosition</link> +</seealso> +</element> + +<element name="TfpgWidget.FormDesigner"> +<short>If assigned, then this widget is being editing in the Form Designer</short> +</element> + +<element name="TfpgWidget.Parent"> +<short>An alias for Owner</short> +<descr>Unlike Delphi or Lazarus, fpGUI treats Owner and Parent as the same thing. Owner or Parent manages the life of children, and the parent/child hierarchy defines the visual aspect as well.</descr> +</element> + +<element name="TfpgWidget.IsContainer"> +<short>Can this component managed child components</short> +<descr>This is mainly used in fpGUI UI Designer, to know if you can drop on widget inside another widget.</descr> +</element> + +<element name="TfpgWidget.Focusable"> +<short>This determines if the widget is allowed to received keyboard focus</short> +<descr><printshort id="TfpgWidget.Focusable"/>. No focus rectangle will be drawn, even +if the user clicks this component.</descr> +</element> + +<element name="TfpgWidget.Anchors"> +<short>Allows the component to resize or reposition based on its Parent.</short> +<descr><p>By default Anchors are set to Top Left.</p> +<remark>Anchoring only takes affect <i>after</i> the component is visible on the +screen (when the component has a window handle assigned). So if you create a Button +in the constructor and set its Anchor property to Bottom/Right, and then set the +size of the Form, the Button will <i>not</i> be repositioned.</remark> +<p>This is by design. fpGUI allows you to setup a window layout without triggering unnecesary events as you set property values for each widget. Only when csLoading is not in ComponentState, then anchoring events will be triggered. This allows the developer or the fpGUI UI Designer to setup a window layout undisturbed.</p> +</descr> +</element> + +<element name="TfpgWidget.HandleLMouseUp"> +<short>Occurs after the component processed the mouse button press event</short> +<descr><printshort id="TfpgWidget.HandleLMouseUp"/>. By default this method also +triggers the OnClick event, but this behaviour can be overridden by descendant +components.</descr> +</element> + + +</module> +</package> </fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_wuline.xml b/docs/xml/corelib/fpg_wuline.xml index d5a56b33..fd689971 100644 --- a/docs/xml/corelib/fpg_wuline.xml +++ b/docs/xml/corelib/fpg_wuline.xml @@ -4,9 +4,8 @@ <module name="fpg_wuline"> <short>Xioalin Wu's anti-aliased line drawing algorithm implementation</short> -<descr><printshort id="fpg_wuline"/>. For more details see the following Wikipedia page: -http://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm -</descr> +<descr><p><printshort id="fpg_wuline"/>. For more details see the following Wikipedia page: +<url href="http://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm" /></p></descr> </module> diff --git a/docs/xml/fpgui_topic_defaultlanguage.xml b/docs/xml/fpgui_topic_defaultlanguage.xml new file mode 100644 index 00000000..a4d3fa79 --- /dev/null +++ b/docs/xml/fpgui_topic_defaultlanguage.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<fpdoc-descriptions> +<package name="fpGUI"> +<topic name="AdditionalTopics"> +<short>Additional Topics</short> + +<topic name="ChangingDefaultLanguage"> +<short>Changing the default language</short> +<descr><p>Inside the <var>fpg_constants.pas</var> unit there are a few commented language +defines. If no language specific Define is set, then fpGUI defaults to the English +language. So say you want to change the default language to German, simply uncomment +the <b>de</b> define, and recompile fpGUI. +</p> +<p>Here is a list of current supported languages and their commented defines as they +appear in the <var>fpg_constants</var> unit.</p> +<code> +{.$DEFINE de} // German +{.$DEFINE ru} // Russian +{.$DEFINE fr} // French +{.$DEFINE pt} // Portuguese (Brazil) +{.$DEFINE af} // Afrikaans +{.$DEFINE it} // Italian +{.$DEFINE es} // Spanish +</code> +</descr> + + +</topic> +</topic> +</package> +</fpdoc-descriptions> diff --git a/docs/xml/fpgui_topic_dnd.xml b/docs/xml/fpgui_topic_dnd.xml new file mode 100644 index 00000000..3c0f4346 --- /dev/null +++ b/docs/xml/fpgui_topic_dnd.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<fpdoc-descriptions> +<package name="fpGUI"> +<topic name="AdditionalTopics"> +<short>Additional Topics</short> +<topic name='DND'> + +<short>Drag and Drop</short> + +<descr><p>Drag and drop provides a simple visual mechanism which users can use +to transfer information between and within applications. [In the literature this +is referred to as a "direct manipulation model".] Drag and drop is similar in +function to the clipboard's cut and paste mechanism. +</p> +<p>This topic describes the basic drag and drop mechanism and outlines the +approach used to enable it in custom widgets. +</p> +<p><b>Drag and Drop Classes</b></p> +<p>These classes deal with drag and drop and the necessary mime type encoding and +decoding.</p> +<dl> +<dt>TfpgDrag</dt><dd>The Object that initializes the drag and drop action, and +that manages the lifespan of the TfpgMimeData instance.</dd> +<dt>TfpgMimeData</dt><dd>This class manages data and a mime type describing that +data.</dd> +</dl> +</descr> + +</topic> +</topic> +</package> +</fpdoc-descriptions> diff --git a/docs/xml/gui/fpg_button.xml b/docs/xml/gui/fpg_button.xml index 137231ce..dec53067 100644 --- a/docs/xml/gui/fpg_button.xml +++ b/docs/xml/gui/fpg_button.xml @@ -47,9 +47,10 @@ simply publishes various properties for runtime type information.</descr> <link id="fpg_button.TfpgBaseButton">TfpgBaseButton</link> </seealso> </element> - <element name="TfpgButton.ImageName" link="TfpgBaseButton.ImageName"/> - <element name="TfpgButton.ImageSpacing" link="TfpgBaseButton.ImageSpacing"/> - <element name="TfpgButton.ImageLayout" link="TfpgBaseButton.ImageLayout"/> + +<element name="TfpgButton.ImageName" link="TfpgBaseButton.ImageName"/> +<element name="TfpgButton.ImageSpacing" link="TfpgBaseButton.ImageSpacing"/> +<element name="TfpgButton.ImageLayout" link="TfpgBaseButton.ImageLayout"/> </module> </package> diff --git a/docs/xml/gui/fpg_colormapping.xml b/docs/xml/gui/fpg_colormapping.xml index 0a88ca1e..f605d782 100644 --- a/docs/xml/gui/fpg_colormapping.xml +++ b/docs/xml/gui/fpg_colormapping.xml @@ -10,11 +10,11 @@ HSV (Hue, Saturation, Value) colorspace. The parameters have specific value ranges as listed below.</p> <dl> -<dt>Hue</dt> +<dt><i>Hue</i></dt> <dd>The Hue range is from 0 - 1535. In that range, the primary colors are mapped to the following values. Red = 0. Green = 512 and Blue = 1024.</dd> -<dt>Saturation</dt> +<dt><i>Saturation</i></dt> <dd>The Saturation value range is from 0.0 - 1.0. Grey (no color) = 0. Maximum color = 1.0.</dd> -<dt>Value</dt> +<dt><i>Value</i></dt> <dd>The Value value range is from 0.0 to 1.0. Black being 0 and maximum brightness being 1.0.</dd> </dl> </descr> @@ -22,7 +22,7 @@ listed below.</p> <element name="HSVToRGB"> <short>Map HSV colorspace to RGB colorspace.</short> <seealso> - <link id="RGBToHSV"/> + <link id="fpg_colormapping.RGBToHSV">RGBToHSV</link> </seealso> </element> </module> diff --git a/docs/xml/gui/fpg_colorwheel.xml b/docs/xml/gui/fpg_colorwheel.xml index 0ec24bdf..0ed78f44 100644 --- a/docs/xml/gui/fpg_colorwheel.xml +++ b/docs/xml/gui/fpg_colorwheel.xml @@ -7,12 +7,12 @@ <p> <b>Using the components:</b> </p> - <p>Normally, you use both a color wheel and a value bar. + <p>Normally, you use both a <i>color wheel</i> and a <i>value bar</i>. </p> <ol> <li>Put a color wheel on your form.</li> <li>Put a value bar on your form beside the wheel.</li> - <li>Set the ColorWheel's ValueBar property to the ValueBar component + <li>Set the ColorWheel's <var>ValueBar</var> property to the ValueBar component you just put on the form.</li> </ol> <p>The two components are now linked together. When a selection is @@ -25,10 +25,8 @@ only be displayed at runtime.</p> <p> <b>Reading and setting the color:</b> </p> - <p>To set the color being displayed, use the SetSelectedColor method -of the color wheel.</p> - <p>To read the color selected, read the SelectedColor property -of the ValueBar.</p> + <p>To set the color being displayed, use the <link id="fpg_colorwheel.TfpgColorWheel.SetSelectedColor">TfpgColorWheel.SetSelectedColor</link> method.</p> + <p>To read the color selected, read the <link id="fpg_colorwheel.TfpgValueBar.SelectedColor">TfpgValueBar.SelectedColor</link> property.</p> <p>If you want to know when the user picks a color, you can use the OnChange event in the ValueBar.</p> </descr> diff --git a/docs/xml/gui/fpg_dialogs.xml b/docs/xml/gui/fpg_dialogs.xml index 40b17cde..3df4c24f 100644 --- a/docs/xml/gui/fpg_dialogs.xml +++ b/docs/xml/gui/fpg_dialogs.xml @@ -129,7 +129,7 @@ not specified the caption of the message box will be 'Message'. <element name="SelectFontDialog"> <short>A convenience function to show the font selection dialog.</short> <seealso> - <link id="TfpgFontSelectDialog"/> + <link id="fpg_dialogs.TfpgFontSelectDialog">TfpgFontSelectDialog</link> </seealso> </element> diff --git a/docs/xml/gui/fpg_form.xml b/docs/xml/gui/fpg_form.xml new file mode 100644 index 00000000..3dfb01fc --- /dev/null +++ b/docs/xml/gui/fpg_form.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<fpdoc-descriptions> + <package name="fpGUI"> + <module name="fpg_form"> + <short>This unit contains the class implementation representing a Form/Window on the screen</short> + <descr/> + +<element name="TWindowPosition.wpUser"> +<descr>OS or Desktop/Window manager decides the position.</descr> +</element> + +<element name="TWindowPosition.wpAuto"> +<descr>Window gets placed in exact x,y coordinates set by developer.</descr> +</element> + +<element name="TWindowPosition.wpScreenCenter"> +<descr>Window gets centered horizontally and vertically in the current desktop window.</descr> +</element> + +<element name="TWindowPosition.wpOneThirdDown"> +<descr>Following the "golden ratio 1.618" rules or ideas as to what is +pleasing to the eye. The window is positioned one third from +the top of the screen, using the desktop height to calculate, and centered +horizontally. +</descr> +</element> + + </module> + </package> +</fpdoc-descriptions> diff --git a/docs/xml/gui/fpg_hyperlink.xml b/docs/xml/gui/fpg_hyperlink.xml index f9239fa5..0c3d507c 100644 --- a/docs/xml/gui/fpg_hyperlink.xml +++ b/docs/xml/gui/fpg_hyperlink.xml @@ -3,9 +3,9 @@ <package name="fpGUI"> <module name="fpg_hyperlink"> <short>A label component that can launch a web browser</short> - <descr>This component acts like a link found in a web page. You can assign a + <descr><p>This component acts like a link found in a web page. You can assign a target URL and if the user clicks on the component, it will launch a web browser -using the target URL as destination.</descr> +using the target URL as destination.</p></descr> <element name="TfpgHyperlink"> <short>A <var>TfpgCustomLabel</var> descendant that implements hyperlink support</short> <descr>This is a class to implement a hyperlink. Of course, such as all diff --git a/docs/xml/gui/fpg_tree.xml b/docs/xml/gui/fpg_tree.xml new file mode 100644 index 00000000..60af7603 --- /dev/null +++ b/docs/xml/gui/fpg_tree.xml @@ -0,0 +1,162 @@ +<?xml version="1.0"?> +<fpdoc-descriptions> +<package name="fpGUI"> + +<module name="fpg_tree"> +<short>This unit defines a tree view control</short> +<descr><p><printshort id="fpg_tree"/>. A tree view displays items in an indented +outline. The control provides buttons that allow nodes to be expanded and collapsed. +You can include icons with items' text labels and display different icons to +indicate whether a node is expanded or collapsed.</p> +</descr> + + +<element name="TfpgTreeView"> +<short>Represents a window that displays a hierachy list of items</short> +<descr><p><printshort id="TfpgTreeView"/>. Examples of such hierachies can be +the headings in a document, the entries in a index, or the files and directories +on a disk.</p> +<p>Use TfpgTreeView to add an expanding and contracting outline to a form. Each node +in a tree view control consists of a label and a number of optional bitmapped images. +Each node can have a list of subnodes associated with it. By clicking on a node, +the user can expand or collapse the associated list of subnodes.</p> +<remark>There is basic column support, but this is still very experimental.</remark></descr> +</element> + +<element name="TfpgTreeView.FullCollapse"> +<short>Collapses all the nodes within a tree view control</short> +<descr><printshort id="TfpgTreeView.FullCollapse"/>. Call FullCollapse to hide +all the nodes in the tree view except those at the first level. All node buttons +will change from '-' to '+'.</descr> +<seealso> + <link id="TfpgTreeView.FullExpand"/> +</seealso> +</element> + +<element name="TfpgTreeView.FullExpand"> +<short>Expands all nodes within the tree view control</short> +<descr><printshort id="TfpgTreeView.FullExpand"/>. Call FullExpand to display +all the nodes in the tree view. All node buttons will change from '+' to '-'.</descr> +<seealso> + <link id="TfpgTreeView.FullCollapse"/> +</seealso> +</element> + +<element name="TfpgTreeView.GotoNextNodeUp"> +<short>Moves the selection to the previous node up the tree</short> +</element> + +<element name="TfpgTreeView.GotoNextNodeDown"> +<short>Moves the selection to the next node down the tree</short> +</element> + +<element name="TfpgTreeView.NextNode"> +<short>Return the next node after ANode</short> +<descr><printshort id="TfpgTreeView.NextNode"/>. This function will step into child +nodes as well, to return the correct node. It works on the actual nodes in the tree, +and not just the visible nodes in the tree.</descr> +<seealso> + <link id="TfpgTreeView.PrevNode"/> +</seealso> +</element> + +<element name="TfpgTreeView.PrevNode"> +<short>Return the previous node starting from ANode</short> +<descr><printshort id="TfpgTreeView.PrevNode"/>. This function will step into child +nodes as well, to insure it returns the correct node. It works on the actual nodes +in the tree, and not just on the visible nodes.</descr> +<seealso> + <link id="TfpgTreeView.NextNode"/> +</seealso> +</element> + +<element name="TfpgTreeview.NextVisualNode"> +<short>Return the next visible node starting from ANode</short> +<descr><printshort id="TfpgTreeview.NextVisualNode"/>. This works exactly the same +as <var>NextNode</var> function, but this time it only acts on nodes that are visible.</descr> +<seealso> + <link id="TfpgTreeview.NextNode"/> +</seealso> +</element> + +<element name="TfpgTreeview.PrevVisualNode"> +<short>Return the previous visible node starting from ANode</short> +<descr><printshort id="TfpgTreeview.PrevVisualNode"/>. This works exactly the same +as <var>PrevNode</var> function, but this time it only acts on nodes that are visible.</descr> +<seealso> + <link id="TfpgTreeview.PrevNode"/> +</seealso> +</element> + +<element name="TfpgTreeview.Font"> +<short>This gives you read access to the internal Font resource</short> +<descr><printshort id="TfpgTreeview.Font"/>. If you want to change the font used +in the tree view, use the <link id="TfpgTreeview.FondDesc">FondDesc</link> property instead.</descr> +<seealso> + <link id="TfpgTreeview.FontDesc"/> +</seealso> +</element> + +<element name="TfpgTreeview.RootNode"> +<short>Returns the first node of the tree where all other nodes branch from</short> +<descr><printshort id="TfpgTreeview.RootNode"/>. This node is not a visible node, and +is the internal node all other nodes in the tree branches from.</descr> +</element> + +<element name="TfpgTreeview.Selection"> +<short>Specifies the selected node in the tree vie</short> +<descr><p><printshort id="TfpgTreeview.Selection"/>. Read <var>Selection</var> to access +the selected node of the tree view. If there is no selected node, the value returned +is nil.</p> +<p>Set <var>Selection</var> to set the node in the tree view. If the new node is +a child of a collapsed node, the tree view will automatically +expand the nodes and scroll the new selected node into view. As the parent nodes are +expanded, so the tree view will trigger the OnExpand event as well.</p></descr> +</element> + +<element name="TfpgTreeview.ImageList"> +<short>Refers to the image list associated with the tree view</short> +<descr><printshort id="TfpgTreeview.ImageList"/>. Use the <var>ImageList</var> to +provide a customised list of bitmaps that can be displayed with the node's text. Use +the node's <link id="TfpgTreeNode.ImageIndex">ImageIndex</link> property to specify the +bitmap that must be painted next to the node's text.</descr> +<seealso> + <link id="TfpgTreeNode.ImageIndex"/> +</seealso> +</element> + +<element name="TfpgTreeview.PopupMenu"> +<short>Identifies the pop-up menu associated with the tree view</short> +<descr><printshort id="TfpgTreeview.PopupMenu"/>. Assign a value to <var>PopupMenu</var> +to make a popup-menu appear when the user selects the control and clicks the right mouse +button.</descr> +</element> + +<element name="TfpgTreeview.DefaultColumnWidth"> +<short>Is the default with of columns displayed in the tree view</short> +<descr><p><printshort id="TfpgTreeview.DefaultColumnWidth"/>.</p> +<remark>There is basic column support, but this is still very experimental.</remark></descr> +</element> + +<element name="TfpgTreeview.FontDesc"> +<short>Specifies the font used for the tree view</short> +<descr><printshort id="TfpgTreeview.FontDesc"/>. You can specify the font name and size +in the format <var>fontname-size:attributes</var>, or you can use any of the font +aliases that has been setup. A font alias is a short name for some specific font, font size +and attribute all in one. A font alias is in the format <var>#aliasname</var>.</descr> +</element> + + +<element name="TfpgTreeview.HandleLMouseUp" link="fpg_widget.TfpgWidget.HandleLMouseUp"/> +<element name="TfpgTreeview.HandleLMouseDown" link="fpg_widget.TfpgWidget.HandleLMouseDown"/> +<element name="TfpgTreeview.HandleRMouseUp" link="fpg_widget.TfpgWidget.HandleRMouseUp"/> +<element name="TfpgTreeview.HandleDoubleClick" link="fpg_widget.TfpgWidget.HandleDoubleClick"/> +<element name="TfpgTreeview.HandleKeyPress" link="fpg_widget.TfpgWidget.HandleKeyPress"/> +<element name="TfpgTreeview.HandleMouseScroll" link="fpg_widget.TfpgWidget.HandleMouseScroll"/> + + +</module> + +</package> +</fpdoc-descriptions> + diff --git a/docview/components/richtext/ACLStringUtility.pas b/docview/components/richtext/ACLStringUtility.pas index 5ddcb2b7..76dd0fe7 100644 --- a/docview/components/richtext/ACLStringUtility.pas +++ b/docview/components/richtext/ACLStringUtility.pas @@ -215,20 +215,6 @@ Procedure ParseConfigLine( const S: string; // Removes spaces around the separator in the given string Procedure RemoveSeparatorSpaces( var S: string; const Separator:string ); -{$ifdef os2} -// ------------ Ansi String utilities ------------------------ - -// Right & left trim that works with AnsiStrings. -Function AnsiTrim( const S: AnsiString ): AnsiString; - -Procedure AnsiParseConfigLine( const S: Ansistring; - var keyName: Ansistring; - var keyValue: Ansistring ); - -Function AnsiExtractNextValue( var CSVString: AnsiString; - const Separator: AnsiString ): AnsiString; - -{$endif} // ------------- Lists of strings, and strings as lists ----------- @@ -922,39 +908,6 @@ Begin Result := ( UppercaseC >= 'A' ) and ( UppercaseC <= 'Z' ); end; -{$ifdef os2} -// Returns true if s is only spaces (or empty) -Function IsSpaces( const s: string ): boolean; -Begin - Asm - MOV ESI,s // get address of s into ESI - MOV CL,[ESI] // get length of s - MOVZX ECX, CL // widen CL - INC ECX - -!IsSpacesLoop: - INC ESI // move to next char - DEC ECX - JE !IsSpacesTrue - - MOV AL,[ESI] // load character - CMP AL,32 // is it a space? - JE !IsSpacesLoop // yes, go to next - - // no, return false - MOV EAX, 0 - JMP !IsSpacesDone - -!IsSpacesTrue: - MOV EAX, 1 - -!IsSpacesDone: - LEAVE - RETN32 4 - End; - -End; -{$else} // Returns true if s is only spaces (or empty) Function IsSpaces( const s: string ): boolean; var @@ -970,7 +923,6 @@ Begin end; result := true; end; -{$endif} Function StrLeft0Pad( const n: integer; const width: integer ): string; Begin @@ -1268,83 +1220,6 @@ begin Result:= StartString + '1'; end; -{$ifdef OS2} - -Function AnsiTrim( const S: AnsiString ): AnsiString; -Var - i: longint; -Begin - i:= 1; - while i<length( S) do - begin - if S[ i ]<>' ' then - break; - inc( i ); - end; - Result:= S; - if i>1 then - AnsiDelete( Result, 1, i-1 ); - i:= length( Result ); - while i>=1 do - begin - if S[ i ]<>' ' then - break; - dec( i ); - end; - AnsiSetLength( Result, i ); -End; - -Procedure AnsiParseConfigLine( const S: Ansistring; - var keyName: Ansistring; - var keyValue: Ansistring ); -Var - line: AnsiString; - EqualsPos: longint; -Begin - KeyName:= ''; - KeyValue:= ''; - - line:= AnsiTrim( S ); - EqualsPos:= AnsiPos( '=', line ); - - if ( EqualsPos>0 ) then - begin - KeyName:= AnsiCopy( line, 1, EqualsPos-1 ); - KeyName:= AnsiTrim( KeyName ); - - KeyValue:= AnsiCopy( line, EqualsPos+1, length( line )-EqualsPos ); - KeyValue:= AnsiTrim( KeyValue ); - end; -end; - -Function AnsiExtractNextValue( var CSVString: AnsiString; - const Separator: AnsiString ): AnsiString; -Var - SeparatorPos: integer; -Begin - SeparatorPos:= AnsiPos( Separator, CSVString ); - if SeparatorPos>0 then - begin - Result:= AnsiCopy( CSVString, 1, SeparatorPos-1 ); - AnsiDelete( CSVString, 1, SeparatorPos + length( Separator ) - 1 ); - end - else - begin - Result:= CSVString; - CSVString:= ''; - end; - Result:= AnsiTrim( Result ); - // Remove qyotes if present - if ( Result[1] = chr(34) ) - and ( Result[ length(Result) ] = chr(34) ) then - begin - AnsiDelete( Result, 1, 1 ); - AnsiDelete( Result, length( Result ), 1 ); - Result:= AnsiTrim( Result ); - end; -end; -{$Endif} - Procedure ReverseList( TheList:TStrings ); Var TempList: TStringList; diff --git a/docview/components/richtext/CanvasFontManager.pas b/docview/components/richtext/CanvasFontManager.pas index 7996c16d..ed3abf08 100644 --- a/docview/components/richtext/CanvasFontManager.pas +++ b/docview/components/richtext/CanvasFontManager.pas @@ -15,12 +15,16 @@ Const // This defines the fraction of a pixel that // font character widths will be given in FontWidthPrecisionFactor = 1; // 256 seems to be specific to OS/2 API - DefaultTopicFont = 'Sans'; + DefaultTopicFontName = 'Arial'; DefaultTopicFontSize = '10'; - DefaultTopicFixedFont = 'Courier New'; + DefaultTopicFixedFontName = 'Courier New'; DefaultTopicFixedFontSize = '10'; + DefaultTopicFont = DefaultTopicFontName + '-' + DefaultTopicFontSize; + DefaultTopicFixedFont = DefaultTopicFixedFontName + '-' + DefaultTopicFixedFontSize; + + Type {Standard Font types} TFontType=(ftBitmap,ftOutline); @@ -146,6 +150,7 @@ uses ,ACLStringUtility ,nvUtilities ,fpg_stringutils + ,SettingsUnit ; @@ -345,13 +350,13 @@ end; procedure GetDefaultFonts; begin // courier new is common and reasonably nice - DefaultOutlineFixedFace := FindFaceName( 'Courier New' ); + DefaultOutlineFixedFace := FindFaceName( DefaultTopicFixedFontName ); if DefaultOutlineFixedFace = nil then begin DefaultOutlineFixedFace := GetFirstOutlineFace( true ); // first fixed outline face end; - DefaultOutlineProportionalFace := FindFaceName( DefaultTopicFont ); + DefaultOutlineProportionalFace := FindFaceName( DefaultTopicFontName ); if DefaultOutlineProportionalFace = nil then begin DefaultOutlineProportionalFace := GetFirstOutlineFace( false ); // first prop outline face @@ -408,6 +413,7 @@ begin End; End; + fl.Free; // pick some for defaults GetDefaultFonts; end; @@ -454,17 +460,17 @@ end; function SubstituteBitmapFontToOutline( const FaceName: string ): string; begin if StringsSame( FaceName, 'Helv' ) then - result := DefaultTopicFont + result := DefaultTopicFontName else if StringsSame( FaceName, 'Helvetica' ) then - result := DefaultTopicFont + result := DefaultTopicFontName else if StringsSame( FaceName, 'Tms Rmn' ) then result := 'Times New Roman' else if StringsSame( FaceName, 'System Proportional' ) then - result := DefaultTopicFont + result := DefaultTopicFontName else if StringsSame( FaceName, 'System Monospaced' ) then - result := DefaultTopicFixedFont + result := DefaultTopicFixedFontName else if StringsSame( FaceName, 'System VIO' ) then - result := DefaultTopicFixedFont + result := DefaultTopicFixedFontName else result := FaceName; // no substitution end; @@ -567,10 +573,16 @@ begin FCanvas.Font := fpgApplication.DefaultFont; // delete each logical font and our record of it - for i := 0 to FLogicalFonts.Count - 1 do + for i := FLogicalFonts.Count-1 downto 0 do begin - lFont := TLogicalFont(FLogicalFonts[ i ]); - lFont.Free; + // TODO: This must be fixed. If we don't use try..except we sometimes get AV's on lFont.Free + // TODO: TLogicalFont must be totally removed from DocView. + try + lFont := TLogicalFont(FLogicalFonts[i]); + lFont.Free; + except + // do nothing + end; end; FLogicalFonts.Clear; FLogicalFonts.Free; diff --git a/docview/components/richtext/RichTextDisplayUnit.pas b/docview/components/richtext/RichTextDisplayUnit.pas index 6009e7e2..b8e18264 100644 --- a/docview/components/richtext/RichTextDisplayUnit.pas +++ b/docview/components/richtext/RichTextDisplayUnit.pas @@ -35,7 +35,6 @@ Implementation uses SysUtils -// ACLString, ACLUtility, ,RichTextDocumentUnit ,fpg_base ,fpg_main diff --git a/docview/components/richtext/RichTextDocumentUnit.pas b/docview/components/richtext/RichTextDocumentUnit.pas index dd2f9a96..a3e951d1 100644 --- a/docview/components/richtext/RichTextDocumentUnit.pas +++ b/docview/components/richtext/RichTextDocumentUnit.pas @@ -151,7 +151,6 @@ function CopyPlainTextToBuffer( StartP: PChar; Implementation uses -// BseDOS, // for NLS/case mapping SysUtils ,ACLStringUtility ; diff --git a/docview/components/richtext/RichTextLayoutUnit.pas b/docview/components/richtext/RichTextLayoutUnit.pas index 4c6cf427..9b684349 100644 --- a/docview/components/richtext/RichTextLayoutUnit.pas +++ b/docview/components/richtext/RichTextLayoutUnit.pas @@ -10,7 +10,8 @@ Interface Uses Classes, CanvasFontManager, - RichTextDocumentUnit, RichTextStyleUnit, + RichTextDocumentUnit, + RichTextStyleUnit, fpg_imagelist; Type @@ -117,11 +118,7 @@ Implementation Uses SysUtils -// PMWin, BseDos, Dos, ClipBrd, Printers, -// ACLUtility, ,ACLStringUtility -// ACLString, -// ControlScrolling; ,nvUtilities ,fpg_main ; @@ -604,12 +601,12 @@ var begin case Style.Alignment of taLeft: - Result := Style.LeftMargin * FontWidthPrecisionFactor; + Result := Style.LeftMargin; taRight: - Result := Style.LeftMargin * FontWidthPrecisionFactor + Result := Style.LeftMargin + FLayoutWidth - - Style.RightMargin * FontWidthPrecisionFactor + - Style.RightMargin - Line.Width; taCenter: @@ -620,10 +617,9 @@ begin // |<-----line width------> | // space = layoutw-rm-linew SpaceOnLine := FLayoutWidth - - Style.RightMargin * FontWidthPrecisionFactor + - Style.RightMargin - Line.Width; // Note: line width includes left margin - Result := Style.LeftMargin * FontWidthPrecisionFactor - + SpaceOnLine div 2; + Result := Style.LeftMargin + (SpaceOnLine div 2); end; end; end; @@ -644,13 +640,12 @@ Var NewMarginX: longint; StartedDrawing: boolean; begin - Line := TLayoutLine(FLines[ LineIndex ]); - P := Line.Text; - EndP := Line.Text + Line.Length; - + Line := TLayoutLine(FLines[ LineIndex ]); + P := Line.Text; + EndP := Line.Text + Line.Length; Style := Line.Style; - FFontManager.SetFont( Style.Font ); + FFontManager.SetFont( Style.Font ); StartedDrawing := false; Link := ''; @@ -674,8 +669,7 @@ begin // so work out alignment X := GetStartX( Style, Line ); - if X div FontWidthPrecisionFactor - > XToFind then + if X > XToFind then begin // found before the start of the line // don't set link @@ -690,8 +684,7 @@ begin // Now find out how wide the thing is inc( X, GetElementWidth( Element ) ); - if X div FontWidthPrecisionFactor - > XToFind then + if X > XToFind then begin // found Offset := PCharDiff( P, Line.Text ); @@ -718,7 +711,7 @@ begin PerformStyleTag( Element.Tag, Style, X ); - NewMarginX := Style.LeftMargin * FontWidthPrecisionFactor; + NewMarginX := Style.LeftMargin; if NewMarginX > X then begin //skip across... @@ -774,7 +767,7 @@ begin if GetCharIndex( P ) - GetCharIndex( Line.Text ) >= Offset then begin - X := X div FontWidthPrecisionFactor; + X := X; // found exit; end; @@ -796,7 +789,7 @@ begin Style, X ); - NewMarginX := Style.LeftMargin * FontWidthPrecisionFactor; + NewMarginX := Style.LeftMargin; if NewMarginX > X then begin //skip across... @@ -811,7 +804,7 @@ begin if not StartedDrawing then X := GetStartX( Style, Line ); - X := X div FontWidthPrecisionFactor; + X := X; end; function TRichTextLayout.GetLineFromPosition( YToFind: longint; @@ -836,7 +829,7 @@ begin begin LineHeight := TLayoutLine(FLines[ LineIndex ]).Height; if ( YToFind >= Y ) - and ( YToFind < Y + LineHeight ) then + and ( YToFind < (Y + LineHeight)) then begin // YToFind is within the line Result := tpWithinText; @@ -844,7 +837,7 @@ begin exit; end; - inc( Y, TLayoutLine(FLines[ LineIndex ]).Height ); + inc( Y, LineHeight ); inc( LineIndex ); end; @@ -933,9 +926,7 @@ begin if IsValidBitmapIndex( BitmapIndex ) then begin Bitmap := FImages.Item[BitmapIndex].Image; - Result := Trunc(Bitmap.Width - * FontWidthPrecisionFactor - * FHorizontalImageScale); + Result := Trunc(Bitmap.Width * FHorizontalImageScale); end; end; diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index 64612b0e..cfdde684 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -61,8 +61,7 @@ type function GetMargin_Top: longint; Procedure SetMargin_Top( NewValue: longint ); Procedure SetupComponent; - Procedure AssignFont( Var Font: TfpgFont; - NewFont: TfpgFont ); + Procedure AssignFont(var AFont: TfpgFont; NewFont: TfpgFont); // Hide properties... property Name; @@ -131,6 +130,7 @@ uses SysUtils, ACLStringUtility ,nvUtilities + ,SettingsUnit // , ACLProfile ; @@ -271,7 +271,7 @@ ProfileEvent('DEBUG: ApplyStyleTag >>>'); if ( Tag.TagType = ttSetLeftMargin ) and ( MarginParam1 = 'here' ) then begin - Style.LeftMargin := X {div FontWidthPrecisionFactor}; + Style.LeftMargin := X; end else begin @@ -296,8 +296,7 @@ ProfileEvent('DEBUG: ApplyStyleTag >>>'); NewMargin := MarginSize * FontManager.MaximumCharWidth; msSpecifiedChar: NewMargin := MarginSize - * FontManager.CharWidth( Chr( Settings.MarginChar ) ) - div FontWidthPrecisionFactor; + * FontManager.CharWidth( Chr( Settings.MarginChar ) ); end; end; except @@ -305,11 +304,9 @@ ProfileEvent('DEBUG: ApplyStyleTag >>>'); end; if Tag.TagType = ttSetLeftMargin then - Style.LeftMargin := Settings.Margins.Left - + NewMargin + Style.LeftMargin := Settings.Margins.Left + NewMargin else - Style.RightMargin := Settings.Margins.Right - + NewMargin; + Style.RightMargin := Settings.Margins.Right + NewMargin; end; tmpFontParts.Free; end; { teSet[left|right]margin } @@ -323,11 +320,11 @@ end; function GetDefaultStyle( const Settings: TRichTextSettings ): TTextDrawStyle; begin FillChar(Result, SizeOf(TTextDrawStyle), 0); - FPGuiFontToFontSpec( Settings.FNormalFont, Result.Font ); - Result.Alignment := Settings.FDefaultAlignment; - Result.Wrap := Settings.FDefaultWrap; - Result.Color := Settings.FDefaultColor; - Result.BackgroundColor := Settings.FDefaultBackgroundColor; + FPGuiFontToFontSpec( Settings.NormalFont, Result.Font ); + Result.Alignment := Settings.DefaultAlignment; + Result.Wrap := Settings.DefaultWrap; + Result.Color := Settings.DefaultColor; + Result.BackgroundColor := Settings.DefaultBackgroundColor; Result.LeftMargin := Settings.Margins.Left; Result.RightMargin := Settings.Margins.Right; end; @@ -337,11 +334,11 @@ Procedure TRichTextSettings.SetupComponent; begin Name := 'RichTextSettings'; - FNormalFont := fpgGetFont('Arial-10'); - FFixedFont := fpgGetFont('Courier New-10'); - FHeading1Font := fpgGetFont('Arial-20'); - FHeading2Font := fpgGetFont('Arial-14'); - FHeading3Font := fpgGetFont('Arial-10:bold'); + FNormalFont := fpgGetFont(Settings.NormalFontDesc); // fpgGetFont(DefaultTopicFont); + FFixedFont := fpgGetFont(Settings.FixedFontDesc); // fpgGetFont(DefaultTopicFixedFont); + FHeading1Font := fpgGetFont(DefaultTopicFontName + '-20'); + FHeading2Font := fpgGetFont(DefaultTopicFontName + '-14'); + FHeading3Font := fpgGetFont(DefaultTopicFontName + '-10:bold'); FDefaultColor := clBlack; FDefaultBackgroundColor := clWhite; @@ -353,12 +350,12 @@ begin FMarginSizeStyle := msMaximumCharWidth; FMarginChar := Ord( ' ' ); - FMargins.Left := 0; - FMargins.Right := 0; - FMargins.Top := 0; + FMargins.Left := 0; + FMargins.Right := 0; + FMargins.Top := 0; FMargins.Bottom := 0; - FUpdateCount := 0; + FUpdateCount := 0; FChangesPending := false; end; @@ -505,18 +502,16 @@ begin Result := FontA.FontDesc = FontB.FontDesc; end; -Procedure TRichTextSettings.AssignFont( Var Font: TfpgFont; - NewFont: TfpgFont ); +Procedure TRichTextSettings.AssignFont(var AFont: TfpgFont; NewFont: TfpgFont ); begin If NewFont = Nil Then NewFont := fpgApplication.DefaultFont; - if FontSame( NewFont, Font ) then + if FontSame( NewFont, AFont ) then exit; // no change - Font.Free; - Font := NewFont; -// Font.Free; + AFont.Free; + AFont := NewFont; Change; End; diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas index ec1af338..e32c71ee 100644 --- a/docview/components/richtext/RichTextView.pas +++ b/docview/components/richtext/RichTextView.pas @@ -14,7 +14,6 @@ Uses fpg_imagelist, RichTextStyleUnit, RichTextLayoutUnit, -// RichTextDocumentUnit, CanvasFontManager; { @@ -50,9 +49,10 @@ Type TLinkEvent = procedure( Sender: TRichTextView; Link: string ) of object; - TRichTextView = Class( TfpgWidget ) + TRichTextView = class(TfpgWidget) private FPopupMenu: TfpgPopupMenu; + FScrollDistance: integer; procedure FVScrollbarScroll(Sender: TObject; position: integer); procedure FHScrollbarScroll(Sender: TObject; position: integer); procedure ShowDefaultPopupMenu(const x, y: integer; const shiftstate: TShiftState); virtual; @@ -64,6 +64,7 @@ Type Procedure SmoothScrollMIClick( Sender: TObject ); Procedure DebugMIClick( Sender: TObject ); Procedure DefaultMenuPopup( Sender: TObject ); + procedure SetScrollDistance(const AValue: integer); protected FFontManager: TCanvasFontManager; FRichTextSettings: TRichTextSettings; @@ -80,12 +81,12 @@ Type FOnClickLink: TLinkEvent; FDefaultMenu: TfpgPopupMenu; - FSelectAllMI: TfpgMenuItem; - FCopyMI: TfpgMenuItem; - FRefreshMI: TfpgMenuItem; - FWordWrapMI: TfpgMenuItem; - FSmoothScrollMI: TfpgMenuItem; - FDebugMI: TfpgMenuItem; + FSelectAllMI: TfpgMenuItem; + FCopyMI: TfpgMenuItem; + FRefreshMI: TfpgMenuItem; + FWordWrapMI: TfpgMenuItem; + FSmoothScrollMI: TfpgMenuItem; + FDebugMI: TfpgMenuItem; // Internal layout data FNeedVScroll, FNeedHScroll: boolean; @@ -138,6 +139,7 @@ Type procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; + procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; //procedure ScanEvent( Var KeyCode: TKeyCode; // RepeatCount: Byte ); override; @@ -244,8 +246,7 @@ Type PreserveSelection: boolean ); procedure MakeRowVisible( Row: longint ); - procedure MakeRowAndColumnVisible( Row: longint; - Column: longint ); + procedure MakeRowAndColumnVisible(Row: longint; Column: longint); // These two methods set selection start and end, // and redraw the screen, but do not set up cursor. @@ -367,6 +368,7 @@ Type property RichTextSettings: TRichTextSettings read FRichTextSettings; property ScrollBarWidth: longint read FScrollBarWidth write SetScrollBarWidth default 15; property SmoothScroll: boolean read FSmoothScroll write FSmoothScroll; + property ScrollDistance: integer read FScrollDistance write SetScrollDistance default 75; property UseDefaultMenu: boolean read FUseDefaultMenu write FUseDefaultMenu default True; property Debug: boolean read FDebug write SetDebug default False; property Images: TfpgImageList read FImages write SetImages; @@ -395,9 +397,6 @@ Type //Property OnSetupShow; //Property OnScan; - Protected - //Property Font; - End; @@ -407,7 +406,6 @@ uses SysUtils ,ACLStringUtility ,nvUtilities -// ControlScrolling, ControlsUtility, ,RichTextDocumentUnit ,RichTextDisplayUnit ; @@ -516,16 +514,12 @@ begin FSelectionEnd := -1; FSelectionStart := -1; - - // clear display of selection - { TODO -oGraeme : Draw must not be called here } -// Draw( StartLine, EndLine ); - Canvas.SetClipRect(OldClip); end; FSelectionEnd := -1; FSelectionStart := -1; + Repaint; end; Function TRichTextView.GetTextEnd: longint; @@ -539,7 +533,9 @@ begin FDefaultMenu.OnShow := @DefaultMenuPopup; FSelectAllMI := FDefaultMenu.AddMenuItem('Select &All', '', @SelectAllMIClick); + FSelectAllMI.Enabled := False; // TODO: implement me FCopyMI := FDefaultMenu.AddMenuItem('&Copy', '', @CopyMIClick); + FCopyMI.Enabled := False; // TODO: implement me FDefaultMenu.AddMenuItem('-', '', nil); FRefreshMI := FDefaultMenu.AddMenuItem('&Refresh', '', @RefreshMIClick); FDefaultMenu.AddMenuItem('-', '', nil); @@ -588,6 +584,17 @@ begin FDebugMI.Checked := Debug; end; +procedure TRichTextView.SetScrollDistance(const AValue: integer); +begin + if FScrollDistance = AValue then + exit; + FScrollDistance := AValue; + if Assigned(FVScrollBar) then + FVScrollBar.ScrollStep := FScrollDistance; + if Assigned(FHScrollBar) then + FHScrollBar.ScrollStep := FScrollDistance; +end; + constructor TRichTextView.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -755,14 +762,28 @@ procedure TRichTextView.HandleLMouseDown(x, y: integer; shiftstate: TShiftState) var Line: longint; Offset: longint; - Link: string; + Link: TfpgString; Position: TTextPosition; Shift: boolean; begin inherited HandleLMouseDown(x, y, shiftstate); + Offset := 0; Position := FindPoint( X, Y, Line, Offset, Link ); FClickedLink := Link; // writeln('Pos=', Ord(Position), ' link=', Link); + + if Position in [tpAboveTextArea, tpBelowTextArea] then + // not on the control (this probably won't happen) + exit; + + // if shift is pressed then keep the same selection start. + Shift := ssShift in ShiftState; + RemoveCursor; + + if not Shift then + ClearSelection; + + SetCursorPosition(Offset, Line, Shift); end; procedure TRichTextView.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); @@ -774,6 +795,37 @@ begin FClickedLink := ''; // reset link end; +procedure TRichTextView.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); +var + Line: longint; + Offset: longint; + Link: TfpgString; + Position: TTextPosition; +begin + inherited HandleMouseMove(x, y, btnstate, shiftstate); + Position := FindPoint(X, Y, Line, Offset, Link); + + if Link <> FLastLinkOver then + begin + if Link <> '' then + begin + if Assigned(FOnOverLink) then + FOnOverLink(Self, Link) + end + else + begin + if Assigned(FOnNotOverLink) then + FOnNotOverLink(Self, FLastLinkOver); + end; + FLastLinkOver := Link; + end; + + if Link <> '' then + MouseCursor := mcHand + else + MouseCursor := mcDefault; // TODO: later this should be IBeam when RichView supports editing +end; + Destructor TRichTextView.Destroy; Begin FDefaultMenu.Free; @@ -1054,13 +1106,9 @@ begin TextHeight := GetTextAreaHeight; -// YToFind := Height - YToFind; - - //if FBorderStyle = bsSingle then - //begin - // dec( YToFind, 2 ); - // dec( XToFind, 2 ); - //end; + // Should we take into account Border Styles? + XToFind := XToFind - FRichTextSettings.Margins.Left; + YToFind := YToFind - FRichTextSettings.Margins.Top; if YToFind < 3 then begin @@ -1212,12 +1260,12 @@ begin FVScrollBar.Max := 0; end; - FHScrollBar.ScrollStep := 25; // pixels - FHScrollBar.PageSize := AvailableWidth - FHScrollbar.ScrollStep; // slightly less than width - FHScrollBar.SliderSize := AvailableWidth / MaxDisplayWidth; - FVScrollBar.ScrollStep := 25; // not used (line up/down calculated explicitly) - FVScrollBar.PageSize := AvailableHeight - FVScrollBar.ScrollStep; - FVScrollBar.SliderSize := AvailableHeight / FLayout.Height; + FHScrollBar.ScrollStep := FScrollDistance; // pixels + FHScrollBar.PageSize := AvailableWidth - FHScrollbar.ScrollStep; // slightly less than width + FHScrollBar.SliderSize := AvailableWidth / MaxDisplayWidth; + FVScrollBar.ScrollStep := FScrollDistance; // pixels + FVScrollBar.PageSize := AvailableHeight - FVScrollBar.ScrollStep; + FVScrollBar.SliderSize := AvailableHeight / FLayout.Height; // Physical horizontal scroll setup FHScrollbar.Visible := FNeedHScroll; @@ -1429,7 +1477,7 @@ begin Result := 0; end; -Function TRichTextView.GetLineUpPosition: longint; +function TRichTextView.GetLineUpPosition: longint; var FirstVisibleLine: longint; Offset: longint; @@ -1438,8 +1486,7 @@ begin Result := GetLineUpPositionFrom( FirstVisibleLine, Offset ); end; -Function TRichTextView.GetLineUpPositionFrom( FirstVisibleLine: longint; - Offset: longint ): longint; +function TRichTextView.GetLineUpPositionFrom( FirstVisibleLine: longint; Offset: longint ): longint; begin // we should never have scrolled all lines off the top!! assert( FirstVisibleLine <> -1 ); @@ -1456,15 +1503,13 @@ begin end; // scroll so that top line is fully visible... - Result := FVScrollBar.Position - - Offset; + Result := FVScrollBar.Position - Offset; if Offset < (FLayout.FLines^[ FirstVisibleLine ].Height div 2) then // more than half the line was already displayed so if FirstVisibleLine > 0 then // AND to make next line up visible dec( Result, FLayout.FLines^[ FirstVisibleLine - 1 ].Height ); - end; Function Sign( arg: longint ): longint; @@ -1533,54 +1578,26 @@ end; *) Procedure TRichTextView.DoVerticalScroll( NewY: longint ); -//var -// ScrollDistance: longint; begin FYScroll := 0 - NewY; - if not Visible then begin FLastYScroll := FYScroll; exit; end; - -// ScrollDistance := FYScroll - FLastYScroll; - - { TODO -ograeme -cscrolling : Implement vertical scrolling here } - //ScrollControlRect( Self, - // GetTextAreaRect, - // 0, - // ScrollDistance, - // Color, - // FSmoothScroll ); - FLastYScroll := FYScroll; RePaint; SetupCursor; end; Procedure TRichTextView.DoHorizontalScroll( NewX: longint ); -var - ScrollDistance: longint; begin FXScroll := NewX; - if not Visible then begin FLastXScroll := FXScroll; exit; end; - -// ScrollDistance := FXScroll - FLastXScroll; - - { TODO -ograemeg -cscrolling : Implement horizontal scrolling } - //ScrollControlRect( Self, - // GetTextAreaRect, - // - ScrollDistance, - // 0, - // Color, - // FSmoothScroll ); - FLastXScroll := FXScroll; RePaint; SetupCursor; @@ -1631,7 +1648,7 @@ begin s := Text; // Warning: Hack Alert! replace some strange Bell character found in some INF files // s := SubstituteChar(s, Chr($07), Chr($20) ); - s := StringReplace(s, Chr($07), '•', [rfReplaceAll, rfIgnoreCase]); + s := StringReplace(s, Chr($07), #$E2#$80#$A2, [rfReplaceAll, rfIgnoreCase]); // u+2022 small bullet //// Hack Alert #2: replace strange table chars with something we can actually see // s := SubstituteChar(s, Chr(218), Char('+') ); // top-left corner @@ -2405,8 +2422,9 @@ end; Procedure TRichTextView.SelectAll; begin ClearSelection; - SelectionStart := FLayout.GetCharIndex( FText ); - SelectionEnd := FLayout.GetTextEnd; + FSelectionStart := FLayout.GetCharIndex( FText ); + FSelectionEnd := FLayout.GetTextEnd; + Repaint; end; (* @@ -2781,21 +2799,19 @@ begin end; end; -procedure TRichTextView.MakeRowAndColumnVisible( Row: longint; - Column: longint ); +procedure TRichTextView.MakeRowAndColumnVisible(Row: longint; Column: longint); var X: Longint; begin MakeRowVisible( Row ); FLayout.GetXFromOffset( Column, Row, X ); - if X > FXScroll + GetTextAreaWidth then + if X > (FXScroll + GetTextAreaWidth) then // off the right SetHorizontalPosition( X - GetTextAreaWidth + 5 ) else if X < FXScroll then // off to left SetHorizontalPosition( X ); - end; function TRichTextView.LinkFromIndex( const CharIndexToFind: longint): string; diff --git a/docview/docs/docview.ipf b/docview/docs/docview.ipf index 17bc7741..9d91a943 100644 --- a/docview/docs/docview.ipf +++ b/docview/docs/docview.ipf @@ -1,12 +1,8 @@ :userdoc. :docprof toc=123456. -:title.NewView Help +:title.fpGUI DocView Help .* ************************************************************ -.* Subject: Help for NewView -.* Version: -.* Copyright: Copyright 2004 Aaron Lawrence -.* Copyright: Copyright 2006-2007 Ronald Brill -.* Author: Aaron Lawrence +.* Subject: Help for DocView .* ************************************************************ .* .* @@ -15,109 +11,166 @@ .* ************************************************************ :h1 res=30000 id='Introduction'.Introduction :i1 id=30001.support -:p.:artwork runin name='images\NewView.bmp'. -:hp2.Welcome to NewView&xclm.:ehp2. +.* :artwork runin name='images\DocView.bmp'. +:hp2.Welcome to DocView!:ehp2. :p. -:p.NewView is a program for reading OS&slash.2 &lpar.or eComStation&rpar. Help -Files&per. +DocView is a program for reading fpGUI or OS/2 (aka eComStation) Help +Files. Both the INF and OS/2 HLP file formats can be read. :p.:link reftype=hd refid='Support'.Support and Licensing:elink. -:p.:link reftype=hd refid='Using'.Using NewView:elink. -:p.:hp1.To stop this file appearing when you start NewView without specifying a -help file&comma. see Tools &endash. Options &endash. General tab&per.:ehp1. -:p.:hp2.History:ehp2. -:p.NewView replaces the original IBM program supplied with OS&slash.2&per. -:p.It improves upon many aspects of View&comma. with a modern&comma. easy to use -interface&comma. more options&comma. and new features that View simply -didn&apos.t have&per. +:p.:link reftype=hd refid='Using'.Using DocView:elink. +:p.:hp1.To stop this file appearing when you start DocView without specifying a +help file, see "Settings - Options - General" tab.:ehp1. :p. +:hp2.History:ehp2. +:p. +DocView was originally based on the OS/2 NewView program. It was ported from +the Sibyl development environment, to the fpGUI Toolkit and the Free Pascal Compiler. Since then the code +and features of DocView has diverged. +:p. +It improves upon many aspects of the origin IBM View program, with a modern, +easy to use interface, more options, and new features that View simply +didn't have. And don't forget, DocVIew is also cross platform - currently available +as native executable for Linux, FreeBSD and Windows. DocView is also available in +32-bit or 64-bit. + + .* ************************************************************ .* Support and Licensing .* ************************************************************ -:h2 res=1 id='Support'. -Support and Licensing +:h2 res=1 id='Support'.Support and Licensing :i1 id=30002.license :i2 refid=30001.Support and Licensing :i2 refid=30001.Introduction :i1 id=30003.bugs :i1 id=30004.source code -:p.:hp2.Support and Licensing:ehp2. +:i1 id=30007.features planned +:hp2.Support and Licensing:ehp2. +:p.DocView is Copyright 2009-2010 by Graeme Geldenhuys. It is also licensed +under the GNU Public License v2, which means you have the right to obtain the +source code. :p. -:p.NewView is Copyright 1999&endash.2006 Aaron Lawrence&per. It is also licensed -under the GNU Public License&comma. which means you have the right to obtain the -source code&per. -:p.Since 2006 Ronald Brill maintains the product&per. -.br -NewView is a Netlabs project&per. -:p.See the Readme&per.txt for more technical details&per. -:p.See the Changes&per.txt file for a history of changes to NewView&per. -:p.If you find NewView helpful&comma. please email me and&slash.or make a -donation to support further development&per. It&apos.s nice to hear from -you&xclm. +DocView is part of the fpGUI Toolkit project and is the default help viewer for +any fpGUI based applications. Source code for DocView is available in the fpGUI +git repository on SourceForge.net, inside the :hp1.docview:ehp1. directory. +:p. +If you find DocView helpful, please email me and/or make a +donation to support further development. It's nice to hear from +you! :ul. -:li.Suggestions&comma. compliments or bug reports http&colon.&slash.&slash.svn&per.netlabs&per.org&slash.newview -:li.Translate NewView to your language&per. -:li.A donation to Netlabs http&colon.&slash.&slash.www&per.mensys&per.nl +:li.Project is hosted on SourceForge.net at http://sourceforge.net/projects/fpgui/ +:li.Suggestions, compliments or bug reports can be left on the fpGUI support newsgroups. +The news server is accessible via NNTP at news://opensoft.homeip.net/ +.br +There is also a web interface to the NNTP news server for those behind company +firewalls. http://opensoft.homeip.net/webnews/ +:li.Translate DocView to your language. +:li.A donation to fpGUI development. You can contact me via email at: graemeg@gmail.com :eul. :p.:hp2.Reporting Bugs:ehp2. -:p.If you need to report a crash or other problem&comma. then be as specific as -possible about what files were being used&comma. what you were doing&comma. -etc&per. If one is available&comma. PLEASE include the newview&per.log&per. The -log file will be EITHER -.br - &endash. in the same directory as NewView itself -.br - &endash. in the folder set by LOGFILES environment variable &lpar.typically eCS -1&per.1&plus.&rpar. -.br -If it is specific to a particular help file&comma. then send them to me&comma. -unless they&apos.re large &lpar.bigger than 1MB&rpar.&per. -:p.Most of the following information is in the newview&per.log file&comma. but -it would be helpful if you could include it for verification&colon. +:p.If you need to report a crash or other problem, then be as specific as +possible about what files were being used, what you were doing, +etc. If at all possible, compile DocView with debug information and supply a +backtrace. This will greatly help me fix problems. +:p. +If it is specific to a particular help file, then send them to me via email. +:p. +It would be helpful if you could include the following information with your +bug report: :ul. -:li.NewView version &lpar.Help &endash. Product Information&rpar. -:li.The filenames of the help files&per. -:li.A screenshot may be useful&comma. if the problem is an incorrect or corrupt -display&per. +:li.DocView version (Help - Product Information) +:li.The file names of the help files you have problems with. +:li.A screenshot may be useful, if the problem is an incorrect or corrupt +display. :eul. -:p.:hp2.Why doesn&apos.t my help file work properly?:ehp2. -:p.Some of the less used features of the original View program are not -implemented&per. This is either because I have not got around to it&comma. or -because they are simply not worth the time&per. Examples include -metafiles&comma. index synonyms&comma. the entire application control API&comma. -and so on&per. -:p.Unfortunately&comma. it seems that at least one developer has used every one -of these features&comma. so you may find an occasional file that doesn&apos.t -load or doesn&apos.t work properly&per. -.* -.* + +:p.:hp2.Why doesn't my help file work properly?:ehp2. +:p. +Some of the less used features of the original View program are not +implemented. This is either because I have not got around to it, or +because they are simply not worth the time. Examples include +metafiles, index synonyms, application control API (like toolbar button customisation), +MDI style window management and so on. +:p. +Unfortunately, IBM seems to have used every one of these features in there INF +documents, so you may find an occasional file that doesn't +load or doesn't work properly. + +:p.:hp2.Features still planned?:ehp2. +:ul. +:li.Image support. The Ric Text View component can already handle images, I am only struggling +to decode the images inside INF help files. This should hopefully be fixed soon. +:li.Bookmark support +:li.Printing support +:li.Cross-file linking. Clicking a hyperlink that automatically opens another +INF help file and goes to the correct topic. DocView already supports loading +multiple files, so this is almost complete. +:li.Some optimization of the Rich Text View component. Better startup time, improved +text wrapping and font substitution support. +:li.Global searching of all help files on your help folder specified by the +environment variables BOOKSHELF or HELP. +:eul. + +.* ---------------------------------------------------------------------- +:h2.Disclaimers +:p. +Since this program is free, it is supplied with no warranty, either expressed or +implied. +:p. +I disclaim all warranties for any damages, including, but not limited to, incidental +or consequential damage caused directly or indirectly by this software. +:p. +All software is supplied AS IS. You may use the program package only at your own +risk. +:p. +This program must not be used in states that do not allow the above limitation of +liability. + + +.* ---------------------------------------------------------------------- +:h2.Trademarks +:p. +The following trademarks are used in this online help file: +:ul compact. +:li.OS/2 is a registered trademark of IBM Corporation. +:li.eComStation is a registered trademark of Serenity Systems, Inc. +:li.Windows is a registered trademark of Microsoft Corporation +:li.Linux is a registered trademark of Linus Torvalds +:li.FreeBSD is a registered trademark of The FreeBSD Foundation +:eul. + .* ************************************************************ -.* Using NewView -.* ************************************************************ -:h1 res=2 id='Using'. -Using NewView -:p.:hp2.Using NewView:ehp2. -:p.Once you have :link reftype=hd refid='OpeningFiles'.opened a -file:elink.&comma. you can read it in various ways&per. -:p.You can read the :link reftype=hd refid='contents'.table of -contents:elink.&comma. use the :link reftype=hd refid='Index'.alphabetical -index:elink.&comma. or :link reftype=hd refid='search'.search:elink.&per. -:p.To simply read the help file like a paper book&comma. use the &odq.Previous&cdq. -:artwork runin name='images\previous.bmp'. - and &odq.Next&cdq. -:artwork runin name='images\next.bmp'. - buttons to work your way through all the topics&per. -:p.You can also use the help file like web pages&comma. using &odq.Back&cdq. -:artwork runin name='images\back.bmp'. - and &odq.Forward&cdq. -:artwork runin name='images\forward.bmp'. - buttons to go back to wherever you were before&comma. or to retread your -steps&per. -:p.Colours and some of the behaviour of NewView can be adjusted from the Tools -&endash. Options menu&per. -:p.You can also :link reftype=hd refid='notes'.annotate:elink. or :link -reftype=hd refid='bookmarks'.bookmark:elink. topics&per. -.* -.* +.* Using DocView +.* ************************************************************ +:h1 res=2 id='Using'.Using DocView +:hp2.Using DocView:ehp2. +:p. +Once you have :link reftype=hd refid='OpeningFiles'.opened a +file:elink., you can read it in various ways. +:p. +You can read the :link reftype=hd refid='contents'.table of +contents:elink., use the :link reftype=hd refid='Index'.alphabetical +index:elink., or :link reftype=hd refid='search'.search:elink.. +:p. +To simply read the help file like a paper book, use the "Previous" +.* :artwork runin name='images\previous.bmp'. + and "Next" +.* :artwork runin name='images\next.bmp'. + buttons to work your way through all the topics. They are the Up and Down arrow + buttons on the toolbar. +:p.You can also use the help file like web pages, using "Back" +.* :artwork runin name='images\back.bmp'. + and "Forward" +.* :artwork runin name='images\forward.bmp'. + buttons to go back to wherever you were before, or to retrace your +steps. They are the Left and Right arrow buttons on the toolbar. +:p. +Colours and some of the behaviour of DocView can be adjusted from the "Tools +- Options" menu. +.* TODO +.* :p.You can also :link reftype=hd refid='notes'.annotate:elink. or :link +.*reftype=hd refid='bookmarks'.bookmark:elink. topics. + + .* ************************************************************ .* Opening Help File .* ************************************************************ @@ -126,697 +179,867 @@ Opening Files :i1 id=30005.open :p.:hp2.Opening Help Files:ehp2. :p. -:p.To open a help file&comma. you can use any of the following&colon. -:p.&endash. Double&endash.click a :link reftype=hd refid='HelpIcons'.help -icon:elink. that is already set up -:p.&endash. Type &odq.view :hp1.filename:ehp1.&cdq. from the :link reftype=hd -refid='CommandLine'.command line:elink. -:p.&endash. Click the Open button -:artwork runin name='images\open.bmp'. - from within NewView -:p.&endash. Reload a recently viewed file from the &odq.File&cdq. menu -:p.&endash. Drag and drop a Help file from the desktop -:p.Once the file is loaded&comma. you should see the :link reftype=hd -refid='contents'.table of contents:elink. and the first topic&per. -:note text='Note:'.This assumes you installed NewView as a replacement -for original View&per. If you didn&apos.t then existing help icons and the -command line may behave differently&per. -:p.:hp2.Loading Multiple Files Together:ehp2. -:p.NewView can load multiple files at once&comma. presenting them as if they -were one book&comma. and read environment variables for filenames&per. -:p.For example&comma. with the OS&slash.2 Developer&apos.s Toolkit -documentation&colon. -.br - NewView cpref -.br -loads the &odq.Control Program Guide and Reference&cdq.&per. CPREF is an environment -variable set in config&per.sys&comma. consisting of &odq.CP1&plus.CP2&plus.CP3&cdq. -which tells NewView &lpar.or View&rpar. to load the help files CP1&comma. CP2 -and CP3&per. The files are searched for in the path specified by two :link +To open a help file, you can use any of the following: +:ul. +:li.Double-click a :link reftype=hd refid='HelpIcons'.help icon:elink. that is +already set up. The DocView executable needs to be associated with INF files in +your desktop environment. +:li.Type "docview :hp1.filename:ehp1." from the :link reftype=hd +refid='CommandLine'.command line:elink.. +:li.Click the Open button +.* :artwork runin name='images\open.bmp'. + from within DocView, or the "File - Open" menu item. +:li.Click the "File - Open additional file" menu item to open more files, without +closing the already opened files. +:li.Click the "File - Open Special" to load help files based on an Environmnt Variable +that was previous set. +:li.Reload a recently viewed file from the "File - Open Recent" menu. +:eul. +:p. +Once the file is loaded, you should see the :link reftype=hd +refid='contents'.table of contents:elink. and the first help topic. +:p. +:hp2.Loading Multiple Files Together:ehp2. +:p. +DocView can load multiple files at once, presenting them as if they +were one book, and read environment variables for filenames. +:p. +For example, on my system I can do the following: +:xmp. + docview FPCHELP +:exmp. +:p. +which loads the whole Free Pascal help library on my system. FPCHELP is an environment +variable set in ~/.profile (Linux) or config.sys (Windows) consisting of "rtl+fcl+ref" +which tells DocView to load the help files rtl.inf, fcl.inf and ref.inf. The +files are searched for in the path specified by two :link reftype=hd refid='L_EnvironmentVariables'.environment -variables:elink.&per.&asterisk. -:p.The files are all loaded and effectively appended to each other&per. -:p.Being able to load multiple files like this can be helpful for various -reasons&per. For example&comma. 4OS&slash.2 &lpar.a CMD&per.EXE -replacement&rpar. uses it to add it&apos.s own help on top of the original CMD -help&per. You can do it yourself with any files you like&per. -:p.You can load multiple files in the Open File dialog by using Ctrl or Shift to -select multiple files&per. -:p.When you click a link to a different help file&comma. NewView loads the other -file without closing your current files&per. -:p.At any time&comma. you can find out what files are open by using File -&endash. Information&per. -:p.:hp2.Loading Additional Files:ehp2. -:p.You can tick the &odq.Keep current files open&cdq. checkbox in the Open File -dialog&comma. and NewView will open the files you have selected without closing -the currently opened files&per. -:p.:hp2.Drag and Drop:ehp2. -:p.You can drag and drop &per.INF or &per.HLP files onto NewView and they will -be opened&per. If you hold down the Shift key&comma. they will be opened without -closing the current files&per. -:p.You can drop files onto any of the main content areas&comma. such as the -Contents or Index windows&comma. or an existing topic window&per. -:note text='Note:'.Some links that go across files&comma. will only work if the correct set of -files is loaded&per. +variables:elink.. +:p. +The files are all loaded and effectively appended to each other. +:p. +Being able to load multiple files like this can be helpful for various +reasons. For example, I use this method to integrate DocView with the various IDE's +(Integrated Development Environments) I use. I can then easily search for help on +language keywords, source code classes or units etc. +:p. +You can also open additional help files by selecting the "File - Open additional file" +menu option. +.* TODO +.* :p. +.* When you click a link to a different help file&comma. DocView loads the other +.* file without closing your current files&per. +:p. +At any time, you can find out what files are open by using the "Help - Show help +file header info" menu option. +:p. +:hp2.Loading Additional Files:ehp2. +:p. +You can select the "File - Open additional file" menu option, and DocView will +open the file you have selected without closing the currently opened files. +.* TODO +.* :p.:hp2.Drag and Drop:ehp2. +.* :p.You can drag and drop &per.INF or &per.HLP files onto DocView and they will +.* be opened&per. If you hold down the Shift key&comma. they will be opened without +.* closing the current files&per. +.* :p.You can drop files onto any of the main content areas&comma. such as the +.* Contents or Index windows&comma. or an existing topic window&per. +.* :note text='Note:'.Some links that go across files&comma. will only work if the correct set of +.* files is loaded&per. + + .* ************************************************************ .* Help Icons .* ************************************************************ -:h2 res=17 id='HelpIcons'. -Help Icons -:p.:hp2.Help Icons:ehp2. -:p.Help Icons on the desktop are usually &odq.program objects&cdq. with the program name -set to &odq.view&per.exe&cdq. and the parameters set to the name of the help files&per. -:p.Some programs create these icons automatically at install time&per. -:p.You can create these icons yourself by using the desktop program -template&per. See desktop help for more information&per. -:p.If you create icons by dragging help files to the desktop&comma. then you -cannot give them a meaningful title&comma. because that would change the name of -the file&comma. which might prevent programs from finding the help file&per. -Therefore program objects are currently the recommended means of creating help -icons&per. -.* -.* +:h2 res=17 id='HelpIcons'.Help Icons +:hp2.Help Icons:ehp2. +:p. +Help Icons on the desktop are usually "program shortcuts" or "filesystem objects". +Details on how to create a program shortcut for DocView, or how to associate INF +files to be opened with DocView, is beyond the scope of this document. Please see the +help of your operating system for more information. +:p. +Saying that, with the fpGUI source code, in the "docview/install" directory, there is some +information on how to setup a Gnome desktop with DocView. Unfortunately those +instructions don't seem to work on all Linux or FreeBSD systems, so you again need +to refer to your desktop system's help for guidance. +.* :p.Some programs create these icons automatically at install time&per. +.* :p.You can create these icons yourself by using the desktop program +.* template&per. See desktop help for more information&per. +.* :p.If you create icons by dragging help files to the desktop&comma. then you +.* cannot give them a meaningful title&comma. because that would change the name of +.* the file&comma. which might prevent programs from finding the help file&per. +.* Therefore program objects are currently the recommended means of creating help +.* icons&per. + + .* ************************************************************ .* Navigation Panel Tabs .* ************************************************************ -:h1 res=200 id='NavigationPanel'. -Navigation Panel Tabs -:p.:hp2.Navigation Panel Tabs:ehp2. -:p.The left hand panel contains several tabs for moving through the current help -file in different ways&per. -:p.:link reftype=hd refid='contents'.Contents:elink. -:p.:link reftype=hd refid='Index'.Index:elink. -:p.:link reftype=hd refid='search'.Search:elink. -:p.:link reftype=hd refid='notes'.Notes:elink. -:p.You can turn this panel off to get more space&comma. with the button -:artwork runin name='images\navigator.bmp'. or by selecting View -&endash. Show Left Panel from the menu&comma. or pressing Alt&plus.P&per. Do the -same to turn it on again&per. -:p.You can stop the navigation panel from appearing when a help file is opened -in Tools &endash. Options &endash. General tab&per. -:note text='Note:'.Many programs choose to show the table of contents -when they open their help file&semi. in this case&comma. the panel is -automatically shown&comma. overriding your setting&per. +:h1 res=200 id='NavigationPanel'.Navigation Panel Tabs +:hp2.Navigation Panel Tabs:ehp2. +:p. +The left hand panel contains several tabs for moving through the current help +file in different ways. +:ul. +:li.:link reftype=hd refid='contents'.Contents:elink. +:li.:link reftype=hd refid='index'.Index:elink. +:li.:link reftype=hd refid='search'.Search:elink. +:li.:link reftype=hd refid='notes'.Notes:elink. +:li.:link reftype=hd refid='history'.History:elink. +:eul. +:p.You can hide this panel to get more space, by draging the splitter bar +.* :artwork runin name='images\navigator.bmp'. or by selecting View +to the left, or simply double-clicking on the splitter bar. To show the Left Panel +again, drag the splitter bar to the right. +:p. +The last location of the splitter bar (width of the Left Panel) is remembered +between DocView sessions. So when you open DocView, the Left Panel is the same +width as the last time you used DocView. +.* TODO +.* :p.You can stop the navigation panel from appearing when a help file is opened +.* in Tools &endash. Options &endash. General tab&per. + + .* ************************************************************ .* Contents View .* ************************************************************ -:h2 res=4 id='contents'. -Contents View +:h2 res=4 id='contents'.Contents View :i1 id=30006.Table of Contents -:p.:hp2.Table of Contents:ehp2. -:p. -:p.Most help files have a table of contents that shows you the topics in the -file&comma. in a hierarchy or &odq.tree&cdq.&per. This is usually the first view you see -when you open a file&per. -:p.You can expand or collapse branches on the tree by clicking the &plus. or -&endash. buttons&comma. or using the space bar&per. -:p.To view a topic from the contents&comma. just click on it&per. You can also -move through the contents by using the arrow keys&per. -:p.To move through :hp2.all:ehp2. topics in the contents tree&comma. in -order&comma. you can use Ctrl &plus. Up and Ctrl &plus. Down&comma. or the -&odq.Previous&cdq. -:artwork runin name='images\previous.bmp'. - and &odq.Next&cdq. -:artwork runin name='images\next.bmp'. - buttons&per. This is one way to treat the file as a normal book&comma. reading -through each page&per. -:p.You can also review the whole table of contents by using &odq.Expand All&cdq. in the -&odq.View&cdq. menu&per. This expands all the branches of the contents table so you can -quickly look through it&per. However&comma. it&apos.s usually easier to use +:hp2.Table of Contents:ehp2. +:p. +Most help files have a table of contents that shows you the topics in the +file, in a hierarchy or "tree". This is usually the first view you see +when you open a file. +:p. +You can expand or collapse branches on the tree by clicking the [+] or +[-] buttons, or using the left and right arrow keys on the keyboard. +:p. +To view a topic from the contents, just click on it. You can also +move through the contents by using the arrow keys. +:p. +To move through :hp2.all:ehp2. topics in the contents tree, in +order, you can use the +.* TODO +.* Ctrl &plus. Up and Ctrl &plus. Down&comma. or the +"Previous" +.* :artwork runin name='images\previous.bmp'. + and "Next" +.* :artwork runin name='images\next.bmp'. + buttons on the toolbar. This is one way to treat the help file as a normal book, reading +through each page. +:p. +You can also review the whole table of contents by using "Expand All" in the +tree view's popup menu. This expands all the branches of the contents table so you can +quickly look through it. However, it's usually easier to use :link reftype=hd refid='search'.Search:elink. or :link reftype=hd -refid='Index'.Index:elink. for this purpose&per. +refid='Index'.Index:elink. for this purpose. + .* ************************************************************ .* Index .* ************************************************************ -:h2 res=5 id='Index'. -Index -:p.:hp2.About the Index:ehp2. +:h2 res=5 id='index'.Index +:hp2.About the Index:ehp2. :p. -:p.The Index tab contains an alphabetical listing of topics or keywords in the -help file&per. You can quickly search through it just by typing the first few -characters of the word you want to look up&per. NewView jumps to the first match -in the index automatically&per. To view the highlighted topic&comma. press -enter&per. +The Index tab contains an alphabetical listing of topics or keywords in the +help file. You can quickly search through it just by typing the first few +characters of the word you want to look up. DocView jumps to the first match +in the index automatically. To view the highlighted topic, press +enter. :note text='Note:'. -:p.Help files may or may not include an &odq.official&cdq. index&per. The index is -manually created by the author&comma. so &lpar.for original View&rpar. it&apos.s -usefulness is strictly dependent on how much work the author put into it&per. -There may not even be one&per. -:p.However&comma. a useful index can be provided simply by listing the titles of -each topic alphabetically&comma. and this is what NewView does&per. It then -merges the original index &lpar.if any&rpar. with the list of topic titles&per. -:p.If for some reason you don&apos.t like this&comma. you can turn it off in -Tools &endash. Options &endash. Index tab&per. +Help files may or may not include an "official" index. The index is +manually created by the author, so (for the original OS/2 View program) it's +usefulness is strictly dependent on how much work the author put into it. +There may not even be Index information in the help file. +:p. +However, a useful index can be provided simply by listing the titles of +each topic alphabetically, and this is what DocView does. It then +merges the original index (if any) with the list of topic titles. +:p. +If for some reason you don't like this, you can change this behaviour in +"Settings - Options - General" tab. There are three options to choose from. +:dl tsize=16. +:dt.Alphabetical +:dd.All topics from the table of content are sorted and displayed as an Index. +:dt.File Only +:dd.Only the "official" index created by the author of the help file is used. Some +help files don't include an official index, so then the Index listbox will be empty. +:dt.Full +:dd.Both the topics and the official index are combined to display a larger and +more useful Index to the user. This is the default option. +:edl. + .* ************************************************************ .* Search .* ************************************************************ -:h2 res=6 id='search'. -Search -:p.:hp2.Searching:ehp2. -:p. -:p.Searching is a quick way to find information&comma. when you don&apos.t know -where to start&per. Simply go to the Search tab&comma. type some related words -and click the Search button&per. -You&apos.ll see a listing of all topics containing that word&comma. or words -like it&comma. with the best matches at the top&per. The best match will be -displayed automatically&per. -:p.Words that matches your search are highlighted in the topic&per. -:p.:hp2.Global search:ehp2. -:p.You can also search all help files on your system using the :link reftype=hd -refid='GlobalSearch'.global search:elink. in Tools &endash. Search all Help -Files&per. -:p.:hp2.Phrase search:ehp2. -:p.If you want to search for a phrase made up of more than one word&comma. put -double quotes around it&comma. for example &odq.os&slash.2 warp&cdq.&per. -:p.:hp2.Matching features:ehp2. -:p.NewView allows you finer control of searching&per. -:p.&plus. indicates a word that :hp2.must:ehp2. be matched -:p.&endash. indicates a word that must :hp2.not:ehp2. be matched -:p.NewView always does partial word matches&per. That is&comma. if you search -for &odq.win&cdq. NewView will also find &odq.window&cdq. and &odq.showing&cdq.&per. However&comma. the -better the match is the higher the rank will be&per. -:p.:hp2.How NewView ranks results:ehp2. -:p.NewView ranks matching topics by various means&colon. -:p.&endash. a closer match to a full word -:p.&endash. number of matching words in a topic -:p.&endash. matches within the title -:p.&endash. matches within an index entry +:h2 res=6 id='search'.Search +:hp2.Searching:ehp2. +:p. +Searching is a quick way to find information, when you don't know +where to start. Simply go to the Search tab, type some related words +and press Enter, or click the Go button. +You'll see a listing of all topics containing that word, or words +like it, with the best matches at the top. The best match will be +displayed automatically. +:p. +Words that matches your search are highlighted in the topic. +.* TODO +.* :p. +.* :hp2.Global search:ehp2. +.* :p.You can also search all help files on your system using the :link reftype=hd +.* refid='GlobalSearch'.global search:elink. in "Settings - Search all Help +.* Files". +:p. +:hp2.Phrase search:ehp2. +:p. +If you want to search for a phrase made up of more than one word, put +double quotes around it, for example "OS/2 warp". +:p. +:hp2.Matching features:ehp2. +:p. +DocView allows you finer control of searching. You can add either of the two symbols +directly infront of a word (no spaces between symbol and word), to narrow down +a search even more. +:dl compact tsize=20. +:dt.+ (plus sign) +:dd.indicates a word that :hp2.must:ehp2. be matched +:dt.- (minus sign) +:dd.indicates a word that must :hp2.not:ehp2. be matched +:edl. +:p. +To make searching even more useful, DocView implements a special search algorithm +which does partial word matches. That is, if you search for "win", DocView will +also find "window", "following", "showing" etc. However, the better the match is the higher +the rank will be. The search rank is displayed in square brackets behind each +search result. Searches are :hp2.not:ehp2. case-sensitive. +:p. +:hp2.How DocView ranks results:ehp2. +:p.DocView ranks matching topics by various means: +:ul compact. +:li.a closer match to a full word +:li.number of matching words in a topic +:li.matches within the title +:li.matches within an index entry +:eul. + .* ************************************************************ .* Notes .* ************************************************************ -:h2 res=7 id='notes'. -Notes -:p.:hp2.Adding and Using Notes:ehp2. -:p. -:p.NewView allows you to add notes &lpar.annotations&rpar. to your help -files&per. -:p.To add a note&comma. simply click where you want to make a note and click the -&odq.Note&cdq. button -:artwork runin name='images\note.bmp'. -&comma. then type your text and click OK&per. The text will be inserted into the -help topic with a different color &lpar.default is green&semi. you can change -this in Tools &endash. Options &endash. Colors&rpar.&per. -:p.To edit or delete a note&comma. click on the colored note text&semi. you can -then edit the note text&comma. or click on delete to get rid of it&per. -:p.You can also review all the notes that you&apos.ve made in the current help -file&lpar.s&rpar. by going to the Notes tab&semi. this allows you to add&comma. -edit and delete&comma. and also jump to the topics containing your notes&per. -:p. -:p.Notes are saved in a file with the extension &per.nte&comma. in the same -directory as the help file they are for&per. -:note text='Note:'.If a help file is changed &lpar.for example a program is -upgraded&rpar. then notes will no longer appear in the correct place&semi. -however&comma. you can still read them from the Notes tab&per. +:h2 res=7 id='notes'.Notes +:hp2.Adding and Using Notes:ehp2. +:p. +DocView allows you to add notes (annotations) to your help +files. +:p. +To add a note, simply left click where you want to make a note and click the +"Note" toolbar button +.* :artwork runin name='images\note.bmp'. +, then type your text and click OK. The text will be inserted into the +help topic with a different color (default is green; you can change +this in "Settings - Options - Fonts &. Colors". +:p. +To edit or delete a note, click on the colored note text; you can +then edit the note text, or click on delete to get rid of it. +:p. +You can also review all the notes that you've made in the current help +file(s) by going to the Notes tab; this allows you to add, +edit and delete, and also jump to the topics containing your notes. +:p. +Notes are saved in a file with the extension "&per.notes", in same directory +as the help file. This makes it ideal to keep your private notes with the help +files in question. For example: storing help files on a removable usb drive. If +you made any annotations, your annotations will be avaiable, no matter what +machine you use to read your help. In future this behaviour will become user +selectable, so you can select your preferred storage location. + +.* the DocView config +.* directory. This is in the user's home profile directory where there is read/write +.* access. Under Linux it is normally "~/.config/docview/" and under Windows it is +.* normally "C:\Documents and Settings\<user>\Local Settings\Application Data\docview". +.* I will probably add a setting in DocView, so the user can configure a +.* preferred storage location for notes (eg: some users prefer it like OS/2's View program did, +.* by storing notes in the same directory as the help file). + +:note.If a help file is changed (for example a program is +upgraded) then notes will no longer appear in the correct place; +however, you can still read them from the Notes tab. + +.* ************************************************************ +.* History +.* ************************************************************ +:h2 res=21 id='history'.History +:p.:hp2.About the History:ehp2. +:p. +DocView keeps track of every topic you visit. This allows you to view a help file +like a web browser does with web pages. You can use the "Back" and "Forward" +buttons on the toolbar to move back and forward in your history list. +:p. +In the History tab, is a list of all previously visited topics. To jump to any +of them, simply highlight the topic and press enter. Or simply double-click a +topic. +:p. +The history is not saved when you exit DocView. The history is also cleared if +you open a new or additional help file. + .* .* .* ************************************************************ .* Global Search .* ************************************************************ -:h1 res=18 id='GlobalSearch'. -Global Search -:p.:hp2.Global search:ehp2. -:p.You can search all help files on your system&comma. by clicking the Search -All button -:artwork runin name='images\search.bmp'. -&comma. using Tools &endash. Search all Help Files in the menu&comma. or -pressing Ctrl&plus.S&per. -:p.This search works similarly to :link reftype=hd refid='search'.searching -within a file:elink.&comma. but it also tells you what help file the results -were found in&per. -:p.These searches may take some time&comma. depending on what you search -for&per. You can stop the search at any time&per. -:p.:hp2.Where NewView searches:ehp2. -:p.The default is to search for help files in the help paths&comma. which are -specified by the BOOKSHELF and HELP :link reftype=hd -refid='L_EnvironmentVariables'.environment variables:elink.&per. -:p.You can choose other places to search by choosing from the drop&endash.down -list&comma. or customise the list by clicking the Select button&per. -:p.:hp2.Search in&colon. Standard Help Paths:ehp2. -:p.This is the default and will search BOOKSHELF and HELP as specified -above&per. -:p.Clicking the select button will allow you to choose which of the directories -in the help paths will be used&per. Click each item in the list to select or -de&endash.select it&per. After you choose this&comma. the location will show as -&odq.Selected Help Paths&cdq. -:p.:hp2.Search in&colon. All Hard Drives:ehp2. -:p.This option will search all hard &lpar.non&endash.removable&rpar. drives on -your system&per. You can click &odq.Select&per.&per.&per.&cdq. to customise the -location&per. -:p.Searching drives can find more help files&comma. but might be much slower -than just the help paths&per. -:p.:hp2.Search in&colon. Selected Help Paths:ehp2. -:p.If you have already selected particular help paths to search&per.&comma. you can -click &odq.Select&per.&per.&per.&cdq. to customise again&per. -:p.:hp2.Search in&colon. Directory List:ehp2. -:p.In the &odq.Select Directories&cdq. dialog&comma. clicking the &odq.Add&per.&per.&per.&cdq. -button will allow you to add one or more directories to the search list&per. -:p.Select the drive and directory using the controls that appear&comma. then -click &odq.<. Add Directory&cdq. to add the chosen directory&per. You can do this as -many times as you like&per. Choose &odq.With sub&endash.directories&cdq. if you want -sub&endash.directories of the selected directory to be searched as well&per. In -this case&comma. &per.&per.&per. will show on the end of the directory&per. -:p.After you add a custom directory like this&comma. the location for searching -will show as &odq.Directory List&cdq.&per. -:note text='Note:'.If you add a custom directory to standard or selected help -paths&comma. then the list will become a custom list&comma. and you can no -longer re&endash.select help paths&per. To get back to the original help -paths&comma. choose &odq.Standard Help Paths&cdq. then click &odq.Select&per.&per.&per.&cdq. -again&per. -:p.:hp2.Search in&colon. Typing a location:ehp2. -:p.You can type a drive or directory into the &odq.Search in&colon.&cdq. entry -field&per. Add &odq.&per.&per.&per.&cdq. on the end of the directory if you want to -search subdirectories as well&per. -:p.Example&colon. -:p. Search in&colon. &lbracket. E&colon.&bsl.mydocs&bsl.&per.&per.&per. - &rbracket. -:p.This will search help files in E&colon.&bsl.mydocs&bsl. and any -subdirectories&per. -.* -.* +.* TODO +.* :h1 res=18 hide id='GlobalSearch'.Global Search +.* :hp2.Global search:ehp2. +.* :note.:hp8.*** This feature is not implemented yet. ***:ehp8. +.* :p.You can search all help files on your system, by clicking the Search +.* All toolbar button +.* .* :artwork runin name='images\search.bmp'. +.* , or by using "Tools - Search all Help Files" in the menu, or +.* pressing Ctrl+S. +.* :p. +.* This search works similarly to :link reftype=hd refid='search'.searching +.* within a file:elink., but it also tells you what help file the results +.* were found in. +.* :p. +.* These searches may take some time, depending on what you search +.* for. You can stop the search at any time. +.* :p. +.* :hp2.Where DocView searches:ehp2. +.* :p. +.* The default is to search for help files in the help paths, which are +.* specified by the BOOKSHELF and HELP :link reftype=hd +.* refid='L_EnvironmentVariables'.environment variables:elink.. +.* :p. +.* You can choose other places to search by choosing from the drop-down +.* list, or customise the list by clicking the Select button. +.* :ul. +.* :li.:hp2.Search in: Standard Help Paths:ehp2. +.* :p. +.* This is the default and will search BOOKSHELF and HELP as specified +.* above. +.* :p. +.* Clicking the select button will allow you to choose which of the directories +.* in the help paths will be used. Click each item in the list to select or +.* deselect it. After you choose this, the location will show as +.* "Selected Help Paths". +.* :li.:hp2.Search in: All Hard Drives:ehp2. +.* :p. +.* This option will search all hard drives on +.* your system. You can click "Select..." to customise the +.* location. +.* :p. +.* Searching drives can find more help files, but might be much slower +.* than just the help paths. +.* :li.:hp2.Search in: Selected Help Paths:ehp2. +.* :p. +.* If you have already selected particular help paths to search, you can +.* click "Select..." to customise again. +.* :li.:hp2.Search in: Directory List:ehp2. +.* :p. +.* In the "Select Directories" dialog, clicking the "Add..." +.* button will allow you to add one or more directories to the search list. +.* :p. +.* Select the drive and directory using the controls that appear, then +.* click "< Add Directory" to add the chosen directory. You can do this as +.* many times as you like. Choose "With sub-directories" if you want +.* sub-directories of the selected directory to be searched as well. In +.* this case, ... will show on the end of the directory. +.* :p. +.* After you add a custom directory like this, the location for searching +.* will show as "Directory List". +.* :note.If you add a custom directory to standard or selected help +.* paths, then the list will become a custom list, and you can no +.* longer re-select help paths. To get back to the original help +.* paths, choose "Standard Help Paths" then click "Select..." +.* again. +.* :li.:hp2.Search in: Typing a location:ehp2. +.* :p. +.* You can type a drive or directory into the "Search in:" entry +.* field. Add "..." on the end of the directory if you want to +.* search subdirectories as well. +.* :p. +.* Example: +.* :p. +.* Search in: [ E:\mydocs\... ] +.* :p. +.* This will search help files in E:\mydocs\ and any +.* subdirectories. +.* :eul. + + .* ************************************************************ .* Bookmarks .* ************************************************************ -:h1 res=8 id='bookmarks'. -Bookmarks -:p.:hp2.Bookmarks:ehp2. +:h1 res=8 id='bookmarks'.Bookmarks +:hp2.Bookmarks:ehp2. +:note.:hp8.*** This feature is not implemented yet. ***:ehp8. +:p. +DocView allows you to bookmark particular topics within the current help +file. Simply click the bookmark toolbar button +.* :artwork runin name='images\bookmark.bmp'. +to add the current topic as a bookmark. :p. -:p.NewView allows you to bookmark particular topics within the current help -file&per. Simply click the bookmark button -:artwork runin name='images\bookmark.bmp'. - to add the current topic as a bookmark&per. -:p.To jump to a bookmark&comma. go to the &odq.Bookmarks&cdq. menu&comma. and click on -the bookmark you want to open&per. -:p.You can view or delete all your bookmarks by clicking on &odq.Edit&per.&per.&cdq. in -the &odq.Bookmarks&cdq. menu&per. This window can remain open while you read&comma. so -that you can quickly look through your bookmarks&per. +To jump to a bookmark, go to the "Bookmarks" menu, and click on +the bookmark you want to open. :p. +You can view or delete all your bookmarks by clicking on "Edit..." in +the "Bookmarks" menu. This window can remain open while you read, so +that you can quickly look through your bookmarks. :note text='Note:'. -:p.NewView bookmarks remember all the topic windows that are open&comma. if -there is more than one&per. -:p.Bookmarks are saved in a file with the extension &per.bmk&comma. in the same -directory as the help file they are for&per. -.* -.* +DocView bookmarks remember all the topic windows that are open, if +there is more than one. +:p. +Bookmarks are saved in a file with the extension ".bookmarks", in the DocView config +directory. This is in the user's home profile directory where there is read/write +access. Under Linux it is normally "~/.config/docview/" and under Windows it is +normally "C:\Documents and Settings\<user>\Local Settings\Application Data\docview". +I will probably add a setting in DocView, so the user can configure a +preferred storage location for bookmarks (eg: some users prefer it like OS/2's View program did, +by storing notes in the same directory as the help file). + + .* ************************************************************ .* Internet Links .* ************************************************************ -:h1 res=100 id='InternetLinks'. -Internet Links -:p.:hp2.Internet Links:ehp2. -:p.When you click a web URL like -http&colon.&slash.&slash.www&per.google&per.com&comma. NewView launches your -default web browser&per. -:p.This web browser is specified by operating system settings&comma. not NewView -itself&per. To configure it&comma. you can open a URL object on the -desktop&comma. edit the browser path in the :hp2.Browser:ehp2. tab&comma. then -click Set Default&per. Alternatively&comma. download the utility ConfigApps from -Hobbes -:p. - http&colon.&slash.&slash.hobbes&per.nmsu&per.edu&slash.cgi&endash.bin&slash.h&endash.search?key&eq.configapps -.br -:p.Browsers may also have the ability to make themselves the default&comma. -either at install time or in preferences&per. -:p.Email&comma. Newsgroups and FTP links are also passed to the web browser&per. -At this time&comma. it isn&apos.t possible to choose a different program for -these links&per. -:p.:hp2.Note to help file authors:ehp2. -:p.The original View had no understanding of URL or email links&comma. so the -only way to implement them was a link to&comma. for example&comma. -&odq.netscape&per.exe&cdq. with the correct parameters&per. -:p.NewView translates program links to &odq.netscape&cdq.&comma. &odq.explore&cdq. or &odq.mozilla&cdq. -into links to the default browser&per. -:p.It also auto&endash.detects URLs in the forms&colon. -:p. http&colon.&slash.&slash.x https&colon.&slash.&slash.x - ftp&colon.&slash.&slash.x -:p. mailto&colon.x news&colon.x -:p.Things that look like URLs are also detected&comma. even without the protocol -prefix&colon. -:p. www&per.a&per.b &endash. browser -:p. ftp&per.a&per.b &endash. ftp -:p. a&atsign.b&per.c &endash. email -:p.where a&comma. b and c are any alphanumeric string&per. -:p.You don&apos.t need to do anything for NewView to recognise these&per. -.* -.* +:h1 res=100 id='InternetLinks'.Internet Links +:hp2.Internet Links:ehp2. +:p. +When you click a web URL like +http://opensoft.homeip.net/fpgui/, DocView launches your +default web browser. +:p. +This web browser is specified by operating system settings, not DocView +itself. Please see your operating system or desktop environment help for further +details on how to configure it. +:p. +For more technical details about what browser is used, have a look at the fpgOpenURL() +function in fpGUI Toolkit source code. +:p. +Email, Newsgroups and FTP links are also passed to operating system or desktop +environment, the same as web addresses. +:p. +:hp2.Note to help file authors:ehp2. +:p.The original OS/2 View program had no understanding of URL or email links, so the +only way to implement them was a link to, for example, +"netscape.exe" with the correct parameters. +:p. +DocView translates program links to "netscape", "explorer" or "mozilla" +into links to the default browser. +:p. +It also auto-detects URLs in the forms: +:lm margin=5. +:p.http&colon.//xxx +:p.https&colon.//xxx +:p.ftp&colon.//xxx +:p.mailto&colon.xxx +:p.news&colon.xxx +:lm margin=1. +:p. +Things that look like URLs are also detected, even without the protocol +prefix: +:lm margin=5. +:p.www&per.aaa&per.bbb - browser +:p.ftp&per.aaa&per.bbb - ftp +:p.aaa&atsign.bbb&per.ccc - email +:lm margin=1. +:p. +where aaa, bbb and ccc are any alphanumeric string. +:p. +You don't need to do anything for DocView to recognise these. + + .* ************************************************************ .* Command Line .* ************************************************************ -:h1 res=9 id='CommandLine'. -Command Line Parameters -:p.:hp2.Command Line Parameters:ehp2. -:p.When you run NewView from the command line you can supply various -parameters&per. None of them are required&per. -:p. -:p.:hp2.NewView &lbracket.options&rbracket. &lbracket.<.filename>. -&lbracket.<.search text>.&rbracket.&rbracket.:ehp2. -:p.If NewView is installed as a replacement for view&comma. then the command -starts with view instead of newview&per. -:p.:link reftype=hd refid='CommandLineExamples'.Examples:elink. -.* -:p.:hp2.<.filename>.:ehp2. -:p.The file for NewView to load&per. You can load multiple files at once by -using filename1&plus.filename2 etc&per. -.br -If a path isn&apos.t specified&comma. then the files are searched for in the -:link reftype=hd refid='L_EnvironmentVariables'.BOOKSHELF and HELP -paths:elink.&per. -.br -If you path and&slash.or filename contains special characters (like blank) then -you have to enclose the filename in double qoutes&per. -.* -:p.:hp2.<.search text>.:ehp2. -:p.Search topic titles and index entries for this text&per. This is -:hp2.not:ehp2. the same as a normal search&comma. for compatibility with -original View&per. To do a proper search use the &slash.s option &lpar.see -below&rpar.&per. For more details&comma. see :link reftype=hd -refid='CommandLineTopicSearch'.Command Line Topic Search:elink.&per. -:p.:hp2.Options:ehp2. -:p.:hp2.&slash.s:ehp2. -:p.After opening the file&comma. performs a :link reftype=hd -refid='search'.search:elink. for the given text (do a real full text search intead of -the default topic titles search)&per. The result is the same as performing the search from -the :link reftype=hd -refid='search'.serach navigation panel:elink.&per. -:p.Example&colon. -.br -:lm margin=4. -To search for copy in the whole cmdref document you can call -:xmp. - newview &slash.s cmdref copy -:exmp. -NewView is clever enought to handle multiple words (like the :link reftype=hd -refid='search'.serach navigation panel:elink.)&per. This is a OR search&per. +:h1 res=9 id='CommandLine'.Command Line Parameters +:hp2.Command Line Parameters:ehp2. +:p. +When you run DocView from the command line you can supply various +parameters. None of them are required. For a quick summary, select +"Help - Command line parameters". :xmp. - newview &slash.s cmdref net access + docview [<filename>] [[option] [option parameter]] :exmp. -To perform a AND search enclose the search phrase in double quotes&per. + +:p. +:link reftype=hd refid='CommandLineExamples'.:hp2.Examples:ehp2.:elink. +:p. +:hp2.<filename>:ehp2. +:p. +The file for DocView to load. You can load multiple files at once by +using filename1+filename2 format. +:p. +If a path isn't specified, then the files are searched for in the +:link reftype=hd refid='L_EnvironmentVariables'.BOOKSHELF and HELP:elink. +environment variable locations. +:p. +If a path and/or filename contains special characters (like blank) then +you have to enclose the filename in double qoutes. + +:p. +:hp2.[option]:ehp2. +:p.The following options are available: +:parml tsize=6. +:pt.-h +:pd.Show the command line summary when docview starts up. +:pt.-k <searchtext> +:pd.After opening the file, it performs a :link reftype=hd +refid='search'.search:elink. for a keyword <searchtext>. This does a full text +search look at topic titles, index entries and topic content. The result is the +same as performing a search from the :link reftype=hd refid='search'.search panel:elink.. +:p. +Example: +.br +:lm margin=8. +To search for TfpgApplication in the whole fpGUI Toolkit class document you can call + :xmp. - newview &slash.s cmdref &odq.net access&cdq. + docview fpgui.inf -k TfpgApplication :exmp. -:lm margin=1. -.* -:p.:hp2.&slash.g:ehp2. -:p.Performs a :link reftype=hd refid='GlobalSearch'.global search:elink. for the -given text&comma. on all the help files in your system&per. -:p.Example&colon. -.br -:lm margin=4. -To search for copy in all help files use + +:p. +DocView is clever enough to handle multiple words (like the :link reftype=hd +refid='search'.search panel:elink.). This is a OR search. + :xmp. - newview &slash.g copy + docview fpgui.inf -k net access :exmp. -Provide the file name as first parameter if you like to open a help file -before the search starts. + +:p. +To perform an AND search enclose the search phrase in double quotes. :xmp. - newview &slash.g cmdref copy + docview fpgui.inf -k "net access" :exmp. :lm margin=1. -.* -:p.:hp2.&slash.?:ehp2. or :hp2.&slash.h:ehp2. or :hp2.&slash.help:ehp2. -:p.Show command line help -:p.See also&colon. :link reftype=hd refid='AdvancedParameters'.Advanced -Parameters:elink. -.* ************************************************************ -.* Command Line Topic Search -.* ************************************************************ -:h2 res=13 id='CommandLineTopicSearch'. -Command Line Topic Search -:p.:hp2.Command line topic search:ehp2. -:p. view <.filename>. <.topic>. -:p.The topic search parameter specified on the command line&comma. copies the -behaviour of old view&per. -:p.Text within topics is not searched&comma. only titles and index entries&per. -This makes it less useful to humans&comma. but is used by some programs to -reference help topics in a predictable way&per. -:p.You can use multiple words here&per. -:p.The search performed is&colon. -:p.&endash. topic title starts with search text -:p.&endash. index entry starts with search text -:p.&endash. topic title contains search text -:p.&endash. index entry contains search text&per. -:p.Developers should make sure that the expected document will be found if using -this technique to identify topics when starting New or Old view&per. + +:pt.-n <id> +:pd.Open a topic with the numeric ID equal to <id>. +:pt.-s <id> +:pd.Open a topic with string ID equal to <id>. +:pt.-debuglog <filename> +:pd.Log debug information to a file. +:eparml. + +.* :p.See also&colon. :link reftype=hd refid='AdvancedParameters'.Advanced +.* Parameters:elink. + .* ************************************************************ .* Advanded Parameters .* ************************************************************ -:h2 res=14 id='AdvancedParameters'. -Advanced Parameters -:p.:hp2.Advanced Parameters:ehp2. -:p.The following command line parameters are intended mainly for software -developers&comma. but can be used for any purpose&per. -:p.:hp2.&slash.lang&colon.<.language spec>.:ehp2. -:p.Loads the specified language&per. Overrides the default chosen based on the -LANG environment variable&per. For example&comma. -:xmp. - newview cmdref &slash.lang&colon.en -:exmp. -loads English&per. See readme&per.txt for more information&per. -:p.:hp2.&slash.pos&colon.<.left>.&comma.<.bottom>.&comma.<.width>.&comma.<.height>.:ehp2. -:p.Set the main program window to the given position and size&per. All values -must be given&per. Put a :hp2.P:ehp2. after a number to specify a -percentage&per. For example&colon. -:xmp. - newview &slash.pos&colon.10P&comma.10P&comma.80P&comma.80P -:exmp. -:p.makes the window centered and 80&percent. of the screen size&per. -:p.:hp2.&slash.title&colon.<.window title>.:ehp2. -:p.Sets the title of the NewView window to the specified text&comma. overriding -whatever appears in the help file&per. The text &odq.Help &endash. &cdq. will always be -inserted in front of the specified text&comma. unless the specified text is -&odq.help&cdq.&comma. in which case the title will simply become &odq.Help&cdq.&per. This is to -make sure that help windows are always obvious as such in the window list&per. -:p.If you need to specify multiple words&comma. surround the entire option with -quotes&comma. for example&colon. -:xmp. - newview cmdref &odq.&slash.title&colon.Command Line Help&cdq. -:exmp. +.* :h2 res=14 id='AdvancedParameters'. +.* Advanced Parameters +.* :p.:hp2.Advanced Parameters:ehp2. +.* :p.The following command line parameters are intended mainly for software +.* developers&comma. but can be used for any purpose&per. +.* :p.:hp2.&slash.lang&colon.<.language spec>.:ehp2. +.* :p.Loads the specified language&per. Overrides the default chosen based on the +.* LANG environment variable&per. For example&comma. +.* :xmp. +.* DocView cmdref &slash.lang&colon.en +.* :exmp. +.* loads English&per. See readme&per.txt for more information&per. +.* :p.:hp2.&slash.pos&colon.<.left>.&comma.<.bottom>.&comma.<.width>.&comma.<.height>.:ehp2. +.* :p.Set the main program window to the given position and size&per. All values +.* must be given&per. Put a :hp2.P:ehp2. after a number to specify a +.* percentage&per. For example&colon. +.* :xmp. +.* DocView &slash.pos&colon.10P&comma.10P&comma.80P&comma.80P +.* :exmp. +.* :p.makes the window centered and 80&percent. of the screen size&per. +.* :p.:hp2.&slash.title&colon.<.window title>.:ehp2. +.* :p.Sets the title of the DocView window to the specified text&comma. overriding +.* whatever appears in the help file&per. The text &odq.Help &endash. &cdq. will always be +.* inserted in front of the specified text&comma. unless the specified text is +.* &odq.help&cdq.&comma. in which case the title will simply become &odq.Help&cdq.&per. This is to +.* make sure that help windows are always obvious as such in the window list&per. +.* :p.If you need to specify multiple words&comma. surround the entire option with +.* quotes&comma. for example&colon. +.* :xmp. +.* DocView cmdref &odq.&slash.title&colon.Command Line Help&cdq. +.* :exmp. + .* ************************************************************ .* Command Line Examples .* ************************************************************ -:h2 res=15 id='CommandLineExamples'. -Command Line Examples -:p.:hp2.Command Line Examples:ehp2. -.* -:p.The following examples assume that newview is installed as a complete -replacement and therefore view is actually newview&per. -:p.:hp2.view cmdref:ehp2. -:lm margin=4. -:p.Open the file cmdref&per.inf &lpar.OS&slash.2 Command Reference&rpar. from -the help path&per. -:lm margin=1. -.* -:p.:hp2.view cmdref&plus.os2ug:ehp2. -:lm margin=4. -:p.Open two files&comma. cmdref&per.inf and os2ug&per.inf &lpar.OS&slash.2 User -Guide&rpar.&comma. in the same window&per. -.br -The table of contents from os2ug&per.inf is added to the end of the contents -from cmdref&per.inf&per. The indexes are combined alphabetically&per. -:lm margin=1. -.* -:p.:hp2.view c&colon.&bsl.os2&bsl.book&bsl.os2ug&per.inf:ehp2. +:h2 res=15 id='CommandLineExamples'.Command Line Examples +:hp2.Command Line Examples:ehp2. +:p. +The following examples assume that DocView is installed and is accessible from +the command line. +:p. +:hp2.docview fpgui:ehp2. :lm margin=4. -:p.Open the file os2ug&per.inf in the c&colon.&bsl.os2&bsl.book directory&per. +:p. +Open the file fpgui.inf (fpGUI Toolkit's class documentation) from +the help path. :lm margin=1. -.* -:p.:hp2.view &odq.c&colon.&bsl.os2 book&bsl.os2ug&per.inf&cdq.:ehp2. +:p. +:hp2.docview fpgui+rtl:ehp2. :lm margin=4. -:p.Surround path&bsl.file with double quotes if they contain special characters (like blank)&per. +:p. +Open two files, fpgui.inf and rtl.inf (Free Pascal's Runtime Library documentation), +in the same window. The table of contents from rtl.inf is added to the end of the +contents from fpgui.inf. The indexes are combined alphabetically. :lm margin=1. -.* -:p.:hp2.view cmdref dir:ehp2. +:p. +:hp2.docview c:\programming\books\rtl.inf:ehp2. :lm margin=4. -:p.Open the file cmdref &lpar.OS&slash.2 command reference&rpar. and look in -titles and index for the word &odq.dir&cdq.&per. Will show the help page for the DIR -command&per. +:p. +Open the file rtl.inf in the c:\programming\books\ directory. :lm margin=1. -.* -:p.:hp2.view &slash.s os2ug desktop:ehp2. +:p. +:hp2.docview "c:\programming books\rtl.inf":ehp2. :lm margin=4. -:p.Open the file os2ug&per.inf and search for the word &odq.desktop&cdq.&per. The best -match is shown&per. +:p. +Surround <path>\<file> with double quotes if they contain special characters +(like spaces). :lm margin=1. -.* -:p.:hp2.view &slash.g permissions:ehp2. +:p. +:hp2.docview fpgui -k themes:ehp2. :lm margin=4. -:p.Performs a search of all help files for the word &odq.permissions&cdq.&per. +:p.Open the file fpgui.inf and search for the word "themes". The best +match is shown. The search tab will also be active, showing any other search +results. :lm margin=1. -.* -:p.:hp2.set myhelp&eq.cmdref&plus.os2ug&plus.rexx:ehp2. +:p. +Linux example: .br -:hp2.view myhelp:ehp2. +:hp2.export MYHELP=rtl+fcl+fpgui:ehp2. +.br +:hp2.docview MYHELP:ehp2. +:p. +Windows example: +.br +:hp2.set MYHELP=rtl+fcl+fpgui:ehp2. +.br +:hp2.docview MYHELP:ehp2. :lm margin=4. :p.The first line sets an environment variable MYHELP to contain the names of -three help files&per. The second line opens the three files&per. +three help files. The second line opens the three files. +:note.Under Linux, environment variable names are also case sensitive (like +file names), so the environment variable "MYHELP" is not equal to "myhelp". :lm margin=1. -.* -.* + + .* ************************************************************ .* Keyboard Shortcuts .* ************************************************************ -:h1 res=10 id='KeyboardShortcuts'. -Keyboard Shortcuts -:p.:hp2.Keyboard Shortcuts:ehp2. -:p.Most keyboard shortcuts are visible in the menu&comma. but a few are not&per. -The additional shortcuts are&colon. -:p.:hp2.Alt&plus.F4:ehp2. Exit -:p.:hp2.Ctrl&plus.C:ehp2. Copy selected text to clipboard -:p.:hp2.F7:ehp2. Back -:p.:hp2.F8:ehp2. Forward -:p.:hp2.Ctrl&plus.Left:ehp2. Back -:p.:hp2.F11:ehp2. Previous in contents -:p.:hp2.F12:ehp2. Next in contents -:p. -:p.:hp2.Shortcuts visible in the menu:ehp2. -:p.:hp2.Ctrl&plus.O:ehp2. Open files -:p.:hp2.Ctrl&plus.E:ehp2. Open files from help paths -:p.:hp2.Ctrl&plus.N:ehp2. Open a new window -:p.:hp2.Ctrl&plus.P:ehp2. Print topic -:p.:hp2.F3:ehp2. Exit -:p. -:p. -:p.:hp2.Ctrl&plus.A:ehp2. Select all text in topic -:p.:hp2.Ctrl&plus.Ins:ehp2. Copy selected text to clipboard -:p. -:p.:hp2.Ctrl&plus.F:ehp2. Find within current topic -:p.:hp2.Ctrl&plus.G:ehp2. Repeat last find -:p. -:p.:hp2.Ctrl&plus.S:ehp2. Open global search tool -:p. -:p.:hp2.Alt&plus.C:ehp2. Change to the contents tab -:p.:hp2.Alt&plus.I:ehp2. Change to the index tab -:p.:hp2.Alt&plus.S:ehp2. Change to the search tab -:p.:hp2.Alt&plus.N:ehp2. Change to the notes tab -:p.:hp2.Alt&plus.P:ehp2. Toggle the left panel &lpar.tabs&rpar. on and off -:p.:hp2.F5:ehp2. Expand all contents -:p.:hp2.F6:ehp2. Collapse all contents -:p. -:p.:hp2.Esc:ehp2. Back -:p.:hp2.Ctrl&plus.Right:ehp2. Forward -:p.:hp2.Ctrl&plus.Up:ehp2. Previous topic in contents -:p.:hp2.Ctrl&plus.Down:ehp2. Next topic in contents -:p. -:p.:hp2.Ctrl&plus.D:ehp2. Edit bookmarks -:p.:hp2.Ctrl&plus.B:ehp2. Bookmark current topic -:p. -:p.:hp2.Ctrl&plus.M:ehp2. Add note at cursor position -:p. -:p.:hp2.F1:ehp2. Help for NewView -.* -.* +.* TODO +.* :h1 res=10 id='KeyboardShortcuts'. +.* Keyboard Shortcuts +.* :p.:hp2.Keyboard Shortcuts:ehp2. +.* :p.Most keyboard shortcuts are visible in the menu&comma. but a few are not&per. +.* The additional shortcuts are&colon. +.* :p.:hp2.Alt&plus.F4:ehp2. Exit +.* :p.:hp2.Ctrl&plus.C:ehp2. Copy selected text to clipboard +.* :p.:hp2.F7:ehp2. Back +.* :p.:hp2.F8:ehp2. Forward +.* :p.:hp2.Ctrl&plus.Left:ehp2. Back +.* :p.:hp2.F11:ehp2. Previous in contents +.* :p.:hp2.F12:ehp2. Next in contents +.* :p. +.* :p.:hp2.Shortcuts visible in the menu:ehp2. +.* :p.:hp2.Ctrl&plus.O:ehp2. Open files +.* :p.:hp2.Ctrl&plus.E:ehp2. Open files from help paths +.* :p.:hp2.Ctrl&plus.N:ehp2. Open a new window +.* :p.:hp2.Ctrl&plus.P:ehp2. Print topic +.* :p.:hp2.F3:ehp2. Exit +.* :p. +.* :p. +.* :p.:hp2.Ctrl&plus.A:ehp2. Select all text in topic +.* :p.:hp2.Ctrl&plus.Ins:ehp2. Copy selected text to clipboard +.* :p. +.* :p.:hp2.Ctrl&plus.F:ehp2. Find within current topic +.* :p.:hp2.Ctrl&plus.G:ehp2. Repeat last find +.* :p. +.* :p.:hp2.Ctrl&plus.S:ehp2. Open global search tool +.* :p. +.* :p.:hp2.Alt&plus.C:ehp2. Change to the contents tab +.* :p.:hp2.Alt&plus.I:ehp2. Change to the index tab +.* :p.:hp2.Alt&plus.S:ehp2. Change to the search tab +.* :p.:hp2.Alt&plus.N:ehp2. Change to the notes tab +.* :p.:hp2.Alt&plus.P:ehp2. Toggle the left panel &lpar.tabs&rpar. on and off +.* :p.:hp2.F5:ehp2. Expand all contents +.* :p.:hp2.F6:ehp2. Collapse all contents +.* :p. +.* :p.:hp2.Esc:ehp2. Back +.* :p.:hp2.Ctrl&plus.Right:ehp2. Forward +.* :p.:hp2.Ctrl&plus.Up:ehp2. Previous topic in contents +.* :p.:hp2.Ctrl&plus.Down:ehp2. Next topic in contents +.* :p. +.* :p.:hp2.Ctrl&plus.D:ehp2. Edit bookmarks +.* :p.:hp2.Ctrl&plus.B:ehp2. Bookmark current topic +.* :p. +.* :p.:hp2.Ctrl&plus.M:ehp2. Add note at cursor position +.* :p. +.* :p.:hp2.F1:ehp2. Help for DocView + + .* ************************************************************ .* Environment Variables .* ************************************************************ -:h1 res=11 id='L_EnvironmentVariables'. -Environment Variables -:p.:hp2.Environment Variables:ehp2. -:p. -:p.Both the :hp2.BOOKSHELF:ehp2. and :hp2.HELP:ehp2. environment variables -define paths &lpar.lists of directories&rpar. for searching for help files&per. -NewView uses both paths without distinction&per. -:p.These paths are searched when you&colon. -:p.o specify a help file without a path on the command line -:p.o use the File &endash. Open Special&per.&per.&per. menu item -:p.o do a :link reftype=hd refid='GlobalSearch'.global search:elink. +:h1 res=11 id='L_EnvironmentVariables'.Environment Variables +:hp2.Environment Variables:ehp2. +:p. +Both the :hp2.BOOKSHELF:ehp2. and :hp2.HELP:ehp2. environment variables +define paths (lists of directories) for searching for help files. +DocView uses both paths without distinction. +:p. +These paths are searched when you: +:ul. +:li.specify a help file without a path on the command line +:li.use the "File - Open Special..." menu item +.* TODO +.* :li.do a :link reftype=hd refid='GlobalSearch'.global search:elink. +:eul. :p.You can permanently add directories of help files to the :hp2.HELP:ehp2. or -:hp2.BOOKSHELF:ehp2. paths by modifying the CONFIG&per.SYS file&per. Add to both -paths&comma. if you also want old view to be able to find the files&per. -:p.:hp2.Other environment variables:ehp2. -:p.The :hp2.LANG:ehp2. environment variable is examined to decide the default -language that NewView will be displayed in&per. &lpar.Overridden by the -&slash.lang :link reftype=hd refid='AdvancedParameters'.command line -parameter:elink.&per.&rpar. See the newview readme&per.txt for more information -about languages&per. -:p.The directory defined in :hp2.LOGFILES:ehp2. is used for logging crashes or -other information&per. -:p.The subdirectory &odq.lang&cdq. under the directory defined by :hp2.OSDIR:ehp2. is -searched for language files at startup&per. -:p.The path :hp2.ULSPATH:ehp2. is also searched for language files&per. -.* -.* +:hp2.BOOKSHELF:ehp2. paths by modifying the CONFIG&per.SYS (Windows) or +~/.profile (Linux &. FreeBSD) file. +:p. +:hp2.Other environment variables:ehp2. +:p. +The :hp2.LANG:ehp2. environment variable is examined under Linux or FreeBSD to +decide the default language that DocView will be displayed in. Windows doesn't +user a environment variable, instead use the Region applet in the Windows Control Panel. + + .* ************************************************************ .* For Authors and Developers .* ************************************************************ -:h1 res=20 id='ForAuthors'. -For Authors and Developers -:p.:hp2.For Authors and Developers:ehp2. +:h1 res=20 id='ForAuthors'.For Authors and Developers +:hp2.For Authors and Developers:ehp2. +:p. +This section contains some notes for document authors and software +developers. :p. -:p.This section contains some notes for document authors and software -developers&per. -:p.Also see the section about URL recognition in the :link reftype=hd -refid='InternetLinks'.Internet Links :elink.topic&per. +Also see the section about URL recognition in the :link reftype=hd +refid='InternetLinks'.Internet Links :elink.topic. + .* ************************************************************ .* Writing Help Files .* ************************************************************ -:h2 res=12 id='WritingHelpFiles'. -Writing Help Files -:p.:hp2.Writing OS&slash.2 Help Files :ehp2. -:p. -:p.OS&slash.2 Help Files are produced using the IPF Compiler&per. IPF stands for -Information Presentation Facility&per. -:p.The IPF Compiler takes a text file written in a language that tells it about -things like headings&comma. links&comma. text and images&comma. and produces -either a &per.INF or &per.HLP file&per. -:p.The official way to obtain the IPF compiler &lpar.ipfc&per.exe&rpar. is from -the OS&slash.2 Developers Toolkit&per. This is included free with eComStation -&lpar.http&colon.&slash.&slash.www&per.ecomstation&per.com&rpar.&per. -:p.Since the language for IPFC is tedious &lpar.for example all punctuation must -be typed as special keywords&comma. like &.comma&per.&rpar. many people use -other tools besides the IPF compiler itself&per. -:p.I use Vyperhelp -&lpar.http&colon.&slash.&slash.www&per.vyperhelp&per.com&rpar. since it is -simple and graphical&per. It can also export to Windows Help&comma. HTML and -others&comma. though it only runs on OS&slash.2&per. Not free&per. -:p.Some other popular options are&colon. -:p.o HyperText&slash.2 IPF Preprocessor -&lpar.http&colon.&slash.&slash.www&per.clanganke&per.de&slash.os2&slash.sw&slash.htext&slash. -.br -&rpar. &endash. preprocesses a simpler starting language into the very difficult -IPF format&per. Free&per. -:p.o HyperMake -&lpar.http&colon.&slash.&slash.www&per.hypermake&per.com&rpar.&per. -Similar&comma. but can also produce Windows Help and HTML&per. -:p.o Sibyl &lpar.which NewView was created with&rpar. comes with an IPF -preprocessor&per. -:p.o IPFEditor from PCS -&lpar.http&colon.&slash.&slash.www&per.pcs&endash.soft&per.com&slash.productipfe212&per.htm -.br -&rpar.&per. Probably the most complete&comma. but significant cost&per. -Note&colon. NewView doesn&apos.t support everything IPFE can do&xclm. -.br -In the past there were many other options&per. Those listed should still be -available and have some support&per. +:h2 res=12 id='WritingHelpFiles'.Writing Help Files +:hp2.Writing fpGUI Toolkit and OS/2 Help Files:ehp2. +:p. +fpGUI Toolkit Help Files are produced using the IPF Compiler. IPF stands for +Information Presentation Facility and was original designed by IBM. +:p. +The IPF Compiler takes a text file written in a markup language that tells +it about things like headings, links, text and images, and produces +either a .INF or .HLP file. +:p. +The official way to obtain the IPF compiler (ipfc.exe). is from +the OS/2 Developers Toolkit. This is included free with eComStation +(http://www.ecomstation.com). fpGUI doesn't support the OS/2 platform, so we +can't really use the origin IPF Compiler. Luckily for us, open source software +comes to the rescue! A developer from the OpenWatcom (http://www.openwatcom.org) project +implemented a clean room implementation of the IPF Compiler, by simply using the +origin IPF Compiler documentation as a guide. This new compiler is called WIPC, and +is 100% compatible with the original IBM version. +:p. +For your convenience I included the OpenWatcom IPF Compiler as part of fpGUI Toolkit. +You can find pre-built Windows and Linux binaries in the <fpgui>/tools/wipfc/ directory. +:p. +One huge benefit of the WIPFC compiler over the original IBM version, is that it +is much easier to author help files. With the original IBM version the source help text +was very tedious to write. Every symbol or punctuation like a comma, semi-colon, hyphen etc. and to be +written as special "escaped" keyword. This requirement (and labour intensive work) was +luckily removed from the WIPFC version. +:p. +fpGUI also includes the IPF Language Reference document (IPFREF_v4.INF) as part +of fpGUI Toolkit. You can find this INF document in the +<fpgui>/docview/docs/ directory. The IPF language is not hard to learn. There are +45 tags in total, but you don't need all of them to start authoring your own help +files. All markup tags (with the exception of 5 tags) start with a colon and end +with a fullstop. The tags are mnemonic, making it easy to assocciate them with +their function. +:p. +There are still some GUI IPF editors out there, but most of them are only for +OS/2 (and maybe for Windows). The IPF Language is actually really easy to learn +and understand, so you don't really need a special editor. I used my programming IDE +as my editor, and simply supplied it with a syntax highlighter for the IPF language. +No extra tools needed. Just so you know, that is what I used to author this help +document. :-) +:p. +Here is an example of a small IPF document to get you started. I'll also show you +how to compile it into a binary INF file - viewable with DocView of course. ;-) +:p. +Lets create a text file and call it "sample.ipf". Then type in the following using +your favourite text editor. +:xmp. + &colon.userdoc. + &colon.title. Sample INF file... + &colon.h1.Header One + &colon.p.This is a sample file with one header in the table of content. + &colon.p.This is paragraph two of this single header. + &colon.euserdoc. +:exmp. +:p. +Save the document and close your editor. Now we have the source of our first help +file. Now all that remains is to compile it into a binary INF file. +:p. +To use the WIPC compiler, we need to setup an environment variable so the compiler +can find some of it's support files. +:p. +We do this as follows under Linux. +:xmp. + export WIPFC=~/apps/wipfc/ +:exmp. + ...or as follows under Windows. +:xmp. + set WIPFC=C:\apps\wipfc\ +:exmp. + +I normally setup my computer so that those settings are permantantly set when my +computer boots up. I also make sure the "wipfc" executable is setup in the system +search path so I can run it form anywhere on my system. Now we are ready to compile +our help file! + +:xmp. + wipfc -i sample.ipf +:exmp. + +:p. +If you typed the document correctly, you should now have +a :hp2.sample.inf:ehp2. file in the current directory. Now you simply +run DocView and open your first INF help file. Well done! + .* ************************************************************ .* Topic Resource IDs .* ************************************************************ -:h2 res=16 id='TopicResourceIDs'. -Topic Resource IDs -:p.:hp2.Topic Resource IDs:ehp2. -:p.Resource IDs are used by authors of online help for applications&comma. to -identify help topics&per. Applications call the Help Manager specifying a -resource ID&comma. either directly using the HM&us.DISPLAY&us.HELP -message&comma. or indirectly via help tables added to their resources&comma. -which PM automatically handles&per. The resource ID is stored in a table inside -the help file&per. -:p.For document authors&comma. NewView offers the ability to see and find -resource IDs&per. -:p.:hp2.Finding by Resource ID:ehp2. -:p.Use Tools &endash. Find Resource ID to search for a specified resource ID in -all opened files&per. -:p.:hp2.Displaying Resource IDs:ehp2. -:p.Use topic properties &lpar.right mouse click &endash. Properties&rpar. to see -which resource IDs are associated with a topic&per. +:h2 res=16 id='TopicResourceIDs'.Topic Resource IDs +:hp2.Topic Resource IDs:ehp2. +:p. +Resource IDs are used by authors of online help for applications, to +identify help topics. When you create fpGUI base applications, the fpGUI +framework will call DocView with the resource ID as parameter, to display the +correct topic for that part of your application. The resource ID is stored in +a table inside the help file. For a developer to use these, they needs to set +the component's HelpType to htContext. +:p. +For document authors, DocView offers the ability to see and find +resource IDs. +:p. +:hp2.Finding by Resource ID:ehp2. +:p. +Use "Tools - Find topic by resource ID" to search for a specified resource ID in +all opened files. +:p. +:hp2.Displaying Resource IDs:ehp2. +:p. +Use topic properties (right mouse click in the Contents tree view - "Topic Properties") +to see which resource IDs are associated with a topic. + .* ************************************************************ .* TopicNames .* ************************************************************ -:h2 res=19 id='TopicNames'. -Topic Names -:p.:hp2.Topic Names:ehp2. +:h2 res=19 id='TopicNames'.Topic Names +:hp2.Topic Names:ehp2. +:p. +Like resource IDs, topic names can be used by developers to link to +help topics from within their application. The developers needs to set the component's +HelpType to htKeyword. :p. -:p.Like resource IDs&comma. topic names can be used by developers to link to -help topics from within their application&comma. using the HM&us.DISPLAY&us.HELP -message with parameter 2 being HM&us.PANELNAME&per. -:p.These are not so often used&per. -:p.NewView can find a particular topic name&comma. using Tools &endash. Find -Topic Name&per. +DocView can find a particular topic name, using "Tools - Find +topic by resource name". + :euserdoc. diff --git a/docview/images/docview-48x48.ico b/docview/images/docview-48x48.ico Binary files differnew file mode 100644 index 00000000..653d64f9 --- /dev/null +++ b/docview/images/docview-48x48.ico diff --git a/docview/images/notegreen_16.bmp b/docview/images/notegreen_16.bmp Binary files differnew file mode 100644 index 00000000..fdec86f7 --- /dev/null +++ b/docview/images/notegreen_16.bmp diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index a3801aa5..dc9998ed 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -46,8 +46,11 @@ type end; + { THelpFile } + THelpFile = class(TObject) private + function GetFormatVersion: string; function GetStringResourceIDCount: integer; function GetNumericResourceIDCount: integer; protected @@ -133,6 +136,7 @@ type property NumericResourceIDCount: integer read GetNumericResourceIDCount; property Index: TIndex read GetIndex; property Filename: string read _FileName; + property FormatVersion: string read GetFormatVersion; property ReferencedFiles: TStringList read _ReferencedFiles; @@ -186,6 +190,7 @@ uses // ACLFileIOUtility, // ACLLanguageUnit; fpg_main + ,fpg_utils ,nvUtilities ,ACLStringUtility ; @@ -345,6 +350,11 @@ Begin Result := Topic.HelpFile as THelpFile; end; +function THelpFile.GetFormatVersion: string; +begin + Result := Format('%d.%d', [_pHeader^.version_hi, _pHeader^.version_lo]); +end; + function THelpFile.GetStringResourceIDCount: integer; begin Result := _pHeader^.nname; @@ -1219,7 +1229,7 @@ var fstream: TFileStream; Ext: string; begin - Ext := ExtractFileExt( Filename ); + Ext := fpgExtractFileExt( Filename ); Result := ''; if SameText( Ext, '.inf' ) diff --git a/docview/src/HelpNote.pas b/docview/src/HelpNote.pas new file mode 100644 index 00000000..ec80d4d1 --- /dev/null +++ b/docview/src/HelpNote.pas @@ -0,0 +1,42 @@ +unit HelpNote; + +{$mode objfpc} + +interface + +uses + Classes, fpg_base, HelpTopic; + +type + { Simple data object store information about help note and position of note } + THelpNote = class(TObject) + public + Text: TfpgString; + Topic: TTopic; + InsertPoint: longint; + // calculated + InsertText: TfpgString; + constructor Create; + destructor Destroy; override; + end; + +implementation + +{ THelpNote } + +constructor THelpNote.Create; +begin + inherited Create; + Text := ''; + InsertText := ''; + Topic := nil; + InsertPoint := -1; +end; + +destructor THelpNote.Destroy; +begin + inherited Destroy; +end; + +end. + diff --git a/docview/src/HelpTopic.pas b/docview/src/HelpTopic.pas index a2ae38dc..8e0602a3 100644 --- a/docview/src/HelpTopic.pas +++ b/docview/src/HelpTopic.pas @@ -882,8 +882,7 @@ begin CheckForAutoURL( AText, State ); Margin := integer( ( pData + 2 )^ ); GetMarginTag( Margin, State.FontState, OutputString, false ); - OutputString := OutputString - + RTF_NewLine; + OutputString := OutputString + RTF_NewLine; end; ecSetLeftMarginFit: @@ -1047,7 +1046,7 @@ begin begin State.FontState := fsNormal; State.InCharGraphics := false; - OutputString := '</tt><wrap yes>' + RTF_NewLine; + OutputString := '</tt><wrap yes>';// + RTF_NewLine; State.Spacing := true; end; diff --git a/docview/src/IPFEscapeCodes.pas b/docview/src/IPFEscapeCodes.pas index 41e743d4..5b308f80 100644 --- a/docview/src/IPFEscapeCodes.pas +++ b/docview/src/IPFEscapeCodes.pas @@ -9,6 +9,9 @@ Unit IPFEscapeCodes; Interface +uses + Classes; + // List of IPF escape codes. Not complete! Many are just used // as magic numbers in HelpTopic.pas diff --git a/docview/src/IPFFileFormatUnit.pas b/docview/src/IPFFileFormatUnit.pas index b954f4c8..66c52b40 100644 --- a/docview/src/IPFFileFormatUnit.pas +++ b/docview/src/IPFFileFormatUnit.pas @@ -10,9 +10,9 @@ uses SysUtils; type - uint32 = longword; - uint16 = word; - uint8 = byte; + uint32 = longword; // 4 bytes + uint16 = word; // 2 bytes + uint8 = byte; // 1 byte pUInt16 = ^uint16; pUInt32 = ^uint32; pUInt8 = ^uint8; diff --git a/docview/src/NewViewConstantsUnit.pas b/docview/src/NewViewConstantsUnit.pas index 4e191b15..2aed1cd0 100644 --- a/docview/src/NewViewConstantsUnit.pas +++ b/docview/src/NewViewConstantsUnit.pas @@ -1,15 +1,24 @@ -Unit NewViewConstantsUnit; +{ + fpGUI - Free Pascal GUI Toolkit -{$mode objfpc}{$H+} + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. -// NewView - a new OS/2 Help Viewer -// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) -// Copyright 2006-2009 Ronald Brill (rbri at rbri dot de) -// This software is released under the Gnu Public License - see readme.txt + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// Common used constants for NewView + Description: + Common used constants for DocView +} +unit NewViewConstantsUnit; + +{$mode objfpc}{$H+} -Interface +interface const PARAM_LINK_NOTE = 'note'; @@ -23,6 +32,6 @@ const PRGM_FIREFOX = 'firefox'; -Implementation +implementation -End. +end. diff --git a/docview/src/SettingsUnit.pas b/docview/src/SettingsUnit.pas index 82a3aaf7..e100b1b1 100644 --- a/docview/src/SettingsUnit.pas +++ b/docview/src/SettingsUnit.pas @@ -1,12 +1,8 @@ -Unit SettingsUnit; +unit SettingsUnit; {$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 // Defines settings (options) in a record and contains functions // for loading and saving them to ini file. @@ -40,20 +36,6 @@ Const //clLightCyan = $c0ffff; //clLightGreen = $e0ffe0; - VGADefaultColors: array[ 0 .. NumColorSettings - 1 ] of TfpgColor - = ( clBoxColor, - clText1, - clText1, - clBoxColor, - clText1, - clBoxColor, - clText1, - clBoxColor, - clText1, - clBoxColor, - clGreen, - clYellow ); - DefaultColors: array[ 0 .. NumColorSettings - 1 ] of TfpgColor = ( clLightCyan, clBlack, @@ -71,21 +53,19 @@ Const ApplicationFontIndex = 0; NumFontSettings = 1; - DefaultTopicFont = DefaultTopicFont + '-' + DefaultTopicFontSize; - DefaultTopicFixedFont = DefaultTopicFixedFont + '-10' + DefaultTopicFixedFontSize; - Type TIndexStyle = ( isAlphabetical, isFileOnly, isFull ); TToolbarStyle = ( tsNone, tsImages, tsText, tsImagesAndText ); TGlobalSearchLocation = ( gsHelpPaths, gsFixedDrives, gsSelectedHelpPaths, gsCustom ); + TMRUItem = class(TObject) public Title: string; Filenames: TStringList; constructor Create; - destructor Destroy; override; + destructor Destroy; override; end; @@ -95,12 +75,12 @@ Type LastSaveDirectory: string; StartupHelp: boolean; LeftPanelWidth: longint; - ShowLeftPanel_Help: boolean; - ShowLeftPanel_Standalone: boolean; + ShowLeftPanel: boolean; + ScrollDistance: integer; FileDialogSplit: Double; Colors: array[ 0..NumColorSettings - 1 ] of TfpgColor; - NormalFont: TfpgFont; - FixedFont: TfpgFont; + NormalFontDesc: TfpgString; + FixedFontDesc: TfpgString; Fonts: array[ 0..NumFontSettings - 1 ] of TfpgFont; FixedFontSubstitution: boolean; FixedFontSubstitutes: string; @@ -116,10 +96,11 @@ Type IPFTopicSaveAsEscaped: boolean; end; + // global procs procedure LoadSettings; procedure SaveSettings; -procedure writeSettingsDetailsTo(aStrings : TStrings); +procedure WriteSettingsDetailsTo(aStrings : TStrings); procedure AddToMRUList( const Title: string; Filenames: TStrings ); var @@ -187,16 +168,14 @@ begin LeftPanelWidth := ReadInteger( GeneralSection, 'LeftPanelWidth', 225 ); FileDialogSplit := ReadInteger( GeneralSection, 'FileDialogSplit', 500 ) / 1000; - ShowLeftPanel_Help := ReadBool( GeneralSection, 'ShowLeftPanel_Help', true ); - ShowLeftPanel_Standalone := ReadBool( GeneralSection, 'ShowLeftPanel_Standalone', true ); + ShowLeftPanel := ReadBool( GeneralSection, 'ShowLeftPanel', true ); + + ScrollDistance := ReadInteger(GeneralSection, 'ScrollDistance', 75); // Colours for ColorIndex := 0 to High( Colors ) do begin - //if GetScreenColorDepth > 8 then - DefaultColor := DefaultColors[ ColorIndex ]; - //else - // DefaultColor := VGADefaultColors[ ColorIndex ]; + DefaultColor := DefaultColors[ ColorIndex ]; Colors[ ColorIndex ] := ReadInteger( ColoursSection, 'Color' + IntToStr( ColorIndex ), DefaultColor ); @@ -230,13 +209,8 @@ begin end; // Fonts - NormalFont := fpgGetFont(ReadString(FontsSection, 'NormalFont', DefaultTopicFont)); - if NormalFont = nil then - NormalFont := fpgStyle.DefaultFont; - - FixedFont := fpgGetFont(ReadString(FontsSection, 'FixedFont', DefaultTopicFixedFont)); - if FixedFont = nil then - FixedFont := fpgStyle.FixedFont; + NormalFontDesc := ReadString(FontsSection, 'NormalFont', DefaultTopicFont); + FixedFontDesc := ReadString(FontsSection, 'FixedFont', DefaultTopicFixedFont); for i := 0 to NumFontSettings - 1 do begin @@ -247,7 +221,7 @@ begin end; FixedFontSubstitution := ReadBool( FontsSection, 'FixedFontSubstitution', true ); - FixedFontSubstitutes := ReadString( FontsSection, 'FixedFontSubstitutes', 'Mono-10' ); + FixedFontSubstitutes := ReadString( FontsSection, 'FixedFontSubstitutes', DefaultTopicFixedFont ); // Index style SettingString := ReadString( GeneralSection, 'IndexStyle', 'Full' ); @@ -330,8 +304,8 @@ begin // Write split points, as units of 0.1% WriteInteger( GeneralSection, 'FileDialogSplit', Round( FileDialogSplit * 1000 ) ); - WriteBool( GeneralSection, 'ShowLeftPanel_Help', ShowLeftPanel_Help ); - WriteBool( GeneralSection, 'ShowLeftPanel_Standalone', ShowLeftPanel_Standalone ); + WriteBool( GeneralSection, 'ShowLeftPanel', ShowLeftPanel); + WriteInteger(GeneralSection, 'ScrollDistance', ScrollDistance); // Colours for ColorIndex := 0 to High( Colors ) do @@ -362,8 +336,8 @@ begin end; // Fonts - WriteString( FontsSection, 'NormalFont', NormalFont.FontDesc ); - WriteString( FontsSection, 'FixedFont', FixedFont.FontDesc ); + WriteString( FontsSection, 'NormalFont', NormalFontDesc ); + WriteString( FontsSection, 'FixedFont', FixedFontDesc ); for FontIndex := 0 to NumFontSettings - 1 do begin FontName := 'Font' + IntToStr( FontIndex ); @@ -478,7 +452,7 @@ begin end; end; -procedure writeSettingsDetailsTo(aStrings : TStrings); +procedure WriteSettingsDetailsTo(aStrings : TStrings); Begin aStrings.Add(''); aStrings.Add('---- Settings ----'); @@ -490,12 +464,12 @@ Begin aStrings.Add('LastSaveDirectory: ' + Settings.LastSaveDirectory); aStrings.Add('StartupHelp: ' + boolToStr(Settings.StartupHelp)); // LeftPanelWidth: longint; - aStrings.Add('ShowLeftPanel_Help: ' + boolToStr(Settings.ShowLeftPanel_Help)); - aStrings.Add('ShowLeftPanel_Standalone: ' + boolToStr(Settings.ShowLeftPanel_Standalone)); + aStrings.Add('ShowLeftPanel: ' + boolToStr(Settings.ShowLeftPanel)); + aStrings.Add('ScrollDistance: ' + IntToStr(Settings.ScrollDistance)); // FileDialogSplit: real; // Colors: array[ 0..NumColorSettings - 1 ] of TColor; - // NormalFont: TFont; - // FixedFont: TFont; + aStrings.Add('NormalFont: ' + Settings.NormalFontDesc); + aStrings.Add('FixedFont: ' + Settings.FixedFontDesc); // Fonts: array[ 0..NumFontSettings - 1 ] of TFont; aStrings.Add('FixedFontSubstitution: ' + boolToStr(Settings.FixedFontSubstitution)); aStrings.Add('FixedFontSubstitutes: ' + Settings.FixedFontSubstitutes); @@ -514,14 +488,9 @@ end; Initialization Settings.MRUList := TObjectList.Create; - - //Settings.NormalFont := fpgStyle.DefaultFont; - //Settings.FixedFont := fpgStyle.FixedFont; - //Settings.SearchDirectories := TStringList.Create; + Settings.SearchDirectories := TStringList.Create; Finalization - Settings.NormalFont.Free; - Settings.FixedFont.Free; Settings.SearchDirectories.Free; Settings.MRUList.Free; diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index f64b028f..144c1c30 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -1,20 +1,16 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="8"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> </Flags> <SessionStorage Value="InIDEConfig"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> <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"/> @@ -32,7 +28,7 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="30"> + <Units Count="35"> <Unit0> <Filename Value="docview.lpr"/> <IsPartOfProject Value="True"/> @@ -179,6 +175,29 @@ <Filename Value="missing.inc"/> <IsPartOfProject Value="True"/> </Unit29> + <Unit30> + <Filename Value="frm_text.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_text"/> + </Unit30> + <Unit31> + <Filename Value="docview.rc"/> + <IsPartOfProject Value="True"/> + </Unit31> + <Unit32> + <Filename Value="../docs/docview.ipf"/> + <IsPartOfProject Value="True"/> + </Unit32> + <Unit33> + <Filename Value="frm_note.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_note"/> + </Unit33> + <Unit34> + <Filename Value="HelpNote.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpNote"/> + </Unit34> </Units> </ProjectOptions> <CompilerOptions> @@ -202,7 +221,17 @@ <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> <Other> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> <CustomOptions Value="-O-"/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/docview/src/docview.lpr b/docview/src/docview.lpr index 91e50323..812c8e43 100644 --- a/docview/src/docview.lpr +++ b/docview/src/docview.lpr @@ -6,14 +6,16 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, - fpg_main, frm_main, IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, - TextSearchQuery, nvUtilities, HelpFile, SearchUnit, - fpg_cmdlineparams, IPFFileFormatUnit, HelpWindowDimensions, - NewViewConstantsUnit, SettingsUnit, RichTextStyleUnit, CanvasFontManager, - ACLStringUtility, RichTextDocumentUnit, RichTextView, RichTextLayoutUnit, - RichTextDisplayUnit, dvconstants, dvHelpers, frm_configuration, HelpBitmap; - + Classes, fpg_main, frm_main, IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, + TextSearchQuery, nvUtilities, HelpFile, SearchUnit, fpg_cmdlineparams, + IPFFileFormatUnit, HelpWindowDimensions, NewViewConstantsUnit, SettingsUnit, + RichTextStyleUnit, CanvasFontManager, ACLStringUtility, RichTextDocumentUnit, + RichTextView, RichTextLayoutUnit, RichTextDisplayUnit, dvconstants, dvHelpers, + frm_configuration, HelpBitmap, frm_text, frm_note, HelpNote; + +{$IFDEF WINDOWS} + {$R docview.rc} +{$ENDIF} procedure MainProc; var diff --git a/docview/src/docview.rc b/docview/src/docview.rc new file mode 100644 index 00000000..ab1ccf16 --- /dev/null +++ b/docview/src/docview.rc @@ -0,0 +1,29 @@ +MAINICON ICON "../images/docview-48x48.ico"
+
+1 VERSIONINFO
+FILEVERSION 0, 7, 137, 0
+PRODUCTVERSION 0, 7, 137, 0
+FILEFLAGSMASK 0
+FILEOS 0x40000
+FILETYPE 1
+{
+ BLOCK "StringFileInfo"
+ {
+ BLOCK "040904E4"
+ {
+ VALUE "CompanyName", "fpGUI Toolkit"
+ VALUE "FileDescription", "fpGUI's INF Documentation Viewer"
+ VALUE "FileVersion", "0.7.137"
+ VALUE "InternalName", "docview"
+ VALUE "LegalCopyright", "GNU Public License"
+ VALUE "OriginalFilename", "docview"
+ VALUE "ProductName", "fpGUI Toolkit"
+ VALUE "ProductVersion", "0.7.0"
+ }
+ }
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x409, 0x4E4
+ }
+}
+
diff --git a/docview/src/dvHelpers.pas b/docview/src/dvHelpers.pas index c5486bb7..25e68c92 100644 --- a/docview/src/dvHelpers.pas +++ b/docview/src/dvHelpers.pas @@ -5,44 +5,167 @@ unit dvHelpers; interface uses - Classes, SysUtils; + Classes, SysUtils, fpg_base; const OWN_HELP_MARKER = '[DOCVIEWHELP]'; function GetOwnHelpFileName: String; -function FindHelpFile(const AFilename: string): string; +// Given a filename, which may or may not contain a path or extension, +// finds the actual file. This can involve searching +// the help and bookshelf paths. +function FindHelpFile(const AFilename: TfpgString): TfpgString; +function SearchHelpPaths( const Filename: TfpgString; var ResultFilename: TfpgString; const IncludeAppDir: boolean ): boolean; + +function GetApplicationDir: TfpgString; +function SearchPath( PathEnvVar: TfpgString; Filename: TfpgString; var FilenameFound: string ): boolean; implementation uses fpg_utils + ,dvConstants + ,nvUtilities ; function GetOwnHelpFileName: String; -//var -// tmpLanguage : String; begin - //tmpLanguage := getLanguage; - //if tmpLanguage = '' then - //begin - // tmpLanguage := GetEnv(LanguageEnvironmentVar) - //end; - // - //result := FindDefaultLanguageHelpFile('NewView', tmpLanguage); - - { TODO -oGraeme -cown help : Improve own help file location } - result := fpgExtractFilePath(ParamStr(0)) + 'docview.inf'; + { TODO -oGraeme -cown help : Maybe later we will have different language versions } + result := fpgExtractFilePath(ParamStr(0)) + cDocViewHelpFile; + if not fpgFileExists(Result) then + begin + Result := FindHelpFile(cDocViewHelpFile); + end; end; // Given a "filename" which may include a path, find it in various paths and extensions -function FindHelpFile(const AFilename: string): string; +function FindHelpFile(const AFilename: TfpgString): TfpgString; +var + AlternativeFileName: TfpgString; + lFilename: TfpgString; +begin + lFilename := AFilename; + if lFileName = OWN_HELP_MARKER then + begin + Result := GetOwnHelpFileName; + exit; + end; + + Result := ''; + + AlternativeFileName := ''; + if fpgExtractFileExt( lFilename ) = '' then + begin + lFilename := fpgChangeFileExt(lFilename, '.inf'); + AlternativeFileName := fpgChangeFileExt(lFilename, '.hlp'); + end; + + if fpgExtractFilePath( lFileName ) <> '' then + begin + // Path specified; just see if it exists + + // expand out relative paths + lFilename := fpgExpandFileName( lFileName ); + AlternativeFilename := fpgExpandFileName( AlternativeFilename ); + + if fpgFileExists( lFilename ) then + Result := lFilename + else if fpgFileExists( AlternativeFilename ) then + Result := AlternativeFilename; + + end + else + begin + // Path not specified; search current + if fpgFileExists( fpgExpandFileName( lFileName ) ) then + begin + Result := fpgExpandFileName( lFileName ); + exit; + end; + + if (AlternativeFilename <> '') and fpgFileExists(fpgExpandFileName(AlternativeFilename)) then + begin + Result := fpgExpandFileName( AlternativeFilename ); + exit; + end; + + // Search help paths + if not SearchHelpPaths( lFileName, + Result, + false // don't search our app dir + ) then + begin + // Didn't find as specified or as .inf, try .hlp + if AlternativeFilename <> '' then + begin + if not SearchHelpPaths( AlternativeFileName, + Result, + false // don't search our app dir + ) then + begin + Result := ''; + end; + end; + end; + end; +// Result := AFileName; +end; + +Function SearchHelpPaths( const Filename: TfpgString; + var ResultFilename: TfpgString; + const IncludeAppDir: boolean ): boolean; +begin + Result := SearchPath( HelpPathEnvironmentVar, + FileName, + ResultFilename ); + if not Result then + Result := SearchPath( BookshelfEnvironmentVar, + FileName, + ResultFilename ); + if ( not Result ) and IncludeAppDir then + begin + ResultFilename := fpgAppendPathDelim(GetApplicationDir) + + Filename; + Result := fpgFileExists( ResultFilename ); + if not Result then + ResultFilename := ''; + end; + +end; + +function GetApplicationDir: TfpgString; +begin + Result := fpgExtractFilePath(ParamStr(0)); +end; + +function SearchPath( PathEnvVar: TfpgString; Filename: TfpgString; var FilenameFound: string ): boolean; +var + lFilename: string; + lDir: TfpgString; + fl: TStrings; + i: integer; begin - { TODO -ograemeg -csearch files : Implement searching know locations } - Result := AFileName; + Result := False; + FilenameFound := ''; + + lDir := GetEnvironmentVariable(PathEnvVar); + + fl := TStringList.Create; + ListFilesInDirectory(lDir, AllFilesMask, True, fl); + TStringList(fl).Sort; + for i := 0 to fl.Count-1 do + begin + lFilename := fpgExtractFileName(fl[i]); + if SameText(lFilename, Filename) then + begin + FilenameFound := fl[i]; + Result := True; + Exit; + end; + end; end; diff --git a/docview/src/dvconstants.pas b/docview/src/dvconstants.pas index 626e0840..3e44ef58 100644 --- a/docview/src/dvconstants.pas +++ b/docview/src/dvconstants.pas @@ -1,9 +1,31 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + Constants used by DocView. +} + unit dvConstants; {$mode objfpc}{$H+} interface +uses + Classes + ,fpg_base + ; + const { DO NOT LOCALIZE } HelpPathEnvironmentVar = 'HELP'; @@ -11,6 +33,8 @@ const HELP_FILE_DELIMITER = '+'; HELP_FILE_EXTENSION = ExtensionSeparator + 'hlp'; INF_FILE_EXTENSION = ExtensionSeparator + 'inf'; + NOTES_FILE_EXTENSION = ExtensionSeparator + 'notes'; + cDocViewHelpFile = 'docview.inf'; resourcestring @@ -24,7 +48,7 @@ resourcestring rsDVNoFile = 'No file'; rsDVOpenHelpFile = 'Open Help File'; rsDVHelpFiles = 'Help Files'; - rsDVNoMatchesFound = '(No matches found for ''%s'')'; + rsDVNoMatchesFound = '(No matches found for <%s>)'; rsDVSearchSyntaxError = 'Error in search syntax: '; rsDVSearchFoundMsg = 'Found %d matches for '; rsDVCouldNotOpen = 'Could not open <%s>'; @@ -33,6 +57,7 @@ const hcConfigGeneralTab = 510; hcConfigFontsColorTab = 520; + implementation end. diff --git a/docview/src/frm_configuration.pas b/docview/src/frm_configuration.pas index 2e19939b..348f445d 100644 --- a/docview/src/frm_configuration.pas +++ b/docview/src/frm_configuration.pas @@ -6,44 +6,57 @@ 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; + fpg_label, fpg_edit, fpg_panel, fpg_combobox, fpg_listbox, fpg_checkbox, + fpg_editbtn, fpg_radiobutton; type TConfigurationForm = class(TfpgForm) private {@VFD_HEAD_BEGIN: ConfigurationForm} - PageControl1: TfpgPageControl; + pcSettings: TfpgPageControl; btnSave: TfpgButton; btnCancel: TfpgButton; tsGeneral: TfpgTabSheet; tsFontsColor: TfpgTabSheet; + tsIndex: TfpgTabSheet; Label1: TfpgLabel; - edtNormalFont: TfpgEdit; - btnNormalFont: TfpgButton; Label2: TfpgLabel; - edtFixedFont: TfpgEdit; - btnFixedFont: TfpgButton; - btnHelp: TfpgButton; - Panel1: TfpgPanel; - cbIndexStyle: TfpgComboBox; + pnlSearchHighlight: TfpgPanel; + pnlNotesColor: TfpgPanel; lblIndexStyle: TfpgLabel; lblSearchDirs: TfpgLabel; btnSearchDirAdd: TfpgButton; lbSearchDirs: TfpgListBox; btnSearchDirDelete: TfpgButton; chkEscapeIPFSymbols: TfpgCheckBox; + chkStartupHelp: TfpgCheckBox; + chkOpenTOC: TfpgCheckBox; + btnColorHighlight: TfpgButton; + btnColorNotes: TfpgButton; + btnResetColors: TfpgButton; + edtFixedFont: TfpgFontEdit; + edtNormalFont: TfpgFontEdit; + rbIndexOrig: TfpgRadioButton; + rbIndexAlpha: TfpgRadioButton; + rbIndexBoth: TfpgRadioButton; + lblScrollDistance: TfpgLabel; + edtScrollDistance: TfpgEditInteger; + lblPixels: TfpgLabel; {@VFD_HEAD_END: ConfigurationForm} - procedure btnNormalFontClicked(Sender: TObject); - procedure btnFixedFontClicked(Sender: TObject); + btnHelp: TfpgButton; 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 btnSearchHighlightClicked(Sender: TObject); + procedure btnNotesColorClicked(Sender: TObject); + procedure ResetColorsButtonOnClick(Sender: TObject); procedure SettingsToGui; procedure GuiToSettings; + procedure UpdateColorPanels; public constructor Create(AOwner: TComponent); override; procedure AfterCreate; override; @@ -72,28 +85,10 @@ 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; + pcSettings.ActivePage := tsGeneral; // programatically seting a tab does not fire OnChange event, so we do it mantually PageControl1Change(self, tsGeneral); end; @@ -108,11 +103,11 @@ procedure TConfigurationForm.PageControl1Change(Sender: TObject; begin if NewActiveSheet = tsGeneral then begin - btnHelp.HelpContext := hcConfigGeneralTab; +// btnHelp.HelpContext := hcConfigGeneralTab; end else if NewActiveSheet = tsFontsColor then begin - btnHelp.HelpContext := hcConfigFontsColorTab; +// btnHelp.HelpContext := hcConfigFontsColorTab; end; end; @@ -137,28 +132,76 @@ begin lbSearchDirs.Items.Add(s); end; +procedure TConfigurationForm.btnSearchHighlightClicked(Sender: TObject); +begin + pnlSearchHighlight.BackgroundColor := fpgSelectColorDialog(pnlSearchHighlight.BackgroundColor); +end; + +procedure TConfigurationForm.btnNotesColorClicked(Sender: TObject); +begin + pnlNotesColor.BackgroundColor := fpgSelectColorDialog(pnlNotesColor.BackgroundColor); +end; + +procedure TConfigurationForm.ResetColorsButtonOnClick(Sender: TObject); +var + i: longint; +Begin + // restore default colors + for i := 0 to NumColorSettings - 1 do + begin + Settings.Colors[i] := DefaultColors[i]; + end; + UpdateColorPanels; +End; + procedure TConfigurationForm.SettingsToGui; begin // General - cbIndexStyle.FocusItem := Ord(Settings.IndexStyle); + edtScrollDistance.Value := Settings.ScrollDistance; lbSearchDirs.Items.Assign(Settings.SearchDirectories); chkEscapeIPFSymbols.Checked := Settings.IPFTopicSaveAsEscaped; + chkStartupHelp.Checked := Settings.StartupHelp; + chkOpenTOC.Checked := Settings.OpenWithExpandedContents; // Fonts & Color - edtNormalFont.Text := Settings.NormalFont.FontDesc; - edtFixedFont.Text := Settings.FixedFont.FontDesc; + edtNormalFont.FontDesc := Settings.NormalFontDesc; + edtFixedFont.FontDesc := Settings.FixedFontDesc; + UpdateColorPanels; + // Index + rbIndexOrig.Checked := Settings.IndexStyle = isFileOnly; + rbIndexAlpha.Checked := Settings.IndexStyle = isAlphabetical; + rbIndexBoth.Checked := Settings.IndexStyle = isFull; end; procedure TConfigurationForm.GuiToSettings; begin // General - Settings.IndexStyle := TIndexStyle(cbIndexStyle.FocusItem); + if edtScrollDistance.Value < 1 then + edtScrollDistance.Value := 75; // default + if edtScrollDistance.Value > 400 then + edtScrollDistance.Value := 400; + Settings.ScrollDistance := edtScrollDistance.Value; Settings.SearchDirectories.Assign(lbSearchDirs.Items); Settings.IPFTopicSaveAsEscaped := chkEscapeIPFSymbols.Checked; + Settings.StartupHelp := chkStartupHelp.Checked; + Settings.OpenWithExpandedContents := chkOpenTOC.Checked; // Fonts & Color - Settings.NormalFont.Free; - Settings.NormalFont := fpgGetFont(edtNormalFont.Text); - Settings.FixedFont.Free; - Settings.FixedFont := fpgGetFont(edtFixedFont.Text); + Settings.NormalFontDesc := edtNormalFont.FontDesc; + Settings.FixedFontDesc := edtFixedFont.FontDesc; + Settings.Colors[SearchHighlightTextColorIndex] := pnlSearchHighlight.BackgroundColor; + Settings.Colors[NotesTextColorIndex] := pnlNotesColor.BackgroundColor; + // Index + if rbIndexOrig.Checked then + Settings.IndexStyle := isFileOnly + else if rbIndexAlpha.Checked then + Settings.IndexStyle := isAlphabetical + else if rbIndexBoth.Checked then + Settings.IndexStyle := isFull; +end; + +procedure TConfigurationForm.UpdateColorPanels; +begin + pnlSearchHighlight.BackgroundColor := Settings.Colors[SearchHighlightTextColorIndex]; + pnlNotesColor.BackgroundColor := Settings.Colors[NotesTextColorIndex]; end; constructor TConfigurationForm.Create(AOwner: TComponent); @@ -172,17 +215,20 @@ begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: ConfigurationForm} Name := 'ConfigurationForm'; - SetPosition(310, 157, 515, 439); + SetPosition(402, 189, 515, 439); WindowTitle := 'Configuration'; + Hint := ''; + ShowHint := True; WindowPosition := wpOneThirdDown; - PageControl1 := TfpgPageControl.Create(self); - with PageControl1 do + pcSettings := TfpgPageControl.Create(self); + with pcSettings do begin - Name := 'PageControl1'; + Name := 'pcSettings'; SetPosition(4, 4, 506, 388); Anchors := [anLeft,anRight,anTop,anBottom]; ActivePageIndex := 0; + Hint := ''; TabOrder := 0; OnChange := @PageControl1Change; end; @@ -193,10 +239,11 @@ begin Name := 'btnSave'; SetPosition(344, 408, 80, 24); Text := 'Save'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; - TabOrder := 1; + TabOrder := 25; OnClick := @btnSaveClick; end; @@ -206,14 +253,15 @@ begin Name := 'btnCancel'; SetPosition(428, 408, 80, 24); Text := 'Cancel'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; - TabOrder := 2; + TabOrder := 26; OnClick := @btnCancelClick; end; - tsGeneral := TfpgTabSheet.Create(PageControl1); + tsGeneral := TfpgTabSheet.Create(pcSettings); with tsGeneral do begin Name := 'tsGeneral'; @@ -221,7 +269,7 @@ begin Text := 'General'; end; - tsFontsColor := TfpgTabSheet.Create(PageControl1); + tsFontsColor := TfpgTabSheet.Create(pcSettings); with tsFontsColor do begin Name := 'tsFontsColor'; @@ -229,119 +277,64 @@ begin Text := 'Fonts & Color'; end; + tsIndex := TfpgTabSheet.Create(pcSettings); + with tsIndex do + begin + Name := 'tsIndex'; + SetPosition(3, 24, 500, 361); + Text := 'Index'; + end; + Label1 := TfpgLabel.Create(tsFontsColor); with Label1 do begin Name := 'Label1'; - SetPosition(12, 20, 108, 16); + SetPosition(12, 20, 108, 19); FontDesc := '#Label1'; Hint := ''; + Layout := tlCenter; 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); + SetPosition(12, 52, 104, 19); FontDesc := '#Label1'; Hint := ''; + Layout := tlCenter; 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 + pnlSearchHighlight := TfpgPanel.Create(tsFontsColor); + with pnlSearchHighlight do begin - Name := 'btnFixedFont'; - SetPosition(384, 48, 80, 24); - Anchors := [anRight,anTop]; - Text := 'Select...'; + Name := 'pnlSearchHighlight'; + SetPosition(12, 104, 360, 24); FontDesc := '#Label1'; Hint := ''; - ImageName := ''; - TabOrder := 5; - OnClick :=@btnFixedFontClicked; + Style := bsLowered; + Text := 'Search Highlight Color'; end; - btnHelp := TfpgButton.Create(self); - with btnHelp do + pnlNotesColor := TfpgPanel.Create(tsFontsColor); + with pnlNotesColor do begin - Name := 'btnHelp'; - SetPosition(468, 356, 28, 24); - Anchors := [anRight,anBottom]; - Text := '?'; + Name := 'pnlNotesColor'; + SetPosition(12, 134, 360, 24); 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; + Text := 'Notes/Annotations Color'; end; - lblIndexStyle := TfpgLabel.Create(tsGeneral); + lblIndexStyle := TfpgLabel.Create(tsIndex); with lblIndexStyle do begin Name := 'lblIndexStyle'; - SetPosition(12, 12, 212, 16); - FontDesc := '#Label1'; + SetPosition(12, 12, 224, 17); + FontDesc := '#Label2'; Hint := ''; Text := 'Index style'; end; @@ -350,7 +343,7 @@ begin with lblSearchDirs do begin Name := 'lblSearchDirs'; - SetPosition(12, 64, 216, 16); + SetPosition(12, 65, 308, 17); FontDesc := '#Label1'; Hint := ''; Text := 'Search directories'; @@ -362,10 +355,11 @@ begin Name := 'btnSearchDirAdd'; SetPosition(408, 84, 80, 24); Text := 'Add...'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; - TabOrder := 4; + TabOrder := 3; OnClick :=@btnSearchDirAddClicked; end; @@ -375,8 +369,7 @@ begin Name := 'lbSearchDirs'; SetPosition(12, 84, 388, 148); FontDesc := '#List'; - HotTrack := False; - PopupFrame := False; + Hint := ''; TabOrder := 5; Items.Duplicates := dupIgnore; end; @@ -387,10 +380,11 @@ begin Name := 'btnSearchDirDelete'; SetPosition(408, 116, 80, 24); Text := 'Remove...'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; - TabOrder := 5; + TabOrder := 4; end; chkEscapeIPFSymbols := TfpgCheckBox.Create(tsGeneral); @@ -400,12 +394,185 @@ begin SetPosition(12, 244, 480, 20); Anchors := [anLeft,anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 6; Text := 'Escape symbols when saving topics as IPF text'; end; + chkStartupHelp := TfpgCheckBox.Create(tsGeneral); + with chkStartupHelp do + begin + Name := 'chkStartupHelp'; + SetPosition(12, 268, 480, 20); + Anchors := [anLeft,anRight,anTop]; + Checked := True; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 7; + Text := 'Show DocView help at startup if no files opened'; + end; + + chkOpenTOC := TfpgCheckBox.Create(tsGeneral); + with chkOpenTOC do + begin + Name := 'chkOpenTOC'; + SetPosition(12, 292, 476, 20); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 8; + Text := 'Open files with contents expanded'; + end; + + btnColorHighlight := TfpgButton.Create(tsFontsColor); + with btnColorHighlight do + begin + Name := 'btnColorHighlight'; + SetPosition(384, 104, 80, 24); + Text := 'Color'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 15; + OnClick := @btnSearchHighlightClicked; + end; + + btnColorNotes := TfpgButton.Create(tsFontsColor); + with btnColorNotes do + begin + Name := 'btnColorNotes'; + SetPosition(384, 134, 80, 24); + Text := 'Color'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 15; + OnClick := @btnNotesColorClicked; + end; + + btnResetColors := TfpgButton.Create(tsFontsColor); + with btnResetColors do + begin + Name := 'btnResetColors'; + SetPosition(12, 328, 100, 24); + Text := 'Reset Colors'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 16; + OnClick := @ResetColorsButtonOnClick; + end; + + edtFixedFont := TfpgFontEdit.Create(tsFontsColor); + with edtFixedFont do + begin + Name := 'edtFixedFont'; + SetPosition(124, 48, 340, 24); + Anchors := [anLeft,anRight,anTop]; + FontDesc := ''; + TabOrder := 14; + end; + + edtNormalFont := TfpgFontEdit.Create(tsFontsColor); + with edtNormalFont do + begin + Name := 'edtNormalFont'; + SetPosition(124, 16, 340, 24); + Anchors := [anLeft,anRight,anTop]; + FontDesc := ''; + TabOrder := 13; + end; + + rbIndexOrig := TfpgRadioButton.Create(tsIndex); + with rbIndexOrig do + begin + Name := 'rbIndexOrig'; + SetPosition(24, 28, 280, 20); + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := ''; + TabOrder := 21; + Text := 'File Only (only entries specified in file)'; + end; + + rbIndexAlpha := TfpgRadioButton.Create(tsIndex); + with rbIndexAlpha do + begin + Name := 'rbIndexAlpha'; + SetPosition(24, 48, 280, 20); + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := ''; + TabOrder := 22; + Text := 'Alphabetical listing of topics'; + end; + + rbIndexBoth := TfpgRadioButton.Create(tsIndex); + with rbIndexBoth do + begin + Name := 'rbIndexBoth'; + SetPosition(24, 68, 280, 20); + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := ''; + TabOrder := 23; + Text := 'Both'; + end; + + lblScrollDistance := TfpgLabel.Create(tsGeneral); + with lblScrollDistance do + begin + Name := 'lblScrollDistance'; + SetPosition(12, 12, 280, 17); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Mouse Wheel Scroll Distance'; + end; + + edtScrollDistance := TfpgEditInteger.Create(tsGeneral); + with edtScrollDistance do + begin + Name := 'edtScrollDistance'; + SetPosition(12, 32, 72, 24); + Hint := ''; + TabOrder := 2; + FontDesc := '#Edit1'; + Value := 0; + end; + + lblPixels := TfpgLabel.Create(tsGeneral); + with lblPixels do + begin + Name := 'lblPixels'; + SetPosition(88, 36, 80, 17); + FontDesc := '#Label1'; + Hint := ''; + Text := '(pixels)'; + end; + {@VFD_BODY_END: ConfigurationForm} {%endregion} + + // always reset pagecotrol + pcSettings.ActivePageIndex := 0; + + //btnHelp := TfpgButton.Create(self); + //with btnHelp do + //begin + // Name := 'btnHelp'; + // SetPosition(468, 356, 28, 24); + // Anchors := [anRight,anBottom]; + // Text := '?'; + // FontDesc := '#Label1'; + // Hint := ''; + // ImageName := ''; + // TabOrder := 21; + // HelpType := htContext; + // OnClick := @btnHelpClick; + //end; end; diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 3e24c320..2b32ca26 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -45,7 +45,7 @@ type Label3: TfpgLabel; btnSearch: TfpgButton; tsNotes: TfpgTabSheet; - ListBox1: TfpgListBox; + NotesListBox: TfpgListBox; btnNotesAdd: TfpgButton; btnNotesEdit: TfpgButton; btnNotesDel: TfpgButton; @@ -58,8 +58,8 @@ type miFile: TfpgPopupMenu; miSettings: TfpgPopupMenu; miBookmarks: TfpgPopupMenu; + miView: TfpgPopupMenu; miHelp: TfpgPopupMenu; - miDebug: TfpgPopupMenu; ToolBar: TfpgBevel; btnOpen: TfpgButton; btnBack: TfpgButton; @@ -70,6 +70,9 @@ type btnQuit: TfpgButton; Bevel1: TfpgBevel; Bevel2: TfpgBevel; + miTools: TfpgPopupMenu; + Bevel3: TfpgBevel; + btnTBNoteAdd: TfpgButton; {@VFD_HEAD_END: MainForm} miOpenRecentMenu: TfpgPopupMenu; miDebugHexInfo: TfpgMenuItem; @@ -92,7 +95,19 @@ type 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; - + OpenAdditionalFile: boolean; + Notes: TList; // Notes in current files. + + procedure btnTBNoteAddClick(Sender: TObject); + procedure RichViewOverLink(Sender: TRichTextView; Link: string); + procedure RichViewNotOverLink(Sender: TRichTextView; Link: string); + procedure NotesListBoxChange(Sender: TObject); + procedure NotesListBoxKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure NotesListBoxDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure btnNotesAddClick(Sender: TObject); + procedure btnNotesDelClick(Sender: TObject); + procedure btnNotesEditClick(Sender: TObject); + procedure UpdateRichViewFromSettings; procedure btnBackHistClick(Sender: TObject); procedure btnFwdHistClick(Sender: TObject); procedure btnPrevClick(Sender: TObject); @@ -103,14 +118,21 @@ type procedure MainFormDestroy(Sender: TObject); procedure miFileQuitClicked(Sender: TObject); procedure miFileOpenClicked(Sender: TObject); + procedure miFileOpenAdditionalFileClicked(Sender: TObject); procedure miFileOpenSpecialClicked(Sender: TObject); procedure miFileCloseClicked(Sender: TObject); procedure miConfigureClicked(Sender: TObject); + procedure miViewExpandAllClicked(Sender: TObject); + procedure miViewCollapseAllClicked(Sender: TObject); procedure miHelpProdInfoClicked(Sender: TObject); procedure miHelpAboutFPGui(Sender: TObject); procedure miHelpCmdLineParams(Sender: TObject); + procedure miHelpUsingDocView(Sender: TObject); procedure miDebugHeader(Sender: TObject); procedure miDebugHex(Sender: TObject); + procedure miToolsFindByResourceID(Sender: TObject); + procedure miToolsFindTopifByName(Sender: TObject); + procedure miTopicPropertiesClicked(Sender: TObject); procedure miFileSaveTopicAsIPF(Sender: TObject); procedure OnMRUMenuItemClick(Sender: TObject); procedure btnShowIndex(Sender: TObject); @@ -128,6 +150,7 @@ type 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 btnNotesGotoClicked(Sender: TObject); procedure IndexSearchEditOnChange(Sender: TObject); procedure DisplaySelectedSearchResultTopic; procedure NavigateToHistoryIndex(AIndex: integer); @@ -145,14 +168,31 @@ type function OpenFile(const AFileName: string; const AWindowTitle: string; const DisplayFirstTopic: boolean): boolean; procedure CloseFile(const ADestroying: boolean = False); procedure OnHelpFileLoadProgress(n, outof: integer; AMessage: string); - procedure LoadNotes(AHelpFile: THelpFile); procedure LoadContents(AFiles: TList; var FirstNode: TfpgTreeNode); procedure LoadIndex; // Used in loading contents procedure AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; ALevel: longint; var ATopicIndex: longint ); - procedure ClearNotes; procedure ClearIndexComponents; - procedure SaveNotes(AHelpFile: THelpFile); + + // Note manipulations -------------------------------- + // make sure that note insert positions are not in + // the middle of tags due to help file or newview updates. + procedure CorrectNotesPositions(Topic: TTopic; AText: pchar); + procedure InsertNotesIntoTopicText(ATopic: TTopic; var AText: TfpgString); + function FindOriginalNoteCharIndex(NoteCharIndex: longword; Topic: TTopic): longword; + function FindActualNoteCharIndex(NoteCharIndex: longword; MaxNoteIndex: longword; Topic: TTopic): longword; + procedure RefreshNoteInsertInfo( NoteIndex: longword ); + procedure ClearNotes; + procedure SaveNotesForFile(AHelpFile: THelpFile); + procedure LoadNotesForFile(AHelpFile: THelpFile); + procedure AddNote; + procedure EditNote(ANoteIndex: longint); + procedure DeleteNote(ANoteIndex: longint); + procedure SaveNotes; + procedure GotoCurrentNote; + procedure UpdateNotesDisplay; + procedure EnableNotesControls; + procedure DisplayTopic(ATopic: TTopic = nil); procedure ResetProgress; procedure SetStatus(const AText: TfpgString); @@ -166,6 +206,10 @@ type function FindTopicForLink( Link: THelpLink ): TTopic; function FindTopicByResourceID( ID: word ): TTopic; function FindTopicByName(const AName: string): TTopic; + function DisplayTopicByResourceID( ID: word ): boolean; + function DisplayTopicByName(const TopicName: string): boolean; + function DisplayTopicByGlobalName(const TopicName: string): boolean; + procedure ViewSourceMIOnClick(Sender: TObject); procedure AddCurrentToMRUFiles; procedure CreateMRUMenuItems; public @@ -195,6 +239,12 @@ uses ,SettingsUnit ,dvHelpers ,frm_configuration + ,frm_text + ,frm_note + ,NewViewConstantsUnit + ,CanvasFontManager + ,HelpNote + ,RichTextDocumentUnit ; const @@ -204,6 +254,7 @@ const {$I arrows.inc} {$I missing.inc} +{$I images.inc} {@VFD_NEWFORM_IMPL} @@ -222,6 +273,74 @@ begin end end; +procedure TMainForm.btnTBNoteAddClick(Sender: TObject); +begin + AddNote; +end; + +procedure TMainForm.RichViewOverLink(Sender: TRichTextView; Link: string); +begin + if StrLeft(Link, 4 ) = PARAM_LINK_NOTE then + SetStatus('Click to edit note'); +end; + +procedure TMainForm.RichViewNotOverLink(Sender: TRichTextView; Link: string); +begin + UpdateLocationPanel; +end; + +procedure TMainForm.NotesListBoxChange(Sender: TObject); +begin + EnableNotesControls; +end; + +procedure TMainForm.NotesListBoxKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + GotoCurrentNote; + end + else if (KeyCode = keyDelete) then + begin + Consumed := True; + DeleteNote(NotesListBox.FocusItem); + end; +end; + +procedure TMainForm.NotesListBoxDoubleClick(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + GotoCurrentNote; +end; + +procedure TMainForm.btnNotesAddClick(Sender: TObject); +begin + AddNote; +end; + +procedure TMainForm.btnNotesDelClick(Sender: TObject); +begin + if NotesListBox.FocusItem = -1 then + exit; + DeleteNote(NotesListBox.FocusItem); +end; + +procedure TMainForm.btnNotesEditClick(Sender: TObject); +begin + if NotesListBox.FocusItem = -1 then + exit; + EditNote(NotesListBox.FocusItem); +end; + +procedure TMainForm.UpdateRichViewFromSettings; +begin + RichView.RichTextSettings.NormalFont := fpgGetFont(Settings.NormalFontDesc); + RichView.RichTextSettings.FixedFont := fpgGetFont(Settings.FixedFontDesc); + RichView.ScrollDistance := Settings.ScrollDistance; +end; + procedure TMainForm.btnBackHistClick(Sender: TObject); begin if CurrentHistoryIndex > 0 then @@ -271,17 +390,26 @@ var lTopic: TTopic; lFound: Boolean; lURL: TfpgString; + lNoteIndex: integer; begin - // TODO: process other types of links (external, application etc...) too! - if pos('external', Link) > 0 then + if pos(PARAM_LINK_NOTE, Link) > 0 then + begin + lNoteIndex := StrToInt(StrRightFrom(Link, 5)); + NotesListBox.FocusItem := lNoteIndex; + EditNote(lNoteIndex); + end + else if pos(PARAM_LINK_PROGRAM, Link) > 0 then + begin + TfpgMessageDialog.Warning('', 'Program links are not supported in DocView yet. Please try again with a later build.') + end + else if pos(PARAM_LINK_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 + else if pos(PARAM_LINK_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); @@ -290,15 +418,19 @@ begin begin // we have a internal INF file link LinkIndex := StrToInt( Link ); - lLink := THelpLink(CurrentTopic.Links[LinkIndex]); - lTopic := FindTopicForLink(lLink); + lLink := THelpLink(CurrentTopic.Links[LinkIndex]); + lTopic := FindTopicForLink(lLink); + if lTopic <> nil then DisplayTopic(lTopic); - exit; + { TODO: we need to implement the remained of link support } + //----------------------- + exit; //==> lHelp := THelpFile(lLink.HelpFile); lTopic := nil; lFound := False; + for i := 0 to CurrentOpenFiles.Count-1 do begin lHelp := THelpFile(CurrentOpenFiles[i]); @@ -306,17 +438,14 @@ begin if lTopic <> nil then begin lFound := True; -// writeln('Found Topic! ', lTopic.Title); break; end; if lFound then break; end; + if lTopic <> nil then - begin -// writeln('Displaying topic <', lTopic.Title, '>'); DisplayTopic(lTopic); - end; end; end; @@ -334,6 +463,8 @@ begin end; procedure TMainForm.MainFormShow(Sender: TObject); +var + lFilename: TfpgString; begin bvlBody.Realign; @@ -342,16 +473,24 @@ begin PageControl1.Width := gINI.ReadInteger('Options', 'SplitterLeft', 260); UpdateWindowPosition; - Settings.NormalFont := fpgStyle.DefaultFont; - Settings.FixedFont := fpgStyle.FixedFont; - Settings.SearchDirectories := TStringList.Create; - - LogEvent(LogSettings, 'Loading settings'); - LoadSettings; CreateMRUMenuItems; ProcessCommandLineParams; RichView.Images := FImages; + UpdateRichViewFromSettings; + + if ParamCount = 0 then + begin + // user hasn't requested any particular file + // at startup, so if the option is still set, + // load the DocView help file + if Settings.StartupHelp then + begin + lFilename := GetOwnHelpFileName; + if FileExists(lFilename) then + OpenFile(lFilename, '', true); + end; + end; end; procedure TMainForm.MainFormDestroy(Sender: TObject); @@ -374,14 +513,23 @@ end; procedure TMainForm.miFileOpenClicked(Sender: TObject); begin + OpenAdditionalFile := False; FileOpen; end; +procedure TMainForm.miFileOpenAdditionalFileClicked(Sender: TObject); +begin + OpenAdditionalFile := True; + FileOpen; + OpenAdditionalFile := False; +end; + procedure TMainForm.miFileOpenSpecialClicked(Sender: TObject); var s: TfpgString; begin - if fpgInputQuery('Open Special...', 'Enter environment variable to open', s) then + OpenAdditionalFile := False; + if fpgInputQuery('Open Special...', 'Enter Environment Variable or Directory Path to open', s) then begin if s <> '' then OpenFile(s, '', True); @@ -396,6 +544,17 @@ end; procedure TMainForm.miConfigureClicked(Sender: TObject); begin ShowConfigForm; + UpdateRichViewFromSettings; +end; + +procedure TMainForm.miViewExpandAllClicked(Sender: TObject); +begin + tvContents.FullExpand; +end; + +procedure TMainForm.miViewCollapseAllClicked(Sender: TObject); +begin + tvContents.FullCollapse; end; procedure TMainForm.miHelpProdInfoClicked(Sender: TObject); @@ -420,6 +579,12 @@ begin ShowCmdLineParamHelp; end; +procedure TMainForm.miHelpUsingDocView(Sender: TObject); +begin + CloseFile(False); + OpenFile(OWN_HELP_MARKER, '', True); +end; + procedure TMainForm.miDebugHeader(Sender: TObject); var f: THelpFile; @@ -435,9 +600,10 @@ begin sl.Clear; with sl do begin - Add('<b><u>Filename:</u></b> <red>' + f.Filename + '<black>'); - Add(''); + Add('<b><u>Filename:</u></b> <blue>' + f.Filename + '<black>'); Add('<b>Title:</b> ' + f.Title); + Add('<b>File size:</b> ' + IntToStr(fpgFileSize(f.Filename)) + ' bytes'); + Add('<b>INF/HLP file version</b> ' + f.FormatVersion); Add('<b>Dictionary count:</b> ' + IntToStr(f.DictionaryCount)); Add('<b>Topic count:</b> ' + IntToStr(f.TopicCount)); Add('<b>Index count:</b> ' + IntToStr(f.Index.Count)); @@ -460,6 +626,82 @@ begin DisplayTopic(nil); end; +procedure TMainForm.miToolsFindByResourceID(Sender: TObject); +var + ResourceIDString: string; + ResourceID: word; +begin + if not fpgInputQuery('Find Resource ID', 'Enter the resource ID to find', ResourceIDString) then + exit; + try + ResourceID := StrToInt(ResourceIDString); + except + TfpgMessageDialog.Critical('Find Resource ID', 'Invalid resource ID entered'); + exit; + end; + + if not DisplayTopicByResourceID( ResourceID ) then + TfpgMessageDialog.Critical('Find Resource ID', 'Resource ID not found'); +end; + +procedure TMainForm.miToolsFindTopifByName(Sender: TObject); +var + TopicNameString: string; +Begin + if not fpgInputQuery( 'Find Topic By Name', + 'Enter the topic name to search for', + TopicNameString ) then + exit; + + if not DisplayTopicByName( TopicNameString ) then + if not DisplayTopicByGlobalName( TopicNameString ) then + TfpgMessageDialog.Critical( 'Find Topic By Name', 'Topic name not found' ); +end; + +procedure TMainForm.miTopicPropertiesClicked(Sender: TObject); +const + TopicInfoTitle = 'Topic Information'; + TopicInfoTopicTitle = 'Title: '; + TopicInfoIndex = 'Index: '; + TopicInfoFile = 'File: '; + TopicInfoResourceIDs = 'Resource IDs:'; + TopicInfoNoResourceIDs = ' (None)'; +var + Topic: TTopic; + HelpFile: THelpFile; + ResourceIDs: TList; + i: longint; + sl: TStringList; +begin + if CurrentTopic = nil then + Exit; + Topic := CurrentTopic; + HelpFile := Topic.HelpFile as THelpFile; + + ResourceIDs := TList.Create; + HelpFile.FindResourceIDsForTopic(Topic, ResourceIDs); + sl := TStringList.Create; + try + with sl do + begin + Clear; + Add( TopicInfoTitle ); + Add( TopicInfoTopicTitle + Topic.Title ); + Add( TopicInfoIndex + IntToStr( Topic.Index ) ); + Add( TopicInfoFile + HelpFile.Filename ); + Add( TopicInfoResourceIDs ); + for i := 0 to ResourceIDs.Count - 1 do + Add( ' ' + IntToStr( longint( ResourceIDs[ i ] ) ) ); + if ResourceIDs.Count = 0 then + Add( TopicInfoNoResourceIDs ); + end; + ResourceIDs.Destroy; + ShowText(TopicInfoTitle, sl.Text); + finally + sl.Free; + end; +End; + procedure TMainForm.miFileSaveTopicAsIPF(Sender: TObject); var F: TextFile; @@ -752,6 +994,11 @@ begin DoSearch; end; +procedure TMainForm.btnNotesGotoClicked(Sender: TObject); +begin + GotoCurrentNote; +end; + procedure TMainForm.IndexSearchEditOnChange(Sender: TObject); var tmpMatchIndex: longint; @@ -795,7 +1042,8 @@ begin // the "no results" place holder exit; Topic := lbSearchResults.Items.Objects[lbSearchResults.FocusItem] as TTopic; - DisplayTopic( Topic ); + if Topic <> nil then + DisplayTopic(Topic); end; procedure TMainForm.NavigateToHistoryIndex(AIndex: integer); @@ -820,6 +1068,8 @@ begin s := ''; sep := ''; n := tvContents.Selection; + if n = nil then + Exit; while n.Parent <> nil do begin s := n.Parent.Text + sep + s; @@ -831,7 +1081,8 @@ end; procedure TMainForm.EnableControls; begin - // + { TODO: lots more need to be added here } + EnableNotesControls; end; procedure TMainForm.ClearAllWordSequences; @@ -871,7 +1122,10 @@ begin lbSearchResults.Items.Clear; if SearchText = '' then + begin + ClearAllWordSequences; exit; + end; lbSearchResults.Items.Add(rsDVSearchingMsg); SetStatus(rsDVSearchingMsg); @@ -996,8 +1250,7 @@ begin // LoadBookmarks( HelpFile ); //end; - { TODO -ograeme : update notes display } - //UpdateNotesDisplay; + UpdateNotesDisplay; { TODO -ograeme : bookmarks } //BuildBookmarksMenu; @@ -1034,7 +1287,7 @@ begin if dlg.RunOpenFile then begin - Settings.LastOpenDirectory := ExtractFilePath(dlg.Filename); + Settings.LastOpenDirectory := fpgExtractFilePath(dlg.Filename); OpenFile(dlg.Filename, '', true); end; { TODO -oGraeme : Add support for multiple files. } @@ -1084,7 +1337,8 @@ begin else begin LogEvent(LogStartup, ' File not found' ); - FullFilePath := FileName; // we'll complain later. + TfpgMessageDialog.Critical('Error', 'Failed to find the help file: ' + Filename); + Abort; end; LoadingFilenameList[ FileIndex ] := FullFilePath; end; @@ -1168,10 +1422,14 @@ begin // Now that we have successfully loaded the new help file(s) // close the existing one. - CloseFile; + if not OpenAdditionalFile then + CloseFile; AssignList(tmpHelpFiles, CurrentOpenFiles ); + if CurrentOpenFiles.Count = 0 then + exit; // no help files found - nothing further to do + ProgressBar.Position := 50; SetStatus( rsDVDisplaying ); @@ -1255,7 +1513,7 @@ begin for FileIndex := 0 to CurrentOpenFiles.Count - 1 do begin lHelpFile := THelpFile(CurrentOpenFiles[FileIndex]); - SaveNotes( lHelpFile ); + SaveNotesForFile( lHelpFile ); end; ClearIndexComponents; @@ -1277,10 +1535,99 @@ begin // end; -procedure TMainForm.LoadNotes(AHelpFile: THelpFile); +procedure TMainForm.LoadNotesForFile(AHelpFile: THelpFile); +var + NotesFileName: TfpgString; + TopicIndex: longint; + InsertPoint: longint; + Note: THelpNote; + + NotesFile: TStringList; + + Paragraph: TfpgString; + NotEOF: boolean; + NoteText: TfpgString; + i: integer; + s: TfpgString; + lReadTopicIndex: boolean; + lReadInsertPoint: boolean; begin -// NotesFileName:= ChangeFileExt( HelpFile.FileName, '.nte' ); + ProfileEvent( 'Load notes for ' + AHelpFile.Filename ); + + if AHelpFile.NotesLoaded then + exit; + + AHelpFile.NotesLoaded := true; + NotesFileName := fpgChangeFileExt(AHelpFile.FileName, NOTES_FILE_EXTENSION); + + if not fpgFileExists(NotesFileName) then + exit; // no notes + + NotesFile := TStringList.Create; + if NotesFile = nil then + begin + TfpgMessageDialog.Critical('Error', 'Error opening file: ' + NotesFileName); + exit; + end; + NotesFile.LoadFromFile(NotesFileName); + + NoteText := ''; + NotEOF := true; + i := 0; + repeat + { reset variables } + TopicIndex := -1; + InsertPoint := -1; + NoteText := ''; + + { Read the topic index } + s := NotesFile[i]; + try + TopicIndex := StrToInt(s); + except + TopicIndex := -1; + end; + inc(i); + + { Read the insert point } + s := NotesFile[i]; + try + InsertPoint := StrToInt(s); + except + InsertPoint := -1; + end; + inc(i); + + { Read note text until end marker is found } + repeat + s := NotesFile[i]; + inc(i); + if s = '#ENDNOTE#' then + begin + // found end of note + if (TopicIndex >= 0) and (InsertPoint >= 0) then + begin + Note := THelpNote.Create; + Note.Topic := AHelpFile.Topics[TopicIndex]; + Note.InsertPoint := InsertPoint; + Note.Text := NoteText; + Notes.Add(Note); + end; + break; + end + else + begin + if NoteText <> '' then + NoteText := NoteText + LineEnding + s + else + NoteText := s; + end; + until s = '#ENDNOTE#'; + + until i >= NotesFile.Count; + NotesFile.Free; + UpdateNotesDisplay; end; procedure TMainForm.LoadContents(AFiles: TList; var FirstNode: TfpgTreeNode); @@ -1338,13 +1685,7 @@ begin if Settings.OpenWithExpandedContents then begin LogEvent(LogStartup, ' Expand all contents' ); - tvContents.RootNode.Expand; - node := tvContents.RootNode.Next; - while node <> nil do - begin - node.Expand; - node := tvContents.RootNode.Next; - end; + tvContents.FullExpand; end else begin @@ -1600,9 +1941,323 @@ begin IndexLoaded := False; end; -procedure TMainForm.SaveNotes(AHelpFile: THelpFile); +procedure TMainForm.CorrectNotesPositions(Topic: TTopic; AText: pchar); +var + NoteIndex: longint; + Note: THelpNote; + p: pchar; + NextP: pchar; + Element: TTextElement; + TextIndex: longint; +begin + NoteIndex := 0; + for NoteIndex := 0 to Notes.Count-1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic = Topic then + begin + // this note belongs to the specified topic. + p := AText; + + while true do + begin + Element := ExtractNextTextElement( p, NextP ); + if Element.ElementType = teTextEnd then + break; + TextIndex := PCharDiff( p, AText ); + if TextIndex >= Note.InsertPoint then + begin + // found a safe point to insert + if TextIndex <> Note.InsertPoint then + begin + // correct it. + Note.InsertPoint := TextIndex; + end; + break; + end; + + p := NextP; + end; + end; + end; +end; + +procedure TMainForm.InsertNotesIntoTopicText(ATopic: TTopic; var AText: TfpgString); +var + NoteIndex: longint; + Note: THelpNote; + ActualInsertPoint: longword; begin - { TODO -oGraeme : Implement me } + CorrectNotesPositions( ATopic, PChar(AText) ); + + for NoteIndex := 0 to Notes.Count - 1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic = ATopic then + begin + // Adjust insert point for any notes we have already inserted. + ActualInsertPoint := FindActualNoteCharIndex( Note.InsertPoint, + NoteIndex, + ATopic ); + RefreshNoteInsertInfo( NoteIndex ); + // DON'T USE UTF8Insert() HERE - THE OFFSET IS IN BYTES, NOT CHARACTERS! + Insert(Note.InsertText, AText, ActualInsertPoint); + end; + end; +end; + +function TMainForm.FindOriginalNoteCharIndex(NoteCharIndex: longword; Topic: TTopic): longword; +var + NoteIndex: longint; + Note: THelpNote; +begin + Result := NoteCharIndex; + for NoteIndex := 0 to Notes.Count-1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic = Topic then + if Note.InsertPoint < NoteCharIndex then + dec(Result, UTF8Length(Note.InsertText)); + end; +end; + +function TMainForm.FindActualNoteCharIndex(NoteCharIndex: longword; + MaxNoteIndex: longword; Topic: TTopic): longword; +var + NoteIndex: longint; + Note: THelpNote; +begin + NoteIndex := 0; + Result := NoteCharIndex; + for NoteIndex := 0 to MaxNoteIndex-1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic = Topic then + if Note.InsertPoint < NoteCharIndex then + inc(Result, UTF8Length(Note.InsertText)); + end; +end; + +procedure TMainForm.RefreshNoteInsertInfo(NoteIndex: longword); +var + Note: THelpNote; +begin + Note := THelpNote(Notes[ NoteIndex ]); + if Note.Topic = nil then + exit; + with Note do + begin + InsertText := '<color #' + + IntToHex( Settings.Colors[ NotesTextColorIndex ], 6 ) + + '><link note' + IntToStr( NoteIndex ) + '>'; + InsertText := InsertText + Text; + InsertText := InsertText + '</color></link>'; + end; +end; + +procedure TMainForm.SaveNotesForFile(AHelpFile: THelpFile); +var + NotesFileName: TfpgString; + FileNoteCount: integer; + NoteIndex: integer; + Note: THelpNote; + NotesFile: TStringList; + TopicIndex: integer; + s: TfpgString; +begin + ProfileEvent('Save notes for ' + AHelpFile.Filename); + if not AHelpFile.NotesLoaded then + // we never loaded the notes/displayed a topic from this file + // so don't do anything. + exit; + + ProfileEvent('Really saving'); + NotesFileName := fpgChangeFileExt(AHelpFile.FileName, NOTES_FILE_EXTENSION); + + FileNoteCount := 0; + for NoteIndex := 0 to Notes.Count-1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic.HelpFile = AHelpFile then + inc(FileNoteCount); + end; + + if FileNoteCount = 0 then + begin + // no notes. delete notes file if it already exists. + if fpgFileExists( NotesFileName ) then + fpgDeleteFile( NotesFileName ); + exit; + end; + + NotesFile := TStringList.Create; + + for NoteIndex := 0 to Notes.Count-1 do + begin + Note := THelpNote(Notes[ NoteIndex ]); + + if Note.Topic.HelpFile <> AHelpFile then + continue; + + TopicIndex := AHelpFile.IndexOfTopic(Note.Topic); + + NotesFile.Add(IntToStr(TopicIndex)); + NotesFile.Add(IntToStr(Note.InsertPoint)); + NotesFile.Add(Note.Text); + NotesFile.Add('#ENDNOTE#'); + end; + + NotesFile.SaveToFile(NotesFileName); + NotesFile.Free; +end; + +procedure TMainForm.AddNote; +var + Note: THelpNote; + NoteForm: TNoteForm; +begin + { check that the note position isn't within a note already } + if RichView.LinkFromIndex(RichView.CursorIndex) <> '' then + begin + TfpgMessageDialog.Critical('Error', 'You can''t add a note within a link or another note' ); + exit; + end; + + NoteForm := TNoteForm.Create(nil); + NoteForm.Text := ''; + NoteForm.CanDelete := False; + if NoteForm.ShowModal <> mrOK then + begin + NoteForm.Free; + exit; + end; + + // store note data + Note := THelpNote.Create; + Note.Text := NoteForm.Text; + NoteForm.Free; + + // compensate for existing notes + if RichView.CursorIndex <> -1 then + Note.InsertPoint := FindOriginalNoteCharIndex(RichView.CursorIndex, CurrentTopic) + else + Note.InsertPoint := 0; + Note.Topic := CurrentTopic; + Notes.Add(Note); + + // redisplay topic + DisplayTopic(CurrentTopic); + //DisplayTopicInWindow( Window, + // false, // don't follow links! + // true ); // keep position + + //RichView.SelectionStart := FindActualNoteCharIndex(Note.InsertPoint, + // Notes.Count - 1, + // CurrentTopic); + UpdateNotesDisplay; + + SaveNotes; +end; + +procedure TMainForm.EditNote(ANoteIndex: longint); +var + Note: THelpNote; + NoteForm: TNoteForm; +begin + Note := THelpNote(Notes[ANoteIndex]); + if Note = nil then + exit; + NoteForm := TNoteForm.Create(nil); + try + NoteForm.Text := Note.Text; + NoteForm.CanDelete := True; + + if NoteForm.ShowModal = mrCancel then + exit; + + if NoteForm.ModalResult = mrAbort then + begin + DeleteNote(ANoteIndex); + exit; + end; + + Note.Text := NoteForm.Text; + SaveNotes; + DisplayTopic(CurrentTopic); + UpdateNotesDisplay; + finally + NoteForm.Free; + end; +end; + +procedure TMainForm.DeleteNote(ANoteIndex: longint); +var + Note: THelpNote; +begin + if TfpgMessageDialog.Question(rsconfirmation, 'Are you sure you want to delete the seleted Note?') <> mbYes then + Exit; + { if we got here, we must delete the note } + Note := THelpNote(Notes[ANoteIndex]); + Notes.Delete(ANoteIndex); + Note.Free; + + DisplayTopic(CurrentTopic); + UpdateNotesDisplay; + + SaveNotes; +end; + +procedure TMainForm.SaveNotes; +var + FileIndex: integer; + HelpFile: THelpFile; +begin + ProfileEvent( 'Save notes' ); + for FileIndex := 0 to CurrentOpenFiles.Count-1 do + begin + HelpFile := THelpFile(CurrentOpenFiles[FileIndex]); + SaveNotesForFile(HelpFile); + end; +end; + +procedure TMainForm.GotoCurrentNote; +var + Note: THelpNote; +begin + if NotesListBox.FocusItem = -1 then + exit; + Note := NotesListBox.Items.Objects[NotesListBox.FocusItem] as THelpNote; + DisplayTopic(Note.Topic); +end; + +procedure TMainForm.UpdateNotesDisplay; +var + NoteIndex: longint; + Note: THelpNote; + NoteTitle: string; +begin + NotesListBox.Items.Clear; + for NoteIndex := 0 to Notes.Count-1 do + begin + Note := THelpNote(Notes[NoteIndex]); + if Note.Topic <> nil then + NoteTitle := Note.Topic.Title + else + NoteTitle := StrLeft(Note.Text, 100); + NotesListBox.Items.AddObject(NoteTitle, Note); + end; + EnableNotesControls; +end; + +procedure TMainForm.EnableNotesControls; +var + NoteSelected: boolean; +begin + NoteSelected := NotesListBox.FocusItem <> -1; + btnNotesEdit.Enabled := NoteSelected; + btnNotesGoto.Enabled := NoteSelected; + btnNotesDel.Enabled := NoteSelected; + btnNotesAdd.Enabled := CurrentOpenFiles.Count > 0; end; procedure TMainForm.DisplayTopic(ATopic: TTopic); @@ -1715,10 +2370,23 @@ begin //writeln(lText); //writeln('-----------------------------'); + { Load and insert annotations / notes } + if not HelpFile.NotesLoaded then + LoadNotesForFile(HelpFile); + InsertNotesIntoTopicText(Topic, lText); + RichView.AddText(PChar(lText)); + if CurrentTopic.ShowInContents then + begin tvContents.Selection := tvContents.RootNode.FindSubNode(CurrentTopic, True); tvContents.Invalidate; + end + else + begin + tvContents.Selection := nil; + tvContents.Invalidate; + end; SaveNavigatePoint; UpdateLocationPanel; end; @@ -1753,13 +2421,15 @@ begin inherited Create(AOwner); fpgApplication.OnException := @MainFormException; OnShow := @MainFormShow; - OnDestroy :=@MainFormDestroy; + OnDestroy := @MainFormDestroy; // Files := TList.Create; AllFilesWordSequences := TList.Create; CurrentOpenFiles := TList.Create; DisplayedIndex := TStringList.Create; + Notes := TList.Create; CurrentHistoryIndex := -1; FHistorySelection := False; + OpenAdditionalFile := False; { TODO -oGraeme : Make Debug a menu option } Debug := False; @@ -1790,6 +2460,13 @@ begin 'dv.arrowdown', @usr_arrow_down, sizeof(usr_arrow_down), 0, 0); + fpgImages.AddMaskedBMP( + 'dv.notegreen', @usr_notegreen, + sizeof(usr_notegreen), 0, 0); + + + // load custom user settings like Fonts, Search Highlight Color etc. + LoadSettings; end; destructor TMainForm.Destroy; @@ -1800,6 +2477,7 @@ begin FFileOpenRecent := nil; // it was a reference only miOpenRecentMenu.Free; // DestroyListAndObjects(Files); + DestroyListAndObjects(Notes); DestroyListAndObjects(AllFilesWordSequences); DestroyListAndObjects(CurrentOpenFiles); inherited Destroy; @@ -1899,6 +2577,7 @@ begin SetPosition(166, 4, 80, 24); Anchors := [anRight,anTop]; Text := 'Go to'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; @@ -1921,6 +2600,7 @@ begin SetPosition(166, 4, 80, 24); Anchors := [anRight,anTop]; Text := 'Go to'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; @@ -1936,11 +2616,9 @@ begin Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; Hint := ''; - HotTrack := False; - PopupFrame := False; TabOrder := 1; OnDoubleClick := @lbIndexDoubleClick; - OnKeyPress:=@lbIndexKeyPress; + OnKeyPress := @lbIndexKeyPress; end; IndexSearchEdit := TfpgEdit.Create(tsIndex); @@ -2087,8 +2765,6 @@ begin Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; Hint := ''; - HotTrack := False; - PopupFrame := False; TabOrder := 9; OnDoubleClick := @lbSearchResultsDoubleClick; OnKeyPress := @lbSearchResultsKeyPress; @@ -2111,6 +2787,7 @@ begin SetPosition(220, 20, 28, 26); Anchors := [anRight,anTop]; Text := 'Go'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; @@ -2122,21 +2799,22 @@ begin with tsNotes do begin Name := 'tsNotes'; - SetPosition(3, 24, 254, 289); + SetPosition(3, 24, 254, 249); Text := 'Notes'; end; - ListBox1 := TfpgListBox.Create(tsNotes); - with ListBox1 do + NotesListBox := TfpgListBox.Create(tsNotes); + with NotesListBox do begin - Name := 'ListBox1'; - SetPosition(4, 32, 242, 252); + Name := 'NotesListBox'; + SetPosition(4, 32, 242, 212); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; Hint := ''; - HotTrack := False; - PopupFrame := False; TabOrder := 0; + OnDoubleClick := @NotesListBoxDoubleClick; + OnKeyPress := @NotesListBoxKeyPress; + OnChange := @NotesListBoxChange; end; btnNotesAdd := TfpgButton.Create(tsNotes); @@ -2145,11 +2823,14 @@ begin Name := 'btnNotesAdd'; SetPosition(4, 4, 24, 24); Text := ''; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageMargin := 0; ImageName := 'stdimg.add'; TabOrder := 1; + Enabled := false; + OnClick := @btnNotesAddClick; end; btnNotesEdit := TfpgButton.Create(tsNotes); @@ -2158,11 +2839,14 @@ begin Name := 'btnNotesEdit'; SetPosition(32, 4, 24, 24); Text := ''; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageMargin := 0; ImageName := 'stdimg.edit'; TabOrder := 2; + Enabled := False; + OnClick := @btnNotesEditClick; end; btnNotesDel := TfpgButton.Create(tsNotes); @@ -2171,11 +2855,14 @@ begin Name := 'btnNotesDel'; SetPosition(60, 4, 24, 24); Text := ''; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageMargin := 0; ImageName := 'stdimg.remove'; TabOrder := 3; + Enabled := False; + OnClick := @btnNotesDelClick; end; btnNotesGoto := TfpgButton.Create(tsNotes); @@ -2185,10 +2872,12 @@ begin SetPosition(166, 4, 80, 24); Anchors := [anRight,anTop]; Text := 'Go to'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := ''; TabOrder := 4; + OnClick := @btnNotesGotoClicked; end; tsHistory := TfpgTabSheet.Create(PageControl1); @@ -2207,8 +2896,6 @@ begin Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; Hint := ''; - HotTrack := False; - PopupFrame := False; TabOrder := 0; OnDoubleClick := @lbHistoryDoubleClick; OnKeyPress := @lbHistoryKeyPress; @@ -2229,7 +2916,9 @@ begin SetPosition(368, 192, 244, 92); TabOrder := 2; Align := alClient; - OnClickLink:=@RichViewClickLink; + OnOverLink := @RichViewOverLink; + OnNotOverLink := @RichViewNotOverLink; + OnClickLink := @RichViewClickLink; end; MainMenu := TfpgMenuBar.Create(self); @@ -2246,6 +2935,7 @@ begin Name := 'miFile'; SetPosition(292, 96, 132, 20); AddMenuItem('Open...', '', @miFileOpenClicked); + AddMenuItem('Open additional file...', '', @miFileOpenAdditionalFileClicked); AddMenuItem('Open Special...', '', @miFileOpenSpecialClicked); AddMenuItem('Save current Topic to IPF...', '', @miFileSaveTopicAsIPF); AddMenuItem('Close', '', @miFileCloseClicked); @@ -2268,8 +2958,32 @@ begin begin Name := 'miBookmarks'; SetPosition(292, 144, 132, 20); - AddMenuItem('Add..', '', nil); - AddMenuItem('Show', '', nil); + AddMenuItem('Add..', '', nil).Enabled := False; + AddMenuItem('Show', '', nil).Enabled := False; + end; + + miView := TfpgPopupMenu.Create(self); + with miView do + begin + Name := 'miView'; + SetPosition(292, 216, 132, 20); + AddMenuItem('Expand All', '', @miViewExpandAllClicked); + AddMenuItem('Collapse All', '', @miViewCollapseAllClicked); + AddMenuItem('-', '', nil); + AddMenuItem('Topic Properties', '', @miTopicPropertiesClicked); + end; + + miTools := TfpgPopupMenu.Create(self); + with miTools do + begin + Name := 'miTools'; + SetPosition(428, 96, 120, 20); + AddMenuItem('Show file info', '', @miDebugHeader); + AddMenuItem('Find topic by resource ID', '', @miToolsFindByResourceID); + AddMenuItem('Find topic by resource name', '', @miToolsFindTopifByName); + miDebugHexInfo := AddMenuItem('Toggle hex INF values in contents', '', @miDebugHex); + AddMenuItem('View source of RichView component', '', @ViewSourceMIOnClick); + AddMenuItem('Current topic properties', '', @miTopicPropertiesClicked); end; miHelp := TfpgPopupMenu.Create(self); @@ -2277,24 +2991,13 @@ begin begin Name := 'miHelp'; SetPosition(292, 168, 132, 20); - AddMenuItem('Contents...', '', nil); - AddMenuItem('Help using help', '', nil); + AddMenuItem('Help using DocView', '', @miHelpUsingDocView); 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; - miDebug := TfpgPopupMenu.Create(self); - with miDebug do - begin - Name := 'miDebug'; - SetPosition(292, 192, 132, 20); - miDebugHexInfo := AddMenuItem('Toggle Hex INF Values in Contents', '', @miDebugHex); - end; - ToolBar := TfpgBevel.Create(self); with ToolBar do begin @@ -2312,9 +3015,10 @@ begin Name := 'btnOpen'; SetPosition(30, 1, 24, 24); Text := ''; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Open a new help file.'; + Hint := 'Open a new help file'; ImageMargin := -1; ImageName := 'stdimg.open'; ImageSpacing := 0; @@ -2329,9 +3033,10 @@ begin Name := 'btnBack'; SetPosition(70, 1, 32, 24); Text := '<'; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Previous history item.'; + Hint := 'Previous history item'; ImageMargin := -1; ImageName := 'dv.arrowleft'; ImageSpacing := 0; @@ -2346,9 +3051,10 @@ begin Name := 'btnFwd'; SetPosition(104, 1, 32, 24); Text := '>'; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Next history item.'; + Hint := 'Next history item'; ImageMargin := -1; ImageName := 'dv.arrowright'; ImageSpacing := 0; @@ -2363,9 +3069,10 @@ begin Name := 'btnPrev'; SetPosition(138, 1, 32, 24); Text := 'prev'; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Previous Topic.'; + Hint := 'Previous Topic'; ImageMargin := -1; ImageName := 'dv.arrowup'; ImageSpacing := 0; @@ -2380,28 +3087,30 @@ begin Name := 'btnNext'; SetPosition(172, 1, 32, 24); Text := 'next'; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Next Topic.'; + Hint := 'Next Topic'; ImageMargin := -1; ImageName := 'dv.arrowdown'; ImageSpacing := 0; TabOrder := 5; Focusable := False; - OnClick :=@btnNextClick; + OnClick := @btnNextClick; end; btnHelp := TfpgButton.Create(ToolBar); with btnHelp do begin Name := 'btnHelp'; - SetPosition(218, 1, 24, 24); + SetPosition(256, 1, 24, 24); Text := ''; + Down := False; Flat := True; FontDesc := '#Label1'; - Hint := 'Display Product Information.'; + Hint := 'Display Product Information'; ImageMargin := -1; - ImageName := 'stdimg.help'; + ImageName := 'stdimg.about'; ImageSpacing := 0; TabOrder := 6; Focusable := False; @@ -2414,6 +3123,7 @@ begin Name := 'btnQuit'; SetPosition(4, 1, 24, 24); Text := ''; + Down := False; Flat := True; FontDesc := '#Label1'; Hint := ''; @@ -2445,6 +3155,34 @@ begin Shape := bsLeftLine; end; + Bevel3 := TfpgBevel.Create(ToolBar); + with Bevel3 do + begin + Name := 'Bevel3'; + SetPosition(248, 0, 6, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + btnTBNoteAdd := TfpgButton.Create(ToolBar); + with btnTBNoteAdd do + begin + Name := 'btnTBNoteAdd'; + SetPosition(218, 1, 24, 24); + Text := ''; + Down := False; + Flat := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'dv.notegreen'; + ImageSpacing := 0; + TabOrder := 12; + Focusable := False; + OnClick := @btnTBNoteAddClick; + end; + {@VFD_BODY_END: MainForm} {%endregion} @@ -2465,10 +3203,12 @@ begin MainMenu.AddMenuItem('&File', nil).SubMenu := miFile; MainMenu.AddMenuItem('&Settings', nil).SubMenu := miSettings; MainMenu.AddMenuItem('&Bookmarks', nil).SubMenu := miBookmarks; + MainMenu.AddMenuItem('&Tools', nil).SubMenu := miTools; MainMenu.AddMenuItem('&Help', nil).SubMenu := miHelp; - MainMenu.AddMenuItem('&Debug', nil).SubMenu := miDebug; FFileOpenRecent.SubMenu := miOpenRecentMenu; + tvContents.PopupMenu := miView; + // correct default visible tabsheet PageControl1.ActivePageIndex := 0; end; @@ -2582,7 +3322,7 @@ const var s: string; begin - s := '<font "Arial" 12><b>' + cLongName + '</b></font>' + le + s := '<font "' + DefaultTopicFontName + '" 12><b>' + cLongName + '</b></font>' + le + cVersion + le + le + 'Supported command line parameters:' + le + le + '<tt>' @@ -2655,6 +3395,46 @@ begin Result := nil; end; +function TMainForm.DisplayTopicByResourceID(ID: word): boolean; +var + Topic: TTopic; +begin + Topic := FindTopicByResourceID( ID ); + if Topic = nil then + begin + Result := false; + exit; + end; + result := true; + DisplayTopic(Topic); +end; + +function TMainForm.DisplayTopicByName(const TopicName: string): boolean; +var + Topic: TTopic; +begin + Topic := FindTopicByName(TopicName); + if Topic = nil then + begin + Result := false; + exit; + end; + result := true; + DisplayTopic(Topic); +end; + +function TMainForm.DisplayTopicByGlobalName(const TopicName: string): boolean; +begin + Result := False; + // TODO: implement me +end; + +procedure TMainForm.ViewSourceMIOnClick(Sender: TObject); +begin + ShowText('RichView Source Text', RichView.Text); +End; + + // Add the current list of open files as // a Most Recently Used entry procedure TMainForm.AddCurrentToMRUFiles; diff --git a/docview/src/frm_note.pas b/docview/src/frm_note.pas new file mode 100644 index 00000000..02c7dbf7 --- /dev/null +++ b/docview/src/frm_note.pas @@ -0,0 +1,143 @@ +unit frm_note; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_memo, fpg_button; + +type + + TNoteForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: NoteForm} + Memo1: TfpgMemo; + btnOK: TfpgButton; + btnHelp: TfpgButton; + btnCancel: TfpgButton; + btnDelete: TfpgButton; + FCanDelete: boolean; + {@VFD_HEAD_END: NoteForm} + procedure FormShow(Sender: TObject); + function GetText: TfpgString; + procedure SetText(const AValue: TfpgString); + procedure SetCanDelete(const AValue: boolean); + public + procedure AfterCreate; override; + property Text: TfpgString read GetText write SetText; + property CanDelete: boolean read FCanDelete write SetCanDelete; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TNoteForm.FormShow(Sender: TObject); +begin + Memo1.SetFocus; +end; + +function TNoteForm.GetText: TfpgString; +begin + Result := Memo1.Text; +end; + +procedure TNoteForm.SetText(const AValue: TfpgString); +begin + Memo1.Text := AValue; +end; + +procedure TNoteForm.SetCanDelete(const AValue: boolean); +begin + FCanDelete := AValue; + btnDelete.Enabled := FCanDelete; +end; + +procedure TNoteForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: NoteForm} + Name := 'NoteForm'; + SetPosition(349, 186, 420, 191); + WindowTitle := 'Notes'; + Hint := ''; + OnShow := @FormShow; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(4, 4, 412, 149); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + FontDesc := '#Edit1'; + TabOrder := 1; + end; + + btnOK := TfpgButton.Create(self); + with btnOK do + begin + Name := 'btnOK'; + SetPosition(252, 161, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'OK'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 2; + end; + + btnHelp := TfpgButton.Create(self); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(4, 161, 80, 24); + Anchors := [anLeft,anBottom]; + Text := 'Help'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + end; + + btnCancel := TfpgButton.Create(self); + with btnCancel do + begin + Name := 'btnCancel'; + SetPosition(336, 161, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Cancel'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrCancel; + TabOrder := 4; + end; + + btnDelete := TfpgButton.Create(self); + with btnDelete do + begin + Name := 'btnDelete'; + SetPosition(92, 161, 80, 24); + Text := 'Delete'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrAbort; + TabOrder := 5; + end; + + {@VFD_BODY_END: NoteForm} + {%endregion} +end; + + +end. diff --git a/docview/src/frm_text.pas b/docview/src/frm_text.pas new file mode 100644 index 00000000..c005f210 --- /dev/null +++ b/docview/src/frm_text.pas @@ -0,0 +1,113 @@ +{ + A simple form with a memo to display text. Handle for debuging etc. +} +unit frm_text; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_button, fpg_memo; + +type + + TTextForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: TextForm} + btnClose: TfpgButton; + Memo1: TfpgMemo; + btnCopy: TfpgButton; + {@VFD_HEAD_END: TextForm} + procedure btnCopyClicked(Sender: TObject); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +procedure ShowText(const ATitle: TfpgString; const AText: TfpgString); + + +implementation + + +procedure ShowText(const ATitle: TfpgString; const AText: TfpgString); +var + frm: TTextForm; +begin + frm := TTextForm.Create(nil); + try + if ATitle = '' then + frm.WindowTitle := 'Text Form' + else + frm.WindowTitle := ATitle; + frm.Memo1.Lines.Text := AText; + frm.ShowModal; + finally + frm.Free; + end; +end; + +{@VFD_NEWFORM_IMPL} + +procedure TTextForm.btnCopyClicked(Sender: TObject); +begin + fpgClipboard.Text := Memo1.Lines.Text; +end; + +procedure TTextForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: TextForm} + Name := 'TextForm'; + SetPosition(405, 197, 496, 297); + WindowTitle := 'Text Form'; + Hint := ''; + WindowPosition := wpScreenCenter; + + btnClose := TfpgButton.Create(self); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(412, 268, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Close'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 1; + end; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(0, 0, 496, 260); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + FontDesc := '#Edit2'; + TabOrder := 2; + end; + + btnCopy := TfpgButton.Create(self); + with btnCopy do + begin + Name := 'btnCopy'; + SetPosition(4, 268, 128, 24); + Anchors := [anLeft,anBottom]; + Text := 'Copy to Clipboard'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + OnClick := @btnCopyClicked; + end; + + {@VFD_BODY_END: TextForm} + {%endregion} +end; + + +end. diff --git a/docview/src/images.inc b/docview/src/images.inc new file mode 100644 index 00000000..37d89aec --- /dev/null +++ b/docview/src/images.inc @@ -0,0 +1,53 @@ + +Const + usr_notegreen : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,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, 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, + 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255, 11,119, 63, 11,119, + 63, 11,119, 63,255, 0,255,255, 0,255,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, 0, 0, 0, 0, 11,119, 63, 18,197,106,128,128,128, 11,119, + 63, 11,119, 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 11,119, 63, 18,197,106,128,128,128, 11,119, 63,128,128,128, 11,119, + 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 11,119, 63, 18,197,106, + 128,128,128,128,128,128,128,128,128, 11,119, 63, 11,119, 63, 11,119, + 63, 11,119, 63, 11,119, 63,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 11,119, 63, 18,197,106, 18,197,106, + 128,128,128, 11,119, 63, 11,119, 63, 11,119, 63, 18,197,106, 18,197, + 106, 18,197,106, 11,119, 63,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 11,119, 63, 18,197,106,128,128,128, 18,197,106, + 128,128,128, 11,119, 63, 18,197,106, 18,197,106, 18,197,106, 18,197, + 106, 11,119, 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 11,119, 63, 11,119, 63, 11,119, 63, 11,119, 63, + 18,197,106, 18,197,106, 18,197,106, 18,197,106, 18,197,106, 11,119, + 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 11,119, 63, 18,197,106, + 18,197,106, 18,197,106, 18,197,106, 11,119, 63,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 11,119, 63, 18,197,106, 18,197,106, + 18,197,106, 11,119, 63, 11,119, 63,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 11,119, 63, 11,119, 63, 11,119, 63, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + diff --git a/docview/src/nvUtilities.pas b/docview/src/nvUtilities.pas index 568fbc19..9cc19076 100644 --- a/docview/src/nvUtilities.pas +++ b/docview/src/nvUtilities.pas @@ -226,17 +226,8 @@ begin end; function GetFileSize(const AFilename: string): integer; -var - f: File; begin - Result := 0; - {$i-} - FileMode := 0; // read-only - Assign(f, fpgToOSEncoding(AFileName)); - Reset(f); - {$i+} - Result := FileSize(f); - CloseFile(f); + Result := fpgFileSize(AFilename); end; function IsDigit(const AChar: TfpgChar): boolean; @@ -261,7 +252,7 @@ begin if Limit1 < Limit2 then Result:= ( Value >= Limit1 ) and ( Value <= Limit2 ) else - Result:= ( Value >= Limit2 ) and ( Value <= Limit1 ) + Result:= ( Value >= Limit2 ) and ( Value <= Limit1 ); end; operator = (ARect: TRect; BRect: TRect): boolean; diff --git a/examples/apps/debugserver/fpgDebugServer.lpr b/examples/apps/debugserver/fpgDebugServer.lpr index eaf9492b..4f317c12 100644 --- a/examples/apps/debugserver/fpgDebugServer.lpr +++ b/examples/apps/debugserver/fpgDebugServer.lpr @@ -7,7 +7,8 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes - ,fpg_main, frm_main + ,fpg_main + ,frm_main ; procedure MainProc; diff --git a/examples/apps/debugserver/frm_main.pas b/examples/apps/debugserver/frm_main.pas index e0da08a7..005fc8dc 100644 --- a/examples/apps/debugserver/frm_main.pas +++ b/examples/apps/debugserver/frm_main.pas @@ -312,7 +312,7 @@ begin with MainMenu do begin Name := 'MainMenu'; - SetPosition(0, 0, 486, 26); + SetPosition(0, 0, 486, 21); Anchors := [anLeft,anRight,anTop]; end; @@ -320,7 +320,7 @@ begin with Bevel1 do begin Name := 'Bevel1'; - SetPosition(0, 26, 486, 31); + SetPosition(0, 21, 486, 30); Anchors := [anLeft,anRight,anTop]; Hint := ''; Style := bsLowered; @@ -331,7 +331,7 @@ begin with grdMessages do begin Name := 'grdMessages'; - SetPosition(4, 63, 478, 246); + SetPosition(4, 55, 478, 254); Anchors := [anLeft,anRight,anTop,anBottom]; AddColumn('Type', 50, taLeftJustify); AddColumn('Time', 75, taCenter); @@ -380,7 +380,7 @@ begin with btnQuit do begin Name := 'btnQuit'; - SetPosition(4, 2, 25, 25); + SetPosition(4, 2, 24, 24); Text := ''; Flat := True; FontDesc := '#Label1'; @@ -407,7 +407,7 @@ begin with btnPause do begin Name := 'btnPause'; - SetPosition(43, 2, 25, 25); + SetPosition(43, 2, 24, 24); Text := ''; AllowAllUp := True; Flat := True; @@ -416,6 +416,7 @@ begin Hint := 'pause server'; ImageMargin := -1; ImageName := 'dbs.pause'; + ImageSpacing := 0; TabOrder := 2; Focusable := False; OnClick :=@btnPauseClicked; @@ -425,13 +426,14 @@ begin with btnStart do begin Name := 'btnStart'; - SetPosition(70, 2, 25, 25); + SetPosition(67, 2, 24, 24); Text := ''; Flat := True; FontDesc := '#Label1'; Hint := 'start server'; ImageMargin := -1; ImageName := 'dbs.run'; + ImageSpacing := 0; TabOrder := 2; Focusable := False; OnClick := @btnStartClicked; @@ -442,13 +444,14 @@ begin with btnClear do begin Name := 'btnClear'; - SetPosition(97, 2, 25, 25); + SetPosition(91, 2, 24, 24); Text := ''; Flat := True; FontDesc := '#Label1'; Hint := 'clear listview'; ImageMargin := -1; ImageName := 'dbs.clean'; + ImageSpacing := 0; TabOrder := 2; Focusable := False; OnClick :=@btnClearClicked; diff --git a/examples/apps/globe/extrafpc.cfg b/examples/apps/globe/extrafpc.cfg new file mode 100644 index 00000000..bf32f456 --- /dev/null +++ b/examples/apps/globe/extrafpc.cfg @@ -0,0 +1,6 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fi. +-Xs +-XX +-CX diff --git a/examples/apps/globe/frm_main.pas b/examples/apps/globe/frm_main.pas new file mode 100644 index 00000000..dba93762 --- /dev/null +++ b/examples/apps/globe/frm_main.pas @@ -0,0 +1,704 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_widget, fpg_form, fpg_menu, + fpg_panel, fpg_button; + + +{$I globe_data.inc} +{$I images.inc} + +type + TGlobe = class(TfpgWidget) + private + FShowGrid: boolean; + FGridStep: integer; + R, Fi, Th, Wfi, Wth, Y, X, Xold, Yold: integer; + CosFi, SinFi: Double; { Fi is longitude } + CosTh, SinTh: Double; { Th is latitude } + CosWth, SinWth: Double; + procedure DrawSpace; + procedure DrawGlobe; + procedure DrawGrid; + procedure DrawSegment; + procedure Convert; + function GetRadius: integer; + procedure SetRadius(const AValue: integer); + procedure SetShowGrid(const AValue: boolean); + procedure SetGridStep(const AValue: integer); + protected + procedure HandlePaint; override; + public + constructor Create(AOwner: TComponent); override; + procedure SetViewPoint(const ALon, ALat: integer); + property GridStep: integer read FGridStep write SetGridStep default 5; + property ShowGrid: boolean read FShowGrid write SetShowGrid default True; + property Radius: integer read GetRadius write SetRadius default 150; + end; + + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + MainMenu: TfpgMenuBar; + Globe1: TGlobe; + pmFile: TfpgPopupMenu; + pmView: TfpgPopupMenu; + pmHelp: TfpgPopupMenu; + StatusPanel: TfpgPanel; + Bevel1: TfpgBevel; + btnQuit: TfpgButton; + btnGrid: TfpgButton; + btnZoomIn: TfpgButton; + btnZoomOut: TfpgButton; + btnHelp: TfpgButton; + Bevel2: TfpgBevel; + Bevel3: TfpgBevel; + {@VFD_HEAD_END: MainForm} + miShowGrid: TfpgMenuItem; + FShowGrid: boolean; + FWfi: integer; + FWth: integer; + FStep: integer; + procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure miFileQuitClicked(Sender: TObject); + procedure miShowGridClicked(Sender: TObject); + procedure miZoomInClicked(Sender: TObject); + procedure miZoomOutClicked(Sender: TObject); + procedure btnHelpClicked(Sender: TObject); + procedure miHelpAbout(Sender: TObject); + procedure miHelpAboutFPGui(Sender: TObject); + procedure UpdateStatus; + procedure MoveWest; + procedure MoveEast; + procedure MoveNorth; + procedure MoveSouth; + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + fpg_dialogs, math; + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.FormKeyPressed(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + case KeyCode of + 81: // Q key + begin + Consumed := True; +// if ShiftState = [ssCtrl] then + Close; + end; + keyUp: + begin + MoveNorth; + Consumed := True; + end; + keyDown: + begin + MoveSouth; + Consumed := True; + end; + keyLeft: + begin + MoveWest; + Consumed := True; + end; + keyRight: + begin + MoveEast; + Consumed := True; + end; + 71: // g key + begin + Consumed := True; + miShowGridClicked(nil); + end; + 73: // i key + begin + Consumed := True; + miZoomInClicked(nil); + end; + 79: // o key + begin + Consumed := True; + miZoomOutClicked(nil); + end; + keyF1: + begin + Consumed := True; + btnHelpClicked(nil); + end; + keyF11: + begin + Consumed := True; + miHelpAboutFPGui(nil); + end; + keyF12: + begin + Consumed := True; + miHelpAbout(nil); + end; + end; +end; + +procedure TMainForm.miFileQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miShowGridClicked(Sender: TObject); +begin + FShowGrid := not FShowGrid; + miShowGrid.Checked := FShowGrid; + btnGrid.Down := FShowGrid; + Globe1.ShowGrid := FShowGrid; +end; + +procedure TMainForm.miZoomInClicked(Sender: TObject); +var + r: integer; +begin + r := Globe1.Radius; + if r < 1000 then + r := r + 50; + Globe1.Radius := r; +end; + +procedure TMainForm.miZoomOutClicked(Sender: TObject); +var + r: integer; +begin + r := Globe1.Radius; + if r > 50 then + r := r - 50; + Globe1.Radius := r; +end; + +procedure TMainForm.btnHelpClicked(Sender: TObject); +var + frm: TfpgMessageBox; +begin + frm := TfpgMessageBox.Create(nil); + try + frm.WindowTitle := 'Keyboard Help'; + frm.CentreText := False; + frm.FontDesc := '#Edit2'; // mono font + frm.SetMessage( + 'G: Toggles the grid' + LineEnding + + 'I: Zoom in' + LineEnding + + 'O: Zoom out' + LineEnding + + 'Q: Quit the application' + LineEnding + + LineEnding + + 'The arrow keys rotate the globe up,down,left and right' + LineEnding + + LineEnding + + 'F1: Shows this help' + LineEnding + + 'F11: About fpGUI Toolkit' + LineEnding + + 'F12: About this program'); + frm.ShowModal; + finally + frm.Free; + end; +end; + +procedure TMainForm.miHelpAbout(Sender: TObject); +begin + ShowMessage('fpgGUI Globe written by Graeme Geldenhuys - 2010', 'About...', True); +end; + +procedure TMainForm.miHelpAboutFPGui(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui(''); +end; + +procedure TMainForm.UpdateStatus; +var + fi, th: integer; + ew, ns: TfpgString; +begin + if FWth >= 0 then + begin + th := FWth; + ns := 'N'; + end + else + begin + th := - FWth; + ns := 'S'; + end; + fi := FWfi mod 360; + if (fi > 180) then + fi := fi - 360 + else if (fi < -180) then + fi := fi + 360; + if fi >= 0 then + ew := 'E' + else + begin + fi := -fi; + ew := 'W'; + end; + StatusPanel.Text := Format('View Point: %d %s, %d %s', [th, ns, fi, ew]); +end; + +procedure TMainForm.MoveWest; +begin + FWfi := FWfi - FStep; + FWfi := FWfi mod 360; + Globe1.SetViewPoint(FWfi, FWth); + UpdateStatus; +end; + +procedure TMainForm.MoveEast; +begin + FWfi := FWfi + FStep; + FWfi := FWfi mod 360; + Globe1.SetViewPoint(FWfi, FWth); + UpdateStatus; +end; + +procedure TMainForm.MoveNorth; +begin + if FWth <= (90-FStep) then + FWth := FWth + FStep + else + FWth := 90; + Globe1.SetViewPoint(FWfi, FWth); + UpdateStatus; +end; + +procedure TMainForm.MoveSouth; +begin + if FWth >= (FStep-90) then + FWth := FWth - FStep + else + FWth := -90; + Globe1.SetViewPoint(FWfi, FWth); + UpdateStatus; +end; + +constructor TMainForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FStep := 5; + FShowGrid := True; + OnKeyPress := @FormKeyPressed; + fpgImages.AddMaskedBMP( // 16x16 image + 'usr.toggle_grid', + @usr_toggle_grid, + sizeof(usr_toggle_grid), 0, 0); +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(357, 219, 363, 430); + WindowTitle := 'fpGUI Globe'; + Hint := ''; + ShowHint := True; + WindowPosition := wpOneThirdDown; + + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 363, 21); + Anchors := [anLeft,anRight,anTop]; + end; + + Globe1 := TGlobe.Create(self); + with Globe1 do + begin + Name := 'Globe1'; + SetPosition(7, 64, 350, 330); + Anchors := [anLeft,anRight,anTop,anBottom]; + // OnKeyPress := @FormKeyPressed; + end; + + pmFile := TfpgPopupMenu.Create(self); + with pmFile do + begin + Name := 'pmFile'; + SetPosition(248, 36, 120, 20); + AddMenuItem('&Quit', 'Q', @miFileQuitClicked); + end; + + pmView := TfpgPopupMenu.Create(self); + with pmView do + begin + Name := 'pmView'; + SetPosition(248, 56, 120, 20); + miShowGrid := AddMenuItem('Show Grid', '', @miShowGridClicked); + miShowGrid.Checked := True; + AddMenuItem('Zoom In', '', @miZoomInClicked); + AddMenuItem('Zoom Out', '', @miZoomOutClicked); + end; + + pmHelp := TfpgPopupMenu.Create(self); + with pmHelp do + begin + Name := 'pmHelp'; + SetPosition(248, 76, 120, 20); + AddMenuItem('Keyboard Shortcuts...', 'F1', @btnHelpClicked); + AddMenuItem('-', '', nil); + AddMenuItem('About fpGUI Toolkit...', 'F11', @miHelpAboutFPGui); + AddMenuItem('About...', 'F12', @miHelpAbout); + end; + + StatusPanel := TfpgPanel.Create(self); + with StatusPanel do + begin + Name := 'StatusPanel'; + SetPosition(0, 405, 363, 24); + Anchors := [anLeft,anRight,anBottom]; + Alignment := taLeftJustify; + FontDesc := '#Label1'; + Hint := ''; + Style := bsLowered; + Text := 'Ready.'; + end; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(0, 22, 363, 30); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + btnQuit := TfpgButton.Create(Bevel1); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 2, 24, 24); + Text := ''; + Down := False; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Quit the application'; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 1; + Focusable := False; + OnClick := @miFileQuitClicked; + end; + + btnGrid := TfpgButton.Create(Bevel1); + with btnGrid do + begin + Name := 'btnGrid'; + SetPosition(35, 2, 24, 24); + Text := ''; + AllowAllUp := True; + Down := True; + Flat := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := 'Toggle the grid on or off'; + ImageMargin := -1; + ImageName := 'usr.toggle_grid'; + ImageSpacing := 0; + TabOrder := 2; + Focusable := False; + OnClick := @miShowGridClicked; + end; + + btnZoomIn := TfpgButton.Create(Bevel1); + with btnZoomIn do + begin + Name := 'btnZoomIn'; + SetPosition(60, 2, 24, 24); + Text := ''; + Down := False; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Zoom in'; + ImageMargin := -1; + ImageName := 'stdimg.add'; + ImageSpacing := 0; + TabOrder := 3; + Focusable := False; + OnClick := @miZoomInClicked; + end; + + btnZoomOut := TfpgButton.Create(Bevel1); + with btnZoomOut do + begin + Name := 'btnZoomOut'; + SetPosition(84, 2, 24, 24); + Text := ''; + Down := False; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Zoom out'; + ImageMargin := -1; + ImageName := 'stdimg.remove'; + ImageSpacing := 0; + TabOrder := 4; + Focusable := False; + OnClick := @miZoomOutClicked; + end; + + btnHelp := TfpgButton.Create(Bevel1); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(116, 2, 24, 24); + Text := ''; + Down := False; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Keyboard shortcut help'; + ImageMargin := -1; + ImageName := 'stdimg.help'; + ImageSpacing := 0; + TabOrder := 5; + Focusable := False; + OnClick := @btnHelpClicked; + end; + + Bevel2 := TfpgBevel.Create(Bevel1); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(30, 2, 3, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + Bevel3 := TfpgBevel.Create(Bevel1); + with Bevel3 do + begin + Name := 'Bevel3'; + SetPosition(112, 2, 3, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + { hook up the menus to menu bar } + MainMenu.AddMenuItem('&File', nil).SubMenu := pmFile; + MainMenu.AddMenuItem('&View', nil).SubMenu := pmView; + MainMenu.AddMenuItem('&Help', nil).SubMenu := pmHelp; +end; + + +{ TGlobe } + +procedure TGlobe.DrawSpace; +var + i: integer; +begin + Canvas.Color := clGray; //clNavy; + i := 0; + while i < R do + begin + X := Trunc(R - (sqrt(R*R - (R-i)*(R-i) )) - 0.5); + Canvas.DrawLine(0, i, X, i); + Canvas.DrawLine(2*R-X, i, 2*R, i); + Canvas.DrawLine(0, 2*R-i, X, 2*R-i); + Canvas.DrawLine(2*R-X, 2*R-i, 2*R, 2*R-i); + inc(i, 2); + end; +end; + +procedure TGlobe.DrawGlobe; +var + i: integer; +begin + DrawSpace; + Canvas.Color := clGreen; + + CosWth := cos(degtorad(Wth)); + SinWth := sin(degtorad(Wth)); + i := 0; + + Fi := globe_data[i]; + inc(i); + Th := globe_data[i]; + inc(i); + Convert; + Xold := X; + Yold := Y; + + { plot } + while i < Length(globe_data) do + begin + Fi := globe_data[i]; + inc(i); + Th := globe_data[i]; + inc(i); + if (Fi <> 0) or (Th <> 0) then + begin + Convert; + DrawSegment; + Xold := X; + Yold := Y; + continue; + end; + + if i = Length(globe_data) then + break; + + Fi := globe_data[i]; + inc(i); + Th := globe_data[i]; + inc(i); + Convert; + Xold := X; + Yold := Y; + end; + + if FShowGrid then + DrawGrid; +end; + +procedure TGlobe.DrawGrid; +var + temp: integer; +begin + Canvas.Color := TfpgColor($8080FF); // clGray; + Canvas.SetLineStyle(0, lsDash); + { Parallels } + temp := Wfi; + Wfi := 0; + Th := -90+GridStep; + while Th < 90 do + begin + Fi := -180; + Convert; + Xold := X; + Yold := Y; + while Fi < 180 do + begin + Fi := Fi + 6; + Convert; + DrawSegment; + Xold := X; + Yold := Y; + end; + inc(Th, GridStep); + end; + + Wfi := temp; + Fi := -180; + { Meridians } + while Fi < 180 do + begin + Th := -84; + Convert; + Xold := X; + Yold := Y; + while Th < 84 do + begin + Th := Th + 6; + Convert; + DrawSegment; + Xold := X; + Yold := Y; + end; + inc(Fi, GridStep); + end; +end; + +procedure TGlobe.DrawSegment; +begin + if (CosFi * CosTh * CosWth + SinTh * SinWth) > 0.0 then + Canvas.DrawLine(Xold+R, Yold+R, X+R, Y+R); +end; + +procedure TGlobe.Convert; +var + dFi: integer; +begin + dFi := Fi - Wfi; + + CosFi := cos(degtorad(dFi)); + SinFi := sin(degtorad(dFi)); + CosTh := cos(degtorad(Th)); + SinTh := sin(degtorad(Th)); + + X := Trunc(CosTh * SinFi * R); + Y := Trunc((CosFi * CosTh * SinWth - SinTh * CosWth) * R); +end; + +function TGlobe.GetRadius: integer; +begin + Result := R; +end; + +procedure TGlobe.SetRadius(const AValue: integer); +begin + R := AValue; + Repaint; +end; + +procedure TGlobe.SetShowGrid(const AValue: boolean); +begin + if FShowGrid=AValue then exit; + FShowGrid:=AValue; + Repaint; +end; + +procedure TGlobe.SetGridStep(const AValue: integer); +begin + if FGridStep = AValue then exit; + FGridStep := AValue; + if FShowGrid then + Repaint; +end; + +procedure TGlobe.HandlePaint; +begin + Canvas.BeginDraw; + Canvas.Clear(clWindowBackground); +// R := Width div 2; + // inherited HandlePaint; + DrawGlobe; + Canvas.EndDraw; +end; + +constructor TGlobe.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FFocusable := True; + FGridStep := 15; + FShowGrid := True; + R := 150; +end; + +procedure TGlobe.SetViewPoint(const ALon, ALat: integer); +begin + if ALat < -90 then + Wth := -90 + else if ALat > 90 then + Wth := 90 + else + Wth := ALat; + Wfi := ALon mod 360; + Repaint; +end; + +end. diff --git a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi b/examples/apps/globe/globe.lpi index 10179042..cfefa9b2 100644 --- a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi +++ b/examples/apps/globe/globe.lpi @@ -1,20 +1,21 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> - <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + <StringTable ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -30,14 +31,14 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="tiOPFfpGUI"/> + <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="3"> + <Units Count="4"> <Unit0> - <Filename Value="demo_07.lpr"/> + <Filename Value="globe.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="demo_07"/> + <UnitName Value="globe"/> </Unit0> <Unit1> <Filename Value="frm_main.pas"/> @@ -45,26 +46,48 @@ <UnitName Value="frm_main"/> </Unit1> <Unit2> - <Filename Value="Client_BOM.pas"/> + <Filename Value="globe_data.inc"/> <IsPartOfProject Value="True"/> - <UnitName Value="Client_BOM"/> </Unit2> + <Unit3> + <Filename Value="images.inc"/> + <IsPartOfProject Value="True"/> + </Unit3> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> + <Target> + <Filename Value="globe"/> + </Target> <SearchPaths> <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <Parsing> - <SyntaxOptions> - <AllowLabel Value="False"/> - <CPPInline Value="False"/> - </SyntaxOptions> - </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> <Other> - <CustomOptions Value="-dUseCThreads"/> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> </CONFIG> diff --git a/extras/tiopf/demos/rtf_reporting/demoproject.lpr b/examples/apps/globe/globe.lpr index e8ab8521..02af6132 100644 --- a/extras/tiopf/demos/rtf_reporting/demoproject.lpr +++ b/examples/apps/globe/globe.lpr @@ -1,4 +1,4 @@ -program demoproject; +program globe; {$mode objfpc}{$H+} @@ -6,8 +6,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, fpg_main, frmMain; - + Classes, fpg_main, fpg_form, frm_main; procedure MainProc; var diff --git a/examples/apps/globe/globe_data.inc b/examples/apps/globe/globe_data.inc new file mode 100644 index 00000000..56bb0207 --- /dev/null +++ b/examples/apps/globe/globe_data.inc @@ -0,0 +1,1567 @@ + + +// Data array for continents, as a sequence of connected line segment +// (polylines). Segment end coordinates are in degrees, each pair +// representing the absolute latitude and longitude respectively, +// West and South are negative. The step between break-points is +// not greather than 7 degree. The end of a sequence is represented +// by 0,0. + +// The data order is the following: Africa, Europe, Asia, +// South America, North America, Australia and Antartic. + +const + globe_data: array[0..3093] of integer = ( + 33, 28, + 35, 25, + 37, 22, + 38, 18, + 40, 15, + 43, 13, + 44, 11, + 45, 10, + 52, 12, + 51, 10, + 48, 6, + 46, 2, + 44, 1, + 38, -6, + 39, -7, + 39, -9, + 41, -11, + 41, -15, + 39, -17, + 37, -18, + 35, -20, + 36, -24, + 33, -26, + 32, -29, + 29, -32, + 26, -34, + 21, -34, + 20, -35, + 18, -33, + 18, -31, + 15, -26, + 14, -22, + 12, -18, + 12, -16, + 13, -13, + 14, -12, + 14, -11, + 12, -5, + 9, -1, + 10, 3, + 8, 5, + 6, 4, + 5, 6, + 4, 7, + -2, 5, + -6, 5, + -8, 4, + -13, 8, + -13, 9, + -17, 13, + -18, 15, + -17, 17, + -17, 20, + -18, 21, + -18, 22, + -14, 26, + -13, 28, + -10, 30, + -10, 32, + -9, 33, + -7, 34, + -5, 36, + -4, 35, + -2, 35, + 0, 36, + 4, 37, + 11, 37, + 10, 34, + 13, 33, + 15, 32, + 19, 30, + 20, 31, + 20, 32, + 21, 33, + 23, 33, + 23, 32, + 29, 31, + 31, 32, + 33, 31, + 0, 0, + 50, -13, + 50, -16, + 47, -25, + 45, -26, + 44, -25, + 43, -22, + 44, -19, + 44, -17, + 45, -16, + 46, -16, + 49, -12, + 50, -13, + 0, 0, + 34, 0, + 34, -1, + 33, -2, + 32, -2, + 32, 0, + 34, 0, + 0, 0, + 13, 14, + 14, 14, + 15, 13, + 14, 13, + 14, 12, + 13, 14, + 0, 0, + 33, 31, + 34, 31, + 36, 35, + 36, 37, + 35, 37, + 33, 36, + 31, 37, + 30, 38, + 27, 37, + 26, 39, + 26, 40, + 29, 41, + 0, 0, + 32, 35, + 34, 35, + 35, 36, + 32, 35, + 0, 0, + 26, 35, + 24, 36, + 25, 35, + 26, 35, + 0, 0, + 29, 41, + 31, 41, + 33, 42, + 35, 42, + 38, 41, + 40, 41, + 42, 42, + 42, 43, + 37, 45, + 39, 47, + 35, 46, + 37, 45, + 34, 44, + 33, 45, + 34, 46, + 31, 47, + 30, 45, + 28, 43, + 28, 42, + 29, 41, + 28, 41, + 26, 40, + 26, 41, + 24, 41, + 24, 40, + 23, 40, + 23, 39, + 25, 38, + 23, 37, + 23, 36, + 21, 38, + 21, 39, + 20, 40, + 19, 42, + 15, 44, + 15, 45, + 14, 45, + 14, 46, + 12, 45, + 15, 42, + 16, 42, + 17, 41, + 18, 40, + 17, 40, + 17, 39, + 16, 38, + 12, 38, + 14, 37, + 15, 37, + 15, 38, + 16, 39, + 16, 40, + 12, 42, + 10, 44, + 8, 44, + 6, 43, + 3, 43, + 3, 42, + 1, 41, + 0, 40, + 0, 39, + -2, 37, + -4, 37, + -6, 36, + -7, 37, + -9, 37, + -9, 38, + -10, 39, + -9, 41, + -9, 43, + -8, 44, + -2, 43, + -1, 45, + -1, 46, + -2, 47, + -5, 48, + -3, 49, + -2, 49, + -2, 50, + 0, 49, + 2, 51, + 1, 51, + -5, 50, + -6, 50, + -4, 51, + -3, 51, + -5, 52, + -3, 54, + -5, 55, + -5, 56, + -6, 55, + -8, 55, + -9, 54, + -10, 54, + -10, 53, + -9, 53, + -10, 52, + -10, 51, + -7, 52, + -6, 53, + -6, 59, + -7, 57, + -6, 57, + -5, 58, + -3, 59, + -3, 58, + -2, 58, + -3, 56, + -2, 56, + 0, 54, + 0, 53, + 2, 53, + 2, 52, + 1, 52, + 2, 51, + 5, 53, + 9, 54, + 8, 57, + 11, 58, + 11, 57, + 10, 55, + 12, 55, + 12, 56, + 11, 56, + 11, 54, + 14, 55, + 14, 54, + 18, 55, + 21, 55, + 21, 57, + 23, 58, + 24, 57, + 25, 58, + 22, 59, + 22, 58, + 26, 60, + 30, 60, + 28, 61, + 25, 60, + 22, 60, + 21, 61, + 21, 63, + 25, 65, + 24, 66, + 23, 66, + 21, 64, + 17, 62, + 17, 61, + 19, 60, + 17, 58, + 16, 56, + 13, 56, + 13, 57, + 11, 59, + 8, 58, + 7, 58, + 6, 59, + 5, 62, + 10, 64, + 12, 65, + 15, 68, + 16, 69, + 19, 70, + 24, 71, + 28, 71, + 31, 70, + 29, 70, + 34, 69, + 36, 69, + 40, 68, + 41, 67, + 38, 66, + 37, 66, + 33, 67, + 35, 66, + 35, 64, + 38, 63, + 38, 64, + 36, 65, + 37, 65, + 40, 64, + 40, 66, + 43, 67, + 44, 67, + 43, 69, + 46, 69, + 47, 68, + 45, 67, + 48, 67, + 49, 68, + 54, 69, + 54, 68, + 59, 69, + 60, 68, + 61, 69, + 58, 71, + 56, 72, + 57, 73, + 54, 73, + 54, 74, + 56, 75, + 62, 76, + 64, 76, + 67, 77, + 69, 77, + 69, 76, + 60, 74, + 57, 73, + 54, 73, + 52, 72, + 55, 71, + 58, 71, + 60, 70, + 61, 70, + 68, 68, + 0, 0, + 10, 41, + 10, 39, + 9, 39, + 10, 43, + 9, 42, + 10, 41, + 0, 0, + 4, 40, + 4, 39, + 3, 39, + 4, 40, + 0, 0, + -16, 64, + -19, 63, + -23, 64, + -22, 65, + -24, 65, + -24, 66, + -22, 67, + -21, 66, + -21, 65, + -20, 66, + -17, 66, + -16, 67, + -13, 65, + -16, 64, + 0, 0, + -45, 60, + -47, 61, + -48, 61, + -51, 63, + -54, 67, + -53, 68, + -51, 68, + -51, 70, + -55, 70, + -54, 69, + -52, 69, + -54, 71, + -52, 71, + -53, 72, + -56, 72, + -59, 76, + -62, 77, + -68, 77, + -71, 78, + -72, 79, + -65, 80, + -67, 80, + -59, 82, + -51, 82, + -43, 83, + -34, 83, + -28, 83, + -20, 82, + -22, 81, + -17, 81, + -12, 81, + -20, 80, + -20, 73, + -22, 72, + -21, 70, + -27, 69, + -32, 68, + -34, 66, + -40, 65, + -43, 60, + -45, 60, + 0, 0, + 68, 68, + 69, 69, + 67, 70, + 67, 72, + 69, 73, + 72, 73, + 71, 72, + 73, 68, + 72, 67, + 68, 66, + 72, 66, + 74, 67, + 74, 68, + 76, 68, + 78, 67, + 77, 69, + 74, 69, + 74, 71, + 73, 72, + 74, 73, + 75, 73, + 75, 72, + 78, 71, + 76, 72, + 80, 72, + 83, 71, + 81, 73, + 81, 74, + 86, 74, + 87, 75, + 93, 76, + 98, 76, + 101, 77, + 103, 78, + 105, 79, + 102, 80, + 99, 79, + 91, 80, + 98, 80, + 95, 81, + 92, 80, + 100, 80, + 100, 79, + 104, 79, + 108, 77, + 112, 77, + 114, 76, + 113, 75, + 105, 74, + 112, 74, + 118, 74, + 123, 73, + 123, 74, + 128, 73, + 129, 71, + 130, 71, + 133, 72, + 140, 72, + 140, 75, + 135, 76, + 138, 77, + 145, 76, + 150, 75, + 152, 76, + 147, 76, + 143, 75, + 140, 75, + 143, 74, + 140, 74, + 140, 73, + 148, 72, + 153, 71, + 159, 71, + 160, 70, + 167, 70, + 169, 69, + 172, 69, + 171, 70, + 176, 70, + -176, 68, + -174, 66, + -174, 67, + -172, 67, + -170, 66, + -173, 64, + -176, 65, + -176, 66, + -178, 66, + -178, 67, + 180, 65, + 176, 65, + 178, 64, + 179, 63, + 178, 62, + 177, 63, + 171, 61, + 170, 60, + 169, 61, + 163, 60, + 162, 58, + 163, 58, + 163, 56, + 162, 56, + 162, 55, + 160, 54, + 160, 53, + 158, 53, + 158, 52, + 157, 51, + 156, 56, + 157, 58, + 164, 61, + 164, 62, + 160, 61, + 160, 62, + 157, 62, + 154, 60, + 155, 59, + 153, 59, + 149, 60, + 149, 59, + 143, 59, + 135, 55, + 138, 54, + 140, 54, + 141, 53, + 141, 52, + 142, 51, + 142, 46, + 143, 47, + 144, 46, + 144, 47, + 143, 48, + 143, 49, + 144, 49, + 145, 48, + 143, 52, + 143, 54, + 142, 53, + 140, 48, + 136, 44, + 134, 43, + 133, 43, + 132, 44, + 130, 42, + 130, 41, + 128, 40, + 127, 39, + 129, 37, + 129, 35, + 126, 34, + 126, 38, + 125, 38, + 125, 39, + 124, 40, + 121, 39, + 122, 41, + 121, 41, + 119, 39, + 118, 39, + 118, 38, + 119, 38, + 119, 37, + 120, 37, + 121, 38, + 123, 37, + 119, 35, + 122, 32, + 122, 31, + 120, 30, + 122, 30, + 120, 26, + 116, 23, + 111, 21, + 109, 19, + 109, 18, + 110, 18, + 111, 20, + 110, 20, + 110, 22, + 108, 22, + 106, 20, + 106, 18, + 108, 15, + 109, 13, + 109, 11, + 105, 8, + 105, 10, + 103, 11, + 102, 13, + 101, 13, + 101, 14, + 100, 14, + 100, 12, + 99, 9, + 100, 9, + 101, 7, + 102, 7, + 103, 5, + 104, 3, + 105, 1, + 102, 3, + 100, 7, + 98, 8, + 98, 14, + 97, 17, + 95, 16, + 94, 16, + 94, 19, + 92, 23, + 87, 22, + 87, 20, + 82, 17, + 80, 16, + 80, 10, + 80, 6, + 81, 6, + 82, 7, + 82, 8, + 81, 9, + 80, 10, + 78, 8, + 77, 8, + 74, 15, + 73, 22, + 72, 21, + 70, 21, + 69, 22, + 71, 23, + 69, 23, + 67, 26, + 62, 25, + 57, 26, + 56, 27, + 55, 26, + 51, 28, + 50, 30, + 48, 30, + 47, 29, + 50, 27, + 50, 26, + 51, 25, + 51, 26, + 52, 26, + 52, 24, + 54, 24, + 56, 26, + 56, 25, + 57, 24, + 58, 23, + 60, 22, + 58, 19, + 57, 19, + 57, 18, + 55, 18, + 55, 17, + 52, 16, + 52, 15, + 45, 13, + 44, 13, + 42, 17, + 39, 22, + 35, 28, + 35, 29, + 34, 28, + 33, 30, + 33, 28, + 0, 0, + 50, 40, + 47, 43, + 47, 45, + 51, 47, + 53, 47, + 53, 46, + 52, 45, + 50, 45, + 52, 43, + 53, 43, + 53, 41, + 54, 42, + 55, 41, + 53, 41, + 53, 40, + 54, 39, + 54, 37, + 51, 37, + 49, 38, + 49, 39, + 50, 40, + 0, 0, + 62, 45, + 61, 44, + 58, 44, + 58, 45, + 59, 46, + 62, 47, + 61, 46, + 62, 45, + 0, 0, + 142, 40, + 142, 39, + 141, 38, + 141, 36, + 140, 35, + 140, 36, + 139, 35, + 137, 35, + 136, 34, + 135, 34, + 133, 33, + 132, 33, + 133, 34, + 135, 34, + 136, 35, + 132, 34, + 131, 34, + 132, 33, + 131, 31, + 130, 30, + 130, 33, + 129, 33, + 131, 34, + 132, 35, + 136, 36, + 137, 37, + 138, 37, + 140, 39, + 140, 43, + 142, 44, + 142, 46, + 144, 44, + 146, 43, + 144, 43, + 143, 42, + 142, 43, + 141, 43, + 141, 42, + 140, 41, + 141, 41, + 142, 40, + 0, 0, + 120, 24, + 121, 25, + 122, 25, + 121, 22, + 120, 23, + 120, 24, + 0, 0, + 120, 18, + 122, 18, + 122, 16, + 121, 15, + 122, 14, + 124, 14, + 124, 11, + 125, 10, + 126, 9, + 127, 8, + 126, 7, + 126, 6, + 124, 7, + 123, 8, + 122, 7, + 122, 8, + 124, 8, + 125, 10, + 125, 11, + 126, 11, + 125, 12, + 124, 12, + 122, 14, + 120, 14, + 121, 12, + 123, 11, + 123, 10, + 122, 10, + 124, 9, + 124, 10, + 124, 11, + 123, 11, + 122, 10, + 121, 12, + 120, 12, + 120, 11, + 117, 8, + 120, 10, + 120, 11, + 121, 12, + 121, 14, + 120, 15, + 119, 17, + 120, 16, + 120, 18, + 0, 0, + 95, 6, + 98, 5, + 101, 2, + 102, 2, + 104, 0, + 103, -1, + 104, -1, + 106, -3, + 107, -3, + 106, -2, + 106, -6, + 105, -7, + 111, -8, + 114, -8, + 115, -9, + 116, -8, + 117, -9, + 118, -9, + 120, -8, + 127, -8, + 125, -9, + 125, -10, + 123, -11, + 124, -9, + 125, -8, + 124, -8, + 119, -9, + 121, -10, + 119, -8, + 117, -8, + 116, -9, + 115, -8, + 114, -8, + 114, -7, + 108, -7, + 107, -6, + 104, -6, + 101, -3, + 99, 1, + 95, 5, + 95, 6, + 0, 0, + 110, 2, + 111, 2, + 111, 3, + 113, 3, + 116, 7, + 117, 6, + 118, 6, + 119, 5, + 117, 4, + 118, 2, + 119, 2, + 119, 1, + 118, 1, + 116, -3, + 115, -4, + 110, -3, + 109, 1, + 110, 2, + 0, 0, + 125, 2, + 125, 1, + 124, 0, + 121, 1, + 120, 0, + 121, -2, + 122, -1, + 123, -1, + 122, -2, + 123, -4, + 122, -6, + 123, -6, + 123, -5, + 122, -5, + 121, -4, + 121, -4, + 120, -3, + 120, -6, + 119, -6, + 119, -4, + 118, -4, + 118, -3, + 119, -1, + 120, 1, + 121, 2, + 122, 2, + 124, 1, + 125, 2, + 0, 0, + 131, -1, + 134, -1, + 135, -3, + 138, -1, + 144, -3, + 147, -5, + 151, -5, + 152, -4, + 153, -4, + 153, -5, + 151, -6, + 149, -6, + 148, -5, + 148, -6, + 147, -6, + 149, -9, + 151, -10, + 148, -10, + 146, -7, + 143, -8, + 144, -8, + 143, -9, + 141, -9, + 140, -8, + 138, -8, + 139, -7, + 138, -6, + 134, -4, + 133, -4, + 132, -3, + 134, -2, + 132, -2, + 131, -1, + 0, 0, + 164, -20, + 167, -22, + 166, -22, + 164, -21, + 164, -20, + 0, 0, + -77, 8, + -75, 11, + -72, 12, + -71, 12, + -72, 11, + -71, 9, + -72, 9, + -71, 11, + -70, 12, + -68, 11, + -66, 11, + -65, 10, + -64, 11, + -63, 11, + -62, 10, + -61, 10, + -61, 11, + -62, 10, + -61, 9, + -61, 8, + -57, 6, + -54, 6, + -51, 4, + -50, 1, + -51, 0, + -51, -1, + -50, 0, + -48, 0, + -49, -2, + -48, -1, + -44, -2, + -44, -3, + -43, -2, + -42, -3, + -40, -3, + -37, -5, + -36, -5, + -35, -7, + -35, -9, + -38, -12, + -39, -18, + -40, -20, + -42, -23, + -44, -23, + -48, -25, + -49, -28, + -54, -35, + -58, -34, + -57, -37, + -59, -38, + -62, -38, + -62, -41, + -65, -41, + -65, -42, + -63, -43, + -63, -42, + -68, -46, + -66, -47, + -68, -50, + -69, -51, + -68, -53, + -65, -55, + -70, -55, + -75, -53, + -76, -48, + -74, -42, + -75, -41, + -74, -40, + -73, -37, + -72, -33, + -72, -30, + -71, -23, + -70, -20, + -71, -18, + -75, -16, + -77, -14, + -77, -13, + -80, -7, + -82, -6, + -82, -4, + -80, -3, + -80, -2, + -81, -2, + -81, -1, + -80, 1, + -78, 3, + -77, 4, + -78, 6, + -79, 9, + -80, 9, + -80, 7, + -81, 7, + -86, 10, + -86, 11, + -88, 13, + -91, 14, + -94, 16, + -98, 16, + -102, 18, + -105, 20, + -106, 23, + -112, 29, + -113, 31, + -115, 32, + -115, 30, + -111, 26, + -110, 24, + -109, 23, + -110, 23, + -112, 25, + -112, 26, + -115, 28, + -114, 28, + -116, 30, + -118, 34, + -121, 35, + -122, 36, + -124, 39, + -124, 46, + -125, 48, + -123, 48, + -124, 50, + -128, 51, + -125, 49, + -124, 49, + -127, 52, + -131, 55, + -133, 54, + -131, 52, + -132, 54, + -134, 56, + -133, 57, + -134, 58, + -135, 56, + -138, 58, + -142, 60, + -144, 60, + -147, 61, + -148, 61, + -149, 60, + -152, 59, + -154, 58, + -153, 57, + -152, 58, + -152, 60, + -149, 62, + -153, 61, + -154, 59, + -155, 58, + -160, 56, + -165, 54, + -164, 55, + -160, 57, + -158, 58, + -157, 59, + -162, 59, + -162, 60, + -164, 60, + -165, 61, + -167, 61, + -166, 60, + -165, 61, + -166, 62, + -164, 63, + -161, 64, + -161, 65, + -165, 64, + -168, 66, + -164, 67, + -163, 67, + -166, 68, + -166, 69, + -164, 69, + -163, 70, + -156, 72, + -148, 71, + -142, 70, + -136, 69, + -131, 70, + -128, 71, + -122, 70, + -118, 69, + -114, 69, + -116, 68, + -110, 68, + -108, 66, + -107, 68, + -105, 69, + -98, 68, + -98, 70, + -96, 68, + -93, 69, + -97, 70, + -96, 74, + -91, 74, + -92, 73, + -93, 73, + -94, 72, + -90, 68, + -89, 69, + -87, 68, + -85, 70, + -82, 69, + -82, 66, + -83, 66, + -86, 66, + -88, 64, + -91, 63, + -94, 61, + -95, 59, + -94, 59, + -93, 57, + -90, 57, + -85, 55, + -82, 55, + -82, 53, + -80, 51, + -78, 52, + -80, 55, + -77, 56, + -77, 57, + -78, 59, + -77, 60, + -77, 62, + -74, 62, + -70, 61, + -69, 59, + -67, 58, + -65, 60, + -60, 55, + -56, 53, + -56, 52, + -59, 47, + -56, 47, + -56, 46, + -53, 46, + -54, 49, + -56, 50, + -55, 52, + -59, 51, + -60, 50, + -67, 50, + -71, 47, + -67, 49, + -65, 49, + -64, 48, + -66, 48, + -65, 47, + -61, 45, + -60, 46, + -61, 47, + -62, 45, + -65, 43, + -66, 44, + -63, 45, + -67, 45, + -70, 44, + -71, 43, + -70, 42, + -74, 41, + -72, 41, + -74, 40, + -76, 37, + -75, 35, + -78, 34, + -81, 32, + -81, 32, + -80, 27, + -81, 25, + -83, 28, + -83, 29, + -84, 30, + -90, 30, + -89, 29, + -94, 30, + -97, 28, + -97, 26, + 0, 0, + -76, 43, + -79, 43, + -82, 41, + -83, 42, + -81, 45, + -80, 45, + -81, 46, + -87, 46, + -88, 44, + -88, 42, + -86, 43, + -86, 45, + -85, 46, + -85, 48, + -86, 48, + -88, 49, + -92, 47, + -90, 47, + -88, 48, + -87, 47, + -85, 47, + -83, 45, + -84, 44, + -83, 44, + -82, 42, + -81, 43, + -80, 43, + -78, 44, + -76, 44, + -76, 43, + 0, 0, + -156, 20, + -155, 20, + -155, 19, + -156, 19, + -156, 21, + -158, 21, + -158, 22, + -156, 20, + 0, 0, + -159, 22, + -160, 22, + -160, 23, + -159, 22, + 0, 0, + -97, 26, + -98, 22, + -96, 19, + -94, 18, + -91, 19, + -90, 21, + -87, 22, + -89, 16, + -85, 16, + -83, 15, + -84, 11, + -82, 9, + -81, 9, + -79, 10, + -77, 8, + 0, 0, + -85, 22, + -83, 23, + -80, 23, + -74, 20, + -78, 20, + -77, 21, + -78, 21, + -80, 22, + -82, 22, + -82, 23, + -83, 22, + -85, 22, + 0, 0, + -78, 19, + -77, 19, + -76, 18, + -77, 18, + -78, 19, + 0, 0, + -73, 20, + -71, 20, + -68, 19, + -71, 19, + -71, 18, + -72, 18, + -74, 18, + -72, 19, + -73, 20, + 0, 0, + -67, 19, + -65, 19, + -66, 18, + -67, 18, + -67, 19, + 0, 0, + -64, 19, + -63, 18, + 0, 0, + -62, 17, + -61, 16, + 0, 0, + -61, 15, + -61, 14, + 0, 0, + -61, 13, + -62, 12, + 0, 0, + -78, 25, + -77, 24, + 0, 0, + 143, -11, + 144, -14, + 145, -15, + 147, -19, + 148, -20, + 153, -26, + 154, -28, + 153, -33, + 152, -34, + 150, -36, + 150, -37, + 149, -38, + 148, -38, + 146, -39, + 144, -38, + 143, -39, + 141, -38, + 139, -35, + 137, -36, + 139, -36, + 138, -34, + 138, -35, + 137, -35, + 138, -33, + 136, -35, + 134, -33, + 131, -32, + 124, -33, + 123, -34, + 120, -34, + 118, -35, + 116, -35, + 115, -34, + 116, -33, + 116, -32, + 115, -30, + 115, -29, + 113, -26, + 114, -27, + 113, -24, + 114, -22, + 119, -20, + 120, -20, + 122, -19, + 123, -16, + 124, -17, + 124, -16, + 125, -16, + 124, -15, + 127, -14, + 129, -15, + 131, -11, + 130, -11, + 130, -12, + 132, -13, + 133, -13, + 132, -11, + 133, -11, + 134, -12, + 135, -12, + 137, -11, + 137, -12, + 136, -13, + 137, -13, + 137, -14, + 136, -13, + 135, -15, + 138, -17, + 139, -16, + 139, -17, + 138, -17, + 140, -18, + 141, -17, + 142, -13, + 143, -11, + 0, 0, + 145, -40, + 146, -41, + 147, -41, + 147, -42, + 146, -43, + 145, -40, + 0, 0, + 178, -39, + 177, -39, + 177, -40, + 176, -41, + 175, -42, + 174, -41, + 172, -41, + 172, -42, + 168, -44, + 166, -46, + 168, -47, + 168, -48, + 167, -47, + 170, -47, + 172, -44, + 173, -44, + 174, -42, + 175, -41, + 175, -40, + 174, -39, + 175, -39, + 175, -38, + 174, -36, + 173, -35, + 174, -35, + 175, -37, + 176, -37, + 177, -38, + 178, -38, + 178, -39, + 0, 0, + 0, -70, + 8, -70, + 16, -70, + 24, -70, + 32, -69, + 40, -70, + 48, -68, + 53, -66, + 57, -67, + 60, -68, + 65, -68, + 70, -68, + 67, -70, + 72, -72, + 80, -68, + 83, -66, + 90, -67, + 95, -67, + 96, -65, + 99, -66, + 104, -65, + 109, -67, + 114, -66, + 114, -67, + 122, -67, + 130, -67, + 134, -67, + 135, -66, + 136, -67, + 146, -67, + 148, -68, + 154, -68, + 160, -70, + 168, -71, + 170, -72, + 162, -77, + 165, -78, + 160, -79, + 168, -82, + 167, -83, + 175, -84, + -177, -85, + -169, -85, + -161, -86, + -153, -86, + -145, -86, + -142, -86, + -150, -85, + -152, -82, + -146, -81, + -150, -80, + -150, -79, + -157, -77, + -150, -78, + -144, -76, + -147, -75, + -139, -74, + -131, -74, + -128, -74, + -128, -73, + -120, -74, + -112, -74, + -104, -75, + -104, -73, + -96, -74, + -88, -73, + -82, -74, + -76, -74, + -68, -72, + -70, -69, + -68, -67, + -60, -63, + -58, -62, + -64, -66, + -66, -68, + -63, -70, + -64, -74, + -70, -77, + -78, -75, + -84, -78, + -80, -80, + -72, -82, + -64, -83, + -58, -84, + -50, -83, + -42, -82, + -34, -80, + -32, -77, + -24, -76, + -16, -73, + -8, -71, + 0, -70, + 0, 0, + 0, 89, + 180, 89, + 0, 0, + 90, 89, + -90, 89, + 0, 0, + 0, -89, + 180, -89, + 0, 0, + 90, -89, + -90, -89, + 0, 0 + ); + + +// #define NPOINTS (sizeof(globe_data)/sizeof(globe_data[0])) + + diff --git a/examples/apps/globe/images.inc b/examples/apps/globe/images.inc new file mode 100644 index 00000000..282a61c0 --- /dev/null +++ b/examples/apps/globe/images.inc @@ -0,0 +1,52 @@ + +Const + usr_toggle_grid : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0,196, 14, 0, 0,196, 14, 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,192,113, 65,255, 0,255,255, 0, + 255,176,105, 65,255, 0,255,255, 0,255,160, 97, 49,255, 0,255,255, + 0,255,160, 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,192,121, 81,255, 0,255,255, 0,255,176,105, + 65,255, 0,255,255, 0,255,160, 97, 49,255, 0,255,255, 0,255,160, + 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255,192,129, 81, + 192,129, 81,192,121, 81,192,121, 81,192,113, 65,176,113, 65,176,105, + 65,176,105, 49,176, 97, 49,176, 97, 49,160, 89, 49,160, 89, 49,160, + 89, 49,160, 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 192,129, 81,255,255,255,255,255,255,192,113, 65,255,255,255,255,255, + 255,176,105, 65,255,255,255,255,255,255,160, 97, 49,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,192,129, 81, + 255,255,255,255,255,255,192,121, 65,255,255,255,255,255,255,176,105, + 65,255,255,255,255,255,255,176, 97, 49,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,208,144, 97,208,136, 97,208,136, 97,192,129, 81, + 192,129, 81,192,121, 81,192,121, 81,192,113, 65,176,105, 65,176,105, + 65,176,105, 49,176, 97, 49,176, 97, 49,160, 89, 49,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,208,136, 97,255,255,255,255,255,255, + 192,129, 81,255,255,255,255,255,255,192,113, 65,255,255,255,255,255, + 255,176,105, 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,208,144, 97,255,255,255,255,255,255,192,129, 81, + 255,255,255,255,255,255,192,121, 81,255,255,255,255,255,255,176,105, + 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224,152,113,224, + 152,113,208,144, 97,208,144, 97,208,136, 97,208,136, 97,192,129, 81, + 192,129, 81,192,121, 81,192,121, 65,176,113, 65,176,113, 65,176,105, + 65,176,105, 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224, + 152, 97,255,255,255,255,255,255,208,136, 97,255,255,255,255,255,255, + 192,129, 81,255,255,255,255,255,255,192,113, 65,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224,152,113,255, + 255,255,255,255,255,208,144, 97,255,255,255,255,255,255,192,129, 81, + 255,255,255,255,255,255,192,121, 81,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,224,152,113,224,152,113,224,152,113,224,152,113,224, + 152, 97,208,144, 97,208,144, 97,208,136, 97,208,136, 97,208,129, 81, + 192,129, 81,192,121, 81,192,121, 81,176,113, 65,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,224,152,113,255, 0,255,255, 0,255,224, + 144, 97,255, 0,255,255, 0,255,208,136, 97,255, 0,255,255, 0,255, + 192,129, 81,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,224,152,113,255, 0,255,255, 0,255,224,152,113,255, + 0,255,255, 0,255,208,144, 97,255, 0,255,255, 0,255,208,129, 81, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); diff --git a/examples/apps/globe/images/toggle_grid.bmp b/examples/apps/globe/images/toggle_grid.bmp Binary files differnew file mode 100644 index 00000000..47760e12 --- /dev/null +++ b/examples/apps/globe/images/toggle_grid.bmp diff --git a/examples/apps/globe/units/placeholder.txt b/examples/apps/globe/units/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/examples/apps/globe/units/placeholder.txt diff --git a/examples/gui/colorlistbox/frmMain.pas b/examples/gui/colorlistbox/frmMain.pas index 0392be1d..f5ceb6ce 100644 --- a/examples/gui/colorlistbox/frmMain.pas +++ b/examples/gui/colorlistbox/frmMain.pas @@ -13,13 +13,6 @@ type TMainForm = class(TfpgForm) private - procedure chkColorNameChange(Sender: TObject); - procedure ckdReorderChanged(Sender: TObject); - procedure cbName1Change(Sender: TObject); - procedure btnName1Clicked(Sender: TObject); - procedure SetBGColor(Sender: TObject); - procedure PopulatePaletteColorCombo; - public {@VFD_HEAD_BEGIN: MainForm} cbName1: TfpgComboBox; lblName4: TfpgLabel; @@ -32,6 +25,13 @@ type chkColorName: TfpgCheckBox; chkReorder: TfpgCheckBox; {@VFD_HEAD_END: MainForm} + procedure chkColorNameChange(Sender: TObject); + procedure ckdReorderChanged(Sender: TObject); + procedure cbName1Change(Sender: TObject); + procedure btnName1Clicked(Sender: TObject); + procedure SetBGColor(Sender: TObject); + procedure PopulatePaletteColorCombo; + public procedure AfterCreate; override; end; @@ -93,6 +93,7 @@ begin Name := 'MainForm'; SetPosition(286, 264, 413, 250); WindowTitle := 'Color ListBox Test'; + Hint := ''; WindowPosition := wpScreenCenter; cbName1 := TfpgComboBox.Create(self); @@ -101,6 +102,7 @@ begin Name := 'cbName1'; SetPosition(12, 36, 172, 22); FontDesc := '#List'; + Hint := ''; TabOrder := 0; end; @@ -131,7 +133,11 @@ begin with lbColorPick do begin Name := 'lbColorPick'; - SetPosition(216, 20, 184, 148); + SetPosition(216, 20, 184, 212); + Anchors := [anLeft,anTop,anBottom]; + FontDesc := '#List'; + Hint := ''; + TabOrder := 4; end; btnName2 := TfpgButton.Create(self); @@ -196,6 +202,7 @@ begin SetPosition(12, 140, 180, 20); Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 8; Text := 'Show Color Names'; OnChange := @chkColorNameChange; @@ -207,6 +214,7 @@ begin Name := 'chkReorder'; SetPosition(12, 160, 180, 20); FontDesc := '#Label1'; + Hint := ''; TabOrder := 9; Text := 'Drag to reorder'; OnChange := @ckdReorderChanged; diff --git a/examples/gui/customstyles/customstyles.lpi b/examples/gui/customstyles/customstyles.lpi index da520924..5ca58599 100644 --- a/examples/gui/customstyles/customstyles.lpi +++ b/examples/gui/customstyles/customstyles.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/customstyles/frm_test.pas b/examples/gui/customstyles/frm_test.pas index bb429a33..1db20d95 100644 --- a/examples/gui/customstyles/frm_test.pas +++ b/examples/gui/customstyles/frm_test.pas @@ -27,6 +27,11 @@ type btnName4: TfpgButton; edtName1: TfpgEdit; btnClose: TfpgButton; + MainMenu: TfpgMenuBar; + pmFile: TfpgPopupMenu; + pmEdit: TfpgPopupMenu; + pmHelp: TfpgPopupMenu; + pmSubMenu1: TfpgPopupMenu; {@VFD_HEAD_END: TestForm} procedure CloseClicked(Sender: TObject); public @@ -45,18 +50,21 @@ begin end; procedure TTestForm.AfterCreate; +var + miSubMenu: TfpgMenuItem; begin {@VFD_BODY_BEGIN: TestForm} Name := 'TestForm'; - SetPosition(335, 206, 300, 250); + SetPosition(335, 206, 442, 250); WindowTitle := 'Testing Custom Styles'; + Hint := ''; WindowPosition := wpScreenCenter; btnName1 := TfpgButton.Create(self); with btnName1 do begin Name := 'btnName1'; - SetPosition(24, 48, 80, 24); + SetPosition(24, 56, 80, 24); Text := 'Button1'; FontDesc := '#Label1'; Hint := ''; @@ -68,7 +76,7 @@ begin with lblName1 do begin Name := 'lblName1'; - SetPosition(20, 24, 116, 16); + SetPosition(20, 32, 116, 16); FontDesc := '#Label2'; Hint := ''; Text := 'Standard Button'; @@ -78,7 +86,7 @@ begin with lblName2 do begin Name := 'lblName2'; - SetPosition(164, 24, 124, 16); + SetPosition(164, 32, 124, 16); FontDesc := '#Label2'; Hint := ''; Text := 'Embedded Button'; @@ -88,7 +96,7 @@ begin with btnName2 do begin Name := 'btnName2'; - SetPosition(176, 48, 80, 24); + SetPosition(176, 56, 80, 24); Text := 'Button2'; Embedded := True; FontDesc := '#Label1'; @@ -101,7 +109,7 @@ begin with lblName3 do begin Name := 'lblName3'; - SetPosition(20, 92, 100, 16); + SetPosition(20, 100, 100, 16); FontDesc := '#Label2'; Hint := ''; Text := 'Default Button'; @@ -111,7 +119,7 @@ begin with btnName3 do begin Name := 'btnName3'; - SetPosition(24, 116, 80, 24); + SetPosition(24, 124, 80, 24); Text := 'Button3'; FontDesc := '#Label1'; Hint := ''; @@ -124,7 +132,7 @@ begin with lblName4 do begin Name := 'lblName4'; - SetPosition(164, 92, 116, 16); + SetPosition(164, 100, 116, 16); FontDesc := '#Label2'; Hint := ''; Text := 'Flat Button'; @@ -134,7 +142,7 @@ begin with btnName4 do begin Name := 'btnName4'; - SetPosition(176, 116, 80, 24); + SetPosition(176, 124, 80, 24); Text := 'Button4'; Flat := True; FontDesc := '#Label1'; @@ -147,7 +155,9 @@ begin with edtName1 do begin Name := 'edtName1'; - SetPosition(24, 168, 120, 22); + SetPosition(24, 168, 164, 27); + ExtraHint := ''; + Hint := ''; TabOrder := 5; Text := ''; FontDesc := '#Edit1'; @@ -157,7 +167,8 @@ begin with btnClose do begin Name := 'btnClose'; - SetPosition(212, 216, 80, 24); + SetPosition(354, 216, 80, 24); + Anchors := [anRight,anBottom]; Text := 'Close'; FontDesc := '#Label1'; Hint := ''; @@ -166,7 +177,67 @@ begin OnClick := @CloseClicked; end; + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(8, 4, 120, 24); + Align := alTop; + end; + + pmFile := TfpgPopupMenu.Create(self); + with pmFile do + begin + Name := 'pmFile'; + SetPosition(300, 64, 120, 24); + AddMenuItem('&Open', 'Ctrl+O', nil); + AddMenuItem('&Save', 'Ctrl+S', nil); + AddMenuItem('S&ave As', 'Ctrl+A', nil); + AddMenuItem('-', '', nil); + AddMenuItem('Save && Reload', '', nil); + AddMenuItem('-', '', nil); + AddMenuItem('&Quit', 'Ctrl+Q', nil); + end; + + pmEdit := TfpgPopupMenu.Create(self); + with pmEdit do + begin + Name := 'pmEdit'; + SetPosition(300, 92, 120, 24); + AddMenuItem('Cut', '', nil); + AddMenuItem('Copy', '', nil); + AddMenuItem('Paste', '', nil); + AddMenuItem('-', '', nil); + AddMenuItem('Some selected item', '', nil).Checked := True; + miSubMenu := AddMenuItem('My sub-menu', '', nil); + end; + + pmHelp := TfpgPopupMenu.Create(self); + with pmHelp do + begin + Name := 'pmHelp'; + SetPosition(300, 120, 120, 24); + AddMenuItem('About...', '', nil); + end; + + pmSubMenu1 := TfpgPopupMenu.Create(self); + with pmSubMenu1 do + begin + Name := 'pmSubMenu1'; + SetPosition(300, 148, 120, 24); + AddMenuItem('Item 1', '', nil); + AddMenuItem('Item 2', '', nil); + AddMenuItem('Item 3', '', nil).Enabled := False; + end; + {@VFD_BODY_END: TestForm} + + // hook up menus to mainmenu bar + MainMenu.AddMenuItem('File', nil).SubMenu := pmFile; + MainMenu.AddMenuItem('Edit', nil).SubMenu := pmEdit; + MainMenu.AddMenuItem('Help', nil).SubMenu := pmHelp; + + miSubMenu.SubMenu := pmSubMenu1; end; diff --git a/examples/gui/customstyles/mystyle.pas b/examples/gui/customstyles/mystyle.pas index 70448d14..5f95506c 100644 --- a/examples/gui/customstyles/mystyle.pas +++ b/examples/gui/customstyles/mystyle.pas @@ -40,11 +40,15 @@ uses Classes, SysUtils, fpg_main, fpg_base; type + + { TMyStyle } + TMyStyle = class(TfpgStyle) public constructor Create; override; procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); override; procedure DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; AFlags: TFButtonFlags); override; + procedure DrawMenuRow(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgMenuItemFlags); override; end; @@ -113,5 +117,12 @@ begin end; end; +procedure TMyStyle.DrawMenuRow(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgMenuItemFlags); +begin + inherited DrawMenuRow(ACanvas, r, AFlags); + if (mifSelected in AFlags) and not (mifSeparator in AFlags) then + ACanvas.GradientFill(r, TfpgColor($fec475), TfpgColor($fb9d24), gdVertical); +end; + end. diff --git a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi b/examples/gui/drag_n_drop/dndexample.lpi index 4a8402a2..f2ed8c97 100644 --- a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi +++ b/examples/gui/drag_n_drop/dndexample.lpi @@ -1,23 +1,28 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> - <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + <StringTable ProductVersion=""/> </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> + <IgnoreBinaries Value="False"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> </PublishOptions> @@ -29,36 +34,58 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="tiOPFfpGUI"/> + <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="2"> + <Units Count="1"> <Unit0> - <Filename Value="demo_06.lpr"/> + <Filename Value="dndexample.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="demo_06"/> + <UnitName Value="dndexample"/> </Unit0> - <Unit1> - <Filename Value="frm_main.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_main"/> - </Unit1> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> + <Target> + <Filename Value="dndexample"/> + </Target> <SearchPaths> <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> + <IncludeAssertionCode Value="True"/> <AllowLabel Value="False"/> <CPPInline Value="False"/> + <UseAnsiStrings Value="False"/> </SyntaxOptions> </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> <Other> - <CustomOptions Value="-dUseCThreads"/> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> </CONFIG> diff --git a/examples/gui/drag_n_drop/dndexample.lpr b/examples/gui/drag_n_drop/dndexample.lpr new file mode 100644 index 00000000..e134fb74 --- /dev/null +++ b/examples/gui/drag_n_drop/dndexample.lpr @@ -0,0 +1,348 @@ +program dndexample; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + fpg_base, fpg_main, fpg_form, fpg_button, fpg_grid, fpg_panel, + fpg_label, fpg_edit, fpg_stdimages, fpg_checkbox; + +type + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + Bevel1: TfpgPanel; + Grid1: TfpgStringGrid; + Button1: TfpgButton; + btnClear: TfpgButton; + MyDragSourceLabel: TfpgLabel; + Edit1: TfpgEdit; + Label1: TfpgLabel; + Label2: TfpgLabel; + Label3: TfpgLabel; + chkAcceptDrops: TfpgCheckBox; + chkAccept: TfpgCheckBox; + {@VFD_HEAD_END: MainForm} + procedure CheckAcceptDropsChanged(Sender: TObject); + procedure Edit1DragDrop(Sender, Source: TObject; X, Y: integer; AData: variant); + procedure Edit1DragEnter(Sender, Source: TObject; AMimeList: TStringList; var AMimeChoice: TfpgString; var ADropAction: TfpgDropAction; var Accept: Boolean); + procedure Bevel1DragEnter(Sender, Source: TObject; AMimeList: TStringList; var AMimeChoice: TfpgString; var ADropAction: TfpgDropAction; var Accept: Boolean); + procedure Bevel1DragLeave(Sender: TObject); + procedure PanelDragDrop(Sender, Source: TObject; X, Y: integer; AData: variant); + procedure Button1Clicked(Sender: TObject); + procedure btnClearClicked(Sender: TObject); + procedure LabelDragStartDetected(Sender: TObject); + procedure ShowMimeList(AMimeList: TStringList); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.CheckAcceptDropsChanged(Sender: TObject); +begin + Edit1.AcceptDrops := chkAcceptDrops.Checked; +end; + +procedure TMainForm.Edit1DragDrop(Sender, Source: TObject; X, Y: integer; + AData: variant); +begin + Edit1.Text := AData; +end; + +procedure TMainForm.Edit1DragEnter(Sender, Source: TObject; + AMimeList: TStringList; var AMimeChoice: TfpgString; + var ADropAction: TfpgDropAction; var Accept: Boolean); +var + s: string; +begin + s := 'text/plain'; + if chkAccept.Checked then + Accept := False + else + Accept := AMimeList.IndexOf(s) > -1; + if Accept then + begin + if AMimeChoice <> s then + AMimeChoice := s; + ShowMimeList(AMimeList); + end; +end; + +procedure TMainForm.Bevel1DragEnter(Sender, Source: TObject; + AMimeList: TStringList; var AMimeChoice: TfpgString; + var ADropAction: TfpgDropAction; var Accept: Boolean); +var + i: integer; + s: string; +begin + { the mime type we want to accept } + s := 'text/html'; + { if we wil accept the drop, set Accept to True } + Accept := AMimeList.IndexOf(s) > -1; + if Accept then + begin + { If the offered mime type is different, request our preference } + if AMimeChoice <> s then + AMimeChoice := s; + + ShowMimeList(AMimeList); + Bevel1.BackgroundColor := clRed; + end; +end; + +procedure TMainForm.Bevel1DragLeave(Sender: TObject); +begin + Bevel1.BackgroundColor := clWindowBackground; +end; + +procedure TMainForm.PanelDragDrop(Sender, Source: TObject; X, Y: integer; + AData: Variant); +var + s: string; + v: variant; +begin + s := AData; + Bevel1.Text := Format('Drop event at (%d,%d) with value(s):'+LineEnding+'%s', [X, Y, s]); + Bevel1DragLeave(nil); +end; + +procedure TMainForm.Button1Clicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.btnClearClicked(Sender: TObject); +begin + Grid1.RowCount := 0; +end; + +procedure TMainForm.LabelDragStartDetected(Sender: TObject); +var + m: TfpgMimeData; + d: TfpgDrag; + v: variant; +begin + m := TfpgMimeData.Create; + + { via convenience properties } + m.Text := 'My name is Earl'; + m.HTML := 'My name is <b>Earl</b>'; + { Could also have used the generic SetData function } +// m.SetData('text/plain', 'My name is Earl'); +// m.SetData('text/html', 'My name is <b>Earl</b>'); + + { tell TfpgDrag who is the Source of the drag } + d := TfpgDrag.Create(Sender as TfpgWindow); + + { TfpgDrag now takes ownership of TfpgMimeData } + d.MimeData := m; + + { TfpgDrag instance will be freed later when DND action is completed } + d.Execute([daCopy]); +end; + +procedure TMainForm.ShowMimeList(AMimeList: TStringList); +var + i: integer; +begin + { for debug purposes, output the various mime types supported by the source } + Grid1.RowCount := AMimeList.Count; + for i := 0 to AMimeList.Count-1 do + begin + Grid1.Cells[0, i] := IntToStr(i+1); + Grid1.Cells[1, i] := AMimeList[i]; + end; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(316, 186, 512, 429); + WindowTitle := 'Drop Site Demo'; + Hint := ''; + DNDEnabled := True; + + Bevel1 := TfpgPanel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(260, 40, 244, 140); + Anchors := [anLeft,anRight,anTop]; + Alignment := taLeftJustify; + BorderStyle := bsDouble; + FontDesc := '#Label1'; + Hint := ''; + Layout := tlTop; + Style := bsLowered; + Text := ''; + WrapText := True; + AcceptDrops := True; + OnDragEnter := @Bevel1DragEnter; + OnDragLeave := @Bevel1DragLeave; + OnDragDrop := @PanelDragDrop; + end; + + Grid1 := TfpgStringGrid.Create(self); + with Grid1 do + begin + Name := 'Grid1'; + SetPosition(8, 224, 496, 167); + Anchors := [anLeft,anRight,anTop,anBottom]; + BackgroundColor := TfpgColor($80000002); + AddColumn('#', 20, taLeftJustify); + AddColumn('MIME Type', 190, taLeftJustify); + AddColumn('Data', 250, taLeftJustify); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := False; + TabOrder := 2; + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(424, 400, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Quit'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + OnClick :=@Button1Clicked; + end; + + btnClear := TfpgButton.Create(self); + with btnClear do + begin + Name := 'btnClear'; + SetPosition(340, 400, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Clear'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick := @btnClearClicked; + end; + + MyDragSourceLabel := TfpgLabel.Create(self); + with MyDragSourceLabel do + begin + Name := 'MyDragSourceLabel'; + SetPosition(28, 20, 84, 40); + Alignment := taCenter; + BackgroundColor := TfpgColor($67D47A); + FontDesc := '#Label1'; + Hint := ''; + Layout := tlCenter; + Text := 'Drag Me!'; + OnDragStartDetected := @LabelDragStartDetected; + end; + + Edit1 := TfpgEdit.Create(self); + with Edit1 do + begin + Name := 'Edit1'; + SetPosition(8, 156, 240, 24); + ExtraHint := ''; + FontDesc := '#Edit1'; + Hint := ''; + TabOrder := 7; + Text := ''; + AcceptDrops := True; + OnDragEnter := @Edit1DragEnter; + OnDragDrop := @Edit1DragDrop; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(260, 20, 244, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Accepts ''text/html'''; + end; + + Label2 := TfpgLabel.Create(self); + with Label2 do + begin + Name := 'Label2'; + SetPosition(8, 136, 240, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Accepts ''text/plain'''; + end; + + Label3 := TfpgLabel.Create(self); + with Label3 do + begin + Name := 'Label3'; + SetPosition(8, 204, 284, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Available drop formats'; + end; + + chkAcceptDrops := TfpgCheckBox.Create(self); + with chkAcceptDrops do + begin + Name := 'chkAcceptDrops'; + SetPosition(4, 96, 168, 20); + Checked := True; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 10; + Text := 'Enable AcceptDrops'; + OnChange :=@CheckAcceptDropsChanged; + end; + + chkAccept := TfpgCheckBox.Create(self); + with chkAccept do + begin + Name := 'chkAccept'; + SetPosition(4, 116, 244, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 11; + Text := 'Set Accept to False in OnDragEnter'; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/gui/drag_n_drop/extrafpc.cfg b/examples/gui/drag_n_drop/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/drag_n_drop/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/drag_n_drop/units/placeholder.txt b/examples/gui/drag_n_drop/units/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/examples/gui/drag_n_drop/units/placeholder.txt diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr index 37f90ddf..e1dca3d7 100644 --- a/examples/gui/filedialog/filedialog.lpr +++ b/examples/gui/filedialog/filedialog.lpr @@ -6,7 +6,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, + Classes, SysUtils, fpg_base, fpg_main, fpg_form, @@ -30,6 +30,7 @@ type btnName1: TfpgButton; btnName2: TfpgButton; btnUserPrompt: TfpgButton; + btnUserInput: TfpgButton; {@VFD_HEAD_END: MainForm} procedure btnQuitClick(Sender: TObject); procedure btnOpenFileClick(Sender: TObject); @@ -37,6 +38,7 @@ type procedure btnMessageBoxClick(Sender: TObject); procedure btnMessageDlgClick(Sender: TObject); procedure btnUserPromptClick(Sender: TObject); + procedure btnUserInputClicked(Sender: TObject); public procedure AfterCreate; override; end; @@ -99,6 +101,14 @@ begin end; end; +procedure TMainForm.btnUserInputClicked(Sender: TObject); +var + lAnswer: TfpgString; +begin + if fpgInputQuery('Caption here', 'And the prompt goes here', lAnswer) then + ShowMessage(Format('User entered <%s>', [lAnswer])); +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -153,8 +163,9 @@ begin inherited AfterCreate; {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; - SetPosition(197, 147, 419, 138); + SetPosition(330, 199, 419, 138); WindowTitle := 'File dialog test'; + Hint := ''; MinWidth := 300; MinHeight := 135; @@ -165,6 +176,7 @@ begin SetPosition(8, 8, 80, 23); Text := 'Open File...'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 1; OnClick := @btnOpenFileClick; @@ -177,6 +189,7 @@ begin SetPosition(8, 34, 80, 23); Text := 'Save File...'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 2; OnClick := @btnSaveFileClick; @@ -188,6 +201,8 @@ begin Name := 'edFilename'; SetPosition(8, 70, 400, 24); Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; TabOrder := 2; Text := ''; FontDesc := '#Edit1'; @@ -201,6 +216,7 @@ begin Anchors := [anRight,anBottom]; Text := 'Quit'; FontDesc := '#Label1'; + Hint := ''; ImageName := 'stdimg.Quit'; TabOrder := 6; OnClick := @btnQuitClick; @@ -210,9 +226,10 @@ begin with btnName1 do begin Name := 'btnName1'; - SetPosition(148, 8, 119, 27); + SetPosition(148, 8, 116, 27); Text := 'Message Box'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 3; OnClick := @btnMessageBoxClick; @@ -225,6 +242,7 @@ begin SetPosition(272, 8, 131, 27); Text := 'Message Dialog'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 4; OnClick := @btnMessageDlgClick; @@ -237,11 +255,25 @@ begin SetPosition(272, 40, 131, 24); Text := 'User Prompt'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 5; OnClick := @btnUserPromptClick; end; + btnUserInput := TfpgButton.Create(self); + with btnUserInput do + begin + Name := 'btnUserInput'; + SetPosition(148, 40, 116, 24); + Text := 'User Input'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 8; + OnClick :=@btnUserInputClicked; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/examples/gui/gridediting/extrafpc.cfg b/examples/gui/gridediting/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/gridediting/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/gridediting/frm_main.pas b/examples/gui/gridediting/frm_main.pas new file mode 100644 index 00000000..51480595 --- /dev/null +++ b/examples/gui/gridediting/frm_main.pas @@ -0,0 +1,172 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_basegrid, + fpg_grid, fpg_button, fpg_edit, fpg_label; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + Grid1: TfpgStringGrid; + btnQuit: TfpgButton; + Label1: TfpgLabel; + {@VFD_HEAD_END: MainForm} + FCellEdit: TfpgEdit; + FFocusRect: TfpgRect; + FLastGrid: TfpgStringGrid; // reference only + procedure SetupCellEdit(AGrid: TfpgStringGrid); + procedure CellEditExit(Sender: TObject); + procedure CellEditKeypressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure GridKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure GridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); + procedure ButtonQuitClicked(Sender: TObject); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.GridKeyPressed(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if (KeyCode = keyInsert) and (ssCtrl in ShiftState) then + begin + TfpgStringGrid(Sender).RowCount := TfpgStringGrid(Sender).RowCount + 1; + Consumed := True; + Exit; + end; + + if (KeyCode = keyF2) or (KeyCode = keyReturn) then + begin + // we need to edit the cell contents + SetupCellEdit(TfpgStringGrid(Sender)); + Consumed := True; + end; +end; + +procedure TMainForm.GridDrawCell(Sender: TObject; const ARow, ACol: Integer; + const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); +begin + if (gdSelected in AFlags) then + begin + FFocusRect := ARect; + end; +end; + +procedure TMainForm.ButtonQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.SetupCellEdit(AGrid: TfpgStringGrid); +var + pt: TPoint; +begin + if Assigned(FCellEdit) then + FCellEdit.Free; + + FLastGrid := AGrid; + FCellEdit := TfpgEdit.Create(FLastGrid.Parent); + pt.X := FLastGrid.Left + FFocusRect.Left; + pt.Y := FLastGrid.Top + FFocusRect.Top; + with FCellEdit do + begin + Name := 'FCellEdit'; + SetPosition(pt.X, pt.Y, FFocusRect.Width, FFocusRect.Height); + BorderStyle := ebsSingle; + FontDesc := '#Grid'; + Text := AGrid.Cells[AGrid.FocusCol, AGrid.FocusRow]; + OnKeyPress := @CellEditKeypressed; + OnExit := @CellEditExit; + SetFocus; + end; +end; + +procedure TMainForm.CellEditExit(Sender: TObject); +begin + FCellEdit.Visible := False; +end; + +procedure TMainForm.CellEditKeypressed(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyReturn then + begin + FLastGrid.Cells[FLastGrid.FocusCol, FLastGrid.FocusRow] := FCellEdit.Text; + FCellEdit.Visible := False; + FLastGrid.SetFocus; + end; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(356, 172, 431, 361); + WindowTitle := 'Editable StringGrid Demo'; + Hint := ''; + + Grid1 := TfpgStringGrid.Create(self); + with Grid1 do + begin + Name := 'Grid1'; + SetPosition(16, 76, 400, 239); + Anchors := [anLeft,anRight,anTop,anBottom]; + AddColumn('#1', 100, taLeftJustify); + AddColumn('#2', 100, taLeftJustify); + AddColumn('#3', 100, taLeftJustify); + AddColumn('#4', 75, taLeftJustify); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 5; + RowSelect := False; + TabOrder := 1; + OnKeyPress := @GridKeyPressed; + OnDrawCell := @GridDrawCell; + end; + + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(336, 329, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Quit'; + Down := False; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @ButtonQuitClicked; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(16, 8, 400, 56); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#Label1'; + Hint := ''; + Text := 'You can use Ctrl+Ins to add new grid lines. F2 or Enter will put you in edit mode. While in edit mode, changing focus or pressing Enter will take you back to non-edit mode.'; + WrapText := True; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +end. diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi b/examples/gui/gridediting/gridediting.lpi index 047ccf7a..13caff41 100644 --- a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi +++ b/examples/gui/gridediting/gridediting.lpi @@ -1,18 +1,20 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> </Flags> - <SessionStorage Value="InProjectDir"/> + <SessionStorage Value="None"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -22,21 +24,19 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> - <RequiredPackages Count="2"> + <RequiredPackages Count="1"> <Item1> <PackageName Value="fpgui_toolkit"/> </Item1> - <Item2> - <PackageName Value="tiOPF"/> - </Item2> </RequiredPackages> <Units Count="2"> <Unit0> - <Filename Value="PerformanceTesting.lpr"/> + <Filename Value="gridediting.lpr"/> <IsPartOfProject Value="True"/> + <UnitName Value="gridediting"/> </Unit0> <Unit1> <Filename Value="frm_main.pas"/> @@ -46,14 +46,26 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> + <Version Value="9"/> <Other> - <CustomOptions Value="-dUseCThreads -"/> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> </CONFIG> diff --git a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpr b/examples/gui/gridediting/gridediting.lpr index 5db2a346..fc21969d 100644 --- a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpr +++ b/examples/gui/gridediting/gridediting.lpr @@ -1,4 +1,4 @@ -program demo_listmediators; +program gridediting; {$mode objfpc}{$H+} @@ -6,7 +6,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, fpg_main, frmMain, Model, Constants, Model_View; + Classes, fpg_main, fpg_form, frm_main; procedure MainProc; diff --git a/examples/gui/gridediting/units/placeholder.txt b/examples/gui/gridediting/units/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/examples/gui/gridediting/units/placeholder.txt diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 29a51b43..b12811bf 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -40,6 +40,7 @@ type btnFiveOnly: TfpgButton; btnDelRow: TfpgButton; chkSmoothScroll: TfpgCheckBox; + chkAlterColor: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure btnAddFiveClicked(Sender: TObject); @@ -52,6 +53,7 @@ type procedure chkShowGridChange(Sender: TObject); procedure chkHideFocusChange(Sender: TObject); procedure chkSmoothScrollChange(Sender: TObject); + procedure chkAlterColorChange(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); @@ -131,6 +133,15 @@ begin stringgrid.Update; end; +procedure TMainForm.chkAlterColorChange(Sender: TObject); +begin + if chkAlterColor.Checked then + stringgrid.Options := stringgrid.Options + [go_AlternativeColor] + else + stringgrid.Options := stringgrid.Options - [go_AlternativeColor]; + stringgrid.Invalidate; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -149,6 +160,20 @@ begin StringGrid.Canvas.SetTextColor(clTeal); StringGrid.Canvas.DrawString(ARect.Height + ARect.Left + 2, ARect.Top, StringGrid.Cells[ACol, ARow]); end; + // two rows with different background color + if (ARow = 7) or (ARow = 8) then + begin + if ((gdSelected in AFlags) and (gdFocused in AFlags)) or + (gdSelected in AFlags) then + Exit; // we want select cel to be painted as normal + // If we got here, we must do some painting. The background first. + StringGrid.Canvas.Color := clOrange; + StringGrid.Canvas.FillRectangle(ARect); + // NOTE: We want the grid to take care of the drawing of the text, which + // handles text layout and alignment, so we MUST NOT set the + // ADefaultDrawing to False. If we do, we need to handle text painting + // ourselves. + end; end; procedure TMainForm.btnTopRowClicked(Sender: TObject); @@ -277,7 +302,7 @@ begin with chkHideFocus do begin Name := 'chkHideFocus'; - SetPosition(394, 108, 120, 20); + SetPosition(394, 108, 120, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; Hint := ''; @@ -372,7 +397,7 @@ begin with chkSmoothScroll do begin Name := 'chkSmoothScroll'; - SetPosition(394, 128, 120, 20); + SetPosition(394, 132, 120, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; Hint := ''; @@ -381,6 +406,18 @@ begin OnChange := @chkSmoothScrollChange; end; + chkAlterColor := TfpgCheckBox.Create(self); + with chkAlterColor do + begin + Name := 'chkAlterColor'; + SetPosition(394, 156, 120, 24); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 15; + Text := 'Alternate Color'; + OnChange := @chkAlterColorChange; + end; + {@VFD_BODY_END: MainForm} for r := 0 to stringgrid.RowCount-1 do diff --git a/examples/gui/menutest/menutest.lpi b/examples/gui/menutest/menutest.lpi index 522b9451..c3120df3 100644 --- a/examples/gui/menutest/menutest.lpi +++ b/examples/gui/menutest/menutest.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="8"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> @@ -39,7 +39,12 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Linking> <Debugging> <GenerateDebugInfo Value="True"/> diff --git a/examples/gui/menutest/menutest.lpr b/examples/gui/menutest/menutest.lpr index e4d40cf0..586a4387 100644 --- a/examples/gui/menutest/menutest.lpr +++ b/examples/gui/menutest/menutest.lpr @@ -28,13 +28,17 @@ type btnSave: TfpgButton; btnOpen: TfpgButton; btnAbout: TfpgButton; + pnlClient: TfpgBevel; edit1: TfpgEdit; Memo1: TfpgMemo; FFileSubMenu: TfpgPopupMenu; FEditSubMenu: TfpgPopupMenu; FEditSelectSubMenu: TfpgPopupMenu; FViewSubMenu: TfpgPopupMenu; + FDisabledSubMenu: TfpgPopupMenu; FHelpSubMenu: TfpgPopupMenu; + Bevel1: TfpgBevel; + Bevel2: TfpgBevel; {@VFD_HEAD_END: MainForm} procedure miExitClicked(Sender: TObject); procedure miMenuItemSelected(Sender: TObject); @@ -71,6 +75,7 @@ procedure TMainForm.miToolBarChecked(Sender: TObject); begin TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; ToolBar.Visible := not ToolBar.Visible; + Realign; Log('Check Menu for Toolbar toggled'); end; @@ -78,6 +83,7 @@ procedure TMainForm.miStatusBarChecked(Sender: TObject); begin TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; StatusBar.Visible := not StatusBar.Visible; + Realign; Log('Check Menu for Statusbar toggled'); end; @@ -92,21 +98,25 @@ begin end; procedure TMainForm.AfterCreate; +var + mi: TfpgMenuItem; begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; - SetPosition(316, 169, 400, 200); + SetPosition(402, 189, 400, 200); WindowTitle := 'Menu Test'; Hint := ''; WindowPosition := wpOneThirdDown; + MinWidth := 300; + MinHeight := 100; FMenuBar := TfpgMenuBar.Create(self); with FMenuBar do begin Name := 'FMenuBar'; SetPosition(0, 0, 400, 24); - Anchors := [anLeft,anRight,anTop]; + Align := alTop; end; StatusBar := TfpgPanel.Create(self); @@ -114,12 +124,12 @@ begin begin Name := 'StatusBar'; SetPosition(0, 176, 400, 24); - Anchors := [anLeft,anRight,anBottom]; Alignment := taLeftJustify; FontDesc := '#Label1'; Hint := ''; Style := bsLowered; Text := 'This is the status bar...'; + Align := alBottom; end; Toolbar := TfpgBevel.Create(self); @@ -127,9 +137,10 @@ begin begin Name := 'Toolbar'; SetPosition(0, 24, 400, 29); - Anchors := [anLeft,anRight,anTop]; Hint := ''; + Style := bsLowered; Shape := bsBottomLine; + Align := alTop; end; btnQuit := TfpgButton.Create(Toolbar); @@ -138,67 +149,77 @@ begin Name := 'btnQuit'; SetPosition(4, 2, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := ''; ImageMargin := -1; ImageName := 'stdimg.quit'; - ImageSpacing := 0; TabOrder := 1; OnClick := @miExitClicked; + Focusable := False; end; btnSave := TfpgButton.Create(Toolbar); with btnSave do begin Name := 'btnSave'; - SetPosition(56, 2, 24, 24); + SetPosition(64, 2, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := ''; ImageMargin := -1; ImageName := 'stdimg.save'; - ImageSpacing := 0; TabOrder := 2; + Focusable := False; end; btnOpen := TfpgButton.Create(Toolbar); with btnOpen do begin Name := 'btnOpen'; - SetPosition(32, 2, 24, 24); + SetPosition(40, 2, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := ''; ImageMargin := -1; ImageName := 'stdimg.open'; - ImageSpacing := 0; TabOrder := 3; + Focusable := False; end; btnAbout := TfpgButton.Create(Toolbar); with btnAbout do begin Name := 'btnAbout'; - SetPosition(84, 2, 24, 24); + SetPosition(100, 2, 24, 24); Text := ''; - Embedded := True; + Flat := True; FontDesc := '#Label1'; Hint := ''; ImageMargin := -1; ImageName := 'stdimg.help'; - ImageSpacing := 0; TabOrder := 4; OnClick := @btnAboutClicked; + Focusable := False; + end; + + pnlClient := TfpgBevel.Create(self); + with pnlClient do + begin + Name := 'pnlClient'; + SetPosition(56, 56, 244, 116); + Hint := ''; + Shape := bsSpacer; + Align := alClient; end; - edit1 := TfpgEdit.Create(self); + edit1 := TfpgEdit.Create(pnlClient); with edit1 do begin Name := 'edit1'; - SetPosition(8, 62, 100, 24); + SetPosition(8, 4, 100, 24); ExtraHint := ''; Hint := ''; TabOrder := 6; @@ -206,11 +227,11 @@ begin FontDesc := '#Edit1'; end; - Memo1 := TfpgMemo.Create(self); + Memo1 := TfpgMemo.Create(pnlClient); with Memo1 do begin Name := 'Memo1'; - SetPosition(124, 60, 268, 108); + SetPosition(120, 4, 120, 108); Anchors := [anLeft,anRight,anTop,anBottom]; Hint := ''; Lines.Add('<= Text Edit has a popup menu too.'); @@ -275,6 +296,34 @@ begin AddMenuItem('Test Russian text -> Òåñò', '', @miMenuItemSelected); end; + FDisabledSubMenu := TfpgPopupMenu.Create(self); + with FDisabledSubMenu do + begin + Name := 'FDisabledSubMenu'; + SetPosition(264, 160, 120, 20); + AddMenuItem('I''m not enabled', '', nil); + end; + + Bevel1 := TfpgBevel.Create(Toolbar); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(32, 2, 5, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + Bevel2 := TfpgBevel.Create(Toolbar); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(92, 2, 5, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + {@VFD_BODY_END: MainForm} {%endregion} @@ -282,8 +331,9 @@ begin FMenuBar.AddMenuItem('&File', nil).SubMenu := FFileSubMenu; FMenuBar.AddMenuItem('&Edit', nil).SubMenu := FEditSubMenu; FMenuBar.AddMenuItem('&View', nil).SubMenu := FViewSubMenu; - FMenuBar.AddMenuItem('&Windows', nil); - FMenuBar.AddMenuItem('&Disabled', nil).Enabled := False; + mi := FMenuBar.AddMenuItem('&Disabled', nil); + mi.Enabled := False; + mi.SubMenu := FDisabledSubMenu; FMenuBar.AddMenuItem('&Help', nil).SubMenu := FHelpSubMenu; end; diff --git a/examples/gui/splitter/splitter_test.lpr b/examples/gui/splitter/splitter_test.lpr index 9aff9293..52486204 100644 --- a/examples/gui/splitter/splitter_test.lpr +++ b/examples/gui/splitter/splitter_test.lpr @@ -84,22 +84,10 @@ begin with spl2 do begin Name := 'spl2'; - SetPosition(165, 90, 257, 8); + SetPosition(164, 90, 257, 8); Align := alTop; end; - mmDest := TfpgMemo.Create(self); - with mmDest do - begin - Name := 'mmDest'; - SetPosition(165, 94, 256, 116); - Lines.Add('Memo2 Line #1'); - Lines.Add('Memo2 Line #2'); - FontDesc := '#Edit1'; - TabOrder := 1; - Align := alClient; - end; - pnlName1 := TfpgPanel.Create(self); with pnlName1 do begin @@ -143,9 +131,18 @@ begin SetPosition(0, 211, 554, 8); Align := alBottom; end; - - // vvzh: the form appears unaligned under Linux, so we have to add the following line: - Self.Realign; + + mmDest := TfpgMemo.Create(self); + with mmDest do + begin + Name := 'mmDest'; + SetPosition(165, 94, 100, 100); + Lines.Add('Memo2 Line #1'); + Lines.Add('Memo2 Line #2'); + FontDesc := '#Edit1'; + TabOrder := 1; + Align := alClient; + end; {@VFD_BODY_END: frmSplitterTest} end; diff --git a/examples/gui/treeviewtest/treeviewtest.lpr b/examples/gui/treeviewtest/treeviewtest.lpr index 9c57d5f9..5b46b277 100644 --- a/examples/gui/treeviewtest/treeviewtest.lpr +++ b/examples/gui/treeviewtest/treeviewtest.lpr @@ -14,7 +14,11 @@ uses fpg_tree, fpg_checkbox, fpg_button, - fpg_imagelist; + fpg_imagelist, + fpg_label, + fpg_dialogs, + fpg_combobox, + fpg_utils; type @@ -25,12 +29,36 @@ type cbShowImages: TfpgCheckBox; cbIndentNode: TfpgCheckBox; btnClear: TfpgButton; + Label1: TfpgLabel; + Label2: TfpgLabel; + Label3: TfpgLabel; + Label4: TfpgLabel; + Label5: TfpgLabel; + lblSource: TfpgLabel; + lblDestination: TfpgLabel; + btnSource: TfpgButton; + btnDest: TfpgButton; + btnMoveTo: TfpgButton; + cbMoveToTypes: TfpgComboBox; + Label6: TfpgLabel; + Label7: TfpgLabel; + Label8: TfpgLabel; + btnCollapseAll: TfpgButton; + btnExpandAll: TfpgButton; {@VFD_HEAD_END: MainForm} FImagelist: TfpgImageList; + FSrcNode: TfpgTreeNode; + FDestnode: TfpgTreeNode; procedure cbShowImagesChange(Sender: TObject); procedure cbIndentNodeChange(Sender: TObject); procedure btnClearClicked(Sender: TObject); + procedure TreeNodeChanged(Sender: TObject); procedure PopulateTree; + procedure btnSourceClicked(Sender: TObject); + procedure btnDestinationClicked(Sender: TObject); + procedure btnMoveToClicked(Sender: TObject); + procedure btnCollapseAllClicked(Sender: TObject); + procedure btnExpandAllClicked(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -57,6 +85,33 @@ begin end; end; +procedure TMainForm.TreeNodeChanged(Sender: TObject); +const + cParent = 'Parent = %s'; + cPrev = 'Prev = %s'; + cNext = 'Next = %s'; + cFirstSubNode = 'FirstSubnode = %s'; + cLastSubNode = 'LastSubnode = %s'; +var + n: TfpgTreeNode; + + procedure PrintNodeInfo(ALabel: TfpgLabel; AFormat: string; ANode: TfpgTreeNode); + begin + if ANode = nil then + ALabel.Text := Format(AFormat, ['nil']) + else + ALabel.Text := Format(AFormat, [ANode.Text]); + end; + +begin + n := Tree.Selection; + PrintNodeInfo(Label1, cParent, n.Parent); + PrintNodeInfo(Label2, cPrev, n.Prev); + PrintNodeInfo(Label3, cNext, n.Next); + PrintNodeInfo(Label4, cFirstSubNode, n.FirstSubNode); + PrintNodeInfo(Label5, cLastSubNode, n.LastSubNode); +end; + procedure TMainForm.PopulateTree; var n: TfpgTreeNode; @@ -92,6 +147,55 @@ begin n2.AppendText('Child 1').AppendText('Child 2'); n2.Collapsed := False; end; + + TreeNodeChanged(nil); +end; + +procedure TMainForm.btnSourceClicked(Sender: TObject); +begin + FSrcNode := tree.Selection; + if Assigned(FSrcNode) then + lblSource.Text := FSrcNode.Text + else + lblSource.Text := '--'; +end; + +procedure TMainForm.btnDestinationClicked(Sender: TObject); +begin + FDestNode := tree.Selection; + if Assigned(FDestNode) then + lblDestination.Text := FDestNode.Text + else + lblDestination.Text := '--'; +end; + +procedure TMainForm.btnMoveToClicked(Sender: TObject); +const + cEmpty = '--'; +var + i: integer; +begin + if FSrcNode = FDestNode then + begin + TfpgMessageDialog.Warning('', 'Source and Destination may not be the same'); + exit; + end; + if (FSrcNode = nil) or (FDestnode = nil) then + begin + TfpgMessageDialog.Warning('', 'Both Source and Destintation needs to be set first'); + exit; + end; + i := cbMoveToTypes.FocusItem; + FSrcNode.MoveTo(FDestnode, TfpgNodeAttachMode(i)); // This cast is a hack! Do not do this in real-world apps!! + tree.FullExpand; + tree.Invalidate; + // reset values + FSrcNode := nil; + FDestnode := nil; + lblSource.Text := cEmpty; + lblDestination.Text := cEmpty; + + TreeNodeChanged(nil); end; procedure TMainForm.cbShowImagesChange(Sender: TObject); @@ -104,10 +208,14 @@ begin inherited Create(AOwner); // create a image list FImagelist := TfpgImageList.Create; - FImagelist.AddItemFromFile(SetDirSeparators('../../../images/folder_16.bmp'), 0); - FImagelist.AddItemFromFile(SetDirSeparators('../../../images/menu_preferences_16.bmp'), 1); - FImagelist.Item[1].Image.CreateMaskFromSample(0, 0); - FImagelist.Item[1].Image.UpdateImage; + if fpgFileExists('../../../images/folder_16.bmp') then + FImagelist.AddItemFromFile(SetDirSeparators('../../../images/folder_16.bmp'), 0); + if fpgFileExists('../../../images/menu_preferences_16.bmp') then + begin + FImagelist.AddItemFromFile(SetDirSeparators('../../../images/menu_preferences_16.bmp'), 1); + FImagelist.Item[1].Image.CreateMaskFromSample(0, 0); + FImagelist.Item[1].Image.UpdateImage; + end; end; destructor TMainForm.Destroy; @@ -122,30 +230,35 @@ begin inherited AfterCreate; {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; - SetPosition(294, 174, 300, 250); + SetPosition(399, 184, 709, 333); WindowTitle := 'Treeview Test'; + Hint := ''; WindowPosition := wpScreenCenter; tree := TfpgTreeView.Create(self); with tree do begin Name := 'tree'; - SetPosition(8, 8, 284, 184); - Anchors := [anLeft,anRight,anTop,anBottom]; + SetPosition(8, 8, 284, 267); + Anchors := [anLeft,anTop,anBottom]; FontDesc := '#Label1'; + Hint := ''; ScrollWheelDelta := 30; ShowImages := True; + TabOrder := 0; ImageList := FImagelist; + OnChange := @TreeNodeChanged; end; cbShowImages := TfpgCheckBox.Create(self); with cbShowImages do begin Name := 'cbShowImages'; - SetPosition(8, 200, 109, 20); + SetPosition(8, 283, 109, 20); Anchors := [anLeft,anBottom]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 1; Text := 'Show images'; OnChange := @cbShowImagesChange; @@ -155,10 +268,11 @@ begin with cbIndentNode do begin Name := 'cbIndentNode'; - SetPosition(120, 200, 179, 20); + SetPosition(120, 283, 179, 20); Anchors := [anLeft,anBottom]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 2; Text := 'Indent node with no image'; OnChange := @cbIndentNodeChange; @@ -168,7 +282,8 @@ begin with btnClear do begin Name := 'btnClear'; - SetPosition(8, 222, 144, 23); + SetPosition(8, 305, 144, 23); + Anchors := [anLeft,anBottom]; Text := 'Clear Selected Node'; FontDesc := '#Label1'; Hint := ''; @@ -177,11 +292,202 @@ begin OnClick := @btnClearClicked; end; + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(316, 24, 292, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + end; + + Label2 := TfpgLabel.Create(self); + with Label2 do + begin + Name := 'Label2'; + SetPosition(316, 40, 288, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + end; + + Label3 := TfpgLabel.Create(self); + with Label3 do + begin + Name := 'Label3'; + SetPosition(316, 56, 272, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + end; + + Label4 := TfpgLabel.Create(self); + with Label4 do + begin + Name := 'Label4'; + SetPosition(316, 72, 300, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + end; + + Label5 := TfpgLabel.Create(self); + with Label5 do + begin + Name := 'Label5'; + SetPosition(316, 88, 320, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + end; + + lblSource := TfpgLabel.Create(self); + with lblSource do + begin + Name := 'lblSource'; + SetPosition(316, 172, 140, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := '--'; + end; + + lblDestination := TfpgLabel.Create(self); + with lblDestination do + begin + Name := 'lblDestination'; + SetPosition(468, 172, 128, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := '--'; + end; + + btnSource := TfpgButton.Create(self); + with btnSource do + begin + Name := 'btnSource'; + SetPosition(316, 144, 80, 24); + Text := 'Source'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 11; + OnClick := @btnSourceClicked; + end; + + btnDest := TfpgButton.Create(self); + with btnDest do + begin + Name := 'btnDest'; + SetPosition(468, 144, 80, 24); + Text := 'Destination'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 12; + OnClick := @btnDestinationClicked; + end; + + btnMoveTo := TfpgButton.Create(self); + with btnMoveTo do + begin + Name := 'btnMoveTo'; + SetPosition(612, 144, 80, 24); + Text := 'MoveTo'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 13; + OnClick := @btnMoveToClicked; + end; + + cbMoveToTypes := TfpgComboBox.Create(self); + with cbMoveToTypes do + begin + Name := 'cbMoveToTypes'; + SetPosition(612, 172, 96, 22); + FontDesc := '#List'; + Hint := ''; + Items.Add('naAdd'); + Items.Add('naAddFirst'); + Items.Add('naAddChild'); + Items.Add('naAddChildFirst'); + Items.Add('naInsert'); + TabOrder := 14; + FocusItem := 0; + end; + + Label6 := TfpgLabel.Create(self); + with Label6 do + begin + Name := 'Label6'; + SetPosition(300, 4, 348, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Selected Node Information'; + end; + + Label7 := TfpgLabel.Create(self); + with Label7 do + begin + Name := 'Label7'; + SetPosition(300, 120, 348, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Reorder Nodes (testing MovoTo() function)'; + end; + + Label8 := TfpgLabel.Create(self); + with Label8 do + begin + Name := 'Label8'; + SetPosition(300, 200, 308, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Test various Tree functions'; + end; + + btnCollapseAll := TfpgButton.Create(self); + with btnCollapseAll do + begin + Name := 'btnCollapseAll'; + SetPosition(316, 224, 92, 24); + Text := 'Collapse All'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 19; + OnClick := @btnCollapseAllClicked; + end; + + btnExpandAll := TfpgButton.Create(self); + with btnExpandAll do + begin + Name := 'btnExpandAll'; + SetPosition(416, 224, 92, 24); + Text := 'Expand All'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 20; + OnClick := @btnExpandAllClicked; + end; + {@VFD_BODY_END: MainForm} PopulateTree; end; +procedure TMainForm.btnCollapseAllClicked(Sender: TObject); +begin + tree.FullCollapse; +end; + +procedure TMainForm.btnExpandAllClicked(Sender: TObject); +begin + tree.FullExpand; +end; + procedure MainProc; var diff --git a/extras/lazarus_ide/fpguilazideintf.pas b/extras/lazarus_ide/fpguilazideintf.pas index 3d3c5766..306d3d44 100644 --- a/extras/lazarus_ide/fpguilazideintf.pas +++ b/extras/lazarus_ide/fpguilazideintf.pas @@ -107,14 +107,15 @@ begin +' {$IFDEF UNIX}{$IFDEF UseCThreads}'+le +' cthreads,'+le +' {$ENDIF}{$ENDIF}'+le - +' Classes, fpg_main, fpg_form;'+le + +' Classes, fpg_base, fpg_main, fpg_form;'+le +le +'type'+le +le +' TMainForm = class(TfpgForm)'+le - +' public'+le + +' private'+le +' {@VFD_HEAD_BEGIN: MainForm}'+le +' {@VFD_HEAD_END: MainForm}'+le + +' public'+le +' procedure AfterCreate; override;'+le +' end;'+le +le diff --git a/extras/mseide_syntaxdefs/pascal_dark.sdef b/extras/mseide_syntaxdefs/pascal_dark.sdef new file mode 100644 index 00000000..8c95beb7 --- /dev/null +++ b/extras/mseide_syntaxdefs/pascal_dark.sdef @@ -0,0 +1,99 @@ +# +# Dark Pascal Theme +# Created by Graeme Geldenhuys - 2010-05-20 +# + +caseinsensitive + +# COLORS [[[fontcolor [backgroundcolor [statementcolor]]] +# cl_default for project options settings +COLORS cl_ltgray cl_black $202424 + +styles + default '' + # some mud color + words 'b' $AF7832 + # dirty green + comment '' $8EC25C + # aqua + option '' $00FFFF + # pale blue + string '' $6897BB + symbol '' cl_red + +keyworddefs pascal + 'ABSOLUTE' 'ABSTRACT' 'AND' 'ARRAY' 'AS' 'ASM' 'ASSEMBLER' 'BEGIN' + 'BREAK' 'CASE' 'CDECL' 'CLASS' 'CONST' 'CONSTRUCTOR' + 'CONTINUE' 'DEFAULT' 'DEPRECATED' 'DESTRUCTOR' 'DISPOSE' 'DIV' 'DO' 'DOWNTO' + 'ELSE' 'END' 'EXCEPT' 'EXIT' 'EXPORT' 'EXPORTS' 'EXTERNAL' 'FAIL' + 'FALSE' 'FAR' 'FILE' 'FINALIZATION' 'FINALLY' 'FOR' 'FORWARD' 'FUNCTION' 'GOTO' 'IF' + 'IMPLEMENTATION' 'IMPLEMENTS' 'IN' 'INDEX' 'INHERITED' + 'INITIALIZATION' 'INLINE' 'INTERFACE' 'INTERRUPT' 'IS' 'LABEL' 'LIBRARY' + 'MOD' 'NEW' 'NIL' 'NODEFAULT' 'NOT' 'OBJECT' + 'OF' 'ON' 'OPERATOR' 'OR' 'OUT' 'OTHERWISE' 'PACKED' 'POPSTACK' 'PRIVATE' + 'PROCEDURE' 'PROGRAM' 'PROPERTY' 'PROTECTED' + 'PUBLIC' 'PUBLISHED' 'RAISE' 'READ' 'RECORD' 'REINTRODUCE' 'REPEAT' + 'RESOURCESTRING' + 'SELF' 'SET' 'SHL' 'SHR' + 'STDCALL' 'STORED' 'THEN' 'THREADVAR' 'TO' 'TRUE' 'TRY' 'TYPE' 'UNIT' 'UNTIL' + 'USES' 'VAR' 'VIRTUAL' 'WHILE' 'WITH' 'WRITE' 'XOR' + 'OVERLOAD' 'OVERRIDE' + + +# Scopes must be defined before they can be referenced + + +scope option option + endtokens + '}' + +scope comment1 comment + endtokens + '}' + +scope comment2 comment + endtokens + '' + +scope comment3 comment + endtokens + '*)' + +scope string string + endtokens + '''' '' + +scope string1 string + calltokens + '''' string + endtokens + ' ' '' + +scope symbol1 symbol + RETURN +# No endtokens, scope terminates immediately + + +scope main + + keywords words + pascal + + calltokens + '{$' option + '{' comment1 + '//' comment2 + '(*' comment3 + '''' string + '#' string1 + ':' symbol1 + '.' symbol1 + ';' symbol1 + ',' symbol1 + '=' symbol1 + '<>' symbol1 + '<' symbol1 + '>' symbol1 + + + diff --git a/extras/mseide_templates/fpgui.prj b/extras/mseide_templates/fpgui.prj index 2cf0c420..32a77fa2 100644 --- a/extras/mseide_templates/fpgui.prj +++ b/extras/mseide_templates/fpgui.prj @@ -11,6 +11,7 @@ order8=0 order9=0 order10=0 order11=0 +order12=0 [projectoptions] projectdir=/opt/msegui_svn/apps/ide/templates projectfilename=/opt/msegui_svn/apps/ide/templates/fpgui.prj @@ -68,7 +69,7 @@ replacedialog=13 y=302 cx=421 cy=163 -options=93 +options=95 [projectoptionsfo.twidgetgrid3] propcolwidthref=801 sortdescent0=0 @@ -95,7 +96,7 @@ options=93 sortcol=-1 col=4 row=0 - rowheight=17 + rowheight=19 [projectoptionsfo.newfile] firsttab=0 index=0 @@ -108,9 +109,11 @@ options=93 width1=460 sortdescent1=0 values2=0 + values2_ci=-1 width2=30 sortdescent2=0 values3=0 + values3_ci=-1 width3=50 sortdescent3=0 values4=0 @@ -125,8 +128,8 @@ options=93 [projectoptionsfo.macrosplitter] x=0 y=178 - xprop=0 - yprop=0.34296724470134 + xprop=1 + yprop=0.35145631067961 [projectoptionsfo.macrogrid] propcolwidthref=595 sortdescent0=0 @@ -141,7 +144,7 @@ options=93 sortdescent7=0 [projectoptionsfo.makegroupbox] firsttab=0 - index=1 + index=2 [projectoptionsfo.exceptionsgrid] propcolwidthref=772 width0=47 @@ -155,11 +158,11 @@ options=93 index=0 [projectoptionsfo.tabwidget] firsttab=0 - index=6 + index=7 [projectoptionsfo] stackedunder= - x=283 - y=107 + x=96 + y=46 cx=821 cy=572 settings=8 @@ -211,17 +214,11 @@ exceptclassnames=1 EconvertError exceptignore=1 0 -modulenames=3 - ACTIONSMO - MAINFO +modulenames=1 SOURCEPAGE -moduletypes=3 - TACTIONSMO - TMAINFO +moduletypes=1 TSOURCEPAGE -modulefiles=3 - /opt/msegui_svn/apps/ide/actionsmodule.mfm - /opt/msegui_svn/apps/ide/main.mfm +modulefiles=1 /opt/msegui_svn/apps/ide/sourcepage.mfm mainfile=${PROJECTNAME}.pas targetfile=${PROJECTNAME}${EXEEXT} @@ -242,7 +239,7 @@ downloadalways=0 startupbkpt=0 startupbkpton=0 gdbsimulator=0 -gdbprocessor=i386 +gdbprocessor=auto gdbservercommand= gdbservercommandattach= gdbserverwait=0 @@ -250,6 +247,10 @@ beforeload= afterload= beforerun= defaultmake=1 +befcommand=0 +befcommandon=0 +aftcommand=0 +aftcommandon=0 makeoptions=5 -l -Mobjfpc -Sh -gl -O- @@ -262,24 +263,27 @@ makeoptionson=5 34 32 63 -macroon=5 +macroon=6 1 3 6 4 63 -macronames=5 + 63 +macronames=6 TargetCPU TargetOS TargetCPU TargetOS FPGUI_DIR -macrovalues=5 + HelpPath +macrovalues=6 x86_64 linux i386 win32 /home/graemeg/programming/fpgui + /opt/FPC_Docs/inf/ macrogroup=0 groupcomments=6 Linux 64-bit @@ -289,9 +293,9 @@ groupcomments=6 sourcedirs=4 - ${MSEDIR}lib/addon/*/ - ${MSELIBDIR}kernel/$TARGET/ - ${MSELIBDIR}*/ + ${FPGUI_DIR}/src/corelib/gdi/X/ + ${FPGUI_DIR}/src/corelib/x11/ + ${FPGUI_DIR}/src/*/ ./ defines=0 defineson=0 @@ -303,7 +307,7 @@ unitdirs=6 ${FPGUI_DIR}/src/gui/ ${FPGUI_DIR}/src/corelib/ unitdirson=6 - 65599 + 65537 131102 196618 196614 @@ -314,16 +318,18 @@ incpref=-Fi libpref=-Fl objpref=-Fo targpref=-o -sourcefilemasks=4 +sourcefilemasks=5 "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" "*.c" "*.cc" "*.h" "*.mfm" "*.ipf" -syntaxdeffiles=4 - ${SYNTAXDEFDIR}pascal.sdef + "*.sql" +syntaxdeffiles=5 + ${SYNTAXDEFDIR}pascal_dark.sdef ${SYNTAXDEFDIR}cpp.sdef ${SYNTAXDEFDIR}objecttext.sdef ${SYNTAXDEFDIR}ipf2.sdef + ${SYNTAXDEFDIR}sql.sdef filemasknames=5 Source Forms @@ -336,12 +342,24 @@ filemasks=5 *.txt *.ipf * -toolsave=0 -toolhide=0 -toolparse=0 -toolmenus=0 -toolfiles=0 -toolparams=0 +toolsave=2 + -1 + 0 +toolhide=2 + 0 + 0 +toolparse=2 + 0 + 0 +toolmenus=2 + fpGUI &UI Designer + fpGUI &DocView +toolfiles=2 + ${FPGUI_DIR}/uidesigner/units/${TargetCPU}-${TargetOS}/uidesigner${EXEEXT} + ${FPGUI_DIR}/docview/src/units/${TargetCPU}-${TargetOS}/docview${EXEEXT} +toolparams=2 + ${CURSOURCEFILE} + ${HelpPath} -k ${cursword} fontalias=0 fontancestors=0 fontnames=0 @@ -422,13 +440,16 @@ scrollheight=0 tabstops=4 spacetabs=0 tabindent=0 -editfontname=Raize -editfontheight=13 +editfontname=mseide_source +editfontheight=15 editfontwidth=0 -editfontextraspace=2 +editfontextraspace=0 +editfontcolor=-1879048183 +editbkcolor=-1879048186 +statementcolor=14745599 editfontantialiased=1 editmarkbrackets=1 -backupfilecount=2 +backupfilecount=0 encoding=0 scriptbeforecopy= scriptaftercopy= @@ -508,7 +529,11 @@ units= modulefilenames=0 modulenames=0 moduleclassnames=0 - a=0,4133,0,Units + a=0,4133,0,Pascal Units + ) +cmodules= + ( + a=0,4132,0,C Modules ) files= ( @@ -518,7 +543,7 @@ files= storedir=/opt/msegui_svn/apps/ide/compstore/ filename= [layout] -windowlayout=413 +windowlayout=467 [mainfo.openfile] filenames=0 filehistory=10 @@ -540,11 +565,11 @@ windowlayout=413 [mainfo] stackedunder= x=4 - y=24 + y=46 cx=322 cy=74 wsize=0 - active=0 + active=1 visible=1 [targetconsolefo] splitdir=0 @@ -555,10 +580,12 @@ windowlayout=413 ny=0 ncx=0 ncy=0 - x=405 - y=452 - cx=904 - cy=347 + x=616 + y=358 + cx=368 + cy=306 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -575,7 +602,9 @@ windowlayout=413 x=0 y=0 cx=470 - cy=340 + cy=338 + rcx=0 + rcy=0 [memoryfo] splitdir=0 useroptions=16507 @@ -589,7 +618,9 @@ windowlayout=413 x=0 y=0 cx=470 - cy=340 + cy=338 + rcx=0 + rcy=0 [memoryfo.add] value=0 [memoryfo.memon] @@ -601,7 +632,7 @@ windowlayout=413 [disassfo] splitdir=0 useroptions=16491 - stackedunder=componentstorefo + stackedunder=projecttreefo parent= mdistate=0 nx=0 @@ -612,13 +643,15 @@ windowlayout=413 y=502 cx=564 cy=210 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 [findinfilefo] splitdir=0 useroptions=16491 - stackedunder=mainfo.panel1 + stackedunder=componentstorefo parent= mdistate=0 nx=0 @@ -629,6 +662,8 @@ windowlayout=413 y=115 cx=786 cy=207 + rcx=0 + rcy=0 [projecttreefo] splitdir=0 useroptions=16491 @@ -643,9 +678,21 @@ windowlayout=413 y=39 cx=698 cy=413 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 + [projecttreefo.grid] + propcolwidthref=547 + width0=141 + sortdescent0=0 + width1=541 + sortdescent1=0 + sortcol=-1 + col=-1073741823 + row=-1073741823 + rowheight=19 [stackfo] splitdir=0 useroptions=16489 @@ -659,7 +706,9 @@ windowlayout=413 x=0 y=0 cx=470 - cy=340 + cy=338 + rcx=0 + rcy=0 [watchpointsfo] splitdir=0 useroptions=16489 @@ -673,6 +722,8 @@ windowlayout=413 y=26 cx=483 cy=210 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -682,6 +733,7 @@ windowlayout=413 sortdescent0=0 values1=1 0 + values1_ci=-1 width1=33 sortdescent1=0 values2=1 @@ -692,6 +744,7 @@ windowlayout=413 sortdescent4=0 values5=1 0 + values5_ci=-1 width5=38 sortdescent5=0 values6=1 @@ -712,6 +765,8 @@ windowlayout=413 y=404 cx=477 cy=128 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -720,7 +775,7 @@ windowlayout=413 [objectinspectorfo] splitdir=0 useroptions=16491 - stackedunder=mainfo.panel2 + stackedunder=findinfilefo parent= mdistate=0 nx=0 @@ -731,6 +786,8 @@ windowlayout=413 y=179 cx=447 cy=484 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -753,19 +810,24 @@ windowlayout=413 x=0 y=0 cx=470 - cy=340 + cy=338 + rcx=0 + rcy=0 [watchfo.grid] propcolwidthref=275 values0=0 + values0_ci=-1 width0=13 sortdescent0=0 values1=0 width1=152 sortdescent1=0 values3=0 + values3_ci=-1 width3=12 sortdescent3=0 values4=0 + values4_ci=-1 width4=13 sortdescent4=0 [watchfo.watchon] @@ -786,10 +848,12 @@ windowlayout=413 y=359 cx=925 cy=226 + rcx=0 + rcy=0 [componentstorefo] splitdir=0 useroptions=24675 - stackedunder=projecttreefo + stackedunder=mainfo.panel1 parent= mdistate=0 nx=0 @@ -800,6 +864,8 @@ windowlayout=413 y=100 cx=445 cy=354 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -807,10 +873,11 @@ windowlayout=413 propcolwidthref=435 width0=111 sortdescent0=0 - width1=157 sortdescent1=0 width2=160 sortdescent2=0 + width3=185 + sortdescent3=0 [componentstorefo.storefiledialog] filenames=1 /home/mse/test/msegui/apps/ide/compstore/ @@ -839,6 +906,8 @@ windowlayout=413 y=3 cx=440 cy=107 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -857,7 +926,9 @@ windowlayout=413 x=0 y=0 cx=322 - cy=36 + cy=32 + rcx=0 + rcy=0 [sourcefo] splitdir=0 useroptions=16489 @@ -872,6 +943,8 @@ windowlayout=413 y=0 cx=925 cy=585 + rcx=0 + rcy=0 [actionsmo.watchesonact] checked=1 [actionsmo.bluedotsonact] @@ -890,7 +963,9 @@ windowlayout=413 x=0 y=0 cx=470 - cy=340 + cy=338 + rcx=0 + rcy=0 [mainfo.panel1] splitdir=2 useroptions=33586667 @@ -905,6 +980,8 @@ windowlayout=413 y=201 cx=935 cy=585 + rcx=0 + rcy=0 wsize=0 active=1 visible=1 @@ -918,7 +995,7 @@ windowlayout=413 memoryfo cpui386fo activetab=4 - stackedunder=formdesignerfo + stackedunder=mainfo.panel1 parent= mdistate=0 nx=0 @@ -929,6 +1006,8 @@ windowlayout=413 y=256 cx=480 cy=359 + rcx=0 + rcy=0 wsize=0 active=0 visible=0 @@ -948,13 +1027,9 @@ editpos=0 sourcefiles=0 relpaths=0 ismoduletexts=0 -modules=3 +modules=1 /opt/msegui_svn/apps/ide/sourcepage.mfm - /opt/msegui_svn/apps/ide/main.mfm - /opt/msegui_svn/apps/ide/actionsmodule.mfm -visiblemodules=3 - 0 - 0 +visiblemodules=1 0 [sourcefo.tabwidget] tabsize=134 diff --git a/extras/mseide_templates/fpgui/simpleform.pas b/extras/mseide_templates/fpgui/simpleform.pas index a17cf812..92605b34 100644 --- a/extras/mseide_templates/fpgui/simpleform.pas +++ b/extras/mseide_templates/fpgui/simpleform.pas @@ -26,7 +26,7 @@ implementation procedure T${%FORMNAME%}.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} - {@VFD_BODY_BEGIN: MainForm} + {@VFD_BODY_BEGIN: ${%FORMNAME%}} Name := '${%FORMNAME%}'; SetPosition(374, 228, 490, 258); WindowTitle := 'NewForm'; diff --git a/extras/mseide_templates/fpgui_single_unit/program.pas b/extras/mseide_templates/fpgui_single_unit/program.pas new file mode 100644 index 00000000..28eeec4b --- /dev/null +++ b/extras/mseide_templates/fpgui_single_unit/program.pas @@ -0,0 +1,55 @@ +program ${%PROJECTNAME%}; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, fpg_form; + +type + + TMainForm = class(TfpgForm) + public + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(316, 186, 300, 250); + WindowTitle := 'MainForm'; + + {@VFD_BODY_END: MainForm} +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + + diff --git a/extras/mseide_templates/fpgui_single_unit/project.pas b/extras/mseide_templates/fpgui_single_unit/project.pas new file mode 100644 index 00000000..28eeec4b --- /dev/null +++ b/extras/mseide_templates/fpgui_single_unit/project.pas @@ -0,0 +1,55 @@ +program ${%PROJECTNAME%}; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, fpg_form; + +type + + TMainForm = class(TfpgForm) + public + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(316, 186, 300, 250); + WindowTitle := 'MainForm'; + + {@VFD_BODY_END: MainForm} +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + + diff --git a/extras/tiopf/demos/Common/Constants.pas b/extras/tiopf/demos/Common/Constants.pas deleted file mode 100644 index 9820ae5e..00000000 --- a/extras/tiopf/demos/Common/Constants.pas +++ /dev/null @@ -1,14 +0,0 @@ -unit Constants; - -{$mode objfpc}{$H+} - -interface - -const - cNameMissing = 'Please enter a name'; - cAgeOutofRange = 'Please enter a valid age between 1 - 100'; - - -implementation - -end. diff --git a/extras/tiopf/demos/Common/Model.pas b/extras/tiopf/demos/Common/Model.pas deleted file mode 100644 index 8fe815cb..00000000 --- a/extras/tiopf/demos/Common/Model.pas +++ /dev/null @@ -1,263 +0,0 @@ -unit Model; - -{$mode objfpc}{$H+} - -interface -uses - tiObject - ; - -type - TGender = (genMale, genFemale); - -const - cGender: array[TGender] of string = ('Male', 'Female'); - -type - TPerson = class; - TPersonList = class; - - - { Undo feature for TPerson } - TPersonMemento = class(TObject) - private - FOID: string; - FObjectState: TPerObjectState; - FName: string; - FAge: integer; - FGender: TGender; - end; - - - { TPerson - The subject being observed } - TPerson = class(TtiObject) - private - FGender: TGender; - FName: string; - FAge: integer; - function GetGenderGUI: string; - function GetMemento: TPersonMemento; - procedure SetGender(const AValue: TGender); - procedure SetGenderGUI(const AValue: string); - procedure SetName(const Value: string); - procedure SetAge(const Value: integer); - procedure SetMemento(const AValue: TPersonMemento); - protected - function GetCaption: string; override; - procedure DoGetFieldBounds(const AFieldName: String; var MinValue, MaxValue: Integer; var HasBounds: Boolean); override; - public - constructor Create; override; - function IsValid(const pErrors: TtiObjectErrors): Boolean; override; - procedure NotifyObservers; override; - property Memento: TPersonMemento read GetMemento write SetMemento; - property Gender: TGender read FGender write SetGender; - published - property Name: string read FName write SetName; - property Age: integer read FAge write SetAge; - property GenderGUI: string read GetGenderGUI write SetGenderGUI; - end; - - - { TPersonList } - TPersonList = class(TtiObjectList) - private - protected - function GetItems(i: integer): TPerson; reintroduce; - procedure SetItems(i: integer; const Value: TPerson); reintroduce; - public - property Items[i: integer]: TPerson read GetItems write SetItems; - procedure Add(const pObject: TPerson); reintroduce; - end; - - -function GeneratePersonList: TPersonList; - - -implementation -uses - Constants - ; - - -function GeneratePersonList: TPersonList; -var - lData: TPerson; -begin - Result := TPersonList.Create; - - lData := TPerson.Create; - lData.Name := 'Graeme Geldenhuys'; - lData.Age := 23; - Result.Add(lData); - - lData := TPerson.Create; - lData.Name := 'Peter Hinrichsen'; - lData.Age := 34; - Result.Add(lData); - - //lData := TPerson.Create; - //lData.Name := 'Ian Krigsman'; - //lData.Age := 45; - //lData.Deleted := True; - //Result.Add(lData); - - lData := TPerson.Create; - lData.Name := 'John Guthrie'; - lData.Age := 56; - Result.Add(lData); -end; - - -{ TPerson } - -function TPerson.IsValid(const pErrors: TtiObjectErrors): Boolean; -begin - inherited IsValid(pErrors); - - if Name = '' then - pErrors.AddError('Name', cNameMissing); - - if (Age < 1) or (Age > 100) then - pErrors.AddError('Age', cAgeOutofRange); - - Result := pErrors.Count = 0; -end; - -{ This was used for debugging, so you can see when NotifiObservers get called } -procedure TPerson.NotifyObservers; -begin -// writeln('NotifyObservers'); - inherited NotifyObservers; -end; - -procedure TPerson.SetAge(const Value: integer); -begin - { BeginUpdate and EndUpdate are optional. They allow the observers to only - get updated once, and not continuous for small updates. It doesn't really - make a difference for this simple example though. } - BeginUpdate; - FAge := Value; - EndUpdate; - { If you don't use BeginUpdate and EndUpdate, you need to call NotifyObserver - to they can be updated. } -// NotifyObservers; -end; - -procedure TPerson.SetMemento(const AValue: TPersonMemento); -begin - // Update the Person state from the memento. Only if their OID's match. - if (OID.AsString = AValue.FOID) then - begin - FName := AValue.FName; - FAge := AValue.FAge; - FGender := AValue.FGender; - ObjectState := AValue.FObjectState; - end; -end; - -function TPerson.GetCaption: string; -begin - Result := Name; - if Deleted then - Result := Result + ' (deleted)'; -end; - -procedure TPerson.DoGetFieldBounds(const AFieldName: String; var MinValue, - MaxValue: Integer; var HasBounds: Boolean); -begin - if AFieldName = 'Name' then - begin -// writeln(' Name - DoGetFieldBounds'); - HasBounds := True; - MinValue := 1; - MaxValue := 25; - end - else if AFieldName = 'Age' then - begin -// writeln(' Age - DoGetFieldBounds'); - HasBounds := True; - MinValue := 1; - MaxValue := 100; - end - else - begin -// writeln(' unknown property <', AFieldName, '> - DoGetFieldBounds'); - inherited DoGetFieldBounds(AFieldName, MinValue, MaxValue, HasBounds); - end; -end; - -constructor TPerson.Create; -begin - inherited Create; - FGender := genMale; -end; - -procedure TPerson.SetName(const Value: string); -begin - BeginUpdate; - FName := Value; - EndUpdate; -end; - -procedure TPerson.SetGender(const AValue: TGender); -begin - if FGender = AValue then exit; - BeginUpdate; - FGender := AValue; - EndUpdate; -end; - -function TPerson.GetGenderGUI: string; -begin - result := cGender[FGender]; -end; - -function TPerson.GetMemento: TPersonMemento; -begin - // Create a new memento, store the Centre state and return it. - Result := TPersonMemento.Create; - Result.FOID := OID.AsString; - Result.FObjectState := ObjectState; - Result.FName := FName; - Result.FAge := FAge; - Result.FGender := FGender; -end; - -procedure TPerson.SetGenderGUI(const AValue: string); -var - i: TGender; -begin - for i := Low(TGender) to High(TGender) do - begin - if cGender[i] = AValue then - begin - Gender := i; - Exit; //==> - end; - end; - Gender := genMale; -end; - - -{ TPersonList } - -function TPersonList.GetItems(i: integer): TPerson; -begin - result := TPerson(inherited GetItems(i)); -end; - -procedure TPersonList.SetItems(i: integer; const Value: TPerson); -begin - inherited SetItems(i, Value); -end; - -procedure TPersonList.Add(const pObject: TPerson); -begin - BeginUpdate; - inherited Add(pObject); - EndUpdate; -end; - - -end. - diff --git a/extras/tiopf/demos/Common/Model_View.pas b/extras/tiopf/demos/Common/Model_View.pas deleted file mode 100644 index ceac389f..00000000 --- a/extras/tiopf/demos/Common/Model_View.pas +++ /dev/null @@ -1,52 +0,0 @@ -unit Model_View; - -{$IFDEF FPC} - {$mode objfpc}{$H+} -{$ENDIF} - -interface - -uses - Classes - ,tiMediators - ; - -type - { TMemo - Name } - TPerson_Name_Memo_Mediator = class(TtiMemoMediatorView) - protected - procedure SetupGUIandObject; override; - end; - - -implementation - -uses - Model, tiBaseMediator; - - -procedure RegisterMediators; -begin - // Fallbacks (generic) - RegisterFallBackMediators; - - // Specific - gMediatorManager.RegisterMediator(TPerson_Name_Memo_Mediator, TPerson, 'Name'); -end; - - -{ TPerson_Name_Memo_Mediator } - -procedure TPerson_Name_Memo_Mediator.SetupGUIandObject; -begin - inherited SetupGUIandObject; - View.Enabled := False; // fpGUI doesn't have a ReadOnly property yet -end; - - -initialization - { Register all your Mediator Views here } - RegisterMediators; - -end. - diff --git a/extras/tiopf/demos/Common/frm_pickdatabase.pas b/extras/tiopf/demos/Common/frm_pickdatabase.pas deleted file mode 100644 index 7dcee309..00000000 --- a/extras/tiopf/demos/Common/frm_pickdatabase.pas +++ /dev/null @@ -1,361 +0,0 @@ -unit frm_pickdatabase; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils - ,Classes - ,contnrs - // fpGUI - ,fpg_base - ,fpg_main - ,fpg_form - ,fpg_button - ,fpg_edit - ,fpg_combobox - ,fpg_tab - ,fpg_label - // tiOPF - ,tiPersistenceLayers - ; - - -const - cINIIdentLastPerLayer = 'LastPerLayer'; - -type - - TPickDatabaseForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: PickDatabaseForm} - PageControl1: TfpgPageControl; - tsDatabase: TfpgTabSheet; - btnReset: TfpgButton; - Label1: TfpgLabel; - cbPersistenceLayer: TfpgComboBox; - Label2: TfpgLabel; - edtDatabaseName: TfpgEdit; - Label3: TfpgLabel; - edtUsername: TfpgEdit; - Label4: TfpgLabel; - edtPassword: TfpgEdit; - btnDone: TfpgButton; - {@VFD_HEAD_END: PickDatabaseForm} - FSingleUserPersistenceLayers: TObjectList; - function GetDatabaseName: string; - function GetPassword: string; - function GetPersistenceLayerName: string; - function GetUserName: string; - procedure SetPersistenceLayer(const APersistenceLayerName: string); - procedure RegisterPersistenceLayersAsTests; - procedure RegisterPersistenceLayerAsTest(const APersistenceLayer: TtiPersistenceLayer); - procedure FormShow(Sender: TObject); - procedure PersistenceLayerChanged(Sender: TObject); - procedure DefaultToPresetValuesClick(Sender: TObject); - protected - function GetDataDir: string; virtual; - public - constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; - property SingleUserPersistenceLayers: TObjectList read FSingleUserPersistenceLayers; - property PersistenceLayerName: string read GetPersistenceLayerName; - property DatabaseName : string read GetDatabaseName; - property UserName : string read GetUserName; - property Password : string read GetPassword; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiConstants - ,tiUtils - ,tiOPFManager - ,tiINI - ; - -{@VFD_NEWFORM_IMPL} - -function TPickDatabaseForm.GetDatabaseName: string; -begin - Result := edtDatabaseName.Text; -end; - -function TPickDatabaseForm.GetPassword: string; -begin - Result := edtPassword.Text; -end; - -function TPickDatabaseForm.GetPersistenceLayerName: string; -begin - Result := cbPersistenceLayer.Text; -end; - -function TPickDatabaseForm.GetUserName: string; -begin - Result := edtUsername.Text; -end; - -procedure TPickDatabaseForm.SetPersistenceLayer(const APersistenceLayerName: string); -var - LPL: TtiPersistenceLayer; - LDefaults: TtiPersistenceLayerDefaults; -begin - LPL:= GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(APersistenceLayerName); - if LPL<>nil then - begin - LDefaults:= TtiPersistenceLayerDefaults.Create; - try - LPL.AssignPersistenceLayerDefaults(LDefaults); - cbPersistenceLayer.Text := LDefaults.PersistenceLayerName; - edtDatabaseName.Text := ExpandFileName(GetDataDir + LDefaults.DatabaseName); - edtUserName.Text := LDefaults.UserName; - edtPassword.Text := LDefaults.Password; - gINI.WriteString(Name, cINIIdentLastPerLayer, LDefaults.PersistenceLayerName); - finally - LDefaults.Free; - end; - end else - begin - cbPersistenceLayer.FocusItem := -1; - edtDatabaseName.Text := ''; - edtUserName.Text := ''; - edtPassword.Text := ''; - end; -end; - -procedure TPickDatabaseForm.RegisterPersistenceLayersAsTests; -var - i: integer; -begin - for i := 0 to GTIOPFManager.PersistenceLayers.Count - 1 do - RegisterPersistenceLayerAsTest(GTIOPFManager.PersistenceLayers.Items[i]); -end; - -procedure TPickDatabaseForm.RegisterPersistenceLayerAsTest(const APersistenceLayer: TtiPersistenceLayer); -var - LDefaults: TtiPersistenceLayerDefaults; -begin - Assert(APersistenceLayer.TestValid, CTIErrorInvalidObject); - LDefaults:= TtiPersistenceLayerDefaults.Create; - try - APersistenceLayer.AssignPersistenceLayerDefaults(LDefaults); - cbPersistenceLayer.Items.Add(LDefaults.PersistenceLayerName); - finally - LDefaults.Free; - end; -end; - -procedure TPickDatabaseForm.FormShow(Sender: TObject); -var - lLastPerLayer: string; -begin - PageControl1.ActivePageIndex := 0; - RegisterPersistenceLayersAsTests; - lLastPerLayer := gINI.ReadString(Name, 'LastPerLayer', ''); - SetPersistenceLayer(lLastPerLayer); -end; - -procedure TPickDatabaseForm.PersistenceLayerChanged(Sender: TObject); -begin - SetPersistenceLayer(cbPersistenceLayer.Text); -end; - -procedure TPickDatabaseForm.DefaultToPresetValuesClick(Sender: TObject); -begin - SetPersistenceLayer(cbPersistenceLayer.Text); -end; - -function TPickDatabaseForm.GetDataDir: string; -var - dir: string; -begin - dir := tiAddTrailingSlash(tiGetAppDataDirPrivate) + '_Data\'; - result := ExpandFileName(tiFixPathDelim(dir)); -end; - -constructor TPickDatabaseForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - OnShow := @FormShow; - FSingleUserPersistenceLayers := TObjectList.Create(False); -end; - -procedure TPickDatabaseForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: PickDatabaseForm} - Name := 'PickDatabaseForm'; - SetPosition(301, 186, 464, 248); - WindowTitle := 'Pick Database'; - - PageControl1 := TfpgPageControl.Create(self); - with PageControl1 do - begin - Name := 'PageControl1'; - SetPosition(8, 12, 446, 224); - Anchors := [anLeft,anRight,anTop,anBottom]; - ActivePageIndex := 0; - ParentShowHint := True; - TabOrder := 0; - end; - - tsDatabase := TfpgTabSheet.Create(PageControl1); - with tsDatabase do - begin - Name := 'tsDatabase'; - SetPosition(3, 24, 440, 197); - Text := 'Database'; - end; - - btnReset := TfpgButton.Create(tsDatabase); - with btnReset do - begin - Name := 'btnReset'; - SetPosition(296, 24, 132, 24); - Text := 'Reset to Defaults'; - AllowAllUp := False; - Embedded := False; - Flat := False; - FontDesc := '#Label1'; - GroupIndex := 0; - Hint := ''; - ImageLayout := ilImageLeft; - ImageMargin := 3; - ImageName := ''; - ImageSpacing := -1; - ParentShowHint := True; - ShowImage := True; - TabOrder := 0; - OnClick := @DefaultToPresetValuesClick; - end; - - Label1 := TfpgLabel.Create(tsDatabase); - with Label1 do - begin - Name := 'Label1'; - SetPosition(8, 4, 220, 18); - Alignment := taLeftJustify; - FontDesc := '#Label1'; - Hint := ''; - Layout := tlTop; - ParentShowHint := True; - Text := 'Persistence Layer'; - WrapText := False; - end; - - cbPersistenceLayer := TfpgComboBox.Create(tsDatabase); - with cbPersistenceLayer do - begin - Name := 'cbPersistenceLayer'; - SetPosition(8, 24, 268, 24); - FontDesc := '#List'; - ParentShowHint := True; - TabOrder := 2; - OnChange :=@PersistenceLayerChanged; - end; - - Label2 := TfpgLabel.Create(tsDatabase); - with Label2 do - begin - Name := 'Label2'; - SetPosition(8, 50, 232, 18); - Alignment := taLeftJustify; - FontDesc := '#Label1'; - Hint := ''; - Layout := tlTop; - ParentShowHint := True; - Text := 'Database Name'; - WrapText := False; - end; - - edtDatabaseName := TfpgEdit.Create(tsDatabase); - with edtDatabaseName do - begin - Name := 'edtDatabaseName'; - SetPosition(8, 68, 268, 24); - TabOrder := 4; - Text := ''; - FontDesc := '#Edit1'; - ParentShowHint := True; - end; - - Label3 := TfpgLabel.Create(tsDatabase); - with Label3 do - begin - Name := 'Label3'; - SetPosition(8, 94, 232, 18); - Alignment := taLeftJustify; - FontDesc := '#Label1'; - Hint := ''; - Layout := tlTop; - ParentShowHint := True; - Text := 'Username'; - WrapText := False; - end; - - edtUsername := TfpgEdit.Create(tsDatabase); - with edtUsername do - begin - Name := 'edtUsername'; - SetPosition(8, 112, 268, 24); - TabOrder := 6; - Text := ''; - FontDesc := '#Edit1'; - ParentShowHint := True; - end; - - Label4 := TfpgLabel.Create(tsDatabase); - with Label4 do - begin - Name := 'Label4'; - SetPosition(8, 138, 232, 18); - Alignment := taLeftJustify; - FontDesc := '#Label1'; - Hint := ''; - Layout := tlTop; - ParentShowHint := True; - Text := 'Password'; - WrapText := False; - end; - - edtPassword := TfpgEdit.Create(tsDatabase); - with edtPassword do - begin - Name := 'edtPassword'; - SetPosition(8, 156, 268, 24); - TabOrder := 8; - Text := ''; - FontDesc := '#Edit1'; - ParentShowHint := True; - end; - - btnDone := TfpgButton.Create(tsDatabase); - with btnDone do - begin - Name := 'btnDone'; - SetPosition(296, 156, 132, 24); - Text := 'DONE'; - AllowAllUp := False; - Embedded := False; - Flat := False; - FontDesc := '#Label1'; - GroupIndex := 0; - Hint := ''; - ImageLayout := ilImageLeft; - ImageMargin := 3; - ImageName := ''; - ImageSpacing := -1; - ParentShowHint := True; - ShowImage := True; - TabOrder := 11; - ModalResult := mrOK; - end; - - {@VFD_BODY_END: PickDatabaseForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi b/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi deleted file mode 100644 index 34df30b5..00000000 --- a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="2"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - <Item2> - <PackageName Value="fpgui_toolkit"/> - </Item2> - </RequiredPackages> - <Units Count="3"> - <Unit0> - <Filename Value="demo_04.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="demo_04"/> - </Unit0> - <Unit1> - <Filename Value="../Common/frm_pickdatabase.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_pickdatabase"/> - </Unit1> - <Unit2> - <Filename Value="frm_main.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_main"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="../Common/"/> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <CStyleOperator Value="False"/> - </SyntaxOptions> - </Parsing> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpr b/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpr deleted file mode 100644 index d7ff4605..00000000 --- a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpr +++ /dev/null @@ -1,39 +0,0 @@ -program demo_04; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes - ,SysUtils - ,fpg_main - ,tiOPFManager - ,tiConstants - ,frm_main - ; - - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - gTIOPFManager.Terminate; - end; -end; - -begin - MainProc; -end. - - - diff --git a/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas b/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas deleted file mode 100644 index cee11cd0..00000000 --- a/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas +++ /dev/null @@ -1,176 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_button, fpg_panel; - -type - - TMainForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: MainForm} - btnPickDB: TfpgButton; - btnCreateDB: TfpgButton; - btnDBExists: TfpgButton; - pnlDBName: TfpgPanel; - {@VFD_HEAD_END: MainForm} - FPersistenceLayerName: string; - FDatabaseName: string; - FUsername: string; - FPassword: string; - procedure PickDBClicked(Sender: TObject); - procedure DatabaseExistsClicked(Sender: TObject); - procedure CreateDatabaseClicked(Sender: TObject); - public - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - frm_pickdatabase - ,fpg_dialogs - ,tiOPFManager - ,tiPersistenceLayers - ,tiDialogs - ; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.PickDBClicked(Sender: TObject); -var - frm: TPickDatabaseForm; -begin - frm := TPickDatabaseForm.Create(nil); - try - if frm.ShowModal = mrOK then - begin - FPersistenceLayerName := frm.PersistenceLayerName; - FDatabaseName := frm.DatabaseName; - FUsername := frm.UserName; - FPassword := frm.Password; - pnlDBName.Text := frm.DatabaseName; - end; - finally - frm.Free; - end; -end; - -procedure TMainForm.DatabaseExistsClicked(Sender: TObject); -var - LPerLayer: TtiPersistenceLayer; -begin - LPerLayer:= GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(FPersistenceLayerName); - Assert(LPerLayer<>nil, '"' + FPersistenceLayerName + '" not registered'); - if LPerLayer.DatabaseExists(FDatabaseName, FUserName, FPassword) - then - tiAppMessage('Database <' + FDatabaseName + '> exists.') - else - tiAppWarning('Database <' + FDatabaseName + '> does not exist.'); -end; - -procedure TMainForm.CreateDatabaseClicked(Sender: TObject); -var - LPerLayer: TtiPersistenceLayer; -begin - LPerLayer:= GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(FPersistenceLayerName); - Assert(LPerLayer<>nil, '"' + FPersistenceLayerName + '" not registered'); - LPerLayer.CreateDatabase(FDatabaseName, FUserName, FPassword); - tiAppMessage('Database "' + FDatabaseName + '" has been created.'); -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(312, 189, 359, 182); - WindowTitle := 'Demo 04 - Create Database'; - WindowPosition := wpScreenCenter; - - btnPickDB := TfpgButton.Create(self); - with btnPickDB do - begin - Name := 'btnPickDB'; - SetPosition(108, 20, 144, 24); - Text := 'Pick Database'; - AllowAllUp := False; - Embedded := False; - Flat := False; - FontDesc := '#Label1'; - GroupIndex := 0; - Hint := ''; - ImageLayout := ilImageLeft; - ImageMargin := 3; - ImageName := ''; - ImageSpacing := -1; - ParentShowHint := True; - ShowImage := True; - TabOrder := 0; - OnClick := @PickDBClicked; - end; - - btnCreateDB := TfpgButton.Create(self); - with btnCreateDB do - begin - Name := 'btnCreateDB'; - SetPosition(108, 96, 136, 24); - Text := 'Create Database'; - AllowAllUp := False; - Embedded := False; - Flat := False; - FontDesc := '#Label1'; - GroupIndex := 0; - Hint := ''; - ImageLayout := ilImageLeft; - ImageMargin := 3; - ImageName := ''; - ImageSpacing := -1; - ParentShowHint := True; - ShowImage := True; - TabOrder := 1; - OnClick := @CreateDatabaseClicked; - end; - - btnDBExists := TfpgButton.Create(self); - with btnDBExists do - begin - Name := 'btnDBExists'; - SetPosition(108, 128, 136, 24); - Text := 'Database Exists'; - AllowAllUp := False; - Embedded := False; - Flat := False; - FontDesc := '#Label1'; - GroupIndex := 0; - Hint := ''; - ImageLayout := ilImageLeft; - ImageMargin := 3; - ImageName := ''; - ImageSpacing := -1; - ParentShowHint := True; - ShowImage := True; - TabOrder := 2; - OnClick := @DatabaseExistsClicked; - end; - - pnlDBName := TfpgPanel.Create(self); - with pnlDBName do - begin - Name := 'pnlDBName'; - SetPosition(12, 56, 336, 32); - Anchors := [anLeft,anRight,anTop]; - ParentShowHint := True; - Style := bsLowered; - Text := '---'; - end; - - {@VFD_BODY_END: MainForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpr b/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpr deleted file mode 100644 index 8e966dc7..00000000 --- a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpr +++ /dev/null @@ -1,45 +0,0 @@ -program demo_06; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, SysUtils, - fpg_main, frm_main, tiOPFManager, tiConstants; - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - - if GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(cTIPersistFBL) = nil then - raise Exception.Create('The system failed to find the <' + cTIPersistFBL + '> persistence layer') - else - GTIOPFManager.DefaultPersistenceLayerName := cTIPersistFBL; - - // Change the connection string to suite your database location - // ** Remote connection -// gTIOPFManager.ConnectDatabase('192.168.0.54|/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - // ** Local connection - gTIOPFManager.ConnectDatabase('/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - gTIOPFManager.DisconnectDatabase; - gTIOPFManager.Terminate; - end; -end; - -begin - MainProc; -end. - - diff --git a/extras/tiopf/demos/Demo_06_CreateTable/frm_main.pas b/extras/tiopf/demos/Demo_06_CreateTable/frm_main.pas deleted file mode 100644 index f413aa38..00000000 --- a/extras/tiopf/demos/Demo_06_CreateTable/frm_main.pas +++ /dev/null @@ -1,205 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, - fpg_main, fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_memo, fpg_dialogs; - -type - - TMainForm = class(TfpgForm) - private - procedure btnCreateTableClick(Sender: TObject); - procedure btnDropTableClick(Sender: TObject); - procedure btnShowMetaDataClick(Sender: TObject); - procedure btnTableExistsClick(Sender: TObject); - public - {@VFD_HEAD_BEGIN: MainForm} - lblConnectedTo: TfpgLabel; - btnCreateTable: TfpgButton; - btnDropTable: TfpgButton; - btnShowMetaData: TfpgButton; - btnTableExists: TfpgButton; - memName1: TfpgMemo; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiQuery - ,tiOPFManager - ,tiOIDGUID - ,tiDialogs - ; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.btnCreateTableClick(Sender: TObject); -var - LTableMetaData: TtiDBMetaDataTable; -begin - LTableMetaData:= TtiDBMetaDataTable.Create; - try - LTableMetaData.Name:= 'Client'; - LTableMetaData.AddField('OID', qfkString, 36); // Using GUID OIDs - LTableMetaData.AddField('Client_Name', qfkString, 200); - LTableMetaData.AddField('Client_ID', qfkString, 9); - gTIOPFManager.CreateTable(LTableMetaData); - finally - LTableMetaData.Free; - end; - ShowMessage('Table ''Client'' created'); -end; - -procedure TMainForm.btnDropTableClick(Sender: TObject); -begin - gTIOPFManager.DropTable('Client'); - ShowMessage('Table ''Client'' dropped'); -end; - -procedure TMainForm.btnShowMetaDataClick(Sender: TObject); -var - LTableMetaData: TtiDBMetaDataTable; - LDatabase : TtiDatabase; -begin - LTableMetaData:= TtiDBMetaDataTable.Create; - try - LTableMetaData.Name:= 'Client'; - LDatabase:= gTIOPFManager.DefaultDBConnectionPool.Lock; - try - LDatabase.ReadMetaDataFields(LTableMetaData); - tiShowMessage(LTableMetaData.AsDebugString); - finally - gTIOPFManager.DefaultDBConnectionPool.UnLock(LDatabase); - end; - finally - LTableMetaData.Free; - end; -end; - -procedure TMainForm.btnTableExistsClick(Sender: TObject); -var - LDBMetaData: TtiDBMetaData; - LDatabase : TtiDatabase; -begin - LDBMetaData:= TtiDBMetaData.Create; - try - LDatabase:= gTIOPFManager.DefaultDBConnectionPool.Lock; - try - LDatabase.ReadMetaDataTables(LDBMetaData); - if LDBMetaData.FindByTableName('Client') <> nil then - ShowMessage('Table <Client> exists') - else - ShowMessage('Table <Client> does not exist'); - finally - gTIOPFManager.DefaultDBConnectionPool.UnLock(LDatabase); - end; - finally - LDBMetaData.Free; - end; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - lblConnectedTo.Text := 'Connected to: ' + gTIOPFManager.DefaultDBConnectionName; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(738, 153, 389, 250); - WindowTitle := 'Create table demo'; - WindowPosition := wpScreenCenter; - Sizeable := False; - - lblConnectedTo := TfpgLabel.Create(self); - with lblConnectedTo do - begin - Name := 'lblConnectedTo'; - SetPosition(4, 4, 380, 16); - Text := 'Connected To:'; - FontDesc := '#Label1'; - end; - - btnCreateTable := TfpgButton.Create(self); - with btnCreateTable do - begin - Name := 'btnCreateTable'; - SetPosition(280, 24, 103, 24); - Text := 'Create Table'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnCreateTableClick; - end; - - btnDropTable := TfpgButton.Create(self); - with btnDropTable do - begin - Name := 'btnDropTable'; - SetPosition(280, 52, 103, 24); - Text := 'Drop Table'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnDropTableClick; - end; - - btnShowMetaData := TfpgButton.Create(self); - with btnShowMetaData do - begin - Name := 'btnShowMetaData'; - SetPosition(280, 80, 103, 24); - Text := 'Show metadata'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnShowMetaDataClick; - end; - - btnTableExists := TfpgButton.Create(self); - with btnTableExists do - begin - Name := 'btnTableExists'; - SetPosition(280, 108, 103, 24); - Text := 'Table exists?'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnTableExistsClick; - end; - - memName1 := TfpgMemo.Create(self); - with memName1 do - begin - Name := 'memName1'; - SetPosition(4, 24, 264, 220); - Lines.Add('This demo will:'); - Lines.Add(''); - Lines.Add('a) Create a table called Client with the'); - Lines.Add(' following structure:'); - Lines.Add(' OID String(36)'); - Lines.Add(' Client_Name String(200)'); - Lines.Add(' Client_ID String(9)'); - Lines.Add(''); - Lines.Add('b) Test if a table called Client exists'); - Lines.Add(''); - Lines.Add('c) Show metadata for the Client table'); - Lines.Add(''); - Lines.Add('d) Drop the client table'); - FontDesc := '#Edit1'; - Enabled := False; - end; - - {@VFD_BODY_END: MainForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_07_VisitorBasics/Client_BOM.pas b/extras/tiopf/demos/Demo_07_VisitorBasics/Client_BOM.pas deleted file mode 100644 index 49195b48..00000000 --- a/extras/tiopf/demos/Demo_07_VisitorBasics/Client_BOM.pas +++ /dev/null @@ -1,81 +0,0 @@ -unit Client_BOM; - -interface -uses - tiObject - ,tiOID - ,tiOIDGUID - ,tiVisitor - ; - -type - - TClient = class; - TClientList = class; - - TClientName = String[200]; - TClientID = String[9]; - - TClientList = class(TtiObjectList); - - - TClient = class(TtiObject) - private - FClientID: TClientID; - FClientName: TClientName; - published - property ClientName: TClientName read FClientName write FClientName; - property ClientID : TClientID read FClientID write FClientID; - end; - - - TClientVisitor = class(TtiVisitor) - protected - function AcceptVisitor: boolean; override; - public - procedure Execute(const AVisited: TtiVisited); override; - end; - - -procedure RegisterMappings; - - -implementation -uses - tiOPFManager - ,tiAutoMap - ,tiConstants - ,tiDialogs - ; - -procedure RegisterMappings; -begin - // Class, Table, Property, Column, Special Info - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'OID', 'OID', [pktDB]); - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'ClientName', 'Client_Name' ); - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'ClientID', 'Client_ID' ); - gTIOPFManager.ClassDBMappingMgr.RegisterCollection(TClientList, TClient); -end; - -{ TClientVisitor } - -function TClientVisitor.AcceptVisitor: boolean; -begin - // Put the code to check if this visitor should act on this object in here. - Result:= Visited is TClient; - // Remove this line and the visitor will touch the TClientList object - // as well as it's owned TClient objects. -end; - -procedure TClientVisitor.Execute(const AVisited: TtiVisited); -begin - inherited; - if not AcceptVisitor then - Exit; - tiShowMessage((Visited as TtiObject).AsDebugString); -end; - -end. - - - diff --git a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpr b/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpr deleted file mode 100644 index 125dd248..00000000 --- a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpr +++ /dev/null @@ -1,39 +0,0 @@ -program demo_07; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_main, frm_main, tiOIDGUID, tiOPFManager, Client_BOM; - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - - // Change the connection string to suite your database location - // ** Remote connection - //gTIOPFManager.ConnectDatabase('192.168.0.54|/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - // ** Local connection - //gTIOPFManager.ConnectDatabase('/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - //gTIOPFManager.DisconnectDatabase; - //gTIOPFManager.Terminate; - end; -end; - -begin - MainProc; -end. - - diff --git a/extras/tiopf/demos/Demo_07_VisitorBasics/frm_main.pas b/extras/tiopf/demos/Demo_07_VisitorBasics/frm_main.pas deleted file mode 100644 index 8a10f2df..00000000 --- a/extras/tiopf/demos/Demo_07_VisitorBasics/frm_main.pas +++ /dev/null @@ -1,131 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, - fpg_main, fpg_form, fpg_button, - Client_BOM; - -type - - TMainForm = class(TfpgForm) - private - FClientList: TClientList; - procedure btnAddClientClick(Sender: TObject); - procedure btnShowListClick(Sender: TObject); - procedure btnRunClientVisitorClick(Sender: TObject); - public - {@VFD_HEAD_BEGIN: MainForm} - btnAddClient: TfpgButton; - btnShowList: TfpgButton; - btnRunClientVisitor: TfpgButton; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiUtils - ,tiDialogs - ,tiOPFManager - ; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.btnAddClientClick(Sender: TObject); -var - lClient: TClient; -begin - lClient := TClient.Create; - lClient.OID.AsString := IntToStr(tiGetTickCount); // Not how you do it in real life! - lClient.ClientName := 'Test ' + DateTimeToStr(Now); - lClient.ClientID := IntToStr(tiGetTickCount); - FClientList.Add(lClient); -end; - -procedure TMainForm.btnShowListClick(Sender: TObject); -begin - tiShowString(FClientList.AsDebugString); -end; - -procedure TMainForm.btnRunClientVisitorClick(Sender: TObject); -var - lVis: TClientVisitor; -begin - lVis := TClientVisitor.Create; - try - FClientList.Iterate(lVis); - finally - lVis.Free; - end; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - FClientList := TClientList.Create; -end; - -destructor TMainForm.Destroy; -begin -// FClientList.Save; - FClientList.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(854, 117, 244, 166); - WindowTitle := 'Visitor Basics'; - WindowPosition := wpScreenCenter; - Sizeable := False; - - btnAddClient := TfpgButton.Create(self); - with btnAddClient do - begin - Name := 'btnAddClient'; - SetPosition(68, 24, 107, 24); - Text := 'Add client'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnAddClientClick; - end; - - btnShowList := TfpgButton.Create(self); - with btnShowList do - begin - Name := 'btnShowList'; - SetPosition(68, 56, 107, 24); - Text := 'Show list'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnShowListClick; - end; - - btnRunClientVisitor := TfpgButton.Create(self); - with btnRunClientVisitor do - begin - Name := 'btnRunClientVisitor'; - SetPosition(68, 88, 107, 24); - Text := 'Run client visitor'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnRunClientVisitorClick; - end; - - {@VFD_BODY_END: MainForm} -end; - - -end. - diff --git a/extras/tiopf/demos/Demo_08_Collection/Client_AutoMap_Svr.pas b/extras/tiopf/demos/Demo_08_Collection/Client_AutoMap_Svr.pas deleted file mode 100644 index 6ad1008e..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/Client_AutoMap_Svr.pas +++ /dev/null @@ -1,25 +0,0 @@ -unit Client_AutoMap_Svr; - -{$mode objfpc}{$H+} - -interface - -procedure RegisterMappings; - -implementation -uses - tiOPFManager - ,tiAutoMap - ,Client_BOM - ; - -procedure RegisterMappings; -begin - // Class, Table, Property, Column, Special Info - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'OID', 'OID', [pktDB]); - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'ClientName', 'Client_Name' ); - gTIOPFManager.ClassDBMappingMgr.RegisterMapping(TClient, 'Client', 'ClientID', 'Client_ID' ); - gTIOPFManager.ClassDBMappingMgr.RegisterCollection(TClients, TClient); -end; - -end. diff --git a/extras/tiopf/demos/Demo_08_Collection/Client_BOM.pas b/extras/tiopf/demos/Demo_08_Collection/Client_BOM.pas deleted file mode 100644 index 52775334..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/Client_BOM.pas +++ /dev/null @@ -1,70 +0,0 @@ -unit Client_BOM; - -{$mode objfpc}{$H+} - -interface -uses - tiObject - ; - -type - - TClient = class; - TClients = class; - - TClientName = String[200]; - TClientID = String[9]; - - - TClients = class(TtiObjectList) - public - procedure Read; override; - procedure Save; override; - end; - - - TClient = class(TtiObject) - private - FClientID: TClientID; - FClientName: TClientName; - public - constructor CreateNew(const ADatabaseName: string=''; const APersistenceLayerName: string=''); override; - published - property ClientName: TClientName read FClientName write FClientName; - property ClientID: TClientID read FClientID write FClientID; - end; - - -implementation -uses - tiOPFManager - ,SysUtils - ,tiUtils - ; - -{ TClient } - -constructor TClient.CreateNew(const ADatabaseName: string = ''; const APersistenceLayerName: string = ''); -begin - inherited; - // Set some default values for the demo - ClientName := 'TEST ' + DateTimeToStr(Now); - ClientID := IntToStr(tiGetTickCount); -end; - -{ TClients } - -procedure TClients.Read; -begin - inherited Read; - NotifyObservers; -end; - -procedure TClients.Save; -begin - inherited Save; - NotifyObservers; -end; - -end. - diff --git a/extras/tiopf/demos/Demo_08_Collection/Client_DBIndependentVisitors_Svr.pas b/extras/tiopf/demos/Demo_08_Collection/Client_DBIndependentVisitors_Svr.pas deleted file mode 100644 index 495191e6..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/Client_DBIndependentVisitors_Svr.pas +++ /dev/null @@ -1,146 +0,0 @@ -unit Client_DBIndependentVisitors_Svr; - -{$mode objfpc}{$H+} - -interface -uses - tiVisitorDBAutoGen - ; - -type - - TVisClient_Read = class(TVisDBAutoGenRead) - protected - function AcceptVisitor: boolean; override; - procedure Init ; override; - procedure SetupParams ; override; - procedure MapRowToObject; override; - end; - - TVisClient_Create = class(TVisDBAutoGenUpdate) - protected - function AcceptVisitor: boolean; override; - procedure SetupParams ; override; - end; - - TVisClient_Update = class(TVisDBAutoGenUpdate) - protected - function AcceptVisitor: boolean; override; - procedure SetupParams ; override; - end; - - TVisClient_Delete = class(TVisDBAutoGenDelete) - protected - function AcceptVisitor: boolean; override; - procedure SetupParams ; override; - end; - -procedure RegisterVisitors; - -implementation -uses - Client_BOM - ,tiOPFManager - ,tiObject - ,tiLog - ,tiQuery - ; - -procedure RegisterVisitors; -begin - gTIOPFManager.RegReadVisitor(TVisClient_Read); - gTIOPFManager.RegSaveVisitor(TVisClient_Create); - gTIOPFManager.RegSaveVisitor(TVisClient_Update); - gTIOPFManager.RegSaveVisitor(TVisClient_Delete); -end; - -{ TVisClient_Read } - -function TVisClient_Read.AcceptVisitor: boolean; -begin - result:= (Visited is TClients) and - (Visited.ObjectState = posEmpty); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Read.Init; -begin - TableName:= 'Client'; -end; - -procedure TVisClient_Read.MapRowToObject; -var - LClient: TClient; -begin - LClient:= TClient.Create; - LClient.OID.AssignFromTIQuery('OID',Query); - LClient.ClientName:= Query.FieldAsString['Client_Name']; - LClient.ClientID:= Query.FieldAsString['Client_ID']; - LClient.ObjectState:= posClean; - TClients(Visited).Add(LClient); -end; - -procedure TVisClient_Read.SetupParams; -begin - // Do nothing -end; - -{ TVisClient_Create } - -function TVisClient_Create.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posCreate); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Create.SetupParams; -var - LData: TClient; -begin - LData:= Visited as TClient; - TableName:= 'Client'; - QueryType:= qtInsert; - QueryParams.SetValueAsString('OID', LData.OID.AsString); - QueryParams.SetValueAsString('Client_Name', LData.ClientName); - QueryParams.SetValueAsString('Client_ID', LData.ClientID); -end; - -{ TVisClient_Update } - -function TVisClient_Update.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posUpdate); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Update.SetupParams; -var - LData: TClient; -begin - LData:= Visited as TClient; - TableName:= 'Client'; - QueryType:= qtUpdate; - QueryWhere.SetValueAsString('OID', LData.OID.AsString); - QueryParams.SetValueAsString('Client_Name', LData.ClientName); - QueryParams.SetValueAsString('Client_ID', LData.ClientID); -end; - -{ TVisClient_Delete } - -function TVisClient_Delete.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posDelete); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Delete.SetupParams; -begin - inherited; - TableName:= 'Client'; -end; - -end. - diff --git a/extras/tiopf/demos/Demo_08_Collection/Client_HardCodedVisitors_Svr.pas b/extras/tiopf/demos/Demo_08_Collection/Client_HardCodedVisitors_Svr.pas deleted file mode 100644 index 99a25573..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/Client_HardCodedVisitors_Svr.pas +++ /dev/null @@ -1,171 +0,0 @@ -unit Client_HardCodedVisitors_Svr; - -{$mode objfpc}{$H+} - -interface -uses - tiVisitorDB - ; - -type - - TVisClient_Read = class(TVisOwnedQrySelect) - protected - function AcceptVisitor: boolean; override; - procedure Init ; override; - procedure SetupParams ; override; - procedure MapRowToObject; override; - end; - - TVisClient_Create = class(TVisOwnedQryUpdate) - protected - function AcceptVisitor: boolean; override; - procedure Init ; override; - procedure SetupParams ; override; - end; - - TVisClient_Update = class(TVisOwnedQryUpdate) - protected - function AcceptVisitor: boolean; override; - procedure Init ; override; - procedure SetupParams ; override; - end; - - TVisClient_Delete = class(TVisOwnedQryUpdate) - protected - function AcceptVisitor: boolean; override; - procedure Init ; override; - procedure SetupParams ; override; - end; - -procedure RegisterVisitors; - -implementation -uses - Client_BOM - ,tiOPFManager - ,tiObject - ,tiLog - ; - -procedure RegisterVisitors; -begin - gTIOPFManager.RegReadVisitor(TVisClient_Read); - gTIOPFManager.RegSaveVisitor(TVisClient_Create); - gTIOPFManager.RegSaveVisitor(TVisClient_Update); - gTIOPFManager.RegSaveVisitor(TVisClient_Delete); -end; - -{ TVisClient_Read } - -function TVisClient_Read.AcceptVisitor: boolean; -begin - result:= (Visited is TClients) and - (Visited.ObjectState = posEmpty); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Read.Init; -begin - Query.SQLText:= - 'select OID, Client_Name, Client_ID from Client'; -end; - -procedure TVisClient_Read.MapRowToObject; -var - lClient: TClient; -begin - lClient:= TClient.Create; - lClient.OID.AssignFromTIQuery('OID',Query); - lClient.ClientName:= Query.FieldAsString['Client_Name']; - lClient.ClientID:= Query.FieldAsString['Client_ID']; - lClient.ObjectState:= posClean; - TClients(Visited).Add(lClient); -end; - -procedure TVisClient_Read.SetupParams; -begin - // Do nothing -end; - -{ TVisClient_Create } - -function TVisClient_Create.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posCreate); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Create.Init; -begin - Query.SQLText:= - 'Insert into Client (OID, Client_Name, Client_ID) ' + - 'Values ' + - '(:OID,:Client_Name,:Client_ID)'; -end; - -procedure TVisClient_Create.SetupParams; -var - lData: TClient; -begin - lData:= Visited as TClient; - lData.OID.AssignToTIQuery('OID', Query); - Query.ParamAsString['Client_Name']:= lData.ClientName; - Query.ParamAsString['Client_ID']:= lData.ClientID; -end; - -{ TVisClient_Update } - -function TVisClient_Update.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posUpdate); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Update.Init; -begin - Query.SQLText:= - 'Update Client Set ' + - ' Client_Name =:Client_Name ' + - ' ,Client_ID =:Client_ID ' + - 'where ' + - ' OID =:OID'; -end; - -procedure TVisClient_Update.SetupParams; -var - lData: TClient; -begin - lData:= Visited as TClient; - lData.OID.AssignToTIQuery('OID', Query); - Query.ParamAsString['Client_Name']:= lData.ClientName; - Query.ParamAsString['Client_ID']:= lData.ClientID; -end; - -{ TVisClient_Delete } - -function TVisClient_Delete.AcceptVisitor: boolean; -begin - result:= (Visited is TClient) and - (Visited.ObjectState = posDelete); - Log([ClassName, Visited.ClassName, Visited.ObjectStateAsString, Result ]); -end; - -procedure TVisClient_Delete.Init; -begin - Query.SQLText:= - 'delete from client where oid =:oid'; -end; - -procedure TVisClient_Delete.SetupParams; -var - lData: TClient; -begin - lData:= Visited as TClient; - lData.OID.AssignToTIQuery('OID', Query); -end; - -end. - diff --git a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi b/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi deleted file mode 100644 index 04d2b379..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <MainUnitHasCreateFormStatements Value="False"/> - <MainUnitHasTitleStatement Value="False"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - </RequiredPackages> - <Units Count="6"> - <Unit0> - <Filename Value="demo_08.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="demo_08"/> - </Unit0> - <Unit1> - <Filename Value="frm_main.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_main"/> - </Unit1> - <Unit2> - <Filename Value="Client_HardCodedVisitors_Svr.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Client_HardCodedVisitors_Svr"/> - </Unit2> - <Unit3> - <Filename Value="Client_AutoMap_Svr.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Client_AutoMap_Svr"/> - </Unit3> - <Unit4> - <Filename Value="Client_BOM.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Client_BOM"/> - </Unit4> - <Unit5> - <Filename Value="Client_DBIndependentVisitors_Svr.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Client_DBIndependentVisitors_Svr"/> - </Unit5> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <AllowLabel Value="False"/> - <CPPInline Value="False"/> - </SyntaxOptions> - </Parsing> - <Other> - <CustomOptions Value="-dUseCThreads"/> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpr b/extras/tiopf/demos/Demo_08_Collection/demo_08.lpr deleted file mode 100644 index c1d14863..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpr +++ /dev/null @@ -1,65 +0,0 @@ -program demo_08; - -{$mode objfpc}{$H+} - -// Which persistence layer to activate. (Un)Comment the one you want to use -{.$define UseFBL} -{$define UseSqldbIB} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, SysUtils, fpg_main, frm_main, - Client_DBIndependentVisitors_Svr, Client_BOM, - Client_AutoMap_Svr, Client_HardCodedVisitors_Svr, tiOPFManager, - tiConstants{, tiLog, tiLogToConsole}; - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - - {$IFDEF UseFBL} - if GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(cTIPersistFBL) = nil then - raise Exception.Create('The system failed to find the <' + cTIPersistFBL + '> persistence layer') - else - GTIOPFManager.DefaultPersistenceLayerName := cTIPersistFBL; - {$ENDIF} - {$IFDEF UseSqldbIB} - if GTIOPFManager.PersistenceLayers.FindByPersistenceLayerName(cTIPersistSqldbIB) = nil then - raise Exception.Create('The system failed to find the <' + cTIPersistSqldbIB + '> persistence layer') - else - GTIOPFManager.DefaultPersistenceLayerName := cTIPersistSqldbIB; - {$ENDIF} - - { Change the connection string to suite your database location } - // ** Remote connection - //gTIOPFManager.ConnectDatabase('192.168.0.54|/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - // ** Local connection - gTIOPFManager.ConnectDatabase('/home/graemeg/programming/data/tiopf.fdb', 'sysdba', 'masterkey'); - - - { Which persistence mechanism do you want to use? Uncomment one. } - Client_AutoMap_Svr.RegisterMappings; - //Client_HardCodedVisitors_Svr.RegisterVisitors; - //Client_DBIndependentVisitors_Svr.RegisterVisitors; - - - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - gTIOPFManager.DisconnectDatabase; - gTIOPFManager.Terminate; - end; -end; - -begin - MainProc; -end. - - diff --git a/extras/tiopf/demos/Demo_08_Collection/frm_main.pas b/extras/tiopf/demos/Demo_08_Collection/frm_main.pas deleted file mode 100644 index 34241b17..00000000 --- a/extras/tiopf/demos/Demo_08_Collection/frm_main.pas +++ /dev/null @@ -1,332 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel, Client_BOM, tiModelMediator; - -type - - TMainForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: MainForm} - lblName1: TfpgLabel; - lblName2: TfpgLabel; - lblName3: TfpgLabel; - edtOID: TfpgEdit; - edtClientName: TfpgEdit; - edtClientID: TfpgEdit; - btnInsertRow: TfpgButton; - btnDeleteRow: TfpgButton; - btnShow: TfpgButton; - btnSave: TfpgButton; - btnRead: TfpgButton; - grdCollection: TfpgStringGrid; - {@VFD_HEAD_END: MainForm} - FClients: TClients; - FMediator: TtiModelMediator; - procedure MainFormShow(Sender: TObject); - procedure CreateTable; - procedure DropTable; - procedure CreateMediators; - function TableExists: boolean; - procedure btnInsertRowClick(Sender: TObject); - procedure btnDeleteRowClick(Sender: TObject); - procedure btnSaveClick(Sender: TObject); - procedure btnReadClick(Sender: TObject); - procedure btnShowClick(Sender: TObject); - public - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiQuery - ,tiOIDGUID - ,tiOPFManager - ,tiDBConnectionPool - ,tiOID - ,tiDialogs - ,tiConstants - ,tiBaseMediator - ,tiListMediators - ,tiLog - ; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.MainFormShow(Sender: TObject); -begin - Log('Creating mediators'); - CreateMediators; - - // Drop and re-create to be sure we start with the correct structure - Log('Testing if table exists'); - if TableExists then - begin - Log(' Should we drop and recreate the tables'); - if TfpgMessageDialog.Question(ApplicationName, 'Must we delete existing data?', mbYesNo) = mbYes then - begin - DropTable; - CreateTable; - end; - end - else - CreateTable; -end; - -procedure TMainForm.CreateTable; -var - LTableMetaData: TtiDBMetaDataTable; -begin - LTableMetaData := TtiDBMetaDataTable.Create; - try - LTableMetaData.Name:= 'Client'; - LTableMetaData.AddField('OID', qfkString, 36); // Using GUID OIDs - LTableMetaData.AddField('Client_Name', qfkString, 200); - LTableMetaData.AddField('Client_ID', qfkString, 9); - gTIOPFManager.CreateTable(LTableMetaData); - finally - LTableMetaData.Free; - end; -end; - -procedure TMainForm.DropTable; -begin - gTIOPFManager.DropTable('Client'); -end; - -procedure TMainForm.CreateMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddComposite('ClientName(200,"Client name");ClientID(80,"Client ID")', grdCollection); - end; - FMediator.Subject := FClients; - FMediator.Active := True; - - //FmedClients := TClient_StringGrid_Mediator.CreateCustom(FClients, grdCollection, 'ClientName(200,"Client name");ClientID(80,"Client ID")'); - //FClients.NotifyObservers; - - //LV.AddColumn(LVDeriveOID, 'OID', 270); - //LV.AddColumn('ClientName', vttkString, 'Client name', 200); - //LV.AddColumn('ClientID', vttkString, 'Client ID', 80); - //LV.Data:= FClients; -end; - -function TMainForm.TableExists: boolean; -var - LDBMetaData: TtiDBMetaData; - LDatabase: TtiDatabase; -begin - LDBMetaData := TtiDBMetaData.Create; - try - LDatabase := gTIOPFManager.DefaultDBConnectionPool.Lock; - try -// Log(' Reading meta data of tables'); - LDatabase.ReadMetaDataTables(LDBMetaData); -// log(' Finding the table <Client>'); - result := LDBMetaData.FindByTableName('Client') <> nil; - finally - gTIOPFManager.DefaultDBConnectionPool.UnLock(LDatabase); - end; - finally - LDBMetaData.Free; - end; -end; - -procedure TMainForm.btnInsertRowClick(Sender: TObject); -var - LClient: TClient; -begin - LClient:= TClient.CreateNew; - FClients.Add(LClient); -end; - -procedure TMainForm.btnDeleteRowClick(Sender: TObject); -begin - //if LV.SelectedData <> nil then - //LV.SelectedData.Deleted:= true; - //LV.Refresh; -end; - -procedure TMainForm.btnSaveClick(Sender: TObject); -begin - FClients.Save; -end; - -procedure TMainForm.btnReadClick(Sender: TObject); -begin - FMediator.Active := False; - FClients.Clear; - FClients.Read; - FMediator.Active := True; -end; - -procedure TMainForm.btnShowClick(Sender: TObject); -begin - tiShowString(FClients.AsDebugString); -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - WindowTitle := 'Connected to ' + gTIOPFManager.DefaultDBConnectionName; - FClients := TClients.Create; - OnShow := @MainFormShow; -end; - -destructor TMainForm.Destroy; -begin - FMediator.Active := False; - FClients.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(304, 254, 565, 250); - WindowTitle := 'Collection demo'; - WindowPosition := wpScreenCenter; - Sizeable := False; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(8, 12, 80, 16); - Text := 'OID:'; - FontDesc := '#Label1'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 36, 80, 16); - Text := 'Client Name:'; - FontDesc := '#Label1'; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(8, 60, 80, 16); - Text := 'Client ID:'; - FontDesc := '#Label1'; - end; - - edtOID := TfpgEdit.Create(self); - with edtOID do - begin - Name := 'edtOID'; - SetPosition(88, 8, 172, 22); - Text := ''; - FontDesc := '#Edit1'; - end; - - edtClientName := TfpgEdit.Create(self); - with edtClientName do - begin - Name := 'edtClientName'; - SetPosition(88, 32, 172, 22); - Text := ''; - FontDesc := '#Edit1'; - end; - - edtClientID := TfpgEdit.Create(self); - with edtClientID do - begin - Name := 'edtClientID'; - SetPosition(88, 56, 172, 22); - Text := ''; - FontDesc := '#Edit1'; - end; - - btnInsertRow := TfpgButton.Create(self); - with btnInsertRow do - begin - Name := 'btnInsertRow'; - SetPosition(268, 8, 143, 24); - Text := 'Insert object into list'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnInsertRowClick; - end; - - btnDeleteRow := TfpgButton.Create(self); - with btnDeleteRow do - begin - Name := 'btnDeleteRow'; - SetPosition(268, 36, 143, 24); - Text := 'Delete object in list'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnDeleteRowClick; - end; - - btnShow := TfpgButton.Create(self); - with btnShow do - begin - Name := 'btnShow'; - SetPosition(416, 8, 143, 24); - Text := 'Show Objects in list'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnShowClick; - end; - - btnSave := TfpgButton.Create(self); - with btnSave do - begin - Name := 'btnSave'; - SetPosition(416, 36, 143, 24); - Text := 'Save'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnSaveClick; - end; - - btnRead := TfpgButton.Create(self); - with btnRead do - begin - Name := 'btnRead'; - SetPosition(416, 64, 143, 24); - Text := 'Read list from DB'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnReadClick; - end; - - grdCollection := TfpgStringGrid.Create(self); - with grdCollection do - begin - Name := 'grdCollection'; - SetPosition(8, 96, 552, 148); - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - end; - - {@VFD_BODY_END: MainForm} -end; - -initialization - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TClients); - -end. diff --git a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi b/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi deleted file mode 100644 index ece8df27..00000000 --- a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - </RequiredPackages> - <Units Count="5"> - <Unit0> - <Filename Value="demo_listmediators.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="demo_listmediators"/> - </Unit0> - <Unit1> - <Filename Value="frmMain.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmMain"/> - </Unit1> - <Unit2> - <Filename Value="../Common/Model.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model"/> - </Unit2> - <Unit3> - <Filename Value="../Common/Model_View.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model_View"/> - </Unit3> - <Unit4> - <Filename Value="../Common/Constants.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Constants"/> - </Unit4> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="../Common/"/> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <CStyleOperator Value="False"/> - </SyntaxOptions> - </Parsing> - <CodeGeneration> - <SmartLinkUnit Value="True"/> - </CodeGeneration> - <Linking> - <LinkSmart Value="True"/> - </Linking> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas b/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas deleted file mode 100644 index f186340b..00000000 --- a/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas +++ /dev/null @@ -1,277 +0,0 @@ -unit frmMain; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_widget, fpg_form, fpg_button, - fpg_grid, fpg_checkbox, fpg_panel, fpg_listview, fpg_listbox, fpg_combobox, - Model, tiModelMediator, tiMediators; - -type - - TMainForm = class(TfpgForm) - private - { The object we will be working with. } - FPersonList: TPersonList; - FMediator: TtiModelMediator; - medCombo: TtiComboBoxMediatorView; - procedure btnViaCodeChangeClick(Sender: TObject); - procedure btnQuitClicked(Sender: TObject); - procedure btnViaCodeAddClick(Sender: TObject); - procedure btnShowModelClick(Sender: TObject); - procedure btnShowDeletedClick(Sender: TObject); - procedure SetupMediators; - public - {@VFD_HEAD_BEGIN: MainForm} - lvName1: TfpgListView; - grdName1: TfpgStringGrid; - pnlName1: TfpgPanel; - btnName1: TfpgButton; - btnName2: TfpgButton; - btnName3: TfpgButton; - btnName4: TfpgButton; - btnQuit: TfpgButton; - cbName1: TfpgCheckBox; - lstName1: TfpgListBox; - cbName2: TfpgComboBox; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterConstruction; override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiBaseMediator, tiListMediators, tiObject, tiDialogs; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.btnViaCodeChangeClick(Sender: TObject); -begin - { The BeginUpdate/EndUpdate will let the Item notify its observers - only once, even though two change where made. - Note: - This is for observers to the Item, not the List that the Item belongs to! } - FPersonList.Items[1].BeginUpdate; - FPersonList.Items[1].Name := 'I have changed via code'; - FPersonList.Items[1].Age := 99; - FPersonList.Items[1].EndUpdate; - { This notifies observers of the List, that something has changed. } - FPersonList.NotifyObservers; -end; - -procedure TMainForm.btnQuitClicked(Sender: TObject); -begin - Close; -end; - -procedure TMainForm.btnViaCodeAddClick(Sender: TObject); -var - lData: TPerson; -begin - lData := TPerson.Create; - lData.Name := 'I am new'; - lData.Age := 44; - FPersonList.Add(lData); -end; - -procedure TMainForm.btnShowModelClick(Sender: TObject); -begin - tiShowString(FPersonList.AsDebugString); -end; - -procedure TMainForm.btnShowDeletedClick(Sender: TObject); -var - med: TtiMediatorView; -begin - med := FMediator.FindByComponent(grdName1).Mediator; - tiShowString(TtiStringGridMediatorView(med).SelectedObject.AsDebugString); -end; - -procedure TMainForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.Name := 'DemoFormMediator'; - FMediator.AddComposite('Name(150,"Name",<);Age(50,"Age",>);GenderGUI(80,"Gender",|)', grdName1); -// FMediator.AddComposite('Name(150,"Name",<);Age(75,"Age",>);GenderGUI(50,"Gender",|)', lvName1); - FMediator.AddProperty('Name', lstName1); - end; - FMediator.Subject := FPersonList; - FMediator.Active := True; - -// medCombo := TMediatorComboBoxView.CreateCustom(cbName1, FPerson); -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - FPersonList := GeneratePersonList; -end; - -destructor TMainForm.Destroy; -begin - FMediator.Active := False; - FPersonList.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterConstruction; -begin - inherited AfterConstruction; - SetupMediators; - FPersonList.NotifyObservers; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(298, 184, 617, 358); - WindowTitle := 'Demo 20: ListMediators'; - Sizeable := False; - - lvName1 := TfpgListView.Create(self); - with lvName1 do - begin - Name := 'lvName1'; - SetPosition(8, 52, 292, 112); - ShowHeaders := True; - end; - - grdName1 := TfpgStringGrid.Create(self); - with grdName1 do - begin - Name := 'grdName1'; - SetPosition(316, 52, 292, 220); - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - TabOrder := 1; - Tag := 99; - end; - - pnlName1 := TfpgPanel.Create(self); - with pnlName1 do - begin - Name := 'pnlName1'; - SetPosition(8, 12, 600, 28); - Anchors := [anLeft,anRight,anTop]; - Alignment := taLeftJustify; - Margin := 8; - Text := 'ListMediator Demo'; - FontDesc := '#Label2'; - TextColor := clWhite; - BackGroundColor := clDarkBlue; - end; - - btnName1 := TfpgButton.Create(self); - with btnName1 do - begin - Name := 'btnName1'; - SetPosition(8, 296, 120, 24); - Text := 'Add via Code'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 3; - OnClick := @btnViaCodeAddClick; - end; - - btnName2 := TfpgButton.Create(self); - with btnName2 do - begin - Name := 'btnName2'; - SetPosition(8, 324, 120, 24); - Text := 'Change via Code'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 4; - OnClick := @btnViaCodeChangeClick; - end; - - btnName3 := TfpgButton.Create(self); - with btnName3 do - begin - Name := 'btnName3'; - SetPosition(132, 324, 96, 24); - Text := 'Show Model'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 5; - OnClick := @btnShowModelClick; - end; - - btnName4 := TfpgButton.Create(self); - with btnName4 do - begin - Name := 'btnName4'; - SetPosition(232, 324, 80, 24); - Text := 'Delete'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 6; - OnClick := @btnShowDeletedClick; - end; - - btnQuit := TfpgButton.Create(self); - with btnQuit do - begin - Name := 'btnQuit'; - SetPosition(528, 324, 80, 24); - Text := 'Quit'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 7; - OnClick := @btnQuitClicked; - end; - - cbName1 := TfpgCheckBox.Create(self); - with cbName1 do - begin - Name := 'cbName1'; - SetPosition(148, 296, 120, 20); - FontDesc := '#Label1'; - TabOrder := 8; - Text := 'Show Deleted'; - OnClick := @btnShowDeletedClick; - end; - - lstName1 := TfpgListBox.Create(self); - with lstName1 do - begin - Name := 'lstName1'; - SetPosition(8, 168, 228, 120); - FontDesc := '#List'; - TabOrder := 9; - end; - - cbName2 := TfpgComboBox.Create(self); - with cbName2 do - begin - Name := 'cbName2'; - SetPosition(320, 276, 204, 22); - FontDesc := '#List'; - TabOrder := 10; - end; - - {@VFD_BODY_END: MainForm} -end; - - -initialization - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TtiObjectList); -// gMediatorManager.RegisterMediator(TListBoxMediator, TPersonList); -// gMediatorManager.RegisterMediator(TListViewMediator, TtiObjectList); - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/_readme.txt b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/_readme.txt deleted file mode 100644 index 51897ba0..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/_readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -ToDo: - This demo must be modified for the latest structure in Adrs_bom.pas - - This demo implements a Address Book. It uses standard components - and the Model-GUI-Mediator pattern to make those components - object-aware. - - This demo is still work in progress... Not complete! - - - Graeme Geldenhuys - - - diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/contactmanager.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/contactmanager.pas deleted file mode 100644 index c8518f30..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/contactmanager.pas +++ /dev/null @@ -1,260 +0,0 @@ -unit contactmanager; - -{$IFDEF FPC} - {$mode objfpc}{$H+} -{$ENDIF} - -interface - -uses - model; - -type - - { TContactManager } - - TContactManager = class(TMarkObject) - private - FAddressTypeList: TAddressTypeList; - FCityList: TCityList; - FContactList: TContactList; - FCountryList: TCountryList; - procedure PopulateCountries; - procedure PopulateCities; - procedure PopulateAddressTypes; - function GenPhone: string; - public - constructor Create; override; - destructor Destroy; override; - procedure PopulateContacts; - published - property AddressTypeList: TAddressTypeList read FAddressTypeList; - property CountryList: TCountryList read FCountryList; - property CityList: TCityList read FCityList; - property ContactList: TContactList read FContactList; - end; - - -// Global singleton -function gContactManager: TContactManager; - - -implementation - -uses - SysUtils, tiObject; - -var - uContactManager: TContactManager; - -const - LastNames: array[1..10] of string = ('Geldenhuys', 'Botha', 'Johnson', 'Fourie', - 'Louw', 'Bougas', 'van der Mescht', 'Waskanski', 'Welgens', 'Viljoen'); - - FirstNames: array[1..10] of string = ('Graeme', 'Johan', 'Debbie', 'Freda', - 'Jack', 'Ryno', 'Dirkus', 'Angela', 'Denise', 'Daniel'); - - StreetNames: array[1..11] of string = ('Stellenberg Rd', 'Stellendal Rd', - 'Abelia', 'Main Rd', 'Links Drive', 'Short Street', - 'Long Street', 'Loop Street', 'Hillside Rd', 'Mountain Rd', 'Beach Drive'); - -function gContactManager: TContactManager; -begin - if not Assigned(uContactManager) then - uContactManager:= TContactManager.Create; - result:= uContactManager; -end; - -{ TContactManager } - -procedure TContactManager.PopulateCountries; -var - i: integer; -begin - FCountryList.Add(TCountry.CreateNew('za', 'South Africa')); - FCountryList.Add(TCountry.CreateNew('gb', 'Great Britain')); - FCountryList.Add(TCountry.CreateNew('uk', 'Ukrain')); - FCountryList.Add(TCountry.CreateNew('fr', 'France')); - FCountryList.Add(TCountry.CreateNew('us', 'United States')); - FCountryList.Add(TCountry.CreateNew('gr', 'Germany')); - - { reset ObjectState property } - for i := 0 to FCountryList.Count - 1 do - FCountryList[i].ObjectState := posClean; -end; - -procedure TContactManager.PopulateCities; -var - c: TCity; - i: integer; -begin - c:= TCity.CreateNew; - c.Name:= 'Somerset West'; - c.ZIP := '7130'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['za'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Cape Town'; - c.ZIP := '8000'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['za'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Pretoria'; - c.ZIP := '0001'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['za'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Durban'; - c.ZIP := '2000'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['za'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'London'; - c.ZIP := 'EC9 5NW'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['gb'], True)); - - FCityList.Add(c); - c:= TCity.CreateNew; - c.Name:= 'Watford'; - c.ZIP := 'NW9 7BJ'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['gb'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Frankfurt'; - c.ZIP := 'FK2000'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['gr'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'New York'; - c.ZIP := 'NY2008'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['us'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'San Fransisco'; - c.ZIP := 'SF2500'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['us'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Paris'; - c.ZIP := 'PRS007'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['fr'], True)); - FCityList.Add(c); - - c:= TCity.CreateNew; - c.Name:= 'Big City'; - c.ZIP := 'BC5 7WN'; - c.Country:= TCountry(FCountryList.FindByProps(['ISO'], ['uk'], True)); - FCityList.Add(c); - - { reset ObjectState property } - for i := 0 to FCityList.Count - 1 do - FCityList[i].ObjectState := posClean; -end; - -procedure TContactManager.PopulateAddressTypes; -var - a: TAddressType; - i: integer; -begin - a := TAddressType.CreateNew; - a.Name := 'Home'; - FAddressTypeList.Add(a); - - a := TAddressType.CreateNew; - a.Name := 'Work'; - FAddressTypeList.Add(a); - - a := TAddressType.CreateNew; - a.Name := 'Postal'; - FAddressTypeList.Add(a); - - { reset ObjectState property } - for i := 0 to FAddressTypeList.Count - 1 do - FAddressTypeList[i].ObjectState := posClean; -end; - -function TContactManager.GenPhone: string; -begin - result:= '+27 ' + IntToStr(Random(9)) + IntToStr(Random(9)) + ' ' - + IntToStr(Random(9)) + IntToStr(Random(9)) + IntToStr(Random(9)) + '-' - + IntToStr(Random(9)) + IntToStr(Random(9)) + IntToStr(Random(9)) + IntToStr(Random(9)); -end; - -constructor TContactManager.Create; -begin - inherited Create; - FAddressTypeList := TAddressTypeList.Create; - FAddressTypeList.Owner := self; - - FCountryList := TCountryList.Create; - FCountryList.Owner := self; - - FCityList := TCityList.Create; - FCityList.Owner := self; - - FContactList := TContactList.Create; - FContactList.Owner := self; -end; - -destructor TContactManager.Destroy; -begin - FContactList.Free; - FCityList.Free; - FCountryList.Free; - FAddressTypeList.Free; - inherited Destroy; -end; - -procedure TContactManager.PopulateContacts; -var - C: TContact; - I,J: Integer; - A: TAddress; -begin - PopulateCountries; - PopulateCities; - PopulateAddressTypes; - for I := 1 to 10 do - begin - C:= TContact.CreateNew; - C.FirstName:= FirstNames[I]; - C.LastName := LastNames[I]; - C.Mobile := GenPhone; - C.Email := LowerCase(FirstNames[i])+ '@freepascal.org'; - for J:= 1 to 1+Random(2) do - begin - A:= TAddress.CreateNew; - A.AddressType := FAddressTypeList[Random(3)]; - A.Street := StreetNames[1+Random(10)]; - A.Nr := Random(100)+1; - A.City := FCityList[Random(10)]; - A.Fax := GenPhone; - A.Telephone1:= GenPhone; - If Random(2)>0 then - A.Telephone2:= GenPhone; - A.Dirty := False; - C.AddressList.Add(A); - end; - C.Comments := 'My name is ' + C.FirstName + '.'; - C.ObjectState := posClean; - FContactList.Add(C); - end; -end; - - -initialization - uContactManager:= nil; - -finalization - uContactManager.Free; - -end. - diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi deleted file mode 100644 index 6f88bb12..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - </RequiredPackages> - <Units Count="9"> - <Unit0> - <Filename Value="demo_adrsbook_mgm.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="demo_adrsbook_mgm"/> - </Unit0> - <Unit1> - <Filename Value="contactmanager.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="contactmanager"/> - </Unit1> - <Unit2> - <Filename Value="model.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="model"/> - </Unit2> - <Unit3> - <Filename Value="frmmain.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmmain"/> - </Unit3> - <Unit4> - <Filename Value="frmcontactmaint.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmContactMaint"/> - </Unit4> - <Unit5> - <Filename Value="frmcitylist.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmCityList"/> - </Unit5> - <Unit6> - <Filename Value="frmcitymaint.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmCityMaint"/> - </Unit6> - <Unit7> - <Filename Value="frmcountrylist.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmCountryList"/> - </Unit7> - <Unit8> - <Filename Value="frmaddressmaint.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmAddressMaint"/> - </Unit8> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <CStyleOperator Value="False"/> - <AllowLabel Value="False"/> - <CPPInline Value="False"/> - </SyntaxOptions> - </Parsing> - <Other> - <CustomOptions Value=" -"/> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpr b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpr deleted file mode 100644 index d5e48414..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpr +++ /dev/null @@ -1,33 +0,0 @@ -program demo_adrsbook_mgm; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_main, frmmain, frmcontactmaint, frmCityList, frmcitymaint, - frmcountrylist, frmaddressmaint; - - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - end; -end; - -begin - Randomize; - MainProc; -end. - - diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas deleted file mode 100644 index 931b36c5..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas +++ /dev/null @@ -1,266 +0,0 @@ -unit frmAddressMaint; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, fpg_combobox, - fpg_dialogs, fpg_menu, - model, tiModelMediator; - -type - TAddressEditForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: AddressEditForm} - cbType: TfpgComboBox; - edNo: TfpgEdit; - edStreet: TfpgEdit; - cbCity: TfpgComboBox; - edPhone1: TfpgEdit; - edPhone2: TfpgEdit; - edFax: TfpgEdit; - lblName1: TfpgLabel; - lblName2: TfpgLabel; - lblName3: TfpgLabel; - lblName4: TfpgLabel; - lblName5: TfpgLabel; - lblName6: TfpgLabel; - lblName7: TfpgLabel; - btnSave: TfpgButton; - btnCancel: TfpgButton; - {@VFD_HEAD_END: AddressEditForm} - FData: TAddress; - FMediator: TtiModelMediator; - procedure SetData(const AValue: TAddress); - procedure SetupMediators; - public - procedure AfterCreate; override; - property Data: TAddress read FData write SetData; - end; - -{@VFD_NEWFORM_DECL} - -function EditAddress(AData: TAddress): Boolean; - -implementation - -uses - contactmanager; - - -function EditAddress(AData: TAddress): Boolean; -var - frm: TAddressEditForm; -begin - frm:= TAddressEditForm.Create(nil); - try - frm.SetData(AData); - result:= frm.ShowModal = mrOK; - finally - frm.Free; - end; -end; - -{@VFD_NEWFORM_IMPL} - -procedure TAddressEditForm.SetData(const AValue: TAddress); -begin - if FData=AValue then exit; - FData:=AValue; - SetupMediators; -end; - -procedure TAddressEditForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddProperty('AddressType', cbType).ValueList := gContactManager.AddressTypeList; - FMediator.AddProperty('Nr', edNo); - FMediator.AddProperty('Street', edStreet); - FMediator.AddProperty('City', cbCity).ValueList := gContactManager.CityList; - FMediator.AddProperty('Telephone1', edPhone1); - FMediator.AddProperty('Telephone2', edPhone2); - FMediator.AddProperty('Fax', edFax); - end; - FMediator.Subject := FData; - FMediator.Active := True; -end; - -procedure TAddressEditForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: AddressEditForm} - Name := 'AddressEditForm'; - SetPosition(300, 231, 296, 282); - WindowTitle := 'Address Edit Form'; - - cbType := TfpgComboBox.Create(self); - with cbType do - begin - Name := 'cbType'; - SetPosition(8, 24, 272, 22); - FontDesc := '#List'; - end; - - edNo := TfpgEdit.Create(self); - with edNo do - begin - Name := 'edNo'; - SetPosition(8, 68, 56, 22); - TabOrder := 1; - Text := ''; - FontDesc := '#Edit1'; - end; - - edStreet := TfpgEdit.Create(self); - with edStreet do - begin - Name := 'edStreet'; - SetPosition(76, 68, 204, 22); - TabOrder := 2; - Text := ''; - FontDesc := '#Edit1'; - end; - - cbCity := TfpgComboBox.Create(self); - with cbCity do - begin - Name := 'cbCity'; - SetPosition(8, 112, 272, 22); - FontDesc := '#List'; - TabOrder := 3; - end; - - edPhone1 := TfpgEdit.Create(self); - with edPhone1 do - begin - Name := 'edPhone1'; - SetPosition(8, 160, 120, 22); - TabOrder := 4; - Text := ''; - FontDesc := '#Edit1'; - end; - - edPhone2 := TfpgEdit.Create(self); - with edPhone2 do - begin - Name := 'edPhone2'; - SetPosition(160, 160, 120, 22); - TabOrder := 5; - Text := ''; - FontDesc := '#Edit1'; - end; - - edFax := TfpgEdit.Create(self); - with edFax do - begin - Name := 'edFax'; - SetPosition(8, 204, 120, 22); - TabOrder := 6; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(76, 52, 120, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Street:'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 52, 60, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Number:'; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(8, 144, 120, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Telephone #1:'; - end; - - lblName4 := TfpgLabel.Create(self); - with lblName4 do - begin - Name := 'lblName4'; - SetPosition(160, 144, 112, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Telephone #2:'; - end; - - lblName5 := TfpgLabel.Create(self); - with lblName5 do - begin - Name := 'lblName5'; - SetPosition(8, 188, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Fax:'; - end; - - lblName6 := TfpgLabel.Create(self); - with lblName6 do - begin - Name := 'lblName6'; - SetPosition(8, 8, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Type:'; - end; - - lblName7 := TfpgLabel.Create(self); - with lblName7 do - begin - Name := 'lblName7'; - SetPosition(8, 96, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'City:'; - end; - - btnSave := TfpgButton.Create(self); - with btnSave do - begin - Name := 'btnSave'; - SetPosition(124, 248, 80, 24); - Text := 'Save'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 7; - ModalResult := mrOK; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(208, 248, 80, 24); - Text := 'Cancel'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 8; - ModalResult := mrCancel; - end; - - {@VFD_BODY_END: AddressEditForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas deleted file mode 100644 index 522362d1..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas +++ /dev/null @@ -1,173 +0,0 @@ -unit frmCityList; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, - fpg_widget, fpg_form, fpg_button, - fpg_grid, fpg_dialogs, fpg_menu, - fpg_panel, - tiModelMediator, model; - -type - - TCityListForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: CityListForm} - bvlName1: TfpgBevel; - btnAdd: TfpgButton; - btnEdit: TfpgButton; - btnDelete: TfpgButton; - grdName1: TfpgStringGrid; - btnCancel: TfpgButton; - {@VFD_HEAD_END: CityListForm} - FData: TCityList; - FMediator: TtiModelMediator; - procedure SetData(const AValue: TCityList); - procedure SetupMediators; - procedure btnEditClicked(Sender: TObject); - public - procedure AfterCreate; override; - property Data: TCityList read FData write SetData; - end; - -{@VFD_NEWFORM_DECL} - -procedure ShowCities(const AList: TCityList); - - -implementation - -uses - tiListMediators, frmCityMaint{, tiDialogs}; - - -procedure ShowCities(const AList: TCityList); -var - frm: TCityListForm; -begin - frm := TCityListForm.Create(nil); - try - frm.SetData(AList); - frm.ShowModal; - finally; - frm.Free; - end; -end; - -{@VFD_NEWFORM_IMPL} - -procedure TCityListForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddComposite('Name(110);Zip(80);CountryAsString(150)', grdName1); - end; - FMediator.Subject := FData; - FMediator.Active := True; -end; - -procedure TCityListForm.btnEditClicked(Sender: TObject); -var - c: TCity; -begin - c := TCity(TtiStringGridMediatorView(FMediator.FindByComponent(grdName1).Mediator).SelectedObject); -// tiShowString(c.AsDebugString); - - if not Assigned(c) then - Exit; //==> - - if EditCity(c) then - begin - // we can save contact here - end; -end; - -procedure TCityListForm.SetData(const AValue: TCityList); -begin - if FData=AValue then exit; - FData:=AValue; - SetupMediators; -end; - -procedure TCityListForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: CityListForm} - Name := 'CityListForm'; - SetPosition(412, 278, 421, 315); - WindowTitle := 'City Listing'; - - bvlName1 := TfpgBevel.Create(self); - with bvlName1 do - begin - Name := 'bvlName1'; - SetPosition(0, 0, 420, 36); - Anchors := [anLeft,anRight,anTop]; - Shape := bsSpacer; - end; - - btnAdd := TfpgButton.Create(bvlName1); - with btnAdd do - begin - Name := 'btnAdd'; - SetPosition(12, 4, 52, 24); - Text := 'Add'; - FontDesc := '#Label1'; - ImageName := ''; - Enabled := False; - end; - - btnEdit := TfpgButton.Create(bvlName1); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(68, 4, 52, 24); - Text := 'Edit'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 1; - OnClick := @btnEditClicked; - end; - - btnDelete := TfpgButton.Create(bvlName1); - with btnDelete do - begin - Name := 'btnDelete'; - SetPosition(124, 4, 52, 24); - Text := 'Delete'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 2; - Enabled := False; - end; - - grdName1 := TfpgStringGrid.Create(self); - with grdName1 do - begin - Name := 'grdName1'; - SetPosition(8, 40, 404, 220); - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - TabOrder := 1; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(332, 276, 80, 24); - Text := 'Cancel'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 2; - ModalResult := mrOK; - end; - - {@VFD_BODY_END: CityListForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas deleted file mode 100644 index 1b6f27f7..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas +++ /dev/null @@ -1,200 +0,0 @@ -unit frmCityMaint; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_dialogs, fpg_combobox, - model, tiModelMediator; - -type - - TCityEditForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: CityEditForm} - lblName1: TfpgLabel; - edName: TfpgEdit; - lblName2: TfpgLabel; - edZIP: TfpgEdit; - lblName3: TfpgLabel; - cbCountry: TfpgComboBox; - btnSave: TfpgButton; - btnCancel: TfpgButton; - btnDebug: TfpgButton; - {@VFD_HEAD_END: CityEditForm} - FMediator: TtiModelMediator; - FData: TCity; - procedure SetData(const AValue: TCity); - procedure SetupMediators; - procedure btnDebugClicked(Sender: TObject); - public - procedure AfterCreate; override; - property Data: TCity read FData write SetData; - end; - -{@VFD_NEWFORM_DECL} - -function EditCity(AData: TCity): boolean; - - -implementation - -uses - tiBaseMediator, contactmanager, typinfo, tiDialogs; - - -function EditCity(AData: TCity): boolean; -var - frm: TCityEditForm; -begin - frm:= TCityEditForm.Create(nil); - try - frm.SetData(AData); - result:= frm.ShowModal = mrOK; - finally - frm.Free; - end; -end; - -{@VFD_NEWFORM_IMPL} - -procedure TCityEditForm.SetData(const AValue: TCity); -begin - if FData=AValue then exit; - FData:=AValue; - SetupMediators; -end; - -procedure TCityEditForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddProperty('Name', edName); - FMediator.AddProperty('ZIP', edZIP); - FMediator.AddProperty('Country', cbCountry).ValueList := gContactManager.CountryList; - end; - FMediator.Subject := FData; - FMediator.Active := True; -end; - -procedure TCityEditForm.btnDebugClicked(Sender: TObject); -begin - tiShowString(FData.AsDebugString); -end; - -procedure TCityEditForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: CityEditForm} - Name := 'CityEditForm'; - SetPosition(673, 204, 350, 186); - WindowTitle := 'City Maintenance'; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(8, 8, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'City name:'; - end; - - edName := TfpgEdit.Create(self); - with edName do - begin - Name := 'edName'; - SetPosition(8, 24, 200, 22); - TabOrder := 1; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 52, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'ZIP code:'; - end; - - edZIP := TfpgEdit.Create(self); - with edZIP do - begin - Name := 'edZIP'; - SetPosition(8, 68, 120, 22); - TabOrder := 3; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(8, 96, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Country:'; - end; - - cbCountry := TfpgComboBox.Create(self); - with cbCountry do - begin - Name := 'cbCountry'; - SetPosition(8, 112, 200, 22); - FontDesc := '#List'; - TabOrder := 5; - end; - - btnSave := TfpgButton.Create(self); - with btnSave do - begin - Name := 'btnSave'; - SetPosition(182, 156, 80, 24); - Anchors := [anRight,anBottom]; - Text := 'Save'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 6; - ModalResult := mrOK; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(266, 156, 80, 24); - Anchors := [anRight,anBottom]; - Text := 'Cancel'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 7; - ModalResult := mrCancel; - end; - - btnDebug := TfpgButton.Create(self); - with btnDebug do - begin - Name := 'btnDebug'; - SetPosition(8, 156, 100, 24); - Text := 'Debug (Show)'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 8; - OnClick := @btnDebugClicked; - end; - - {@VFD_BODY_END: CityEditForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas deleted file mode 100644 index 8bd46e31..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas +++ /dev/null @@ -1,335 +0,0 @@ -unit frmContactMaint; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listview, fpg_memo, - model, tiModelMediator; - -type - - TContactEditForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: ContactEditForm} - lblName1: TfpgLabel; - edFName: TfpgEdit; - lblName2: TfpgLabel; - edLName: TfpgEdit; - lblName3: TfpgLabel; - edEmail: TfpgEdit; - lblName4: TfpgLabel; - edMobile: TfpgEdit; - lblName5: TfpgLabel; - meComments: TfpgMemo; - lblName6: TfpgLabel; - lvAddresses: TfpgListView; - btnSave: TfpgButton; - btnCancel: TfpgButton; - btnAdd: TfpgButton; - btnEdit: TfpgButton; - btnDelete: TfpgButton; - btnDebug: TfpgButton; - {@VFD_HEAD_END: ContactEditForm} - FData: TContact; - FMediator: TtiModelMediator; - FAdrsMediator: TtiModelMediator; - procedure SetData(const AValue: TContact); - procedure SetupMediators; - procedure btnDebugClicked(Sender: TObject); - procedure btnEditClicked(Sender: TObject); - public - procedure AfterCreate; override; - property Data: TContact read FData write SetData; - end; - -{@VFD_NEWFORM_DECL} - -function EditContact(AData: TContact): Boolean; - - -implementation - -uses - contactmanager, tiDialogs, frmAddressMaint, tiListMediators; - - -function EditContact(AData: TContact): Boolean; -var - frm: TContactEditForm; -begin - frm:= TContactEditForm.Create(nil); - try - frm.SetData(AData); - result:= frm.ShowModal = mrOK; - finally - frm.Free; - end; -end; - - -{@VFD_NEWFORM_IMPL} - -procedure TContactEditForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddProperty('FirstName', edFName); - FMediator.AddProperty('LastName', edLName); - FMediator.AddProperty('EMail', edEmail); - FMediator.AddProperty('Mobile', edMobile); - FMediator.AddProperty('Comments', meComments); - end; - FMediator.Subject := FData; - FMediator.Active := True; - - if not Assigned(FAdrsMediator) then - begin - FAdrsMediator := TtiModelMediator.Create(self); - FAdrsMediator.AddComposite({'AddressType.Name;}'AddressType4GUI(50,"Type");Nr;Street;Telephone1', lvAddresses); - end; - FAdrsMediator.Subject := FData.AddressList; - FAdrsMediator.Active := True; -end; - -procedure TContactEditForm.btnDebugClicked(Sender: TObject); -begin - tiShowString(FData.AsDebugString); -end; - -procedure TContactEditForm.btnEditClicked(Sender: TObject); -var - obj: TAddress; -begin - obj := TAddress(TtiListViewMediatorView(FAdrsMediator.FindByComponent(lvAddresses).Mediator).SelectedObject); - tiShowString(obj.AsDebugString); - - if not Assigned(obj) then - Exit; //==> - - if EditAddress(obj) then - begin - // do nothing - end; -end; - -procedure TContactEditForm.SetData(const AValue: TContact); -begin - if FData=AValue then exit; - FData:=AValue; - SetupMediators; -end; - -procedure TContactEditForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: ContactEditForm} - Name := 'ContactEditForm'; - SetPosition(513, 423, 537, 331); - WindowTitle := 'Contact Edit Form'; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(8, 8, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Firstname:'; - end; - - edFName := TfpgEdit.Create(self); - with edFName do - begin - Name := 'edFName'; - SetPosition(8, 24, 216, 22); - TabOrder := 1; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 52, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Lastname:'; - end; - - edLName := TfpgEdit.Create(self); - with edLName do - begin - Name := 'edLName'; - SetPosition(8, 68, 216, 22); - TabOrder := 3; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(8, 96, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'EMail:'; - end; - - edEmail := TfpgEdit.Create(self); - with edEmail do - begin - Name := 'edEmail'; - SetPosition(8, 112, 216, 22); - TabOrder := 5; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName4 := TfpgLabel.Create(self); - with lblName4 do - begin - Name := 'lblName4'; - SetPosition(8, 140, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Mobile:'; - end; - - edMobile := TfpgEdit.Create(self); - with edMobile do - begin - Name := 'edMobile'; - SetPosition(8, 156, 216, 22); - TabOrder := 7; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName5 := TfpgLabel.Create(self); - with lblName5 do - begin - Name := 'lblName5'; - SetPosition(8, 184, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Comments:'; - end; - - meComments := TfpgMemo.Create(self); - with meComments do - begin - Name := 'meComments'; - SetPosition(8, 200, 216, 80); - FontDesc := '#Edit1'; - TabOrder := 9; - Lines.text := 'Hello'; - end; - - lblName6 := TfpgLabel.Create(self); - with lblName6 do - begin - Name := 'lblName6'; - SetPosition(264, 8, 80, 16); - FontDesc := '#Label1'; - Hint := ''; - Text := 'Addresses:'; - end; - - lvAddresses := TfpgListView.Create(self); - with lvAddresses do - begin - Name := 'lvAddresses'; - SetPosition(264, 24, 260, 124); - ShowHeaders := True; - TabOrder := 11; - end; - - btnSave := TfpgButton.Create(self); - with btnSave do - begin - Name := 'btnSave'; - SetPosition(364, 300, 80, 24); - Text := 'Save'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 12; - ModalResult := mrOK; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(448, 300, 80, 24); - Text := 'Cancel'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 13; - ModalResult := mrCancel; - end; - - btnAdd := TfpgButton.Create(self); - with btnAdd do - begin - Name := 'btnAdd'; - SetPosition(264, 152, 52, 24); - Text := 'Add'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 14; - Enabled := False; - end; - - btnEdit := TfpgButton.Create(self); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(320, 152, 52, 24); - Text := 'Edit'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 15; - OnClick := @btnEditClicked; - end; - - btnDelete := TfpgButton.Create(self); - with btnDelete do - begin - Name := 'btnDelete'; - SetPosition(376, 152, 52, 24); - Text := 'Delete'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 16; - Enabled := False; - end; - - btnDebug := TfpgButton.Create(self); - with btnDebug do - begin - Name := 'btnDebug'; - SetPosition(8, 300, 100, 24); - Text := 'Debug (Show)'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 17; - OnClick := @btnDebugClicked; - end; - - {@VFD_BODY_END: ContactEditForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas deleted file mode 100644 index c9f54537..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas +++ /dev/null @@ -1,166 +0,0 @@ -unit frmCountryList; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, - fpg_widget, fpg_form, fpg_button, fpg_grid, - fpg_dialogs, fpg_menu, - fpg_panel, - model, tiModelMediator; - -type - - TCountryListForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: CountryListForm} - bvlName1: TfpgBevel; - btnAdd: TfpgButton; - btnEdit: TfpgButton; - btnDelete: TfpgButton; - grdName1: TfpgStringGrid; - btnCancel: TfpgButton; - {@VFD_HEAD_END: CountryListForm} - FData: TCountryList; - FMediator: TtiModelMediator; - procedure SetData(const AValue: TCountryList); - procedure SetupMediators; - procedure btnEditClicked(Sender: TObject); - public - procedure AfterCreate; override; - property Data: TCountryList read FData write SetData; - end; - -{@VFD_NEWFORM_DECL} - -procedure ShowCountries(const AList: TCountryList); - - -implementation - - - - -procedure ShowCountries(const AList: TCountryList); -var - frm: TCountryListForm; -begin - frm := TCountryListForm.Create(nil); - try - frm.SetData(AList); - frm.ShowModal; - finally; - frm.Free; - end; -end; - -{@VFD_NEWFORM_IMPL} - -procedure TCountryListForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddComposite('ISO(60);Name(110)', grdName1); - end; - FMediator.Subject := FData; - FMediator.Active := True; -end; - -procedure TCountryListForm.btnEditClicked(Sender: TObject); -begin - // -end; - -procedure TCountryListForm.SetData(const AValue: TCountryList); -begin - if FData=AValue then exit; - FData:=AValue; - SetupMediators; -end; - -procedure TCountryListForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: CountryListForm} - Name := 'CountryListForm'; - SetPosition(412, 278, 421, 315); - WindowTitle := 'Country Listing'; - - bvlName1 := TfpgBevel.Create(self); - with bvlName1 do - begin - Name := 'bvlName1'; - SetPosition(0, 0, 420, 36); - Anchors := [anLeft,anRight,anTop]; - Shape := bsSpacer; - end; - - btnAdd := TfpgButton.Create(bvlName1); - with btnAdd do - begin - Name := 'btnAdd'; - SetPosition(12, 4, 52, 24); - Text := 'Add'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - Enabled := False; - end; - - btnEdit := TfpgButton.Create(bvlName1); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(68, 4, 52, 24); - Text := 'Edit'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 1; - OnClick := @btnEditClicked; - Enabled := False; - end; - - btnDelete := TfpgButton.Create(bvlName1); - with btnDelete do - begin - Name := 'btnDelete'; - SetPosition(124, 4, 52, 24); - Text := 'Delete'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 2; - Enabled := False; - end; - - grdName1 := TfpgStringGrid.Create(self); - with grdName1 do - begin - Name := 'grdName1'; - SetPosition(8, 40, 404, 220); - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - TabOrder := 1; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(332, 276, 80, 24); - Text := 'Cancel'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 2; - ModalResult := mrOK; - end; - - {@VFD_BODY_END: CountryListForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas deleted file mode 100644 index 979e6592..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas +++ /dev/null @@ -1,276 +0,0 @@ -unit frmmain; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, - { fpGUI Toolkit } - fpg_base, fpg_main, fpg_widget, fpg_form, fpg_button, - fpg_grid, fpg_dialogs, fpg_menu, - { tiOPF } - tiModelMediator; - -type - { The main application window } - TMainForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: MainForm} - grdContacts: TfpgStringGrid; - btnAdd: TfpgButton; - btnEdit: TfpgButton; - btnDelete: TfpgButton; - MainMenu: TfpgMenuBar; - miFile: TfpgPopupMenu; - miEdit: TfpgPopupMenu; - miSystem: TfpgPopupMenu; - {@VFD_HEAD_END: MainForm} - FMediator: TtiModelMediator; - procedure FormShow(Sender: TObject); - procedure GridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); - procedure SetupMediators; - procedure miEditAddClick(Sender: TObject); - procedure miEditEditClick(Sender: TObject); - procedure miEditDeleteClick(Sender: TObject); - procedure miSystemCityList(Sender: TObject); - procedure miSystemCountryList(Sender: TObject); - procedure miSystemAddressTypeList(Sender: TObject); - procedure miFileExit(Sender: TObject); - public - procedure AfterCreate; override; - procedure AfterConstruction; override; - constructor Create(AOwner: TComponent); override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - model, contactmanager, tiListMediators, tiBaseMediator, tiMediators, - frmcontactmaint, frmcitylist, frmcountrylist, tiDialogs, tiObject; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.FormShow(Sender: TObject); -begin -// do nothing yet -end; - -procedure TMainForm.GridDoubleClicked(Sender: TObject; AButton: TMouseButton; - AShift: TShiftState; const AMousePos: TPoint); -begin - miEditEditClick(nil); -end; - -procedure TMainForm.SetupMediators; -begin - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.AddComposite('FirstName;LastName(130);EMail(180);Mobile(130);Comments(200)', grdContacts); - end; - FMediator.Subject := gContactManager.ContactList; - FMediator.Active := True; -end; - -procedure TMainForm.miEditAddClick(Sender: TObject); -var - c: TContact; -begin - c := TContact.CreateNew; - if EditContact(c) then - gContactManager.ContactList.Add(c) - else - c.Free; -end; - -procedure TMainForm.miEditEditClick(Sender: TObject); -var - c: TContact; -begin - if grdContacts.FocusRow < 0 then - begin - tiAppError('You need to select a Contact first'); - Exit; - end; - c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); - - if not Assigned(c) then - Exit; //==> - - if EditContact(c) then - begin - // we can save contact here if we wanted - end; -end; - -procedure TMainForm.miEditDeleteClick(Sender: TObject); -var - c: TContact; -begin - if grdContacts.FocusRow < 0 then - begin - tiAppError('You need to select a Contact first'); - Exit; - end; - c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); - - if tiAppConfirmation('Are you sure you want to delete <%s>', [c.FirstName + ' ' + c.LastName]) then - begin - { We can't use .Deleted property here, because we don't actually save - changes. This means the ObjectState will only be posDelete and not - posDeleted, which is what .FreeDeleted is looking for. } -// c.Deleted := True; - c.ObjectState := posDeleted; - gContactManager.ContactList.FreeDeleted; - end; -end; - -procedure TMainForm.miSystemCityList(Sender: TObject); -begin - ShowCities(gContactManager.CityList); -end; - -procedure TMainForm.miSystemCountryList(Sender: TObject); -begin - ShowCountries(gContactManager.CountryList); -end; - -procedure TMainForm.miSystemAddressTypeList(Sender: TObject); -begin - // ShowAddressTypeList(gContactManager.AddressTypeList); -end; - -procedure TMainForm.miFileExit(Sender: TObject); -begin - Close; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(373, 273, 540, 404); - WindowTitle := 'Demo 21: Address Book Demo using MGM'; - - grdContacts := TfpgStringGrid.Create(self); - with grdContacts do - begin - Name := 'grdContacts'; - SetPosition(12, 56, 516, 336); - Anchors := [anLeft,anRight,anTop,anBottom]; - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - OnDoubleClick := @GridDoubleClicked; - end; - - btnAdd := TfpgButton.Create(self); - with btnAdd do - begin - Name := 'btnAdd'; - SetPosition(12, 28, 52, 24); - Text := 'Add'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 1; - OnClick := @miEditAddClick; - end; - - btnEdit := TfpgButton.Create(self); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(68, 28, 52, 24); - Text := 'Edit'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 2; - OnClick := @miEditEditClick; - end; - - btnDelete := TfpgButton.Create(self); - with btnDelete do - begin - Name := 'btnDelete'; - SetPosition(124, 28, 52, 24); - Text := 'Delete'; - FontDesc := '#Label1'; - Hint := ''; - ImageName := ''; - TabOrder := 3; - OnClick := @miEditDeleteClick; - end; - - MainMenu := TfpgMenuBar.Create(self); - with MainMenu do - begin - Name := 'MainMenu'; - SetPosition(0, 0, 540, 24); - Anchors := [anLeft,anRight,anTop]; - end; - - miFile := TfpgPopupMenu.Create(self); - with miFile do - begin - Name := 'miFile'; - SetPosition(344, 136, 120, 20); - AddMenuItem('E&xit', 'Alt+F4', @miFileExit); - end; - - miEdit := TfpgPopupMenu.Create(self); - with miEdit do - begin - Name := 'miEdit'; - SetPosition(344, 156, 120, 20); - AddMenuItem('Add Contact', '', @miEditAddClick); - AddMenuItem('Edit Contact', '', @miEditEditClick); - AddMenuItem('Delete Contact', '', @miEditDeleteClick); - end; - - miSystem := TfpgPopupMenu.Create(self); - with miSystem do - begin - Name := 'miSystem'; - SetPosition(344, 176, 120, 20); - AddMenuItem('City List', '', @miSystemCityList); - AddMenuItem('Country List', '', @miSystemCountryList); - AddMenuItem('Address Type List', '', @miSystemAddressTypeList).Enabled := False; - end; - - {@VFD_BODY_END: MainForm} - - // setup main menu - MainMenu.AddMenuItem('&File', nil).SubMenu := miFile; - MainMenu.AddMenuItem('&Edit', nil).SubMenu := miEdit; - MainMenu.AddMenuItem('&System', nil).SubMenu := miSystem; -end; - -procedure TMainForm.AfterConstruction; -begin - inherited AfterConstruction; - SetupMediators; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - gContactManager.PopulateContacts; - OnShow := @FormShow; -end; - - -initialization - RegisterFallBackMediators; - - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TContactList); - gMediatorManager.RegisterMediator(TtiListViewMediatorView, TAddressList); - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCityList); - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCountryList); - gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TCity, 'Country'); - gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TAddressType, 'AddressType'); - -end. diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/model.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/model.pas deleted file mode 100644 index 643fe7c0..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/model.pas +++ /dev/null @@ -1,553 +0,0 @@ -{ - The business object model -} -unit model; - -{$IFDEF FPC} - {$mode objfpc}{$H+} -{$ENDIF} - -interface - -uses - Classes, SysUtils, tiObject; - -type - - TMarkObject = class(TtiObject) - protected - procedure Mark; - end; - - - TMarkObjectList = class(TtiObjectList) - protected - procedure Mark; - end; - - - TCountry = class(TMarkObject) - private - FISO: string; - FName: string; - procedure SetISO(const AValue: string); - procedure SetName(const AValue: string); - protected - function GetCaption: string; override; - public - constructor CreateNew(const AISO: string; const AName: string); reintroduce; overload; - published - property ISO: string read FISO write SetISO; - property Name: string read FName write SetName; - end; - - - TCountryList = class(TMarkObjectList) - protected - function GetItems(i: integer): TCountry; reintroduce; - procedure SetItems(i: integer; const AValue: TCountry); reintroduce; - public - function Add(const AObject: TCountry): integer; reintroduce; - property Items[i: integer]: TCountry read GetItems write SetItems; default; - end; - - - TCity = class(TMarkObject) - private - FZIP: string; - FName: string; - FCountry: TCountry; - function GetCountryAsString: string; - procedure SetCountry(const AValue: TCountry); - procedure SetName(const AValue: string); - procedure SetZIP(const AValue: string); - protected - function GetCaption: string; override; - public - procedure AssignClassProps(ASource: TtiObject); override; - published - property Country: TCountry read FCountry write SetCountry; - property Name: string read FName write SetName; - property ZIP: string read FZIP write SetZIP; - property CountryAsString: string read GetCountryAsString; - end; - - - TCityList = class(TMarkObjectList) - protected - function GetItems(i: integer): TCity; reintroduce; - procedure SetItems(i: integer; const AValue: TCity); reintroduce; - public - function Add(const AObject: TCity): integer; reintroduce; - property Items[i: integer]: TCity read GetItems write SetItems; default; - end; - - - TAddressType = class(TMarkObject) - private - FName: string; - procedure SetName(const AValue: string); - protected - function GetCaption: string; override; - published - property Name: string read FName write SetName; - end; - - - TAddressTypeList = class(TMarkObjectList) - protected - function GetItems(i: integer): TAddressType; reintroduce; - procedure SetItems(i: integer; const AValue: TAddressType); reintroduce; - public - function Add(const AObject: TAddressType): integer; reintroduce; - property Items[i: integer]: TAddressType read GetItems write SetItems; default; - end; - - - TAddress = class(TMarkObject) - private - FAddressType: TAddressType; - FCity: TCity; - FFax: string; - FNr: integer; - FStreet: string; - FTelephone1: string; - FTelephone2: string; - function GetAddressType4GUI: string; - procedure SetAddressType(const AValue: TAddressType); - procedure SetCity(const AValue: TCity); - procedure SetFax(const AValue: string); - procedure SetNr(const AValue: integer); - procedure SetStreet(const AValue: string); - procedure SetTelephone1(const AValue: string); - procedure SetTelephone2(const AValue: string); - public - constructor Create; override; - procedure AssignClassProps(ASource: TtiObject); override; - published - property Street: string read FStreet write SetStreet; - property Nr: integer read FNr write SetNr; - property Telephone1: string read FTelephone1 write SetTelephone1; - property Telephone2: string read FTelephone2 write SetTelephone2; - property Fax: string read FFax write SetFax; - property AddressType: TAddressType read FAddressType write SetAddressType; - property AddressType4GUI: string read GetAddressType4GUI; - property City: TCity read FCity write SetCity; - end; - - - TAddressList = class(TMarkObjectList) - protected - function GetItems(i: integer): TAddress; reintroduce; - procedure SetItems(i: integer; const AValue: TAddress); reintroduce; - public - function Add(const AObject: TAddress): integer; reintroduce; - property Items[i: integer]: TAddress read GetItems write SetItems; default; - end; - - - TContact = class(TMarkObject) - private - FAddressList: TAddressList; - FComments: string; - FEmail: string; - FFirstName: string; - FLastName: string; - FMobile: string; - procedure SetComments(const AValue: string); - procedure SetEmail(const AValue: string); - procedure SetFirstName(const AValue: string); - procedure SetLastName(const AValue: string); - procedure SetMobile(const AValue: string); - public - constructor Create; override; - destructor Destroy; override; - published - property FirstName: string read FFirstName write SetFirstName; - property LastName: string read FLastName write SetLastName; - property EMail: string read FEmail write SetEmail; - property Mobile: string read FMobile write SetMobile; - property Comments: string read FComments write SetComments; - property AddressList: TAddressList read FAddressList; - end; - - - TContactList = class(TMarkObjectList) - protected - function GetItems(i: integer): TContact; reintroduce; - procedure SetItems(i: integer; const AValue: TContact); reintroduce; - public - function Add(const AObject: TContact): integer; reintroduce; - property Items[i: integer]: TContact read GetItems write SetItems; default; - end; - - - -implementation - - -{ TMarkObject } - -procedure TMarkObject.Mark; -begin - if (ObjectState <> posEmpty) then - Dirty:= True; -end; - -{ TMarkObjectList } - -procedure TMarkObjectList.Mark; -begin - if (ObjectState <> posEmpty) then - Dirty:= True; -end; - -{ TCountry } - -procedure TCountry.SetISO(const AValue: string); -begin - if FISO = AValue then - Exit; //==> - - BeginUpdate; - FISO:= AValue; - Mark; - EndUpdate; -end; - -procedure TCountry.SetName(const AValue: string); -begin - if FName = AValue then - Exit; //==> - - BeginUpdate; - FName:= AValue; - Mark; - EndUpdate; -end; - -function TCountry.GetCaption: string; -begin - Result:= Name; -end; - -constructor TCountry.CreateNew(const AISO: string; const AName: string); -begin - inherited CreateNew; - FISO:= AISO; - FName:= AName; -end; - -{ TCity } - -procedure TCity.SetCountry(const AValue: TCountry); -begin - if FCountry = AValue then - Exit; //==> - - BeginUpdate; - FCountry:= AValue; - Mark; - EndUpdate; -end; - -function TCity.GetCountryAsString: string; -begin - result:= Country.Name + ' (' + Country.ISO + ')'; -end; - -procedure TCity.SetName(const AValue: string); -begin - if FName = AValue then - Exit; //==> - - BeginUpdate; - FName:= AValue; - Mark; - EndUpdate; -end; - -procedure TCity.SetZIP(const AValue: string); -begin - if FZip = AValue then - Exit; //==> - - BeginUpdate; - FZip:= AValue; - Mark; - EndUpdate; -end; - -function TCity.GetCaption: string; -begin - Result := Name; -end; - -procedure TCity.AssignClassProps(ASource: TtiObject); -begin - FCountry:= TCity(ASource).Country; // reference only -end; - -{ TAddressType } - -procedure TAddressType.SetName(const AValue: string); -begin - if FName = AValue then - Exit; //==> - - BeginUpdate; - FName:= AValue; - Mark; - EndUpdate; -end; - -function TAddressType.GetCaption: string; -begin - Result := Name; -end; - -{ TAddress } - -procedure TAddress.SetStreet(const AValue: string); -begin - if FStreet=AValue then exit; - - BeginUpdate; - FStreet:=AValue; - Mark; - EndUpdate; -end; - -procedure TAddress.SetTelephone1(const AValue: string); -begin - if FTelephone1=AValue then exit; - - BeginUpdate; - FTelephone1:=AValue; - Mark; - EndUpdate; -end; - -procedure TAddress.SetTelephone2(const AValue: string); -begin - if FTelephone2=AValue then exit; - - BeginUpdate; - FTelephone2:=AValue; - Mark; - EndUpdate; -end; - -constructor TAddress.Create; -begin - inherited Create; - FAddressType := nil; -end; - -procedure TAddress.AssignClassProps(ASource: TtiObject); -begin - FAddressType := TAddress(ASource).AddressType; // reference only - FCity := TAddress(ASource).City; // reference only -end; - -procedure TAddress.SetNr(const AValue: integer); -begin - if FNr=AValue then exit; - - BeginUpdate; - FNr:=AValue; - Mark; - EndUpdate; -end; - -procedure TAddress.SetAddressType(const AValue: TAddressType); -begin - if FAddressType = AValue then - Exit; //==> - - BeginUpdate; - FAddressType := AValue; - Mark; - EndUpdate; -end; - -function TAddress.GetAddressType4GUI: string; -begin - Result := FAddressType.Name; -end; - -procedure TAddress.SetCity(const AValue: TCity); -begin - if FCity=AValue then exit; - - BeginUpdate; - FCity:=AValue; - Mark; - EndUpdate; -end; - -procedure TAddress.SetFax(const AValue: string); -begin - if FFax=AValue then exit; - - BeginUpdate; - FFax:=AValue; - Mark; - EndUpdate; -end; - -{ TContact } - -procedure TContact.SetFirstName(const AValue: string); -begin - if FFirstName=AValue then exit; - - BeginUpdate; - FFirstName:=AValue; - Mark; - EndUpdate; -end; - -procedure TContact.SetEmail(const AValue: string); -begin - if FEmail=AValue then exit; - - BeginUpdate; - FEmail:=AValue; - Mark; - EndUpdate; -end; - -procedure TContact.SetComments(const AValue: string); -begin - if FComments=AValue then exit; - - BeginUpdate; - FComments:=AValue; - Mark; - EndUpdate; -end; - -procedure TContact.SetLastName(const AValue: string); -begin - if FLastName=AValue then exit; - - BeginUpdate; - FLastName:=AValue; - Mark; - EndUpdate; -end; - -procedure TContact.SetMobile(const AValue: string); -begin - if FMobile=AValue then exit; - - BeginUpdate; - FMobile:=AValue; - Mark; - EndUpdate; -end; - -constructor TContact.Create; -begin - inherited Create; - FAddressList:= TAddressList.Create; - FAddressList.Owner:= self; - // ToDo: Refactor to remove need for ItemOwner. Use Parent instead - FAddressList.ItemOwner:= self; -end; - -destructor TContact.Destroy; -begin - FAddressList.Free; - inherited Destroy; -end; - -{ TCountryList } - -function TCountryList.GetItems(i: integer): TCountry; -begin - Result:= TCountry(inherited GetItems(i)); -end; - -procedure TCountryList.SetItems(i: integer; const AValue: TCountry); -begin - inherited SetItems(i, AValue); -end; - -function TCountryList.Add(const AObject: TCountry): integer; -begin - Result:= inherited Add(AObject); -end; - -{ TCityList } - -function TCityList.GetItems(i: integer): TCity; -begin - result:= TCity(inherited GetItems(i)); -end; - -procedure TCityList.SetItems(i: integer; const AValue: TCity); -begin - inherited SetItems(i, AValue); -end; - -function TCityList.Add(const AObject: TCity): integer; -begin - result:= inherited Add(AObject); -end; - -{ TAddressList } - -function TAddressList.GetItems(i: integer): TAddress; -begin - result:= TAddress(inherited GetItems(i)); -end; - -procedure TAddressList.SetItems(i: integer; const AValue: TAddress); -begin - inherited SetItems(i, AValue); -end; - -function TAddressList.Add(const AObject: TAddress): integer; -begin - result:= inherited Add(AObject); -end; - -{ TContactList } - -function TContactList.GetItems(i: integer): TContact; -begin - result:= TContact(inherited GetItems(i)); -end; - -procedure TContactList.SetItems(i: integer; const AValue: TContact); -begin - inherited SetItems(i, AValue); -end; - -function TContactList.Add(const AObject: TContact): integer; -begin - result:= inherited Add(AObject); -end; - - -{ TAddressTypeList } - -function TAddressTypeList.GetItems(i: integer): TAddressType; -begin - result := TAddressType(inherited GetItems(i)); -end; - -procedure TAddressTypeList.SetItems(i: integer; const AValue: TAddressType); -begin - inherited SetItems(i, AValue); -end; - -function TAddressTypeList.Add(const AObject: TAddressType): integer; -begin - result := inherited Add(AObject); -end; - -end. - diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/units/placeholder.txt b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/units/placeholder.txt deleted file mode 100644 index 4805699e..00000000 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/units/placeholder.txt +++ /dev/null @@ -1 +0,0 @@ -do not delete me. diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpr b/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpr deleted file mode 100644 index e43592fd..00000000 --- a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpr +++ /dev/null @@ -1,31 +0,0 @@ -{ - This demo does performance testing of the TtiBaseObject to see the difference - when Reference Counting is enabled, linked in or not. -} -program PerformanceTesting; - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_main, frm_main; - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - end; -end; - -begin - MainProc; -end. - diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/frm_main.pas b/extras/tiopf/demos/Demo_TtiBaseObject/frm_main.pas deleted file mode 100644 index 6b39cf0d..00000000 --- a/extras/tiopf/demos/Demo_TtiBaseObject/frm_main.pas +++ /dev/null @@ -1,218 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -// You need to enable these in tiOPF's tiDefines.inc as well. -{.$Define object_tracking} -{$Define reference_counting} - - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel, fpg_popupcalendar, fpg_gauge; - -type - - TMainForm = class(TfpgForm) - private - procedure PerformanceTestNoReferenceCounting(Sender: TObject); - procedure PerformanceTestReferenceCounting(Sender: TObject); - procedure btnTestValidClick(Sender: TObject); - procedure Log(const AMessage: string); - public - {@VFD_HEAD_BEGIN: MainForm} - btnNoRefCount: TfpgButton; - btnRefCount: TfpgButton; - btnTestValid: TfpgButton; - memName1: TfpgMemo; - lblName1: TfpgLabel; - lblName2: TfpgLabel; - memLog: TfpgMemo; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - tiUtils, - tiBaseObject; - -const - CTestRunTime = 5; // Seconds - CTestCount = 1000000; // 1 million - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.PerformanceTestNoReferenceCounting(Sender: TObject); -var - LO: TtiBaseObject; - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TtiBaseObject.Create; - LO.Free; - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (no reference counting)', - [tiIntToCommaStr(LCount), tiGetTickCount - LStart])); -end; - -procedure TMainForm.PerformanceTestReferenceCounting(Sender: TObject); -{$ifdef reference_counting} -var -// LO: IInterface; - LO: TtiBaseObject; // We are testing object creation only. Hence a class and not interface reference. - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TtiBaseObject.CreateWithRefCounting; - LO.Free; // we are testing object creation. This remove the garbage collector. - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (reference counting)', - [tiIntToCommaStr(LCount), tiGetTickCount - LStart])); -{$else} -begin - Assert(False, 'reference_counting not enabled'); -{$endif} -end; - -procedure TMainForm.btnTestValidClick(Sender: TObject); -var - LO: TtiBaseObject; -begin - LO := TtiBaseObject.Create; - Assert(LO.TestValid); - LO.Free; - Assert(not LO.TestValid); -end; - -procedure TMainForm.Log(const AMessage: string); -begin - memLog.Lines.Add(AMessage); - memLog.Invalidate; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - memLog.Lines.Clear; - {$ifdef object_tracking} - Log('object_tracking is ON'); - {$else} - btnTestValid.Enabled := False; - Log('object_tracking is OFF'); - {$endif} - {$ifdef reference_counting} - Log('reference_counting is ON'); - {$else} - Log('reference_counting is OFF'); - btnRefCount.Enabled := False; - {$endif} - Log('---'); -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(307, 319, 357, 290); - WindowTitle := 'TtiBaseObject Performance Demo'; - WindowPosition := wpScreenCenter; - - btnNoRefCount := TfpgButton.Create(self); - with btnNoRefCount do - begin - Name := 'btnNoRefCount'; - SetPosition(16, 28, 155, 23); - Text := 'No reference counting'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @PerformanceTestNoReferenceCounting; - end; - - btnRefCount := TfpgButton.Create(self); - with btnRefCount do - begin - Name := 'btnRefCount'; - SetPosition(16, 56, 155, 23); - Text := 'Reference counting'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @PerformanceTestReferenceCounting; - end; - - btnTestValid := TfpgButton.Create(self); - with btnTestValid do - begin - Name := 'btnTestValid'; - SetPosition(16, 112, 155, 23); - Text := 'TtiBaseObject.TestValid'; - FontDesc := '#Label1'; - ImageName := ''; - OnClick := @btnTestValidClick; - end; - - memName1 := TfpgMemo.Create(self); - with memName1 do - begin - Name := 'memName1'; - SetPosition(176, 28, 176, 125); - Lines.Add('Toggle the conditional defines'); - Lines.Add('REFERENCE_COUNTING '); - Lines.Add('and OBJECT_TRACKING on '); - Lines.Add('and off to examine behaviour.'); - FontDesc := '#Edit1'; - Enabled := False; - end; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(8, 8, 160, 15); - Text := 'Performance'; - FontDesc := '#Label2'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 92, 160, 15); - Text := 'TtiBaseObject.TestValid'; - FontDesc := '#Label2'; - end; - - memLog := TfpgMemo.Create(self); - with memLog do - begin - Name := 'memLog'; - SetPosition(8, 164, 344, 121); - Lines.Add(''); - FontDesc := '#Edit1'; - end; - - {@VFD_BODY_END: MainForm} -end; - - -end. diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi b/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi deleted file mode 100644 index cf7d5e86..00000000 --- a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi +++ /dev/null @@ -1,117 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <LRSInOutputDirectory Value="False"/> - </Flags> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - <ActiveEditorIndexAtStart Value="0"/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - <Language Value=""/> - <CharSet Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <Units Count="9"> - <Unit0> - <Filename Value="performancetest.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="performancetest"/> - <CursorPos X="1" Y="13"/> - <TopLine Value="13"/> - <EditorIndex Value="0"/> - <UsageCount Value="20"/> - <Loaded Value="True"/> - </Unit0> - <Unit1> - <Filename Value="frm_main.pas"/> - <UnitName Value="frm_main"/> - <CursorPos X="37" Y="85"/> - <TopLine Value="65"/> - <EditorIndex Value="2"/> - <UsageCount Value="10"/> - <Loaded Value="True"/> - </Unit1> - <Unit2> - <Filename Value="/opt/fpc_2.2.0/src/packages/fcl-base/src/inc/custapp.pp"/> - <UnitName Value="CustApp"/> - <CursorPos X="3" Y="26"/> - <TopLine Value="11"/> - <UsageCount Value="10"/> - </Unit2> - <Unit3> - <Filename Value="../../../../../3rdParty/tiOPF2/Source/Core/tiUtils.pas"/> - <UnitName Value="tiUtils"/> - <CursorPos X="9" Y="507"/> - <TopLine Value="486"/> - <UsageCount Value="10"/> - </Unit3> - <Unit4> - <Filename Value="../../../../../3rdParty/tiOPF2/Source/Core/tiLinux.pas"/> - <UnitName Value="tiLinux"/> - <CursorPos X="1" Y="48"/> - <TopLine Value="28"/> - <UsageCount Value="10"/> - </Unit4> - <Unit5> - <Filename Value="../../../../../3rdParty/tiOPF2/Source/Core/tiBaseObject.pas"/> - <UnitName Value="tiBaseObject"/> - <CursorPos X="1" Y="128"/> - <TopLine Value="94"/> - <EditorIndex Value="1"/> - <UsageCount Value="10"/> - <Loaded Value="True"/> - </Unit5> - <Unit6> - <Filename Value="/opt/fpc_2.2.0/src/rtl/inc/objpash.inc"/> - <CursorPos X="29" Y="220"/> - <TopLine Value="212"/> - <UsageCount Value="10"/> - </Unit6> - <Unit7> - <Filename Value="/opt/fpc_2.2.0/src/rtl/inc/objpas.inc"/> - <CursorPos X="9" Y="709"/> - <TopLine Value="705"/> - <UsageCount Value="10"/> - </Unit7> - <Unit8> - <Filename Value="FMain.pas"/> - <UnitName Value="FMain"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="38"/> - <UsageCount Value="10"/> - </Unit8> - </Units> - <JumpHistory Count="2" HistoryIndex="1"> - <Position1> - <Filename Value="performancetest.lpr"/> - <Caret Line="112" Column="1" TopLine="112"/> - </Position1> - <Position2> - <Filename Value="performancetest.lpr"/> - <Caret Line="249" Column="1" TopLine="220"/> - </Position2> - </JumpHistory> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpr b/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpr deleted file mode 100644 index d42615cc..00000000 --- a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpr +++ /dev/null @@ -1,248 +0,0 @@ -{ - This program tests the speed of Reference Counted and non-Reference Counted - objects over a set time period. Default of 5 seconds. -} -program performancetest; - -{$mode objfpc}{$H+} - -uses - Classes, SysUtils, CustApp; - -const - CTestCount = 1000000; // 1 million - -type - TMyApplication = class(TCustomApplication) - protected - procedure DoRun; override; - procedure TestRefCountedObjects; - procedure TestNonRefCountedObjects; - procedure TestRefCountedMyObjects; - procedure TestNonRefCountedMyObjects; - procedure Log(const AMessage: string); - public - constructor Create(TheOwner: TComponent); override; - destructor Destroy; override; - procedure WriteHelp; virtual; - end; - - - TMyBaseObject = class(TObject, IUnknown) - private - FRefCounting: Boolean; - FRefCount: Integer; - protected - function QueryInterface(const IID: TGUID; out Obj): longint; stdcall; - function _AddRef: longint; stdcall; - function _Release: longint; stdcall; - public - constructor Create; - destructor Destroy; override; - constructor CreateWithRefCounting; - procedure AfterConstruction; override; - procedure BeforeDestruction; override; - class function NewInstance: TObject; override; - end; - -{ TMyBaseObject } - -function TMyBaseObject.QueryInterface(const IID: TGUID; out Obj): longint; stdcall; -begin - if GetInterface(IID, Obj) then - Result := 0 - else - Result := E_NOINTERFACE; -end; - -function TMyBaseObject._AddRef: longint; stdcall; -begin - Result := InterlockedIncrement(FRefCount); -end; - -function TMyBaseObject._Release: longint; stdcall; -begin - Result := InterlockedDecrement(FRefCount); - if FRefCounting then - if Result = 0 then - Destroy; -end; - -constructor TMyBaseObject.Create; -begin - FRefCounting := False; -end; - -destructor TMyBaseObject.Destroy; -begin - inherited Destroy; -end; - -constructor TMyBaseObject.CreateWithRefCounting; -begin - Create; - FRefCounting := True; -end; - -procedure TMyBaseObject.AfterConstruction; -begin - inherited AfterConstruction; - // Release the constructor's implicit refcount - if FRefCounting then - InterlockedDecrement(FRefCount); -end; - -procedure TMyBaseObject.BeforeDestruction; -begin - if FRefCounting then - if FRefCount <> 0 then - System.Error(reInvalidPtr); - inherited BeforeDestruction; -end; - -class function TMyBaseObject.NewInstance: TObject; -begin - Result := inherited NewInstance; - TMyBaseObject(Result).FRefCount := 1; -end; - -function tiGetTickCount: Cardinal; -begin - Result := Cardinal(Trunc(Now * 24 * 60 * 60 * 1000)); -end; - - -{ TMyApplication } - -procedure TMyApplication.DoRun; -var - ErrorMsg: String; -begin - // quick check parameters - ErrorMsg := CheckOptions('h','help'); - if ErrorMsg <> '' then - begin - ShowException(Exception.Create(ErrorMsg)); - Halt; - end; - - // parse parameters - if HasOption('h','help') then - begin - WriteHelp; - Halt; - end; - -// TestNonRefCountedMyObjects; - TestNonRefCountedObjects; - TestRefCountedObjects; - TestNonRefCountedMyObjects; - TestRefCountedMyObjects; - - // stop program loop - Terminate; -end; - -procedure TMyApplication.TestRefCountedObjects; -var - LO: TInterfacedObject; - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TInterfacedObject.Create; - LO.Free; - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (reference counting with TInterfacedObject)', - [IntToStr(LCount), tiGetTickCount - LStart])); -end; - -procedure TMyApplication.TestNonRefCountedObjects; -var - LO: TObject; - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TObject.Create; - LO.Free; - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (no reference counting with TObject)', - [IntToStr(LCount), tiGetTickCount - LStart])); -end; - -procedure TMyApplication.TestRefCountedMyObjects; -var - LO: TMyBaseObject; - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TMyBaseObject.CreateWithRefCounting; - LO.Free; - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (reference counting with MyBaseObject)', - [IntToStr(LCount), tiGetTickCount - LStart])); -end; - -procedure TMyApplication.TestNonRefCountedMyObjects; -var - LO: TMyBaseObject; - LStart: Cardinal; - LCount: Cardinal; -begin - LCount := 0; - LStart := tiGetTickCount; - while LCount < CTestCount do - begin - LO := TMyBaseObject.Create; - LO.Free; - Inc(LCount); - end; - Log(Format('%s iterations in %d ms (no reference counting with MyBaseObject)', - [IntToStr(LCount), tiGetTickCount - LStart])); -end; - -procedure TMyApplication.Log(const AMessage: string); -begin - writeln(AMessage); -end; - -constructor TMyApplication.Create(TheOwner: TComponent); -begin - inherited Create(TheOwner); - StopOnException := True; -end; - -destructor TMyApplication.Destroy; -begin - inherited Destroy; -end; - -procedure TMyApplication.WriteHelp; -begin - { add your help code here } - writeln('Usage: ',ExeName,' -h'); -end; - -var - Application: TMyApplication; -begin - Application := TMyApplication.Create(nil); - Application.Title := 'My Application'; - Application.Run; - Application.Free; -end. - diff --git a/extras/tiopf/demos/EditControlsDemo/editmediators.lpi b/extras/tiopf/demos/EditControlsDemo/editmediators.lpi deleted file mode 100644 index 0f0543c7..00000000 --- a/extras/tiopf/demos/EditControlsDemo/editmediators.lpi +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - <UseAppBundle Value="False"/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - <MinVersion Major="2" Release="3" Valid="True"/> - </Item1> - </RequiredPackages> - <Units Count="5"> - <Unit0> - <Filename Value="editmediators.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="editmediators"/> - </Unit0> - <Unit1> - <Filename Value="frmMain.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmMain"/> - </Unit1> - <Unit2> - <Filename Value="../Common/Model_View.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model_View"/> - </Unit2> - <Unit3> - <Filename Value="../Common/Constants.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Constants"/> - </Unit3> - <Unit4> - <Filename Value="../Common/Model.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model"/> - </Unit4> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="../Common/"/> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/EditControlsDemo/editmediators.lpr b/extras/tiopf/demos/EditControlsDemo/editmediators.lpr deleted file mode 100644 index 0dd11cc8..00000000 --- a/extras/tiopf/demos/EditControlsDemo/editmediators.lpr +++ /dev/null @@ -1,27 +0,0 @@ -program editmediators; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_main, frmMain; - - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - frm.Show; - fpgApplication.Run; -end; - -begin - MainProc; -end. - - diff --git a/extras/tiopf/demos/EditControlsDemo/frmMain.pas b/extras/tiopf/demos/EditControlsDemo/frmMain.pas deleted file mode 100644 index 03749901..00000000 --- a/extras/tiopf/demos/EditControlsDemo/frmMain.pas +++ /dev/null @@ -1,237 +0,0 @@ -unit frmMain; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, fpg_form, fpg_button, fpg_label, fpg_edit, fpg_trackbar, - fpg_combobox, fpg_memo, Model, tiModelMediator, Model_View; - -type - TMainForm = class(TfpgForm) - private - btnClose: TfpgButton; - btnViaCode: TfpgButton; - btnShowModel: TfpgButton; - Label1: TfpgLabel; - Label2: TfpgLabel; - edtName: TfpgEdit; - AgeTrackBar: TfpgTrackBar; - memMemo: TfpgMemo; - cbGender: TfpgComboBox; - Label3: TfpgLabel; - - { The object we will be working with. } - FPerson: TPerson; - { Form Mediator } - FMediator: TtiModelMediator; - - procedure btnCloseClick(Sender: TObject); - procedure btnShowModelClick(Sender: TObject); - procedure btnViaCodeClick(Sender: TObject); - procedure InitializeComponents; - procedure SetupMediators; - public - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterConstruction; override; - end; - -implementation - -uses - fpg_dialogs - ; - -{ TMainForm } - -procedure TMainForm.btnCloseClick(Sender: TObject); -begin - Close; -end; - -procedure TMainForm.btnShowModelClick(Sender: TObject); -begin - ShowMessage(FPerson.AsDebugString); -end; - -{ The controls will automatically update as well! } -procedure TMainForm.btnViaCodeClick(Sender: TObject); -begin - FPerson.Name := 'John Doe'; - FPerson.Age := 23; - FPerson.Gender := genFemale; -end; - -procedure TMainForm.InitializeComponents; -begin - Label1 := TfpgLabel.Create(self); - with Label1 do - begin - Left := 8; - Height := 17; - Top := 16; - Width := 49; - Text := 'Name:'; - end; - - Label2 := TfpgLabel.Create(self); - with Label2 do - begin - Left := 8; - Height := 17; - Top := 48; - Width := 34; - Text := 'Age:'; - end; - - Label3 := TfpgLabel.Create(self); - with Label3 do - begin - Left := 264; - Height := 17; - Top := 16; - Width := 90; - Text := '(Read-Only)'; - end; - - btnClose := TfpgButton.Create(self); - with btnClose do - begin - Left := 416; - Height := 25; - Top := 160; - Width := 75; - Text := 'Close'; - OnClick := @btnCloseClick; - ImageName := 'stdimg.Close'; - ShowImage := True; - TabOrder := 0; - end; - - btnViaCode := TfpgButton.Create(self); - with btnViaCode do - begin - Left := 7; - Height := 25; - Top := 160; - Width := 150; - Text := 'Change via Code'; - OnClick := @btnViaCodeClick; - TabOrder := 1; - end; - - btnShowModel := TfpgButton.Create(self); - with btnShowModel do - begin - Left := 164; - Height := 25; - Top := 160; - Width := 100; - Text := 'Show Model'; - OnClick := @btnShowModelClick; - TabOrder := 2; - end; - - edtName := TfpgEdit.Create(self); - with edtName do - begin - Left := 64; - Height := 21; - Top := 16; - Width := 150; - TabOrder := 3; - end; - - AgeTrackBar := TfpgTrackBar.Create(self); - with AgeTrackBar do - begin - Left := 64; - Height := 41; - Top := 72; - Width := 150; - Max := 100; - ShowPosition := True; - TabOrder := 5; - end; - - memMemo := TfpgMemo.Create(self); - with memMemo do - begin - Left := 264; - Height := 57; - Top := 32; - Width := 185; - TabOrder := 6; - end; - - cbGender := TfpgComboBox.Create(self); - with cbGender do - begin - Left := 264; - Height := 21; - Top := 96; - TabOrder := 7; - end; -end; - -procedure TMainForm.SetupMediators; -begin -{ - FComboBoxGenderMediator := TPerson_Gender_ComboBox_Mediator.CreateCustom(cbGender, FPerson, 'GenderGUI', 'Text'); -} - if not Assigned(FMediator) then - begin - FMediator := TtiModelMediator.Create(self); - FMediator.Name := 'DemoFormMediator'; - FMediator.AddProperty('Name', edtName); - FMediator.AddProperty('Age', AgeTrackBar); - FMediator.AddProperty('Name', memMemo); - FMediator.AddProperty('GenderGUI', cbGender); - end; - FMediator.Subject := FPerson; - FMediator.Active := True; -end; - -constructor TMainForm.Create(AOwner: TComponent); -var - i: TGender; -begin - inherited Create(AOwner); - WindowTitle := 'Edit Mediators Demo'; - WindowPosition := wpUser; - SetPosition(100, 100, 500, 200); - - { The Data Object being observed } - FPerson := TPerson.Create; - FPerson.Name := 'Graeme Geldenhuys'; - FPerson.Age := 32; - - InitializeComponents; - - for i := Low(TGender) to High(TGender) do - cbGender.Items.Add(cGender[i]); -end; - -destructor TMainForm.Destroy; -begin - // TFormMediator (FMediator) get free'd automatically because it's a TComponent - FPerson.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterConstruction; -begin - inherited AfterConstruction; - { The only trick here is to not let the OnChange events fire - before the mediators are not set up!! } - SetupMediators; - - // This will cause all components to update at once - FPerson.NotifyObservers; -end; - - -end. - diff --git a/extras/tiopf/demos/ListControlDemo/frmMain.pas b/extras/tiopf/demos/ListControlDemo/frmMain.pas deleted file mode 100644 index 551a6b18..00000000 --- a/extras/tiopf/demos/ListControlDemo/frmMain.pas +++ /dev/null @@ -1,255 +0,0 @@ -unit frmMain; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, fpg_form, fpg_button, fpg_label, fpg_edit, fpg_trackbar, - fpg_combobox, fpg_checkbox, fpg_listbox, Model, - tiGenericEditMediators, tiGenericListMediators; - -type - TMainForm = class(TfpgForm) - private - btnClose: TfpgButton; - btnViaCode: TfpgButton; - btnAddViaCode: TfpgButton; - btnShowModel: TfpgButton; - btnDeleted: TfpgButton; - lblName: TfpgLabel; - edtName: TfpgEdit; - lblAge: TfpgLabel; -// edtAge: TSpinEdit; - AgeTrackBar: TfpgTrackBar; - cbPeople: TfpgComboBox; - lbPeople: TfpgListBox; - lblPerson: TfpgLabel; -// gbPerson: TGroupBox; - chkShowDeleted: TfpgCheckBox; - { The object we will be working with. } - FPersonList: TPersonList; - - { Mediators } - FComboBoxMediator: TComboBoxMediator; - FListBoxMediator: TListBoxMediator; - FNameMediator: TMediatorEditView; -// FAgeMediator: TMediatorSpinEditView; - FTrackBarAgeMediator: TMediatorTrackBarView; - - procedure btnCloseClick(Sender: TObject); - procedure btnShowModelClick(Sender: TObject); - procedure btnViaCodeClick(Sender: TObject); - procedure btnDeleteClick(Sender: TObject); - procedure btnViaCodeAddClick(Sender: TObject); - procedure lbSelectionChanged(Sender: TObject); - procedure cbSelectionChanged(Sender: TObject); - procedure chkShowDeletedChange(Sender: TObject); - - procedure InitializeComponents; - procedure SetupMediators; - procedure SetupEventHandlers; - public - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterConstruction; override; - end; - -implementation - -uses - Model_View - ,gfxbase - ,tiObject - ,tiDialogs - ; - -{ TMainForm } - -procedure TMainForm.btnCloseClick(Sender: TObject); -begin - Close; -end; - -procedure TMainForm.btnShowModelClick(Sender: TObject); -begin - tiShowString(FPersonList.AsDebugString); -end; - -procedure TMainForm.btnViaCodeClick(Sender: TObject); -begin - { The BeginUpdate/EndUpdate will let the Item notify its observers - only once, even though two change where made. - Note: - This is for observers to the Item, not the List that the Item belongs to! } - FPersonList.Items[1].BeginUpdate; - FPersonList.Items[1].Name := 'I have changed via code'; - FPersonList.Items[1].Age := 99; - FPersonList.Items[1].EndUpdate; - { This notifies observers of the List, that something has changed. } - FPersonList.NotifyObservers; -end; - -{ This toggles the Deleted state of an object. Not really the correct way of - doing things. It is for demonstration purposes only! } -procedure TMainForm.btnDeleteClick(Sender: TObject); -begin - if FListBoxMediator.SelectedObject.Deleted then - FListBoxMediator.SelectedObject.ObjectState := posCreate - else - FListBoxMediator.SelectedObject.Deleted := True; - FPersonList.NotifyObservers; -end; - -procedure TMainForm.btnViaCodeAddClick(Sender: TObject); -var - lData: TPerson; -begin - lData := TPerson.Create; - lData.Name := 'I am new'; - lData.Age := 44; - FPersonList.Add(lData); -end; - -procedure TMainForm.lbSelectionChanged(Sender: TObject); -var - backup: TNotifyEvent; -begin - FListBoxMediator.HandleSelectionChanged; - { This is only done to keep the ComboBox and ListBox in sync. This would not - be done or needed in a real application } - backup := cbPeople.OnChange; - cbPeople.OnChange := nil; - cbPeople.FocusItem := lbPeople.FocusItem; - cbpeople.OnChange := backup; -end; - -procedure TMainForm.cbSelectionChanged(Sender: TObject); -var - backup: TNotifyEvent; -begin - FComboBoxMediator.HandleSelectionChanged; - { This is only done to keep the ComboBox and ListBox in sync. This would not - be done or needed in a real application } - backup := lbPeople.OnChange; - lbPeople.OnChange := nil; - lbPeople.FocusItem := cbPeople.FocusItem; - lbPeople.OnChange := backup; -end; - -procedure TMainForm.chkShowDeletedChange(Sender: TObject); -begin - FComboBoxMediator.ShowDeleted := chkShowDeleted.Checked; - FListBoxMediator.ShowDeleted := chkShowDeleted.Checked; -end; - -procedure TMainForm.InitializeComponents; -var - lbl: TfpgLabel; -begin - btnClose := CreateButton(self, 416, 370, 75, 'Close', @btnCloseClick); - btnClose.ImageName := 'stdimg.Close'; - btnClose.ShowImage := True; - - btnViaCode := CreateButton(self, 7, btnClose.Top, 150, 'Change via Code', @btnViaCodeClick); - btnViaCode.Hint := 'This changes a object via code, and magically the list views are updated.'; - - btnAddViaCode := CreateButton(self, 7, btnViaCode.Top - btnViaCode.Height - 5, 150, 'Add via Code', @btnViaCodeAddClick); - btnAddViaCode.Hint := 'This adds a object via code, and magically the list views are updated.'; - - btnShowModel := CreateButton(self, btnViaCode.Right + 7, btnViaCode.Top, 100, 'Show Model', @btnShowModelClick); - btnShowModel.Hint := 'Show the internal state of all objects'; - - btnDeleted := CreateButton(self, btnShowModel.Right + 7, btnClose.Top, 75, 'Delete', @btnDeleteClick); - btnDeleted.Hint := 'Toggle the Deleted state of seleted object in ListBox'; - - lblPerson := CreateLabel(self, 7, 20, 'Details of selected object in ComboBox'); - lblPerson.FontDesc := '#Label2'; - - lblName := CreateLabel(self, 25, lblPerson.Bottom + 7, 'Name:'); - edtName := CreateEdit(self, lblName.Right + 7, lblPerson.Bottom + 5, 150, 20); - edtName.Enabled := False; - - lblAge := CreateLabel(self, 25, edtName.Bottom + 7, 'Age:'); - AgeTrackBar := TfpgTrackbar.Create(self); - AgeTrackBar.Left := edtName.Left; - AgeTrackBar.Top := lblAge.Top-4; - AgeTrackBar.Width := edtName.Width; - AgeTrackBar.ShowPosition := True; - AgeTrackBar.Enabled := False; - - lbl := CreateLabel(self, edtName.Right + 30, edtName.Top, 'These components observe the selected item of ComboBox', 200, AgeTrackBar.Top-5); - lbl.TextColor := clBlue; - lbl.WrapText := True; - - lbPeople := TfpgListBox.Create(self); - lbPeople.Top := AgeTrackBar.Bottom + 17; - lbPeople.Left := 7; - lbPeople.Height := 200; - lbPeople.Width := 200; - lbPeople.Hint := 'Shows objects from the object list'; - - cbPeople := TfpgComboBox.Create(self); - cbPeople.Top := AgeTrackBar.Bottom + 17; - cbPeople.Left := lbPeople.Right + 15; - cbPeople.Width := 200; - cbPeople.Hint := 'Shows objects from the object list'; - - chkShowDeleted := CreateCheckBox(self, cbPeople.Left, lbPeople.Bottom-20, 'Show Deleted'); - -end; - -procedure TMainForm.SetupMediators; -begin - { list mediators } - FComboBoxMediator := TPersonList_ComboBox_Mediator.CreateCustom(FPersonList, cbPeople); - FListBoxMediator := TListBoxMediator.CreateCustom(FPersonList, lbPeople); - - { property/edit mediators } - FNameMediator := TPerson_Name_TextEdit_View.CreateCustom(edtName, FComboBoxMediator.SelectedObject, 'Name', 'Text'); - FTrackBarAgeMediator := TPerson_Age_TrackBar_Mediator.CreateCustom(AgeTrackBar, FComboBoxMediator.SelectedObject, 'Age', 'Position'); - - { By default we creating mediators, they are not updated automatically. This - allows us to notify all observers at once. This behaviour can be changed. } - FPersonList.NotifyObservers; -end; - -procedure TMainForm.SetupEventHandlers; -begin - lbPeople.OnChange := @lbSelectionChanged; - cbPeople.OnChange := @cbSelectionChanged; - chkShowDeleted.OnChange := @chkShowDeletedChange; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - WindowTitle := 'List Mediators Demo'; - WindowPosition := wpUser; - SetPosition(100, 100, 500, 400); - - InitializeComponents; - FPersonList := GeneratePersonList; - SetupEventHandlers; -end; - -destructor TMainForm.Destroy; -begin - FNameMediator.Free; - FTrackBarAgeMediator.Free; - FComboBoxMediator.Free; - FListBoxMediator.Free; - FPersonList.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterConstruction; -begin - inherited AfterConstruction; - { The only trick here is to not let the OnChange events fire - before the mediators are not set up!! } - SetupMediators; -end; - -end. - diff --git a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi deleted file mode 100644 index 6faa819b..00000000 --- a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - <MinVersion Major="2" Release="3" Valid="True"/> - </Item1> - </RequiredPackages> - <Units Count="5"> - <Unit0> - <Filename Value="listcontroldemo.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="listcontroldemo"/> - </Unit0> - <Unit1> - <Filename Value="frmMain.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmMain"/> - </Unit1> - <Unit2> - <Filename Value="../Common/Model_View.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model_View"/> - </Unit2> - <Unit3> - <Filename Value="../Common/Constants.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Constants"/> - </Unit3> - <Unit4> - <Filename Value="../Common/Model.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model"/> - </Unit4> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="../Common/"/> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Other> - <CustomOptions Value=" -"/> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr deleted file mode 100644 index 6455aa9b..00000000 --- a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr +++ /dev/null @@ -1,26 +0,0 @@ -program listcontroldemo; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_base, fpg_main, frmMain, Model, Constants, Model_View; - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - frm.Show; - fpgApplication.Run; -end; - -begin - MainProc; -end. - - diff --git a/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas b/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas deleted file mode 100644 index 3878ad61..00000000 --- a/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas +++ /dev/null @@ -1,288 +0,0 @@ -unit frm_main; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_basegrid, fpg_grid, fpg_menu, - fpg_panel, fpg_popupcalendar, fpg_gauge, Model, tiListMediators; - -type - - TMainForm = class(TfpgForm) - private - FList: TPersonList; - medGrid: TtiStringGridMediatorView; - procedure SetupMediators; - procedure ValidateData; - procedure btnAddClicked(Sender: TObject); - procedure btnEditClicked(Sender: TObject); - procedure btnDeleteClicked(Sender: TObject); - procedure btnUpdateClicked(Sender: TObject); - procedure btnQuitClicked(Sender: TObject); - procedure btnRetrieveClicked(Sender: TObject); - public - {@VFD_HEAD_BEGIN: MainForm} - grdName1: TfpgStringGrid; - lblName1: TfpgLabel; - edtName: TfpgEdit; - lblName2: TfpgLabel; - edtAge: TfpgEdit; - btnQuit: TfpgButton; - btnUpdate: TfpgButton; - btnAdd: TfpgButton; - btnEdit: TfpgButton; - btnDelete: TfpgButton; - btnRetrieve: TfpgButton; - lblName3: TfpgLabel; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - -implementation - -uses - fpg_dialogs, frm_personmaint; - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.SetupMediators; -begin - medGrid := TtiStringGridMediatorView.CreateCustom(FList, grdName1, 'Name(200);Age'); -end; - -procedure TMainForm.ValidateData; -var - i: integer; -begin - try - i := StrToInt(edtAge.Text); - if (i < 1) or (i > 100) then - begin - TfpgMessageDialog.Warning('Age out of range', 'Age must be between 1 and 100'); - Abort; - end; - except - on E: Exception do - TfpgMessageDialog.Critical('Age must be a numeric value', E.Message); - end; -end; - -procedure TMainForm.btnAddClicked(Sender: TObject); -var - lData: TPerson; -begin - lData := TPerson.CreateNew; - lData.Name := 'New Name'; - lData.Age := 12; - FList.Add(lData); -end; - -procedure TMainForm.btnEditClicked(Sender: TObject); -begin - if medGrid.SelectedObject = nil then - Exit; - EditPerson(TPerson(medGrid.SelectedObject)); -end; - -procedure TMainForm.btnDeleteClicked(Sender: TObject); -begin - medGrid.SelectedObject.Deleted := True; - FList.NotifyObservers; -end; - -procedure TMainForm.btnUpdateClicked(Sender: TObject); -var - lData: TPerson; -begin - ValidateData; - lData := medGrid.SelectedObject as TPerson; - lData.BeginUpdate; - lData.Name := edtName.Text; - lData.Age := StrToInt(edtAge.Text); - lData.EndUpdate; -end; - -procedure TMainForm.btnQuitClicked(Sender: TObject); -begin - Close; -end; - -procedure TMainForm.btnRetrieveClicked(Sender: TObject); -var - lData: TPerson; -begin - lData := medGrid.SelectedObject as TPerson; - if lData = nil then - Exit; - edtName.Text := lData.Name; - edtAge.Text := IntToStr(lData.Age); -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - FList := GeneratePersonList; -end; - -destructor TMainForm.Destroy; -begin - medGrid.Free; - FList.Free; - inherited Destroy; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(308, 203, 463, 265); - WindowTitle := 'StringGrid Mediator Demo'; - - grdName1 := TfpgStringGrid.Create(self); - with grdName1 do - begin - Name := 'grdName1'; - SetPosition(8, 28, 272, 172); - FontDesc := '#Grid'; - HeaderFontDesc := '#GridHeader'; - end; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(332, 80, 80, 15); - FontDesc := '#Label1'; - Text := 'Name:'; - end; - - edtName := TfpgEdit.Create(self); - with edtName do - begin - Name := 'edtName'; - SetPosition(332, 96, 120, 21); - TabOrder := 2; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(332, 120, 80, 15); - FontDesc := '#Label1'; - Text := 'Age:'; - end; - - edtAge := TfpgEdit.Create(self); - with edtAge do - begin - Name := 'edtAge'; - SetPosition(332, 136, 52, 21); - TabOrder := 4; - Text := ''; - FontDesc := '#Edit1'; - end; - - btnQuit := TfpgButton.Create(self); - with btnQuit do - begin - Name := 'btnQuit'; - SetPosition(376, 236, 80, 23); - Anchors := [anRight,anBottom]; - Text := 'Quit'; - FontDesc := '#Label1'; - ImageName := 'stdimg.quit'; - TabOrder := 5; - OnClick := @btnQuitClicked; - end; - - btnUpdate := TfpgButton.Create(self); - with btnUpdate do - begin - Name := 'btnUpdate'; - SetPosition(356, 168, 80, 23); - Text := 'Update'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 6; - OnClick := @btnUpdateClicked; - end; - - btnAdd := TfpgButton.Create(self); - with btnAdd do - begin - Name := 'btnAdd'; - SetPosition(8, 4, 48, 20); - Text := 'add'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 7; - OnClick := @btnAddClicked; -// Enabled := False; - end; - - btnEdit := TfpgButton.Create(self); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(60, 4, 48, 20); - Text := 'edit'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 8; - OnClick := @btnEditClicked; - end; - - btnDelete := TfpgButton.Create(self); - with btnDelete do - begin - Name := 'btnDelete'; - SetPosition(112, 4, 48, 20); - Text := 'delete'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 9; - OnClick := @btnDeleteClicked; -// Enabled := False; - end; - - btnRetrieve := TfpgButton.Create(self); - with btnRetrieve do - begin - Name := 'btnRetrieve'; - SetPosition(288, 84, 28, 23); - Text := '>>'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 10; - OnClick := @btnRetrieveClicked; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(288, 0, 167, 70); - Anchors := [anLeft,anRight,anTop]; - FontDesc := '#Label1'; - Text := 'The controls below allow you to manually update the selected object. No mediators are used.'; - WrapText := True; - end; - - {@VFD_BODY_END: MainForm} - - SetupMediators; -end; - - -end. diff --git a/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas b/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas deleted file mode 100644 index 96620e92..00000000 --- a/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas +++ /dev/null @@ -1,191 +0,0 @@ -unit frm_personmaint; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_form, fpg_label, fpg_button, - model, model_view; - -type - - TPersonMaintForm = class(TfpgForm) - private - FData: TPerson; - FMemento: TPersonMemento; // This form is the Caretaker - FmedName: TPerson_Name_TextEdit_View; - FmedAge: TPerson_Age_TextEdit_View; - procedure FormShow(Sender: TObject); - procedure SetData(const AValue: TPerson); - procedure SetupMediators; - public - {@VFD_HEAD_BEGIN: PersonMaintForm} - lblName1: TfpgLabel; - edtName: TfpgEdit; - lblName2: TfpgLabel; - edtAge: TfpgEdit; - btnOK: TfpgButton; - btnCancel: TfpgButton; - lblName3: TfpgLabel; - {@VFD_HEAD_END: PersonMaintForm} - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - procedure AfterCreate; override; - property Data: TPerson read FData write SetData; - end; - - -procedure EditPerson(const AData: TPerson); - -{@VFD_NEWFORM_DECL} - -implementation - -procedure EditPerson(const AData: TPerson); -var - frm: TPersonMaintForm; -begin - frm := TPersonMaintForm.Create(nil); - try - frm.Data := AData; - if frm.ShowModal = 2 then // Cancel clicked - begin - // undo changes - AData.BeginUpdate; - AData.Memento := frm.FMemento; - AData.EndUpdate; - end; - finally - frm.Free; - end; -end; - -{@VFD_NEWFORM_IMPL} - -procedure TPersonMaintForm.FormShow(Sender: TObject); -begin - SetupMediators; -end; - -procedure TPersonMaintForm.SetData(const AValue: TPerson); -begin - if FData = AValue then - exit; //==>> - FData := AValue; - FreeAndNil(FMemento); - FMemento := FData.Memento; -end; - -procedure TPersonMaintForm.SetupMediators; -begin - FmedName := TPerson_Name_TextEdit_View.CreateCustom(edtName, FData, 'Name', 'Text'); - FmedAge := TPerson_Age_TextEdit_View.CreateCustom(edtAge, FData, 'Age', 'Text'); -// edtName.Text := FData.Name; -// edtAge.Text := IntToStr(FData.Age); - - // Notify all observers to update themselves. - FData.NotifyObservers; -end; - -constructor TPersonMaintForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - OnShow := @FormShow; -end; - -destructor TPersonMaintForm.Destroy; -begin - FmedName.Free; - FmedAge.Free; - inherited Destroy; -end; - -procedure TPersonMaintForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: PersonMaintForm} - Name := 'PersonMaintForm'; - SetPosition(418, 244, 232, 190); - WindowTitle := 'Edit Person...'; - - lblName1 := TfpgLabel.Create(self); - with lblName1 do - begin - Name := 'lblName1'; - SetPosition(8, 8, 212, 15); - FontDesc := '#Label1'; - Text := 'Name:'; - end; - - edtName := TfpgEdit.Create(self); - with edtName do - begin - Name := 'edtName'; - SetPosition(8, 24, 212, 21); - TabOrder := 1; - Text := ''; - FontDesc := '#Edit1'; - end; - - lblName2 := TfpgLabel.Create(self); - with lblName2 do - begin - Name := 'lblName2'; - SetPosition(8, 56, 212, 15); - FontDesc := '#Label1'; - Text := 'Age:'; - end; - - edtAge := TfpgEdit.Create(self); - with edtAge do - begin - Name := 'edtAge'; - SetPosition(8, 72, 64, 21); - TabOrder := 3; - Text := ''; - FontDesc := '#Edit1'; - end; - - btnOK := TfpgButton.Create(self); - with btnOK do - begin - Name := 'btnOK'; - SetPosition(56, 159, 80, 23); - Anchors := [anRight,anBottom]; - Text := 'OK'; - FontDesc := '#Label1'; - ImageName := ''; - ModalResult := 1; - TabOrder := 4; - end; - - btnCancel := TfpgButton.Create(self); - with btnCancel do - begin - Name := 'btnCancel'; - SetPosition(140, 159, 80, 23); - Anchors := [anRight,anBottom]; - Text := 'Cancel'; - FontDesc := '#Label1'; - ImageName := ''; - ModalResult := 2; - TabOrder := 5; - end; - - lblName3 := TfpgLabel.Create(self); - with lblName3 do - begin - Name := 'lblName3'; - SetPosition(8, 108, 212, 39); - Anchors := [anLeft,anRight,anTop,anBottom]; - FontDesc := '#Label1'; - Text := 'Notice as you change the values they are updated in the MainForm''s Grid.'; - WrapText := True; - end; - - {@VFD_BODY_END: PersonMaintForm} -end; - - -end. diff --git a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi deleted file mode 100644 index b18e4bf3..00000000 --- a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - </RequiredPackages> - <Units Count="6"> - <Unit0> - <Filename Value="stringgridmediatordemo.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="stringgridmediatordemo"/> - </Unit0> - <Unit1> - <Filename Value="frm_main.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_main"/> - </Unit1> - <Unit2> - <Filename Value="../Common/Model.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model"/> - </Unit2> - <Unit3> - <Filename Value="../Common/Constants.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Constants"/> - </Unit3> - <Unit4> - <Filename Value="../Common/Model_View.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="Model_View"/> - </Unit4> - <Unit5> - <Filename Value="frm_personmaint.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frm_personmaint"/> - </Unit5> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="../Common/"/> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Linking> - <Debugging> - <GenerateDebugInfo Value="True"/> - </Debugging> - </Linking> - <Other> - <CustomOptions Value=" -"/> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr deleted file mode 100644 index 366718b0..00000000 --- a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr +++ /dev/null @@ -1,30 +0,0 @@ -program stringgridmediatordemo; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, fpg_main, frm_main, Model, Constants, tiOPFfpGUI, frm_personmaint, - Model_View; - - -procedure MainProc; -var - frm: TMainForm; -begin - fpgApplication.Initialize; - frm := TMainForm.Create(nil); - try - frm.Show; - fpgApplication.Run; - finally - frm.Free; - end; -end; - -begin - MainProc; -end. - diff --git a/extras/tiopf/demos/readme.txt b/extras/tiopf/demos/readme.txt deleted file mode 100644 index 4961aa2c..00000000 --- a/extras/tiopf/demos/readme.txt +++ /dev/null @@ -1,29 +0,0 @@ - - Model-GUI-Mediator (MGM) pattern implementation by Graeme Geldenhuys. - --------------------------------------------------------------------- - -This allows standard controls or any other GUI controls for that matter to become -object-aware. The benefits are much greater ease in cross platform development, -or if you would like to make your favorite set of GUI controls object-aware. - -Please note this is work in progress... -So far I have implemented most used basic edit controls: - TfpgEdit - TfpgSpinEdit (dependend on fpGUI component) - TfpgLabel - TfpgComboBox (single and list property) - TfpgTrackBar - TfpgMemo - TfpgListView (includes popup menu) - TfpgListBox (includes popup menu) - -Currently I am considering implementing the container classes like TfpgTreeView. -They are quite complex and there are multiple ways of implementing them. - -For more information on the MGM pattern, visit Andy Bulka's website. - http://www.atug.com/andypatterns/mgm.htm - - - ----oO0Oo---- - - diff --git a/extras/tiopf/demos/rtf_reporting/demo.rtf b/extras/tiopf/demos/rtf_reporting/demo.rtf deleted file mode 100644 index 637733dd..00000000 --- a/extras/tiopf/demos/rtf_reporting/demo.rtf +++ /dev/null @@ -1,93 +0,0 @@ -{\rtf1\ansi\deff1\adeflang1025 -{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f2\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f3\fswiss\fprq2\fcharset0 DejaVuSans;}{\f4\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f5\fswiss\fprq0\fcharset0 Helvetica;}{\f6\fnil\fprq2\fcharset0 AR PL ShanHeiSun Uni;}{\f7\fnil\fprq0\fcharset0 Tahoma;}{\f8\fswiss\fprq0\fcharset0 Tahoma;}} -{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red255\green0\blue0;\red153\green153\blue153;\red230\green230\blue230;\red128\green128\blue128;} -{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\snext1 Normal;} -{\s2\sb240\sa120\keepn\rtlch\af5\afs28\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs28\lang2057\loch\f5\fs28\lang2057\sbasedon1\snext3 Heading;} -{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext3 Body Text;} -{\s4\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon3\snext4 List;} -{\s5\sb120\sa120\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af3\langfe255\hich\f2\fs24\lang2057\i\loch\f2\fs24\lang2057\i\sbasedon1\snext5 caption;} -{\s6\rtlch\af8\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext6 Index;} -{\s7\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext7 caption;} -{\s8\sb240\sa120\keepn\rtlch\af5\afs21\lang255\ab\ltrch\dbch\af6\langfe255\hich\f5\fs21\lang2057\b\loch\f5\fs21\lang2057\b\sbasedon2\snext3{\*\soutlvl8} heading 9;} -{\s9\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext9 Table Contents;} -{\s10\qc\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b\sbasedon9\snext10 Table Heading;} -{\*\cs12\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 1;} -{\*\cs13\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 2;} -{\*\cs14\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 3;} -{\*\cs15\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 4;} -{\*\cs16\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 5;} -{\*\cs17\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 6;} -{\*\cs18\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 7;} -{\*\cs19\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 8;} -{\*\cs20\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 9;} -{\*\cs21\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 10;} -{\*\cs22\cf2\ul\ulc0\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 Internet link;} -{\*\cs23\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 Numbering Symbols;} -}{\*\listtable{\list\listtemplateid1 -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00.;}{\levelnumbers\'01;}\fi-360\li720} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600} -{\*\soutlvl{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'09.;}{\levelnumbers\'01;}\fi-360\li3960}}{\listname RTF_Num 2;}\listid1} -}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls0}} - -{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern6800}}\deftab709 -{\*\pgdsctbl -{\pgdsc0\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}} -{\*\pgdscno0}\paperh16837\paperw11905\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc -\pard\plain \ltrpar\s1\ql\rtlch\afs32\lang255\ltrch\dbch\af3\langfe255\hich\fs32\lang2057\loch\fs32\lang2057 {\rtlch \ltrch\loch\f1\fs32\lang2057\i0\b0 Simple demo of tiRtfReport} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs20\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\b\loch\fs20\lang2057\b -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\b\loch\fs20\lang2057\b {\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b This shows embedded \\Date\\ \\Time\\ (date & time) value. \line Date \\Date\\ in decoded format: Y=\\SYear(Date)\\ M=\\Month(Date)\\ D=\\Day(Date)\\} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs20\lang255\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\loch\fs20\lang2057 {\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0 If you view the report design you will notice that function parameters do not need to be escaped with the backslash symbol.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Accessing the tiOPF framework objects} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\@count:=0\\\\scan(demoitems)\\} -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat4\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Id} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Name} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Data.Id} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Data.Name} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\scanentry\\\\@count:=@count+1\\} -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\DemoItems.Id\\} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\demoitems.Name\\} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\demoitems.oData.Id\\} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\demoitems.oData.Name\\} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\if(RecordCount(demoitems.oList)>0)\\\\scan(demoitems.oList)\\} -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\demoitems.oList.Id\\} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\demoitems.oList.Name\\} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 \\endscan\\\\endif\\\\endscan\\} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Total of \\@count\\ records in the demoitems list.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Custom function} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is the result of the extra defined function: \\bla\\} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 If you mistype a field name you get something like this: \\First(DemoItems)\\\\DemoItems.Hahaha\\. This is extremely useful for detecting and solving errors in your RTF reports.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Report Design} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Sometimes it is necessary to make report fields hidden so that it fixes report formatting issues. To view all the Report Fields you need to tell OpenOffice to show hidden text.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Follow these steps to view hidden text:} -\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\f3 1.\tab}\ilvl0 \ltrpar\s1\ls0\li720\ri0\lin720\rin0\fi-360\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Enable nonprinting characters: View | Nonprinting Characters} -\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\f3 2.\tab}\ilvl0 \ltrpar\s1\ls0\li720\ri0\lin720\rin0\fi-360\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 If you don't see all the fields yet (eg: between the table header and table details lines) you need to enable the show hidden text option in: Tools | Options | OpenOffice.org Writer | Formatting Aids. Then tick the "Hidden text" option in the "Display of" - section.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\cf3\qc\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b The End!} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par }
\ No newline at end of file diff --git a/extras/tiopf/demos/rtf_reporting/demoproject.lpi b/extras/tiopf/demos/rtf_reporting/demoproject.lpi deleted file mode 100644 index dd154d16..00000000 --- a/extras/tiopf/demos/rtf_reporting/demoproject.lpi +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectOptions> - <Version Value="7"/> - <General> - <Flags> - <SaveOnlyProjectUnits Value="True"/> - <LRSInOutputDirectory Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <TargetFileExt Value=""/> - </General> - <VersionInfo> - <ProjectVersion Value=""/> - </VersionInfo> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="tiOPFfpGUI"/> - </Item1> - </RequiredPackages> - <Units Count="2"> - <Unit0> - <Filename Value="demoproject.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="demoproject"/> - </Unit0> - <Unit1> - <Filename Value="frmMain.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="frmMain"/> - </Unit1> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> -</CONFIG> diff --git a/extras/tiopf/demos/rtf_reporting/frmMain.pas b/extras/tiopf/demos/rtf_reporting/frmMain.pas deleted file mode 100644 index 2cbe8593..00000000 --- a/extras/tiopf/demos/rtf_reporting/frmMain.pas +++ /dev/null @@ -1,313 +0,0 @@ -unit frmMain; - -{$mode objfpc}{$H+} - {$ASMMODE intel} - -interface - -uses - SysUtils, Classes, fpg_base, fpg_main, - fpg_form, fpg_label, fpg_button, - tiRtfReport; - -type - - //Add extra functions in your rtfreport - TRtfPrivateParser = class(TtiRtfParser) - protected - procedure AddFunctions; override; - procedure UdfBla(AArgument: TRtfArgument); - procedure UdfCentreAddress(AArgument: TRtfArgument); - end; - - - TMainForm = class(TfpgForm) - private - ResultFile: string; - TemplateFile: string; - procedure btnEditClicked(Sender: TObject); - procedure btnParseClicked(Sender: TObject); - procedure btnShowClicked(Sender: TObject); - public - {@VFD_HEAD_BEGIN: MainForm} - Label1: TfpgLabel; - btnParse: TfpgButton; - btnEdit: TfpgButton; - btnShow: TfpgButton; - {@VFD_HEAD_END: MainForm} - constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; - end; - -{@VFD_NEWFORM_DECL} - - -implementation - -uses - tiObject, process; - - -type - // Simple BOM structure, nothing fancy - TtiNestedDemoItem = class(TtiObject) - private - FId: integer; - FName: string; - published - property Id: integer read FId write FId; - property Name: string read FName write FName; - end; - - - TtiNestedDemoItems = class(TtiObjectList) - protected - function GetItems(Idx: integer): TtiNestedDemoItem; reintroduce; - public - property Items[Idx: integer]: TtiNestedDemoItem read GetItems; - end; - - - TtiDemoItem = class(TtiObject) - private - FId: integer; - FName: string; - FData: TtiNestedDemoItem; - FList: TtiNestedDemoItems; - public - constructor Create; override; - destructor Destroy; override; - published - property Id: integer read FId write FId; - property Name: string read FName write FName; - property oData: TtiNestedDemoItem read FData; - property oList: TtiNestedDemoItems read FList; - end; - - - TtiDemoItems = class(TtiObjectList) - protected - function GetItems(Idx: integer): TtiDemoItem; reintroduce; - public - procedure Populate; - property Items[Idx: integer]: TtiDemoItem read GetItems; - end; - - -{ TtiNestedDemoItems } - -function TtiNestedDemoItems.GetItems(Idx: integer): TtiNestedDemoItem; -begin - Result := TtiNestedDemoItem(inherited GetItems(Idx)); -end; - - -{ TtiDemoItem } - -constructor TtiDemoItem.Create; -begin - inherited; - FData := TtiNestedDemoItem.Create; - FList := TtiNestedDemoItems.Create; -end; - -destructor TtiDemoItem.Destroy; -begin - FData.Free; - FList.Free; - inherited; -end; - - -{ TtiDemoItems } - -function TtiDemoItems.GetItems(Idx: integer): TtiDemoItem; -begin - Result := TtiDemoItem(inherited GetItems(Idx)); -end; - -procedure TtiDemoItems.Populate; -var - i, j: integer; - ADemoItem: TtiDemoItem; - ANestedDemoItem: TtiNestedDemoItem; -begin - for i := 1 to 20 do begin - ADemoItem := TtiDemoItem.Create; - ADemoItem.Id := i; - ADemoItem.Name := Format('This is demo item %d',[i]); - ADemoItem.oData.Id := i * 1000; - ADemoItem.oData.Name := Format('This is demo data item %d',[i * 1000]); - Add(ADemoItem); - - for j := 1 to Random(5) do begin - ANestedDemoItem := TtiNestedDemoItem.Create; - ANestedDemoItem.Id := j; - ANestedDemoItem.Name := Format('This is nested demo item %d',[j]); - ADemoItem.oList.Add(ANestedDemoItem); - end; - end; -end; - - -{@VFD_NEWFORM_IMPL} - -procedure TMainForm.btnEditClicked(Sender: TObject); -var - p: TProcess; -begin - p := TProcess.Create(nil); - try - p.CommandLine := 'xdg-open ' + TemplateFile; - p.Execute; - finally - p.Free; - end; -end; - -procedure TMainForm.btnParseClicked(Sender: TObject); -var - AStart: TDateTime; - FParser: TRtfPrivateParser; - ADemoItems: TtiDemoItems; -begin - ADemoItems := TtiDemoItems.Create; - try - ADemoItems.Populate; - - try - AStart := Now; - - Label1.Text := 'working'; - btnShow.Enabled := false; - btnParse.Enabled := false; - MouseCursor := mcHourGlass; - FParser := TRtfPrivateParser.Create; - try -// FParser.OnPictureAttr := OnPictureAttr; -// FParser.OnCreateDataset := OnCreateDataset; - FParser.Datasets.Add(ADemoItems, 'DemoItems'); -// FParser.Datasets.Add(tbBioLife, 'BioLife'); - FParser.LoadFromFile(TemplateFile); - FParser.Execute; - FParser.SaveToFile(ResultFile); - finally - FParser.Free; - MouseCursor := mcDefault; - btnShow.Enabled := true; - btnParse.Enabled := true; - end; - - Label1.Text := Format('Session completed in %s',[FormatDateTime('hh:nn:ss:zzz', Now - AStart)]); - btnShow.Click; - except - on E: Exception do begin - fpgApplication.HandleException(E); - end; - end; - - finally - ADemoItems.Free; - end; -end; - -procedure TMainForm.btnShowClicked(Sender: TObject); -var - p: TProcess; -begin - p := TProcess.Create(nil); - try - p.CommandLine := 'xdg-open ' + ResultFile; - p.Execute; - finally - p.Free; - end; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - TemplateFile := 'demo.rtf'; -// TemplateFile := 'demo_ms.rtf'; - ResultFile := 'result.rtf'; - ShortDateFormat := 'yyyy-mm-dd'; -end; - -procedure TMainForm.AfterCreate; -begin - {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(333, 208, 300, 124); - WindowTitle := 'RTF Reporting Demo'; - - Label1 := TfpgLabel.Create(self); - with Label1 do - begin - Name := 'Label1'; - SetPosition(20, 16, 244, 16); - FontDesc := '#Label1'; - Text := '--'; - end; - - btnParse := TfpgButton.Create(self); - with btnParse do - begin - Name := 'btnParse'; - SetPosition(28, 80, 75, 24); - Text := 'Parse'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 1; - OnClick := @btnParseClicked; - end; - - btnEdit := TfpgButton.Create(self); - with btnEdit do - begin - Name := 'btnEdit'; - SetPosition(112, 80, 75, 24); - Text := 'Edit'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 2; - OnClick := @btnEditClicked; - end; - - btnShow := TfpgButton.Create(self); - with btnShow do - begin - Name := 'btnShow'; - SetPosition(196, 80, 75, 24); - Text := 'Show'; - FontDesc := '#Label1'; - ImageName := ''; - TabOrder := 3; - OnClick := @btnShowClicked; - end; - - {@VFD_BODY_END: MainForm} -end; - - -{ TRtfPrivateParser } - -procedure TRtfPrivateParser.AddFunctions; -begin - inherited AddFunctions; - Functions.Add(etFunction, 'Bla', 0, 0, @UdfBla); - Functions.Add(etFunction, 'CentreAddress', 0, 0, @UdfCentreAddress); -end; - -procedure TRtfPrivateParser.UdfBla(AArgument: TRtfArgument); -begin - AArgument.Token := etLitString; - AArgument.Value := 'Best value is 1.5e+400'; -end; - -procedure TRtfPrivateParser.UdfCentreAddress(AArgument: TRtfArgument); -begin - AArgument.Token := etLitString; - AArgument.Value := '8 Stellendal Road, Somerset West, 7130'; -end; - -end. diff --git a/extras/tiopf/demos/rtf_reporting/result.pdf b/extras/tiopf/demos/rtf_reporting/result.pdf Binary files differdeleted file mode 100644 index 67e95d42..00000000 --- a/extras/tiopf/demos/rtf_reporting/result.pdf +++ /dev/null diff --git a/extras/tiopf/demos/rtf_reporting/result.rtf b/extras/tiopf/demos/rtf_reporting/result.rtf deleted file mode 100644 index df05f576..00000000 --- a/extras/tiopf/demos/rtf_reporting/result.rtf +++ /dev/null @@ -1,489 +0,0 @@ -{\rtf1\ansi\deff1\adeflang1025 -{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f2\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f3\fswiss\fprq2\fcharset0 DejaVuSans;}{\f4\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f5\fswiss\fprq0\fcharset0 Helvetica;}{\f6\fnil\fprq2\fcharset0 AR PL ShanHeiSun Uni;}{\f7\fnil\fprq0\fcharset0 Tahoma;}{\f8\fswiss\fprq0\fcharset0 Tahoma;}} -{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red255\green0\blue0;\red153\green153\blue153;\red230\green230\blue230;\red128\green128\blue128;\red0\green0\blue255;\red0\green255\blue255;} -{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\snext1 Normal;} -{\s2\sb240\sa120\keepn\rtlch\af5\afs28\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs28\lang2057\loch\f5\fs28\lang2057\sbasedon1\snext3 Heading;} -{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext3 Body Text;} -{\s4\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon3\snext4 List;} -{\s5\sb120\sa120\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af3\langfe255\hich\f2\fs24\lang2057\i\loch\f2\fs24\lang2057\i\sbasedon1\snext5 caption;} -{\s6\rtlch\af8\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext6 Index;} -{\s7\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext7 caption;} -{\s8\sb240\sa120\keepn\rtlch\af5\afs21\lang255\ab\ltrch\dbch\af6\langfe255\hich\f5\fs21\lang2057\b\loch\f5\fs21\lang2057\b\sbasedon2\snext3{\*\soutlvl8} heading 9;} -{\s9\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext9 Table Contents;} -{\s10\qc\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b\sbasedon9\snext10 Table Heading;} -{\*\cs12\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 1;} -{\*\cs13\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 2;} -{\*\cs14\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 3;} -{\*\cs15\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 4;} -{\*\cs16\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 5;} -{\*\cs17\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 6;} -{\*\cs18\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 7;} -{\*\cs19\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 8;} -{\*\cs20\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 9;} -{\*\cs21\cf0\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 RTF_Num 2 10;} -{\*\cs22\cf2\ul\ulc0\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 Internet link;} -{\*\cs23\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 Numbering Symbols;} -}{\*\listtable{\list\listtemplateid1 -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00.;}{\levelnumbers\'01;}\fi-360\li720} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240} -{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600} -{\*\soutlvl{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'09.;}{\levelnumbers\'01;}\fi-360\li3960}}{\listname RTF_Num 2;}\listid1} -}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls0}} - -{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern6800}}\deftab709 -{\*\pgdsctbl -{\pgdsc0\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}} -{\*\pgdscno0}\paperh16837\paperw11905\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc -\pard\plain \ltrpar\s1\ql\rtlch\afs32\lang255\ltrch\dbch\af3\langfe255\hich\fs32\lang2057\loch\fs32\lang2057 {\rtlch \ltrch\loch\f1\fs32\lang2057\i0\b0 Simple demo of tiRtfReport} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs20\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\b\loch\fs20\lang2057\b -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\b\loch\fs20\lang2057\b {\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b This shows embedded 2008-10-17 11:55:35 (date & time) value. \line Date 2008-10-17 in decoded format: Y=2008 M=10 D=17} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs20\lang255\ltrch\dbch\af3\langfe255\hich\fs20\lang2057\loch\fs20\lang2057 {\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0 If you view the report design you will notice that function parameters do not need to be escaped with the backslash symbol.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Accessing the tiOPF framework objects} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat4\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat4\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Id} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Name} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Data.Id} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Data.Name} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 1000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 2000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 3000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 4000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 4} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 5} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 5} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 5000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 5000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 6} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 6} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 6000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 6000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 4} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 7} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 7} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 7000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 7000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 8} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 8} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 8000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 8000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 4} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 9} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 9} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 9000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 9000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 10} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 10} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 10000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 10000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 11} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 11} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 11000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 11000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 12} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 12} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 12000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 12000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 13} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 13} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 13000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 13000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 14} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 14} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 14000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 14000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 15} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 15} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 15000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 15000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 4} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 16} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 16} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 16000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 16000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 17} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 17} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 17000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 17000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 3} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 3} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 4} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 4} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 18} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 18} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 18000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 18000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 19} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 19} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 19000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 19000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx1264\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx4815\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clcbpat5\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\clcbpat5\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 20} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo item 20} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 20000} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is demo data item 20000} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 1} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 1} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx1260\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4818\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx6540\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9637 -\pard\intbl\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Nested items} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 2} -\cell\pard\plain \intbl\ltrpar\s9\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is nested demo item 2} -\cell\row\pard \pard\plain \ltrpar\s1\v\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 } -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Total of 20 records in the demoitems list.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Custom function} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This is the result of the extra defined function: Best value is 1.5e+400} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 If you mistype a field name you get something like this: {\b\ul\highlight8\cf7 DemoItems.Hahaha Field "Hahaha" does not exist}. This is extremely useful for detecting and solving errors in your RTF reports.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b Report Design} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Sometimes it is necessary to make report fields hidden so that it fixes report formatting issues. To view all the Report Fields you need to tell OpenOffice to show hidden text.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Follow these steps to view hidden text:} -\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\f3 1.\tab}\ilvl0 \ltrpar\s1\ls0\li720\ri0\lin720\rin0\fi-360\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Enable nonprinting characters: View | Nonprinting Characters} -\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\f3 2.\tab}\ilvl0 \ltrpar\s1\ls0\li720\ri0\lin720\rin0\fi-360\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 If you don't see all the fields yet (eg: between the table header and table details lines) you need to enable the show hidden text option in: Tools | Options | OpenOffice.org Writer | Formatting Aids. Then tick the "Hidden text" option in the "Display of" - section.} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\cf3\qc\rtlch\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\b\loch\fs24\lang2057\b {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b The End!} -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af3\langfe255\hich\fs24\lang2057\loch\fs24\lang2057 -\par }
\ No newline at end of file diff --git a/extras/tiopf/gui/tiCompositeMediators.pas b/extras/tiopf/gui/tiCompositeMediators.pas deleted file mode 100644 index e2637056..00000000 --- a/extras/tiopf/gui/tiCompositeMediators.pas +++ /dev/null @@ -1,856 +0,0 @@ -{ - Abstract mediating views for GUI list controls. This allows you to use - standard list components and make them object-aware. See the demo - application for usage. -} -unit tiCompositeMediators; - -{$mode objfpc}{$H+} - -interface - -uses - Classes - ,SysUtils - ,Contnrs { TObjectList } - ,gui_listview { TfpgListView } - ,gui_grid { TfpgStringGrid } - ,tiObject - ; - - -type - TtiMediatorFieldInfo = class - private - FWidth: integer; - FCaption: string; - FPropName: string; - FAlign: TAlignment; - public - property Caption : string read FCaption write FCaption; - property PropName : string read FPropName write FPropName; - property FieldWidth : integer read FWidth write FWidth; - property Alignment : TAlignment read FAlign write FAlign default taLeftJustify; - end; - - { Event object used for OnBeforeSetupField event. Is used to allow formatting - of fields before written to listview Caption or Items. } - TOnBeforeSetupField = procedure(AObject: TtiObject; - const AFieldName: string; var AValue: string) of object; - - { Composite mediator for TfpgListView } - TCompositeListViewMediator = class(TtiObject) - private - FOnBeforeSetupField: TOnBeforeSetupField; - function GetSelectedObject: TtiObject; - procedure SetSelectedObject(const AValue: TtiObject); - procedure SetShowDeleted(const AValue: Boolean); - procedure DoCreateItemMediator(AData: TtiObject); - procedure SetOnBeforeSetupField(const Value: TOnBeforeSetupField); - protected - FIsObserving: Boolean; - FDisplayNames: string; - FShowDeleted: Boolean; - FView: TfpgListView; - FModel: TtiObjectList; - FMediatorList: TObjectList; - FObserversInTransit: TList; - FSelectedObject: TtiObject; - FFieldsInfo : TStringList; - procedure ParseDisplayNames; - procedure CreateSubMediators; virtual; - procedure SetupGUIandObject; virtual; - procedure RebuildList; virtual; - function DataAndPropertyValid(const AData: TtiObject): Boolean; - public - constructor Create; override; - constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; ADisplayNames: string; IsObserving: Boolean = True); overload; - constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; - AOnBeforeSetupField: TOnBeforeSetupField; ADisplayNames: string; IsObserving: Boolean = True); overload; - procedure BeforeDestruction; override; - procedure Update(ASubject: TtiObject); override; - { Called from the GUI to trigger events } - procedure HandleSelectionChanged; virtual; - { Event handler to allow formatting of fields before they are written. } - property OnBeforeSetupField: TOnBeforeSetupField read FOnBeforeSetupField write SetOnBeforeSetupField; - published - property View: TfpgListView read FView; - property Model: TtiObjectList read FModel; - property DisplayNames: string read FDisplayNames; - property IsObserving: Boolean read FIsObserving; - property SelectedObject: TtiObject read GetSelectedObject write SetSelectedObject; - property ShowDeleted: Boolean read FShowDeleted write SetShowDeleted; - end; - - - { Composite mediator for TfpgStringGrid } - TCompositeStringGridMediator = class(TtiObject) - private - function GetSelectedObjected: TtiObject; - procedure SetSelectedObject(const AValue: TtiObject); - procedure SetShowDeleted(const AValue: Boolean); - procedure DoCreateItemMediator(AData: TtiObject); overload; - procedure DoCreateItemMediator(AData: TtiObject; ARowIdx : Integer); overload; - protected - FDisplayNames: string; - FIsObserving: boolean; - FShowDeleted: Boolean; - FView: TfpgStringGrid; - FModel: TtiObjectList; - FMediatorList: TObjectList; - procedure CreateSubMediators; virtual; - procedure SetupGUIandObject; virtual; - procedure RebuildStringGrid; virtual; - function DataAndPropertyValid(const AData: TtiObject): Boolean; - public - constructor CreateCustom(AModel: TtiObjectList; AGrid: TfpgStringGrid; ADisplayNames: string; IsObserving: Boolean = True); - procedure BeforeDestruction; override; - procedure Update(ASubject: TtiObject); override; - published - property View: TfpgStringGrid read FView; - property Model: TtiObjectList read FModel; - property DisplayNames: string read FDisplayNames; - property IsObserving: boolean read FIsObserving; - property ShowDeleted: Boolean read FShowDeleted write SetShowDeleted; - property SelectedObject: TtiObject read GetSelectedObjected write SetSelectedObject; - end; - - - { Used internally for sub-mediators in ListView mediator. Moved to interface - section so it can be overridden. } - TListViewListItemMediator = class(TtiObject) - private - FOnBeforeSetupField: TOnBeforeSetupField; - procedure SetOnBeforeSetupField(const Value: TOnBeforeSetupField); - protected - FModel: TtiObject; - FView: TfpgLVItem; - FDisplayNames: string; - procedure SetupFields; virtual; - public - constructor CreateCustom(AModel: TtiObject; AView: TfpgLVItem; const ADisplayNames: string; IsObserving: Boolean = True); - constructor CreateCustom(AModel: TtiObject; AView: TfpgLVItem; - AOnBeforeSetupField: TOnBeforeSetupField; const ADisplayNames: string; IsObserving: Boolean = True); overload; - procedure BeforeDestruction; override; - procedure Update(ASubject: TtiObject); override; - { Event handler to allow formatting of fields before they are written. } - property OnBeforeSetupField: TOnBeforeSetupField read FOnBeforeSetupField write SetOnBeforeSetupField; - published - property View: TfpgLVItem read FView; - property Model: TtiObject read FModel; - property DisplayNames: string read FDisplayNames; - end; - - - { Used internally for sub-mediators in StringGrid mediator. Moved to interface - section so it can be overridden. } - TStringGridRowMediator = class(TtiObject) - private - FDisplayNames: string; - FView: TfpgStringGrid; - FModel: TtiObject; - FRowIndex: Integer; - protected -// procedure SetupFields; - public - constructor CreateCustom(AModel: TtiObject; AGrid: TfpgStringGrid; ADisplayNames: string; ARowIndex: integer; IsObserving: Boolean = True); - procedure BeforeDestruction; override; - procedure Update(ASubject: TtiObject); override; - published - property Model: TtiObject read FModel; - property View: TfpgStringGrid read FView; - property DisplayNames: string read FDisplayNames; - end; - - -function tiFieldName(const AField: string): string; -function tiFieldWidth(const AField: string): integer; -function tiFieldCaption(const AField: string): string; -function tiFieldAlignment(const AField : string) : TAlignment; - -implementation - -uses - tiUtils - ,typinfo - ,tiExcept - ,tiGenericEditMediators - ; - -const - cFieldDelimiter = ';'; - cBrackets = '()'; - - -{ Helper functions } - -{ Extract the field name part from the AField string which is in the format - fieldname(width,"field caption") eg: Quantity(25,"Qty") will return: Quantity - Width and Field Caption is optional } -function tiFieldName(const AField: string): string; -begin - Result := tiToken(AField, cBrackets[1], 1); -end; - -{ Extract the width part from the AField string which is in the format - fieldname(width,"field caption") eg: Quantity(25,"Qty") will return: 25 - Width and Field Caption is optional } -function tiFieldWidth(const AField: string): integer; -var - s: string; -begin - s := tiSubStr(AField, cBrackets[1], cBrackets[2], 1); - if trim(s) = '' then - Result := 75 // default width - else - Result := StrToInt(tiToken(s, ',', 1)); -end; - -{ Extracts the alignment from the AField string which is in the format - fieldname(width,"field caption",a) where a is the alignment character. - Legal values for the alignment character are :- - < - left aligned - > - right aligned - | - centre aligned - eg: Quantity(25,"Qty",>) will return: Qty with a width of 25 and - the column will be right-aligned. Width, Field Caption and alignment - are optional } -function tiFieldAlignment(const AField : string) : TAlignment; -var - s, a : string; - lAlignChar : Char; -begin - result := taLeftJustify; - s := tiSubStr(AField, cBrackets[1], cBrackets[2], 1); - if trim(s) <> '' then - begin - a := tiToken(s, ',', 3); - if a <> '' then - begin - lAlignChar := a[1]; - Case lAlignChar Of - '<' : Result := taLeftJustify; - '>' : Result := taRightJustify; - '|' : Result := taCenter; - end; { case } - end; - end; -end; - -{ Extract the field caption part from the AField string which is in the format - fieldname(width,"field caption") eg: Quantity(25,"Qty") will return: Qty - Width and Field Caption is optional } -function tiFieldCaption(const AField: string): string; -var - s: string; - p: pchar; -begin - s := tiSubStr(AField, cBrackets[1], cBrackets[2]); - if (trim(s) = '') or (Pos(',', s) = 0) then - // It's only got a width or is blank, so we default to field name - Result := tiFieldName(AField) - else - begin - s := tiToken(s, ',', 2); - p := PChar(s); - Result := AnsiExtractQuotedStr(p, '"'); - end; -end; - - -{ TStringGridRowMediator } - -//procedure TStringGridRowMediator.SetupFields; -//begin -// {$ifdef fpc} {$Note Add the appropriate code here} {$endif} -//end; - - -constructor TStringGridRowMediator.CreateCustom(AModel: TtiObject; - AGrid: TfpgStringGrid; ADisplayNames: string; ARowIndex: integer; - IsObserving: Boolean); -begin - inherited Create; - FModel := AModel; - FView := AGrid; - FDisplayNames := ADisplayNames; - FRowIndex := ARowIndex; - - if IsObserving then - FModel.AttachObserver(self); -end; - -procedure TStringGridRowMediator.BeforeDestruction; -begin - FModel.DetachObserver(self); - FModel := nil; - inherited BeforeDestruction; -end; - -procedure TStringGridRowMediator.Update(ASubject: TtiObject); -var - i: Integer; - lField: string; - lFieldName: string; -begin - Assert(FModel = ASubject); - for i := 0 to tiNumToken(FDisplayNames, cFieldDelimiter)-1 do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, i+1); - lFieldName := tiFieldName(lField); - FView.Cells[i, FRowIndex] := FModel.PropValue[lFieldName]; - end; -end; - - -{ TListViewListItemMediator } - -constructor TListViewListItemMediator.CreateCustom(AModel: TtiObject; - AView: TfpgLVItem; AOnBeforeSetupField: TOnBeforeSetupField; - const ADisplayNames: string; IsObserving: Boolean); -begin - inherited Create; - FModel := AModel; - FView := AView; - FDisplayNames := ADisplayNames; - FOnBeforeSetupField := AOnBeforeSetupField; - - SetupFields; - - if IsObserving then - FModel.AttachObserver(self); -end; - -procedure TListViewListItemMediator.SetOnBeforeSetupField( - const Value: TOnBeforeSetupField); -begin - FOnBeforeSetupField := Value; -end; - -procedure TListViewListItemMediator.SetupFields; -var - c: integer; - lField: string; - lMemberName: string; - lValue: string; -begin - lField := tiToken(FDisplayNames, cFieldDelimiter, 1); - lMemberName := tiFieldName(lField); - lValue := FModel.PropValue[lMemberName]; - - if Assigned(FOnBeforeSetupField) then - FOnBeforeSetupField(FModel, lMemberName, lValue); - - FView.Caption := lValue; - - for c := 2 to tiNumToken(FDisplayNames, cFieldDelimiter) do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, c); - lMemberName := tiFieldName(lField); - lValue := FModel.PropValue[lMemberName]; - - if Assigned(FOnBeforeSetupField) then - FOnBeforeSetupField(FModel, lMemberName, lValue); - - FView.SubItems.Add(lValue); - end; -end; - -constructor TListViewListItemMediator.CreateCustom(AModel: TtiObject; - AView: TfpgLVItem; const ADisplayNames: string; IsObserving: Boolean); -begin - inherited Create; - FModel := AModel; - FView := AView; - FDisplayNames := ADisplayNames; - - SetupFields; - - if IsObserving then - FModel.AttachObserver(self); -end; - -procedure TListViewListItemMediator.BeforeDestruction; -begin - FModel.DetachObserver(self); - FModel := nil; - FView := nil; - inherited BeforeDestruction; -end; - -procedure TListViewListItemMediator.Update(ASubject: TtiObject); -var - c: integer; - lField: string; - lMemberName: string; - lValue: string; -begin - Assert(FModel = ASubject); - - lField := tiToken(DisplayNames, cFieldDelimiter, 1); - lMemberName := tiFieldName(lField); - lValue := FModel.PropValue[lMemberName]; - - if Assigned(FOnBeforeSetupField) then - FOnBeforeSetupField(FModel, lMemberName, lValue); - - FView.Caption := lValue; - - for c := 2 to tiNumToken(DisplayNames, cFieldDelimiter) do - begin - lField := tiToken(DisplayNames, cFieldDelimiter, c); - lMemberName := tiFieldName(lField); - lValue := FModel.PropValue[lMemberName]; - - if Assigned(FOnBeforeSetupField) then - FOnBeforeSetupField(FModel, lMemberName, lValue); - FView.SubItems[c-2] := lValue; - end; -end; - -{ TCompositeListViewMediator } - -procedure TCompositeListViewMediator.SetOnBeforeSetupField( - const Value: TOnBeforeSetupField); -begin - FOnBeforeSetupField := Value; -end; - -procedure TCompositeListViewMediator.SetSelectedObject(const AValue: TtiObject); -var - i: integer; -begin - for i := 0 to FView.Items.Count-1 do - begin - if TtiObject(FView.Items.Item[i].UserData) = AValue then - begin -// FView.Selected := FView.Items.Item[i]; - FView.ItemIndex := i; - HandleSelectionChanged; - Exit; //==> - end; - end; -end; - -function TCompositeListViewMediator.GetSelectedObject: TtiObject; -begin -// if FView.SelCount = 0 then - if FView.ItemIndex = -1 then - FSelectedObject := nil - else -// FSelectedObject := TtiObject(FView.Selected.Data); - FSelectedObject := TtiObject(FView.Items.Item[FView.ItemIndex].UserData); - result := FSelectedObject; -end; - -procedure TCompositeListViewMediator.SetShowDeleted(const AValue: Boolean); -begin - if FShowDeleted = AValue then - Exit; //==> - - BeginUpdate; - try - FShowDeleted := AValue; - RebuildList; - finally - EndUpdate; - end; -end; - -procedure TCompositeListViewMediator.DoCreateItemMediator(AData: TtiObject); -var - li: TfpgLVItem; - m: TListViewListItemMediator; -begin - DataAndPropertyValid(AData); - - { Create ListItem and Mediator } - li := TfpgLVItem.Create(FView.Items); - li.UserData := AData; - FView.Items.Add(li); - m := TListViewListItemMediator.CreateCustom(AData, li, FOnBeforeSetupField, FDisplayNames, FIsObserving); - FMediatorList.Add(m); -end; - -procedure TCompositeListViewMediator.CreateSubMediators; -var - c: integer; - lc: TfpgLVColumn; - lInfo : TtiMediatorFieldInfo; -begin - if View.Columns.Count = 0 then - begin - { Create column headers } - for c := 0 to Pred(FFieldsInfo.Count) do - begin - lInfo := TtiMediatorFieldInfo(FFieldsInfo.Objects[c]); - lc := TfpgLVColumn.Create(View.Columns); - lc.AutoSize := False; - lc.Caption := lInfo.Caption; - lc.Width := lInfo.FieldWidth; - lc.Alignment := lInfo.Alignment; - View.Columns.Add(lc); - end; - end; - FModel.ForEach(@DoCreateItemMediator, FShowDeleted); -end; - -procedure TCompositeListViewMediator.SetupGUIandObject; -begin - { Setup TfpgListView defaults } - FView.Columns.Clear; - FView.Items.Clear; -// FView.ViewStyle := vsReport; - FView.ShowHeaders := True; -// FView.RowSelect := True; -// FView.AutoSize := False; -// FView.ScrollBars := ssAutoBoth; -end; - -procedure TCompositeListViewMediator.RebuildList; -begin - { This rebuilds the whole list. Not very efficient. You can always override - this in your mediators to create a more optimised rebuild. } - View.BeginUpdate; - try - FMediatorList.Clear; - View.Columns.Clear; - View.Items.Clear; - CreateSubMediators; - finally - View.EndUpdate; - end; -end; - -function TCompositeListViewMediator.DataAndPropertyValid(const AData: TtiObject): Boolean; -var - c: integer; - lField: string; -begin - result := (FModel <> nil) and (FDisplayNames <> ''); - if not result then - Exit; //==> - - for c := 1 to tiNumToken(FDisplayNames, cFieldDelimiter) do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, c); - { WRONG!! We should test the items of the Model } - result := (IsPublishedProp(AData, tiFieldName(lField))); - if not result then - raise Exception.CreateFmt('<%s> is not a property of <%s>', - [tiFieldName(lField), AData.ClassName ]); - end; -end; - -constructor TCompositeListViewMediator.Create; -begin - inherited Create; - FObserversInTransit := TList.Create; - FFieldsInfo := TStringList.Create; -end; - -constructor TCompositeListViewMediator.CreateCustom(AModel: TtiObjectList; - AView: TfpgListView; AOnBeforeSetupField: TOnBeforeSetupField; - ADisplayNames: string; IsObserving: Boolean); -begin - Create; // don't forget this - - FModel := AModel; - FView := AView; - FMediatorList := TObjectList.Create; - FIsObserving := IsObserving; - FDisplayNames := ADisplayNames; - FShowDeleted := False; - - Assert(Assigned(AOnBeforeSetupField), 'OnBeforeSetupField not assigned'); - FOnBeforeSetupField := AOnBeforeSetupField; - - SetupGUIandObject; - - { TODO: This must be improved. If no ADisplayNames value maybe default to a - single column listview using the Caption property } - if (ADisplayNames <> '') and (tiNumToken(ADisplayNames, cFieldDelimiter) > 0) then - begin - ParseDisplayNames; - CreateSubMediators; - end; - - if IsObserving then - FModel.AttachObserver(self); - -end; - -constructor TCompositeListViewMediator.CreateCustom(AModel: TtiObjectList; - AView: TfpgListView; ADisplayNames: string; IsObserving: Boolean); -begin - Create; // don't forget this - - FModel := AModel; - FView := AView; - FMediatorList := TObjectList.Create; - FIsObserving := IsObserving; - FDisplayNames := ADisplayNames; - FShowDeleted := False; - - SetupGUIandObject; - - { TODO: This must be improved. If no ADisplayNames value, maybe default to a - single column listview using the Caption property } - if (ADisplayNames <> '') and (tiNumToken(ADisplayNames, cFieldDelimiter) > 0) then - begin - ParseDisplayNames; - CreateSubMediators; - end; - - if IsObserving then - FModel.AttachObserver(self); -end; - -procedure TCompositeListViewMediator.BeforeDestruction; -begin - FFieldsInfo.Free; - FObserversInTransit.Free; - FMediatorList.Free; - FModel.DetachObserver(self); - FModel := nil; - FView := nil; - inherited BeforeDestruction; -end; - -procedure TCompositeListViewMediator.Update(ASubject: TtiObject); -begin - Assert(FModel = ASubject); - RebuildList; -end; - -{ TODO: This is not working 100% yet. Be warned! } -procedure TCompositeListViewMediator.HandleSelectionChanged; -var - i: integer; -begin - if View.ItemIndex = -1 then - FSelectedObject := nil - else - begin - FObserversInTransit.Clear; - { If an item is already selected, assign the item's List of observers to a - temporary container. This is done so that the same observers can be - assigned to the new item. } - if Assigned(FSelectedObject) then - FObserversInTransit.Assign(FSelectedObject.ObserverList); - - // Assign Newly selected item to SelectedObject Obj. - FSelectedObject := TtiObject(View.Items.Item[View.ItemIndex].UserData); - - { If an object was selected, copy the old item's observer List - to the new item's observer List. } - if FObserversInTransit.Count > 0 then - FSelectedObject.ObserverList.Assign(FObserversInTransit); - - { Set the Observers Subject property to the selected object } - for i := 0 to FSelectedObject.ObserverList.Count-1 do - begin - TMediatorView(FSelectedObject.ObserverList.Items[i]).Subject := - FSelectedObject; - end; - - // execute the NotifyObservers event to update the observers. - FSelectedObject.NotifyObservers; - end; -end; - -procedure TCompositeListViewMediator.ParseDisplayNames; -Var - I : Integer; - lField : String; - lInfo : TtiMediatorFieldInfo; -begin - for I := 1 to tiNumToken(FDisplayNames, cFieldDelimiter) do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, I); - lInfo := TtiMediatorFieldInfo.Create; - lInfo.PropName := tiFieldName(lField); - lInfo.Caption := tiFieldCaption(lField); - lInfo.FieldWidth := tiFieldWidth(lField); - lInfo.Alignment := tiFieldAlignment(lField); - FFieldsInfo.AddObject(lInfo.Caption + '=' + tiFieldName(lField), lInfo); - end; { Loop } -end; - -{ TCompositeStringGridMediator } - -function TCompositeStringGridMediator.GetSelectedObjected: TtiObject; -begin - if FView.FocusRow = -1 then -// if FView.Selection.Top = 0 then - Result := nil - else -// Result := TtiObject(FView.Objects[1, FView.Selection.Top]); - Result := TtiObject(FView.Objects[0, FView.FocusRow]); -end; - -procedure TCompositeStringGridMediator.SetSelectedObject(const AValue: TtiObject); -var - i: integer; -begin - for i := 0 to FView.RowCount-1 do - begin - if TtiObject(FView.Objects[0, i]) = AValue then - begin - FView.FocusRow := i; - Exit; //==> - end; - end; -end; - -procedure TCompositeStringGridMediator.SetShowDeleted(const AValue: Boolean); -begin - if FShowDeleted = AValue then - Exit; //==> - - BeginUpdate; - try - FShowDeleted := AVAlue; - RebuildStringGrid; - finally - EndUpdate; - end; -end; - -procedure TCompositeStringGridMediator.DoCreateItemMediator(AData: TtiObject); -begin - DataAndPropertyValid(AData); -end; - -procedure TCompositeStringGridMediator.DoCreateItemMediator(AData: TtiObject; ARowIdx: Integer); -var - i: Integer; - lField: string; - lFieldName: string; - lMediatorView: TStringGridRowMediator; -begin - FView.Objects[0, ARowIdx] := AData; // set Object reference inside grid - for i := 0 to tiNumToken(FDisplayNames, cFieldDelimiter)-1 do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, i+1); - lFieldName := tiFieldName(lField); - FView.Cells[i, ARowIdx] := AData.PropValue[lFieldName]; // set Cell text - lMediatorView := TStringGridRowMediator.CreateCustom(AData, FView, FDisplayNames, ARowIdx, FIsObserving); - FMediatorList.Add(lMediatorView); - end; -end; - -procedure TCompositeStringGridMediator.CreateSubMediators; -var - i: integer; - lField: string; - lColumnTotalWidth: integer; -begin - lColumnTotalWidth := 0; - for i := 0 to tiNumToken(FDisplayNames, cFieldDelimiter)-1 do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, i+1); - FView.ColumnWidth[i] := tiFieldWidth(lField); - FView.ColumnTitle[i] := tiFieldCaption(lField); - - //resize the last column to fill the grid. - if i = tiNumToken(FDisplayNames, cFieldDelimiter)-1 then - FView.ColumnWidth[i] := FView.Width - (lColumnTotalWidth + 10) - else - lColumnTotalWidth := lColumnTotalWidth + FView.ColumnWidth[i] + 20; - end; - - for i := 0 to FModel.Count-1 do // loop through all items - begin - if (not FModel.Items[i].Deleted) or FShowDeleted then - DoCreateItemMediator(FModel.Items[i], i); - end; -end; - -procedure TCompositeStringGridMediator.SetupGUIandObject; -begin - //Setup default properties for the StringGrid - FView.RowSelect := True; - FView.ColumnCount := tiNumToken(FDisplayNames, cFieldDelimiter); - if FShowDeleted then - FView.RowCount := FModel.Count - else - FView.RowCount := FModel.CountNotDeleted; -end; - -procedure TCompositeStringGridMediator.RebuildStringGrid; -var - i: integer; -begin - { This rebuilds the whole list. Not very efficient. } - View.BeginUpdate; - try - SetupGUIandObject; - FMediatorList.Clear; -// for i := View.ColumnCount-1 downto 0 do -// View.DeleteColumn(i); - CreateSubMediators; - finally - View.EndUpdate; - end; -end; - -function TCompositeStringGridMediator.DataAndPropertyValid(const AData: TtiObject): Boolean; -var - i: Integer; - lField: string; -begin - Result := (FModel <> nil) and (FDisplayNames <> ''); - - if not Result then - Exit; //==> - - for i := 1 to tiNumToken(FDisplayNames, cFieldDelimiter) do - begin - lField := tiToken(FDisplayNames, cFieldDelimiter, i); - Result := IsPublishedProp(AData, tiFieldName(lField)); - - if not Result then - raise Exception.CreateFmt('<%s> is not a property of <%s>', - [tiFieldName(lField), AData.ClassName]); - end; -end; - -constructor TCompositeStringGridMediator.CreateCustom(AModel: TtiObjectList; - AGrid: TfpgStringGrid; ADisplayNames: string; IsObserving: Boolean); -begin - inherited Create; - - FModel := AModel; - FView := AGrid; - FMediatorList := TObjectList.Create; - FIsObserving := IsObserving; - FDisplayNames := ADisplayNames; - FShowDeleted := False; - - SetupGUIandObject; - if (FDisplayNames <> '') and (tiNumToken(ADisplayNames, cFieldDelimiter) > 0) then - CreateSubMediators; - - if IsObserving then - FModel.AttachObserver(Self); -end; - -procedure TCompositeStringGridMediator.BeforeDestruction; -begin - FMediatorList.Free; - if Assigned(FModel) then - FModel.DetachObserver(Self); - FModel := nil; - FView := nil; - inherited BeforeDestruction; -end; - -procedure TCompositeStringGridMediator.Update(ASubject: TtiObject); -begin - Assert(FModel = ASubject); - RebuildStringGrid; -end; - -end. - diff --git a/extras/tiopf/gui/tiDialogs.pas b/extras/tiopf/gui/tiDialogs.pas deleted file mode 100644 index 04f4d896..00000000 --- a/extras/tiopf/gui/tiDialogs.pas +++ /dev/null @@ -1,260 +0,0 @@ -unit tiDialogs; - -{$mode objfpc}{$H+} - -{ TODO: Port tiProcessing and tiEndProcessing } - -interface - -uses - Classes, - SysUtils, - Variants, - fpg_base; - - - // Call showMessage, but accepts a variant. Good for debugging. - procedure tiShowMessage(const AArray: Array of Const); overload; - procedure tiShowMessage(const AValue: variant); overload; - - - // Show the contents of a TStringList - for debugging - procedure tiShowStringList(const AStringList: TStringList; const AHeading: TfpgString = 'Show string list'); - // Show the contents of a TStrings - for debugging - procedure tiShowStrings(const AStrings: TStrings; const AHeading: TfpgString = 'Show strings'); - // Show a long string - for debugging - procedure tiShowString(const AStr: TfpgString; const AHeading: TfpgString = 'Show string'); - // Show a variant array of variants - for debugging - procedure tiShowVariant(AValue: Variant; AHeading: TfpgString = 'Show variant'); - // Show the contents of a stream - procedure tiShowStream(const AValue: TStream; const AHeading: TfpgString = 'Show stream'); - // Show a <Yes>, <No> dialog box, and return true if <Yes> was selected - function tiAppConfirmation(const AMessage: TfpgString; ATitle: TfpgString = ''): boolean; overload; - function tiAppConfirmation(const AMessage: TfpgString; const AValues: array of const): boolean; overload; - // Show a message - procedure tiAppMessage(const AMessage: TfpgString; ATitle: TfpgString = ''); - // Show a warning - procedure tiAppWarning(const AMessage: TfpgString; ATitle: TfpgString = ''); - // Show a error message - procedure tiAppError(const AMessage: TfpgString; ATitle: TfpgString = ''); - - // A type of notification window that will disappear by it self - procedure tiProcessing(const AMessage: TfpgString); - procedure tiEndProcessing; - -implementation - -uses - fpg_main, - fpg_form, - fpg_memo, - fpg_label, - fpg_dialogs, - fpg_panel, - tiGUIINI, - tiUtils; - -var - pWorkingForm: TfpgForm; - -type - TProcessingForm = class(TfpgForm) - private - {@VFD_HEAD_BEGIN: ProcessingForm} - Bevel1: TfpgBevel; - lblMessage: TfpgLabel; - {@VFD_HEAD_END: ProcessingForm} - public - procedure AfterCreate; override; - end; - -{ TProcessingForm } - -procedure TProcessingForm.AfterCreate; -begin - {%region 'Auto-generated GUI code' -fold} - {@VFD_BODY_BEGIN: ProcessingForm} - Name := 'ProcessingForm'; - SetPosition(317, 177, 400, 150); - WindowTitle := 'Processing...'; - WindowPosition := wpScreenCenter; - BackgroundColor := clHilite1; - WindowType := wtPopup; - - Bevel1 := TfpgBevel.Create(self); - with Bevel1 do - begin - Name := 'Bevel1'; - SetPosition(8, 4, 232, 80); - Align := alClient; - end; - - lblMessage := TfpgLabel.Create(Bevel1); - with lblMessage do - begin - Name := 'lblMessage'; - SetPosition(32, 28, 108, 32); - Alignment := taCenter; - FontDesc := '#Label1'; - Hint := ''; - Layout := tlCenter; - Text := '...'; - WrapText := True; - Align := alClient; - MouseCursor := mcHourGlass; - end; - - {@VFD_BODY_END: ProcessingForm} - {%endregion} -end; - - - -procedure tiShowMessage(const AArray: array of const); -const - BoolChars: array[Boolean] of Char = ('F', 'T'); -var - i: Integer; - lsLine: string; -begin - lsLine := ''; - for I := 0 to High(AArray) do begin - if lsLine <> '' then - lsLine := lsLine + Cr; - with AArray[i] do - case VType of - vtInteger: lsLine := lsLine + IntToStr(VInteger); - vtBoolean: lsLine := lsLine + BoolChars[VBoolean]; - vtChar: lsLine := lsLine + VChar; - vtExtended: lsLine := lsLine + FloatToStr(VExtended^); - vtString: lsLine := lsLine + VString^; - vtPChar: lsLine := lsLine + VPChar; - vtObject: lsLine := lsLine + VObject.ClassName; - vtClass: lsLine := lsLine + VClass.ClassName; - vtAnsiString: lsLine := lsLine + string(VAnsiString); - vtCurrency: lsLine := lsLine + CurrToStr(VCurrency^); - vtVariant: lsLine := lsLine + string(VVariant^); - vtInt64: lsLine := lsLine + IntToStr(VInt64^); - end; - end; - tiShowMessage(lsLine); -end; - -procedure tiShowMessage(const AValue: variant); -begin - ShowMessage(VarToStr(AValue)); -end; - -procedure tiShowStringList(const AStringList: TStringList; const AHeading: TfpgString); -begin - tiShowStrings(AStringList, AHeading); -end; - -procedure tiShowStrings(const AStrings: TStrings; const AHeading: TfpgString); -var - lForm: TfpgForm; - lMemo: TfpgMemo; -begin - lForm := TfpgForm.Create(nil); - lMemo := TfpgMemo.Create(lForm); - try - lForm.WindowTitle := AHeading; - lForm.Width := 300; - lForm.Height := 300; - lForm.WindowPosition := wpScreenCenter; - lForm.Name := 'FormShowStrings'; - lMemo.Lines.Assign(AStrings); - lMemo.FontDesc := 'Courier New-10'; - gGUIINI.ReadFormState(lForm); - lMemo.SetPosition(0, 0, lForm.Width, lForm.Height); - lMemo.Align := alClient; - lForm.ShowModal; - gGUIINI.WriteFormState(lForm); - finally - lForm.free; - end; -end; - -procedure tiShowString(const AStr: TfpgString; const AHeading: TfpgString); -var - lSL: TStringList; -begin - lSL := TStringList.Create; - try - lSL.Text := AStr; - tiShowStringList(lSL, AHeading); - finally - lSL.Free; - end; -end; - -procedure tiShowVariant(AValue: Variant; AHeading: TfpgString); -var - ls: string; -begin - ls := tiVariantArrayToString(AValue); - tiShowString(ls, AHeading); -end; - -procedure tiShowStream(const AValue: TStream; const AHeading: TfpgString); -var - lStringStream: TStringStream; -begin - lStringStream := TStringStream.Create(''); - try - AValue.Position := 0; - lStringStream.CopyFrom(AValue, AValue.Size); - tiShowString(lStringStream.DataString, AHeading); - finally - lStringStream.Free; - end; -end; - -function tiAppConfirmation(const AMessage: TfpgString; ATitle: TfpgString = ''): boolean; -begin - Result := TfpgMessageDialog.Question(ATitle, AMessage) = mbYes -end; - -function tiAppConfirmation(const AMessage: TfpgString; - const AValues: array of const): boolean; -begin - Result := tiAppConfirmation(Format(AMessage, AValues)); -end; - -procedure tiAppMessage(const AMessage: TfpgString; ATitle: TfpgString = ''); -begin - TfpgMessageDialog.Information(ATitle, AMessage); -end; - -procedure tiAppWarning(const AMessage: TfpgString; ATitle: TfpgString = ''); -begin - TfpgMessageDialog.Warning(ATitle, AMessage); -end; - -procedure tiAppError(const AMessage: TfpgString; ATitle: TfpgString = ''); -begin - TfpgMessageDialog.Critical(ATitle, AMessage); -end; - -procedure tiProcessing(const AMessage: TfpgString); -begin - if not Assigned(pWorkingForm) then - begin - pWorkingForm := TProcessingForm.Create(nil); - TProcessingForm(pWorkingForm).lblMessage.Text := AMessage; - pWorkingForm.Show; - end - else - TProcessingForm(pWorkingForm).lblMessage.Text := AMessage; - fpgApplication.ProcessMessages; -end; - -procedure tiEndProcessing; -begin - if Assigned(pWorkingForm) then - pWorkingForm.Close; - FreeAndNil(pWorkingForm); -end; - -end. - diff --git a/extras/tiopf/gui/tiGUIConstants.pas b/extras/tiopf/gui/tiGUIConstants.pas deleted file mode 100644 index 80a7bbf1..00000000 --- a/extras/tiopf/gui/tiGUIConstants.pas +++ /dev/null @@ -1,17 +0,0 @@ -unit tiGUIConstants; - -{$mode objfpc}{$H+} - -interface - -uses - fpg_base - ; - -const - clError = clYellow; - -implementation - -end. - diff --git a/extras/tiopf/gui/tiGUIINI.pas b/extras/tiopf/gui/tiGUIINI.pas deleted file mode 100644 index 4d13a989..00000000 --- a/extras/tiopf/gui/tiGUIINI.pas +++ /dev/null @@ -1,129 +0,0 @@ -unit tiGUIINI; - -{$mode objfpc}{$H+} - -{ TODO: When TfpgForm supports FormState property, implement the remaining functions. } - -interface -uses - tiINI - ,fpg_form - ; - -type - - TtiGuiINIFile = class(TtiINIFile) - public - procedure ReadFormState(AForm: TfpgForm; AHeight: integer = -1; AWidth: integer = -1); - procedure WriteFormState(AForm : TfpgForm); - end; - -function gGUIINI(const AFileName: string = ''): TtiGuiINIFile; - - -implementation -uses - fpg_main - ; - -var - uGuiINI : TtiGuiINIFile; - - -function gGUIINI(const AFileName: string = ''): TtiGuiINIFile; -begin - if uGuiINI = nil then - begin - uGuiINI := TtiGuiINIFile.CreateExt(AFileName); - uGuiINI.CacheUpdates := False; - end; - result := uGuiINI; -end; - -procedure TtiGuiINIFile.ReadFormState(AForm: TfpgForm; AHeight : integer = -1; AWidth : integer = -1); -var - LINISection: string; - LTop: integer; - LLeft: integer; - LHeight: integer; - LWidth: integer; -begin - Assert(AForm <> nil, 'AForm not assigned'); - LINISection := AForm.Name + 'State'; - // Read form position, -1 if not stored in registry - LTop := readInteger(LINISection, 'Top', -1); - LLeft := readInteger(LINISection, 'Left', -1); - // The form pos was found in the ini file - if (LTop <> -1) and (LLeft <> -1) then - begin - AForm.Top := readInteger(LINISection, 'Top', AForm.Top); - AForm.Left := readInteger(LINISection, 'Left', AForm.Left); - AForm.WindowPosition := wpUser; - end - else - begin // No form pos in the ini file, so default to screen center - if Assigned(fpgApplication.MainForm) and (fpgApplication.MainForm <> AForm) then - AForm.WindowPosition := wpAuto - else - AForm.WindowPosition := wpScreenCenter; - end; - - { 2008-11-20 graemeg: disabled Width and Height settings for now. It causes - major headaches, plus in most applications the forms have been designed - with specific sizes for best look and fit. The user can still adjust sizes - at runtime, they will just not be remembered. I will attend to this issue - at a later date. } - // Only set the form size if a bsSizable window - //if AForm.Sizeable then - //begin - //if AHeight = -1 then - //LHeight := AForm.Height - //else - //LHeight := AHeight; - //if AWidth = -1 then - //LWidth := AForm.Width - //else - //LWidth := AWidth; - //AForm.Height := readInteger(LINISection, 'Height', LHeight); - //AForm.Width := readInteger(LINISection, 'Width', LWidth); - //end; - - // If the form is off screen (positioned outside all monitor screens) then - // center the form on screen. - if AForm.WindowPosition = wpUser then - begin - if (AForm.Top < 0) or (AForm.Top > fpgApplication.ScreenHeight) or - (AForm.Left < 0) or (AForm.Left > fpgApplication.ScreenWidth) then - AForm.WindowPosition := wpScreenCenter; - end; -end; - -procedure TtiGuiINIFile.WriteFormState(AForm: TfpgForm); -var - LINISection: string; -begin - LINISection := AForm.Name + 'State'; - WriteInteger(LINISection, 'Top', AForm.Top); - WriteInteger(LINISection, 'Left', AForm.Left); - if AForm.Sizeable then - begin - WriteInteger(LINISection, 'Height', AForm.Height); - WriteInteger(LINISection, 'Width', AForm.Width); - end; -end; - -initialization - uGuiINI := nil; - -finalization - uGuiINI.Free; - -end. - - - - - - - - diff --git a/extras/tiopf/gui/tiGUIUtils.pas b/extras/tiopf/gui/tiGUIUtils.pas deleted file mode 100644 index 86653304..00000000 --- a/extras/tiopf/gui/tiGUIUtils.pas +++ /dev/null @@ -1,18 +0,0 @@ -unit tiGUIUtils; - -{$mode objfpc}{$H+} - -interface - -uses - Classes - ; - - // Mouse cursor routines -// function tiAutoWaitCursor: IUnknown; -// function tiAutoCursor(ACursor: TCursor = crHourglass): IUnknown; - -implementation - -end. - diff --git a/extras/tiopf/gui/tiGenericEditMediators.pas b/extras/tiopf/gui/tiGenericEditMediators.pas deleted file mode 100644 index 6e24fe2e..00000000 --- a/extras/tiopf/gui/tiGenericEditMediators.pas +++ /dev/null @@ -1,974 +0,0 @@ -(* - -Revision history: - 2005-08-17: First release by Graeme Geldenhuys (graemeg@gmail.com) - 2007-08-24: Ported the code to the fpGUI toolkit. [Graeme] - 2008-05-20: Updates due to fpGUI components now being 0-based. [Graeme] - -Purpose: - Abstract mediating view and Mediator Factory. This allows you to use - standard edit components and make them object-aware. See the demo - application for usage. - -ToDo: - * Implement a View Manager class, so we can remove the View Lists - created in each Form using mediating views. - * As soon as TfpgSpinEdit has been implemented, port the SpinEdit mediator - -*) - -unit tiGenericEditMediators; - -{$mode objfpc}{$H+} - -interface -uses - tiObject - ,Classes - ,fpgfx - ,gfx_widget - ,gui_edit - ,gui_checkbox - ,gui_label - ,gui_trackbar - ,gui_combobox - ,gui_memo - ,gui_popupcalendar - ; - -type - TMediatingViewClass = class of TMediatorView; - - { Base class to inherit from to make more customised Mediator Views. } - TMediatorView = class(TtiObject) - private - FSettingUp: Boolean; - FFieldName: string; - FSubject: TtiObject; - FEditControl: TfpgWidget; - FGuiFieldName: string; - FErrorMessage: string; - procedure TestIfValid; - protected - UseInternalOnChange: boolean; - function GetSubject: TtiObject; virtual; - { Used to setup things like the MaxLength of a edit box, etc. } - procedure SetupGUIandObject; virtual; - { Used for doing validation checks and changing the color of edit controls - in error } - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); virtual; - function DataAndPropertyValid: Boolean; - procedure DoOnChange(Sender: TObject); virtual; - public - constructor Create; override; - constructor CreateCustom(pEditControl: TfpgWidget; pSubject: TtiObject; pFieldName: string; pGuiFieldName: string = ''); - destructor Destroy; override; - { Copies values from the edit control to the Subject } - procedure GuiToObject; virtual; - { Copies property values from the Subject to the edit control } - procedure ObjectToGui; virtual; - procedure Update(pSubject: TtiObject); override; - { This is what gets called from the edit controls OnChange event, to - trigger a update } - procedure GUIChanged; - { The object being edited or observed } - property Subject: TtiObject read GetSubject write FSubject; - { The edit control used for editing a property of the Subject } - property EditControl: TfpgWidget read FEditControl write FEditControl; - { Not being used at the moment } - property ErrorMessage: string read FErrorMessage write FErrorMessage; - class function ComponentClass: TClass; virtual; abstract; - published - { Property of the Subject being edited } - property FieldName: string read FFieldName write FFieldName; - { Property of the edit control used to get/set the new updated value } - property GuiFieldName: string read FGuiFieldName write FGuiFieldName; - end; - - - { Base class to handle TfpgEdit controls } - TMediatorEditView = class(TMediatorView) - private - function GetEditControl: TfpgEdit; - procedure SetEditControl(const AValue: TfpgEdit); - protected - procedure SetupGUIandObject; override; - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); override; - public - constructor CreateCustom(pEditControl: TfpgWidget; pSubject: TtiObject; pFieldName: string; pGuiFieldName: string = 'Text'); reintroduce; - destructor Destroy; override; - property EditControl: TfpgEdit read GetEditControl write SetEditControl; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgCheckBox controls } - TMediatorCheckBoxView = class(TMediatorView) - private - function GetEditControl: TfpgCheckBox; - procedure SetEditControl(const AValue: TfpgCheckBox); - protected - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); override; - public - property EditControl: TfpgCheckBox read GetEditControl write SetEditControl; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgLabel controls } - TMediatorStaticTextView = class(TMediatorView) - private - function GetEditControl: TfpgLabel; - procedure SetEditControl(const AValue: TfpgLabel); - protected - procedure SetupGUIandObject; override; - public - property EditControl: TfpgLabel read GetEditControl write SetEditControl; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TSpinEdit controls } -{ - TMediatorSpinEditView = class(TMediatorView) - private - function GetEditControl: TSpinEdit; - procedure OnLostFocus(Sender: TObject); - procedure SetEditControl(const AValue: TSpinEdit); - protected - procedure SetupGUIandObject; override; - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); override; - public - property EditControl: TSpinEdit read GetEditControl write SetEditControl; - procedure GuiToObject; override; - class function ComponentClass: TClass; override; - end; -} - - { Base class to handle TfpgTrackBar controls } - TMediatorTrackBarView = class(TMediatorView) - private - function GetEditControl: TfpgTrackBar; - procedure SetEditControl(const AValue: TfpgTrackBar); - public - property EditControl: TfpgTrackBar read GetEditControl write SetEditControl; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgComboBox controls } - TMediatorComboBoxView = class(TMediatorView) - private - function GetEditControl: TfpgComboBox; - procedure SetEditControl(const AValue: TfpgComboBox); - protected - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); override; - public - property EditControl: TfpgComboBox read GetEditControl write SetEditControl; - procedure ObjectToGui; override; - class function ComponentClass: TClass; override; - end; - - - { TComboBox observing a list and setting a Object property } - TMediatorDynamicComboBoxView = class(TMediatorComboBoxView) - private - FList: TtiObjectList; - FExternalOnChange: TNotifyEvent; - procedure SetList(const AValue: TtiObjectList); - procedure InternalListRefresh; - protected - procedure SetOnChangeActive(AValue: Boolean); virtual; - procedure SetupGUIandObject; override; - public - constructor CreateCustom(pList: TtiObjectList; pEditControl: TfpgWidget; pSubject: TtiObject; pFieldName: string); reintroduce; - destructor Destroy; override; - procedure GuiToObject; override; - procedure ObjectToGui; override; - procedure RefreshList; virtual; - property List: TtiObjectList read FList write SetList; - end; - - - { Base class to handle TfpgMemo controls } - TMediatorMemoView = class(TMediatorView) - private - function GetEditControl: TfpgMemo; - procedure SetEditControl(const AValue: TfpgMemo); - protected - procedure SetupGUIandObject; override; - public - property EditControl: TfpgMemo read GetEditControl write SetEditControl; - procedure ObjectToGui; override; - procedure GuiToObject; override; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgCalendarCombo controls } - TMediatorCalendarComboView = class(TMediatorView) - private - function GetEditControl: TfpgCalendarCombo; - procedure SetEditControl(const AValue: TfpgCalendarCombo); - public - property EditControl: TfpgCalendarCombo read GetEditControl write SetEditControl; - class function ComponentClass: TClass; override; - end; - - - { Data class for mapping a name to a class } - TMediatorViewMapping = class(TObject) - private - FMediatingViewClass: TMediatingViewClass; - FName: string; - public - constructor CreateExt(pName: String; pMediatingClass: TMediatingViewClass); - property Name: string read FName write FName; - property MediatingViewClass: TMediatingViewClass read FMediatingViewClass write FMediatingViewClass; - end; - - - { This is a parameter object, instead of a whole bunch of single parameters } - TMGMEditLink = class(TObject) - private - FEditControl: TfpgWidget; - FEditObject: TtiObject; - FObjectEditProperty: string; - FControlEditProperty: string; - public - property EditControl: TfpgWidget read FEditControl write FEditControl; - property EditObject: TtiObject read FEditObject write FEditObject; - property ObjectEditProperty: string read FObjectEditProperty write FObjectEditProperty; - property ControlEditProperty: string read FControlEditProperty write FControlEditProperty; - end; - - - { Factory class to register and create your mediating views } - TMediatorFactory = class(TObject) - private - MappingList: TStringList; - function FindMediatorClass(pSubject: TtiObject; pComponentClass: TClass; pFieldName: string): TMediatingViewClass; - function GetMediatorClass(pSubject: TtiObject; pComponentClass: TClass; pFieldName: string): TMediatingViewClass; - public - constructor Create; - destructor Destroy; override; - function CreateMediator(pComponent: TfpgWidget; pSubject: TtiObject; pFieldName: String; pGuiFieldName: string): TMediatorView; overload; - function CreateMediator(pEditLink: TMGMEditLink): TMediatorView; overload; -// function FindMediator(pComponent: TControl): TMediatorView; - procedure RegisterMediatorClass(FieldName: string; MediatorClass: TMediatingViewClass); - end; - - - { Simple singelton for the Factory } - function gMediatorFactory: TMediatorFactory; - - -implementation -uses - SysUtils - ,TypInfo - ,tiExcept - ,gui_dialogs // for TfpgMessageDialog - ,tiGUIConstants // for error color - ,gfxbase // for predefined colors - ; - -var - uMediatorFactory: TMediatorFactory; - - -const - cErrorListHasNotBeenAssigned = 'List has not been assigned'; - - -function gMediatorFactory: TMediatorFactory; -begin - if not Assigned(uMediatorFactory) then - uMediatorFactory := TMediatorFactory.Create; - result := uMediatorFactory; -end; - - -{ TMediatorView } - -constructor TMediatorView.Create; -begin - inherited; - FSettingUp := True; - UseInternalOnChange := True; -end; - -constructor TMediatorView.CreateCustom(pEditControl: TfpgWidget; pSubject: TtiObject; pFieldName: string; pGuiFieldName: string); -begin - Create; - FSubject := pSubject; - FFieldName := pFieldName; - FGuiFieldName := pGuiFieldName; - FEditControl := pEditControl; - FSubject.AttachObserver(self); - SetupGUIandObject; - - // I prefer to do this once in the form after all mediator are created. -// FSubject.NotifyObservers; - FSettingUp := False; -end; - -destructor TMediatorView.Destroy; -begin - if Assigned(FSubject) then - FSubject.DetachObserver(self); - inherited Destroy; -end; - -procedure TMediatorView.GUIChanged; -begin - if not FSettingUp then - begin - GuiToObject; - TestIfValid; - end; -end; - -procedure TMediatorView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -begin - { These lines reset the EditControl in the case of no errors, but will be - further implemented by a concrete class } - EditControl.Hint := ''; -end; - -function TMediatorView.DataAndPropertyValid: Boolean; -begin - result := (FSubject <> nil) and (FFieldName <> ''); - if not result then - Exit; //==> - - result := (IsPublishedProp(FSubject, FFieldName)); - - if not result then - raise Exception.CreateFmt('<%s> is not a property of <%s>', - [FFieldName, FSubject.ClassName ]); - -// EditControl.ReadOnly := ReadOnly or IsPropReadOnly; -end; - -procedure TMediatorView.DoOnChange(Sender: TObject); -begin - GUIChanged; -end; - -procedure TMediatorView.TestIfValid; -var - Errors: TtiObjectErrors; -begin - Errors := TtiObjectErrors.Create; - try - Subject.IsValid(Errors); - UpdateGuiValidStatus(Errors); // always execute this as it also resets EditControl - finally - Errors.Free; - end; -end; - -procedure TMediatorView.Update(pSubject: TtiObject); -begin - inherited; - ObjectToGui; - TestIfValid; -end; - -function TMediatorView.GetSubject: TtiObject; -begin - Result := FSubject; -end; - -procedure TMediatorView.GuiToObject; -begin - Subject.PropValue[FieldName] := TypInfo.GetPropValue(FEditControl, GuiFieldName); -end; - -procedure TMediatorView.ObjectToGui; -begin - TypInfo.SetPropValue(FEditControl, GuiFieldName, Subject.PropValue[FieldName]); -end; - -procedure TMediatorView.SetupGUIandObject; -begin - { do nothing here } -end; - - -{ TMediatorFactory } - -constructor TMediatorFactory.Create; -begin - MappingList := TStringList.Create; -end; - -function TMediatorFactory.CreateMediator(pComponent: TfpgWidget; pSubject: TtiObject; - pFieldName: string; pGuiFieldName: string): TMediatorView; -var - MediatorClass: TMediatingViewClass; -begin - if not Assigned(pComponent) then - raise Exception.Create('TMediatorFactory.CreateMediator: pComponent is not assigned'); - if not Assigned(pSubject) then - raise Exception.Create('TMediatorFactory.CreateMediator: pSubject is not assigned'); - - MediatorClass := GetMediatorClass( - pSubject, - pComponent.ClassType, - pFieldName ); - result := MediatorClass.CreateCustom( - pComponent, - pSubject, - pFieldName, - pGuiFieldName ); - pSubject.AttachObserver( result ); -end; - -function TMediatorFactory.CreateMediator(pEditLink: TMGMEditLink): TMediatorView; -var - MediatorClass: TMediatingViewClass; -begin - MediatorClass := GetMediatorClass( - pEditLink.EditObject, - pEditLink.EditControl.ClassType, - pEditLink.ObjectEditProperty ); - result := MediatorClass.CreateCustom( - pEditLink.EditControl, - pEditLink.EditObject, - pEditLink.ObjectEditProperty, - pEditLink.ControlEditProperty ); - pEditLink.EditObject.AttachObserver( Result ); -end; - - -destructor TMediatorFactory.Destroy; -var - i: integer; -begin - for i := 0 to MappingList.Count -1 do - TObject(MappingList.Objects[i]).Free; - MappingList.Free; - inherited; -end; - - -function TMediatorFactory.FindMediatorClass(pSubject: TtiObject; pComponentClass: TClass; pFieldName: string): TMediatingViewClass; -const - cName = '%s.%s.%s'; { Subject Classname, FieldName, Edit control name } -var - i: Integer; - lName: string; -begin - { Get the name formatting correct } - lName := Format(cName, [UpperCase(pSubject.ClassName), UpperCase(pFieldName), UpperCase(pComponentClass.ClassName)]); - { Does the Type exist in the list? } - i := MappingList.IndexOf(lName); - if i <> -1 then - Result := TMediatorViewMapping(MappingList.Objects[i]).MediatingViewClass - else - Result := nil; -end; - - -function TMediatorFactory.GetMediatorClass(pSubject: TtiObject; pComponentClass: TClass; pFieldName: string): TMediatingViewClass; -begin - Result := FindMediatorClass(pSubject, pComponentClass, pFieldName); - if not Assigned(Result) then - raise Exception.Create('No mediator registered for:' + LineEnding + - ' Component: ' + pComponentClass.ClassName + LineEnding + - ' FieldName: ' + pSubject.ClassName + '.' + pFieldName); -end; - - -procedure TMediatorFactory.RegisterMediatorClass(FieldName: string; MediatorClass: TMediatingViewClass); -const - cName = '%s.%s'; -var - lName: String; - i: Integer; - lMapping: TMediatorViewMapping; -begin - lName := Format(cName, [UpperCase(FieldName), UpperCase(MediatorClass.ComponentClass.ClassName)]); - { Does the Medator mapping already exist? } - i := MappingList.IndexOf( lName ); - if i <> -1 then - begin { If yes, notify the user } - { We cannot raise an exception as this will be called in the Initialization - section of a unit. FPC's exception handling may not have been loaded yet! } - TfpgMessageDialog.Information('', - 'Registering a duplicate Mediator View Type <' + FieldName + '> with ' + ClassName); - end - else - begin { If no, then add it to the list } - lMapping := TMediatorViewMapping.CreateExt( lName, MediatorClass ); - MappingList.AddObject( lName, lMapping ); - end; -end; - - -{ TMediatorEditView } - -function TMediatorEditView.GetEditControl: TfpgEdit; -begin - Result := TfpgEdit(FEditControl); -end; - -procedure TMediatorEditView.SetEditControl(const AValue: TfpgEdit); -begin - FEditControl := AValue; -end; - -procedure TMediatorEditView.SetupGUIandObject; -begin - inherited SetupGUIandObject; -end; - -procedure TMediatorEditView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -var - oError: TtiObjectError; -begin - inherited UpdateGuiValidStatus(pErrors); - - oError := pErrors.FindByErrorProperty(FieldName); - if oError <> nil then - begin - EditControl.BackgroundColor := clError; - EditControl.Hint := oError.ErrorMessage; - end - else - begin - EditControl.BackgroundColor := clBoxColor; - EditControl.Hint := ''; - end; -end; - -constructor TMediatorEditView.CreateCustom(pEditControl: TfpgWidget; - pSubject: TtiObject; pFieldName: string; pGuiFieldName: string); -begin - inherited; -end; - -destructor TMediatorEditView.Destroy; -begin - if Assigned(EditControl.OnChange) then - EditControl.OnChange := nil; - inherited Destroy; -end; - -class function TMediatorEditView.ComponentClass: TClass; -begin - Result := TfpgEdit; -end; - - -{ TMediatorSpinEditView} -(* -class function TMediatorSpinEditView.ComponentClass: TClass; -begin - Result := TSpinEdit; -end; - - -procedure TMediatorSpinEditView.GuiToObject; -begin - { Control is busy clearing the value before replacing it with what the user - typed. } - if (TSpinEdit(EditControl).Text = '') then - Exit; //==> - - { continue as normal } - inherited; -end; - -function TMediatorSpinEditView.GetEditControl: TSpinEdit; -begin - Result := TSpinEdit(FEditControl); -end; - -procedure TMediatorSpinEditView.OnLostFocus(Sender: TObject); -begin - if (TSpinEdit(EditControl).Text = '') then - begin - { Default the EditControl to a valid value } - TSpinEdit(EditControl).Value := 0; - GUIChanged; - end; -end; - -procedure TMediatorSpinEditView.SetEditControl(const AValue: TSpinEdit); -begin - FEditControl := AValue; -end; - - -procedure TMediatorSpinEditView.SetupGUIandObject; -begin - inherited; - TSpinEdit(EditControl).Text := ''; - TSpinEdit(EditControl).OnExit := OnLostFocus; -end; - -procedure TMediatorSpinEditView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -var - oError: TtiObjectError; -begin - inherited UpdateGuiValidStatus(pErrors); - - oError := pErrors.FindByErrorProperty(FieldName); - if oError <> nil then - begin - EditControl.Color := clError; - EditControl.Hint := oError.ErrorMessage; - end - else - begin - EditControl.Color := ColorToRGB(clWindow); - EditControl.Hint := ''; - end; -end; -*) - -{ TMediatorTrackBarView} - -function TMediatorTrackBarView.GetEditControl: TfpgTrackBar; -begin - Result := TfpgTrackBar(FEditControl); -end; - -procedure TMediatorTrackBarView.SetEditControl(const AValue: TfpgTrackBar); -begin - FEditControl := AValue; -end; - -class function TMediatorTrackBarView.ComponentClass: TClass; -begin - Result := TfpgTrackBar; -end; - - -{ TMediatorComboBoxView } - -class function TMediatorComboBoxView.ComponentClass: TClass; -begin - Result := TfpgComboBox; -end; - -function TMediatorComboBoxView.GetEditControl: TfpgComboBox; -begin - result := TfpgComboBox(FEditControl); -end; - -procedure TMediatorComboBoxView.SetEditControl(const AValue: TfpgComboBox); -begin - FEditControl := AValue; -end; - -procedure TMediatorComboBoxView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -var - oError: TtiObjectError; -begin - inherited UpdateGuiValidStatus(pErrors); - - oError := pErrors.FindByErrorProperty(FieldName); - if oError <> nil then - begin - EditControl.BackgroundColor := clError; - EditControl.Hint := oError.ErrorMessage; - end - else - begin - EditControl.BackgroundColor := clBoxColor; - EditControl.Hint := ''; - end; -end; - -procedure TMediatorComboBoxView.ObjectToGui; -begin - EditControl.FocusItem := - EditControl.Items.IndexOf(Subject.PropValue[FieldName]); -end; - - -{ TMediatorMemoView } - -class function TMediatorMemoView.ComponentClass: TClass; -begin - Result := TfpgMemo; -end; - -procedure TMediatorMemoView.GuiToObject; -begin - Subject.PropValue[FieldName] := EditControl.Lines.Text; -end; - -procedure TMediatorMemoView.ObjectToGui; -begin - EditControl.Lines.Text := Subject.PropValue[FieldName]; -end; - -function TMediatorMemoView.GetEditControl: TfpgMemo; -begin - Result := TfpgMemo(FEditControl); -end; - -procedure TMediatorMemoView.SetEditControl(const AValue: TfpgMemo); -begin - FEditControl := AValue; -end; - -procedure TMediatorMemoView.SetupGUIandObject; -begin - inherited; - EditControl.Lines.Clear; -// EditControl.ScrollBars := ssVertical; -// EditControl.WordWrap := True; -end; - - -{ TMediatorViewMapping } - -constructor TMediatorViewMapping.CreateExt(pName: String; pMediatingClass: TMediatingViewClass); -begin - Create; - Name := pName; - MediatingViewClass := pMediatingClass; -end; - - -{ TMediatorDynamicComboBoxView } - -procedure TMediatorDynamicComboBoxView.SetList(const AValue: TtiObjectList); -begin - if FList = AValue then - Exit; //==> - FList := AValue; - InternalListRefresh; -end; - -procedure TMediatorDynamicComboBoxView.InternalListRefresh; -var - lItems: TStrings; - i: Integer; -begin - lItems := EditControl.Items; - lItems.Clear; - EditControl.Text := ''; - - if (FList = nil) or - (FList.Count < 1) or - (SameText(FFieldName, EmptyStr)) then - Exit; //==> - - try - for i := 0 to FList.Count - 1 do - begin - lItems.Add(FList.Items[i].Caption); - end; - except - on E: Exception do - raise Exception.CreateFmt('Error adding list items to combobox ' + - 'Message: %s, Item Property Name: %s', - [E.message, FFieldName]); - end; - - ObjectToGui; -end; - -procedure TMediatorDynamicComboBoxView.SetOnChangeActive(AValue: Boolean); -begin - if AValue then - begin - if not UseInternalOnChange then - EditControl.OnChange := FExternalOnChange - else - EditControl.OnChange := @DoOnChange; - end - else - begin - if not UseInternalOnChange then - FExternalOnChange := EditControl.OnChange; - EditControl.OnChange := nil; - end; -end; - -procedure TMediatorDynamicComboBoxView.SetupGUIandObject; -begin - inherited SetupGUIandObject; - - if UseInternalOnChange then - EditControl.OnChange := @DoOnChange; // default OnChange event handler - - EditControl.Enabled := (FList.Count > 0); -end; - -constructor TMediatorDynamicComboBoxView.CreateCustom(pList: TtiObjectList; - pEditControl: TfpgWidget; pSubject: TtiObject; pFieldName: string); -begin - Create; - FGuiFieldName := 'Text'; // TfpgComboBox defaults to Text property - - FSubject := pSubject; - FFieldName := pFieldName; - FEditControl := pEditControl; - - if Assigned(EditControl.OnChange) then - UseInternalOnChange := False; - - { This will fire a refresh } - List := pList; - - FSubject.AttachObserver(self); - SetupGUIandObject; - - // I prefer to do this once in the form after all mediator are created. -// FSubject.NotifyObservers; - FSettingUp := False; -end; - -destructor TMediatorDynamicComboBoxView.Destroy; -begin - FList := nil; - inherited Destroy; -end; - -procedure TMediatorDynamicComboBoxView.GuiToObject; -var - lValue: TtiObject; - lPropType: TTypeKind; -begin - if not DataAndPropertyValid then - Exit; //==> - if EditControl.FocusItem < 0 then - Exit; //==> - - lValue := TtiObject(FList.Items[EditControl.FocusItem]); - - lPropType := typinfo.PropType(Subject, FieldName); - if lPropType = tkClass then - typinfo.SetObjectProp(Subject, FieldName, lValue) - else - raise EtiOPFProgrammerException.Create('Error property type not a Class'); -end; - -procedure TMediatorDynamicComboBoxView.ObjectToGui; -var - i: Integer; - lValue: TtiObject; - lPropType: TTypeKind; -begin - SetOnChangeActive(false); - - // Set the index only (We're assuming the item is present in the list) - EditControl.FocusItem := -1; - if FSubject = nil then - Exit; //==> - - if not Assigned(FList) then - raise EtiOPFProgrammerException.Create(cErrorListHasNotBeenAssigned); - - lPropType := typinfo.PropType(Subject, FieldName); - if lPropType = tkClass then - lValue := TtiObject(typinfo.GetObjectProp(Subject, FieldName)) - else - raise Exception.Create('Property is not a class type!'); - - for i := 0 to FList.Count - 1 do - if FList.Items[i] = lValue then - begin - EditControl.FocusItem := i; - Break; //==> - end; - - SetOnChangeActive(true); -end; - -procedure TMediatorDynamicComboBoxView.RefreshList; -begin - InternalListRefresh; -end; - -{ TMediatorCheckBoxView } - -function TMediatorCheckBoxView.GetEditControl: TfpgCheckBox; -begin - Result := TfpgCheckBox(FEditControl); -end; - -procedure TMediatorCheckBoxView.SetEditControl(const AValue: TfpgCheckBox); -begin - FEditControl := AValue; -end; - -procedure TMediatorCheckBoxView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -var - oError: TtiObjectError; -begin - inherited UpdateGuiValidStatus(pErrors); - - oError := pErrors.FindByErrorProperty(FieldName); - if oError <> nil then - begin - EditControl.BackgroundColor := clError; - EditControl.Hint := oError.ErrorMessage; - end - else - begin - EditControl.BackgroundColor := clWindowBackground; - EditControl.Hint := ''; - end; -end; - -class function TMediatorCheckBoxView.ComponentClass: TClass; -begin - Result := TfpgCheckBox; -end; - -{ TMediatorStaticTextView } - -function TMediatorStaticTextView.GetEditControl: TfpgLabel; -begin - Result := TfpgLabel(FEditControl); -end; - -procedure TMediatorStaticTextView.SetEditControl(const AValue: TfpgLabel); -begin - FEditControl := AValue; -end; - -procedure TMediatorStaticTextView.SetupGUIandObject; -begin - inherited SetupGUIandObject; - EditControl.Text := ''; -end; - -class function TMediatorStaticTextView.ComponentClass: TClass; -begin - Result := TfpgLabel; -end; - -{ TMediatorCalendarComboView } - -function TMediatorCalendarComboView.GetEditControl: TfpgCalendarCombo; -begin - Result := TfpgCalendarCombo(FEditControl); -end; - -procedure TMediatorCalendarComboView.SetEditControl(const AValue: TfpgCalendarCombo); -begin - FEditControl := AValue; -end; - -class function TMediatorCalendarComboView.ComponentClass: TClass; -begin - Result := TfpgCalendarCombo; -end; - - -initialization -finalization - gMediatorFactory.Free; - -end. - diff --git a/extras/tiopf/gui/tiGenericListMediators.pas b/extras/tiopf/gui/tiGenericListMediators.pas deleted file mode 100644 index faa8de95..00000000 --- a/extras/tiopf/gui/tiGenericListMediators.pas +++ /dev/null @@ -1,583 +0,0 @@ -(* - -Revision history: - - 2005-09-01: First release by Graeme Geldenhuys (graemeg@gmail.com) - 2007-08-27: Ported the code to the fpGUI toolkit. [Graeme] - 2008-05-20: Updates due to fpGUI components now being 0-based. [Graeme] - - -Purpose: - Abstract mediating views for GUI list controls. This allows you to use - standard list components and make them object-aware. See the demo - application for usage. - -ToDo: - * Unit tests - * More refactoring - * Implement a View Manager class, so we can remove the View Lists - created in each Form using mediating views. - * TfpgListView mediator implementation - I first need to double check how - far the TfpgListView control itself has been implemented. - -*) - -unit tiGenericListMediators; - -{$mode objfpc}{$H+} - -interface -uses - tiObject - ,tiGenericEditMediators - ,gfx_widget - ,gui_listbox - ,gui_combobox - ,gui_listview - ,gui_menu - ,Classes - ; - - -type - { Used so we know what needs updating, the Internal List, or just the - Selected Object. } - TUpdateMode = (umSelectedObject, umObjectList); - - - { Abstract class that observes a list object } - - TListMediator = class(TtiObject) - private - FObjectList: TtiObjectList; - FControl: TfpgWidget; - FSelectedObject: TtiObject; - FShowDeleted: Boolean; - procedure SetShowDeleted(const Value: Boolean); - protected - FObserversInTransit: TList; - FUpdateMode: TUpdateMode; - FPopupMenu: TfpgPopupMenu; - procedure SetSelectedObject(const Value: TtiObject); virtual; - function GetModel: TtiObjectList; virtual; - procedure SetModel(const Value: TtiObjectList); virtual; - function GetView: TfpgWidget; virtual; - procedure SetView(const Value: TfpgWidget); virtual; - procedure RebuildList; virtual; abstract; - { Used to setup things like the MaxLength of a edit box, etc. } - procedure SetupGUIandObject; virtual; - procedure BuildPopupMenu; virtual; - public - constructor Create; override; - constructor CreateCustom(pObjectList: TtiObjectList; pView: TfpgWidget); virtual; - destructor Destroy; override; - procedure Update(pSubject: TtiObject); override; - { Called from GUI to trigger events } - procedure HandleDeleteItem; virtual; - procedure HandleListChanged; virtual; - procedure HandleSelectionChanged; virtual; abstract; - procedure MenuItemAddClick(Sender: TObject); virtual; - procedure MenuItemEditClick(Sender: TObject); virtual; - procedure MenuItemDeleteClick(Sender: TObject); virtual; - // - property SelectedObject: TtiObject read FSelectedObject write SetSelectedObject; - property ShowDeleted: Boolean read FShowDeleted write SetShowDeleted; - property Model: TtiObjectList read GetModel write SetModel; - property View: TfpgWidget read GetView; - end; - - - { Observes a list object - TfpgListBox } - - TListBoxMediator = class(TListMediator) - private - OldPos: Integer; - NewPos: Integer; - protected - procedure SetSelectedObject(const Value: TtiObject); override; - function GetView: TfpgListBox; reintroduce; - procedure RebuildList; override; - procedure SaveBookmark; - procedure RestoreBookmark; - public - procedure HandleSelectionChanged; override; - published - property View: TfpgListBox read GetView; - end; - - - { Observes a list object - TfpgComboBox } - - TComboBoxMediator = class(TListMediator) - protected - procedure SetSelectedObject(const Value: TtiObject); override; - function GetView: TfpgComboBox; reintroduce; - procedure RebuildList; override; - public - procedure HandleSelectionChanged; override; - published - property View: TfpgComboBox read GetView; - end; - - - { Observes a list object - TListView } -(* - TListViewMediator = class(TListMediator) - protected - function GetView: TfpgListView; reintroduce; - procedure RebuildList; override; - public - procedure HandleSelectionChanged; override; - published - property View: TfpgListView read GetView; - end; -*) - -implementation -uses - SysUtils - ; - - -{ TListBoxMediator } - -procedure TListBoxMediator.SetSelectedObject(const Value: TtiObject); -var - i: integer; -begin - inherited SetSelectedObject(Value); - - if Value = nil then - begin - View.FocusItem := -1; - Exit; //==> - end; - - for i := 0 to Model.Count-1 do - begin - if Value.OID.AsString = Model.Items[i].OID.AsString then - begin - View.FocusItem := i; - Break; //==> - end; - end; -end; - -function TListBoxMediator.GetView: TfpgListBox; -begin - result := TfpgListBox(inherited GetView); -end; - -procedure TListBoxMediator.HandleSelectionChanged; -var - i: integer; -begin - if View.FocusItem = -1 then - FSelectedObject := nil - else - begin - { If an item is already selected, assign the item's List of observers to a - temporary container. This is done so that the same observers can be - assigned to the new item. } - if Assigned(FSelectedObject) then - FObserversInTransit.Assign(FSelectedObject.ObserverList); - - // Assign Newly selected item to SelectedObject Obj. - FSelectedObject := TtiObject(View.Items.Objects[View.FocusItem]); - - { If an object was selected, copy the old item's observer List - to the new item's observer List. } - if FObserversInTransit.Count > 0 then - FSelectedObject.ObserverList.Assign(FObserversInTransit); - - { set the observers's Subject property to the selected object } - for i := 0 to FSelectedObject.ObserverList.Count-1 do - begin - TMediatorView(FSelectedObject.ObserverList.Items[i]).Subject := - FSelectedObject; - end; - - // execute the NotifyObservers event to update the observers. - FSelectedObject.NotifyObservers; - end; -end; - - -procedure TListBoxMediator.RebuildList; -var - i: Integer; - ptr: TNotifyEvent; - selected: integer; -begin - selected := -1; - if (Model.CountNotDeleted) >= View.FocusItem+1 then - begin - selected := View.FocusItem; - end; - - ptr := View.OnChange; - View.OnChange := nil; - View.BeginUpdate; - try - View.Items.Clear; - for i := 0 to Model.Count-1 do - begin - if (not Model.Items[i].Deleted) or - (ShowDeleted and Model.Items[i].Deleted) then - begin - View.Items.AddObject(Model.Items[i].Caption, Model.Items[i]); - end; - end; - if Model.CountNotDeleted > 0 then - begin - if selected = -1 then - selected := 0; - View.FocusItem := selected; - end; - finally - View.EndUpdate; - View.Update; - View.OnChange := ptr; - HandleSelectionChanged; - end; -end; - - -procedure TListBoxMediator.RestoreBookmark; -begin - if OldPos > View.Items.Count-1 then - NewPos := View.Items.Count-1 - else - NewPos := OldPos; - View.FocusItem := NewPos; - HandleSelectionChanged; -end; - -procedure TListBoxMediator.SaveBookmark; -begin - OldPos := View.FocusItem; -end; - - -{ TComboBoxMediator } - -procedure TComboBoxMediator.SetSelectedObject(const Value: TtiObject); -var - i: integer; -begin - inherited SetSelectedObject(Value); - if Value = nil then - begin - View.FocusItem := -1; - Exit; //==> - end; - - for i := 0 to Model.Count-1 do - begin - if Value = Model.Items[i] then - begin - View.FocusItem := i; - exit; //==> - end; - end; -end; - -function TComboBoxMediator.GetView: TfpgComboBox; -begin - result := TfpgComboBox(inherited GetView); -end; - - -procedure TComboBoxMediator.HandleSelectionChanged; -var - i: integer; -begin - if View.FocusItem = -1 then - SelectedObject := nil - else - begin - if Assigned(SelectedObject) then - FObserversInTransit.Assign(SelectedObject.ObserverList); - - SelectedObject := TtiObject(View.Items.Objects[View.FocusItem]); - - if FObserversInTransit.Count > 0 then - SelectedObject.ObserverList.Assign(FObserversInTransit); - - for i := 0 to SelectedObject.ObserverList.Count-1 do - begin - TMediatorView(SelectedObject.ObserverList.Items[i]).Subject := - SelectedObject; - end; - - SelectedObject.NotifyObservers; - end; -end; - - -procedure TComboBoxMediator.RebuildList; -var - i: Integer; - ptr: TNotifyEvent; - selected: integer; -begin - selected := -1; - if Model.CountNotDeleted >= View.FocusItem+1 then - selected := View.FocusItem; - - ptr := View.OnChange; - View.OnChange := nil; - View.Items.BeginUpdate; - try - View.Items.Clear; - for i := 0 to Model.Count-1 do - begin - if (not Model.Items[i].Deleted) or - (ShowDeleted and Model.Items[i].Deleted) then - begin - View.Items.AddObject( Model.Items[i].Caption, Model.Items[i] ); - end; - end; - if Model.CountNotDeleted > 0 then - begin - if selected = -1 then - selected := 0; - View.FocusItem := selected; - end; - finally - View.Items.EndUpdate; - View.FocusItem := 0; - View.OnChange := ptr; - HandleSelectionChanged; - end; -end; - - -{ TListViewMediator } - -(* -function TListViewMediator.GetView: TfpgListView; -begin - result := TfpgListView(inherited GetView); -end; - - -procedure TListViewMediator.HandleSelectionChanged; -var - i: integer; -begin - if not Assigned(View.Selected) then - SelectedObject := nil - else - begin - if Assigned(SelectedObject) then // and Assigned(SelectedObject.ObserverList) - FObserversInTransit.Assign( SelectedObject.ObserverList); - - SelectedObject := TtiObject(View.Selected.Data); - - if FObserversInTransit.Count > 0 then - SelectedObject.ObserverList.Assign(FObserversInTransit); - - for i := 0 to SelectedObject.ObserverList.Count - 1 do - begin - TMediatorView(SelectedObject.ObserverList.Items[i]).Subject := - SelectedObject; - end; - - SelectedObject.NotifyObservers; - end; -end; - - -procedure TListViewMediator.RebuildList; -var - i: Integer; - lItem: TListItem; - ptr: TLVChangeEvent; -begin - ptr := View.OnChange; - View.OnChange := nil; - {$IFDEF FPC} - View.BeginUpdate; - {$ELSE} - View.Items.BeginUpdate; - {$ENDIF} - try - View.Items.Clear; - for i := 0 to Pred(Model.Count) do - begin - if (not Model.Items[i].Deleted) or - (ShowDeleted and Model.Items[i].Deleted) then - begin - lItem := View.Items.Add; - lItem.Caption := Model.Items[i].Caption; - lItem.Data := Model.Items[i]; - end; - end; - if Model.CountNotDeleted > 0 then - begin - SelectedObject := Model.Items[0]; - View.Selected := View.Items[0]; - end; - finally - {$IFDEF FPC} - View.EndUpdate; - {$ELSE} - View.Items.EndUpdate; - {$ENDIF} - View.OnChange := ptr; - HandleSelectionChanged; - end; -end; -*) - -{ TListMediator } - -procedure TListMediator.BuildPopupMenu; -begin - FPopupMenu := TfpgPopupMenu.Create(View); - FPopupMenu.AddMenuItem('Add', '', @MenuItemAddClick); - FPopupMenu.AddMenuItem('Edit', '', @MenuItemEditClick); - FPopupMenu.AddMenuItem('Delete', '', @MenuItemDeleteClick); -end; - - -constructor TListMediator.Create; -begin - inherited; - FObserversInTransit := TList.Create; - FShowDeleted := False; - { This is under construction. } - FUpdateMode := umObjectList; -end; - - -constructor TListMediator.CreateCustom(pObjectList: TtiObjectList; pView: TfpgWidget); -begin - Create; - Model := pObjectList; - FControl := pView; - BuildPopupMenu; - Model.AttachObserver(self); - SetupGUIandObject; - - // I prefer to do this once in the form after all mediator are created. - Model.NotifyObservers; -end; - - -destructor TListMediator.Destroy; -begin - FObserversInTransit.Free; - Model.DetachObserver(self); - inherited; -end; - - -function TListMediator.GetModel: TtiObjectList; -begin - Result := FObjectList; -end; - - -function TListMediator.GetView: TfpgWidget; -begin - Result := FControl; -end; - - -procedure TListMediator.HandleDeleteItem; -begin - if not Assigned(SelectedObject) then - Exit; //==> - - BeginUpdate; - try - SelectedObject.Deleted := True; - RebuildList; - finally - EndUpdate; - end; -end; - - -procedure TListMediator.HandleListChanged; -begin - BeginUpdate; - try - RebuildList; - finally - EndUpdate; - end; -end; - - -procedure TListMediator.MenuItemAddClick(Sender: TObject); -begin - { do nothing here } -end; - - -procedure TListMediator.MenuItemDeleteClick(Sender: TObject); -begin - { do nothing here } -end; - - -procedure TListMediator.MenuItemEditClick(Sender: TObject); -begin - { do nothing here } -end; - - -procedure TListMediator.SetModel(const Value: TtiObjectList); -begin - FObjectList := Value; -// if FObjectList.Count > 0 then -// FSelectedObject := FObjectList.Items[0]; -end; - - -procedure TListMediator.SetSelectedObject(const Value: TtiObject); -begin - FSelectedObject := Value; -end; - - -procedure TListMediator.SetShowDeleted(const Value: Boolean); -begin - BeginUpdate; - try - FShowDeleted := Value; - RebuildList; - finally - EndUpdate; - end; -end; - - -procedure TListMediator.SetView(const Value: TfpgWidget); -begin - FControl := Value; -end; - - -procedure TListMediator.SetupGUIandObject; -begin - { Do nothing. Can be implemented in decendant classes. } -end; - - -procedure TListMediator.Update(pSubject: TtiObject); -begin - BeginUpdate; - try -// inherited Update(pSubject); - RebuildList; - finally - EndUpdate - end; -end; - - -end. diff --git a/extras/tiopf/gui/tiListMediators.pas b/extras/tiopf/gui/tiListMediators.pas deleted file mode 100644 index 89b99135..00000000 --- a/extras/tiopf/gui/tiListMediators.pas +++ /dev/null @@ -1,772 +0,0 @@ -{ - Abstract mediating views for GUI list controls. This allows you to use - standard list components and make them object-aware. See the demo - application for usage. -} -unit tiListMediators; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, - SysUtils, - tiBaseMediator, - fpg_listview, - fpg_grid, - fpg_listbox, - tiObject; - -type - { Composite mediator for TfpgListView } - TtiListViewMediatorView = class(TtiCustomListMediatorView) - private - FObserversInTransit: TList; - protected - function GetSelectedObject: TtiObject; override; - procedure SetSelectedObject(const AValue: TtiObject); override; - procedure CreateColumns; override; - function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; - procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; - procedure SetupGUIandObject; override; - procedure ClearList; override; - procedure RebuildList; override; - procedure SetActive(const AValue: Boolean); override; - public - constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; ADisplayNames: string; AIsObserving: Boolean = True); overload; - constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; AOnBeforeSetupField: TtiOnBeforeSetupField; ADisplayNames: string; AIsObserving: Boolean = True); overload; - class function ComponentClass: TClass; override; - constructor Create; override; - destructor Destroy; override; - function View: TfpgListView; reintroduce; - procedure HandleSelectionChanged; override; - function GetObjectFromItem(AItem: TfpgLVItem): TtiObject; - end; - - - { Composite mediator for TfpgStringGrid } - TtiStringGridMediatorView = class(TtiCustomListMediatorView) - private - function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; - procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; - protected - function GetSelectedObject: TtiObject; override; - procedure SetSelectedObject(const AValue: TtiObject); override; - procedure CreateColumns; override; - procedure SetupGUIandObject; override; - procedure ClearList; override; - procedure RebuildList; override; - public - constructor CreateCustom(AModel: TtiObjectList; AGrid: TfpgStringGrid; ADisplayNames: string; AIsObserving: Boolean = True); reintroduce; overload; - destructor Destroy; override; - class function ComponentClass: TClass; override; - function GetObjectFromRow(ARow: Integer): TtiObject; - function View: TfpgStringGrid; reintroduce; - end; - - - { Used internally for sub-mediators in ListView mediator. Moved to interface - section so it can be overridden. } - TtiListViewListItemMediator = class(TtiListItemMediator) - private - FView: TfpgLVItem; - procedure SetupFields; virtual; - public - constructor CreateCustom(AModel: TtiObject; AView: TfpgLVItem; const AFieldsInfo: TtiMediatorFieldInfoList; IsObserving: Boolean = True); reintroduce; overload; - constructor CreateCustom(AModel: TtiObject; AView: TfpgLVItem; AOnBeforeSetupField: TtiOnBeforeSetupField; const AFieldsInfo: TtiMediatorFieldInfoList; IsObserving: Boolean = True); reintroduce; overload; - procedure BeforeDestruction; override; - procedure Update(ASubject: TtiObject); override; - published - property View: TfpgLVItem read FView; - end; - - - { Used internally for sub-mediators in StringGrid mediator. Moved to interface - section so it can be overridden. } - TtiStringGridRowMediator = class(TtiListItemMediator) - private - FView: TfpgStringGrid; - FRowIndex: integer; - public - constructor CreateCustom(AModel: TtiObject; AGrid: TfpgStringGrid; const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean = True); - procedure Update(ASubject: TtiObject); override; - published - property View: TfpgStringGrid read FView; - property RowIndex: integer read FRowIndex; - end; - - - { Composite mediator for TfpgListBox } - TtiListBoxMediatorView = class(TtiCustomListMediatorView) - private - function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; - procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; - protected - function GetSelectedObject: TtiObject; override; - procedure SetSelectedObject(const AValue: TtiObject); override; - procedure CreateColumns; override; - procedure ClearList; override; - procedure RebuildList; override; - procedure SetupGUIandObject; override; - public - constructor CreateCustom(AModel: TtiObjectList; AListBox: TfpgListBox; ADisplayNames: string; AIsObserving: Boolean = True); reintroduce; overload; - destructor Destroy; override; - class function ComponentClass: TClass; override; - function GetObjectFromRow(ARow: Integer): TtiObject; - function View: TfpgListBox; reintroduce; - end; - - { Used internally for sub-mediators in ListBox mediator. Moved to interface - section so it can be overridden. } - TtiListBoxItemMediator = class(TtiListItemMediator) - private - FView: TfpgListBox; - FRowIndex: integer; - public - constructor CreateCustom(AModel: TtiObject; AListBox: TfpgListBox; const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean = True); - procedure Update(ASubject: TtiObject); override; - published - property View: TfpgListBox read FView; - property RowIndex: integer read FRowIndex; - end; - - -procedure RegisterFallBackListMediators; - - -implementation - -uses - tiRTTI; - - -procedure RegisterFallBackListMediators; -begin - gMediatorManager.RegisterMediator(TtiListViewMediatorView, TtiObjectList); - gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TtiObjectList); - gMediatorManager.RegisterMediator(TtiListBoxMediatorView, TtiObjectList); -end; - -{ TtiListViewMediatorView } - -procedure TtiListViewMediatorView.SetSelectedObject(const AValue: TtiObject); -var - i: integer; -begin - for i := 0 to View.Items.Count - 1 do - if TtiObject(View.Items.Item[i].UserData) = AValue then - begin - View.ItemIndex := i; - HandleSelectionChanged; {$Note Is this line required?} - Exit; //==> - end; -end; - -function TtiListViewMediatorView.GetSelectedObject: TtiObject; -begin - Result := GetObjectFromItem(View.Items.Item[View.ItemIndex]); -end; - -function TtiListViewMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; -var - li: TfpgLVItem; -begin - DataAndPropertyValid(AData); - { Create ListItem and Mediator } - View.BeginUpdate; - try - li := TfpgLVItem.Create(View.Items); - View.Items.Add(li); - Result := TtiListViewListItemMediator.CreateCustom(AData, li, OnBeforeSetupField, FieldsInfo, Active); - li.UserData := Result; - MediatorList.Add(Result); - finally - View.EndUpdate; - end; -end; - -procedure TtiListViewMediatorView.DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); -begin - View.Items.Delete(View.Items.IndexOf(TtiListViewListItemMediator(AMediator).View)); - inherited DoDeleteItemMediator(AIndex, AMediator); -end; - -procedure TtiListViewMediatorView.CreateColumns; -var - c: integer; - lc: TfpgLVColumn; - lInfo: TtiMediatorFieldInfo; -begin - if (View.Columns.Count<>FieldsInfo.Count) then - View.Columns.Clear; - if View.Columns.Count = 0 then - begin - for c := 0 to FieldsInfo.Count-1 do - begin - lInfo := FieldsInfo[c]; - lc := TfpgLVColumn.Create(View.Columns); - lc.AutoSize := False; - lc.Caption := lInfo.Caption; - lc.Width := lInfo.FieldWidth; -// lc.CaptionAlignment:= lInfo.Alignment; - lc.Alignment := lInfo.Alignment; - lc.Resizable := True; - View.Columns.Add(lc); - end; - end; -end; - -procedure TtiListViewMediatorView.SetupGUIandObject; -begin - { Setup TfpgListView defaults } - View.Columns.Clear; - View.Items.Clear; - // FView.ViewStyle := vsReport; - View.ShowHeaders := True; - // FView.RowSelect := True; - // FView.AutoSize := False; - // FView.ScrollBars := ssAutoBoth; -end; - -procedure TtiListViewMediatorView.ClearList; -begin - MediatorList.Clear; - if View <> nil then - View.Items.Clear; -end; - -procedure TtiListViewMediatorView.RebuildList; -begin - View.BeginUpdate; - try - CreateColumns; - CreateSubMediators; - finally - View.EndUpdate; - end; -end; - -procedure TtiListViewMediatorView.SetActive(const AValue: Boolean); -begin - if not AValue then - ClearList; - inherited SetActive(AValue); -end; - -constructor TtiListViewMediatorView.CreateCustom(AModel: TtiObjectList; AView: TfpgListView; AOnBeforeSetupField: TtiOnBeforeSetupField; ADisplayNames: string; AIsObserving: Boolean); -begin - Create; // don't forget this - OnBeforeSetupField := AOnBeforeSetupField; - DisplayNames := ADisplayNames; // Will call ParseDisplaynames. - Subject := AModel; - SetView(AView); // Will call SetupGUIandObject; - CreateSubMediators; - Active := AIsObserving; // Will attach/Detach -end; - -class function TtiListViewMediatorView.ComponentClass: TClass; -begin - Result := TfpgListView; -end; - -constructor TtiListViewMediatorView.Create; -begin - inherited Create; - FObserversInTransit := TList.Create; -end; - -constructor TtiListViewMediatorView.CreateCustom(AModel: TtiObjectList; AView: TfpgListView; ADisplayNames: string; AIsObserving: Boolean); -begin - CreateCustom(AModel, AView, nil, ADisplayNames, AIsObserving); -end; - -destructor TtiListViewMediatorView.Destroy; -begin - IsObserving := False; - FObserversInTransit.Free; - inherited Destroy; -end; - -function TtiListViewMediatorView.View: TfpgListView; -begin - Result := TfpgListView(inherited View); -end; - -procedure TtiListViewMediatorView.HandleSelectionChanged; -var - i: integer; -begin - if View.ItemIndex = -1 then - SelectedObject := nil - else - begin - FObserversInTransit.Clear; - { If an item is already selected, assign the item's List of observers to a - temporary container. This is done so that the same observers can be - assigned to the new item. } - if Assigned(SelectedObject) then - FObserversInTransit.Assign(SelectedObject.ObserverList); - - // Assign Newly selected item to SelectedObject Obj. - SelectedObject := TtiObject(View.Items.Item[View.ItemIndex].UserData); - - { If an object was selected, copy the old item's observer List - to the new item's observer List. } - if FObserversInTransit.Count > 0 then - SelectedObject.ObserverList.Assign(FObserversInTransit); - - { Set the Observers Subject property to the selected object } - for i := 0 to SelectedObject.ObserverList.Count - 1 do - TtiMediatorView(SelectedObject.ObserverList.Items[i]).Subject := - SelectedObject; - - // execute the NotifyObservers event to update the observers. - SelectedObject.NotifyObservers; - end; -end; - -function TtiListViewMediatorView.GetObjectFromItem(AItem: TfpgLVItem): TtiObject; -begin - if (AItem = nil) or (AItem.UserData = nil) then - Result := nil - else - Result := TtiListItemMediator(AItem.UserData).Model; -end; - - -{ TtiListViewListItemMediator } - -procedure TtiListViewListItemMediator.SetupFields; -var - c: integer; - lMemberName: string; - lValue: string; -begin - lMemberName := FFieldsInfo[0].PropName; - lValue := tiGetProperty(Model, lMemberName); - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lMemberName, lValue); - FView.Caption := lValue; - for c := 1 to FFieldsInfo.Count - 1 do - begin - lMemberName := FFieldsInfo[c].PropName; - lValue := tiGetProperty(Model, lMemberName); - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lMemberName, lValue); - FView.SubItems.Add(lValue); - end; -end; - -constructor TtiListViewListItemMediator.CreateCustom(AModel: TtiObject; AView: TfpgLVItem; const AFieldsInfo: TtiMediatorFieldInfoList; IsObserving: Boolean); -begin - CreateCustom(AModel, AView, nil, AFieldsInfo, IsObserving); -end; - -constructor TtiListViewListItemMediator.CreateCustom(AModel: TtiObject; AView: TfpgLVItem; AOnBeforeSetupField: TtiOnBeforeSetupField; const AFieldsInfo: TtiMediatorFieldInfoList; IsObserving: Boolean); -begin - inherited Create; - Model := AModel; - FView := AView; - FFieldsInfo := AFieldsInfo; - OnBeforeSetupField := AOnBeforeSetupField; - SetupFields; - Active := IsObserving; // Will attach -end; - -procedure TtiListViewListItemMediator.BeforeDestruction; -begin - Model.DetachObserver(self); - Model := nil; - FView := nil; - inherited BeforeDestruction; -end; - -procedure TtiListViewListItemMediator.Update(ASubject: TtiObject); -var - c: integer; - lMemberName: string; - lValue: string; -begin - Assert(Model = ASubject); - - lMemberName := FFieldsInfo[0].PropName; - lValue := tiGetProperty(Model, lMemberName); - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lMemberName, lValue); - - FView.Caption := lValue; - - for c := 1 to FFieldsInfo.Count - 1 do - begin - lMemberName := FFieldsInfo[c].PropName; - lValue := Model.PropValue[lMemberName]; - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lMemberName, lValue); - FView.SubItems[c - 1] := lValue; - end; -end; - - -{ TtiStringGridMediatorView } - -function TtiStringGridMediatorView.GetSelectedObject: TtiObject; -begin - Result := GetObjectFromRow(View.FocusRow); -end; - -procedure TtiStringGridMediatorView.SetSelectedObject(const AValue: TtiObject); -var - i: integer; - o: TObject; -begin - for i := 0 to View.RowCount - 1 do - begin - o := View.Objects[0, i]; - if Assigned(o) and (TtiListItemMediator(o).Model = AValue) then - begin - View.FocusRow := i; - Exit; //==> - end; - end; { for } -end; - -function TtiStringGridMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; -var - i: integer; - lFieldName: string; -begin - View.BeginUpdate; - try - if ARowIdx = View.RowCount then // In case of add notification - View.RowCount := View.RowCount+1; - for i := 0 to FieldsInfo.Count - 1 do - begin - lFieldName := FieldsInfo[i].PropName; - View.Cells[i, ARowIdx] := tiGetProperty(AData, lFieldName); // set Cell text - end; - Result := TtiStringGridRowMediator.CreateCustom(AData, View, FieldsInfo, ARowIdx, Active); - View.Objects[0, ARowIdx] := Result; // set Object reference inside grid. It used to be AData. - MediatorList.Add(Result); - finally - View.EndUpdate; - end; -end; - -procedure TtiStringGridMediatorView.DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); -begin - View.DeleteRow(AIndex); - inherited DoDeleteItemMediator(AIndex, AMediator); -end; - -procedure TtiStringGridMediatorView.CreateColumns; -var - i: integer; - lColumnTotalWidth: integer; - lGridNonContentWidth: integer; - lLastColumnWidth: integer; -begin - lColumnTotalWidth := 0; - // Grid is 2px border left + right, 1px col gridline separator, 15px vertical scrollbar width - lGridNonContentWidth := 2 + 2 + (FieldsInfo.Count - 1) + 15; - for i := 0 to FieldsInfo.Count - 1 do - begin - View.ColumnWidth[i] := FieldsInfo[i].FieldWidth; - View.ColumnTitle[i] := FieldsInfo[i].Caption; - View.Columns[i].Alignment := FieldsInfo[i].Alignment; - //resize the last column to fill the grid. - if i = FieldsInfo.Count - 1 then - begin - if View.Width > (lColumnTotalWidth + lGridNonContentWidth) then - begin - lLastColumnWidth := View.Width - (lColumnTotalWidth + lGridNonContentWidth); - if lLastColumnWidth > 10 then - View.ColumnWidth[i] := lLastColumnWidth; - end; - end - else - lColumnTotalWidth := lColumnTotalWidth + View.ColumnWidth[i]; - end; -end; - -procedure TtiStringGridMediatorView.SetupGUIandObject; -begin - //Setup default properties for the StringGrid - View.RowSelect := True; - View.ColumnCount := FieldsInfo.Count; - if ShowDeleted then - View.RowCount := Model.Count - else - View.RowCount := Model.CountNotDeleted; -end; - -procedure TtiStringGridMediatorView.ClearList; -begin - MediatorList.Clear; - if View <> nil then - View.RowCount := 1; {$Note Double check if this is desired. Shouldn't it be 0 instead. } -end; - -procedure TtiStringGridMediatorView.RebuildList; -begin -// writeln('--- TStringGridMediator.RebuildList'); - { This rebuilds the whole list. Not very efficient. } - View.BeginUpdate; - try - SetupGUIandObject; - MediatorList.Clear; - CreateSubMediators; - finally - View.EndUpdate; - end; -end; - -constructor TtiStringGridMediatorView.CreateCustom(AModel: TtiObjectList; AGrid: TfpgStringGrid; ADisplayNames: string; AIsObserving: Boolean); -begin - inherited Create; - DisplayNames := ADisplayNames; - Subject := AModel; - SetView(AGrid); - CreateSubMediators; - IsObserving := AIsObserving; -end; - -destructor TtiStringGridMediatorView.Destroy; -begin - IsObserving := False; - inherited Destroy; -end; - -class function TtiStringGridMediatorView.ComponentClass: TClass; -begin - Result := TfpgStringGrid; -end; - -function TtiStringGridMediatorView.GetObjectFromRow(ARow: Integer): TtiObject; -var - O: TObject; -begin - if View.RowCount = 0 then - begin - Result := nil; - Exit; - end; - - if ARow = -1 then - Result := nil - else - begin - O := View.Objects[0, ARow]; - if O <> nil then - Result := TtiListItemMediator(O).Model - else - Result := nil; - end; -end; - -function TtiStringGridMediatorView.View: TfpgStringGrid; -begin - Result := TfpgStringGrid(inherited View); -end; - - -{ TtiStringGridRowMediator } - -constructor TtiStringGridRowMediator.CreateCustom(AModel: TtiObject; AGrid: TfpgStringGrid; const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean); -begin - inherited Create; - Model := AModel; - FView := AGrid; - FFieldsInfo := AFieldsInfo; - FRowIndex := ARowIndex; - Active := IsObserving; // Will attach -end; - -procedure TtiStringGridRowMediator.Update(ASubject: TtiObject); -var - i: integer; - lFieldName: string; - lValue: string; -begin - Assert(Model = ASubject); - for i := 0 to FFieldsInfo.Count - 1 do - begin - lFieldName := FFieldsInfo[I].PropName; - lValue := tiGetProperty(Model, lFieldName); - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lFieldName, lValue); - FView.Cells[i, FRowIndex] := lValue; - end; -end; - - -{ TtiListBoxMediatorView } - -function TtiListBoxMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; -var - i: integer; - lFieldName: string; -begin - View.BeginUpdate; - try - if FieldsInfo.Count > 0 then // only take the first field it if exists - begin - lFieldName := FieldsInfo[0].PropName; - View.Items.Add(tiGetProperty(AData, lFieldName)); // set Cell text - end - else - View.Items.Add(AData.Caption); // the default fallback - - Result := TtiListBoxItemMediator.CreateCustom(AData, View, FieldsInfo, ARowIdx, Active); - View.Items.Objects[ARowIdx] := Result; // set Object reference inside grid. It used to be AData. - MediatorList.Add(Result); - finally - View.EndUpdate; - end; -end; - -procedure TtiListBoxMediatorView.DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); -begin - View.Items.Delete(AIndex); - inherited DoDeleteItemMediator(AIndex, AMediator); -end; - -function TtiListBoxMediatorView.GetSelectedObject: TtiObject; -begin - Result := GetObjectFromRow(View.FocusItem); -end; - -procedure TtiListBoxMediatorView.SetSelectedObject(const AValue: TtiObject); -var - i: integer; - o: TObject; -begin - for i := 0 to View.ItemCount - 1 do - begin - o := View.Items.Objects[i]; - if Assigned(o) and (TtiListItemMediator(o).Model = AValue) then - begin - View.FocusItem := i; - Exit; //==> - end; - end; { for } -// inherited SetSelectedObject(AValue); -end; - -procedure TtiListBoxMediatorView.CreateColumns; -begin - // do nothing - we don't support columns -end; - -procedure TtiListBoxMediatorView.ClearList; -begin - MediatorList.Clear; - if View <> nil then - View.Items.Clear; -end; - -procedure TtiListBoxMediatorView.RebuildList; -begin - { This rebuilds the whole list. Not very efficient. } - View.BeginUpdate; - try - SetupGUIandObject; - MediatorList.Clear; -// CreateColumns; - CreateSubMediators; - finally - View.EndUpdate; - end; -end; - -procedure TtiListBoxMediatorView.SetupGUIandObject; -begin - View.Items.Clear; - inherited SetupGUIandObject; -end; - -constructor TtiListBoxMediatorView.CreateCustom(AModel: TtiObjectList; - AListBox: TfpgListBox; ADisplayNames: string; AIsObserving: Boolean); -begin - inherited Create; - DisplayNames := ADisplayNames; - Subject := AModel; - SetView(AListBox); - CreateSubMediators; - IsObserving := AIsObserving; -end; - -destructor TtiListBoxMediatorView.Destroy; -begin - IsObserving := False; - inherited Destroy; -end; - -class function TtiListBoxMediatorView.ComponentClass: TClass; -begin - Result := TfpgListView; -end; - -function TtiListBoxMediatorView.GetObjectFromRow(ARow: Integer): TtiObject; -var - O: TObject; -begin - if View.ItemCount = 0 then - begin - Result := nil; - Exit; - end; - - if ARow = -1 then - Result := nil - else - begin - O := View.Items.Objects[ARow]; - if O <> nil then - Result := TtiListItemMediator(O).Model - else - Result := nil; - end; -end; - -function TtiListBoxMediatorView.View: TfpgListBox; -begin - Result := TfpgListBox(inherited View); -end; - -{ TtiListBoxItemMediator } - -constructor TtiListBoxItemMediator.CreateCustom(AModel: TtiObject; AListBox: TfpgListBox; - const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean); -begin - inherited Create; - Model := AModel; - FView := AListBox; - FFieldsInfo := AFieldsInfo; - FRowIndex := ARowIndex; - Active := IsObserving; // Will attach -end; - -procedure TtiListBoxItemMediator.Update(ASubject: TtiObject); -var - i: integer; - lFieldName: string; - lValue: string; - s: string; -begin - Assert(Model = ASubject); - s := ''; - for i := 0 to FFieldsInfo.Count - 1 do - begin - lFieldName := FFieldsInfo[I].PropName; - lValue := tiGetProperty(Model, lFieldName); - if Assigned(OnBeforeSetupField) then - OnBeforeSetupField(Model, lFieldName, lValue); - s := s + ', ' + lValue; - end; - FView.Items[FRowIndex] := s; -// inherited Update(ASubject); -end; - -end. - diff --git a/extras/tiopf/gui/tiLogToGUI.pas b/extras/tiopf/gui/tiLogToGUI.pas deleted file mode 100644 index 9acd5ff1..00000000 --- a/extras/tiopf/gui/tiLogToGUI.pas +++ /dev/null @@ -1,318 +0,0 @@ -{ - Log to a window above the application's main form, but only if - the -lv parameter is passed on the command line - - This in normally controlled by the tiLogReg unit. - - *** NOTE *** - If you application doesn't terminate when you activated LogToGUI, it probably - means a TThread.WaitFor deadlock occured. In that case, call ReleaseLog() - after fpgApplication.Run in you project's *.lpr file. -} -unit tiLogToGUI; - -{$mode objfpc}{$H+} - -interface -uses - Classes, - SysUtils, - fpg_widget, - fpg_form, - fpg_memo, - fpg_menu, - fpg_panel, - fpg_button, - fpg_main, - tiLog; - -type - TtiLogToGUI = class(TtiLogToCacheAbs) - private - FForm: TfpgForm; - FMemoLog: TfpgMemo; - FToolBar: TfpgBevel; - FPopupMenu: TfpgPopupMenu; - FViewLogMenuItem: TfpgMenuItem; - function GetFormParent: TfpgWidget; - procedure SetFormParent(const AValue: TfpgWidget); - function CreateForm: TfpgForm; - procedure FormClearMenuItemClick(Sender: TObject); - procedure FormWordWrapMenuItemClick(Sender: TObject); - procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); - procedure FormLogLevelButtonClick(Sender: TObject); - procedure DoViewLogFile(Sender: TObject); - procedure DoOnPopup(Sender: TObject); - procedure WriteToMemo(const AMessage: string); - protected - procedure WriteToOutput; override; - procedure SetSevToLog(const AValue: TtiSevToLog); override; - public - constructor Create; override; - destructor Destroy; override; - property FormParent: TfpgWidget read GetFormParent; // write SetFormParent; - procedure Log(const ADateTime, AThreadID, AMessage: string; ASeverity: TtiLogSeverity); override; - end; - - -implementation -uses - fpg_base, - tiUtils, - tiCommandLineParams, - tiDialogs; - - -{ TtiLogToGUI } - -constructor TtiLogToGUI.Create; -begin - // GUI output must be synchronized with the main thread. - inherited CreateSynchronized; - FForm := CreateForm; - ThrdLog.Resume; -end; - -destructor TtiLogToGUI.Destroy; -begin -// writeln('>> TtiLogToGUI.Destroy'); - if Assigned(FForm) then - FForm.Free; - FForm := nil; - inherited Destroy; -// writeln('<< TtiLogToGUI.Destroy'); -end; - -function TtiLogToGUI.CreateForm: TfpgForm; -var - lMenuItem: TfpgMenuItem; - lLogSev: TtiLogSeverity; - lToolButton: TfpgButton; - x: integer; -begin - FForm := TfpgForm.Create(fpgApplication); - FForm.WindowPosition := wpUser; - FForm.Top := 10; - FForm.Left := 10; - FForm.Height := 150; - FForm.Width := fpgApplication.ScreenWidth - 20; - FForm.WindowTitle := 'Application event log - ' + ApplicationName; - FForm.OnCloseQuery := @FormCloseQuery; - - FPopupMenu := TfpgPopupMenu.Create(FForm); - FPopupMenu.Name := 'PopupMenu'; - FPopupMenu.BeforeShow := @DoOnPopup; - - FToolBar := TfpgBevel.Create(FForm); - FToolBar.Name := 'ToolBar'; - FToolBar.SetPosition(0, 0, FForm.Width, 30); - FToolbar.Shape := bsSpacer; - FToolBar.Align := alTop; - FToolBar.TabOrder := 1; - - FMemoLog := TfpgMemo.Create(FForm); - FMemoLog.Name := 'MemoLog'; - FMemoLog.Top := 29; - FMemoLog.Align := alClient; - FMemoLog.FontDesc := '#Edit2'; // monospaced font - FMemoLog.PopupMenu := FPopupMenu; -// FMemoLog.ReadOnly := True; -// FMemoLog.ScrollBars := ssBoth; - FMemoLog.TabOrder := 0; -// FMemoLog.WordWrap := False; - FMemoLog.Lines.Clear; - - { Setup popup menu items} - FViewLogMenuItem := FPopupMenu.AddMenuItem('View log file', '', @DoViewLogFile); - FViewLogMenuItem.Name := 'Viewlogfile1'; - lMenuItem := FPopupMenu.AddMenuItem('-', '', nil); - lMenuItem.Name := 'N1'; - lMenuItem := FPopupMenu.AddMenuItem('Clear', '', @FormClearMenuItemClick); - lMenuItem.Name := 'ClearMenuItem'; - lMenuItem := FPopupMenu.AddMenuItem('Word wrap', '', @FormWordWrapMenuItemClick); - lMenuItem.Name := 'WordWrapMenuItem'; - lMenuItem.Enabled := False; - - { Setup severity toolbar buttons } - x := 1; - for lLogSev := Low(TtiLogSeverity) to High(TtiLogSeverity) do - begin - lToolButton := TfpgButton.Create(FToolBar); - lToolButton.SetPosition(x, 1, 50, 28); - lToolButton.Text := cTILogSeverityStrings[lLogSev]; - lToolButton.Tag := Ord(lLogSev); - lToolButton.AllowAllUp := True; // enables toggle button mode - lToolButton.GroupIndex := Ord(lLogSev) + 1; // enables toggle button mode - lToolButton.Down := lLogSev in GLog.SevToLog; - lToolButton.OnClick := @FormLogLevelButtonClick; - lToolButton.Focusable := False; - Inc(x, 51); - end; - - Result := FForm; -end; - -function TtiLogToGUI.GetFormParent: TfpgWidget; -begin - result := FForm.Parent; -end; - -procedure TtiLogToGUI.Log(const ADateTime, AThreadID, AMessage: string; ASeverity: TtiLogSeverity); -begin - if Terminated then - Exit; //==> - if not FForm.HasHandle then - FForm.Show; - inherited Log(ADateTime, AThreadID, AMessage, ASeverity); -end; - -procedure TtiLogToGUI.SetFormParent(const AValue: TfpgWidget); -begin - {$Note This is untested!!! } - FForm.Parent := AValue; - FForm.Align := alClient; - FForm.WindowAttributes := FForm.WindowAttributes + [waBorderless]; -// FForm.BorderStyle := bsNone; -end; - -procedure TtiLogToGUI.SetSevToLog(const AValue: TtiSevToLog); -var - i: integer; - lLogSev: TtiLogSeverity; -begin - // Let parent perform important task(s) - inherited; - // All we do here is reflect any changes to LogSeverity in the visual controls - for i := 0 to FToolBar.ComponentCount - 1 do - begin - lLogSev := TtiLogSeverity(FToolBar.Components[i].Tag); - if FToolBar.Components[i] is TfpgButton then - TfpgButton(FToolBar.Components[i]).Down := lLogSev in AValue; - end; -end; - -procedure TtiLogToGUI.WriteToMemo(const AMessage: string); -var - i: integer; - LLine: string; - LCount: integer; -begin - LCount := tiNumToken(AMessage, CrLf); - if LCount = 1 then - FMemoLog.Lines.Add(tiTrimTrailingWhiteSpace(AMessage)) - else - for i := 1 to LCount do - begin - LLine := tiTrimTrailingWhiteSpace(tiToken(AMessage, CrLf, i)); - FMemoLog.Lines.Add(LLine); - end; -end; - -procedure TtiLogToGUI.WriteToOutput; -var - i: integer; - LLogEvent: TtiLogEvent; - LPosStart: integer; - LPosEnd: integer; -const - ciMaxLineCount = 200; -begin - if ThrdLog.Terminated then - Exit; //==> - - inherited WriteToOutput; - - if ListWorking.Count > ciMaxLineCount * 2 then - begin - FMemoLog.Lines.Clear; - LPosStart := ListWorking.Count - 1 - ciMaxLineCount; - LPosEnd := ListWorking.Count - 1; - end else - begin - if FMemoLog.Lines.Count > ciMaxLineCount then - begin - for i := 0 to ciMaxLineCount div 2 do - FMemoLog.Lines.Delete(0); - //{$IFDEF MSWINDOWS} - //SendMessage(FMemoLog.handle, WM_VSCROLL, SB_Bottom, 0); - //{$ENDIF MSWINDOWS} - end; - LPosStart := 0; - LPosEnd := ListWorking.Count - 1; - end; - - for i := LPosStart to LPosEnd do begin - if ThrdLog.Terminated then - Break; //==> - LLogEvent := TtiLogEvent(ListWorking.Items[i]); - WriteToMemo(LLogEvent.AsLeftPaddedString); - end; - - ListWorking.Clear; -end; - -procedure TtiLogToGUI.FormClearMenuItemClick(Sender: TObject); -begin - FMemoLog.Lines.Clear; -end; - -procedure TtiLogToGUI.FormWordWrapMenuItemClick(Sender: TObject); -begin - //FMemoLog.WordWrap := not FMemoLog.WordWrap; - //FWordWrapMenuItem.Checked := FMemoLog.WordWrap; - //if FMemoLog.WordWrap then - //FMemoLog.ScrollBars := ssVertical - //else - //FMemoLog.ScrollBars := ssBoth; -end; - -procedure TtiLogToGUI.FormCloseQuery(Sender: TObject; var CanClose: Boolean); -begin - CanClose := False; -end; - -procedure TtiLogToGUI.FormLogLevelButtonClick(Sender: TObject); -var - lLogSev: TtiLogSeverity; - lLogChecked: boolean; -begin - if not (Sender is TfpgButton) then - Exit; //==> - - lLogSev := TtiLogSeverity(TfpgWidget(Sender).Tag); - lLogChecked := TfpgButton(Sender).Down; - if lLogChecked then - GLog.SevToLog := GLog.SevToLog + [lLogSev] - else - GLog.SevToLog := GLog.SevToLog - [lLogSev]; -end; - -procedure TtiLogToGUI.DoViewLogFile(Sender: TObject); -var - sl: TStringList; -begin - if (GLog.LogToFileName <> '') and - (FileExists(GLog.LogToFileName)) then - begin - sl := TStringList.Create; - try - sl.LoadFromFile(GLog.LogToFilename); - tiShowStringList(sl, GLog.LogToFilename); -// tiEditFile(GLog.LogToFileName); - finally - sl.Free; - end; - end; -end; - -procedure TtiLogToGUI.DoOnPopup(Sender: TObject); -begin - { If we are logging to file as well, then enable the menu option } - FViewLogMenuItem.Enabled := - (GLog.LogToFileName <> '') and - (FileExists(GLog.LogToFileName)); -end; - - -end. - diff --git a/extras/tiopf/gui/tiMediators.pas b/extras/tiopf/gui/tiMediators.pas deleted file mode 100644 index 889f6540..00000000 --- a/extras/tiopf/gui/tiMediators.pas +++ /dev/null @@ -1,990 +0,0 @@ -{ - Purpose: - Abstract mediating view and Mediator Factory. This allows you to use - standard edit components and make them object-aware. See the demo - application for usage. -} - -unit tiMediators; - -{$mode objfpc}{$H+} - -interface -uses - tiObject - ,Classes - ,tiBaseMediator - ,fpg_base // for predefined colors - ,fpg_main - ,fpg_widget - ,fpg_edit - ,fpg_checkbox - ,fpg_label - ,fpg_trackbar - ,fpg_combobox - ,fpg_memo - ,fpg_popupcalendar - ,fpg_spinedit - ; - -type - { Base class to handle TfpgWidget controls } - TtiControlMediatorView = class(TtiMediatorView) - private - FViewColor: TfpgColor; - FViewHint: TfpgString; - FViewErrorColor: TfpgColor; - FEditControl: TfpgEdit; - procedure SetViewErrorColor(const AValue: TfpgColor); - protected - function GetCurrentControlColor: TfpgColor; virtual; - procedure UpdateGuiValidStatus(pErrors: TtiObjectErrors); override; - public - constructor Create; override; - property ViewErrorColor: TfpgColor read FViewErrorColor write SetViewErrorColor; - procedure SetView(const AValue: TComponent); override; - function View: TfpgWidget; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgBaseEdit controls (TfpgEdit, TfpgNumericEdit, ...) } - TtiBaseEditMediatorView = class(TtiControlMediatorView) - private - FControlReadOnlyColor: TfpgColor; - procedure SetControlReadOnlyColor(const AValue: TfpgColor); - protected - function GetCurrentControlColor: TfpgColor; override; - procedure SetupGUIandObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - destructor Destroy; override; - property ControlReadOnlyColor: TfpgColor read FControlReadOnlyColor write SetControlReadOnlyColor; - function View: TfpgBaseEdit; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgEdit controls } - TtiEditMediatorView = class(TtiBaseEditMediatorView) - public - function View: TfpgEdit; reintroduce; - class function ComponentClass: TClass; override; - end; - - - TtiEditIntegerMediatorView = class(TtiBaseEditMediatorView) - public - constructor Create; override; - function View: TfpgEditInteger; reintroduce; - class function ComponentClass: TClass; override; - end; - - - TtiEditFloatMediatorView = class(TtiBaseEditMediatorView) - public - constructor Create; override; - function View: TfpgEditFloat; reintroduce; - class function ComponentClass: TClass; override; - end; - - - TtiEditCurrencyMediatorView = class(TtiBaseEditMediatorView) - public - constructor Create; override; - function View: TfpgEditCurrency; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgCheckBox controls } - TtiCheckBoxMediatorView = class(TtiControlMediatorView) - protected - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgCheckBox; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgLabel controls } - TtiStaticTextMediatorView = class(TtiControlMediatorView) - protected - procedure SetupGUIandObject; override; - public - constructor Create; override; - function View: TfpgLabel; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgSpinEdit controls } - TtiSpinEditMediatorView = class(TtiControlMediatorView) - protected - procedure SetupGUIandObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgSpinEdit; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgSpinEditFloat controls } - TtiSpinEditFloatMediatorView = class(TtiControlMediatorView) - protected - procedure SetupGUIandObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgSpinEditFloat; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgTrackBar controls } - TtiTrackBarMediatorView = class(TtiControlMediatorView) - private - procedure DoTrackBarChanged(Sender: TObject; APosition: integer); - protected - procedure SetupGUIandObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgTrackBar; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgComboBox controls } - TtiComboBoxMediatorView = class(TtiControlMediatorView) - protected - procedure DoObjectToGui; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgComboBox; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Sets ItemIndex based on integer property } - TtiItemComboBoxMediatorView = class(TtiComboBoxMediatorView) - protected - procedure DoGUIToObject; override; - procedure DoObjectToGUI; override; - public - constructor Create; override; - end; - - - { TfpgComboBox observing a list and setting a Object property } - TtiDynamicComboBoxMediatorView = class(TtiComboBoxMediatorView) - private - FDisplayFieldName: string; - FExternalOnChange: TNotifyEvent; - function GetDisplayFieldName: string; - procedure InternalListRefresh; - protected - procedure SetListObject(const AValue: TtiObjectList); override; - procedure SetOnChangeActive(AValue: Boolean); virtual; - procedure SetupGUIandObject; override; - procedure DoGuiToObject; override; - procedure DoObjectToGui; override; - public - procedure RefreshList; virtual; - property DisplayFieldName: string read GetDisplayFieldName write FDisplayFieldName; - end; - - - { Base class to handle TfpgMemo controls } - TtiMemoMediatorView = class(TtiControlMediatorView) - protected - procedure SetupGUIandObject; override; - procedure DoObjectToGui; override; - procedure DoGuiToObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgMemo; reintroduce; - class function ComponentClass: TClass; override; - end; - - - { Base class to handle TfpgCalendarCombo controls } - TtiCalendarComboMediatorView = class(TtiControlMediatorView) - protected - procedure SetupGUIandObject; override; - procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; - public - constructor Create; override; - function View: TfpgCalendarCombo; reintroduce; - class function ComponentClass: TClass; override; - end; - - -// Registering generic mediators which can handle most cases by default. -procedure RegisterFallBackMediators; - - -implementation -uses - SysUtils - ,TypInfo - ,fpg_dialogs // for TfpgMessageDialog - ,tiGUIConstants // for error color - ; - -type - // Friend class to get access to protected methods - THackWidget = class(TfpgWidget); - THackBaseEdit = class(TfpgBaseEdit); - - -const - cErrorListHasNotBeenAssigned = 'List has not been assigned'; - cErrorPropertyNotClass = 'Property is not a class type!'; - cErrorAddingItemToCombobox = 'Error adding list items to combobox ' + - 'Message: %s, Item Property Name: %s'; - - -procedure RegisterFallBackMediators; -begin - gMediatorManager.RegisterMediator(TtiEditMediatorView, TtiObject, [tkSString,tkAString,tkLString,tkWString,tkUString,tkInteger,tkFloat]); - gMediatorManager.RegisterMediator(TtiEditIntegerMediatorView, TtiObject, [tkInteger]); - gMediatorManager.RegisterMediator(TtiEditFloatMediatorView, TtiObject, [tkFloat]); - gMediatorManager.RegisterMediator(TtiEditCurrencyMediatorView, TtiObject, [tkFloat]); - gMediatorManager.RegisterMediator(TtiCheckBoxMediatorView, TtiObject, [tkBool]); - gMediatorManager.RegisterMediator(TtiComboBoxMediatorView, TtiObject, [tkSString,tkAString]); - gMediatorManager.RegisterMediator(TtiItemComboBoxMediatorView, TtiObject, [tkInteger, tkEnumeration]); - gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TtiObject, [tkClass]); - gMediatorManager.RegisterMediator(TtiStaticTextMediatorView, TtiObject); - gMediatorManager.RegisterMediator(TtiTrackBarMediatorView, TtiObject, [tkInteger]); - gMediatorManager.RegisterMediator(TtiMemoMediatorView, TtiObject, [tkSString,tkAString,tkLString,tkWString,tkUString]); - gMediatorManager.RegisterMediator(TtiCalendarComboMediatorView, TtiObject, [tkFloat]); - gMediatorManager.RegisterMediator(TtiSpinEditMediatorView, TtiObject, [tkInteger]); - gMediatorManager.RegisterMediator(TtiSpinEditFloatMediatorView, TtiObject, [tkFloat]); -end; - -{ TtiControlMediatorView } - -procedure TtiControlMediatorView.SetViewErrorColor(const AValue: TfpgColor); -begin - if AValue <> FViewErrorColor then - begin - FViewErrorColor := AValue; - TestIfValid; // Update view - end; -end; - -function TtiControlMediatorView.GetCurrentControlColor: TfpgColor; -begin - Result := fpgColorToRGB(FViewColor); -end; - -procedure TtiControlMediatorView.UpdateGuiValidStatus(pErrors: TtiObjectErrors); -var - oError: TtiObjectError; -begin - inherited UpdateGuiValidStatus(pErrors); - - oError := pErrors.FindByErrorProperty(RootFieldName); - if oError <> nil then - begin - View.BackgroundColor := ViewErrorColor; - View.Hint := oError.ErrorMessage; - end - else - begin - View.BackgroundColor := GetCurrentControlColor; - View.Hint := FViewHint; - end; -end; - -constructor TtiControlMediatorView.Create; -begin - inherited Create; - FViewErrorColor := clError; -end; - -procedure TtiControlMediatorView.SetView(const AValue: TComponent); -var - LValue: TfpgWidget; -begin - Assert((AValue = nil) or (AValue is TfpgWidget), 'Expected TfpgWidget'); - LValue := AValue as TfpgWidget; - - if LValue <> View then - begin - // Restore state of previous view - if View <> nil then - begin - View.Hint := FViewHint; - View.BackgroundColor := FViewColor; - end; - - // Preserve state of new view - if Assigned(LValue) then - begin - FViewHint := LValue.Hint; - FViewColor := LValue.BackgroundColor; - end; - end; - - inherited SetView(AValue); -end; - -function TtiControlMediatorView.View: TfpgWidget; -begin - Result := TfpgWidget(inherited View); -end; - -class function TtiControlMediatorView.ComponentClass: TClass; -begin - Result := TfpgWidget; -end; - -{ TtiBaseEditMediatorView } - -procedure TtiBaseEditMediatorView.SetControlReadOnlyColor(const AValue: TfpgColor); -begin - if AValue <> FControlReadOnlyColor then - begin - FControlReadOnlyColor := AValue; - TestIfValid; // Update view - end; -end; - -function TtiBaseEditMediatorView.GetCurrentControlColor: TfpgColor; -begin - if THackBaseEdit(View).ReadOnly then - Result := fpgColorToRGB(ControlReadOnlyColor) - else - Result := inherited GetCurrentControlColor; -end; - -procedure TtiBaseEditMediatorView.SetupGUIandObject; -var - Mi, Ma: Integer; -begin - inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName,Mi,Ma) and (Ma>0) then - THackBaseEdit(View).MaxLength := Ma; -end; - -procedure TtiBaseEditMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnchange,ouCustom] then - THackBaseEdit(View).OnChange := @DoOnChange - else - THackBaseEdit(View).OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - THackbaseEdit(View).OnChange := nil; - THackbaseEdit(View).OnExit := nil; - end; - end; -end; - -constructor TtiBaseEditMediatorView.Create; -begin - inherited Create; - FControlReadOnlyColor := clWindowBackground; - GUIFieldName := 'Text'; -end; - -destructor TtiBaseEditMediatorView.Destroy; -begin - if View <> nil then - begin - if Assigned(THackBaseEdit(View).OnChange) then - THackBaseEdit(View).OnChange := nil; - end; - inherited Destroy; -end; - -function TtiBaseEditMediatorView.View: TfpgBaseEdit; -begin - Result := TfpgBaseEdit(inherited View); -end; - -class function TtiBaseEditMediatorView.ComponentClass: TClass; -begin - Result := TfpgBaseEdit; -end; - -{ TtiEditMediatorView } - -function TtiEditMediatorView.View: TfpgEdit; -begin - Result := TfpgEdit(inherited View); -end; - -class function TtiEditMediatorView.ComponentClass: TClass; -begin - Result := TfpgEdit; -end; - -{ TtiSpinEditMediatorView} - -class function TtiSpinEditMediatorView.ComponentClass: TClass; -begin - Result := TfpgSpinEdit; -end; - -procedure TtiSpinEditMediatorView.SetupGUIandObject; -var - Mi, Ma: Integer; -begin - inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName, Mi, Ma) then - begin - View.MinValue := Mi; - View.MaxValue := Ma; - end; -end; - -procedure TtiSpinEditMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiSpinEditMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'Value'; -end; - -function TtiSpinEditMediatorView.View: TfpgSpinEdit; -begin - Result := TfpgSpinEdit(inherited View); -end; - - -{ TtiTrackBarMediatorView} - -procedure TtiTrackBarMediatorView.DoTrackBarChanged(Sender: TObject; APosition: integer); -begin - GUIChanged; -end; - -procedure TtiTrackBarMediatorView.SetupGUIandObject; -var - Mi, Ma: Integer; -begin - inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName, Mi, Ma) then - begin - View.Min := Mi; - View.Max := Ma; - end; -end; - -procedure TtiTrackBarMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoTrackBarChanged // TfpgTrackBar has a different event signature - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiTrackBarMediatorView.Create; -begin - inherited; - GuiFieldName := 'Position'; -end; - -function TtiTrackBarMediatorView.View: TfpgTrackBar; -begin - Result := TfpgTrackBar(inherited View); -end; - -class function TtiTrackBarMediatorView.ComponentClass: TClass; -begin - Result := TfpgTrackBar; -end; - - -{ TtiComboBoxMediatorView } - -class function TtiComboBoxMediatorView.ComponentClass: TClass; -begin - Result := TfpgComboBox; -end; - -constructor TtiComboBoxMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'Text'; -end; - -function TtiComboBoxMediatorView.View: TfpgComboBox; -begin - Result := TfpgComboBox(inherited View); -end; - -procedure TtiComboBoxMediatorView.DoObjectToGui; -begin - View.FocusItem := View.Items.IndexOf(Subject.PropValue[FieldName]); -end; - -procedure TtiComboBoxMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - - -{ TtiMemoMediatorView } - -class function TtiMemoMediatorView.ComponentClass: TClass; -begin - Result := TfpgMemo; -end; - -procedure TtiMemoMediatorView.DoGuiToObject; -begin - Subject.PropValue[FieldName] := Trim(View.Lines.Text); -end; - -procedure TtiMemoMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiMemoMediatorView.Create; -begin - inherited Create; -// FControlReadOnlyColor := clWindowBackground; - GUIFieldName := 'Lines'; -end; - -function TtiMemoMediatorView.View: TfpgMemo; -begin - Result := TfpgMemo(inherited View); -end; - -procedure TtiMemoMediatorView.DoObjectToGui; -begin - View.Lines.Text := Subject.PropValue[FieldName]; -end; - -procedure TtiMemoMediatorView.SetupGUIandObject; -var - Mi, Ma: integer; -begin - inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName,Mi,Ma) and (Ma>0) then - View.MaxLength := Ma; - View.Lines.Text := ''; -end; - - -{ TtiDynamicComboBoxMediatorView } - -procedure TtiDynamicComboBoxMediatorView.SetListObject(const AValue: TtiObjectList); -begin - inherited; - InternalListRefresh; - if Assigned(ValueList) then - View.Enabled := ValueList.Count > 0; -end; - -procedure TtiDynamicComboBoxMediatorView.InternalListRefresh; -var - lItems: TStrings; - i: Integer; -begin - lItems := View.Items; - lItems.Clear; - View.Text := ''; - - if (ValueList = nil) or - (ValueList.Count < 1) or - (SameText(FieldName, EmptyStr)) then - Exit; //==> - - try - for i := 0 to ValueList.Count - 1 do - lItems.AddObject(GetStrProp(ValueList.Items[i], DisplayFieldName), ValueList.Items[i]); - except - on E: Exception do - RaiseMediatorError(cErrorAddingItemToCombobox,[E.message, FieldName]); - end; - ObjectToGui; -end; - -function TtiDynamicComboBoxMediatorView.GetDisplayFieldName: string; -begin - Result := FDisplayFieldName; - if (Result = '') then - Result := 'Caption'; // Do not localize. -end; - -procedure TtiDynamicComboBoxMediatorView.SetOnChangeActive(AValue: Boolean); -begin - if AValue then - begin - if not UseInternalOnChange then - View.OnChange := FExternalOnChange - else - View.OnChange := @DoOnChange; - end - else - begin - if not UseInternalOnChange then - FExternalOnChange := View.OnChange; - View.OnChange := nil; - end; -end; - -procedure TtiDynamicComboBoxMediatorView.SetupGUIandObject; -begin - inherited SetupGUIandObject; - - if UseInternalOnChange then - View.OnChange := @DoOnChange; // default OnChange event handler - - {$Note As far as I can see, ValueList is always going to be nil here! - Graeme } - if ValueList <> nil then - View.Enabled := (ValueList.Count > 0); -end; - -procedure TtiDynamicComboBoxMediatorView.DoGuiToObject; -var - lValue: TtiObject; - lPropType: TTypeKind; -begin - if not DataAndPropertyValid then - Exit; //==> - if View.FocusItem < 0 then - Exit; //==> - - lValue := TtiObject(ValueList.Items[View.FocusItem]); - - lPropType := typinfo.PropType(Subject, FieldName); - if lPropType = tkClass then - typinfo.SetObjectProp(Subject, FieldName, lValue) - else - RaiseMediatorError(cErrorPropertyNotClass); -end; - -procedure TtiDynamicComboBoxMediatorView.DoObjectToGui; -var - i: Integer; - lValue: TtiObject; - lPropType: TTypeKind; -begin - SetOnChangeActive(false); - - // Set the index only (We're assuming the item is present in the list) - View.FocusItem := -1; - if Subject = nil then - Exit; //==> - - if not Assigned(ValueList) then - RaiseMediatorError(cErrorListHasNotBeenAssigned); - - lValue := nil; - lPropType := typinfo.PropType(Subject, FieldName); - if lPropType = tkClass then - lValue := TtiObject(typinfo.GetObjectProp(Subject, FieldName)) - else - RaiseMediatorError(cErrorPropertyNotClass); - - for i := 0 to ValueList.Count - 1 do - if ValueList.Items[i] = lValue then - begin - View.FocusItem := i; - Break; //==> - end; - - SetOnChangeActive(true); -end; - -procedure TtiDynamicComboBoxMediatorView.RefreshList; -begin - InternalListRefresh; -end; - - -{ TtiCheckBoxMediatorView } - -procedure TtiCheckBoxMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiCheckBoxMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'Checked'; -end; - -function TtiCheckBoxMediatorView.View: TfpgCheckBox; -begin - Result := TfpgCheckBox(inherited View); -end; - -class function TtiCheckBoxMediatorView.ComponentClass: TClass; -begin - Result := TfpgCheckBox; -end; - - -{ TtiStaticTextMediatorView } - -procedure TtiStaticTextMediatorView.SetupGUIandObject; -begin - inherited SetupGUIandObject; - View.Text := ''; -end; - -constructor TtiStaticTextMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'Text'; -end; - -function TtiStaticTextMediatorView.View: TfpgLabel; -begin - Result := TfpgLabel(inherited View); -end; - -class function TtiStaticTextMediatorView.ComponentClass: TClass; -begin - Result := TfpgLabel; -end; - - -{ TtiCalendarComboMediatorView } - -procedure TtiCalendarComboMediatorView.SetupGUIandObject; -var - Mi, Ma: TDateTime; -begin -// inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName, Mi, Ma) then - begin - View.MinDate := Mi; - View.MaxDate := Ma; - end; -end; - -procedure TtiCalendarComboMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiCalendarComboMediatorView.Create; -begin - inherited Create; - GUIFieldName := 'DateValue'; -end; - -function TtiCalendarComboMediatorView.View: TfpgCalendarCombo; -begin - Result := TfpgCalendarCombo(inherited View); -end; - -class function TtiCalendarComboMediatorView.ComponentClass: TClass; -begin - Result := TfpgCalendarCombo; -end; - - -{ TtiItemComboBoxMediatorView } - -procedure TtiItemComboBoxMediatorView.DoGUIToObject; -begin - SetOrdProp(Subject, FieldName, View.FocusItem); -end; - -procedure TtiItemComboBoxMediatorView.DoObjectToGUI; -begin - View.FocusItem := GetOrdProp(Subject, FieldName); -end; - -constructor TtiItemComboBoxMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'FocusItem'; -end; - -{ TtiSpinEditFloatMediatorView } - -procedure TtiSpinEditFloatMediatorView.SetupGUIandObject; -var - Mi, Ma: Integer; -begin - inherited SetupGUIandObject; - if Subject.GetFieldBounds(FieldName, Mi, Ma) then - begin - View.MinValue := Mi; - View.MaxValue := Ma; - end; -end; - -procedure TtiSpinEditFloatMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); -begin - inherited SetObjectUpdateMoment(AValue); - if View <> nil then - begin - if ObjectUpdateMoment in [ouOnChange,ouCustom] then - View.OnChange := @DoOnChange - else - View.OnExit := @DoOnChange; - if ObjectUpdateMoment in [ouNone] then - begin - View.OnChange := nil; - View.OnExit := nil; - end; - end; -end; - -constructor TtiSpinEditFloatMediatorView.Create; -begin - inherited Create; - GuiFieldName := 'Value'; -end; - -function TtiSpinEditFloatMediatorView.View: TfpgSpinEditFloat; -begin - Result := TfpgSpinEditFloat(inherited View); -end; - -class function TtiSpinEditFloatMediatorView.ComponentClass: TClass; -begin - Result := TfpgSpinEditFloat; -end; - -{ TtiEditIntegerMediatorView } - -constructor TtiEditIntegerMediatorView.Create; -begin - inherited Create; - GUIFieldName := 'Value'; -end; - -function TtiEditIntegerMediatorView.View: TfpgEditInteger; -begin - Result := TfpgEditInteger(inherited View); -end; - -class function TtiEditIntegerMediatorView.ComponentClass: TClass; -begin - Result := TfpgEditInteger; -end; - -{ TtiEditFloatMediatorView } - -constructor TtiEditFloatMediatorView.Create; -begin - inherited Create; - GUIFieldName := 'Value'; -end; - -function TtiEditFloatMediatorView.View: TfpgEditFloat; -begin - Result := TfpgEditFloat(inherited View); -end; - -class function TtiEditFloatMediatorView.ComponentClass: TClass; -begin - Result := TfpgEditFloat; -end; - -{ TtiEditCurrencyMediatorView } - -constructor TtiEditCurrencyMediatorView.Create; -begin - inherited Create; - GUIFieldName := 'Value'; -end; - -function TtiEditCurrencyMediatorView.View: TfpgEditCurrency; -begin - Result := TfpgEditCurrency(inherited View); -end; - -class function TtiEditCurrencyMediatorView.ComponentClass: TClass; -begin - Result := TfpgEditCurrency; -end; - - -end. - diff --git a/extras/tiopf/gui/tiRtfReport.pas b/extras/tiopf/gui/tiRtfReport.pas deleted file mode 100644 index 1041cd37..00000000 --- a/extras/tiopf/gui/tiRtfReport.pas +++ /dev/null @@ -1,4634 +0,0 @@ -{ - -Revision history: - 2005-07-05: First release by Marius Ellen (mariusellen@home.nl) - 2007-04-18: Ported to Free Pascal and fpGUI by Graeme Geldenhuys (graemeg@gmail.com) - -Purpose: - Create reports with RTF documents with access to dataset and framework objects. - -} - -{ TODO : Better exception handling. (saw some unexpected errors while parsing) corrupting the resulting rtf. } -{ TODO : Show errors when trying to past eof in a TtiObjectList (its now ignored) } -{ TODO : Suppress null dates (0 date are displayed as 1899-xx-xx) } - -unit tiRtfReport; - -{$mode objfpc}{$H+} -{.$I tiDefines.inc} - -interface - -uses - Classes, SysUtils, contnrs, TypInfo{, Jpeg}, - Db, Variants, tiObject, fpg_base; - -type - TtiRtfParser = class; - TRtfArgument = class; - TRtfException = class(Exception); - - TRtfClass =(RtfNothing, RtfUnknown, RtfGroup, RtfText, RtfControl, - RtfExpression, RtfBranche, RtfParseBegin, RtfParseEnd, RtfEOF); - - TRtfToken =(etNothing, etComma, etFunction, etProcedure, etParenthesis, - etADD, etSUB, etMUL, etDIV, etEQ, etNE, etGE, etLE, etGT, etLT, etNot, - etAnd, etOr, etAssign, etFieldName, etVariable, etDataset, etLitString, - etLitInt, etLitFloat, etLitDate, etLitFalse, etLitTrue); - TRtfTokenSet = set of TRtfToken; - - TRtfPictureOption =(poMetafile, poBinary); - TRtfPictureOptions = set of TRtfPictureOption; - TRtfPictureBorder =(brNone, brSingle, brDouble, brThick, brShadow, brDot, brHair); - - TColor = TfpgColor; - TPicture = TMemoryStream; // fake it until we can implement image support - - - TRtfPictureAttr = class(TObject) - private - FWidth: integer; - FHeigth: integer; - FScaleX: integer; - FScaleY: integer; - FWidthmm: Double; - FHeigthmm: Double; - FBorderWidth: integer; - FBorderColor: TColor; - FProportional: boolean; - FBorderType: TRtfPictureBorder; - procedure SetScaleX(Value: integer); - procedure SetScaleY(Value: integer); - public - constructor Create(AWidth, AHeigth: word); - //Width and height are in pixels - property Width: integer read FWidth; - property Heigth: integer read FHeigth; - //Widthmm and heightmm are in milimeters - property Widthmm: Double read FWidthmm; - property Heigthmm: Double read FHeigthmm; - //Scale from 1 to 100 - property ScaleX: integer read FScaleX write SetScaleX; - property ScaleY: integer read FScaleY write SetScaleY; - property BorderColor: TColor read FBorderColor write FBorderColor; - property BorderWidth: integer read FBorderWidth write FBorderWidth; //in points - property BorderType: TRtfPictureBorder read FBorderType write FBorderType; - property Proportional: boolean read FProportional write FProportional; - end; - - - TRtfPicturePath = procedure(var AFilename: string)of object; - TRtfFunctionExecute = procedure(AArgument: TRtfArgument)of object; - TRtfOnPictureAttr = procedure(APictureAttr: TRtfPictureAttr)of object; - TRtfArgumentEvent = procedure(APrevItem, AArgument, ANextItem: TRtfArgument)of object; - TRtfOnCreateDataset = procedure(ADatabase, AAlias, ASql: string; AArgument: TRtfArgument)of object; - - - //Basic Rtf control word - TRtfItem = class(TList) - private - FNext: TRtfItem; - FPrev: TRtfItem; - FParent: TRtfItem; - FRtfMajor: integer; - FRtfMinor: integer; - FRtfClass: TRtfClass; - FRtfTextBuf: string; - function GetItem(Index: integer): TRtfItem; - function CheckItem(AClass: TRtfClass; Major: integer): boolean; - protected - procedure Notify(Ptr: pointer; Action: TListNotification); override; - public - procedure Assign(ASource: TRtfItem); virtual; - property Next: TRtfItem read FNext; - property Prev: TRtfItem read FPrev; - property Parent: TRtfItem read FParent; - //Weak names, but it keeps the RawRtfParser simple - property RtfClass: TRtfClass read FRtfClass write FRtfClass; - property RtfMajor: integer read FRtfMajor write FRtfMajor; - property RtfMinor: integer read FRtfMinor write FRtfMinor; - property RtfTextBuf: string read FRtfTextBuf write FRtfTextBuf; - property Items[Index: integer]: TRtfItem read GetItem; default; - end; - - - //Old style Double linked list (but still usefull) - TRtfItemList = class(TObject) - private - FHead: TRtfItem; - FTail: TRtfItem; - FCount: integer; - protected - procedure dlRemove(AItem: TRtfItem; DisposeIt: boolean); - public - constructor Create; virtual; - destructor Destroy; override; - - procedure Clear; - function Add(AItem: TRtfItem): TRtfItem; - procedure SaveToStream(AStream: TStream; AColors: string); - procedure Insert(AItem: TRtfItem); {-Insert element at start of list} - procedure Delete(AItem: TRtfItem); {-Delete existing element in list, disposing of its contents} - procedure Extract(AItem: TRtfItem); {-Extract existing element from list without disposing of it} - procedure PlaceAfter(AItem, AAfter: TRtfItem); {-Place element P into list _after_ existing element L} - procedure PlaceBefore(AItem, ABefore: TRtfItem); {-Place element P into list _before_ existing element L} - - property Head: TRtfItem read FHead; {-Return TRtfItem to head of list} - property Tail: TRtfItem read FTail; {-Return TRtfItem to tail of list} - property Count: integer read FCount; - end; - - - //Variable definition - TRtfVariable = class(TObject) - private - FName: string; - FValue: variant; - FToken: TRtfToken; - public - property Name: string read FName write FName; - property Value: variant read FValue write FValue; - property Token: TRtfToken read FToken write FToken; - end; - - - TRtfVariableList = class(TObjectList) - private - function GetItem(Index: integer): TRtfVariable; - public - destructor Destroy; override; - function Find(AName: string): TRtfVariable; - function Add(AName: string; AValue: variant; AToken: TRtfToken): TRtfVariable; - property Items[Index: integer]: TRtfVariable read GetItem; default; - end; - - - //Function definition - TRtfFunction = class(TObject) - private - FMin: smallint; - FMax: smallint; - FName: string; - FToken: TRtfToken; - FOnExecute: TRtfFunctionExecute; - public - property Name: string read FName write FName; //Function name - property Min: smallint read FMin write FMin; //Function minimal parameters - property Max: smallint read FMax write FMax; //Function maximal parameters - property Token: TRtfToken read FToken write FToken; //Function type (=weak name) - property OnExecute: TRtfFunctionExecute read FOnExecute write FOnExecute; - end; - - - TRtfFunctionList = class(TObjectList) - private - function GetItem(Index: integer): TRtfFunction; - public - function Find(AName: string): TRtfFunction; - function Add(ATokenType: TRtfToken; AName: string; AMin, AMax: smallint; AOnexecute: TRtfFunctionExecute): TRtfFunction; - property Items[Index: integer]: TRtfFunction read GetItem; default; - end; - - - //Dataset defintion (Simply a wrap around the TDataset compatible and framework objects) - TRtfDataset = class(TObjectList) - private - FName: string; - FDataset: TObject; - FParent: TRtfDataset; - FTableIndex: integer; - FFreeDataset: boolean; - function GetItem(Index: integer): TRtfDataset; - function ResolveNestedFields(ATable: TRtfDataset; AName: string; var AFieldName: string): TRtfDataset; - protected - procedure Notify(Ptr: pointer; Action: TListNotification); override; - public - destructor Destroy; override; - function Find(AName: string): TRtfDataset; overload; - function Find(AName: string; out AFieldName: string): TRtfDataset; overload; - function Add(ADataset: TObject; AName: string; AFreeDataset: boolean = false): TRtfDataset; - property Items[Index: integer]: TRtfDataset read GetItem; default; - - procedure Open; - procedure Next; - procedure Prior; - procedure First; - procedure Last; - function Eof: boolean; - function Bof: boolean; - function IsEmpty: boolean; - function RecordCount: integer; - - property Parent: TRtfDataset read FParent; - property Name: string read FName write FName; //TableName - property FreeDataset: boolean read FFreeDataset; - property Dataset: TObject read FDataset write FDataset; - property TableIndex: integer read FTableIndex write FTableIndex; //Record index - end; - - - //Argument definition (For evaluating of expressions) - TRtfArgument = class(TObjectList) - private - FValue: variant; - FParent: TRtfArgument; - FToken: TRtfToken; - FParam: integer; - FParser: TtiRtfParser; - procedure ResolveVariable; - procedure EvaluateExpression; - function GetItem(Index: integer): TRtfArgument; - function Add(AArgument: TRtfArgument): TRtfArgument; overload; - function Add(AValue: variant; ATokenType: TRtfToken): TRtfArgument; overload; - procedure Walk(ATokenset: TRtfTokenSet; AExecproc: TRtfArgumentEvent); - procedure EvaluateAssign(APrevItem, AArgument, ANextItem: TRtfArgument); - procedure EvaluateComparison(APrevItem, AArgument, ANextItem: TRtfArgument); - procedure EvaluateUnaryBinary(APrevItem, AArgument, ANextItem: TRtfArgument); - protected - procedure Notify(Ptr: pointer; Action: TListNotification); override; - //Dataset stuff - procedure ResolveFieldName; - function GetPicture(APicture: TPicture): string; - procedure GetGraphicsValue(ADataset: TRtfDataset; AFieldName: string); - procedure ResolveFieldValue(ADataset: TRtfDataset; AFieldName: string); - procedure GetPictureData(ABuffer: pointer; ALength: cardinal; var Result: string); - public - constructor Create(AParser: TtiRtfParser); overload; - procedure Evaluate; - function Check(AParam: integer; ATokens: TRtfTokenSet): boolean; overload; - function Check(ATokens: array of TRtfTokenSet): boolean; overload; - procedure ParseExpression(AExpression: string); virtual; - - property Parser: TtiRtfParser read FParser; - property Parent: TRtfArgument read FParent; //Parent argument list - property Value: variant read FValue write FValue; //Argument value - property Param: integer read FParam write FParam; //Just for Scan(Dataset) - property Token: TRtfToken read FToken write FToken; //Argument type - property Items[Index: integer]: TRtfArgument read GetItem; default; - end; - - - //Color definition - TRtfColor = class(TObject) - private - FBlue: integer; - FRed: integer; - FGreen: integer; - function GetAsString: string; - public - property Red: integer read FRed write FRed; - property Green: integer read FGreen write FGreen; - property Blue: integer read FBlue write FBlue; - property AsString: string read GetAsString; - end; - - - TRtfColorList = class(TObjectlist) - private - function GetItem(Index: integer): TRtfColor; - function GetAsString: string; - public - property AsString: string read GetAsString; - procedure Clear; override; - function UseColor(AColor: TColor): integer; overload; - function Add(ARed, AGreen, ABlue: integer): integer; - function Find(ARed, AGreen, ABlue: integer): integer; - function UseColor(ARed, AGreen, ABlue: integer): integer; overload; - property Items[Index: integer]: TRtfColor read GetItem; default; - end; - - - //Parser definition - TtiRtfParser = class(TObject) - private - FBoolTrue: string; - FBoolFalse: string; - FHlpItems: TRtfItem; - TmpItems: TObjectlist; - FDatasets: TRtfDataset; - FRtfItems: TRtfItemList; - FErrorBackColor: TColor; - FErrorForeColor: TColor; - FRawItems: TRtfItemList; - FColorList: TRtfColorList; - FFunctions: TRtfFunctionList; - FVariables: TRtfVariableList; - FOnPicturePath: TRtfPicturePath; - FOnPictureAttr: TRtfOnPictureAttr; - FOnEvalutate: TRtfFunctionExecute; - FPictureOptions: TRtfPictureOptions; - FOnCreateDataset: TRtfOnCreateDataset; - procedure PreParse; - procedure Parse(AItems: TRtfItem); - procedure ParseExpression(AItem: TRtfItem); - function AddToRtfItems(AItem: TRtfItem): TRtfItem; - function SkipParagraph(AItem: TRtfItem): TRtfItem; - procedure UdfDateTimeTo(AArgument: TRtfArgument; AFormat: string); - protected - procedure AddFunctions; virtual; - procedure UdfDummy(AArgument: TRtfArgument); - - //routines for date time - procedure UdfNow(AArgument: TRtfArgument); - procedure UdfDate(AArgument: TRtfArgument); - procedure UdfTime(AArgument: TRtfArgument); - procedure UdfYear(AArgument: TRtfArgument); - procedure UdfMonth(AArgument: TRtfArgument); - procedure UdfDay(AArgument: TRtfArgument); - procedure UdfShortDayName(AArgument: TRtfArgument); - procedure UdfShortMonthName(AArgument: TRtfArgument); - procedure UdfLongDayName(AArgument: TRtfArgument); - procedure UdfLongMonthName(AArgument: TRtfArgument); - { year as string } - procedure UdfSYear(AArgument: TRtfArgument); - { month as string } - procedure UdfSMonth(AArgument: TRtfArgument); - { day as string } - procedure UdfSDay(AArgument: TRtfArgument); - { string to date } - procedure UdfStod(AArgument: TRtfArgument); - { date to string } - procedure UdfDtoS(AArgument: TRtfArgument); - procedure UdfDateToStr(AArgument: TRtfArgument); - procedure UdfTimeToStr(AArgument: TRtfArgument); - procedure UdfDateTimeToStr(AArgument: TRtfArgument); - procedure UdfStrToDate(AArgument: TRtfArgument); - procedure UdfStrToTime(AArgument: TRtfArgument); - procedure UdfStrToDateTime(AArgument: TRtfArgument); - - //routines for strings, int, float etc. - procedure UdfInt(AArgument: TRtfArgument); - procedure UdfStr(AArgument: TRtfArgument); - procedure UdfVal(AArgument: TRtfArgument); - procedure UdfChr(AArgument: TRtfArgument); - procedure UdfNul(AArgument: TRtfArgument); - procedure UdfFrac(AArgument: TRtfArgument); - procedure UdfEmpty(AArgument: TRtfArgument); - procedure UdfPadr(AArgument: TRtfArgument); - procedure UdfPadl(AArgument: TRtfArgument); - procedure UdfLower(AArgument: TRtfArgument); - procedure UdfUpper(AArgument: TRtfArgument); - procedure UdfTrunc(AArgument: TRtfArgument); - procedure UdfRound(AArgument: TRtfArgument); - procedure UdfTrim(AArgument: TRtfArgument); - procedure UdfPower(AArgument: TRtfArgument); - procedure UdfIntPower(AArgument: TRtfArgument); - procedure UdfTrimLeft(AArgument: TRtfArgument); - procedure UdfTrimRight(AArgument: TRtfArgument); - procedure UdfSubStr(AArgument: TRtfArgument); - procedure UdfIntToStr(AArgument: TRtfArgument); - procedure UdfStrToInt(AArgument: TRtfArgument); - procedure UdfFloatToStr(AArgument: TRtfArgument); - procedure UdfStrToFloat(AArgument: TRtfArgument); - procedure UdfFormatFloat(AArgument: TRtfArgument); - procedure UdfFBool(AArgument: TRtfArgument); - - //routines for conditinals - procedure UdfIf(AArgument: TRtfArgument); - procedure UdfIif(AArgument: TRtfArgument); - - //routines for datasets - procedure UdfDataset(AArgument: TRtfArgument); - procedure UdfScan(AArgument: TRtfArgument); - procedure UdfBof(AArgument: TRtfArgument); - procedure UdfEof(AArgument: TRtfArgument); - procedure UdfNext(AArgument: TRtfArgument); - procedure UdfPrior(AArgument: TRtfArgument); - procedure UdfFirst(AArgument: TRtfArgument); - procedure UdfLast(AArgument: TRtfArgument); - procedure UdfOpen(AArgument: TRtfArgument); - procedure UdfIsEmpty(AArgument: TRtfArgument); - procedure UdfRecordCount(AArgument: TRtfArgument); - - //misch routines - procedure UdfPicture(AArgument: TRtfArgument); - procedure UdfDbPicture(AArgument: TRtfArgument); - public - constructor Create; virtual; - destructor Destroy; override; - - procedure Clear; - procedure Execute; virtual; - - procedure LoadFromFile(AFilename: string); - procedure LoadFromString(AString: string); - procedure LoadFromStream(AStream: TMemoryStream); - procedure LoadFromBuffer(ABuffer: pchar; ASize: integer); - - function SaveToString: string; - procedure SaveToFile(AFileName: string); - procedure SaveToStream(AStream: TMemoryStream); - - function AddVariable(AName: string; AValue: variant; AToken: TRtfToken): TRtfVariable; - function AddDataset(ATable: TObject; AName: string; AFreeDataset: boolean = false): TRtfDataset; - function AddFunction(AName: string; ATokenType: TRtfToken; AMin, AMax: smallint; AOnexecute: TRtfFunctionExecute): TRtfFunction; - - - //these should all be hidden in component style - property RawItems: TRtfItemList read FRawItems; - property HlpItems: TRtfItem read FHlpItems; - property RtfItems: TRtfItemList read FRtfItems; - property Datasets: TRtfDataset read FDatasets; - property Functions: TRtfFunctionList read FFunctions; - property Variables: TRtfVariableList read FVariables; - property ColorList: TRtfColorList read FColorList; - property OnEvalutate: TRtfFunctionExecute read FOnEvalutate write FOnEvalutate; //For debug only - published - property BoolTrue: string read FBoolTrue write FBoolTrue; - property BoolFalse: string read FBoolFalse write FBoolFalse; - property ErrorForeColor: TColor read FErrorForeColor write FErrorForeColor default clRed; - property ErrorBackColor: TColor read FErrorBackColor write FErrorBackColor default clYellow; - property PictureOptions: TRtfPictureOptions read FPictureOptions write FPictureOptions default[poMetafile, poBinary]; - - property OnPicturePath: TRtfPicturePath read FOnPicturePath write FOnPicturePath; - property OnPictureAttr: TRtfOnPictureAttr read FOnPictureAttr write FOnPictureAttr; - property OnCreateDataset: TRtfOnCreateDataset read FOnCreateDataset write FOnCreateDataset; - end; - -implementation - -uses - math // IntPower() function - ,fpg_main // fpgApplication.HandleExeception() - ; - -resourcestring - rsNotImplemented = 'Not implemented'; - rsInvalidDateConstant = 'Invalid date constant'; - rsInvalidTimeConstant = 'Invalid time constant'; - rsInvalidDateSeparator = 'Invalid date separator'; - rsInvalidTimeSeparator = 'Invalid time separator'; - rsInvalidDateTimeConstant = 'Invalid date/time constant'; - rsInvalidExpressionCharacter = 'Invalid expression character "%s"'; - rsUnterminatedStringConstant = 'Unterminated string constant'; - rsToManyClosingParenthesis = 'Unexpected parenthesis'; - rsExpectedClosingParenthesis = 'Missing closing parenthesis'; - rsUnexpectedParameterType = 'Unexpected parameter type'; - -type - TRtfKey = record - RtfKMajor: integer; - RtfKMinor: integer; - RtfKStr: string; - end; - - - TRawRtfParser = class(TObject) - private - APtr, AEnd: pchar; - APushedChar: char; - FRtfMajor: integer; - FRtfMinor: integer; - FRtfTextBuf: string; - AParseItem: TRtfItem; - FRtfClass: TRtfClass; - FColorTable: TRtfItem; - RawItems: TRtfItemList; - procedure RtfHook; - procedure GetRtfToken; - function GetRtfChar: char; - protected - property RtfClass: TRtfClass read FRtfClass; - property RtfMajor: integer read FRtfMajor; - property RtfMinor: integer read FRtfMinor; - property RtfTextBuf: string read FRtfTextBuf; - public - procedure Execute(ARawItems: TRtfItemList; ARtfPtr: pchar; ARtfSize: integer); - - property ColorTable: TRtfItem read FColorTable; - end; - - - -const - {@indent off} - //Control class major numbers - //RtfVersion = 01; - //RtfDefFont = 02; - //RtfCharSet = 03; - RtfDestination = 04; - //RtfFontFamily = 05; - //RtfColorName = 06; - RtfSpecialChar = 07; - //RtfStyleAttr = 08; - //RtfDocAttr = 09; - //RtfSectAttr = 10; - //RtfTblAttr = 11; - RtfParAttr = 12; - //RtfCharAttr = 13; - //RtfPictAttr = 14; - //RtfNeXTGrAttr = 15; - //RtfFieldAttr = 16; - //RtfTOCAttr = 17; - //RtfPosAttr = 18; - - //RtfExpression major numbers - RtfNormalExpression = 1; - RtfIfExpression = 2; - RtfThenExpression = 3; - RtfElseExpression = 4; - RtfEndifExpression = 5; - RtfScan = 6; - RtfScanEntry = 7; - RtfScanFooter = 8; - RtfScanEnd = 9; - - //Group class major numbers - RtfBeginGroup = 01; - RtfEndGroup = 02; - - //Control class minor numbers - {RtfAnsiCharSet = 0; - RtfMacCharSet = 1; - RtfPcCharSet = 2; - RtfPcaCharSet = 3;} - - - //Destination attributes minor numbers - {RtfPict = 0; - RtfNeXTGraphic = 1; - RtfFootnote = 2; - RtfHeader = 3; - RtfHeaderLeft = 4; - RtfHeaderRight = 5; - RtfHeaderFirst = 6; - RtfFooter = 7; - RtfFooterLeft = 8; - RtfFooterRight = 9; - RtfFooterFirst = 10; - RtfFNSep = 11; - RtfFNContSep = 12; - RtfFNContNotice = 13;} - RtfInfo = 14; - RtfStyleSheet = 15; - RtfFontTbl = 16; - RtfColorTbl = 17; - RtfField = 18; - {RtfFieldInst = 19; - RtfFieldResult = 20; - RtfIndex = 21; - RtfIndexBold = 22; - RtfIndexItalic = 23; - RtfIndexText = 24; - RtfIndexRange = 25; - RtfTOC = 26; - RtfBookmarkStart = 27; - RtfBookmarkEnd = 28; - RtfITitle = 29; - RtfISubject = 30; - RtfIAuthor = 31; - RtfIOperator = 32; - RtfIKeywords = 33; - RtfIComment = 34; - RtfIVersion = 35; - RtfIDoccomm = 36;} - - //Fonts minor numbers - {RtfFFNil = 0; - RtfFFRoman = 1; - RtfFFSwiss = 2; - RtfFFModern = 3; - RtfFFScript = 4; - RtfFFDecor = 5; - RtfFFTech = 6;} - - //Color attributes minor numbers - {RtfRed = 0; - RtfGreen = 1; - RtfBlue = 2;} - - //Style attributes minor numbers - {RtfBasedOn = 0; - RtfNext = 1;} - - //Special characters minor numbers - {RtfCurHeadPage = 0; - RtfCurFNote = 1; - RtfCurHeadPict = 2; - RtfCurHeadDate = 3; - RtfCurHeadTime = 4;} - RtfFormula = 5; - RtfNoBrkSpace = 6; - RtfNoReqHyphen = 7; - RtfNoBrkHyphen = 8; - {RtfPage = 9; - RtfLine = 10;} - RtfPar = 11; - {RtfSect = 12;} - RtfTab = 13; - {RtfCell = 14; - RtfRow = 15; - RtfCurAnnot = 16; - RtfAnnotation = 17; - RtfAnnotID = 18; - RtfCurAnnotRef = 19; - RtfFNoteSep = 20; - RtfFNoteCont = 21; - RtfColumn = 22;} - RtfOptDest = 23; - {RtfIIntVersion = 24; - RtfICreateTime = 25; - RtfIRevisionTime = 26; - RtfIPrintTime = 27; - RtfIBackupTime = 28; - RtfIEditTime = 29; - RtfIYear = 30; - RtfIMonth = 31; - RtfIDay = 32; - RtfIHour = 33; - RtfIMinute = 34; - RtfINPages = 35; - RtfINWords = 36; - RtfINChars = 37; - RtfIIntID = 38;} - RtflQuote = 39; - RtfrQuote = 40; - RtflDblQuote = 41; - RtfrDblQuote = 42; - - - //Document atributes minor numbers - {RtfPaperWidth = 0; - RtfPaperHeight = 1; - RtfLeftMargin = 2; - RtfRightMargin = 3; - RtfTopMargin = 4; - RtfBottomMargin = 5; - RtfFacingPage = 6; - RtfGutterWid = 7; - RtfDefTab = 8; - RtfWidowCtrl = 9; - RtfHyphHotZone = 10; - RtfFNoteEndSect = 11; - RtfFNoteEndDoc = 12; - RtfFNoteText = 13; - RtfFNoteBottom = 14; - RtfFNoteStart = 15; - RtfFNoteRestart = 16; - RtfPageStart = 17; - RtfLineStart = 18; - RtfLandscape = 19; - RtfFracWidth = 20; - RtfNextFile = 21; - RtfTemplate = 22; - RtfMakeBackup = 23; - RtfRtfDefault = 24; - RtfRevisions = 25; - RtfMirrorMargin = 26; - RtfRevDisplay = 27; - RtfRevBar = 28;} - - //Sector attributes minor numbers - {RtfSectDef = 0; - RtfNoBreak = 1; - RtfColBreak = 2; - RtfPageBreak = 3; - RtfEvenBreak = 4; - RtfOddBreak = 5; - RtfPageStarts = 6; - RtfPageCont = 7; - RtfPageRestart = 8; - RtfPageDecimal = 9; - RtfPageURoman = 10; - RtfPageLRoman = 11; - RtfPageULetter = 12; - RtfPageLLetter = 13; - RtfPageNumLeft = 14; - RtfPageNumTop = 15; - RtfHeaderY = 16; - RtfFooterY = 17; - RtfLineModulus = 18; - RtfLineDist = 19; - RtfLineStarts = 20; - RtfLineRestart = 21; - RtfLineRestartPg = 22; - RtfLineCont = 23; - RtfTopVAlign = 24; - RtfBottomVAlign = 25; - RtfCenterVAlign = 26; - RtfJustVAlign = 27; - RtfColumns = 28; - RtfColumnSpace = 29; - RtfColumnLine = 30; - RtfENoteHere = 31; - RtfTitleSpecial = 32;} - - //Table attributes minor numbers - {RtfCellBordBottom = 0; - RtfCellBordTop = 1; - RtfCellBordLeft = 2; - RtfCellBordRight = 3; - RtfRowDef = 4; - RtfRowLeft = 5; - RtfRowRight = 6; - RtfRowCenter = 7; - RtfRowGapH = 8; - RtfRowHt = 9; - RtfRowLeftEdge = 10; - RtfCellPos = 11; - RtfMergeRngFirst = 12; - RtfMergePrevious = 13;} - - //Paragrapgh attributes minor numbers - RtfParDef = 0; - {RtfStyleNum = 1; - RtfQuadLeft = 2; - RtfQuadRight = 3; - RtfQuadJust = 4; - RtfQuadCenter = 5; - RtfFirstIndent = 6; - RtfLeftIndent = 7; - RtfRightIndent = 8; - RtfSpaceBefore = 9; - RtfSpaceAfter = 10; - RtfSpaceBetween = 11; - RtfInTable = 12; - RtfKeep = 13; - RtfKeepNext = 14; - RtfSideBySide = 15; - RtfPBBefore = 16; - RtfNoLineNum = 17; - RtfTabPos = 18; - RtfTabRight = 19; - RtfTabCenter = 20; - RtfTabDecimal = 21; - RtfTabBar = 22; - RtfBorderTop = 23; - RtfBorderBottom = 24; - RtfBorderLeft = 25; - RtfBorderRight = 26; - RtfBorderBox = 27; - RtfBorderBar = 28; - RtfBorderBetween = 29; - RtfBorderSingle = 30; - RtfBorderThick = 31; - RtfBorderShadow = 32; - RtfBorderDouble = 33; - RtfBorderDot = 34; - RtfBorderHair = 35; - RtfBorderSpace = 36; - RtfLeaderDot = 37; - RtfLeaderHyphen = 38; - RtfLeaderUnder = 39; - RtfLeaderThick = 40;} - - //Character attributes minor numbers - {RtfPlain = 0; - RtfBold = 1; - RtfItalic = 2; - RtfStrikeThru = 3; - RtfOutline = 4; - RtfShadow = 5; - RtfSmallCaps = 6; - RtfAllCaps = 7; - RtfInvisible = 8; - RtfFontNum = 9; - RtfFontSize = 10; - RtfExpand = 11; - RtfUnderline = 12; - RtfWUnderline = 13; - RtfDUnderline = 14; - RtfDbUnderline = 15; - RtfNoUnderline = 16; - RtfSuperScript = 17; - RtfSubScript = 18; - RtfRevised = 19; - RtfForeColor = 20; - RtfBackColor = 21; - RtfGray = 22; } - - //Picture attributes minor numbers - {RtfMacQD = 0; - RtfWinMetafile = 1; - RtfWinBitmap = 2; - RtfPicWid = 3; - RtfPicHt = 4; - RtfPicGoalWid = 5; - RtfPicGoalHt = 6; - RtfPicScaleX = 7; - RtfPicScaleY = 8; - RtfPicScaled = 9; - RtfPicCropTop = 10; - RtfPicCropBottom = 11; - RtfPicCropLeft = 12; - RtfPicCropRight = 13; - RtfPixelBits = 14; - RtfBitmapPlanes = 15; - RtfBitmapWid = 16; - RtfPicBinary = 17;} - - // - {RtfNeXTGWidth = 0; - RtfNeXTGHeight = 1;} - - //Field attributes minor numbers - {RtfFieldDirty = 0; - RtfFieldEdited = 1; - RtfFieldLocked = 2; - RtfFieldPrivate = 3;} - - //Toc attributes minor numbers - {RtfTOCType = 0; - RtfTOCLevel = 1;} - - //Position attributes minor numbers - {RtfPosX = 0; - RtfPosXCenter = 1; - RtfPosXInside = 2; - RtfPosXLeft = 3; - RtfPosXOutSide = 4; - RtfPosXRight = 5; - RtfPosY = 6; - RtfPosYInline = 7; - RtfPosYTop = 8; - RtfPosYCenter = 9; - RtfPosYBottom = 10; - RtfAbsWid = 11; - RtfTextDist = 12; - RtfRPosMargV = 13; - RtfRPosPageV = 14; - RtfRPosMargH = 15; - RtfRPosPageH = 16; - RtfRPosColH = 17;} - -const - //A reduced set of control words - RtfKey: array[0..15]of TRtfKey = - ( - (RtfKMajor: RtfParAttr; RtfKMinor: RtfParDef; RtfKStr: '\pard' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfPar; RtfKStr: '\par' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfTab; RtfKStr: '\tab' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtflQuote; RtfKStr: '\lquote' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfrQuote; RtfKStr: '\rquote' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtflQuote; RtfKStr: '\'+Chr(39)+'91'), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfrQuote; RtfKStr: '\'+Chr(39)+'92'), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtflDblQuote; RtfKStr: '\ldblquote' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfrDblQuote; RtfKStr: '\rdblquote' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtflDblQuote; RtfKStr: '\'+Chr(39)+'93'), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfrDblQuote; RtfKStr: '\'+Chr(39)+'94'), - (RtfKMajor: RtfDestination; RtfKMinor: RtfInfo; RtfKStr: '\info' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfStyleSheet; RtfKStr: '\stylesheet' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFontTbl; RtfKStr: '\fonttbl' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfColorTbl; RtfKStr: '\colortbl' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfField; RtfKStr: '\field' ) - ); - - { You could also add the following (but i don't need all that): - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurHeadPict; RtfKStr: '\chpict' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurHeadDate; RtfKStr: '\chdate' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurHeadTime; RtfKStr: '\chtime' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurHeadPage; RtfKStr: '\chpgn' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurFNote; RtfKStr: '\chftn' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCurAnnotRef; RtfKStr: '\chatn' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfFNoteSep; RtfKStr: '\chftnsep' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfFNoteCont; RtfKStr: '\chftnsepc' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfCell; RtfKStr: '\cell' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfRow; RtfKStr: '\row' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfSect; RtfKStr: '\sect' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfPage; RtfKStr: '\page' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfColumn; RtfKStr: '\column' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfLine; RtfKStr: '\line' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIIntVersion; RtfKStr: '\vern' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfICreateTime; RtfKStr: '\creatim' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIRevisionTime; RtfKStr: '\revtim' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIPrintTime; RtfKStr: '\printim' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIBackupTime; RtfKStr: '\buptim' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIEditTime; RtfKStr: '\edmins' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIYear; RtfKStr: '\yr' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIMonth; RtfKStr: '\mo' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIDay; RtfKStr: '\dy' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIHour; RtfKStr: '\hr' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIMinute; RtfKStr: '\min' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfINPages; RtfKStr: '\nofpages' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfINWords; RtfKStr: '\nofwords' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfINChars; RtfKStr: '\nofchars' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfIIntID; RtfKStr: '\id' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfPict; RtfKStr: '\pict' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfNeXTGraphic; RtfKStr: '\nextgraphic' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFootnote; RtfKStr: '\footnote' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfHeader; RtfKStr: '\header' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfHeaderLeft; RtfKStr: '\headerl' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfHeaderRight; RtfKStr: '\headerr' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfHeaderFirst; RtfKStr: '\headerf' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFooter; RtfKStr: '\footer' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFooterLeft; RtfKStr: '\footerl' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFooterRight; RtfKStr: '\footerr' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFooterFirst; RtfKStr: '\footerf' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFNSep; RtfKStr: '\ftnsep' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFNContSep; RtfKStr: '\ftnsepc' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFNContNotice; RtfKStr: '\ftncn' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfAnnotation; RtfKStr: '\annotation' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfAnnotID; RtfKStr: '\atnid' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFieldInst; RtfKStr: '\fldinst' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfFieldResult; RtfKStr: '\fldrslt' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIndex; RtfKStr: '\xe' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIndexBold; RtfKStr: '\bxe' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIndexItalic; RtfKStr: '\ixe' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIndexText; RtfKStr: '\txe' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIndexRange; RtfKStr: '\rxe' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfTOC; RtfKStr: '\tc' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfBookmarkStart; RtfKStr: '\bkmkstart' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfBookmarkEnd; RtfKStr: '\bkmkend' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfITitle; RtfKStr: '\title' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfISubject; RtfKStr: '\subject' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIAuthor; RtfKStr: '\author' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIOperator; RtfKStr: '\operator' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIKeywords; RtfKStr: '\keywords' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIComment; RtfKStr: '\comment' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIVersion; RtfKStr: '\version' ), - (RtfKMajor: RtfDestination; RtfKMinor: RtfIDoccomm; RtfKStr: '\doccomm' ), - (RtfKMajor: RtfVersion; RtfKMinor: - 1; RtfKStr: '\rtf' ), - (RtfKMajor: RtfDefFont; RtfKMinor: - 1; RtfKStr: '\deff' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfStyleNum; RtfKStr: '\s' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfQuadLeft; RtfKStr: '\ql' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfQuadRight; RtfKStr: '\qr' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfQuadJust; RtfKStr: '\qj' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfQuadCenter; RtfKStr: '\qc' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfFirstIndent; RtfKStr: '\fi' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfLeftIndent; RtfKStr: '\li' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfRightIndent; RtfKStr: '\ri' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfSpaceBefore; RtfKStr: '\sb' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfSpaceAfter; RtfKStr: '\sa' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfSpaceBetween; RtfKStr: '\sl' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfInTable; RtfKStr: '\intbl' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfKeep; RtfKStr: '\keep' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfKeepNext; RtfKStr: '\keepn' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfSideBySide; RtfKStr: '\sbys' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfPBBefore; RtfKStr: '\pagebb' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfNoLineNum; RtfKStr: '\noline' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfTabPos; RtfKStr: '\tx' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfTabRight; RtfKStr: '\tqr' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfTabCenter; RtfKStr: '\tqc' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfTabDecimal; RtfKStr: '\tqdec' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfTabBar; RtfKStr: '\tb' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderTop; RtfKStr: '\brdrt' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderBottom; RtfKStr: '\brdrb' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderLeft; RtfKStr: '\brdrl' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderRight; RtfKStr: '\brdrr' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderBar; RtfKStr: '\bar' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderBox; RtfKStr: '\box' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderBetween; RtfKStr: '\brdrbtw' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderSingle; RtfKStr: '\brdrs' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderThick; RtfKStr: '\brdrth' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderShadow; RtfKStr: '\brdrsh' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderDouble; RtfKStr: '\brdrdb' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderDot; RtfKStr: '\brdrdot' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderHair; RtfKStr: '\brdrhair' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfLeaderDot; RtfKStr: '\tldot' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfLeaderHyphen; RtfKStr: '\tlhyph' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfLeaderUnder; RtfKStr: '\tlul' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfLeaderThick; RtfKStr: '\tlth' ), - (RtfKMajor: RtfParAttr; RtfKMinor: RtfBorderSpace; RtfKStr: '\brsp' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfCellBordBottom; RtfKStr: '\clbrdrb' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfCellBordTop; RtfKStr: '\clbrdrt' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfCellBordLeft; RtfKStr: '\clbrdrl' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfCellBordRight; RtfKStr: '\clbrdrr' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowDef; RtfKStr: '\trowd' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowLeft; RtfKStr: '\trql' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowRight; RtfKStr: '\trqr' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowCenter; RtfKStr: '\trqc' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowGapH; RtfKStr: '\trgaph' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowHt; RtfKStr: '\trrh' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfRowLeftEdge; RtfKStr: '\trleft' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfCellPos; RtfKStr: '\cellx' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfMergeRngFirst; RtfKStr: '\clmgf' ), - (RtfKMajor: RtfTblAttr; RtfKMinor: RtfMergePrevious; RtfKStr: '\clmrg' ), - (RtfKMajor: RtfTOCAttr; RtfKMinor: RtfTOCType; RtfKStr: '\tcf' ), - (RtfKMajor: RtfTOCAttr; RtfKMinor: RtfTOCLevel; RtfKStr: '\tcl' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFNil; RtfKStr: '\fnil' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFRoman; RtfKStr: '\froman' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFSwiss; RtfKStr: '\fswiss' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFModern; RtfKStr: '\fmodern' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFScript; RtfKStr: '\fscript' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFDecor; RtfKStr: '\fdecor' ), - (RtfKMajor: RtfFontFamily; RtfKMinor: RtfFFTech; RtfKStr: '\ftech' ), - (RtfKMajor: RtfCharSet; RtfKMinor: RtfMacCharSet; RtfKStr: '\mac' ), - (RtfKMajor: RtfCharSet; RtfKMinor: RtfAnsiCharSet; RtfKStr: '\ansi' ), - (RtfKMajor: RtfCharSet; RtfKMinor: RtfPcCharSet; RtfKStr: '\pc' ), - (RtfKMajor: RtfCharSet; RtfKMinor: RtfPcaCharSet; RtfKStr: '\pca' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfPlain; RtfKStr: '\plain' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfBold; RtfKStr: '\b' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfItalic; RtfKStr: '\i' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfStrikeThru; RtfKStr: '\strike' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfOutline; RtfKStr: '\outl' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfShadow; RtfKStr: '\shad' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfSmallCaps; RtfKStr: '\scaps' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfAllCaps; RtfKStr: '\caps' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfInvisible; RtfKStr: '\v' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfFontNum; RtfKStr: '\f' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfFontSize; RtfKStr: '\fs' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfExpand; RtfKStr: '\expnd' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfUnderline; RtfKStr: '\ul' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfWUnderline; RtfKStr: '\ulw' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfDUnderline; RtfKStr: '\uld' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfDbUnderline; RtfKStr: '\uldb' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfNoUnderline; RtfKStr: '\ulnone' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfSuperScript; RtfKStr: '\up' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfSubScript; RtfKStr: '\dn' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfRevised; RtfKStr: '\revised' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfForeColor; RtfKStr: '\cf' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfBackColor; RtfKStr: '\cb' ), - (RtfKMajor: RtfCharAttr; RtfKMinor: RtfGray; RtfKStr: '\gray' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfFormula; RtfKStr: '\|' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfNoBrkSpace; RtfKStr: '\~' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfNoReqHyphen; RtfKStr: '\-' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfNoBrkHyphen; RtfKStr: '\_' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfOptDest; RtfKStr: '\*' ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfPar; RtfKstr: #10 ), - (RtfKMajor: RtfSpecialChar; RtfKMinor: RtfPar; RtfKstr: #13 ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosX; RtfKStr: '\posx' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosXCenter; RtfKStr: '\posxc' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosXInside; RtfKStr: '\posxi' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosXLeft; RtfKStr: '\posxl' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosXOutSide; RtfKStr: '\posxo' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosXRight; RtfKStr: '\posxr' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosY; RtfKStr: '\posy' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosYInline; RtfKStr: '\posyil' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosYTop; RtfKStr: '\posyt' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosYCenter; RtfKStr: '\posyc' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfPosYBottom; RtfKStr: '\posyb' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfAbsWid; RtfKStr: '\absw' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfTextDist; RtfKStr: '\dxfrtext' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfRPosMargV; RtfKStr: '\pvmrg' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfRPosPageV; RtfKStr: '\pvpg' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfRPosMargH; RtfKStr: '\phmrg' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfRPosPageH; RtfKStr: '\phpg' ), - (RtfKMajor: RtfPosAttr; RtfKMinor: RtfRPosColH; RtfKStr: '\phcol' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfSectDef; RtfKStr: '\sectd' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfNoBreak; RtfKStr: '\sbknone' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfColBreak; RtfKStr: '\sbkcol' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageBreak; RtfKStr: '\sbkpage' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfEvenBreak; RtfKStr: '\sbkeven' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfOddBreak; RtfKStr: '\sbkodd' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageCont; RtfKStr: '\pgncont' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageStarts; RtfKStr: '\pgnstarts' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageRestart; RtfKStr: '\pgnrestart' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageDecimal; RtfKStr: '\pgndec' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageURoman; RtfKStr: '\pgnucrm' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageLRoman; RtfKStr: '\pgnlcrm' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageULetter; RtfKStr: '\pgnucltr' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageLLetter; RtfKStr: '\pgnlcltr' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageNumLeft; RtfKStr: '\pgnx' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfPageNumTop; RtfKStr: '\pgny' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfHeaderY; RtfKStr: '\headery' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfFooterY; RtfKStr: '\footery' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineModulus; RtfKStr: '\linemod' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineDist; RtfKStr: '\linex' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineStarts; RtfKStr: '\linestarts' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineRestart; RtfKStr: '\linerestart' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineRestartPg; RtfKStr: '\lineppage' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfLineCont; RtfKStr: '\linecont' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfTopVAlign; RtfKStr: '\vertalt' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfBottomVAlign; RtfKStr: '\vertal' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfCenterVAlign; RtfKStr: '\vertalc' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfJustVAlign; RtfKStr: '\vertalj' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfColumns; RtfKStr: '\cols' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfColumnSpace; RtfKStr: '\colsx' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfColumnLine; RtfKStr: '\linebetcol' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfENoteHere; RtfKStr: '\endnhere' ), - (RtfKMajor: RtfSectAttr; RtfKMinor: RtfTitleSpecial; RtfKStr: '\titlepg' ) - (RtfKMajor: RtfFieldAttr; RtfKMinor: RtfFieldDirty; RtfKStr: '\flddirty' ), - (RtfKMajor: RtfFieldAttr; RtfKMinor: RtfFieldEdited; RtfKStr: '\fldedit' ), - (RtfKMajor: RtfFieldAttr; RtfKMinor: RtfFieldLocked; RtfKStr: '\fldlock' ), - (RtfKMajor: RtfFieldAttr; RtfKMinor: RtfFieldPrivate; RtfKStr: '\fldpriv' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfPaperWidth; RtfKStr: '\paperw' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfPaperHeight; RtfKStr: '\paperh' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfLeftMargin; RtfKStr: '\margl' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfRightMargin; RtfKStr: '\margr' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfTopMargin; RtfKStr: '\margt' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfBottomMargin; RtfKStr: '\margb' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFacingPage; RtfKStr: '\facingp' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfGutterWid; RtfKStr: '\gutter' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfDefTab; RtfKStr: '\deftab' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfWidowCtrl; RtfKStr: '\widowctrl' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfHyphHotZone; RtfKStr: '\hyphhotz' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteEndSect; RtfKStr: '\endnotes' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteEndDoc; RtfKStr: '\enddoc' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteBottom; RtfKStr: '\ftnbj' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteText; RtfKStr: '\ftntj' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteStart; RtfKStr: '\ftnstart' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFNoteRestart; RtfKStr: '\ftnrestart' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfPageStart; RtfKStr: '\pgnstart' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfLineStart; RtfKStr: '\linestart' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfLandscape; RtfKStr: '\landscape' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfFracWidth; RtfKStr: '\fracwidth' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfNextFile; RtfKStr: '\nextfile' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfTemplate; RtfKStr: '\template' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfMakeBackup; RtfKStr: '\makeback' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfRtfDefault; RtfKStr: '\defformat' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfRevisions; RtfKStr: '\revisions' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfMirrorMargin; RtfKStr: '\margmirror' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfRevDisplay; RtfKStr: '\revprop' ), - (RtfKMajor: RtfDocAttr; RtfKMinor: RtfRevBar; RtfKStr: '\revbar' ), - (RtfKMajor: RtfStyleAttr; RtfKMinor: RtfBasedOn; RtfKStr: '\sbasedon' ), - (RtfKMajor: RtfStyleAttr; RtfKMinor: RtfNext; RtfKStr: '\snext' ), - (RtfKMajor: RtfColorName; RtfKMinor: RtfRed; RtfKStr: '\red' ), - (RtfKMajor: RtfColorName; RtfKMinor: RtfGreen; RtfKStr: '\green' ), - (RtfKMajor: RtfColorName; RtfKMinor: RtfBlue; RtfKStr: '\blue' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfMacQD; RtfKStr: '\macpict' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfWinMetafile; RtfKStr: '\wmetafile' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfWinBitmap; RtfKStr: '\wbitmap' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicWid; RtfKStr: '\picw' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicHt; RtfKStr: '\pich' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicGoalWid; RtfKStr: '\picwgoal' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicGoalWid; RtfKStr: '\picwGoal' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicGoalHt; RtfKStr: '\pichgoal' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicGoalHt; RtfKStr: '\pichGoal' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicScaleX; RtfKStr: '\picscalex' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicScaleY; RtfKStr: '\picscaley' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicScaled; RtfKStr: '\picscaled' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicCropTop; RtfKStr: '\piccropt' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicCropBottom; RtfKStr: '\piccropb' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicCropLeft; RtfKStr: '\piccropl' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicCropRight; RtfKStr: '\piccropr' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPixelBits; RtfKStr: '\wbmbitspixel' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfBitmapPlanes; RtfKStr: '\wbmplanes' ), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfBitmapWid; RtfKStr: '\wbmwidthbytes'), - (RtfKMajor: RtfPictAttr; RtfKMinor: RtfPicBinary; RtfKStr: '\bin' ), - (RtfKMajor: RtfNeXTGrAttr; RtfKMinor: RtfNeXTGWidth; RtfKStr: '\width' ), - (RtfKMajor: RtfNeXTGrAttr; RtfKMinor: RtfNeXTGHeight; RtfKStr: '\height' ), - } - {@indent on} - -const - TRtfAnyType: TRtfTokenSet =[etDataset..etLitTrue]; - -function ExtractFieldName(const Fields: string; var Pos: integer): string; -var i: integer; -begin - i := Pos; - while(i <= Length(Fields))and(Fields[i] <> '.')do Inc(i); - Result := Trim(Copy(Fields, Pos, i - Pos)); - if(i <= Length(Fields))and(Fields[i] = '.') - then Inc(i); - Pos := i; -end; - -function Pwr(const Base, Exponent: Double): Double; -begin - if Exponent = 0.0 then - Result := 1.0 { n**0 = 1 } - else if(Base = 0.0)and(Exponent > 0.0) then - Result := 0.0 { 0**n = 0, n > 0 } - else if (Frac(Exponent) = 0.0) and (Abs(Exponent) <= MaxInt) then - Result := IntPower(Base, integer(Trunc(Exponent))) - else - Result := Exp(Exponent * Ln(Base)) -end; - -{ TRtfPictureAttr } - -constructor TRtfPictureAttr.Create(AWidth, AHeigth: word); -begin - inherited Create; - FScaleX := 100; - FScaleY := 100; - FWidth := AWidth; - FHeigth := AHeigth; - FWidthmm := AWidth * 0.264596930676; - FHeigthmm := AHeigth * 0.264596930676; - - FBorderWidth := 0; - FBorderType := brNone; - FBorderColor := clBlack; - FProportional := true; -end; - -procedure TRtfPictureAttr.SetScaleX(Value: integer); -var - AScale: Double; -begin - if Value < 1 then - Value := 1 - else if Value > 100 then - Value := 100; - AScale := Double(Value) / FScaleX; - FScaleX := Value; - FWidth := Round(FWidth * AScale); - FWidthmm := FWidthmm * AScale; - if FProportional then - begin - FScaleY := Round(FScaleY * AScale); - FHeigth := Round(FHeigth * AScale); - FHeigthmm := FHeigthmm * AScale; - end; -end; - -procedure TRtfPictureAttr.SetScaleY(Value: integer); -var - AScale: Double; -begin - if Value < 1 then - Value := 1 - else if Value > 100 then - Value := 100; - AScale := Double(Value) / FScaleY; - FScaleY := Value; - FHeigth := Round(FHeigth * AScale); - FHeigthmm := FHeigthmm * AScale; - if FProportional then - begin - FScaleX := Round(FScaleX * AScale); - FWidth := Round(FWidth * AScale); - FWidthmm := FWidthmm * AScale; - end; -end; - - -{ TRtfItem } - -procedure TRtfItem.Assign(ASource: TRtfItem); -begin - RtfClass := ASource.RtfClass; - RtfMajor := ASource.RtfMajor; - RtfMinor := ASource.RtfMinor; - RtfTextBuf := ASource.RtfTextBuf; -end; - -function TRtfItem.CheckItem(AClass: TRtfClass; Major: integer): boolean; -begin - Result :=(RtfClass = AClass)and(RtfMajor = Major); -end; - -function TRtfItem.GetItem(Index: integer): TRtfItem; -begin - Result := TRtfItem(inherited Items[Index]); -end; - -procedure TRtfItem.Notify(Ptr: pointer; Action: TListNotification); -begin - inherited; - case Action of - lnAdded: TRtfItem(Ptr).FParent := Self; - lnExtracted: TRtfItem(Ptr).FParent := nil; - end; -end; - -{ TRtfItemList } - -constructor TRtfItemList.Create; -//Initialize an empty list -begin - inherited Create; -end; - -destructor TRtfItemList.Destroy; -{-Destroy a list} -var n: TRtfItem; - p: TRtfItem; -begin - n := FTail; - while n <> nil do begin - {Get TRtfItem to previous node} - p := n.FPrev; - {Deallocate and destroy this node} - n.Free; - {Do the previous node} - n := p; - end; - FTail := nil; - FHead := nil; - FCount := 0; - inherited Destroy; -end; - -function TRtfItemList.Add(AItem: TRtfItem): TRtfItem; -{-Add element to end of list} -begin - Result := AItem; - {Exit for bad input} - if AItem = nil - then Exit; - AItem.FPrev := FTail; - AItem.FNext := nil; - if FHead = nil then begin - {Special case for first node} - FHead := AItem; - FTail := AItem; - end else begin - {Add at end of existing list} - FTail.FNext := AItem; - FTail := AItem; - end; - Inc(FCount); -end; - -procedure TRtfItemList.Insert(AItem: TRtfItem); -{-Insert element at start of list} -begin - {Exit for bad input} - if AItem = nil - then Exit; - AItem.FPrev := nil; - AItem.FNext := FHead; - if FHead = nil - then FTail := AItem {Special case for first node} - else FHead.FPrev := AItem; {Add at start of existing list} - FHead := AItem; - Inc(FCount); -end; - -procedure TRtfItemList.PlaceAfter(AItem: TRtfItem; AAfter: TRtfItem); -{-Place element P into list _after_ existing element L} -begin - {Exit for bad input} - if(AItem = nil)or(AItem = AAfter) - then Exit; - if AAfter = nil - then Insert(AItem) - else if AAfter = FTail - then Add(AItem) - else begin - AItem.FPrev := AAfter; - AItem.FNext := AAfter.FNext; - AAfter.FNext.FPrev := AItem; - AAfter.FNext := AItem; - Inc(FCount); - end; -end; - -procedure TRtfItemList.PlaceBefore(AItem, ABefore: TRtfItem); -{-Place element P into list _before_ existing element L} -begin - {Exit for bad input} - if(AItem = nil)or(AItem = ABefore) - then Exit; - if(ABefore = nil)or(ABefore = Head) - then Insert(AItem) {Place the new element at the start of the list} - else begin - {Patch in the new element} - AItem.FNext := ABefore; - AItem.FPrev := ABefore.FPrev; - ABefore.FPrev.FNext := AItem; - ABefore.FPrev := AItem; - Inc(FCount); - end; -end; - -procedure TRtfItemList.dlRemove(AItem: TRtfItem; DisposeIt: boolean); -{-Delete existing node from list, optionally disposing of it} -var This: TRtfItem; -begin - {Exit for bad input} - if(AItem = nil)or(FCount = 0) - then Exit; - - This := AItem; - with This do begin - {Fix pointers of surrounding nodes} - if FNext <> nil - then FNext.FPrev := FPrev; - if FPrev <> nil - then FPrev.FNext := FNext; - end; - - {Fix head and tail of list} - if FTail = This - then FTail := FTail.FPrev; - if FHead = This - then FHead := FHead.FNext; - - Dec(FCount); - if DisposeIt - then This.Free; -end; - -procedure TRtfItemList.Extract(AItem: TRtfItem); -{-Extract existing element from list without disposing of it} -begin - dlRemove(AItem, false); -end; - -procedure TRtfItemList.Delete(AItem: TRtfItem); -{-Delete an existing node, disposing of its contents} -begin - dlRemove(AItem, true); -end; - -procedure TRtfItemList.Clear; -begin - while Assigned(FHead)do begin - dlRemove(FHead, true); - end; -end; - -procedure TRtfItemList.SaveToStream(AStream: TStream; AColors: string); -var AItem: TRtfItem; - ALine: string; -begin - AItem := Head; - while Assigned(AItem)do begin - if AItem.CheckItem(RtfControl, RtfDestination)and(AItem.RtfMinor = RtfColorTbl) - then ALine := Format('\colortbl;%s}',[AColors]) - else ALine := AItem.RtfTextBuf; - if ALine <> '' - then AStream.Write(ALine[1], Length(ALine)); - AItem := AItem.Next; - end; -end; - -{ TRawRtfParser } - -procedure TRawRtfParser.RtfHook; -//Build a tree from the rtf-code tokens -var AItem: TRtfItem; - - - function NewItem(AText: string): TRtfItem; - begin - Result := TRtfItem.Create; - Result.RtfClass := RtfClass; - Result.RtfMajor := RtfMajor; - Result.RtfMinor := RtfMinor; - Result.RtfTextBuf := AText; - end; -begin - case RtfClass of - RtfParseBegin: begin - if Assigned(AParseItem) then begin - //Then close it - AParseItem := nil; - AItem := RawItems.Add(NewItem('')); - AItem.RtfClass := RtfParseEnd; - end else begin - //Otherwise open an item - AParseItem := RawItems.Add(NewItem('')); - AParseItem.RtfClass := RtfParseBegin; - end; - end; - RtfControl: begin - if(RtfMajor = RtfDestination)and(RtfMinor = RtfColorTbl) - then FColorTable := RawItems.Add(NewItem(RtfTextBuf)) - else RawItems.Add(NewItem(RtfTextBuf)); - end; - RtfText: begin - if RawItems.Tail.RtfClass = RtfClass - then RawItems.Tail.RtfTextBuf := RawItems.Tail.RtfTextBuf + RtfTextBuf - else RawItems.Add(NewItem(RtfTextBuf)); - end; - RtfGroup, RtfUnknown: begin - if RawItems.Tail.RtfClass in[RtfGroup, RtfUnknown] - then RawItems.Tail.RtfTextBuf := RawItems.Tail.RtfTextBuf + RtfTextBuf - else RawItems.Add(NewItem(RtfTextBuf)); - RawItems.Tail.RtfClass := RtfUnknown; //Dont use these for compares - end; - end; -end; - -function TRawRtfParser.GetRtfChar: char; -begin - if APtr >= AEnd - then Result := #0 - else begin - Result := APtr^; - Inc(APtr); - end; -end; - -procedure TRawRtfParser.GetRtfToken; -var c: char; - i, ALevel: integer; -begin - FRtfTextBuf := ''; //not really needed - - //Get first character, which may be a pushback from previous token - if APushedChar <> #0 then begin - c := APushedChar; - APushedChar := #0; - end - else c := GetRtfChar; - - - case c of - #0: begin - FRtfClass := RtfEof; - FRtfTextBuf := ''; - end; - #8: begin //effectively a \tab control symbol - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfTab; - FRtfTextBuf := c; - c := #0; - end; - '{': begin - FRtfClass := RtfGroup; - FRtfMajor := RtfBeginGroup; - FRtfTextBuf := c; - c := #0; - end; - '}': begin - FRtfClass := RtfGroup; - FRtfMajor := RtfEndGroup; - FRtfTextBuf := c; - c := #0; - end; - '\': begin //We have the backslash, advance to next character - FRtfTextBuf := c; - c := GetRtfChar; - case c of - chr(39): begin //Hex encoded text char, e.g., \'d5, \'d3 - FRtfClass := RtfUnknown; - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - if c <> #0 then begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - if c <> #0 then begin - FRtfClass := RtfText; - FRtfTextBuf := FRtfTextBuf + c; - //It can still be a special character.. - for i := Low(Rtfkey)to High(Rtfkey)do begin - if FRtfTextBuf = Rtfkey[i].RtfKStr then begin - FRtfClass := RtfControl; - FRtfMajor := Rtfkey[i].RtfKMajor; - FRtfMinor := Rtfkey[i].RtfKMinor; - break; - end; - end; - c := #0; - end; - end; - end; - ':', '{', '}', ';', '\': begin //special escaped text char, e.g., \, \; - FRtfTextBuf := FRtfTextBuf + c; - //"\" Marks the start and end of an expression with the RtfParseBegin - //RtfClass. They will later be removed and replaced by RtfExpression - //Items between the opening and closing \ will be the expression text - if c = '\' - then FRtfClass := RtfParseBegin - else FRtfClass := RtfText; - c := #0; - end; - '|': begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfFormula; - c := #0; - end; - '~': begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfNoBrkSpace; - c := #0; - end; - '-': begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfNoReqHyphen; - c := #0; - end; - '_': begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfNoBrkHyphen; - c := #0; - end; - '*': begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfOptDest; - c := #0; - end; - #13, #10: begin - FRtfTextBuf := FRtfTextBuf + c; - FRtfClass := RtfControl; - FRtfMajor := RtfSpecialChar; - FRtfMinor := RtfPar; - c := #0; - end; - else begin //Wasn't anything special, continue with control word - - while(c in['A'..'Z', 'a'..'z'])do begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - end; - - //Find the control word in the key array - FRtfClass := RtfUnknown; - for i := Low(Rtfkey)to High(Rtfkey)do begin - if FRtfTextBuf = Rtfkey[i].RtfKStr then begin - FRtfClass := RtfControl; - FRtfMajor := Rtfkey[i].RtfKMajor; - FRtfMinor := Rtfkey[i].RtfKMinor; - break; - end; - end; - - //Parse the word parameter negative sign - if c = '-' then begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - end; - //Parse the word parameter number - while(c in['0'..'9'])do begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - end; - - //Append control symbol delimiter (i need it for writing) - if c = ' ' then begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - end; - - //Crap1: Fix for {\field{\*\fldinst SYMBOL 32 \\f "Symbol" \\s 12}{\fldrslt\... - //RTF text gets corrupted by this parser (notice the Double backslash!) - //Crap2:Also INFO since it can contain the first line from rtf as docinfo. - if(FRtfClass = RtfControl)and(FRtfMajor = RtfDestination) then begin - if FRtfMinor in[RtfField, RtfInfo, RtfStyleSheet, RtfFontTbl, RtfColorTbl] then begin - //Just include the whole field Group to the TextBuf (who cares..?) - ALevel := 1; //All these items have a "group open" before them - while c <> #0 do begin - FRtfTextBuf := FRtfTextBuf + c; - case c of - '{': Inc(ALevel); - '}': Dec(ALevel); - end; - c := GetRtfChar; - if ALevel = 0 - then break; - end; - FRtfClass := RtfControl; - end; - end; - end; - end; - end; - else - begin - //literal text char. This will give one character per call (which is slow) - FRtfTextBuf := c; - FRtfClass := RtfText; - - c := GetRtfChar; - while not(c in[#0, #8, '\', '{', '}']) do - begin - FRtfTextBuf := FRtfTextBuf + c; - c := GetRtfChar; - end; - end; - end; - - //Push character back if we read one to much - if c <> #0 then - APushedChar := c; -end; - -procedure TRawRtfParser.Execute(ARawItems: TRtfItemList; ARtfPtr: pchar; ARtfSize: integer); -var AItem: TRtfItem; -begin - APtr := ARtfPtr; - APushedChar := #0; - RawItems := ARawItems; - FRtfClass := RtfNothing; - AEnd := APtr + ARtfSize; - - //Dummy item so tail of list is always assigned - AItem := TRtfItem.Create; - AItem.RtfClass := RtfText; - ARawItems.Add(AItem); - - while true do - begin - GetRtfToken; - if RtfClass = RtfEOF then - break; - RtfHook; - end; -end; - -{ TRtfVariableList } - -function TRtfVariableList.Add(AName: string; AValue: variant; AToken: TRtfToken): TRtfVariable; -begin - Result := Find(AName); - if Assigned(Result) then - raise TRtfException.CreateFmt('Variable %s already exists',[AName]); - Result := TRtfVariable.Create; - inherited Add(Result); - Result.Name := AName; - Result.Value := AValue; - Result.Token := AToken; -end; - -destructor TRtfVariableList.Destroy; -begin - inherited; -end; - -function TRtfVariableList.Find(AName: string): TRtfVariable; -var i: integer; -begin - for i := 0 to Count - 1 do begin - Result := Items[i]; - if SameText(Result.Name, AName) - then exit; - end; - Result := nil; -end; - -function TRtfVariableList.GetItem(Index: integer): TRtfVariable; -begin - Result := TRtfVariable(inherited Items[Index]); -end; - -{ TRtfFunctionList } - -function TRtfFunctionList.GetItem(Index: integer): TRtfFunction; -begin - Result := TRtfFunction(inherited Items[Index]); -end; - -function TRtfFunctionList.Add(ATokenType: TRtfToken; AName: string; AMin, AMax: smallint; AOnexecute: TRtfFunctionExecute): TRtfFunction; -//Add a new function or even an additional token to the function list -begin - Result := Find(AName); - if Assigned(Result) - then raise TRtfException.CreateFmt('Function already exists',[AName]); - - Result := TRtfFunction.Create; - Result.Name := AName; - Result.Min := AMin; - Result.Max := AMax; - Result.Token := ATokenType; - Result.Onexecute := AOnexecute; - inherited Add(Result); -end; - -function TRtfFunctionList.Find(AName: string): TRtfFunction; -var i: integer; -begin - for i := 0 to Count - 1 do begin - Result := Items[i]; - if SameText(Result.Name, AName) - then exit; - end; - Result := nil; -end; - -{ TRtfDataset } - -procedure TRtfDataset.Notify(Ptr: pointer; Action: TListNotification); -begin - inherited; - case Action of - lnAdded: TRtfDataset(Ptr).FParent := Self; - lnExtracted: TRtfDataset(Ptr).FParent := nil; - end; -end; - -function TRtfDataset.Bof: boolean; -begin - if Dataset is TDataset then begin - with Dataset as TDataset do begin - Result := Bof; - end - end - else if Dataset is TtiObjectList then - Result := TableIndex = 0 - else if Dataset is TtiObject then - Result := false - else - raise TRtfException.Create(rsNotImplemented); -end; - -function TRtfDataset.Eof: boolean; -begin - if Dataset is TDataset then begin - with Dataset as TDataset do begin - Result := Eof; - end - end - else if Dataset is TtiObjectList then - Result :=(TableIndex >= RecordCount)or(TableIndex < 0) - else if Dataset is TtiObject then - Result := false - else - Result := false; -end; - -function TRtfDataset.Find(AName: string): TRtfDataset; -var i: integer; -begin - for i := 0 to Count - 1 do begin - Result := Items[i]; - if SameText(Result.Name, AName) - then exit; - end; - Result := nil; -end; - -function TRtfDataset.Add(ADataset: TObject; AName: string; AFreeDataset: boolean = false): TRtfDataset; -begin - Result := Find(AName); - if Assigned(Result) then - raise TRtfException.CreateFmt('Dataset already exists',[AName]); - - Result := TRtfDataset.Create; - Result.Dataset := ADataset; - Result.Name := AName; - Result.FFreeDataset := AFreeDataset; - inherited Add(Result); -end; - -function TRtfDataset.ResolveNestedFields(ATable: TRtfDataset; AName: string; var AFieldName: string): TRtfDataset; -//Advance to field level (skipping nested dataset objects) -var ATableName: string; - APropInfo: PPropInfo; - ASubTable: TRtfDataset; - AIndex, i: integer; - AObject: TObject; -begin - AIndex := 1; - Result := ATable; - AFieldName := AName; - while AIndex < Length(AName)do begin - - //Check object dataset and eof state - AObject := nil; - if Result.Dataset is TDataset - then exit; //A TDataset is never nested - if Result.Dataset is TtiObjectList then begin - //Get the right record from the array - if Result.TableIndex <(Result.Dataset as TtiObjectList).Count - then AObject :=(Result.Dataset as TtiObjectList)[Result.TableIndex] - else exit; //Trying beyond eof (or empty table) big problem; nah? - end else if Result.Dataset is TtiObject - then AObject := Result.Dataset - else raise TRtfException.Create('Unknown object'); - - //If the next field is a class then advance - ASubTable := nil; - ATableName := ExtractFieldName(AName, AIndex); - APropInfo := GetPropInfo(AObject, ATableName); - if not Assigned(APropInfo)or(APropInfo^.PropType^.Kind <> tkClass) - then exit; //As long as it's an object continue parsing.. - - //Advance fieldname and find nested table - AFieldName := Copy(AName, AIndex, Maxint); - for i := 0 to Result.Count - 1 do begin - if SameText(Result[i].Name, ATableName) then begin - ASubTable := Result[i]; - break; - end; - end; - - //Add the nested table (for administration of the TableIndex) - if not Assigned(ASubTable) then begin - APropInfo := GetPropInfo(AObject, ATableName); - if not Assigned(APropInfo) - then raise TRtfException.CreateFmt('property %s not found',[ATableName]); - if APropInfo^.PropType^.Kind = tkClass - then AObject := GetObjectProp(AObject, APropInfo) - else exit; //Just a plain property field (returned via AFieldName) - ASubTable := Result.Add(AObject, ATableName); - end; - - //Advance to a deeper table level - Result := ASubTable; - end; -end; - -function TRtfDataset.Find(AName: string; out AFieldName: string): TRtfDataset; -//Find the requested dataset -var - ATableName: string; - AIndex, i: integer; -begin - //MainTable must be in the list of tables - //Otherwise no point of reference. - AIndex := 1; - Result := nil; - ATableName := ExtractFieldName(AName, AIndex); - AFieldName := Copy(AName, AIndex, Maxint); - for i := 0 to Count - 1 do begin - if SameText(Items[i].Name, ATableName) then begin - Result := Items[i]; - break; - end; - end; - if not Assigned(Result)or not Assigned(Result.Dataset) - then raise TRtfException.CreateFmt('Unable to resolve %s',[ATableName]); - Result := ResolveNestedFields(Result, AFieldName, AFieldName); -end; - -procedure TRtfDataset.Open; -begin - Clear; //Clear nested tables - if Dataset is TDataset then begin - with Dataset as TDataset do begin - if not Active - then Open; - end - end; - First; -end; - -procedure TRtfDataset.First; -begin - Clear; //Clear nested tables - if Dataset is TDataset then - begin - with Dataset as TDataset do - begin - First; - end - end - else if Dataset is TtiObjectList then - begin - TableIndex := 0; - end; -end; - -function TRtfDataset.GetItem(Index: integer): TRtfDataset; -begin - Result := TRtfDataset(inherited Items[Index]); -end; - -function TRtfDataset.IsEmpty: boolean; -begin - if Dataset is TDataset then - begin - with Dataset as TDataset do - begin - Result := IsEmpty; - end - end - else if Dataset is TtiObjectList then - Result := RecordCount = 0 - else if Dataset is TtiObject then - Result := false - else - raise TRtfException.Create(rsNotImplemented); -end; - -procedure TRtfDataset.Last; -begin - Clear; //Clear nested tables - if Dataset is TDataset then begin - with Dataset as TDataset do begin - Last; - end - end else if Dataset is TtiObjectList then begin - TableIndex := RecordCount - 1; - end; -end; - -procedure TRtfDataset.Next; -begin - Clear; //Clear nested tables - if Dataset is TDataset then begin - with Dataset as TDataset do begin - Next; - end - end else if Dataset is TtiObjectList then begin - if not Eof then begin - TableIndex := TableIndex + 1; - end; - end; -end; - -procedure TRtfDataset.Prior; -begin - Clear; //Clear nested tables - if Dataset is TDataset then begin - with Dataset as TDataset do begin - Prior; - end - end else if Dataset is TtiObjectList then begin - if not Bof then begin - TableIndex := TableIndex - 1; - end; - end; -end; - -function TRtfDataset.RecordCount: integer; -//This can give problems with Sql.. -begin - if Dataset is TDataset - then Result :=(Dataset as TDataset).RecordCount - else if Dataset is TtiObjectList - then Result :=(Dataset as TtiObjectList).Count - else Result := 1; //Single OpfRecord -end; - -destructor TRtfDataset.Destroy; -begin - if FreeDataset - then FreeAndNil(FDataset); - inherited; -end; - - -{ TRtfArgument } - -constructor TRtfArgument.Create(AParser: TtiRtfParser); -begin - inherited Create(true); - FParser := AParser; -end; - -function TRtfArgument.Add(AValue: variant; ATokenType: TRtfToken): TRtfArgument; -begin - Result := TRtfArgument.Create(Parser); - inherited Add(Result); - Result.Value := AValue; - Result.Token := ATokenType; -end; - -function TRtfArgument.Add(AArgument: TRtfArgument): TRtfArgument; -begin - inherited Add(AArgument); - Result := AArgument; -end; - -function TRtfArgument.GetItem(Index: integer): TRtfArgument; -begin - Result := TRtfArgument(inherited Items[Index]); -end; - -procedure TRtfArgument.Notify(Ptr: pointer; Action: TListNotification); -//Nice way of setting the parent reference -begin - inherited; - case Action of - lnAdded: TRtfArgument(Ptr).FParent := Self; - lnExtracted: TRtfArgument(Ptr).FParent := nil; - end; -end; - -function TRtfArgument.Check(AParam: integer; ATokens: TRtfTokenSet): boolean; -begin - if AParam >= Count then begin - Result := false; - exit; - end; - if not(Items[AParam].Token in ATokens) then begin - Result := false; - exit; - end; - Result := true; -end; - -function TRtfArgument.Check(ATokens: array of TRtfTokenSet): boolean; -var i: integer; -begin - for i := Low(ATokens)to High(ATokens)do begin - Result := Check(i, ATokens[i]); - if not Result - then exit; - end; - Result := true; -end; - -procedure TRtfArgument.ParseExpression(AExpression: string); -//Add token to the argument list. Parameters surrounded by parentheses will -//be added to the nested arguments. This will make a nice argument tree. -//Constant .9 wont be parse, but that's ok -var - FSourcePtr, p, TokenStart: PChar; - ALastArgument, ALast: TRtfArgument; - AInts: array[0..6]of integer; - ASeps: array[0..6]of char; - AFunction: TRtfFunction; - AFloatResult: boolean; - AIntIndex: integer; - AValue: variant; - AToken: string; -begin - ALast := nil; - Value := varEmpty; - Token := etNothing; - ALastArgument := Self; - FSourcePtr := PChar(AExpression); - while FSourcePtr^ <> #0 do begin - - p := FSourcePtr; - while(P^ <> #0)and(P^ <= ' ')do begin - ALast := nil; - Inc(p); - end; - - TokenStart := p; - case P^ of - 'A'..'Z', 'a'..'z', '_', '@': begin // The '@' infront of a reference variable - Inc(p); - ALast := nil; - while P^ in['A'..'Z', 'a'..'z', '0'..'9', '_', '.', '@']do Inc(p); - if TokenStart^ = '@' then begin - Inc(TokenStart); //Remove the '@' prefix - SetString(AToken, TokenStart, p - TokenStart); - ALast := ALastArgument.Add(AToken, etVariable) - end else begin - SetString(AToken, TokenStart, p - TokenStart); - AFunction := Parser.Functions.Find(AToken); - if Assigned(AFunction) - then ALastArgument.Add(AFunction.Name, AFunction.Token) - else ALast := ALastArgument.Add(AToken, etFieldName); //Field or tablename, what else can it be? - end; - end; - Chr(39): begin - Inc(p); - TokenStart := p; - while true do begin - if P^ = Chr(39) then begin - SetString(AToken, TokenStart, p - TokenStart); - //Concatenate etFieldName."Field with spaces" - if Assigned(ALast)and(ALast.Token in[etVariable, etFieldName]) - then ALast.Value := ALast.Value + AToken - else ALastArgument.Add(AToken, etLitString); - Inc(p); - Break; - end; - if P^ = #0 - then raise TRtfException.Create(rsUnterminatedStringConstant); - Inc(p); - end; - end; - '"': begin - Inc(p); - TokenStart := p; - while true do begin - if P^ = '"' then begin - SetString(AToken, TokenStart, p - TokenStart); - //Concatenate etFieldName."Field with spaces" - if Assigned(ALast)and(ALast.Token in[etVariable, etFieldName]) - then ALast.Value := ALast.Value + AToken - else ALastArgument.Add(AToken, etLitString); - Inc(p); - Break; - end; - if P^ = #0 - then raise TRtfException.Create(rsUnterminatedStringConstant); - Inc(p); - end; - end; - '-': begin - Inc(p); - ALast := nil; - ALastArgument.Add(AToken, etSUB); - end; - '0'..'9': begin //Ik ga ervan uit dat alles in het amerikaans genoteerd word - Inc(p); - ALast := nil; - AFloatResult := false; - while P^ in['0'..'9']do Inc(p); - if P^ = '.' then begin //Floating point - Inc(p); - AFloatResult := true; - while P^ in['0'..'9']do Inc(p); - end; - if P^ in['e', 'E'] then begin //1.700000E+308 - AFloatResult := true; - Inc(p); - if P^ in['+', '-'] - then Inc(p); - while P^ in['0'..'9']do Inc(p); - end; - SetString(AToken, TokenStart, p - TokenStart); - if AFloatResult - then AValue := StrToFloat(AToken) - else AValue := StrToInt(AToken); - if AFloatResult - then ALastArgument.Add(AValue, etLitFloat) - else ALastArgument.Add(AValue, etLitInt); - end; - '(': begin - Inc(p); - ALast := nil; - //Add them to the last function if possible.. - if(ALastArgument.Count > 0)and(ALastArgument[ALastArgument.Count - 1].Token in[etFunction, etProcedure]) - then ALastArgument := ALastArgument[ALastArgument.Count - 1] - else ALastArgument := ALastArgument.Add('()', etParenthesis); - end; - ')': begin - Inc(p); - ALast := nil; - ALastArgument := ALastArgument.Parent; - if not Assigned(ALastArgument) - then raise TRtfException.Create(rsToManyClosingParenthesis); - end; - '<': begin - Inc(p); - ALast := nil; - case P^ of - '=': begin - Inc(p); - ALastArgument.Add('<=', etLE); - end; - '>': begin - Inc(p); - ALastArgument.Add('<>', etNE); - end; - else ALastArgument.Add('<', etLT); - end; - end; - '=': begin - Inc(p); - ALast := nil; - ALastArgument.Add('=', etEq); - end; - ':': begin - Inc(p); - ALast := nil; - if P^ = '=' then begin - Inc(p); - ALastArgument.Add(':=', etAssign); - end - else raise TRtfException.CreateFmt(rsInvalidExpressionCharacter,[P^]); - end; - '&': begin - Inc(p); - ALast := nil; - if P^ = '&' then begin - Inc(p); - ALastArgument.Add('and', etAnd); - end - else raise TRtfException.CreateFmt(rsInvalidExpressionCharacter,[P^]); - end; - '|': begin - Inc(p); - ALast := nil; - if P^ = '|' then begin - Inc(p); - ALastArgument.Add('or', etOr); - end - else raise TRtfException.CreateFmt(rsInvalidExpressionCharacter,[P^]); - end; - '!': begin - Inc(p); - ALast := nil; - if P^ = '=' then begin - Inc(p); - ALastArgument.Add('!=', etNe); - end - else ALastArgument.Add(AToken, etNot); - end; - '>': begin - Inc(p); - ALast := nil; - if P^ = '=' then begin - Inc(p); - ALastArgument.Add('>=', etGE); - end - else ALastArgument.Add('>', etGT); - end; - '+': begin - Inc(p); - ALast := nil; - ALastArgument.Add('+', etADD); - end; - '*': begin - Inc(p); - ALast := nil; - ALastArgument.Add('*', etMUL); - end; - '/': begin - Inc(p); - ALast := nil; - ALastArgument.Add('/', etDIV); - end; - ',': begin - Inc(p); - ALast := nil; - ALastArgument.Add(',', etComma); - end; - '\': begin //a date/time constant. Since these are - //in a fixed format we need to parse them ourselves. - Inc(p); - ALast := nil; - if P^ = '{' then begin - Inc(p); - FillChar(AInts[0], SizeOf(AInts), 0); - FillChar(ASeps[0], SizeOf(ASeps), 0); - - AIntIndex := 0; - while(p^ <> #0)and(p^ in['0'..'9', ' ', ':', '-'])do begin - //read integer parts - TokenStart := p; - while P^ in['0'..'9']do Inc(p); - SetString(AToken, TokenStart, p - TokenStart); - if AToken = '' - then raise TRtfException.Create(rsInvalidDateConstant); - ASeps[AIntIndex] := p^; - AInts[AIntIndex] := StrToInt(AToken); - Inc(AIntIndex); - if AIntIndex > 6 - then raise TRtfException.Create(rsInvalidDateConstant); - if(p^ in[' ', '-', ':']) - then Inc(p); - end; - - //There shoud be at least two values entered - if AIntIndex < 2 - then raise TRtfException.Create(rsInvalidDateConstant); - - if not(p^ in['\']) - then raise TRtfException.Create(rsInvalidDateConstant); - Inc(p); - if P^ <> '}' - then raise TRtfException.Create(rsInvalidDateConstant); - Inc(p); - - if ASeps[0] = '-' then begin - //Its a date/time constant.. There should be at least 3 ints - if AIntIndex < 3 - then raise TRtfException.Create(rsInvalidDateConstant); - if ASeps[1] <> '-' - then raise TRtfException.Create(rsInvalidDateSeparator); - if not(ASeps[2]in[' ', '\']) - then raise TRtfException.Create(rsInvalidDateSeparator); - AValue := EncodeDate(AInts[0], AInts[1], AInts[2]); - - //Followed by a optional time constant? There should be at least 2 ints in it - if AIntIndex > 3 then begin - if AIntIndex < 5 - then raise TRtfException.Create(rsInvalidTimeConstant); - if not(ASeps[2]in[' ']) - then raise TRtfException.Create(rsInvalidTimeSeparator); - if not(ASeps[3]in[':', ' ', '\']) - then raise TRtfException.Create(rsInvalidTimeSeparator); - AValue := AValue + EncodeTime(AInts[3], AInts[4], AInts[5], 0); - end; - end else if ASeps[0] = ':' then begin - //Its a time constant.. There should be at least 2 ints - if AIntIndex < 1 - then raise TRtfException.Create(rsInvalidTimeConstant); - if not(ASeps[1]in[':', ' ', '\']) - then raise TRtfException.Create(rsInvalidTimeSeparator); - AValue := EncodeTime(AInts[0], AInts[1], AInts[2], 0); - end; - ALastArgument.Add(AValue, etLitDate) - end - else raise TRtfException.CreateFmt(rsInvalidExpressionCharacter,[P^]); - end; - else begin - if p^ <> #0 - then raise TRtfException.CreateFmt(rsInvalidExpressionCharacter,[P^]); - end; - end; - FSourcePtr := p; - end; - if ALastArgument <> Self - then raise TRtfException.Create(rsExpectedClosingParenthesis); -end; - -procedure TRtfArgument.EvaluateUnaryBinary(APrevItem, AArgument, ANextItem: TRtfArgument); -begin - case APrevItem.Token of - etLitString: begin - case ANextItem.Token of - etLitString: begin - if AArgument.Token <> etAdd - then raise TRtfException.Create('Unable to combine strings with other types'); - APrevItem.Value := APrevItem.Value + ANextItem.Value; - Remove(AArgument); - Remove(ANextItem); - end; - else raise TRtfException.Create('Unable to combine strings with other types'); - end; - end; - etLitInt: begin - case ANextItem.Token of - etLitInt, etLitDate, etLitFloat: begin - case AArgument.Token of - etAdd: APrevItem.Value := APrevItem.Value + ANextItem.Value; - etSub: APrevItem.Value := APrevItem.Value - ANextItem.Value; - etMul: APrevItem.Value := APrevItem.Value * ANextItem.Value; - etDiv: APrevItem.Value := APrevItem.Value / ANextItem.Value; - end; - if ANextItem.Token = etLitDate - then APrevItem.Token := etLitDate - else if ANextItem.Token = etLitFloat - then APrevItem.Token := etLitFloat - else if AArgument.Token = etDiv - then APrevItem.Token := etLitFloat - else APrevItem.Token := etLitInt; - Remove(AArgument); - Remove(ANextItem); - end; - else raise TRtfException.Create('Invalid formula'); - end; - end; - etLitFloat: begin - case ANextItem.Token of - etLitInt, etLitFloat, etLitDate: begin - case AArgument.Token of - etAdd: APrevItem.Value := APrevItem.Value + ANextItem.Value; - etSub: APrevItem.Value := APrevItem.Value - ANextItem.Value; - etMul: APrevItem.Value := APrevItem.Value * ANextItem.Value; - etDiv: APrevItem.Value := APrevItem.Value / ANextItem.Value; - end; - if ANextItem.Token = etLitDate - then APrevItem.Token := etLitDate - else APrevItem.Token := etLitFloat; - Remove(AArgument); - Remove(ANextItem); - end; - else raise TRtfException.Create('Invalid formula'); - end; - end; - etLitDate: begin - case ANextItem.Token of - etLitInt, etLitFloat, etLitDate: begin - case AArgument.Token of - etAdd: APrevItem.Value := APrevItem.Value + ANextItem.Value; - etSub: APrevItem.Value := APrevItem.Value - ANextItem.Value; - etMul: APrevItem.Value := APrevItem.Value * ANextItem.Value; - etDiv: APrevItem.Value := APrevItem.Value / ANextItem.Value; - end; - APrevItem.Token := etLitDate; - Remove(AArgument); - Remove(ANextItem); - end; - else raise TRtfException.Create('Invalid formula'); - end; - end; - etComma: begin - //Fix for constant int's and float's - case ANextItem.Token of - etLitInt, etLitFloat, etLitDate: begin - case AArgument.Token of - etAdd:; //nothing just a (..., +Value) - etSub: ANextItem.Value := ANextItem.Value * - 1; - else raise TRtfException.Create('Invalid formula'); - end; - Remove(AArgument); - end; - else raise TRtfException.Create('Invalid formula'); - end; - end; - etAssign: begin - //Fix for constant int's and float's - case ANextItem.Token of - etLitInt, etLitFloat, etLitDate: begin - case AArgument.Token of - etAdd:; //nothing just a @Variable := +Value - etSub: ANextItem.Value := ANextItem.Value * - 1; - else raise TRtfException.Create('Invalid formula'); - end; - Remove(AArgument); - end; - else raise TRtfException.Create('Invalid formula'); - end; - end; - else raise TRtfException.Create('Invalid formula'); //Otherwise it wont advance - end; - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); -end; - -procedure TRtfArgument.EvaluateComparison(APrevItem, AArgument, ANextItem: TRtfArgument); -begin - if(APrevItem.Token = etLitString)and(ANextItem.Token <> etLitString) - then raise TRtfException.Create('Invalid comparison'); - if(ANextItem.Token = etLitString)and(APrevItem.Token <> etLitString) - then raise TRtfException.Create('Invalid comparison'); - - case AArgument.Token of - etEQ: APrevItem.Value := APrevItem.Value = ANextItem.Value; - etNE: APrevItem.Value := APrevItem.Value <> ANextItem.Value; - etGE: APrevItem.Value := APrevItem.Value >= ANextItem.Value; - etLE: APrevItem.Value := APrevItem.Value <= ANextItem.Value; - etGT: APrevItem.Value := APrevItem.Value > ANextItem.Value; - etLT: APrevItem.Value := APrevItem.Value < ANextItem.Value; - etOr: APrevItem.Value := APrevItem.Value or ANextItem.Value; - etAnd: APrevItem.Value := APrevItem.Value and ANextItem.Value; - else raise TRtfException.Create('Invalid comparison'); - end; - if APrevItem.Value - then APrevItem.Token := etLitTrue - else APrevItem.Token := etLitFalse; - - Remove(AArgument); - Remove(ANextItem); - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); -end; - -procedure TRtfArgument.EvaluateAssign(APrevItem, AArgument, ANextItem: TRtfArgument); -var AVariable: TRtfVariable; -begin - if APrevItem.Token <> etVariable - then raise TRtfException.Create('Invalid assignment'); - - AVariable := Parser.Variables.Find(APrevItem.Value); - if Assigned(AVariable) then begin - AVariable.Value := ANextItem.Value; - AVariable.Token := ANextItem.Token; - end - else AVariable := Parser.Variables.Add(APrevItem.Value, ANextItem.Value, ANextItem.Token); - - APrevItem.Value := AVariable.Value; - APrevItem.Token := AVariable.Token; - - Remove(AArgument); - Remove(ANextItem); - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); -end; - -procedure TRtfArgument.GetPictureData(ABuffer: pointer; ALength: cardinal; var Result: string); -var ASrc: Pbyte; - ADst: pchar; - AIndex: cardinal; - i: integer; - s: string; -begin - if poBinary in Parser.PictureOptions then begin - //Save graphic binary - Result := Format('%s\bin%d ',[Result, ALength]); - AIndex := Length(Result); - SetLength(Result, AIndex + ALength); - ADst := @Result[AIndex + 1]; - System.Move(ABuffer^, ADst^, ALength); - end else begin - //Save graphics as hex - ASrc := ABuffer; - Result := Result + ' '; - AIndex := Length(Result); - SetLength(Result, AIndex + 2 *(ALength +(ALength div 128))); - ADst := @Result[AIndex + 1]; - for i := 0 to ALength - 1 do begin - s := IntToHex(ASrc^, 2); - ADst^ := s[1]; - Inc(ADst); - ADst^ := s[2]; - Inc(ADst); - if(i > 0)and(i and 127 = 0) then begin - ADst^ := #13; - Inc(ADst); - ADst^ := #10; - Inc(ADst); - end; - Inc(ASrc); - end; - end; - Result := Result + #13#10 + '}'; -end; - -function TRtfArgument.GetPicture(APicture: TPicture): string; -//Convert a picture to a string suitable for in the Rtf -(* -var - xw, yh: word; - Rect: TRect; - ARefDC: HDC; - ABuffer: pointer; - ALength: cardinal; - AMetafile: TMetafile; - ABorderWidth: integer; - APictureAttr: TRtfPictureAttr; - ppi, AColorIndex, xtw, ytw: integer; -*) -begin - Result := ''; - (* - ppi := Screen.PixelsPerInch; - - AMetafile := TMetaFile.Create; - try - AMetafile.Enhanced := true; - - if poMetafile in Parser.PictureOptions then begin - AMetafile.Width := Round(APicture.Graphic.Width * ppi / 96); - AMetafile.Height := Round(APicture.Graphic.Height * ppi / 96); - end else begin - if(APicture.graphic is TMetafile)and not APicture.Metafile.Enhanced then begin - AMetafile.Height := APicture.graphic.Height; - AMetafile.Width := APicture.graphic.Width; - end else begin - AMetafile.Height := Round(APicture.graphic.Height * ppi / 96); - AMetafile.Width := Round(APicture.graphic.Width * ppi / 96); - end; - end; - - Rect.Top := 0; - Rect.Left := 0; - Rect.Right := AMetafile.Width - 1; - Rect.Bottom := AMetafile.Height - 1; - - with TMetaFileCanvas.Create(AMetafile, 0)do try - if ppi = 96 - then Draw(0, 0, APicture.Graphic) - else StretchDraw(Rect, APicture.Graphic); - finally - Free; - end; - - if(APicture.Graphic is TMetafile)and not APicture.Metafile.Enhanced then begin - xw := Round(APicture.Width * 96 / ppi); - yh := Round(APicture.Height * 96 / ppi); - end else begin - xw := APicture.Width; - yh := APicture.Height; - end; - - APictureAttr := TRtfPictureAttr.Create(xw, yh); - try - AMetafile.MMWidth := Round(APictureAttr.Widthmm * 100); - AMetafile.MMHeight := Round(APictureAttr.Heigthmm * 100); - - if poMetafile in Parser.PictureOptions then begin - xtw := Round(APictureAttr.Width * 26.4596930676); - ytw := Round(APictureAttr.Heigth * 26.4596930676); - end else begin - xtw := Round(5669 * APictureAttr.Widthmm / 100); - ytw := Round(5669 * APictureAttr.Heigthmm / 100); - end; - - if Assigned(Parser.OnPictureAttr) - then Parser.OnPictureAttr(APictureAttr); - - Result := Format('{\pict\picscalex%d\picscaley%d\piccropl0' + - '\piccropr0\piccropt0\piccropb0\picw%d\pich%d', - [APictureAttr.ScaleX, APictureAttr.ScaleY, xtw, ytw]); - if poMetafile in Parser.PictureOptions - then Result := Result + '\wmetafile8' - else Result := Result + '\emfblip'; - - if(APictureAttr.BorderType <> brNone)and(APictureAttr.BorderWidth > 0) then begin - case APictureAttr.BorderType of - brSingle: Result := Result + '\brdrs'; - brDouble: Result := Result + '\brdrdb'; - brThick: Result := Result + '\brdrth'; - brShadow: Result := Result + '\brdrsh'; - brDot: Result := Result + '\brdrdot'; - brHair: Result := Result + '\brdrhair'; - end; - - ABorderWidth := APictureAttr.BorderWidth; - if ABorderWidth > 75 - then ABorderWidth := 75; - - AColorIndex := Parser.ColorList.UseColor(APictureAttr.BorderColor); - Result := Format('%s\brdrw%d\brdrcf%d',[Result, ABorderWidth, AColorIndex]); - end; - finally - APictureAttr.Free; - end; - - - if poMetafile in Parser.PictureOptions then begin - ARefDC := GetDC(0); - try - ALength := GetWinMetaFileBits(AMetafile.Handle, 0, nil, MM_ANISOTROPIC, ARefDC); - GetMem(ABuffer, ALength); - try - GetWinMetaFileBits(AMetafile.Handle, ALength, ABuffer, MM_ANISOTROPIC, ARefDC); - GetPictureData(ABuffer, ALength, Result); - finally - FreeMem(ABuffer); - end; - finally - ReleaseDC(0, ARefDc); - end; - end else begin - ALength := GetEnhMetaFileBits(AMetafile.Handle, 0, nil); - GetMem(ABuffer, ALength); - try - GetEnhMetaFileBits(AMetafile.Handle, ALength, ABuffer); - GetPictureData(ABuffer, ALength, Result); - finally - FreeMem(ABuffer); - end; - end; - finally - AMetafile.Free; - end; - *) -end; - -procedure TRtfArgument.GetGraphicsValue(ADataset: TRtfDataset; AFieldName: string); -(* -var - APicture: TPicture; - ABlob: TBlobField; - APhoto: TJPEGImage; - AStream: TStringStream; - s: string[20]; - AField: TField; -*) -begin -(* - Value := varEmpty; - Token := etNothing; - if ADataset.Dataset is TDataset then begin - AField :=(ADataset.Dataset as TDataset).FieldByName(AFieldName); - - APicture := TPicture.Create; - try - ABlob := AField as TBlobField; - s := Copy(ABlob.Value, 1, 20); - if(Pos('GIF8', s) > 0)or(Pos('JFIF', s) > 0) then begin - APhoto := TJPEGImage.Create; - try - AStream := TStringStream.Create(ABlob.AsString); - APhoto.LoadFromStream(AStream); - APicture.Assign(APhoto); - finally - FreeAndNil(APhoto); - FreeAndNil(AStream); - end; - end - else APicture.Assign(ABlob); - - if Assigned(APicture.Graphic) then begin - Value := GetPicture(APicture); - Token := etLitString; - end; - - finally - APicture.Free; - end; - end - else - raise TRtfException.Create('Graphic fields worden alleen ondersteund via de tdataset!'); -*) -end; - -procedure TRtfArgument.ResolveFieldValue(ADataset: TRtfDataset; AFieldName: string); -//Get field data from a dataset object -var - AObject: TObject; - APropInfo: PPropInfo; - ATypedata: PTypeData; - ATable: TDataset; - AField: TField; -begin - //Can't resolve that - if AFieldName = '' then - raise TRtfException.Create('invalid fieldname'); - - if ADataset.Dataset is TDataset then - begin - ATable := ADataset.Dataset as TDataset; - AField := ATable.FieldByName(AFieldName); - case AField.DataType of - ftMemo, ftFmtMemo, ftFixedChar, ftWideString, ftString: begin - Token := etLitString; - Value := AField.AsString; - end; - ftLargeint, ftAutoInc, ftSmallint, ftInteger, ftWord: begin - Token := etLitInt; - Value := AField.AsInteger; - end; - ftBoolean: begin - Value := AField.AsBoolean; - if Value then - Token := etLitTrue - else - Token := etLitFalse; - end; - ftFloat, ftCurrency, ftBCD: begin - Token := etLitFloat; - Value := AField.AsFloat; - end; - ftDate, ftTime, ftDateTime, ftTimeStamp: begin - Token := etLitDate; - Value := AField.AsDateTime; - end; - ftGraphic: begin - GetGraphicsValue(ADataset, AFieldName); - end; - else - raise TRtfException.CreateFmt('Unable to convert field "%s" value',[AFieldName]); - end; - end - else - begin - AObject := ADataset.Dataset; - if AObject is TtiObjectList then - begin - //Get the right record from the array - if ADataset.TableIndex <(AObject as TtiObjectList).Count then - AObject :=(AObject as TtiObjectList)[ADataset.TableIndex] - else - begin //Trying beyond eof (or empty dataset) big problem; nah? - Token := etNothing; - Value := varEmpty; - exit; - end; - end; - APropInfo := GetPropInfo(AObject, AFieldName); - if not Assigned(APropInfo) then - raise TRtfException.CreateFmt('Field "%s" does not exist',[AFieldName]); - if not Assigned(APropInfo^.GetProc) then - raise TRtfException.CreateFmt('Cannot access field "%s"',[AFieldName]); - {$IFDEF FPC} - ATypeData := GetTypeData(APropInfo^.PropType); - {$ELSE} - ATypeData := GetTypeData(APropInfo^.PropType^); - {$ENDIF} - - case APropInfo^.PropType^.Kind of - tkChar, tkString, tkLString, tkWString{$IFDEF FPC},tkAString{$ENDIF}: begin - Token := etLitString; - Value := GetStrProp(AObject, APropInfo); - end; - tkInt64: begin - Token := etLitInt; - Value := GetInt64Prop(AObject, APropInfo); - end; - tkSet, tkInteger: begin - Token := etLitInt; - Value := GetOrdProp(AObject, APropInfo); - end; - tkEnumeration: begin - {$IFDEF FPC} - if ATypeData^.BaseType = TypeInfo(boolean) then - {$ELSE} - if ATypeData^.BaseType^ = TypeInfo(boolean) then - {$ENDIF} - begin - Value := GetOrdProp(AObject, APropInfo) = 1; - if Value then - Token := etLitTrue - else - Token := etLitFalse; - end - else - begin - Token := etLitInt; - Value := GetOrdProp(AObject, APropInfo); - end; - end; - tkFloat: begin - if SameText(APropInfo^.PropType^.Name, 'TDate') - or SameText(APropInfo^.PropType^.Name, 'TTime') - or SameText(APropInfo^.PropType^.Name, 'TDateTime') then - Token := etLitDate - else - Token := etLitFloat; - Value := GetFloatProp(AObject, APropInfo); - end; - else - raise TRtfException.CreateFmt('Unable to convert field "%s" value',[AFieldName]); - end; { case } - end; { if/else } -end; - -procedure TRtfArgument.ResolveVariable; -var AVariable: TRtfVariable; - AText, AFieldName: string; - ADataset: TRtfDataset; - AIndex: integer; -begin - AText := Value; - AIndex := Pos('.', AText); - if AIndex > 0 then begin - //Its a dataset reference @Table.Fieldname - AFieldName := Copy(AText, AIndex + 1, Maxint); - AText := Copy(AText, 1, AIndex - 1); - - AVariable := Parser.Variables.Find(AText); - if not Assigned(AVariable) - then raise TRtfException.Create('variable does not exist'); - Token := AVariable.Token; - Value := AVariable.Value; - if Token <> etDataset - then raise TRtfException.Create('variable is not a dataset'); - - ADataset := TRtfDataset(ptrint(Value)); - ADataset := ADataset.ResolveNestedFields(ADataset, AFieldName, AFieldName); - if AFieldName = '' then begin - //Its a (nested) dataset - Token := etDataset; - Value := PtrInt(ADataset); - end - else ResolveFieldValue(ADataset, AFieldName); - end else begin - AVariable := Parser.Variables.Find(AText); - if not Assigned(AVariable) - then raise TRtfException.Create('variable does not exist'); - Token := AVariable.Token; - Value := AVariable.Value; - end; -end; - -procedure TRtfArgument.ResolveFieldName; -//Resolve dataset names or fieldnames (seperated with ".") -var ADataset: TRtfDataset; - AFieldName: string; -begin - //Otherwise it should be a table reference or fieldname - ADataset := Parser.Datasets.Find(Value, AFieldName); - if not Assigned(ADataset) //There should be at least a table reference. - then raise TRtfException.CreateFmt('Dataset "%s" not found',[Value]); - if AFieldName <> '' - then ResolveFieldValue(ADataset, AFieldName) - else begin - //Its a dataset or objectlist reference - Token := etDataset; - Value := PtrInt(ADataset); - end; -end; - -procedure TRtfArgument.Walk(ATokenset: TRtfTokenSet; AExecproc: TRtfArgumentEvent); -//Not really neat (what can you expect in 1 day) -var i: integer; - AText: string; - AResolve: boolean; - AParent, APrevItem, AArgument, ANextItem: TRtfArgument; -begin - if Count > 0 then begin - i := 0; - while i < Count do begin - AArgument := Items[i]; - - if AArgument.Token = etVariable then begin - if(i >= Count - 1)or(Items[i + 1].Token <> etAssign) - then AArgument.ResolveVariable; - end else if AArgument.Token = etFieldName then begin - //An exception is the DbPicture(Table.Field). It shoud not evaluate - //since the DbPicture function should be responsible for that. - AResolve := true; - AParent := AArgument.Parent; - if Assigned(AParent) then begin - AText := AParent.Value; - if SameText(AText, 'DbPicture') - then AResolve := false; - end; - if AResolve - then AArgument.ResolveFieldName; - end; - - if AArgument.Token = etNot then begin - if i < Count - 1 - then ANextItem := Items[i + 1] - else raise TRtfException.Create('invalid formula'); - if ANextItem.Token = etLitFalse - then ANextItem.Value := true - else if ANextItem.Token = etLitTrue - then ANextItem.Value := false - else raise TRtfException.Create('invalid formula'); - Remove(AArgument); - end else if AArgument.Token in ATokenSet then begin - if i > 0 - then APrevItem := Items[i - 1] - else raise TRtfException.Create('invalid formula'); - if i < Count - 1 - then ANextItem := Items[i + 1] - else raise TRtfException.Create('invalid formula'); - AExecproc(APrevItem, AArgument, ANextItem); - end - else Inc(i); - end; - - if(Count = 1)and(Token = etParenthesis) then begin - //Advance the answer from between parenthesis to parent. - AArgument := Items[0]; - Value := AArgument.Value; - Token := AArgument.Token; - Remove(AArgument); - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); - end; - end; -end; - -procedure TRtfArgument.EvaluateExpression; -//Not really neat (what can you expect in 1 day) -//Evaluate the entered expression via ParseExpression() -var AFunction: TRtfFunction; - AArgument: TRtfArgument; - i: integer; -begin - if Count > 0 then begin - //First the binary operators - Walk([etMul, etDiv], {$IFDEF FPC}@{$ENDIF}EvaluateUnaryBinary); - //Secondly the unary operators - Walk([etAdd, etSub], {$IFDEF FPC}@{$ENDIF}EvaluateUnaryBinary); - //And finally the simple comparisons - Walk([etEQ, etNE, etGE, etLE, etGT, etLT], {$IFDEF FPC}@{$ENDIF}EvaluateComparison); - //And finally the more "complicated" comparisons - Walk([etAnd, etOr], {$IFDEF FPC}@{$ENDIF}EvaluateComparison); - end; - - - if Token in[etFunction, etProcedure] then begin - AFunction := Parser.Functions.Find(Value); - if not Assigned(AFunction) - then raise TRtfException.Create('Cannot resolve function'); - - if not Assigned(AFunction.OnExecute) - then raise TRtfException.Create('Cannot resolve function'); - - //Remove now redundant comma's - for i := Count - 1 downto 0 do begin - AArgument := Items[i]; - if AArgument.Token = etComma - then Remove(AArgument) - else if VarIsEmpty(AArgument.Value) - then raise TRtfException.Create('Function needs valid parameters'); - end; - - if Count < AFunction.Min - then raise TRtfException.Create('expected more parameters'); - if Count > AFunction.Max - then raise TRtfException.Create('to many parameters'); - - Value := varEmpty; - Token := etNothing; - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); - AFunction.OnExecute(Self); - Clear; //Clear parameters - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); - end; - - //And not to forget any optional assignments - if Count > 0 - then Walk([etAssign], {$IFDEF FPC}@{$ENDIF}EvaluateAssign); -end; - -procedure TRtfArgument.Evaluate; -//Not really neat (what can you expect in 1 day) -//Evaluate the expression (not very efficient, but what the hack) -var i: integer; - AText: string; - AArgument: TRtfArgument; -begin - for i := 0 to Count - 1 do begin - AArgument := Items[i]; - AArgument.Evaluate; - end; - EvaluateExpression; - - if(Parent = nil)and(Count > 1) - then raise TRtfException.Create('invalid formula'); - - if Count = 1 then begin - //Advance the answer from between parenthesis to parent. - AArgument := Items[0]; - Value := AArgument.Value; - Token := AArgument.Token; - Param := AArgument.Param; - Clear; - if Assigned(Parser.OnEvalutate) - then Parser.OnEvalutate(Self); - end; - - if Token = etLitString then begin - //Fix: DbExpres appends a #0 character to memo fields - AText := Value; - if(Length(AText) > 0)and(AText[Length(AText)] = #0) - then Value := Copy(AText, 1, Length(AText) - 1); - end; -end; - - -{ TRtfColor } - -function TRtfColor.GetAsString: string; -begin - Result := Format('\red%d\green%d\blue%d;',[Red, Green, Blue]); -end; - -{ TRtfColorList } - -function TRtfColorList.GetItem(Index: integer): TRtfColor; -begin - Result := TRtfColor(inherited Items[Index]); -end; - -procedure TRtfColorList.Clear; -begin - inherited Clear; - { TODO -oGraeme : Not sure why this was here, so I removed it. 2009-11-10 } -// Add(0, 0, 0); //Dummy color.. -end; - -function TRtfColorList.Add(ARed, AGreen, ABlue: integer): integer; -var AColor: TRtfColor; -begin - AColor := TRtfColor.Create; - AColor.Red := ARed; - AColor.Green := AGreen; - AColor.Blue := ABlue; - Result := inherited Add(AColor); -end; - -function TRtfColorList.Find(ARed, AGreen, ABlue: integer): integer; -var - i: integer; - AColor: TRtfColor; -begin - //0 is a dummy color - for i := 1 to Count - 1 do - begin - AColor := Items[i]; - if(AColor.Red = ARed)and(AColor.Green = AGreen)and(AColor.Blue = ABlue) then - begin - Result := i; - exit; - end; - end; - Result := - 1; -end; - -function TRtfColorList.GetAsString: string; -var - i: integer; - AColor: TRtfColor; -begin - Result := ''; - //0 is a dummy color - for i := 1 to Count - 1 do - begin - AColor := Items[i]; - Result := Result + AColor.AsString; - end; -end; - -function TRtfColorList.UseColor(ARed, AGreen, ABlue: integer): integer; -begin - Result := Find(ARed, AGreen, ABlue); - if Result < 0 - then Result := Add(ARed, AGreen, ABlue); -end; - -function TRtfColorList.UseColor(AColor: TColor): integer; -var ARed, AGreen, ABlue: integer; -begin - ARed := AColor and 255; - AColor := AColor shr 8; - AGreen := AColor and 255; - AColor := AColor shr 8; - ABlue := AColor and 255; - Result := UseColor(ARed, AGreen, ABlue); -end; - - -{ TtiRtfParser } - -constructor TtiRtfParser.Create; -begin - inherited Create; - FBoolTrue := 'Ja'; - FBoolFalse := 'Nee'; - FErrorForeColor := clRed; - FErrorBackColor := clYellow; - FPictureOptions :=[poMetafile, poBinary]; - FHlpItems := TRtfItem.Create; - TmpItems := TObjectlist.Create; - FDatasets := TRtfDataset.Create; - FRtfItems := TRtfItemList.Create; - FRawItems := TRtfItemList.Create; - FColorList := TRtfColorList.Create; - FVariables := TRtfVariableList.Create; - FFunctions := TRtfFunctionList.Create; - AddFunctions; -end; - -destructor TtiRtfParser.Destroy; -begin - FDatasets.Free; - FRtfItems.Free; - TmpItems.Free; - FHlpItems.Free; - FVariables.Free; - FFunctions.Free; - FRawItems.Free; - FColorList.Free; - inherited; -end; - -procedure TtiRtfParser.Clear; -begin - TmpItems.Clear; - RawItems.Clear; - RtfItems.Clear; - HlpItems.Clear; - ColorList.Clear; -end; - -procedure TtiRtfParser.SaveToFile(AFileName: string); -var AStream: TMemoryStream; -begin - AStream := TMemoryStream.Create; - try - RtfItems.SaveToStream(AStream, ColorList.AsString); - AStream.SaveToFile(AFileName); - finally - AStream.Free; - end; -end; - -function TtiRtfParser.SaveToString: string; -var AStream: TMemoryStream; -begin - Result := ''; - AStream := TMemoryStream.Create; - try - RtfItems.SaveToStream(AStream, ColorList.AsString); - SetLength(Result, AStream.Size); - if AStream.Size > 0 //Humble admitted its a bit dirty - then Move(AStream.Memory^, Result[1], AStream.Size); - finally - AStream.Free; - end; -end; - -procedure TtiRtfParser.SaveToStream(AStream: TMemoryStream); -begin - RtfItems.SaveToStream(AStream, ColorList.AsString); -end; - -function TtiRtfParser.AddVariable(AName: string; AValue: variant; AToken: TRtfToken): TRtfVariable; -begin - Result := Variables.Add(AName, AValue, AToken); -end; - -function TtiRtfParser.AddDataset(ATable: TObject; AName: string; AFreeDataset: boolean = false): TRtfDataset; -begin - Result := Datasets.Add(ATable, AName, AFreeDataset); -end; - -function TtiRtfParser.AddFunction(AName: string; ATokenType: TRtfToken; AMin, AMax: smallint; AOnexecute: TRtfFunctionExecute): TRtfFunction; -begin - Result := Functions.Add(ATokenType, AName, AMin, AMax, AOnexecute); -end; - -function TtiRtfParser.AddToRtfItems(AItem: TRtfItem): TRtfItem; -begin - Result := TRtfItem.Create; - Result.Assign(AItem); - RtfItems.Add(Result); -end; - -procedure TtiRtfParser.LoadFromFile(AFilename: string); -//Tokenize the raw rtf and put it into rawitems -var - AStream: TMemoryStream; -begin - Clear; - AStream := TMemoryStream.Create; - try - AStream.LoadFromFile(AFileName); - LoadFromBuffer(AStream.Memory, AStream.Size); - finally - FreeAndNil(AStream); - end; -end; - -procedure TtiRtfParser.LoadFromStream(AStream: TMemoryStream); -//Tokenize the raw rtf and put it into rawitems -begin - LoadFromBuffer(AStream.Memory, AStream.Size); -end; - -procedure TtiRtfParser.LoadFromString(AString: string); -//Tokenize the raw rtf and put it into rawitems -begin - LoadFromBuffer(pchar(AString), Length(AString)); -end; - -procedure TtiRtfParser.LoadFromBuffer(ABuffer: pchar; ASize: integer); -//Tokenize the raw rtf and put it into rawitems -var AColorTable: TRtfItem; - AColors, AToken: string; - ANumber, ARed, AGreen, ABlue: integer; - p: pchar; -begin - Clear; - with TRawRtfParser.Create do try - Execute(FRawItems, ABuffer, ASize); - AColorTable := ColorTable; - finally - Free; - end; - - if not Assigned(AColorTable) - then raise TRtfException.Create('no colortbl found'); - - //Parse the color table (tiny parser) - ARed := 0; - ABlue := 0; - AGreen := 0; - AColors := Copy(AColorTable.RtfTextBuf, 11, Maxint); - p := pchar(AColors); - while p <> #0 do begin - case p^ of - '\': begin - inc(p); - AToken := ''; - ANumber := 0; - while(p^ in['A'..'Z', 'a'..'z'])do begin - AToken := AToken + p^; - inc(p); - end; - while(p^ in['0'..'9'])do begin - ANumber :=(ANumber * 10) +(ord(p^) - ord('0')); - inc(p); - end; - ANumber := ANumber and 255; - if SameText(AToken, 'red') - then ARed := ANumber - else if SameText(AToken, 'blue') - then ABlue := ANumber - else if SameText(AToken, 'green') - then AGreen := ANumber; - end; - ';': begin - inc(p); - ColorList.UseColor(ARed, AGreen, ABlue); - ARed := 0; - ABlue := 0; - AGreen := 0; - end; - #13, #10: inc(p); - '}': break; - else raise TRtfException.Create('Invalid character in colortbl'); - end; - end; - - (* - {\colortbl;\red0\green0\blue;\red255\green0\blue;\red255\green255\blue;\red0\green255\blue;\red255\green0\blue;\red0\green0\blue;\red0\green255\blue;\red255\green255\blue;\red128\green0\blue;\red128\green128\blue;\red0\green128\blue;\red128\green0\blue;\red0\green0\blue;\red0\green128\blue;\red128\green128\blue;\red192\green192\blue;} - *) -end; - -procedure TtiRtfParser.Execute; -//Rtf has been already been loaded -begin - PreParse; //Create a tree for easy parsing of if-then-else and scan-endscan etc. - Parse(HlpItems); //Parse the tree items in the structure.. -end; - -procedure TtiRtfParser.PreParse; -//Preparse the items from Items to Structure -//This will make a tree from (sub)expressions and code. -//Specially for the if/else/endif and scan/scanend -var AIndex, AForeColor, ABackColor: integer; - AItem, AStart, ABranche: TRtfItem; - AArguments: TRtfArgument; - ARemoveParagraph: boolean; - AFirstArgument: string; - AFirstToken: TRtfToken; - AText: string; -begin - AItem := RawItems.Head; - AArguments := TRtfArgument.Create(Self); - try - //Round 1: create expression nodes - while Assigned(AItem)do begin - if AItem.RtfClass = RtfParsebegin then begin - - //Items starts with a RtfParseBegin - AText := AItem.RtfTextBuf; //Initial expression - AStart := HlpItems[HlpItems.Add(AItem)]; - AStart.RtfClass := RtfExpression; - AStart.RtfMajor := RtfNormalExpression; - AStart.RtfTextBuf := ''; - AItem := AItem.Next; - while Assigned(AItem)do begin - case AItem.RtfClass of - RtfParseEnd: begin //End of expression - AText := AText + AItem.RtfTextBuf; - AItem := AItem.Next; //Skip's ParseEnd - break; - end; - RtfParseBegin: begin //WTF: Start of expression, this should not happen. Inform user - raise TRtfException.Create('Error in preparse? at ' + AText); - end; - RtfText: AText := AText + AItem.RtfTextBuf; - RtfControl: begin - case AItem.RtfMajor of - RtfSpecialChar: begin //Add some special characters - case AItem.RtfMinor of - RtfPar, RtfParDef:; //Ignore these - RtflQuote, RtfrQuote: AText := AText + Chr(39); - RtflDblQuote, RtfrDblQuote: AText := AText + '"'; - else AText := AText + AItem.RtfTextBuf; //Hope this is Ok? - end; - end; - else HlpItems.Add(AItem); - end; - end; - else HlpItems.Add(AItem); - end; - AItem := AItem.Next; - end; - - AStart.RtfTextBuf := StringReplace(AText, #13#10, '',[rfReplaceAll]); - AArguments.Clear; - ARemoveParagraph := true; - try - AArguments.ParseExpression(AText); - except - on e: Exception do begin - //Ignore at this moment, it will be triggered again in the Parse() - end; - end; - if AArguments.Count > 0 then begin - AFirstToken := AArguments[0].Token; - AFirstArgument := AArguments[0].Value; - if SameText(AFirstArgument, 'if') - then AStart.RtfMajor := RtfIfExpression - else if SameText(AFirstArgument, 'else') - then AStart.RtfMajor := RtfElseExpression - else if SameText(AFirstArgument, 'endif') - then AStart.RtfMajor := RtfEndifExpression - else if SameText(AFirstArgument, 'scan') - then AStart.RtfMajor := RtfScan - else if SameText(AFirstArgument, 'endscan') - then AStart.RtfMajor := RtfScanEnd - else if SameText(AFirstArgument, 'scanentry') - then AStart.RtfMajor := RtfScanEntry - else if SameText(AFirstArgument, 'scanfooter') - then AStart.RtfMajor := RtfScanFooter; - ARemoveParagraph := AFirstToken in[etVariable, etProcedure, etNothing]; - if(AFirstToken = etVariable)and(AArguments.Count = 1) - then ARemoveParagraph := false; //One exception: variable reference - end; - - if ARemoveParagraph - then AItem := SkipParagraph(AItem); - end else begin - HlpItems.Add(AItem); - AItem := AItem.Next; - end; - end; - - finally - AArguments.Free; - end; - - //Round 2: create if then else expression sub-nodes - AIndex := 0; - ABranche := nil; - while AIndex < HlpItems.Count do begin - AItem := HlpItems[AIndex]; - try - - if AItem.CheckItem(RtfExpression, RtfIfExpression) then begin - if Assigned(ABranche) then begin - HlpItems.Extract(AItem); - ABranche.Add(AItem); - end - else Inc(AIndex); - - ABranche := TRtfItem.Create; - ABranche.RtfClass := RtfBranche; - ABranche.RtfMajor := RtfThenExpression; - TmpItems.Add(ABranche); //Otherwise memory leak - AItem.Add(ABranche); - end else if AItem.CheckItem(RtfExpression, RtfElseExpression) then begin - if not Assigned(ABranche) - then raise TRtfException.Create('unexpected else'); - - HlpItems.Extract(AItem); //Remove else item - AItem := ABranche.Parent; //Points to "if" statement - if AItem.RtfClass = RtfBranche - then AItem := AItem.Parent; //Points to "if" statement - if not Assigned(AItem) - then raise TRtfException.Create('unexpected else'); - if not AItem.CheckItem(RtfExpression, RtfIfExpression) - then raise TRtfException.Create('unexpected scanentry'); - - ABranche := TRtfItem.Create; - ABranche.RtfClass := RtfBranche; - ABranche.RtfMajor := RtfElseExpression; - TmpItems.Add(ABranche); //Otherwise memory leak - AItem.Add(ABranche); - end else if AItem.CheckItem(RtfExpression, RtfEndifExpression) then begin - if not Assigned(ABranche) - then raise TRtfException.Create('unexpected endif'); - - HlpItems.Extract(AItem); //Remove item - ABranche := ABranche.Parent; - ABranche := ABranche.Parent; - if ABranche = HlpItems - then ABranche := nil; - end else if AItem.CheckItem(RtfExpression, RtfScan) then begin - - if Assigned(ABranche) then begin - HlpItems.Extract(AItem); - ABranche.Add(AItem); - end - else Inc(AIndex); - - ABranche := TRtfItem.Create; - ABranche.RtfClass := RtfBranche; - ABranche.RtfMajor := RtfScan; - TmpItems.Add(ABranche); //Otherwise memory leak - AItem.Add(ABranche); - end else if AItem.CheckItem(RtfExpression, RtfScanEntry) then begin - if not Assigned(ABranche) - then raise TRtfException.Create('unexpected scanentry'); - - HlpItems.Extract(AItem); //Remove else item - AItem := ABranche.Parent; //Points to "scan" statement - if AItem.RtfClass = RtfBranche - then AItem := AItem.Parent; //Points to "scan" statement - if not Assigned(AItem) - then raise TRtfException.Create('unexpected scanentry'); - if not AItem.CheckItem(RtfExpression, RtfScan) - then raise TRtfException.Create('unexpected scanentry'); - - ABranche := TRtfItem.Create; - ABranche.RtfClass := RtfBranche; - ABranche.RtfMajor := RtfScanEntry; - TmpItems.Add(ABranche); //Otherwise memory leak - AItem.Add(ABranche); - end else if AItem.CheckItem(RtfExpression, RtfScanFooter) then begin - if not Assigned(ABranche) - then raise TRtfException.Create('unexpected scanfooter'); - - HlpItems.Extract(AItem); //Remove item - AItem := ABranche.Parent; //Points to "scan" statement - if AItem.RtfClass = RtfBranche - then AItem := AItem.Parent; //Points to "scan" statement - if not Assigned(AItem) - then raise TRtfException.Create('unexpected scanfooter'); - if not AItem.CheckItem(RtfExpression, RtfScan) - then raise TRtfException.Create('unexpected scanfooter'); - - ABranche := TRtfItem.Create; - ABranche.RtfClass := RtfBranche; - ABranche.RtfMajor := RtfScanFooter; - TmpItems.Add(ABranche); //Otherwise memory leak - AItem.Add(ABranche); - end else if AItem.CheckItem(RtfExpression, RtfScanEnd) then begin - if not Assigned(ABranche) - then raise TRtfException.Create('unexpected scanend'); - - HlpItems.Extract(AItem); //Remove item - ABranche := ABranche.Parent; - ABranche := ABranche.Parent; - if ABranche = HlpItems - then ABranche := nil; - end else begin - if Assigned(ABranche) then begin - HlpItems.Extract(AItem); - ABranche.Add(AItem); - end - else Inc(AIndex); - end; - except - on e: Exception do begin - fpgApplication.HandleException(e); -{ - if Assigned(AItem) - then AItem.RtfTextBuf := AItem.RtfTextBuf + ' ' + E.Message; -} - end; - end; - end; - - if Assigned(ABranche) then begin - if Assigned(AItem) then begin - AForeColor := ColorList.UseColor(ErrorForeColor); - ABackColor := ColorList.UseColor(ErrorBackColor); - AItem.FRtfTextBuf := Format('{\b\ul\highlight%d\cf%d <<<<endif or endscan missing}%s',[ABackColor, AForeColor, AItem.RtfTextBuf]); - end; - end; -end; - -function TtiRtfParser.SkipParagraph(AItem: TRtfItem): TRtfItem; -//Remove paragraph breaks if it was just a procedure (or a VAR/SET etc.) -//This can be multiple breaks (CrLf and /Par controls) but -//do not remove more than a single item from each of them -var AEnter, APar, AParDef: boolean; -begin - APar := false; - AEnter := false; - AParDef := false; - while Assigned(AItem) do - begin - case AItem.RtfClass of - RtfText: begin - if not AEnter and(Pos(#13#10, AItem.RtfTextBuf) > 0) then - begin - //Crap, it can contain multiple #13#10's - AItem.RtfTextBuf := StringReplace(AItem.RtfTextBuf, #13#10, '',[rfReplaceAll]); - AItem := AItem.Next; - AEnter := true; - continue; - end - else - break; - end; - RtfControl: begin - case AItem.RtfMajor of - RtfSpecialChar: begin - case AItem.RtfMinor of - RtfPar: begin - if not APar then - begin - AItem := AItem.Next; - APar := true; - continue; - end - else - break; - end; - RtfParDef: begin - if not AParDef then - begin - AItem := AItem.Next; - AParDef := true; - continue; - end - else - break; - end; - end; - end; - end; - end; - end; - break; - end; - Result := AItem; -end; - -procedure TtiRtfParser.Parse(AItems: TRtfItem); -//Forward all stuff to the output list -var - i: integer; - AItem: TRtfItem; -begin - for i := 0 to AItems.Count - 1 do - begin - AItem := AItems[i]; - if AItem.RtfClass = RtfExpression then - ParseExpression(AItem) - else - AddToRtfItems(AItem); - end; -end; - -procedure TtiRtfParser.ParseExpression(AItem: TRtfItem); -var - i, ABackColor, AForeColor: integer; - ARemove: boolean; - ADataset: TRtfDataset; - AScanNoEof: boolean; - AExpression: string; - AResultValue: variant; - AResultParam: integer; - AResultToken: TRtfToken; - AArguments: TRtfArgument; - AAnswer, ATemp, AHeader, ARecord, AFooter: TRtfItem; -begin - AExpression := AItem.RtfTextBuf; - AAnswer := AddToRtfItems(AItem); - AAnswer.RtfTextBuf := ''; - - try - ARemove := true; - AArguments := TRtfArgument.Create(Self); - try - AArguments.ParseExpression(AExpression); - if AArguments.Count > 0 then - begin - //procedures and variables have no returning value and etNothing, well - ARemove := AArguments[0].Token in[etVariable, etProcedure, etNothing]; - if (AArguments[0].Token = etVariable) and (AArguments.Count = 1) then - ARemove := false; //But show a single variable - end; - if Assigned(OnEvalutate) then //debug - OnEvalutate(AArguments); - AArguments.Evaluate; - AResultToken := AArguments.Token; - AResultValue := AArguments.Value; - AResultParam := AArguments.Param; - if Assigned(OnEvalutate) then //debug - OnEvalutate(AArguments); - - case AItem.RtfMajor of - RtfNormalExpression: begin - if not ARemove then begin - //Expand booleans and date to text values (date because Variant - //have no typing for it. Place the text into the output rtf - if AResultToken = etLitTrue then - AAnswer.RtfTextBuf := BoolTrue - else if AResultToken = etLitFalse then - AAnswer.RtfTextBuf := BoolFalse - else if AResultToken = etLitDate then - begin - if Frac(AResultValue) = 0 then - AAnswer.RtfTextBuf := DateToStr(AResultValue) - else if Int(AResultValue) = 0 then - AAnswer.RtfTextBuf := TimeToStr(AResultValue) - else - AAnswer.RtfTextBuf := DateTimeToStr(AResultValue); - end - else - AAnswer.RtfTextBuf := VarToStr(AResultValue); - end; - end; - - RtfIfExpression: - begin - if AResultToken = etLitTrue then - Parse(AItem[0]) - else if(AResultToken = etLitFalse)and(AItem.Count > 1) then - Parse(AItem[1]); - end; - - RtfScan: - begin - //Scan(Dataset). Find out what items is header, record and footer - ARecord := nil; - AHeader := nil; - AFooter := nil; - ADataset := TRtfDataset(PtrInt(AResultValue)); //Dirty! - - for i := 0 to AItem.Count - 1 do begin - ATemp := AItem[i]; - case ATemp.RtfMajor of - RtfScan: AHeader := ATemp; - RtfScanEntry: ARecord := ATemp; - RtfScanFooter: AFooter := ATemp; - end; - end; - - if AHeader = ARecord - then AHeader := nil; - if ARecord = nil then begin - ARecord := AHeader; - AHeader := nil; - end; - - AScanNoEof := AResultParam = 1; - - //And evaluate the Scan(dataset) - ADataset.Open; - if Assigned(AHeader) - then Parse(AHeader); - ADataset.First; - - if AScanNoEof and ADataset.Eof - then exit; //Also no footer.. - - while not ADataset.Eof do begin - if Assigned(ARecord) - then Parse(ARecord); - ADataset.Next; - end; - if Assigned(AFooter) - then Parse(AFooter); - end; - end; - finally - AArguments.Free; - end; - - except - on e: Exception do begin - AForeColor := ColorList.UseColor(ErrorForeColor); - ABackColor := ColorList.UseColor(ErrorBackColor); - AAnswer.FRtfTextBuf := Format('{\b\ul\highlight%d\cf%d %s %s}',[ABackColor, AForeColor, AExpression, E.Message]); - end; - end; -end; - -procedure TtiRtfParser.AddFunctions; -begin - //Extra tokens not tokenized by RawParser - FFunctions.Add(etOr, 'Or', 0, 0, nil); - FFunctions.Add(etNot, 'Not', 0, 0, nil); - FFunctions.Add(etAnd, 'And', 0, 0, nil); - FFunctions.Add(etLitTrue, 'True', 0, 0, nil); - FFunctions.Add(etLitFalse, 'False', 0, 0, nil); - - //Date time functions/conversions - FFunctions.Add(etFunction, 'Year', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfYear); - FFunctions.Add(etFunction, 'Month', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfMonth); - FFunctions.Add(etFunction, 'Day', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfDay); - FFunctions.Add(etFunction, 'SYear', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfSYear); - FFunctions.Add(etFunction, 'SMonth', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfSMonth); - FFunctions.Add(etFunction, 'SDay', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfSDay); - FFunctions.Add(etFunction, 'Dtos', 1, 2, {$IFDEF FPC}@{$ENDIF}UdfDtos); - FFunctions.Add(etFunction, 'Stod', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStod); - FFunctions.Add(etFunction, 'DateToStr', 1, 2, {$IFDEF FPC}@{$ENDIF}UdfDateToStr); - FFunctions.Add(etFunction, 'TimeToStr', 1, 2, {$IFDEF FPC}@{$ENDIF}UdfTimeToStr); - FFunctions.Add(etFunction, 'DateTimeToStr', 1, 2, {$IFDEF FPC}@{$ENDIF}UdfDateTimeToStr); - FFunctions.Add(etFunction, 'StrToDate', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStrToDate); - FFunctions.Add(etFunction, 'StrToTime', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStrToTime); - FFunctions.Add(etFunction, 'StrToDateTime', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStrToDateTime); - FFunctions.Add(etFunction, 'ShortMonthName', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfShortMonthName); - FFunctions.Add(etFunction, 'ShortDayName', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfShortDayName); - FFunctions.Add(etFunction, 'LongMonthName', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfLongMonthName); - FFunctions.Add(etFunction, 'LongDayName', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfLongDayName); - - //String, int, float functions/conversions - FFunctions.Add(etFunction, 'Int', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfInt); - FFunctions.Add(etFunction, 'Chr', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfChr); - FFunctions.Add(etFunction, 'Iif', 3, 3, {$IFDEF FPC}@{$ENDIF}UdfIif); - FFunctions.Add(etFunction, 'Str', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStr); - FFunctions.Add(etFunction, 'Val', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfVal); - FFunctions.Add(etFunction, 'Nul', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfNul); - FFunctions.Add(etFunction, 'Now', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfNow); - FFunctions.Add(etFunction, 'Frac', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfFrac); - FFunctions.Add(etFunction, 'Padr', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfPadr); - FFunctions.Add(etFunction, 'Padl', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfPadl); - FFunctions.Add(etFunction, 'Date', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDate); - FFunctions.Add(etFunction, 'Time', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfTime); - FFunctions.Add(etFunction, 'Mid', 2, 3, {$IFDEF FPC}@{$ENDIF}UdfSubStr); - FFunctions.Add(etFunction, 'Copy', 2, 3, {$IFDEF FPC}@{$ENDIF}UdfSubStr); - FFunctions.Add(etFunction, 'SubStr', 2, 3, {$IFDEF FPC}@{$ENDIF}UdfSubStr); - FFunctions.Add(etFunction, 'Trunc', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfTrunc); - FFunctions.Add(etFunction, 'Round', 1, 2, {$IFDEF FPC}@{$ENDIF}UdfRound); - FFunctions.Add(etFunction, 'Upper', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfUpper); - FFunctions.Add(etFunction, 'Lower', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfLower); - FFunctions.Add(etFunction, 'Trim', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfTrim); - FFunctions.Add(etFunction, 'Empty', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfEmpty); - FFunctions.Add(etFunction, 'TrimLeft', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfTrimLeft); - FFunctions.Add(etFunction, 'TrimRight', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfTrimRight); - FFunctions.Add(etFunction, 'IntToStr', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfIntToStr); - FFunctions.Add(etFunction, 'StrToInt', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStrToInt); - FFunctions.Add(etFunction, 'FloatToStr', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfFloatToStr); - FFunctions.Add(etFunction, 'StrToFloat', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfStrToFloat); - FFunctions.Add(etFunction, 'Power', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfIntPower); - FFunctions.Add(etFunction, 'IntPower', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfIntPower); - FFunctions.Add(etFunction, 'FormatFloat', 2, 2, {$IFDEF FPC}@{$ENDIF}UdfFormatFloat); - FFunctions.Add(etFunction, 'FBool', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfFbool); - - //Dataset - FFunctions.Add(etFunction, 'Bof', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfBof); - FFunctions.Add(etFunction, 'Eof', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfEof); - FFunctions.Add(etProcedure, 'Next', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfNext); - FFunctions.Add(etProcedure, 'Prev', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfPrior); - FFunctions.Add(etProcedure, 'Open', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfOpen); - FFunctions.Add(etProcedure, 'First', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfFirst); - FFunctions.Add(etProcedure, 'Last', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfLast); - FFunctions.Add(etFunction, 'IsEmpty', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfIsEmpty); - FFunctions.Add(etFunction, 'RecordCount', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfRecordCount); - FFunctions.Add(etProcedure, 'Scan', 1, 9999, {$IFDEF FPC}@{$ENDIF}UdfScan); - FFunctions.Add(etProcedure, 'EndScan', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etProcedure, 'ScanEntry', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etProcedure, 'ScanFooter', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etProcedure, 'Dataset', 3, 9999, {$IFDEF FPC}@{$ENDIF}UdfDataset); - - //Misc routines - FFunctions.Add(etProcedure, 'If', 1, 9999, {$IFDEF FPC}@{$ENDIF}UdfIf); - FFunctions.Add(etProcedure, 'Else', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etProcedure, 'Endif', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etProcedure, 'NoPar', 0, 0, {$IFDEF FPC}@{$ENDIF}UdfDummy); - FFunctions.Add(etFunction, 'Picture', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfPicture); - FFunctions.Add(etFunction, 'DbPicture', 1, 1, {$IFDEF FPC}@{$ENDIF}UdfDbPicture); -end; - -procedure TtiRtfParser.UdfDummy(AArgument: TRtfArgument); -begin - //Nothing, since its an etProcedure the Rtf paragraph will be removed -end; - -procedure TtiRtfParser.UdfChr(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitInt]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := Chr(StrToInt(AArgument[0].Value)); - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfNow(AArgument: TRtfArgument); -begin - AArgument.Value := Now; - AArgument.Token := etLitDate; -end; - -procedure TtiRtfParser.UdfDate(AArgument: TRtfArgument); -begin - AArgument.Value := Date; - AArgument.Token := etLitDate; -end; - -procedure TtiRtfParser.UdfTime(AArgument: TRtfArgument); -begin - AArgument.Value := Time; - AArgument.Token := etLitDate; -end; - -procedure TtiRtfParser.UdfIntToStr(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitInt]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := IntToStr(AArgument[0].Value); - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfStrToInt(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := StrToInt(AArgument[0].Value); - AArgument.Token := etLitInt; -end; - -procedure TtiRtfParser.UdfFloatToStr(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFloat]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := FloatToStr(Extended(AArgument[0].Value)); - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfStrToFloat(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := StrToFloat(AArgument[0].Value); - AArgument.Token := etLitFloat; -end; - -procedure TtiRtfParser.UdfNul(AArgument: TRtfArgument); -var AStr: string; - ACnt: integer; -begin - if not AArgument.Check([[etLitInt],[etLitInt]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AStr := AArgument[0].Value; - ACnt := AArgument[1].Value; - while Length(AStr) < ACnt do AStr := '0' + AStr; - while Length(AStr) > ACnt do Delete(AStr, 1, 1); - AArgument.Value := AStr; - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfPadl(AArgument: TRtfArgument); -var AStr: string; - ACnt: integer; -begin - if not AArgument.Check([[etLitString],[etLitInt]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AStr := AArgument[0].Value; - ACnt := AArgument[1].Value; - AStr := Copy(AStr, 1, ACnt); - while Length(AStr) < ACnt do begin - AStr := ' ' + AStr; - end; - AArgument.Value := AStr; - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfPadr(AArgument: TRtfArgument); -var AStr: string; - ACnt: integer; -begin - if not AArgument.Check([[etLitString],[etLitInt]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AStr := AArgument[0].Value; - ACnt := AArgument[1].Value; - AStr := Copy(AStr, 1, ACnt); - while Length(AStr) < ACnt do begin - AStr := AStr + ' '; - end; - AArgument.Value := AStr; - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfIif(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFalse, etLitTrue]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitTrue then begin - AArgument.Value := AArgument[1].Value; - AArgument.Token := AArgument[1].Token; - end else begin - AArgument.Value := AArgument[2].Value; - AArgument.Token := AArgument[2].Token; - end; -end; - -procedure TtiRtfParser.UdfIf(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFalse, etLitTrue]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := AArgument[0].Value; - AArgument.Token := AArgument[0].Token; -end; - -procedure TtiRtfParser.UdfScan(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Value := AArgument[0].Value; - AArgument.Token := AArgument[0].Token; - if AArgument.Count > 1 then begin - if AArgument[1].Token = etLitTrue - then AArgument.Param := 1; - end; -end; - -procedure TtiRtfParser.UdfDataset(AArgument: TRtfArgument); -var ADatabase, AAliasName, ASqlScript: string; - ADataset: TRtfDataset; - AObject: TObject; -begin - if not AArgument.Check([[etLitString],[etLitString],[etLitString]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - - ADatabase := AArgument[0].Value; - AAliasName := AArgument[1].Value; - ASqlScript := AArgument[2].Value; - - //Delete first argument so Sql params become first - AArgument.Delete(0); - AArgument.Delete(0); - AArgument.Delete(0); - - //Remove existing dataset with same aliasname - ADataset := Datasets.Find(AAliasName); - if Assigned(ADataset) - then Datasets.Remove(ADataset); - - //Create the new query or dataset (whatever) - if Assigned(OnCreateDataset) - then OnCreateDataset(ADatabase, AAliasName, ASqlScript, AArgument) - else raise TRtfException.Create('OnCreateDataset is not assigned'); - if VarIsEmpty(AArgument.Value) - then raise TRtfException.Create('OnCreateDataset did not return a dataset object'); - - AObject := TObject(Ptrint(AArgument.Value)); - ADataset := Datasets.Add(AObject, AAliasname, true); - AArgument.Token := etDataset; - AArgument.Value := PtrInt(ADataset); -end; - -procedure TtiRtfParser.UdfLower(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := LowerCase(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfUpper(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := UpperCase(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfTrim(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := Trim(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfTrimLeft(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := TrimLeft(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfTrimRight(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := TrimRight(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfSubStr(AArgument: TRtfArgument); -var AStr: string; - APos, ACnt: integer; -begin - ACnt := Maxint; - if not AArgument.Check([[etLitString],[etLitInt]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument.Count > 2 then begin - if not AArgument.Check(2,[etLitInt]) then - raise TRtfException.Create(rsUnexpectedParameterType); - ACnt := AArgument[2].Value; - end; - AStr := AArgument[0].Value; - APos := AArgument[1].Value; - AStr := Copy(AStr, APos, ACnt); - AArgument.Value := AStr; - AArgument.Token := etLitString; -end; - -procedure TtiRtfParser.UdfStr(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFloat, etLitInt]) then - raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitFloat then - begin - AArgument.Token := etLitString; - AArgument.Value := FloatToStr(AArgument[0].Value); - end - else - begin - AArgument.Token := etLitString; - AArgument.Value := IntToStr(AArgument[0].Value); - end; -end; - -procedure TtiRtfParser.UdfVal(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) then - raise TRtfException.Create(rsUnexpectedParameterType); - if (Pos('.', AArgument[0].Value) > 0)or(Pos(',', AArgument[0].Value) > 0) then - begin - AArgument.Token := etLitString; - AArgument.Value := StrToFloat(AArgument[0].Value) - end - else - begin - AArgument.Token := etLitString; - AArgument.Value := StrToInt(AArgument[0].Value) - end; -end; - -procedure TtiRtfParser.UdfBof(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) then - raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - if ATable.Bof then - begin - AArgument.Token := etLitTrue; - AArgument.Value := true; - end - else - begin - AArgument.Token := etLitFalse; - AArgument.Value := false; - end; -end; - -procedure TtiRtfParser.UdfEof(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) then - raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - if ATable.Eof then - begin - AArgument.Token := etLitTrue; - AArgument.Value := true; - end - else - begin - AArgument.Token := etLitFalse; - AArgument.Value := false; - end; -end; - - -procedure TtiRtfParser.UdfRecordCount(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - AArgument.Token := etLitInt; - AArgument.Value := ATable.RecordCount -end; - -procedure TtiRtfParser.UdfIsEmpty(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - if ATable.IsEmpty then begin - AArgument.Token := etLitTrue; - AArgument.Value := true; - end else begin - AArgument.Token := etLitFalse; - AArgument.Value := false; - end; -end; - -procedure TtiRtfParser.UdfFirst(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - ATable.First; -end; - -procedure TtiRtfParser.UdfLast(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - ATable.Last; -end; - -procedure TtiRtfParser.UdfNext(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - ATable.Next; -end; - -procedure TtiRtfParser.UdfOpen(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - ATable.Open; -end; - -procedure TtiRtfParser.UdfPrior(AArgument: TRtfArgument); -var ATable: TRtfDataset; -begin - if not AArgument.Check(0,[etDataset]) - then raise TRtfException.Create(rsUnexpectedParameterType); - ATable := TRtfDataset(Ptrint(AArgument[0].Value)); - ATable.Prior; -end; - -procedure TtiRtfParser.UdfInt(AArgument: TRtfArgument); -//Returns the integer part of a float -begin - if not AArgument.Check(0,[etLitFloat, etLitInt]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitFloat then begin - AArgument.Token := etLitFloat; - AArgument.Value := Int(AArgument[0].Value); - end else begin - AArgument.Token := etLitInt; - AArgument.Value := AArgument[0].Value; - end; -end; - -procedure TtiRtfParser.UdfFrac(AArgument: TRtfArgument); -//Returns the fractional part of a float -begin - if not AArgument.Check(0,[etLitFloat, etLitInt]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitFloat then begin - AArgument.Token := etLitFloat; - AArgument.Value := Frac(AArgument[0].Value); - end else begin - AArgument.Token := etLitInt; - AArgument.Value := 0; - end; -end; - -procedure TtiRtfParser.UdfRound(AArgument: TRtfArgument); -//0.5 is always rounded to largest integer number -var - ASign, ADecimals, AInt: integer; - AFloat, APower, AFrac: Double; -begin - ADecimals := 0; - if not AArgument.Check(0,[etLitFloat, etLitInt]) then - raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument.Count > 1 then - begin - if not AArgument.Check(1,[etLitInt]) then - raise TRtfException.Create(rsUnexpectedParameterType); - ADecimals := AArgument[1].Value; - end; - - if AArgument[0].Token = etLitFloat then - begin - AFloat := AArgument[0].Value; - - ASign := 1; - if AFloat < 0 then - begin - AFloat := - AFloat; - ASign := - 1; - end; - - if ADecimals = 0 then - begin - AInt := Trunc(AFloat); //integer part - AFrac := AFloat - AInt; //fractional part - if AFrac >= 0.5 then - AArgument.Value := ASign *(AInt + 1) - else - AArgument.Value := ASign * AInt; - AArgument.Token := etLitFloat; - end - else - begin - APower := IntPower(10, ADecimals); - AInt := Trunc(AFloat * APower); //integer part * 10^ADecimals - AFrac := AFloat * APower - AInt; //fractional part - if AFrac >= 0.5 then - AArgument.Value := ASign * IntPower(10, - ADecimals) *(AInt + 1) - else - AArgument.Value := ASign * IntPower(10, - ADecimals) * AInt; - AArgument.Token := etLitFloat; - end; - end - else - begin - AArgument.Token := etLitInt; - AArgument.Value := AArgument[0].Value; - end; -end; - -procedure TtiRtfParser.UdfTrunc(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFloat, etLitInt]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitFloat then begin - AArgument.Token := etLitFloat; - AArgument.Value := Trunc(AArgument[0].Value); - end else begin - AArgument.Token := etLitInt; - AArgument.Value := AArgument[0].Value; - end; -end; - -procedure TtiRtfParser.UdfIntPower(AArgument: TRtfArgument); -var AFloat: Double; - AExponent: integer; -begin - if not AArgument.Check([[etLitInt, etLitFloat],[etLitInt]]) then - raise TRtfException.Create(rsUnexpectedParameterType); - AFloat := AArgument[0].Value; - AExponent := AArgument[1].Value; - AArgument.Token := etLitFloat; - AArgument.Value := IntPower(AFloat, AExponent); -end; - -procedure TtiRtfParser.UdfPower(AArgument: TRtfArgument); -var AFloat, AExponent: Double; -begin - if not AArgument.Check([[etLitInt, etLitFloat],[etLitInt, etLitFloat]]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AFloat := AArgument[0].Value; - AExponent := AArgument[1].Value; - AArgument.Token := etLitFloat; - AArgument.Value := Pwr(AFloat, AExponent); -end; - -procedure TtiRtfParser.UdfEmpty(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - if Trim(AArgument[0].Value) = '' then begin - AArgument.Token := etLitTrue; - AArgument.Value := true; - end else begin - AArgument.Token := etLitFalse; - AArgument.Value := false; - end; -end; - -procedure TtiRtfParser.UdfDay(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitInt; - AArgument.Value := ADay; -end; - -procedure TtiRtfParser.UdfMonth(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitInt; - AArgument.Value := AMonth; -end; - -procedure TtiRtfParser.UdfYear(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitInt; - AArgument.Value := AYear; -end; - -procedure TtiRtfParser.UdfShortDayName(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := ShortDayNames[ADay]; -end; - -procedure TtiRtfParser.UdfShortMonthName(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := ShortMonthNames[AMonth]; -end; - -procedure TtiRtfParser.UdfLongDayName(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := LongMonthNames[AMonth]; -end; - -procedure TtiRtfParser.UdfLongMonthName(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := LongMonthNames[AMonth]; -end; - -procedure TtiRtfParser.UdfSDay(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := Format('%0.2d',[ADay]); -end; - -procedure TtiRtfParser.UdfSMonth(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := Format('%0.2d',[AMonth]); -end; - -procedure TtiRtfParser.UdfSYear(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; -begin - if not AArgument.Check(0,[etLitDate]) - then raise TRtfException.Create(rsUnexpectedParameterType); - DecodeDate(AArgument[0].Value, AYear, AMonth, ADay); - AArgument.Token := etLitString; - AArgument.Value := Format('%0.4d',[AYear]); -end; - -procedure TtiRtfParser.UdfStod(AArgument: TRtfArgument); -var AYear, AMonth, ADay: word; - AStr: string; -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AStr := AArgument[0].Value; - AYear := StrToInt(Copy(AStr, 1, 4)); - AMonth := StrToInt(Copy(AStr, 5, 2)); - ADay := StrToInt(Copy(AStr, 7, 2)); - AArgument.Token := etLitDate; - AArgument.Value := EncodeDate(AYear, AMonth, ADay); -end; - -procedure TtiRtfParser.UdfDateTimeTo(AArgument: TRtfArgument; AFormat: string); -begin - if not AArgument.Check(0,[etLitDate]) then - raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument.Count > 1 then - begin - if not AArgument.Check(1,[etLitString]) then - raise TRtfException.Create(rsUnexpectedParameterType); - AFormat := AArgument[1].Value; - end; - AArgument.Token := etLitString; - AArgument.Value := FormatDateTime(AFormat, AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfDtoS(AArgument: TRtfArgument); -begin - UdfDateTimeTo(AArgument, 'YYYYMMDD'); -end; - -procedure TtiRtfParser.UdfDateToStr(AArgument: TRtfArgument); -begin - UdfDateTimeTo(AArgument, ShortDateFormat); -end; - -procedure TtiRtfParser.UdfTimeToStr(AArgument: TRtfArgument); -begin - UdfDateTimeTo(AArgument, ShortTimeFormat); -end; - -procedure TtiRtfParser.UdfDateTimeToStr(AArgument: TRtfArgument); -begin - UdfDateTimeTo(AArgument, ShortDateFormat + ' ' + ShortTimeFormat); -end; - -procedure TtiRtfParser.UdfStrToDate(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) then - raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := StrToDate(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfStrToTime(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := StrToTime(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfStrToDateTime(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - AArgument.Token := etLitString; - AArgument.Value := StrToDateTime(AArgument[0].Value); -end; - -procedure TtiRtfParser.UdfFormatFloat(AArgument: TRtfArgument); -var AFormat: string; - AFloat: Double; -begin - if not AArgument.Check([[etLitString],[etLitFloat, etLitInt]]) then - raise TRtfException.Create(rsUnexpectedParameterType); - AFormat := AArgument[0].Value; - AFloat := AArgument[1].Value; - AArgument.Token := etLitString; - AArgument.Value := FormatFloat(AFormat, AFloat); -end; - -procedure TtiRtfParser.UdfFBool(AArgument: TRtfArgument); -begin - if not AArgument.Check(0,[etLitFalse, etLitTrue]) then - raise TRtfException.Create(rsUnexpectedParameterType); - if AArgument[0].Token = etLitFalse then - begin - AArgument.Token := etLitString; - AArgument.Value := BoolFalse; - end else begin - AArgument.Token := etLitString; - AArgument.Value := BoolTrue; - end; -end; - -procedure TtiRtfParser.UdfPicture(AArgument: TRtfArgument); -{ -var - APicture: TPicture; - AFilename: string; -} -begin -(* - if not AArgument.Check(0,[etLitString]) - then raise TRtfException.Create(rsUnexpectedParameterType); - APicture := TPicture.Create; - try - AFilename := AArgument[0].Value; - if Assigned(OnPicturePath) - then OnPicturePath(AFilename); - - APicture.LoadFromFile(AFilename); - if not Assigned(APicture.Graphic)or APicture.Graphic.Empty then begin - AArgument.Token := etNothing; - AArgument.Value := varEmpty; - end else begin - AArgument.Value := AArgument.GetPicture(APicture); - AArgument.Token := etLitString; - end; - finally - APicture.Free; - end; - *) -end; - -procedure TtiRtfParser.UdfDbPicture(AArgument: TRtfArgument); -//Since a simple blob (not ftGraphic field) can contain an image -//It has become kind of a typecast for a dataset field. -var ADataset: TRtfDataset; - AFieldName: string; -begin - if not AArgument.Check(0,[etFieldName]) then - raise TRtfException.Create(rsUnexpectedParameterType); - ADataset := Datasets.Find(AArgument[0].Value, AFieldName); - if not Assigned(ADataset) then //There should be at least a table reference. - raise TRtfException.Create('Dataset not found'); - AArgument.GetGraphicsValue(ADataset, AFieldName); -end; - -end. - diff --git a/extras/tiopf/mvp/basic_impl.pas b/extras/tiopf/mvp/basic_impl.pas deleted file mode 100644 index 8ce4b80b..00000000 --- a/extras/tiopf/mvp/basic_impl.pas +++ /dev/null @@ -1,720 +0,0 @@ -unit basic_impl; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, basic_intf; - -type - - TSubject = class(TInterfacedObject, ISubject) - private - fController: Pointer; - fObservers: IInterfaceList; - fUpdateCount: integer; - function GetController: IInterface; - procedure Attach(Observer: IObserver); - procedure Detach(Observer: IObserver); - procedure Notify; - procedure BeginUpdate; - procedure EndUpdate; - public - constructor Create(const Controller: IInterface); - end; - - - TString = class(TInterfacedObject, IString, IVisited) - private - fString: string; - // IString - function GetAsString: string; - procedure SetAsString(const AValue: string); - // IVisited - procedure Accept(const Visitor: IVisitor); - end; - - - TStringSelection = class(TInterfacedObject, ISelection, IVisited) - private - fModel: IStringListModel; - fItems: IInterfaceList; - // ISelection - procedure AddItem(const Item: IInterface); - procedure Clear; - function GetCount: integer; - procedure RemoveItem(const Item: IInterface); - procedure SelectModel; - // IVisited - procedure Accept(const Visitor: IVisitor); - public - constructor Create(const Model: IStringListModel); virtual; - end; - - - TCommand = class(TInterfacedObject, ICommand, IVisited) - private - fEnabled: Boolean; - fSelection: ISelection; - procedure BindSelection(const Selection: ISelection); - function GetEnabled: Boolean; - protected - property Selection: ISelection read fSelection; - // IVisited - procedure Accept(const Visitor: IVisitor); virtual; - // ICommand - function Execute: Boolean; virtual; abstract; - function GetText: string; virtual; abstract; - public - constructor Create(Enabled: Boolean); virtual; - end; - - - TCommandSet = class(TInterfacedObject, ICommandSet, IObserver, ISubject, IVisited) - private - fItems: IInterfaceList; - fSubject: ISubject; - function GetCount: integer; - // IVisited - procedure Accept(const Visitor: IVisitor); - protected - property Count: integer read GetCount; - property Items: IInterfaceList read fItems; - // IObserver - procedure Update(const ASubject: IInterface); virtual; - // ISubject - property Subject: ISubject read fSubject implements ISubject; - public - constructor Create; virtual; - end; - - - TMVPModel = class(TInterfacedObject, IMVPModel, ISubject) - private - fCommandSet: ICommandSet; - fCurrentSelection: ISelection; - fSubject: ISubject; - // IMVPModel - function GetCommandSet: ICommandSet; - function GetCurrentSelection: ISelection; - protected - property CommandSet: ICommandSet read GetCommandSet; - property CurrentSelection: ISelection read GetCurrentSelection; - // 3 methods to be called by the constructor - procedure BindSelection; virtual; - procedure CreateCommandSet(var ACommandSet: ICommandSet); virtual; abstract; - procedure CreateSelection(var ASelection: ISelection); virtual; abstract; - // ISubject - property Subject: ISubject read fSubject implements ISubject; - public - constructor Create; virtual; - destructor Destroy; override; - end; - - - TListModel = class(TMVPModel, IListModel) - private - fItems: IInterfaceList; - protected - property Items: IInterfaceList read fItems; - // IListModel - function GetCount: Integer; virtual; - function GetItem(Idx: Integer): IInterface; virtual; - procedure Add(const Item: IInterface); virtual; - procedure Clear; virtual; - function IndexOf(const Item: IInterface): Integer; virtual; - procedure Insert(const Item, Before: IInterface); virtual; - procedure Move(const Item, Before: IInterface); virtual; - procedure Remove(const Item: IInterface); virtual; - public - destructor Destroy; override; - end; - - - TStringListModel = class(TListModel, IStringListModel, IVisited) - private - // IStringListModel - function IStringListModel.GetItem = StringListModelGetItem; - function StringListModelGetItem(Idx: Integer): IString; - // IVisited - procedure Accept(const Visitor: IVisitor); virtual; - protected - // IMVPModel - procedure CreateCommandSet(var ACommandSet: ICommandSet); override; - procedure CreateSelection(var ASelection: ISelection); override; - public - destructor Destroy; override; - end; - - - TStringModelCommandSet = class(TCommandSet) - protected - // IObserver - procedure Update(const ASubject: IInterface); override; - public - destructor Destroy; override; - end; - - - TStringVisitor = class(TInterfacedObject, IStringVisitor) - private - fTheString: IString; - protected - // IStringVisitor - function GetTheString: IString; virtual; - procedure VisitString(const Str: IString); virtual; - end; - - - TStringMoveVisitor = class(TStringVisitor, IStringMoveVisitor) - private - fCanDemote: Boolean; - fCanPromote: Boolean; - fModel: IStringListModel; - function GetCanDemote: Boolean; - function GetCanPromote: Boolean; - protected - procedure VisitString(const Str: IString); override; - public - constructor Create(const Model: IStringListModel); virtual; - end; - - - TPromoteStringCommand = class(TCommand) - private - fModel: Pointer; - function GetModel: IStringListModel; - protected - function Execute: Boolean; override; - function GetText: string; override; - public - constructor Create(Enabled: Boolean; const Model: IStringListModel); reintroduce; virtual; - end; - - - TDemoteStringCommand = class(TCommand) - private - fModel: Pointer; - function GetModel: IStringListModel; - protected - function Execute: Boolean; override; - function GetText: string; override; - public - constructor Create(Enabled: Boolean; const Model: IStringListModel); reintroduce; virtual; - end; - - - -implementation - -uses - Math; - -{ TSubject } - -function TSubject.GetController: IInterface; -begin - Result := IInterface(fController); -end; - -procedure TSubject.Attach(Observer: IObserver); -begin - if fObservers = nil then - fObservers := TInterfaceList.Create; - if fObservers.IndexOf(Observer) < 0 then - fObservers.Add(Observer); -end; - -procedure TSubject.Detach(Observer: IObserver); -begin - if fObservers <> nil then - begin - if fObservers.IndexOf(Observer) >= 0 then - fObservers.Remove(Observer); - if fObservers.Count = 0 then - fObservers := nil; - end; -end; - -procedure TSubject.Notify; -var - i: integer; -begin - if fObservers <> nil then - for i := 0 to fObservers.Count-1 do - (fObservers[i] as IObserver).Update(GetController); -end; - -procedure TSubject.BeginUpdate; -begin - Inc(fUpdateCount); -end; - -procedure TSubject.EndUpdate; -begin - Dec(fUpdateCount); - if fUpdateCount = 0 then - Notify; -end; - -constructor TSubject.Create(const Controller: IInterface); -begin - inherited Create; - fController := Pointer(Controller); -end; - -{ TListModel } - -function TListModel.GetCount: Integer; -begin - Result := fItems.Count; -end; - -function TListModel.GetItem(Idx: Integer): IInterface; -begin - Result := fItems[Idx]; -end; - -procedure TListModel.Add(const Item: IInterface); -begin - Subject.BeginUpdate; - if fItems = nil then - fItems := TInterfaceList.Create; -// fItems.Add(Item as IInterface); - fItems.Add(Item); - Subject.EndUpdate; -end; - -procedure TListModel.Clear; -begin - Subject.BeginUpdate; - fItems.Clear; - Subject.EndUpdate; -end; - -function TListModel.IndexOf(const Item: IInterface): Integer; -begin - if fItems <> nil then -// Result := fItems.IndexOf(Item as IInterface) - Result := fItems.IndexOf(Item) - else - Result := -1; -end; - -procedure TListModel.Insert(const Item, Before: IInterface); -var - InsertIdx: integer; -begin - if fItems = nil then - fItems := TInterfaceList.Create; - if fItems.IndexOf(Item) < 0 then - begin - Subject.BeginUpdate; - InsertIdx := fItems.IndexOf(Before); - if InsertIdx < 0 then - InsertIdx := 0; - fItems.Insert(InsertIdx, Item); - Subject.EndUpdate; - end; -end; - -procedure TListModel.Move(const Item, Before: IInterface); -var - IdxItem: integer; - IdxBefore: integer; - MoveItem: IInterface; -begin - if fItems <> nil then - begin - IdxItem := fItems.IndexOf(Item); - if IdxItem >= 0 then - begin - Subject.BeginUpdate; - MoveItem := fItems[IdxItem]; - fItems.Delete(IdxItem); - IdxBefore := fItems.IndexOf(Before); - if IdxBefore >0 then - fItems.Insert(IdxBefore, MoveItem); - Subject.EndUpdate; - end; - end; { if } -end; - -procedure TListModel.Remove(const Item: IInterface); -begin - if fItems <> nil then - begin - Subject.BeginUpdate; - fItems.Remove(Item); - Subject.EndUpdate; - end; -end; - -destructor TListModel.Destroy; -begin - inherited Destroy; -end; - -{ TString } - -function TString.GetAsString: string; -begin - -end; - -procedure TString.SetAsString(const AValue: string); -begin - -end; - -procedure TString.Accept(const Visitor: IVisitor); -begin - -end; - -{ TStringListModel } - -function TStringListModel.StringListModelGetItem(Idx: Integer): IString; -begin - Result := Items[Idx] as IString; -end; - -procedure TStringListModel.Accept(const Visitor: IVisitor); -begin - -end; - -procedure TStringListModel.CreateCommandSet(var ACommandSet: ICommandSet); -begin - -end; - -procedure TStringListModel.CreateSelection(var ASelection: ISelection); -begin - -end; - -destructor TStringListModel.Destroy; -begin - inherited Destroy; -end; - -{ TStringSelection } - -procedure TStringSelection.AddItem(const Item: IInterface); -begin - if fItems = nil then - fItems := TInterfaceList.Create; - if fItems.IndexOf(Item) < 0 then - fItems.Add(Item); -end; - -procedure TStringSelection.Clear; -begin - -end; - -function TStringSelection.GetCount: integer; -begin - Result := fItems.Count; -end; - -procedure TStringSelection.RemoveItem(const Item: IInterface); -begin - if fItems <> nil then - begin - if fItems.IndexOf(Item) >= 0 then - fItems.Remove(Item); - if fItems.Count = 0 then - fItems := nil; - end; -end; - -procedure TStringSelection.SelectModel; -var - i: integer; -begin - for i := 0 to (fModel as IListModel).Count-1 do - fItems.Add(fModel.Item[i]); -end; - -procedure TStringSelection.Accept(const Visitor: IVisitor); -var - i: integer; -begin - for i := 0 to fItems.Count-1 do - (fItems[i] as IVisited).Accept(Visitor); -end; - -constructor TStringSelection.Create(const Model: IStringListModel); -begin - inherited Create; - fModel := Model; -end; - -{ TCommand } - -procedure TCommand.BindSelection(const Selection: ISelection); -begin - fSelection := Selection; -end; - -function TCommand.GetEnabled: Boolean; -begin - Result := fEnabled; -end; - -procedure TCommand.Accept(const Visitor: IVisitor); -begin - (Visitor as ICommandVisitor).VisitComand(self); -end; - -constructor TCommand.Create(Enabled: Boolean); -begin - inherited Create; - fEnabled := Enabled; -end; - -{ TCommandSet } - -function TCommandSet.GetCount: integer; -begin - if fItems <> nil then - Result := fItems.Count - else - Result := 0; -end; - -procedure TCommandSet.Accept(const Visitor: IVisitor); -var - i: integer; -begin - for i := 0 to fItems.Count-1 do - (fItems[i] as IVisited).Accept(Visitor); -end; - -procedure TCommandSet.Update(const ASubject: IInterface); -begin - // do nothing yet -end; - -constructor TCommandSet.Create; -begin - inherited Create; - fItems := TInterfaceList.Create; -end; - -{ TMVPModel } - -function TMVPModel.GetCommandSet: ICommandSet; -begin - Result := fCommandSet; -end; - -function TMVPModel.GetCurrentSelection: ISelection; -begin - Result := fCurrentSelection; -end; - -procedure TMVPModel.BindSelection; -begin - (fCurrentSelection as ISubject).Attach(fCommandSet as IObserver); -end; - -constructor TMVPModel.Create; -begin - inherited Create; - fSubject := TSubject.Create(self); - CreateSelection(fCurrentSelection); - CreateCommandSet(fCommandSet); - BindSelection; -end; - -destructor TMVPModel.Destroy; -begin - inherited Destroy; -end; - -{ TStringModelCommandSet } - -procedure TStringModelCommandSet.Update(const ASubject: IInterface); -var - ObjSelection: ISelection; - ObjVisited: IVisited; - ObjModel: IStringListModel; - Visitor: IStringMoveVisitor; - Command: ICommand; -begin - ASubject.QueryInterface(ISelection, ObjSelection); - if ObjSelection <> nil then - begin - Items.Clear; - // We are only interested in a single selection. We don't have a - // mechanism for multi-select yet. - if ObjSelection.Count = 1 then - begin - ObjSelection.QueryInterface(IVisited, ObjVisited); - if ObjVisited <> nil then - begin - ObjVisited.QueryInterface(IStringListModel, ObjModel); - if ObjModel <> nil then - begin - Visitor := TStringMoveVisitor.Create(ObjModel); - ObjVisited.Accept(Visitor); - // This will only give commands that are applicable. So in a Menu the - // available items will keep changing. -{ - if Visitor.CanPromote then - begin - Command := TPromoteStringCommand.Create(True, ObjModel); - Command.BindSelection(ObjSelection); - Items.Add(Command); - end; - if Visitor.CanDemote then - begin - Command := TDemoteStringCommand.Create(True, ObjModel); - Command.BindSelection(ObjSelection); - Items.Add(Command); - end; -} - - // In this case it will return all commands, but only the applicable - // ones will be Enabled. I like this idea more. - Command := TPromoteStringCommand.Create(Visitor.CanPromote, ObjModel); - Command.BindSelection(ObjSelection); - Items.Add(Command); - - Command := TDemoteStringCommand.Create(Visitor.CanDemote, ObjModel); - Command.BindSelection(ObjSelection); - Items.Add(Command); - end; - end; - end; - Subject.Notify; - end; -end; - -destructor TStringModelCommandSet.Destroy; -begin - inherited Destroy; -end; - -{ TStringVisitor } - -function TStringVisitor.GetTheString: IString; -begin - Result := fTheString; -end; - -procedure TStringVisitor.VisitString(const Str: IString); -begin - fTheString := Str; -end; - -{ TStringMoveVisitor } - -function TStringMoveVisitor.GetCanDemote: Boolean; -begin - Result := fCanDemote; -end; - -function TStringMoveVisitor.GetCanPromote: Boolean; -begin - Result := fCanPromote; -end; - -procedure TStringMoveVisitor.VisitString(const Str: IString); -begin - inherited VisitString(Str); - fCanPromote := fModel.IndexOf(Str) > 0; - fCanDemote := fModel.IndexOf(Str) < (fModel.Count - 1) -end; - -constructor TStringMoveVisitor.Create(const Model: IStringListModel); -begin - inherited Create; - fModel := Model; -end; - - -{ TPromoteStringCommand } - -function TPromoteStringCommand.GetModel: IStringListModel; -begin - Result := IStringListModel(fModel); -end; - -function TPromoteStringCommand.Execute: Boolean; -var - Visitor: IStringVisitor; - BeforeIdx: Integer; -begin - Visitor := TStringVisitor.Create; - try - (Selection as IVisited).Accept(Visitor); - BeforeIdx := Max(GetModel.IndexOf(Visitor.TheString) - 1, 0); - GetModel.Move(Visitor.TheString, GetModel.Item[BeforeIdx]); - Result := True; - except - Result := False; - end; -end; - -function TPromoteStringCommand.GetText: string; -begin - Result := 'Promote String'; -end; - -constructor TPromoteStringCommand.Create(Enabled: Boolean; - const Model: IStringListModel); -begin - inherited Create(Enabled); - fModel := Pointer(Model); -end; - -{ TDemoteStringCommand } - -function TDemoteStringCommand.GetModel: IStringListModel; -begin - Result := IStringListModel(fModel); -end; - -function TDemoteStringCommand.Execute: Boolean; -var - Visitor: IStringVisitor; - BeforeIdx: Integer; -begin - Visitor := TStringVisitor.Create; - try - (Selection as IVisited).Accept(Visitor); - BeforeIdx := GetModel.IndexOf(Visitor.TheString) + 2; - if BeforeIdx > GetModel.Count - 1 then - begin - (GetModel as ISubject).BeginUpdate; - GetModel.Remove(Visitor.TheString); - GetModel.Add(Visitor.TheString); - (GetModel as ISubject).EndUpdate; - end - else - GetModel.Move(Visitor.TheString, GetModel.Item[BeforeIdx]); - Result := True; - except - Result := False; - end; -end; - -function TDemoteStringCommand.GetText: string; -begin - Result := 'Demote String'; -end; - -constructor TDemoteStringCommand.Create(Enabled: Boolean; - const Model: IStringListModel); -begin - inherited Create(Enabled); - fModel := Pointer(Model); -end; - -end. - diff --git a/extras/tiopf/mvp/basic_intf.pas b/extras/tiopf/mvp/basic_intf.pas deleted file mode 100644 index a569db9a..00000000 --- a/extras/tiopf/mvp/basic_intf.pas +++ /dev/null @@ -1,205 +0,0 @@ -unit basic_intf; - -{$mode objfpc}{$H+} - -interface - -type - // forward declarations - ISubject = interface; - IMVPView = interface; - ICommandMenuItem = interface; - IString = interface; - - - // event types - TSelectStringEvent = procedure(const AString: IString) of object; - - - IObserver = interface(IInterface) - ['{16CD208B-5F37-41FC-82A4-BFDD16DB3203}'] - procedure Update(const ASubject: IInterface); - end; - - - ISubject = interface(IInterface) - ['{004B3299-C221-4A44-87A7-7657D90B6493}'] - procedure Attach(Observer: IObserver); - procedure Detach(Observer: IObserver); - procedure Notify; - procedure BeginUpdate; - procedure EndUpdate; - end; - - - IVisitor = interface(IInterface) - ['{35E154D2-6573-42DA-9854-156F3B19C95F}'] - // empty interface - end; - - IVisited = interface(IInterface) - ['{7CF62F51-9412-445C-9E8C-DE94F2B1E280}'] - procedure Accept(const Visitor: IVisitor); - end; - - - IListModel = interface(IInterface) - ['{1A772375-1263-4790-8827-F7BEA358674A}'] - function GetCount: Integer; - function GetItem(Idx: Integer): IInterface; - procedure Add(const Item: IInterface); - procedure Clear; - function IndexOf(const Item: IInterface): Integer; - procedure Insert(const Item, Before: IInterface); - procedure Move(const Item, Before: IInterface); - procedure Remove(const Item: IInterface); - property Count: Integer read GetCount; - property Item[Idx: Integer]: IInterface read GetItem; - end; - -(* - IController = interface(IInterface) - ['{4A99C01A-D025-4562-8E94-3A0C873CE894}'] - function GetModel: IModel; - function GetView: IView; - procedure SetModel(const AValue: IModel); - procedure SetView(const AValue: IView); - property Model: IModel read GetModel write SetModel; - property View: IView read GetView write SetView; - end; -*) - - IString = interface(IInterface) - ['{E76984A4-1287-4353-8370-A7332B9FB1CB}'] - function GetAsString: string; - procedure SetAsString(const AValue: string); - property AsString: string read GetAsString write SetAsString; - end; - - - IStringListModel = interface(IListModel) - ['{769804CD-89E4-43C7-B8EF-783BFE27214E}'] - function GetItem(Idx: Integer): IString; overload; - property Item[Idx: Integer]: IString read GetItem; - end; - - - ISelection = interface(IInterface) - ['{F4DDA0EA-E982-4785-8602-5B32E8DD6DA2}'] - procedure AddItem(const Item: IInterface); - procedure Clear; - function GetCount: integer; - procedure RemoveItem(const Item: IInterface); - property Count: integer read GetCount; - end; - - - ICommand = interface(IInterface) - ['{B333C7E1-B124-4D08-A640-DC02F36264C7}'] - procedure BindSelection(const Selection: ISelection); - function Execute: Boolean; - function GetEnabled: Boolean; - function GetText: string; - property Enabled: Boolean read GetEnabled; - property Text: string read GetText; - end; - - - ICommandSet = interface(IInterface) - ['{1622FF69-3104-47EA-8741-9C1B05ADA30B}'] - // empty interface - end; - - - ICommandVisitor = interface(IVisitor) - ['{628B3A4A-30D1-48D3-8B46-090F08AD2AC8}'] - procedure VisitComand(const Command: ICommand); - end; - - - ICommandMenu = interface(IInterface) - ['{3C666D8F-6BED-454B-8BFE-28422943B300}'] - function AddItem(const Caption: string; Enabled: Boolean): ICommandMenuItem; - end; - - - ICommandMenuItem = interface(IInterface) - ['{7DFCF2BD-70DA-4DAC-B8D5-C6FB882267CF}'] - function GetCaption: string; - function GetChecked: Boolean; - function GetCommand: ICommand; - procedure SetCaption(const AValue: string); - procedure SetChecked(const AValue: Boolean); - procedure SetCommand(const AValue: ICommand); - property Caption: string read GetCaption write SetCaption; - property Checked: Boolean read GetChecked write SetChecked; - property Command: ICommand read GetCommand write SetCommand; - end; - - - IStringVisitor = interface(IVisitor) - ['{DA12355F-0727-41B3-9080-DDAF20797FC5}'] - function GetTheString: IString; - procedure VisitString(const Str: IString); - property TheString: IString - read GetTheString; - end; - - - IMVPModel = interface(IInterface) - ['{85223140-B263-4413-89E3-BFA37E9D3112}'] - function GetCommandSet: ICommandSet; - function GetCurrentSelection: ISelection; - property CommandSet: ICommandSet read GetCommandSet; - property CurrentSelection: ISelection read GetCurrentSelection; - end; - - - IMVPPresenter = interface(IInterface) - ['{5B8477DA-A006-4DE1-B304-9512BFAD7507}'] - function GetCommandMenu: ICommandMenu; - function GetModel: IMVPModel; - function GetView: IMVPView; - procedure SetCommandMenu(const AValue: ICommandMenu); - procedure SetModel(const AValue: IMVPModel); - procedure SetView(const AValue: IMVPView); - property CommandMenu: ICommandMenu read GetCommandMenu write SetCommandMenu; - property Model: IMVPModel read GetModel write SetModel; - property View: IMVPView read GetView write SetView; - end; - - - IMVPView = interface(IInterface) - ['{2C575FE7-BACD-46EC-9D72-AEDA44836B20}'] - procedure AdoptCommandMenu(const Value: ICommandMenu); - procedure OrphanCommandMenu(const Value: ICommandMenu); - end; - - - IStringListView = interface(IMVPView) - ['{D834710A-9C1A-42D1-A29B-7F9F8FB46426}'] - function GetOnSelectString: TSelectStringEvent; - procedure SetOnSelectString(const AValue: TSelectStringEvent); - property OnSelectString: TSelectStringEvent read GetOnSelectString write SetOnSelectString; - end; - - - IStringMoveVisitor = interface(IStringVisitor) - ['{DB89C96F-DA90-43ED-A621-51B70E6C600E}'] - function GetCanDemote: Boolean; - function GetCanPromote: Boolean; - property CanDemote: Boolean read GetCanDemote; - property CanPromote: Boolean read GetCanPromote; - end; - - - - - -implementation - - - - -end. - diff --git a/extras/tiopf/mvp/fpgui_intf.pas b/extras/tiopf/mvp/fpgui_intf.pas deleted file mode 100644 index fea8b153..00000000 --- a/extras/tiopf/mvp/fpgui_intf.pas +++ /dev/null @@ -1,22 +0,0 @@ -unit fpgui_intf; - -{$mode objfpc}{$H+} - -interface - -uses - gui_menu, basic_intf; - -type - - IPopupCommandMenu = interface(IInterface) - ['{812C1940-A8BD-4BB4-AE8D-37A912D44A6D}'] - function GetMenu: TfpgPopupMenu; - procedure SetMenu(const AValue: TfpgPopupMenu); - property Menu: TfpgPopupMenu read GetMenu write SetMenu; - end; - -implementation - -end. - diff --git a/extras/tiopf/mvp/gg_mvp.lpk b/extras/tiopf/mvp/gg_mvp.lpk deleted file mode 100644 index 3c335171..00000000 --- a/extras/tiopf/mvp/gg_mvp.lpk +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <Package Version="3"> - <Name Value="gg_mvp"/> - <CompilerOptions> - <Version Value="5"/> - <SearchPaths> - <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> - <Files Count="4"> - <Item1> - <Filename Value="basic_intf.pas"/> - <UnitName Value="basic_intf"/> - </Item1> - <Item2> - <Filename Value="basic_impl.pas"/> - <UnitName Value="basic_impl"/> - </Item2> - <Item3> - <Filename Value="view_impl.pas"/> - <UnitName Value="view_impl"/> - </Item3> - <Item4> - <Filename Value="fpgui_intf.pas"/> - <UnitName Value="fpgui_intf"/> - </Item4> - </Files> - <Type Value="RunAndDesignTime"/> - <RequiredPkgs Count="2"> - <Item1> - <PackageName Value="fpgui_package"/> - </Item1> - <Item2> - <PackageName Value="FCL"/> - <MinVersion Major="1" Valid="True"/> - </Item2> - </RequiredPkgs> - <UsageOptions> - <UnitPath Value="$(PkgOutDir)"/> - </UsageOptions> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - </PublishOptions> - </Package> -</CONFIG> diff --git a/extras/tiopf/mvp/gg_mvp.pas b/extras/tiopf/mvp/gg_mvp.pas deleted file mode 100644 index c8981b1a..00000000 --- a/extras/tiopf/mvp/gg_mvp.pas +++ /dev/null @@ -1,20 +0,0 @@ -{ This file was automatically created by Lazarus. Do not edit! -This source is only used to compile and install the package. - } - -unit gg_mvp; - -interface - -uses - basic_intf, basic_impl, view_impl, fpgui_intf, LazarusPackageIntf; - -implementation - -procedure Register; -begin -end; - -initialization - RegisterPackage('gg_mvp', @Register); -end. diff --git a/extras/tiopf/mvp/readme.txt b/extras/tiopf/mvp/readme.txt deleted file mode 100644 index d4f097cd..00000000 --- a/extras/tiopf/mvp/readme.txt +++ /dev/null @@ -1,11 +0,0 @@ - - Model-View-Presenter (MVP) implementation for tiOPF and fpGUI - ------------------------------------------------------------- - - This is very early stages, so the code is still unusable. - - - Regards, - - Graeme - - -
\ No newline at end of file diff --git a/extras/tiopf/mvp/view_impl.pas b/extras/tiopf/mvp/view_impl.pas deleted file mode 100644 index 478ca9f9..00000000 --- a/extras/tiopf/mvp/view_impl.pas +++ /dev/null @@ -1,66 +0,0 @@ -unit view_impl; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, gui_listbox, gui_combobox, basic_intf; - -type - - TListBoxView = class(TfpgListBox, IObserver) - private - procedure IObserver.Update = ObserverUpdate; - procedure ObserverUpdate(const ASubject: IInterface); - end; - - - TComboBoxView = class(TfpgComboBox, IObserver) - private - procedure IObserver.Update = ObserverUpdate; - procedure ObserverUpdate(const ASubject: IInterface); - end; - - -implementation - -{ TListBoxView } - -procedure TListBoxView.ObserverUpdate(const ASubject: IInterface); -var - Obj: IListModel; - i: integer; -begin - ASubject.QueryInterface(IListModel, Obj); - if Obj <> nil then - begin - Items.BeginUpdate; - Items.Clear; -// for i := 0 to Obj.Count-1 do -// Items.Add(Obj.Item[i]); - Items.EndUpdate; - end; -end; - -{ TComboBoxView } - -procedure TComboBoxView.ObserverUpdate(const ASubject: IInterface); -var - Obj: IListModel; - i: integer; -begin - ASubject.QueryInterface(IListModel, Obj); - if Obj <> nil then - begin - Items.BeginUpdate; - Items.Clear; -// for i := 0 to Obj.Count-1 do -// Items.Add(Obj.Item[i]); - FocusItem := 1; - Items.EndUpdate; - end; -end; - -end. - diff --git a/extras/tiopf/readme.txt b/extras/tiopf/readme.txt deleted file mode 100644 index c42ea0d9..00000000 --- a/extras/tiopf/readme.txt +++ /dev/null @@ -1,12 +0,0 @@ - - tiOPF2 support units - ==================== - -This directory is for all the GUI related units required for tiOPF to work -with fpGUI based applications. tiOPF is a Object Persistent Framework handling -all persistance of Objects to databases or flat files. - -For more details on tiOPF go to the project home page at: - http://www.tiopf.com - - diff --git a/extras/tiopf/tiOPFfpGUI.lpk b/extras/tiopf/tiOPFfpGUI.lpk deleted file mode 100644 index 1a93652d..00000000 --- a/extras/tiopf/tiOPFfpGUI.lpk +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <Package Version="3"> - <Name Value="tiOPFfpGUI"/> - <AddToProjectUsesSection Value="False"/> - <Author Value="Graeme Geldenhuys"/> - <CompilerOptions> - <Version Value="8"/> - <SearchPaths> - <OtherUnitFiles Value="gui/"/> - <UnitOutputDirectory Value="../../lib/$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <CStyleOperator Value="False"/> - </SyntaxOptions> - </Parsing> - <Other> - <CustomOptions Value="-dLINK_CSV --dLINK_TAB --dLINK_FBLx --dLINK_SQLDB_IB --dLINK_SQLDB_PQx --dLINK_SQLDB_Oraclex --dLINK_SQLDB_SQLLite3x --dLINK_SQLDB_ODBCx --dLINK_SQLDB_MySQL40x --dLINK_SQLDB_MySQL41x --dLINK_SQLDB_MySQL50x --dLINK_XMLLIGHTx --dLINK_ZEOS_FB15x --dUseCThreads --Xd -"/> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> - <Description Value="tiOPF GUI layer - visual units -"/> - <License Value="Mozilla Public License v1.1 -"/> - <Version Major="2" Release="5"/> - <Files Count="8"> - <Item1> - <Filename Value="gui/tiGUIUtils.pas"/> - <UnitName Value="tiGUIUtils"/> - </Item1> - <Item2> - <Filename Value="gui/tiDialogs.pas"/> - <UnitName Value="tiDialogs"/> - </Item2> - <Item3> - <Filename Value="gui/tiGUIINI.pas"/> - <UnitName Value="tiGUIINI"/> - </Item3> - <Item4> - <Filename Value="gui/tiGUIConstants.pas"/> - <UnitName Value="tiGUIConstants"/> - </Item4> - <Item5> - <Filename Value="gui/tiRtfReport.pas"/> - <UnitName Value="tiRtfReport"/> - </Item5> - <Item6> - <Filename Value="gui/tiMediators.pas"/> - <UnitName Value="tiMediators"/> - </Item6> - <Item7> - <Filename Value="gui/tiListMediators.pas"/> - <UnitName Value="tiListMediators"/> - </Item7> - <Item8> - <Filename Value="gui/tiLogToGUI.pas"/> - <UnitName Value="tiLogToGUI"/> - </Item8> - </Files> - <RequiredPkgs Count="2"> - <Item1> - <PackageName Value="fpgui_toolkit"/> - <MinVersion Minor="6" Release="2" Valid="True"/> - </Item1> - <Item2> - <PackageName Value="tiOPF"/> - <MinVersion Major="2" Release="3" Valid="True"/> - </Item2> - </RequiredPkgs> - <UsageOptions> - <UnitPath Value="$(PkgOutDir)/"/> - </UsageOptions> - <PublishOptions> - <Version Value="2"/> - <IgnoreBinaries Value="False"/> - </PublishOptions> - </Package> -</CONFIG> diff --git a/extras/tiopf/tiOPFfpGUI.pas b/extras/tiopf/tiOPFfpGUI.pas deleted file mode 100644 index 331a463b..00000000 --- a/extras/tiopf/tiOPFfpGUI.pas +++ /dev/null @@ -1,15 +0,0 @@ -{ This file was automatically created by Lazarus. do not edit! - This source is only used to compile and install the package. - } - -unit tiOPFfpGUI; - -interface - -uses - tiGUIUtils, tiDialogs, tiGUIINI, tiGUIConstants, tiRtfReport, tiMediators, - tiListMediators, tiLogToGUI; - -implementation - -end. diff --git a/images/arrow_down.bmp b/images/arrow_down.bmp Binary files differindex 853bf3c8..9745bd9a 100644 --- a/images/arrow_down.bmp +++ b/images/arrow_down.bmp diff --git a/images/arrow_left.bmp b/images/arrow_left.bmp Binary files differindex 6402f832..1a2a9a9d 100644 --- a/images/arrow_left.bmp +++ b/images/arrow_left.bmp diff --git a/images/arrow_right.bmp b/images/arrow_right.bmp Binary files differindex 223e3a5a..fa9be65b 100644 --- a/images/arrow_right.bmp +++ b/images/arrow_right.bmp diff --git a/images/arrow_up.bmp b/images/arrow_up.bmp Binary files differindex 0c51179c..3f6282b2 100644 --- a/images/arrow_up.bmp +++ b/images/arrow_up.bmp diff --git a/images/bookmark_16.bmp b/images/bookmark_16.bmp Binary files differnew file mode 100644 index 00000000..44456955 --- /dev/null +++ b/images/bookmark_16.bmp diff --git a/images/folder_home_16.bmp b/images/folder_home_16.bmp Binary files differnew file mode 100644 index 00000000..8e00195d --- /dev/null +++ b/images/folder_home_16.bmp diff --git a/images/stdimg_update.sh b/images/stdimg_update.sh index 677136da..0feec995 100755 --- a/images/stdimg_update.sh +++ b/images/stdimg_update.sh @@ -1,3 +1,3 @@ #!/bin/sh chmod +x updatestdimgs -./updatestdimgs > ../src/corelib/stdimages.inc +./updatestdimgs -p stdimg > ../src/corelib/stdimages.inc diff --git a/languages/README.txt b/languages/README.txt index 935bc706..bb6f7bc5 100644 --- a/languages/README.txt +++ b/languages/README.txt @@ -19,16 +19,16 @@ All language files can easily be updated with the script. All text and messages used in the toolkit should be placed into the -<fpGUIdir/src/corelib/lang_english.inc include file. This unit uses a +<fpGUIdir/src/corelib/lang_en.inc (English) include file. This unit uses a resourcestring section, so that the compiler will create the -<fpGUIdir>/lib/gfx_constants.rst file. +<fpGUIdir>/lib/fpg_constants.rst file. Since this is a fpc-only format it must be converted with the rstconv program: cd <fpGUIdir>/languages -rstconv -i ../lib/gfx_constants.rst -o fpgui.po +rstconv -i ../lib/fpg_constants.rst -o fpgui.po Hint: -This is done by <fpGUIdir>/tools/localize.sh or <fpGUIdir>\tools\localize.bat. +This is automatically done by <fpGUIdir>/tools/localize.sh or <fpGUIdir>\tools\localize.bat. This will create the file fpgui.po, which should be translated in all required languages to a fpgui.xx.po file. For the xx see the gettext unit diff --git a/languages/fpgui.af.po b/languages/fpgui.af.po index f5ced39b..6b0878f8 100644 --- a/languages/fpgui.af.po +++ b/languages/fpgui.af.po @@ -28,6 +28,10 @@ msgstr "Staak" msgid "About %s" msgstr "Aangaande %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "Alles" @@ -80,6 +84,10 @@ msgstr "Kan nie die lêergids skep nie" msgid "Change" msgstr "Verander" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "Karakter Kaart" @@ -92,6 +100,10 @@ msgstr "Sluit" msgid "Collection" msgstr "Versameling" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Bevestig" @@ -144,6 +156,10 @@ msgstr "Skrap" msgid "Directories" msgstr "Lêergidse" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "Dryf" @@ -312,6 +328,14 @@ msgstr "Ma" msgid "Monday" msgstr "Maandag" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "Naam" diff --git a/languages/fpgui.de.po b/languages/fpgui.de.po index 52400040..2299515e 100644 --- a/languages/fpgui.de.po +++ b/languages/fpgui.de.po @@ -27,6 +27,10 @@ msgstr "Abbrechen" msgid "About %s" msgstr "Ãœber %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "Alle" @@ -79,6 +83,10 @@ msgstr "Kann Verzeichnis nicht anlegen" msgid "Change" msgstr "Ändern" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" @@ -91,6 +99,10 @@ msgstr "Schließen" msgid "Collection" msgstr "Sammlung" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Bestätigen" @@ -143,6 +155,10 @@ msgstr "Löschen" msgid "Directories" msgstr "Verzeichnisse" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "Laufwerk" @@ -311,6 +327,14 @@ msgstr "Mon" msgid "Monday" msgstr "Montag" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "Name" diff --git a/languages/fpgui.en.po b/languages/fpgui.en.po index 3752d4e7..55473bc6 100644 --- a/languages/fpgui.en.po +++ b/languages/fpgui.en.po @@ -28,6 +28,10 @@ msgstr "" msgid "About %s" msgstr "" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "" @@ -80,6 +84,10 @@ msgstr "" msgid "Change" msgstr "" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" @@ -92,6 +100,10 @@ msgstr "" msgid "Collection" msgstr "" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "" @@ -144,6 +156,10 @@ msgstr "" msgid "Directories" msgstr "" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "" @@ -312,6 +328,14 @@ msgstr "" msgid "Monday" msgstr "" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "" diff --git a/languages/fpgui.es.po b/languages/fpgui.es.po index 69548bea..cc94e42c 100644 --- a/languages/fpgui.es.po +++ b/languages/fpgui.es.po @@ -28,6 +28,10 @@ msgstr "Abortar" msgid "About %s" msgstr "Acerca de %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "Todos" @@ -80,6 +84,10 @@ msgstr "No se puede crear la carpeta" msgid "Change" msgstr "Cambiar" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" @@ -92,6 +100,10 @@ msgstr "Cerrar" msgid "Collection" msgstr "Colección" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Confirmar" @@ -144,6 +156,10 @@ msgstr "Borrar" msgid "Directories" msgstr "Carpetas" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "Unidad" @@ -312,6 +328,14 @@ msgstr "Lun" msgid "Monday" msgstr "Lunes" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "Nombre" diff --git a/languages/fpgui.fr.po b/languages/fpgui.fr.po index 8b827ff1..25c35213 100644 --- a/languages/fpgui.fr.po +++ b/languages/fpgui.fr.po @@ -28,6 +28,10 @@ msgstr "Arrêter" msgid "About %s" msgstr "A propos de %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "Ajouter le répertoire courant" + #: fpg_constants:rsall msgid "All" msgstr "Tous" @@ -80,6 +84,10 @@ msgstr "Impossible de créer le répertoire" msgid "Change" msgstr "Modifier" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "Changer le titre" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "Table de caractères" @@ -92,6 +100,10 @@ msgstr "Fermer" msgid "Collection" msgstr "Collection" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "Configurer les signets" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Confirmer" @@ -144,6 +156,10 @@ msgstr "Supprimer" msgid "Directories" msgstr "Répertoires" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "Répertoire" + #: fpg_constants:rsdrive msgid "Drive" msgstr "Disque" @@ -246,7 +262,7 @@ msgstr "Insérer" #: fpg_constants:rsinsertfromcharactermap msgid "Insert from Character Map" -msgstr "" +msgstr "Insérer depuis la table de caractères" #: fpg_constants:rsitalic msgid "Italic" @@ -312,6 +328,14 @@ msgstr "Lun" msgid "Monday" msgstr "Lundi" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "Déplacer vers le bas" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "Déplacer vers le haut" + #: fpg_constants:rsname msgid "Name" msgstr "Nom" diff --git a/languages/fpgui.it.po b/languages/fpgui.it.po index 551c74b9..2bda8957 100644 --- a/languages/fpgui.it.po +++ b/languages/fpgui.it.po @@ -28,6 +28,10 @@ msgstr "Interrompi" msgid "About %s" msgstr "Informazioni %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "Tutto" @@ -80,6 +84,10 @@ msgstr "Non riesco a creare la cartella" msgid "Change" msgstr "Cambia" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" @@ -92,6 +100,10 @@ msgstr "Chiudi" msgid "Collection" msgstr "Collezione" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Conferma" @@ -144,6 +156,10 @@ msgstr "Cancella" msgid "Directories" msgstr "Cartelle" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "Disco" @@ -312,6 +328,14 @@ msgstr "Lun" msgid "Monday" msgstr "Lunedì" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "Nome" diff --git a/languages/fpgui.po b/languages/fpgui.po index 1371f791..f33b2db9 100644 --- a/languages/fpgui.po +++ b/languages/fpgui.po @@ -66,6 +66,10 @@ msgstr "" msgid "Change" msgstr "" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "" @@ -226,6 +230,10 @@ msgstr "" msgid "Insert" msgstr "" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "" @@ -430,6 +438,10 @@ msgstr "" msgid "Sunday" msgstr "" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "" @@ -494,15 +506,27 @@ msgstr "" msgid "Yes to All" msgstr "" -#: fpg_constants:rstexttoinsert -msgid "Text to Insert" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" msgstr "" -#: fpg_constants:rscharactermap -msgid "Character Map" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" msgstr "" -#: fpg_constants:rsinsertfromcharactermap -msgid "Insert from Character Map" +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + +#: fpg_constants:rsdirectory +msgid "Directory" msgstr "" diff --git a/languages/fpgui.pt.po b/languages/fpgui.pt.po index 55a3df4c..cf4f8c4e 100644 --- a/languages/fpgui.pt.po +++ b/languages/fpgui.pt.po @@ -14,11 +14,11 @@ msgstr "" #: fpg_constants:rserrnotassigned msgid "<%s> not assigned" -msgstr "" +msgstr "<%s> não interligado" #: fpg_constants:rsnewitemdetected msgid "A new item has been detected." -msgstr "" +msgstr "Novo item detectado" #: fpg_constants:rsabort msgid "Abort" @@ -26,7 +26,11 @@ msgstr "Abortar" #: fpg_constants:rsabout msgid "About %s" -msgstr "" +msgstr "Sobre %s" + +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "Adicionar diretório atual" #: fpg_constants:rsall msgid "All" @@ -38,7 +42,7 @@ msgstr "Todos os arquivos" #: fpg_constants:rscollectionallfonts msgid "All Fonts" -msgstr "" +msgstr "Todas Fontes" #: fpg_constants:rsantialiasing msgid "Anti aliasing" @@ -46,23 +50,23 @@ msgstr "" #: fpg_constants:rsshortapr msgid "Apr" -msgstr "" +msgstr "Abr" #: fpg_constants:rslongapr msgid "April" -msgstr "" +msgstr "Abril" #: fpg_constants:rsfileattributes msgid "Attributes" -msgstr "" +msgstr "Atributos" #: fpg_constants:rsshortaug msgid "Aug" -msgstr "" +msgstr "Ago" #: fpg_constants:rslongaug msgid "August" -msgstr "" +msgstr "Agosto" #: fpg_constants:rsbold msgid "Bold" @@ -80,9 +84,13 @@ msgstr "Não foi possÃvel criar diretório" msgid "Change" msgstr "Editar" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "Mudar TÃtulo" + #: fpg_constants:rscharactermap msgid "Character Map" -msgstr "" +msgstr "Mapa de Caracteres" #: fpg_constants:rsclose msgid "Close" @@ -92,6 +100,10 @@ msgstr "Fechar" msgid "Collection" msgstr "Coleção" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Confirmar" @@ -102,11 +114,11 @@ msgstr "Confirmação" #: fpg_constants:rscopy msgid "Copy" -msgstr "" +msgstr "Copiar" #: fpg_constants:rserrcouldnotopendir msgid "Could not open the directory <%s>" -msgstr "" +msgstr "Não pode abrir o diretório <%s>" #: fpg_constants:rscreate msgid "Create" @@ -122,19 +134,19 @@ msgstr "Erro CrÃtico" #: fpg_constants:rscut msgid "Cut" -msgstr "" +msgstr "Cortar" #: fpg_constants:rsdatabase msgid "Database" -msgstr "" +msgstr "Banco de Dados" #: fpg_constants:rsshortdec msgid "Dec" -msgstr "" +msgstr "Dez" #: fpg_constants:rslongdec msgid "December" -msgstr "" +msgstr "Dezembro" #: fpg_constants:rsdelete msgid "Delete" @@ -144,9 +156,13 @@ msgstr "Deletar" msgid "Directories" msgstr "Diretórios" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "Diretório" + #: fpg_constants:rsdrive msgid "Drive" -msgstr "" +msgstr "Dispositivo" #: fpg_constants:rsedit msgid "Edit" @@ -174,7 +190,7 @@ msgstr "Sair" #: fpg_constants:rserrfailedtocreatedir msgid "Failed to create the directory <%s>" -msgstr "" +msgstr "Falhou ao criar o diretório <%s>" #: fpg_constants:rsfalse msgid "False" @@ -182,19 +198,19 @@ msgstr "Falso" #: fpg_constants:rscollectionfavourites msgid "Favourites" -msgstr "" +msgstr "Favoritos" #: fpg_constants:rsshortfeb msgid "Feb" -msgstr "" +msgstr "Fev" #: fpg_constants:rslongfeb msgid "February" -msgstr "" +msgstr "Fevereiro" #: fpg_constants:rsfileselection msgid "File Selection" -msgstr "" +msgstr "Seleção de Arquivo" #: fpg_constants:rsfilename msgid "Filename" @@ -210,7 +226,7 @@ msgstr "Encontrar" #: fpg_constants:rscollectionfixedwidth msgid "Fixed Width" -msgstr "" +msgstr "Largura Fixa" #: fpg_constants:rscollectionfontaliases msgid "Font Aliases" @@ -218,15 +234,15 @@ msgstr "" #: fpg_constants:rsshortfri msgid "Fri" -msgstr "" +msgstr "Sex" #: fpg_constants:rslongfri msgid "Friday" -msgstr "" +msgstr "Sexta-feira" #: fpg_constants:rsfilegroup msgid "Group" -msgstr "" +msgstr "Grupo" #: fpg_constants:rshelp msgid "Help" @@ -246,7 +262,7 @@ msgstr "Inserir" #: fpg_constants:rsinsertfromcharactermap msgid "Insert from Character Map" -msgstr "" +msgstr "Inserir do Mapa de Caracteres" #: fpg_constants:rsitalic msgid "Italic" @@ -254,31 +270,31 @@ msgstr "Itálico" #: fpg_constants:rserritemofwrongtype msgid "Item is not of <%s> type!" -msgstr "" +msgstr "Item não é do tipo <%s>" #: fpg_constants:rsshortjan msgid "Jan" -msgstr "" +msgstr "Jan" #: fpg_constants:rslongjan msgid "January" -msgstr "" +msgstr "janeiro" #: fpg_constants:rsshortjul msgid "Jul" -msgstr "" +msgstr "Jul" #: fpg_constants:rslongjul msgid "July" -msgstr "" +msgstr "Julho" #: fpg_constants:rsshortjun msgid "Jun" -msgstr "" +msgstr "Jun" #: fpg_constants:rslongjun msgid "June" -msgstr "" +msgstr "Junho" #: fpg_constants:rserrlistmustbeempty msgid "List must be empty" @@ -286,15 +302,15 @@ msgstr "Lista deve estar vazio" #: fpg_constants:rsshortmar msgid "Mar" -msgstr "" +msgstr "Mar" #: fpg_constants:rslongmar msgid "March" -msgstr "" +msgstr "Março" #: fpg_constants:rsshortmay msgid "May" -msgstr "" +msgstr "Mai" #: fpg_constants:rsmessage msgid "Message" @@ -302,15 +318,23 @@ msgstr "Mensagem" #: fpg_constants:rsfilemodifiedtime msgid "Mod. Time" -msgstr "" +msgstr "Tempo Mod." #: fpg_constants:rsshortmon msgid "Mon" -msgstr "" +msgstr "Seg" #: fpg_constants:rslongmon msgid "Monday" -msgstr "" +msgstr "Segunda-feira" + +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "Mover Abaixo" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "Mover Acima" #: fpg_constants:rsname msgid "Name" @@ -326,11 +350,11 @@ msgstr "Não para todos" #: fpg_constants:rsshortnov msgid "Nov" -msgstr "" +msgstr "Nov" #: fpg_constants:rslongnov msgid "November" -msgstr "" +msgstr "Novembro" #: fpg_constants:rsok msgid "OK" @@ -338,11 +362,11 @@ msgstr "OK" #: fpg_constants:rsshortoct msgid "Oct" -msgstr "" +msgstr "Out" #: fpg_constants:rslongoct msgid "October" -msgstr "" +msgstr "Outubro" #: fpg_constants:rsopen msgid "Open" @@ -354,19 +378,19 @@ msgstr "Abrir um arquivo" #: fpg_constants:rsfileowner msgid "Owner" -msgstr "" +msgstr "Dono" #: fpg_constants:rspassword msgid "Password" -msgstr "" +msgstr "Senha" #: fpg_constants:rspaste msgid "Paste" -msgstr "" +msgstr "Colar" #: fpg_constants:rscollectionrecentlyused msgid "Recently Used" -msgstr "" +msgstr "Recentemente Usado" #: fpg_constants:rsreplace msgid "Replace" @@ -386,11 +410,11 @@ msgstr "" #: fpg_constants:rsshortsat msgid "Sat" -msgstr "" +msgstr "Sab" #: fpg_constants:rslongsat msgid "Saturday" -msgstr "" +msgstr "Sabado" #: fpg_constants:rssave msgid "Save" @@ -418,11 +442,11 @@ msgstr "Selecione a fonte" #: fpg_constants:rsshortsep msgid "Sep" -msgstr "" +msgstr "Set" #: fpg_constants:rslongsep msgid "September" -msgstr "" +msgstr "Setembro" #: fpg_constants:rscollectionserif msgid "Serif" @@ -450,19 +474,19 @@ msgstr "" #: fpg_constants:rstexttoinsert msgid "Text to Insert" -msgstr "" +msgstr "Texto para Inserir" #: fpg_constants:rsshortthu msgid "Thu" -msgstr "" +msgstr "Qui" #: fpg_constants:rslongthu msgid "Thursday" -msgstr "" +msgstr "Quinta-feira" #: fpg_constants:rstoday msgid "Today" -msgstr "" +msgstr "Hoje" #: fpg_constants:rstrue msgid "True" @@ -470,11 +494,11 @@ msgstr "Verdadeiro" #: fpg_constants:rsshorttue msgid "Tue" -msgstr "" +msgstr "Ter" #: fpg_constants:rslongtue msgid "Tuesday" -msgstr "" +msgstr "Terça-feira" #: fpg_constants:rsfiletype msgid "Type of file" @@ -490,7 +514,7 @@ msgstr "Sublinhado" #: fpg_constants:rsusername msgid "User name" -msgstr "" +msgstr "Usuário" #: fpg_constants:rswarning msgid "Warning" @@ -498,15 +522,15 @@ msgstr "Advertência" #: fpg_constants:rsshortwed msgid "Wed" -msgstr "" +msgstr "Qua" #: fpg_constants:rslongwed msgid "Wednesday" -msgstr "" +msgstr "Quarta-feira" #: fpg_constants:rsaddnewitem msgid "Would you like to add the new item <%s> to the list?" -msgstr "" +msgstr "Você gostaria de adicionar um novo item <%s> para a lista?" #: fpg_constants:rsyes msgid "Yes" diff --git a/languages/fpgui.ru.po b/languages/fpgui.ru.po index 87141b94..c9a442d3 100644 --- a/languages/fpgui.ru.po +++ b/languages/fpgui.ru.po @@ -28,6 +28,10 @@ msgstr "Прервать" msgid "About %s" msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ %s" +#: fpg_constants:rsaddcurrentdirectory +msgid "Add current directory" +msgstr "" + #: fpg_constants:rsall msgid "All" msgstr "Ð’Ñе" @@ -80,6 +84,10 @@ msgstr "Ðевозможно Ñоздать директорию" msgid "Change" msgstr "Изменить" +#: fpg_constants:rschangetitle +msgid "Change Title" +msgstr "" + #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" @@ -92,6 +100,10 @@ msgstr "Закрыть" msgid "Collection" msgstr "Группа" +#: fpg_constants:rsconfigurebookmarks +msgid "Configure Bookmarks" +msgstr "" + #: fpg_constants:rsconfirm msgid "Confirm" msgstr "Подтвердить" @@ -144,6 +156,10 @@ msgstr "Удалить" msgid "Directories" msgstr "Директории" +#: fpg_constants:rsdirectory +msgid "Directory" +msgstr "" + #: fpg_constants:rsdrive msgid "Drive" msgstr "ДиÑк" @@ -312,6 +328,14 @@ msgstr "Пн" msgid "Monday" msgstr "Понедельник" +#: fpg_constants:rsmovedown +msgid "Move Down" +msgstr "" + +#: fpg_constants:rsmoveup +msgid "Move Up" +msgstr "" + #: fpg_constants:rsname msgid "Name" msgstr "Ðазвание" diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 199004ba..a5289474 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -25,7 +25,8 @@ uses Classes, SysUtils, fpg_impl, - syncobjs; // TCriticalSection usage + syncobjs, // TCriticalSection usage + URIParser, variants, contnrs; type TfpgCoord = integer; // we might use floating point coordinates in the future... @@ -59,7 +60,7 @@ type TMouseCursor = (mcDefault, mcArrow, mcCross, mcIBeam, mcSizeEW, mcSizeNS, mcSizeNWSE, mcSizeNESW, mcSizeSWNE, mcSizeSENW, mcMove, mcHourGlass, - mcHand); + mcHand, mcDrag, mcNoDrop); TGradientDirection = (gdVertical, // Fill vertical gdHorizontal); // Fill Horizontal @@ -70,6 +71,9 @@ type TfpgModalResult = (mrNone, mrOK, mrCancel, mrYes, mrNo, mrAbort, mrRetry, mrIgnore, mrAll, mrNoToAll, mrYesToAll); + TfpgDropAction = (daIgnore, daCopy, daMove, daLink, daAsk); + TfpgDropActions = set of TfpgDropAction; + const MOUSE_LEFT = 1; MOUSE_RIGHT = 3; @@ -95,21 +99,20 @@ const FPGM_POPUPCLOSE = 17; FPGM_HINTTIMER = 18; FPGM_FREEME = 19; + FPGM_DROPENTER = 20; + FPGM_DROPEXIT = 21; FPGM_USER = 50000; FPGM_KILLME = MaxInt; // The special keys, based on the well-known keyboard scan codes {$I keys.inc} - { Default fpGUI help viewer } - FPG_HELPVIEWER = 'docview'; var FPG_DEFAULT_FONT_DESC: string = 'Arial-10:antialias=true'; const UserNamedColorStart = 128; - {$I predefinedcolors.inc} type @@ -126,6 +129,22 @@ type end; + TfpgPoint = object // not class for static allocations + X: integer; + Y: integer; + procedure SetPoint(AX, AY: integer); + function ManhattanLength: integer; { See URL for explanation http://en.wikipedia.org/wiki/Taxicab_geometry } + function ManhattanLength(const PointB: TfpgPoint): integer; + end; + + + TfpgSize = object // not class for static allocations + W: integer; + H: integer; + procedure SetSize(AWidth, AHeight: integer); + end; + + TfpgMsgParmMouse = record x: TfpgCoord; y: TfpgCoord; @@ -416,6 +435,8 @@ type FSizeIsDirty: Boolean; FPosIsDirty: Boolean; FMouseCursorIsDirty: Boolean; + FOnDragStartDetected: TNotifyEvent; + FDragActive: boolean; function HandleIsValid: boolean; virtual; abstract; procedure DoUpdateWindowPosition; virtual; abstract; procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); virtual; abstract; @@ -426,6 +447,9 @@ type function DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; virtual; abstract; procedure DoSetWindowTitle(const ATitle: string); virtual; abstract; procedure DoSetMouseCursor; virtual; abstract; + procedure DoDNDEnabled(const AValue: boolean); virtual; abstract; + procedure DoAcceptDrops(const AValue: boolean); virtual; abstract; + procedure DoDragStartDetected; virtual; procedure SetParent(const AValue: TfpgWindowBase); virtual; function GetParent: TfpgWindowBase; virtual; function GetCanvas: TfpgCanvasBase; virtual; @@ -438,6 +462,7 @@ type procedure SetWidth(const AValue: TfpgCoord); procedure HandleMove(x, y: TfpgCoord); virtual; procedure HandleResize(AWidth, AHeight: TfpgCoord); virtual; + property OnDragStartDetected: TNotifyEvent read FOnDragStartDetected write FOnDragStartDetected; public // The standard constructor. constructor Create(AOwner: TComponent); override; @@ -453,6 +478,8 @@ type procedure MoveWindow(const x: TfpgCoord; const y: TfpgCoord); function WindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; function HasParent: Boolean; override; + function GetClientRect: TfpgRect; virtual; + function GetBoundsRect: TfpgRect; virtual; procedure ActivateWindow; virtual; abstract; procedure CaptureMouse; virtual; abstract; procedure ReleaseMouse; virtual; abstract; @@ -466,8 +493,8 @@ type property Height: TfpgCoord read FHeight write SetHeight; property MinWidth: TfpgCoord read FMinWidth write FMinWidth; property MinHeight: TfpgCoord read FMinHeight write FMinHeight; - property MaxWidth: TfpgCoord read FMaxWidth write FMaxWidth; - property MaxHeight: TfpgCoord read FMaxHeight write FMaxHeight; + property MaxWidth: TfpgCoord read FMaxWidth write FMaxWidth default 0; + property MaxHeight: TfpgCoord read FMaxHeight write FMaxHeight default 0; property Canvas: TfpgCanvasBase read GetCanvas; property Parent: TfpgWindowBase read GetParent write SetParent; property MouseCursor: TMouseCursor read FMouseCursor write SetMouseCursor; @@ -531,7 +558,7 @@ type procedure DoSetText(const AValue: TfpgString); virtual; abstract; procedure InitClipboard; virtual; abstract; public - constructor Create; + constructor Create; virtual; property Text: TfpgString read DoGetText write DoSetText; end; @@ -605,6 +632,54 @@ type end; + TfpgMimeDataItem = class(TObject) + public + format: TfpgString; { mime string type } + data: Variant; + constructor Create(const AFormat: TfpgString; const AData: variant); reintroduce; + end; + + + TfpgMimeDataBase = class(TObject) + private + { TODO: This is wrong, we must have one Data Storage object } + FDataList: TObjectList; + FUrlList: TList; + function GetItem(AIndex: Integer): TfpgMimeDataItem; + function Geturls: TList; + procedure Seturls(const AValue: TList); + function GetText: TfpgString; + procedure SetText(const AValue: TfpgString); + function GetHTML: TfpgString; + procedure SetHTML(const AValue: TfpgString); + function GetCount: integer; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function HasFormat(const AMimeType: TfpgString): boolean; + function Formats: TStrings; + function GetData(const AMimeType: TfpgString): Variant; + procedure SetData(const AMimeType: TfpgString; const AData: Variant); + property Items[AIndex: Integer]: TfpgMimeDataItem read GetItem; default; + property urls: TList read Geturls write Seturls; + property Text: TfpgString read GetText write SetText; + property HTML: TfpgString read GetHTML write SetHTML; + property Count: integer read GetCount; + end; + + TfpgDragBase = class(TObject) + protected + FDragging: Boolean; + FMimeData: TfpgMimeDataBase; + public + constructor Create; + destructor Destroy; override; + function Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction = daCopy): TfpgDropAction; virtual; abstract; + end; + + + { ******** Helper functions ******** } { Keyboard } function KeycodeToText(AKey: Word; AShiftState: TShiftState): string; @@ -628,11 +703,14 @@ procedure SortRect(var ARect: TRect); procedure SortRect(var ARect: TfpgRect); procedure SortRect(var left, top, right, bottom: integer); + + implementation uses fpg_main, // needed for fpgApplication & fpgNamedColor fpg_utils, // needed for fpgFileList + fpg_constants, typinfo, process; @@ -962,11 +1040,15 @@ begin GetPropList(Obj.ClassInfo, tkPropsWithDefault, PropInfos); { Loop through all the selected properties } for Loop := 0 to Count - 1 do + begin with PropInfos^[Loop]^ do + begin { If there is supposed to be a default value... } if Default <> NoDefault then { ...then jolly well set it } SetOrdProp(Obj, PropInfos^[Loop], Default) + end; + end; finally FreeMem(PropInfos, Count * SizeOf(PPropInfo)); end; @@ -1002,6 +1084,35 @@ begin Width := Value - Left + 1; end; + +{ TfpgPoint } + +procedure TfpgPoint.SetPoint(AX, AY: integer); +begin + X := AX; + Y := AY; +end; + +function TfpgPoint.ManhattanLength: integer; +begin + Result := Abs(X) + Abs(Y); +end; + +function TfpgPoint.ManhattanLength(const PointB: TfpgPoint): integer; +begin + Result := Abs(PointB.X-X) + Abs(PointB.Y-Y); +end; + + +{ TfpgSize } + +procedure TfpgSize.SetSize(AWidth, AHeight: integer); +begin + W := AWidth; + H := AHeight; +end; + + { TfpgWindowBase } procedure TfpgWindowBase.SetMouseCursor(const AValue: TMouseCursor); @@ -1030,6 +1141,12 @@ begin Result := MinHeight; end; +procedure TfpgWindowBase.DoDragStartDetected; +begin + if Assigned(FOnDragStartDetected) then + FOnDragStartDetected(self); +end; + procedure TfpgWindowBase.SetParent(const AValue: TfpgWindowBase); begin FParent := AValue; @@ -1150,6 +1267,7 @@ begin FSizeIsDirty := True; FMaxWidth := 0; FMaxHeight := 0; + FDragActive := False; end; procedure TfpgWindowBase.AfterConstruction; @@ -1205,6 +1323,16 @@ begin Result := FParent <> nil; end; +function TfpgWindowBase.GetClientRect: TfpgRect; +begin + Result.SetRect(0, 0, Width, Height); +end; + +function TfpgWindowBase.GetBoundsRect: TfpgRect; +begin + Result.SetRect(Left, Top, Width+1, Height+1); +end; + procedure TfpgWindowBase.SetFullscreen(AValue: Boolean); begin if AValue then @@ -2138,7 +2266,7 @@ var begin // Default location is in same directory as current running application // This location might change in the future. - ext := ExtractFileExt(ParamStr(0)); + ext := fpgExtractFileExt(ParamStr(0)); Result := fpgExtractFilePath(ParamStr(0)) + FPG_HELPVIEWER + ext; end; @@ -2255,6 +2383,7 @@ function TfpgApplicationBase.ContextHelp(const AHelpContext: THelpContext): Bool var p: TProcess; begin + Result := False; p := TProcess.Create(nil); try if fpgFileExists(HelpFile) then @@ -2267,6 +2396,7 @@ begin end else p.CommandLine := GetHelpViewer; + Result := True; p.Execute; finally p.Free; @@ -2277,6 +2407,7 @@ function TfpgApplicationBase.KeywordHelp(const AHelpKeyword: string): Boolean; var p: TProcess; begin + Result := False; p := TProcess.Create(nil); try if fpgFileExists(HelpFile) then @@ -2286,6 +2417,7 @@ begin end else p.CommandLine := GetHelpViewer; + Result := True; p.Execute; finally p.Free; @@ -2296,6 +2428,7 @@ end; constructor TfpgClipboardBase.Create; begin + inherited Create; InitClipboard; end; @@ -2415,7 +2548,7 @@ var begin e := TFileEntry.Create; e.Name := sr.Name; - e.Extension := ExtractFileExt(e.Name); + e.Extension := fpgExtractFileExt(e.Name); e.Size := sr.Size; // e.Attributes := sr.Attr; // this is incorrect and needs to improve! e.ModTime := FileDateToDateTime(sr.Time); @@ -2627,8 +2760,225 @@ begin inherited Create(AOwner); FHelpType := htKeyword; FHelpContext := 0; + FHelpKeyword := ''; FTagPointer := nil; end; +{ TfpgMimeDataItem } + +constructor TfpgMimeDataItem.Create(const AFormat: TfpgString; const AData: variant); +begin + inherited Create; + format := AFormat; + data := AData; +end; + + +{ TfpgMimeDataBase } + +function TfpgMimeDataBase.Geturls: TList; +begin + { TODO: We should only return data related to MIME type: text/uri-list } + Result := nil; +end; + +function TfpgMimeDataBase.GetItem(AIndex: Integer): TfpgMimeDataItem; +begin + Result := TfpgMimeDataItem(FDataList[AIndex]); +end; + +procedure TfpgMimeDataBase.Seturls(const AValue: TList); +begin + if AValue = nil then + raise Exception.Create('Source URI list must not be nil'); + + if Assigned(FUrlList) then + FUrlList.Free; + + { We take ownership of AValue. Can we do this? } + FUrlList := AValue; +// FFormats.Clear; +// Formats.Add('text/uri-list'); +end; + +function TfpgMimeDataBase.GetText: TfpgString; +var + i: integer; + s: string; +begin + { TODO: if no text/plain, but we have HTML, we must strip all tags and return that } + for i := 0 to Count-1 do + begin + if Items[i].format = 'text/plain' then + begin + s := Items[i].data; + Result := s; + break; + end; + end; +end; + +procedure TfpgMimeDataBase.SetText(const AValue: TfpgString); +var + i: integer; + r: TfpgMimeDataItem; +begin + { remove existing 'text/plain' first } + for i := Count-1 downto 0 do + begin + r := Items[i]; + if r.format = 'text/plain' then + begin + FDataList.Remove(r); + break; + end; + end; + { now add new structure } + r := TfpgMimeDataItem.Create('text/plain', AValue); + FDataList.Add(r); +end; + +function TfpgMimeDataBase.GetHTML: TfpgString; +var + i: integer; + s: string; +begin + { TODO: if data was HTML, we must strip all tags - regex will make this easy } + for i := 0 to Count-1 do + begin + if Items[i].format = 'text/html' then + begin + s := Items[i].data; + Result := s; + break; + end; + end; +end; + +procedure TfpgMimeDataBase.SetHTML(const AValue: TfpgString); +var + i: integer; + r: TfpgMimeDataItem; +begin + { remove existing 'text/html' first } + for i := Count-1 downto 0 do + begin + r := Items[i]; + if r.format = 'text/html' then + begin + FDataList.Remove(r); + break; + end; + end; + { now add new structure } + r := TfpgMimeDataItem.Create('text/html', AValue); + FDataList.Add(r); +end; + +function TfpgMimeDataBase.GetCount: integer; +begin + Result := FDataList.Count; +end; + +constructor TfpgMimeDataBase.Create; +begin + inherited Create; + FDataList := TObjectList.Create; +end; + +destructor TfpgMimeDataBase.Destroy; +begin + FDataList.Free; + inherited Destroy; +end; + +procedure TfpgMimeDataBase.Clear; +begin + FUrlList.Clear; + FDataList.Clear; +end; + +function TfpgMimeDataBase.HasFormat(const AMimeType: TfpgString): boolean; +var + i: integer; +begin + Result := False; + for i := 0 to Count-1 do + begin + Result := Items[i].format = AMimeType; + if Result then + break; + end; +end; + +function TfpgMimeDataBase.Formats: TStrings; +var + i: integer; + r: TfpgMimeDataItem; + s: string; +begin + if Count = 0 then + Result := nil + else + begin + Result := TStringList.Create; + for i := 0 to Count-1 do + begin + s := Items[i].format; + Result.Add(s); + end; + end; +end; + +function TfpgMimeDataBase.GetData(const AMimeType: TfpgString): Variant; +var + i: integer; +begin + for i := 0 to Count-1 do + begin + if Items[i].format = AMimeType then + begin + Result := Items[i].data; + break; + end; + end; +end; + +procedure TfpgMimeDataBase.SetData(const AMimeType: TfpgString; const AData: Variant); +var + i: integer; + r: TfpgMimeDataItem; +begin + { remove existing mime type first } + for i := Count-1 downto 0 do + begin + r := Items[i]; + if r.format = AMimeType then + begin + FDataList.Remove(r); + break; + end; + end; + { now add new structure } + r := TfpgMimeDataItem.Create(AMimeType, AData); + FDataList.Add(r); +end; + + +{ TfpgDragBase } + +constructor TfpgDragBase.Create; +begin + inherited Create; + FDragging := False; +end; + +destructor TfpgDragBase.Destroy; +begin + FMimeData.Free; + inherited Destroy; +end; + + end. diff --git a/src/corelib/fpg_constants.pas b/src/corelib/fpg_constants.pas index d93e5208..d83f855b 100644 --- a/src/corelib/fpg_constants.pas +++ b/src/corelib/fpg_constants.pas @@ -30,7 +30,7 @@ unit fpg_constants; interface uses - SysUtils, fpg_base; + SysUtils; resourcestring @@ -92,21 +92,20 @@ const ONE_MILISEC = 1/MSecsPerDay; DEFAULT_HINT_PAUSE = 500; // in milliseconds + + { Default fpGUI help viewer } + FPG_HELPVIEWER = 'docview'; + + FPG_CONFIG_DIR = 'fpgui_toolkit' + PathDelim; + FPG_BOOKMARKS_FILE = 'bookmarks.ini'; + FPG_BOOKMARK_SECTION = 'bookmarks'; -{ This is so that when we support LTR and RTL languages, the colon will be - added at the correct place. } -function fpgAddColon(const AText: TfpgString): TfpgString; implementation -function fpgAddColon(const AText: TfpgString): TfpgString; -begin - { TODO : Check language direction and add colon at appropriate end. } - result := AText + ':'; -end; end. diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas index 48b25d5b..1ea61551 100644 --- a/src/corelib/fpg_imgfmt_bmp.pas +++ b/src/corelib/fpg_imgfmt_bmp.pas @@ -25,8 +25,7 @@ interface uses Classes, SysUtils, - fpg_main, - fpg_base; + fpg_main; procedure ReadImage_BMP(img: TfpgImage; bmp: Pointer; bmpsize: longword); function LoadImage_BMP(const AFileName: String): TfpgImage; diff --git a/src/corelib/fpg_imgutils.pas b/src/corelib/fpg_imgutils.pas index afb4d4fe..97f33fb7 100644 --- a/src/corelib/fpg_imgutils.pas +++ b/src/corelib/fpg_imgutils.pas @@ -104,7 +104,7 @@ end; initialization GrayConvMatrix := GCM_NTSC; GrayBrightness := True; - GrayBrightnessPercentage := 20; + GrayBrightnessPercentage := 40; end. diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index c8023408..b5b7fb17 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -29,7 +29,8 @@ uses Classes, SysUtils, fpg_base, - fpg_interface; + fpg_interface, + fpg_impl; type TOrientation = (orVertical, orHorizontal); @@ -43,6 +44,8 @@ type TFButtonFlags = set of (btfIsEmbedded, btfIsDefault, btfIsPressed, btfIsSelected, btfHasFocus, btfHasParentColor, btfFlat, btfHover); + + TfpgMenuItemFlags = set of (mifSelected, mifHasFocus, mifSeparator, mifEnabled, mifChecked, mifSubMenu); TFTextFlags = set of (txtLeft, txtHCenter, txtRight, txtTop, txtVCenter, txtBottom, txtWrap, txtDisabled, txtAutoSize); @@ -177,6 +180,8 @@ type procedure DrawButtonFace(r: TfpgRect; AFlags: TFButtonFlags); procedure DrawControlFrame(x, y, w, h: TfpgCoord); procedure DrawControlFrame(r: TfpgRect); + procedure DrawBevel(x, y, w, h: TfpgCoord; ARaised: Boolean = True); + procedure DrawBevel(r: TfpgRect; ARaised: Boolean = True); procedure DrawDirectionArrow(x, y, w, h: TfpgCoord; direction: TArrowDirection); procedure DrawDirectionArrow(r: TfpgRect; direction: TArrowDirection); procedure DrawFocusRect(r: TfpgRect); @@ -187,10 +192,9 @@ type { This is very basic for now, just to remind us of theming support. Later we - will rework this to use a Style Manager like the previous fpGUI. Styles must - also move out of fpGFX. Also support Bitmap based styles for easier theme - implementations. } - TfpgStyle = class + will rework this to use a Style Manager like the previous fpGUI. + Also support Bitmap based styles for easier theme implementations. } + TfpgStyle = class(TObject) public DefaultFont: TfpgFont; FixedFont: TfpgFont; @@ -201,9 +205,14 @@ type destructor Destroy; override; procedure DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; AFlags: TFButtonFlags); virtual; procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); virtual; + procedure DrawBevel(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; ARaised: Boolean = True); virtual; procedure DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: TArrowDirection); virtual; procedure DrawString(ACanvas: TfpgCanvas; x, y: TfpgCoord; AText: string; AEnabled: boolean = True); virtual; procedure DrawFocusRect(ACanvas: TfpgCanvas; r: TfpgRect); virtual; + procedure DrawMenuRow(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgMenuItemFlags); virtual; + procedure DrawMenuItem(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgMenuItemFlags; AText: TfpgString); virtual; + procedure DrawMenuItemSeparator(ACanvas: TfpgCanvas; r: TfpgRect); virtual; + procedure DrawMenuItemImage(ACanvas: TfpgCanvas; x, y: TfpgCoord; r: TfpgRect; AFlags: TfpgMenuItemFlags); virtual; end; @@ -224,6 +233,8 @@ type FHintTimer: TfpgTimer; FHintWidget: TfpgWindow; FHintPos: TPoint; + FOnKeyPress: TKeyPressEvent; + FStartDragDistance: integer; procedure SetHintPause(const AValue: Integer); procedure SetupLocalizationStrings; procedure InternalMsgFreeMe(var msg: TfpgMessageRec); message FPGM_FREEME; @@ -231,6 +242,7 @@ type procedure CreateHintWindow; procedure HintTimerFired(Sender: TObject); procedure SetShowHint(const AValue: boolean); + procedure SetStartDragDistance(const AValue: integer); protected FDisplayParams: string; FScreenWidth: integer; @@ -263,8 +275,10 @@ type property ScreenWidth: integer read FScreenWidth; property ScreenHeight: integer read FScreenHeight; property ShowHint: boolean read FShowHint write SetShowHint default True; + property StartDragDistance: integer read FStartDragDistance write SetStartDragDistance default 5; property StopOnException: Boolean read FStopOnException write FStopOnException; property OnException: TExceptionEvent read FOnException write FOnException; + property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress; end; @@ -278,10 +292,11 @@ type procedure SetInterval(const AValue: integer); public { AInterval is in milliseconds. } - constructor Create(ainterval: integer); + constructor Create(ainterval: integer); virtual; destructor Destroy; override; procedure CheckAlarm(ctime: TDateTime); - procedure Reset; + procedure Reset; virtual; + procedure Pause(ASeconds: integer); property Enabled: boolean read FEnabled write SetEnabled; property NextAlarm: TDateTime read FNextAlarm; { Interval is in milliseconds. } @@ -322,6 +337,25 @@ type end; + TfpgMimeData = class(TfpgMimeDataImpl) + end; + + + TfpgDrag = class(TfpgDragImpl) + private + FTarget: TfpgWinHandle; + procedure SetMimeData(const AValue: TfpgMimeDataBase); + protected + function GetSource: TfpgWindow; reintroduce; + public + constructor Create(ASource: TfpgWindow); + function Execute(const ADropActions: TfpgDropActions = [daCopy]; const ADefaultAction: TfpgDropAction = daCopy): TfpgDropAction; override; + property Source: TfpgWindow read GetSource; + property Target: TfpgWinHandle read FTarget write FTarget; + property MimeData: TfpgMimeDataBase read FMimeData write SetMimeData; + end; + + var fpgStyle: TfpgStyle; { TODO -ograemeg : move this into fpgApplication } fpgCaret: TfpgCaret; { TODO -ograemeg : move this into fpgApplication } @@ -349,6 +383,7 @@ procedure fpgDeleteFirstMessage; function fpgColorToRGB(col: TfpgColor): TfpgColor; function fpgGetNamedColor(col: TfpgColor): TfpgColor; procedure fpgSetNamedColor(colorid, rgbvalue: longword); +function fpgIsNamedColor(col: TfpgColor): boolean; function fpgGetNamedFontDesc(afontid: string): string; procedure fpgSetNamedFont(afontid, afontdesc: string); function fpgGetNamedFontList: TStringlist; @@ -356,10 +391,11 @@ function fpgGetNamedFontList: TStringlist; // Timers rountines procedure fpgInitTimers; procedure fpgCheckTimers; +procedure fpgResetAllTimers; function fpgClosestTimer(ctime: TDateTime; amaxtime: integer): integer; function fpgGetTickCount: DWord; -// Rectangle routines +// Rectangle, Point & Size routines function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; function InflateRect(var Rect: TfpgRect; dx: Integer; dy: Integer): Boolean; function OffsetRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; @@ -368,6 +404,8 @@ function CenterPoint(const Rect: TRect): TPoint; function CenterPoint(const Rect: TfpgRect): TPoint; function fpgRect(ALeft, ATop, AWidth, AHeight: integer): TfpgRect; function fpgRectToRect(const ARect: TfpgRect): TRect; +function fpgPoint(const AX, AY: integer): TfpgPoint; +function fpgSize(const AWidth, AHeight: integer): TfpgSize; // Debug rountines procedure PrintRect(const Rect: TRect); @@ -386,12 +424,34 @@ procedure DebugLn(const s1, s2, s3, s4: TfpgString); // operator overloading of some useful structures operator = (a: TRect; b: TRect): boolean; +operator = (const ASize1, ASize2: TfpgSize) b: Boolean; +operator = (const APoint1, APoint2: TPoint) b: Boolean; +operator + (const APoint1, APoint2: TPoint) p: TPoint; +operator + (const APoint1, APoint2: TfpgPoint) p: TfpgPoint; +operator + (const APoint: TPoint; ASize: TfpgSize) p: TPoint; +operator + (const APoint: TfpgPoint; ASize: TfpgSize) p: TfpgPoint; +operator + (const ASize: TfpgSize; APoint: TPoint) s: TfpgSize; +operator + (const ASize: TfpgSize; APoint: TfpgPoint) s: TfpgSize; +operator + (const ASize1, ASize2: TfpgSize) s: TfpgSize; +operator + (const APoint: TPoint; i: Integer) p: TPoint; +operator + (const APoint: TfpgPoint; i: Integer) p: TfpgPoint; +operator + (const ASize: TfpgSize; i: Integer) s: TfpgSize; +operator - (const APoint1, APoint2: TPoint) p: TPoint; +operator - (const APoint1, APoint2: TfpgPoint) p: TfpgPoint; +operator - (const APoint: TPoint; i: Integer) p: TPoint; +operator - (const APoint: TfpgPoint; i: Integer) p: TfpgPoint; +operator - (const ASize: TfpgSize; const APoint: TPoint) s: TfpgSize; +operator - (const ASize: TfpgSize; const APoint: TfpgPoint) s: TfpgSize; +operator - (const ASize: TfpgSize; i: Integer) s: TfpgSize; +operator = (const AColor1, AColor2: TFPColor) b: Boolean; + implementation uses strutils, math, + dateutils, fpg_imgfmt_bmp, fpg_stdimages, fpg_translations, @@ -446,19 +506,25 @@ var ctime: TDateTime; begin ctime := now; - i := 0; - while i < fpgTimers.Count do + i := fpgTimers.Count; + while i > 0 do begin + dec(i); if fpgTimers[i] = nil then fpgTimers.Delete(i) else - begin TfpgTimer(fpgTimers[i]).CheckAlarm(ctime); - Inc(i); - end; end; end; +procedure fpgResetAllTimers; +var + i: integer; +begin + for i := 0 to fpgTimers.Count-1 do + TfpgTimer(fpgTimers[i]).Reset; +end; + function fpgClosestTimer(ctime: TDateTime; amaxtime: integer): integer; var i: integer; @@ -583,6 +649,16 @@ begin Result.Bottom := ARect.Bottom; end; +function fpgPoint(const AX, AY: integer): TfpgPoint; +begin + Result.SetPoint(AX, AY); +end; + +function fpgSize(const AWidth, AHeight: integer): TfpgSize; +begin + Result.SetSize(AWidth, AHeight); +end; + procedure InitializeDebugOutput; var DebugFileName: string; @@ -789,6 +865,126 @@ begin Result := False; end; +operator = (const ASize1, ASize2: TfpgSize) b: Boolean; +begin + b := (ASize1.w = ASize2.w) and (ASize1.h = ASize2.h); +end; + +operator = (const APoint1, APoint2: TPoint) b: Boolean; +begin + b := (APoint1.X = APoint2.X) and (APoint1.Y = APoint2.Y); +end; + +operator + (const APoint1, APoint2: TPoint) p: TPoint; +begin + p.x := APoint1.x + APoint2.x; + p.y := APoint1.y + APoint2.y; +end; + +operator + (const APoint1, APoint2: TfpgPoint) p: TfpgPoint; +begin + p.x := APoint1.x + APoint2.x; + p.y := APoint1.y + APoint2.y; +end; + +operator + (const APoint: TPoint; ASize: TfpgSize) p: TPoint; +begin + p.x := APoint.x + ASize.w; + p.y := APoint.y + ASize.h; +end; + +operator + (const APoint: TfpgPoint; ASize: TfpgSize) p: TfpgPoint; +begin + p.x := APoint.x + ASize.w; + p.y := APoint.y + ASize.h; +end; + +operator + (const ASize: TfpgSize; APoint: TPoint) s: TfpgSize; +begin + s.w := ASize.w + APoint.x; + s.h := ASize.h + APoint.y; +end; + +operator + (const ASize: TfpgSize; APoint: TfpgPoint) s: TfpgSize; +begin + s.w := ASize.w + APoint.x; + s.h := ASize.h + APoint.y; +end; + +operator + (const ASize1, ASize2: TfpgSize) s: TfpgSize; +begin + s.w := ASize1.w + ASize2.w; + s.h := ASize1.h + ASize2.h; +end; + +operator + (const APoint: TPoint; i: Integer) p: TPoint; +begin + p.x := APoint.x + i; + p.y := APoint.y + i; +end; + +operator + (const APoint: TfpgPoint; i: Integer) p: TfpgPoint; +begin + p.x := APoint.x + i; + p.y := APoint.y + i; +end; + +operator + (const ASize: TfpgSize; i: Integer) s: TfpgSize; +begin + s.w := ASize.w + i; + s.h := ASize.h + i; +end; + +operator - (const APoint1, APoint2: TPoint) p: TPoint; +begin + p.x := APoint1.x - APoint2.x; + p.y := APoint1.y - APoint2.y; +end; + +operator - (const APoint1, APoint2: TfpgPoint) p: TfpgPoint; +begin + p.x := APoint1.x - APoint2.x; + p.y := APoint1.y - APoint2.y; +end; + +operator - (const APoint: TPoint; i: Integer) p: TPoint; +begin + p.x := APoint.x - i; + p.y := APoint.y - i; +end; + +operator - (const APoint: TfpgPoint; i: Integer) p: TfpgPoint; +begin + p.x := APoint.x - i; + p.y := APoint.y - i; +end; + +operator - (const ASize: TfpgSize; const APoint: TPoint) s: TfpgSize; +begin + s.w := ASize.w - APoint.x; + s.h := ASize.h - APoint.y; +end; + +operator - (const ASize: TfpgSize; const APoint: TfpgPoint) s: TfpgSize; +begin + s.w := ASize.w - APoint.x; + s.h := ASize.h - APoint.y; +end; + +operator - (const ASize: TfpgSize; i: Integer) s: TfpgSize; +begin + s.w := ASize.w - i; + s.h := ASize.h - i; +end; + +operator = (const AColor1, AColor2: TFPColor) b: Boolean; +begin + b := (AColor1.Red = AColor2.Red) + and (AColor1.Green = AColor2.Green) + and (AColor1.Blue = AColor2.Blue) + and (AColor1.Alpha = AColor2.Alpha); +end; + { TfpgTimer } procedure TfpgTimer.SetEnabled(const AValue: boolean); @@ -845,6 +1041,14 @@ begin Enabled := True; end; +procedure TfpgTimer.Pause(ASeconds: integer); +begin + if Enabled then + begin + FNextAlarm := incSecond(Now, ASeconds); + end; +end; + function fpgApplication: TfpgApplication; begin if not Assigned(uApplication) then @@ -869,7 +1073,10 @@ end; function fpgGetNamedColor(col: TfpgColor): TfpgColor; begin - Result := fpgNamedColors[col and $FF]; + if fpgIsNamedColor(col) then + Result := col // nothing to do, it is already a named color + else + Result := fpgNamedColors[col and $FF]; end; procedure fpgSetNamedColor(colorid, rgbvalue: longword); @@ -882,6 +1089,11 @@ begin fpgNamedColors[i] := rgbvalue; end; +function fpgIsNamedColor(col: TfpgColor): boolean; +begin + Result := (col and cl_BaseNamedColor) <> 0; +end; + function fpgGetNamedFontDesc(afontid: string): string; var n: integer; @@ -893,9 +1105,9 @@ begin Exit; //==> end; - {.$IFDEF DEBUG} + {$IFDEF DEBUG} Writeln('GetNamedFontDesc error: "' + afontid + '" is missing. Default is used.'); - {.$ENDIF} + {$ENDIF} Result := FPG_DEFAULT_FONT_DESC; end; @@ -952,6 +1164,7 @@ begin FHintPause := DEFAULT_HINT_PAUSE; FHintWidget := nil; // widget the mouse is over and whos hint text we need. FShowHint := True; + FStartDragDistance := 5; // pixels try inherited Create(AParams); @@ -1262,6 +1475,14 @@ begin FShowHint := AValue; end; +procedure TfpgApplication.SetStartDragDistance(const AValue: integer); +begin + if AValue < 0 then + FStartDragDistance := 0 + else + FStartDragDistance := AValue; +end; + procedure TfpgApplication.FreeFontRes(afontres: TfpgFontResource); var n: integer; @@ -1302,11 +1523,11 @@ end; procedure TfpgApplication.ProcessMessages; begin Flush; - while DoMessagesPending do - begin - WaitWindowMessage(0); - Flush; - end; +// while DoMessagesPending do // this blocked timers and other non-OS code +// begin + WaitWindowMessage(250); +// Flush; +// end; end; procedure TfpgApplication.SetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); @@ -1389,7 +1610,7 @@ end; procedure TfpgApplication.RunMessageLoop; begin - WaitWindowMessage(1000); + WaitWindowMessage(2000); end; { TfpgFont } @@ -1513,6 +1734,16 @@ begin DrawControlFrame(r.Left, r.Top, r.Width, r.Height); end; +procedure TfpgCanvas.DrawBevel(x, y, w, h: TfpgCoord; ARaised: Boolean); +begin + fpgStyle.DrawBevel(self, x, y, w, h, ARaised); +end; + +procedure TfpgCanvas.DrawBevel(r: TfpgRect; ARaised: Boolean); +begin + DrawBevel(r.Left, r.Top, r.Width, r.Height, ARaised); +end; + procedure TfpgCanvas.DrawDirectionArrow(x, y, w, h: TfpgCoord; direction: TArrowDirection); begin fpgStyle.DrawDirectionArrow(self, x, y, w, h, direction); @@ -1683,7 +1914,7 @@ begin fpgSetNamedColor(clText4, $404000); fpgSetNamedColor(clSelection, $08246A); fpgSetNamedColor(clSelectionText, $FFFFFF); - fpgSetNamedColor(clInactiveSel, $D0D0FF); + fpgSetNamedColor(clInactiveSel, $99A6BF); // win 2000 buttonface = $D4D0C8 fpgSetNamedColor(clInactiveSelText, $000000); fpgSetNamedColor(clScrollBar, $E8E4DB); fpgSetNamedColor(clButtonFace, $D5D2CD); @@ -1694,14 +1925,15 @@ begin fpgSetNamedColor(clInactiveWgFrame, $A0A0A0); fpgSetNamedColor(clTextCursor, $000000); fpgSetNamedColor(clChoiceListBox, $E8E8E8); - fpgSetNamedColor(clUnset, $D0D0FF); + fpgSetNamedColor(clUnset, $99A6BF); // dull (gray) blue fpgSetNamedColor(clMenuText, $000000); fpgSetNamedColor(clMenuDisabled, $909090); fpgSetNamedColor(clHintWindow, $FFFFBF); fpgSetNamedColor(clGridSelection, $08246A); // same as clSelection fpgSetNamedColor(clGridSelectionText, $FFFFFF); // same as clSelectionText - fpgSetNamedColor(clGridInactiveSel, $D0D0FF); // same as clInactiveSel + fpgSetNamedColor(clGridInactiveSel, $99A6BF); // same as clInactiveSel fpgSetNamedColor(clGridInactiveSelText, $000000); // same as clInactiveSelText + fpgSetNamedColor(clSplitterGrabBar, $839EFE); // pale blue // Global Font Objects @@ -1752,7 +1984,12 @@ begin if (btfIsEmbedded in AFlags) then ACanvas.SetColor(clHilite2) else - ACanvas.SetColor(clShadow2); + begin + if (btfFlat in AFlags) or (btfHover in AFlags) then + ACanvas.SetColor(clShadow1) { light shadow } + else + ACanvas.SetColor(clShadow2); { dark shadow } + end; end else ACanvas.SetColor(clHilite2); @@ -1774,14 +2011,27 @@ begin if (btfIsEmbedded in AFlags) then ACanvas.SetColor(clHilite1) else - ACanvas.SetColor(clShadow2); + begin + if (btfFlat in AFlags) or (btfHover in AFlags) then + ACanvas.SetColor(clHilite2) { light shadow } + else + ACanvas.SetColor(clShadow2); { dark shadow } + end; end else - ACanvas.SetColor(clShadow2); - + begin + if btfHover in AFlags then + ACanvas.SetColor(clShadow1) { light shadow } + else + ACanvas.SetColor(clShadow2); { dark shadow } + end; + ACanvas.DrawLine(r.Right, r.Top, r.Right, r.Bottom); // right ACanvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); // bottom + if (btfFlat in AFlags) or (btfHover in AFlags) then + exit; { "toolbar" style buttons need a nice thing/flat border } + // Right and Bottom (inner) if btfIsPressed in AFlags then begin @@ -1819,6 +2069,36 @@ begin ACanvas.DrawLine(r.Right-1, r.Bottom-1, r.Left+1, r.Bottom-1); // bottom (inner) end; +procedure TfpgStyle.DrawBevel(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; ARaised: Boolean); +var + r: TfpgRect; +begin + r.SetRect(x, y, w, h); + ACanvas.SetColor(clWindowBackground); + ACanvas.SetLineStyle(1, lsSolid); + ACanvas.FillRectangle(x, y, w, h); + + if ARaised then + ACanvas.SetColor(clHilite2) + else + ACanvas.SetColor(clShadow1); + + { top } + ACanvas.DrawLine(r.Right-1, r.Top, r.Left, r.Top); + + { left } + ACanvas.DrawLine(r.Left, r.Top, r.Left, r.Bottom); + + if ARaised then + ACanvas.SetColor(clShadow1) + else + ACanvas.SetColor(clHilite2); + + { right, then bottom } + ACanvas.DrawLine(r.Right, r.Top, r.Right, r.Bottom); + ACanvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); +end; + procedure TfpgStyle.DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: TArrowDirection); var { @@ -1917,6 +2197,50 @@ begin ACanvas.SetLineStyle(oldLineWidth, oldLineStyle); end; +procedure TfpgStyle.DrawMenuRow(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgMenuItemFlags); +begin + ACanvas.FillRectangle(r); +end; + +procedure TfpgStyle.DrawMenuItem(ACanvas: TfpgCanvas; r: TfpgRect; + AFlags: TfpgMenuItemFlags; AText: TfpgString); +begin + // +end; + +procedure TfpgStyle.DrawMenuItemSeparator(ACanvas: TfpgCanvas; r: TfpgRect); +begin + ACanvas.SetColor(clShadow1); + ACanvas.DrawLine(r.Left+1, r.Top+2, r.Right, r.Top+2); + ACanvas.SetColor(clHilite2); + ACanvas.DrawLine(r.Left+1, r.Top+3, r.Right, r.Top+3); +end; + +procedure TfpgStyle.DrawMenuItemImage(ACanvas: TfpgCanvas; x, y: TfpgCoord; r: TfpgRect; AFlags: TfpgMenuItemFlags); +var + img: TfpgImage; + lx: TfpgCoord; + ly: TfpgCoord; +begin + if mifChecked in AFlags then + begin + img := fpgImages.GetImage('stdimg.check'); // Do NOT localize + if mifSelected in AFlags then + img.Invert; // invert modifies the original image, so we must restore it later + ACanvas.DrawImage(x, y, img); + if mifSelected in AFlags then + img.Invert; // restore image to original state + end; + if mifSubMenu in AFlags then + begin + img := fpgImages.GetImage('sys.sb.right'); // Do NOT localize + lx := (r.height div 2) - 3; + lx := r.right-lx-2; + ly := y + ((r.Height-img.Height) div 2); + ACanvas.DrawImage(lx, ly, img); + end; +end; + { TfpgCaret } @@ -1967,6 +2291,7 @@ procedure TfpgCaret.UnSetCaret(ACanvas: TfpgCanvas); begin if (FCanvas = ACanvas) or (ACanvas = nil) then begin + FTimer.Enabled := False; FEnabled := False; FCanvas := nil; end; @@ -2158,6 +2483,42 @@ begin Result.UpdateImage; end; + +{ TfpgDrag } + +procedure TfpgDrag.SetMimeData(const AValue: TfpgMimeDataBase); +begin + if Assigned(FMimeData) then + FMimeData.Free; + FMimeData := AValue; +end; + +function TfpgDrag.GetSource: TfpgWindow; +begin + Result := TfpgWindow(inherited GetSource); +end; + +constructor TfpgDrag.Create(ASource: TfpgWindow); +begin + inherited Create; + FSource := ASource; +end; + +function TfpgDrag.Execute(const ADropActions: TfpgDropActions; + const ADefaultAction: TfpgDropAction): TfpgDropAction; +begin + {$NOTE These exception messages need to become resource strings } + if not Assigned(FMimeData) then + raise Exception.Create(ClassName + ': No mimedata was set before starting the drag'); + if not Assigned(FSource) then + raise Exception.Create(ClassName + ': No Source window was specified before starting the drag'); + if ADropActions = [] then + raise Exception.Create(ClassName + ': No Drop Action was specified'); + inherited Execute(ADropActions, ADefaultAction); +end; + + + initialization uApplication := nil; uClipboard := nil; diff --git a/src/corelib/fpg_msgqueue.inc b/src/corelib/fpg_msgqueue.inc index 386178d9..00862cc1 100644 --- a/src/corelib/fpg_msgqueue.inc +++ b/src/corelib/fpg_msgqueue.inc @@ -86,10 +86,15 @@ end; function fpgGetFirstMessage: PfpgMessageRec; begin - if UsedFirstMessage <> nil then - Result := @(UsedFirstMessage.msg) - else - Result := nil; + fpgApplication.Lock; + try + if UsedFirstMessage <> nil then + Result := @(UsedFirstMessage.msg) + else + Result := nil; + finally + fpgApplication.Unlock; + end; end; procedure fpgInitMsgQueue; diff --git a/src/corelib/fpg_stdimages.pas b/src/corelib/fpg_stdimages.pas index 2682ce3f..b25890ad 100644 --- a/src/corelib/fpg_stdimages.pas +++ b/src/corelib/fpg_stdimages.pas @@ -72,25 +72,25 @@ procedure fpgCreateStandardImages; begin // system images. Change these to the composite arrow bmp that includes // disabled state - fpgImages.AddBMP( + fpgImages.AddMaskedBMP( // 7x4 image 'sys.sb.up', @stdimg_arrow_up, - sizeof(stdimg_arrow_up)); + sizeof(stdimg_arrow_up), 0, 0); - fpgImages.AddBMP( + fpgImages.AddMaskedBMP( // 7x4 image 'sys.sb.down', @stdimg_arrow_down, - sizeof(stdimg_arrow_down)); + sizeof(stdimg_arrow_down), 0, 3); - fpgImages.AddBMP( + fpgImages.AddMaskedBMP( // 4x7 image 'sys.sb.left', @stdimg_arrow_left, - sizeof(stdimg_arrow_left)); + sizeof(stdimg_arrow_left), 0, 0); - fpgImages.AddBMP( + fpgImages.AddMaskedBMP( // 4x7 image 'sys.sb.right', @stdimg_arrow_right, - sizeof(stdimg_arrow_right)); + sizeof(stdimg_arrow_right), 3, 0); fpgImages.AddMaskedBMP( // 60x12 in total. 5 images of 12x12 each. 'sys.radiobuttons', @@ -225,6 +225,16 @@ begin sizeof(stdimg_folder_open_file_16), 0,0); fpgImages.AddMaskedBMP( + 'stdimg.folderhome', + @stdimg_folder_home_16, + sizeof(stdimg_folder_home_16), 0,0); + + fpgImages.AddMaskedBMP( + 'stdimg.bookmark', + @stdimg_bookmark_16, + sizeof(stdimg_bookmark_16), 0,0); + + fpgImages.AddMaskedBMP( 'stdimg.open', @stdimg_folder_open_16, sizeof(stdimg_folder_open_16), 0,0); @@ -250,6 +260,11 @@ begin sizeof(stdimg_help_16), 0,0); fpgImages.AddMaskedBMP( + 'stdimg.about', + @stdimg_about_16, + sizeof(stdimg_about_16), 0,0); + + fpgImages.AddMaskedBMP( 'stdimg.hidden', @stdimg_hidden, sizeof(stdimg_hidden), 0,0); diff --git a/src/corelib/fpg_stringutils.pas b/src/corelib/fpg_stringutils.pas index f97f1b61..e4d75f86 100644 --- a/src/corelib/fpg_stringutils.pas +++ b/src/corelib/fpg_stringutils.pas @@ -25,6 +25,9 @@ interface uses Classes, SysUtils, fpg_base; +type + TCharToUTF8Table = array[char] of PChar; + function UTF8CharacterLength(p: PChar): integer; function UTF8CharStart(UTF8Str: PChar; Len, Index: integer): PChar; @@ -34,7 +37,7 @@ function UTF8Length(const s: string): integer; function UTF8Length(p: PChar; ByteCount: integer): integer; function UTF8Pos(const SearchForText, SearchInText: string): integer; procedure UTF8Delete(var S: string; Index, Size: integer); -procedure UTF8Insert(const Source: string; var S: string; Index: integer); +procedure UTF8Insert(const SubStr: string; var AText: string; Index: integer); function UTF8CharAtByte(const s: string; const BytePos: integer; out aChar: string): integer; @@ -48,6 +51,16 @@ procedure Insert8(const Source: string; var S: string; Index: integer); function fpgCharAt(const s: TfpgString; Index: integer): TfpgChar; function fpgAppendPathDelim(const Path: TfpgString): TfpgString; function fpgRemovePathDelim(const Path: TfpgString): TfpgString; +function fpgTrimR(const AString, ATrim: TfpgString; ACaseSensitive: boolean = false): TfpgString; + + +// Encoding conversions +function CP437ToUTF8(const s: string): TfpgString; // DOS central europe +function CP850ToUTF8(const s: string): TfpgString; // DOS western europe +function IBMGraphToUTF8(const s: string): TfpgString; // IBM PC / DOS http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/IBMGRAPH.TXT +function IPFToUTF8(const s: string): TfpgString; // minor replacements to improve DocView output +function SingleByteToUTF8(const s: string; const Table: TCharToUTF8Table): TfpgString; + implementation @@ -261,16 +274,16 @@ begin S := b + e; end; -procedure UTF8Insert(const Source: string; var S: string; Index: integer); +procedure UTF8Insert(const SubStr: string; var AText: string; Index: integer); var b: string; e: string; begin - if UTF8Length(Source) = 0 then + if UTF8Length(SubStr) = 0 then Exit; //==> - b := UTF8Copy(S, 1, Index-1); // beginning string - e := UTF8Copy(S, Index, UTF8Length(S)-Index+1); // ending string - S := b + Source + e; + b := UTF8Copy(AText, 1, Index-1); // beginning string + e := UTF8Copy(AText, Index, UTF8Length(AText)-Index+1); // ending string + AText := b + SubStr + e; end; function UTF8CharAtByte(const s: string; const BytePos: integer; out aChar: string): integer; @@ -335,5 +348,1161 @@ begin Result := Path; end; +function fpgTrimR(const AString, ATrim: TfpgString; ACaseSensitive: boolean): TfpgString; +var + li: integer; +begin + if ACaseSensitive then + li := UTF8Pos(ATrim, AString) + else + li := UTF8Pos(UpperCase(ATrim), UpperCase(AString)); + + if li <> 0 then + Result := UTF8Copy(AString, 1, li - 1) + else + Result := AString; +end; + +const + ArrayCP437ToUTF8 : TCharToUTF8Table = ( + #0, // #0 + #1, // #1 + #2, // #2 + #3, // #3 + #4, // #4 + #5, // #5 + #6, // #6 + #$E2#$80#$A2, // #7 bullet + #8, // #8 + #9, // #9 + #10, // #10 + #11, // #11 + #12, // #12 + #13, // #13 + #14, // #14 + #15, // #15 + #16, // #16 + #17, // #17 + #18, // #18 + #19, // #19 + #20, // #20 + #21, // #21 + #22, // #22 + #23, // #23 + #$E2#$86#$91, // #24 up arrow + #$E2#$86#$93, // #25 down arrow + #$E2#$86#$92, // #26 right arrow + #$E2#$86#$90, // #27 left arrow + #28, // #28 + #29, // #29 + #30, // #30 + #31, // #31 + ' ', // ' ' + '!', // '!' + '"', // '"' + '#', // '#' + '$', // '$' + '%', // '%' + '&', // '&' + '''', // '''' + '(', // '(' + ')', // ')' + '*', // '*' + '+', // '+' + ',', // ',' + '-', // '-' + '.', // '.' + '/', // '/' + '0', // '0' + '1', // '1' + '2', // '2' + '3', // '3' + '4', // '4' + '5', // '5' + '6', // '6' + '7', // '7' + '8', // '8' + '9', // '9' + ':', // ':' + ';', // ';' + '<', // '<' + '=', // '=' + '>', // '>' + '?', // '?' + '@', // '@' + 'A', // 'A' + 'B', // 'B' + 'C', // 'C' + 'D', // 'D' + 'E', // 'E' + 'F', // 'F' + 'G', // 'G' + 'H', // 'H' + 'I', // 'I' + 'J', // 'J' + 'K', // 'K' + 'L', // 'L' + 'M', // 'M' + 'N', // 'N' + 'O', // 'O' + 'P', // 'P' + 'Q', // 'Q' + 'R', // 'R' + 'S', // 'S' + 'T', // 'T' + 'U', // 'U' + 'V', // 'V' + 'W', // 'W' + 'X', // 'X' + 'Y', // 'Y' + 'Z', // 'Z' + '[', // '[' + '\', // '\' + ']', // ']' + '^', // '^' + '_', // '_' + '`', // '`' + 'a', // 'a' + 'b', // 'b' + 'c', // 'c' + 'd', // 'd' + 'e', // 'e' + 'f', // 'f' + 'g', // 'g' + 'h', // 'h' + 'i', // 'i' + 'j', // 'j' + 'k', // 'k' + 'l', // 'l' + 'm', // 'm' + 'n', // 'n' + 'o', // 'o' + 'p', // 'p' + 'q', // 'q' + 'r', // 'r' + 's', // 's' + 't', // 't' + 'u', // 'u' + 'v', // 'v' + 'w', // 'w' + 'x', // 'x' + 'y', // 'y' + 'z', // 'z' + '{', // '{' + '|', // '|' + '}', // '}' + '~', // '~' + #127, // #127 + #195#135, // #128 + #195#188, // #129 + #195#169, // #130 + #195#162, // #131 + #195#164, // #132 + #195#160, // #133 + #195#165, // #134 + #195#167, // #135 + #195#170, // #136 + #195#171, // #137 + #195#168, // #138 + #195#175, // #139 + #195#174, // #140 + #195#172, // #141 + #195#132, // #142 + #195#133, // #143 + #195#137, // #144 + #195#166, // #145 + #195#134, // #146 + #195#180, // #147 + #195#182, // #148 + #195#178, // #149 + #195#187, // #150 + #195#185, // #151 + #195#191, // #152 + #195#150, // #153 + #195#156, // #154 + #194#162, // #155 + #194#163, // #156 + #194#165, // #157 + #226#130#167, // #158 + #198#146, // #159 + #195#161, // #160 + #195#173, // #161 + #195#179, // #162 + #195#186, // #163 + #195#177, // #164 + #195#145, // #165 + #194#170, // #166 + #194#186, // #167 + #194#191, // #168 + #226#140#144, // #169 + #194#172, // #170 + #194#189, // #171 + #194#188, // #172 + #194#161, // #173 + #194#171, // #174 + #194#187, // #175 + #226#150#145, // #176 + #226#150#146, // #177 + #226#150#147, // #178 + #226#148#130, // #179 + #226#148#164, // #180 + #226#149#161, // #181 + #226#149#162, // #182 + #226#149#150, // #183 + #226#149#149, // #184 + #226#149#163, // #185 + #226#149#145, // #186 + #226#149#151, // #187 + #226#149#157, // #188 + #226#149#156, // #189 + #226#149#155, // #190 + #226#148#144, // #191 + #226#148#148, // #192 + #226#148#180, // #193 + #226#148#172, // #194 + #226#148#156, // #195 + #226#148#128, // #196 + #226#148#188, // #197 + #226#149#158, // #198 + #226#149#159, // #199 + #226#149#154, // #200 + #226#149#148, // #201 + #226#149#169, // #202 + #226#149#166, // #203 + #226#149#160, // #204 + #226#149#144, // #205 + #226#149#172, // #206 + #226#149#167, // #207 + #226#149#168, // #208 + #226#149#164, // #209 + #226#149#165, // #210 + #226#149#153, // #211 + #226#149#152, // #212 + #226#149#146, // #213 + #226#149#147, // #214 + #226#149#171, // #215 + #226#149#170, // #216 + #226#148#152, // #217 + #226#148#140, // #218 + #226#150#136, // #219 + #226#150#132, // #220 + #226#150#140, // #221 + #226#150#144, // #222 + #226#150#128, // #223 + #206#177, // #224 + #195#159, // #225 + #206#147, // #226 + #207#128, // #227 + #206#163, // #228 + #207#131, // #229 + #194#181, // #230 + #207#132, // #231 + #206#166, // #232 + #206#152, // #233 + #206#169, // #234 + #206#180, // #235 + #226#136#158, // #236 + #207#134, // #237 + #206#181, // #238 + #226#136#169, // #239 + #226#137#161, // #240 + #194#177, // #241 + #226#137#165, // #242 + #226#137#164, // #243 + #226#140#160, // #244 + #226#140#161, // #245 + #195#183, // #246 + #226#137#136, // #247 + #194#176, // #248 + #226#136#153, // #249 + #194#183, // #250 + #226#136#154, // #251 + #226#129#191, // #252 + #194#178, // #253 + #226#150#160, // #254 + #194#160 // #255 + ); + + ArrayCP850ToUTF8 : TCharToUTF8Table = ( + #0, // #0 + #1, // #1 + #2, // #2 + #3, // #3 + #4, // #4 + #5, // #5 + #6, // #6 + #$E2#$80#$A2, // #7 bullet + #8, // #8 + #9, // #9 + #10, // #10 + #11, // #11 + #12, // #12 + #13, // #13 + #14, // #14 + #15, // #15 + #16, // #16 + #17, // #17 + #18, // #18 + #19, // #19 + #20, // #20 + #21, // #21 + #22, // #22 + #23, // #23 + #24, // #24 + #25, // #25 + #26, // #26 + #27, // #27 + #28, // #28 + #29, // #29 + #30, // #30 + #31, // #31 + ' ', // ' ' + '!', // '!' + '"', // '"' + '#', // '#' + '$', // '$' + '%', // '%' + '&', // '&' + '''', // '''' + '(', // '(' + ')', // ')' + '*', // '*' + '+', // '+' + ',', // ',' + '-', // '-' + '.', // '.' + '/', // '/' + '0', // '0' + '1', // '1' + '2', // '2' + '3', // '3' + '4', // '4' + '5', // '5' + '6', // '6' + '7', // '7' + '8', // '8' + '9', // '9' + ':', // ':' + ';', // ';' + '<', // '<' + '=', // '=' + '>', // '>' + '?', // '?' + '@', // '@' + 'A', // 'A' + 'B', // 'B' + 'C', // 'C' + 'D', // 'D' + 'E', // 'E' + 'F', // 'F' + 'G', // 'G' + 'H', // 'H' + 'I', // 'I' + 'J', // 'J' + 'K', // 'K' + 'L', // 'L' + 'M', // 'M' + 'N', // 'N' + 'O', // 'O' + 'P', // 'P' + 'Q', // 'Q' + 'R', // 'R' + 'S', // 'S' + 'T', // 'T' + 'U', // 'U' + 'V', // 'V' + 'W', // 'W' + 'X', // 'X' + 'Y', // 'Y' + 'Z', // 'Z' + '[', // '[' + '\', // '\' + ']', // ']' + '^', // '^' + '_', // '_' + '`', // '`' + 'a', // 'a' + 'b', // 'b' + 'c', // 'c' + 'd', // 'd' + 'e', // 'e' + 'f', // 'f' + 'g', // 'g' + 'h', // 'h' + 'i', // 'i' + 'j', // 'j' + 'k', // 'k' + 'l', // 'l' + 'm', // 'm' + 'n', // 'n' + 'o', // 'o' + 'p', // 'p' + 'q', // 'q' + 'r', // 'r' + 's', // 's' + 't', // 't' + 'u', // 'u' + 'v', // 'v' + 'w', // 'w' + 'x', // 'x' + 'y', // 'y' + 'z', // 'z' + '{', // '{' + '|', // '|' + '}', // '}' + '~', // '~' + #127, // #127 + #195#135, // #128 + #195#188, // #129 + #195#169, // #130 + #195#162, // #131 + #195#164, // #132 + #195#160, // #133 + #195#165, // #134 + #195#167, // #135 + #195#170, // #136 + #195#171, // #137 + #195#168, // #138 + #195#175, // #139 + #195#174, // #140 + #195#172, // #141 + #195#132, // #142 + #195#133, // #143 + #195#137, // #144 + #195#166, // #145 + #195#134, // #146 + #195#180, // #147 + #195#182, // #148 + #195#178, // #149 + #195#187, // #150 + #195#185, // #151 + #195#191, // #152 + #195#150, // #153 + #195#156, // #154 + #195#184, // #155 + #194#163, // #156 + #195#152, // #157 + #195#151, // #158 + #198#146, // #159 + #195#161, // #160 + #195#173, // #161 + #195#179, // #162 + #195#186, // #163 + #195#177, // #164 + #195#145, // #165 + #194#170, // #166 + #194#186, // #167 + #194#191, // #168 + #194#174, // #169 + #194#172, // #170 + #194#189, // #171 + #194#188, // #172 + #194#161, // #173 + #194#171, // #174 + #194#187, // #175 + #226#150#145, // #176 + #226#150#146, // #177 + #226#150#147, // #178 + #226#148#130, // #179 + #226#148#164, // #180 + #195#129, // #181 + #195#130, // #182 + #195#128, // #183 + #194#169, // #184 + #226#149#163, // #185 + #226#149#145, // #186 + #226#149#151, // #187 + #226#149#157, // #188 + #194#162, // #189 + #194#165, // #190 + #226#148#144, // #191 + #226#148#148, // #192 + #226#148#180, // #193 + #226#148#172, // #194 + #226#148#156, // #195 + #226#148#128, // #196 + #226#148#188, // #197 + #195#163, // #198 + #195#131, // #199 + #226#149#154, // #200 + #226#149#148, // #201 + #226#149#169, // #202 + #226#149#166, // #203 + #226#149#160, // #204 + #226#149#144, // #205 + #226#149#172, // #206 + #194#164, // #207 + #195#176, // #208 + #195#144, // #209 + #195#138, // #210 + #195#139, // #211 + #195#136, // #212 + #196#177, // #213 + #195#141, // #214 + #195#142, // #215 + #195#143, // #216 + #226#148#152, // #217 + #226#148#140, // #218 + #226#150#136, // #219 + #226#150#132, // #220 + #194#166, // #221 + #195#140, // #222 + #226#150#128, // #223 + #195#147, // #224 + #195#159, // #225 + #195#148, // #226 + #195#146, // #227 + #195#181, // #228 + #195#149, // #229 + #194#181, // #230 + #195#190, // #231 + #195#158, // #232 + #195#154, // #233 + #195#155, // #234 + #195#153, // #235 + #195#189, // #236 + #195#157, // #237 + #194#175, // #238 + #194#180, // #239 + #194#173, // #240 + #194#177, // #241 + #226#128#151, // #242 + #194#190, // #243 + #194#182, // #244 + #194#167, // #245 + #195#183, // #246 + #194#184, // #247 + #194#176, // #248 + #194#168, // #249 + #194#183, // #250 + #194#185, // #251 + #194#179, // #252 + #194#178, // #253 + #226#150#160, // #254 + #194#160 // #255 + ); + + + + ArrayIBMGraphToUTF8: TCharToUTF8Table = ( + #0, // #0 + #1, // #1 + #2, // #2 + #3, // #3 + #4, // #4 + #5, // #5 + #6, // #6 + #$E2#$80#$A2, // #7 bullet + #8, // #8 + #9, // #9 + #10, // #10 + #11, // #11 + #12, // #12 + #13, // #13 + #14, // #14 + #15, // #15 + #16, // #16 + #$E2#$86#$90, // #17 + #18, // #18 + #19, // #19 + #20, // #20 + #21, // #21 + #22, // #22 + #23, // #23 + #$E2#$86#$91, // #24 up arrow + #$E2#$86#$93, // #25 down arrow + #$E2#$86#$92, // #26 right arrow + #$E2#$86#$90, // #27 left arrow + #28, // #28 + #29, // #29 left arrow + #30, // #30 + #31, // #31 + ' ', // ' ' + '!', // '!' + '"', // '"' + '#', // '#' + '$', // '$' + '%', // '%' + '&', // '&' + '''', // '''' + '(', // '(' + ')', // ')' + '*', // '*' + '+', // '+' + ',', // ',' + '-', // '-' + '.', // '.' + '/', // '/' + '0', // '0' + '1', // '1' + '2', // '2' + '3', // '3' + '4', // '4' + '5', // '5' + '6', // '6' + '7', // '7' + '8', // '8' + '9', // '9' + ':', // ':' + ';', // ';' + '<', // '<' + '=', // '=' + '>', // '>' + '?', // '?' + '@', // '@' + 'A', // 'A' + 'B', // 'B' + 'C', // 'C' + 'D', // 'D' + 'E', // 'E' + 'F', // 'F' + 'G', // 'G' + 'H', // 'H' + 'I', // 'I' + 'J', // 'J' + 'K', // 'K' + 'L', // 'L' + 'M', // 'M' + 'N', // 'N' + 'O', // 'O' + 'P', // 'P' + 'Q', // 'Q' + 'R', // 'R' + 'S', // 'S' + 'T', // 'T' + 'U', // 'U' + 'V', // 'V' + 'W', // 'W' + 'X', // 'X' + 'Y', // 'Y' + 'Z', // 'Z' + '[', // '[' + '\', // '\' + ']', // ']' + '^', // '^' + '_', // '_' + '`', // '`' + 'a', // 'a' + 'b', // 'b' + 'c', // 'c' + 'd', // 'd' + 'e', // 'e' + 'f', // 'f' + 'g', // 'g' + 'h', // 'h' + 'i', // 'i' + 'j', // 'j' + 'k', // 'k' + 'l', // 'l' + 'm', // 'm' + 'n', // 'n' + 'o', // 'o' + 'p', // 'p' + 'q', // 'q' + 'r', // 'r' + 's', // 's' + 't', // 't' + 'u', // 'u' + 'v', // 'v' + 'w', // 'w' + 'x', // 'x' + 'y', // 'y' + 'z', // 'z' + '{', // '{' + '|', // '|' + '}', // '}' + '~', // '~' + #127, // #127 + #195#135, // #128 + #195#188, // #129 + #195#169, // #130 + #195#162, // #131 + #195#164, // #132 + #195#160, // #133 + #195#165, // #134 + #195#167, // #135 + #195#170, // #136 + #195#171, // #137 + #195#168, // #138 + #195#175, // #139 + #195#174, // #140 + #195#172, // #141 + #195#132, // #142 + #195#133, // #143 + #195#137, // #144 + #195#166, // #145 + #195#134, // #146 + #195#180, // #147 + #195#182, // #148 + #195#178, // #149 + #195#187, // #150 + #195#185, // #151 + #195#191, // #152 + #195#150, // #153 + #195#156, // #154 + #194#162, // #155 + #194#163, // #156 + #194#165, // #157 + #226#130#167, // #158 + #198#146, // #159 + #195#161, // #160 + #195#173, // #161 + #195#179, // #162 + #195#186, // #163 + #195#177, // #164 + #195#145, // #165 + #194#170, // #166 + #194#186, // #167 + #194#191, // #168 + #226#140#144, // #169 + #194#172, // #170 + #194#189, // #171 + #194#188, // #172 + #194#161, // #173 + #194#171, // #174 + #194#187, // #175 + #226#150#145, // #176 + #226#150#146, // #177 + #226#150#147, // #178 + #226#148#130, // #179 + #226#148#164, // #180 + #226#149#161, // #181 + #226#149#162, // #182 + #226#149#150, // #183 + #226#149#149, // #184 + #226#149#163, // #185 + #226#149#145, // #186 + #226#149#151, // #187 + #226#149#157, // #188 + #226#149#156, // #189 + #226#149#155, // #190 + #226#148#144, // #191 + #226#148#148, // #192 + #226#148#180, // #193 + #226#148#172, // #194 + #226#148#156, // #195 + #226#148#128, // #196 + #226#148#188, // #197 + #226#149#158, // #198 + #226#149#159, // #199 + #226#149#154, // #200 + #226#149#148, // #201 + #226#149#169, // #202 + #226#149#166, // #203 + #226#149#160, // #204 + #226#149#144, // #205 + #226#149#172, // #206 + #226#149#167, // #207 + #226#149#168, // #208 + #226#149#164, // #209 + #226#149#165, // #210 + #226#149#153, // #211 + #226#149#152, // #212 + #226#149#146, // #213 + #226#149#147, // #214 + #226#149#171, // #215 + #226#149#170, // #216 + #226#148#152, // #217 + #226#148#140, // #218 + #226#150#136, // #219 + #226#150#132, // #220 + #226#150#140, // #221 + #226#150#144, // #222 + #226#150#128, // #223 + #206#177, // #224 + #195#159, // #225 + #206#147, // #226 + #207#128, // #227 + #206#163, // #228 + #207#131, // #229 + #194#181, // #230 + #207#132, // #231 + #206#166, // #232 + #206#152, // #233 + #206#169, // #234 + #206#180, // #235 + #226#136#158, // #236 + #207#134, // #237 + #206#181, // #238 + #226#136#169, // #239 + #226#137#161, // #240 + #194#177, // #241 + #226#137#165, // #242 + #226#137#164, // #243 + #226#140#160, // #244 + #226#140#161, // #245 + #195#183, // #246 + #226#137#136, // #247 + #194#176, // #248 + #226#136#153, // #249 + #194#183, // #250 + #226#136#154, // #251 + #226#129#191, // #252 + #194#178, // #253 + #226#150#160, // #254 + #194#160 // #255 + ); + + ArrayIPFToUTF8 : TCharToUTF8Table = ( + #0, // #0 + #1, // #1 + #2, // #2 + #3, // #3 + #4, // #4 + #5, // #5 + #6, // #6 + #$E2#$80#$A2, // #7 bullet (hard-coded in IPF Compiler) + #8, // #8 + #9, // #9 + #10, // #10 + #$E2#$97#$84, // #11 + #12, // #12 + #13, // #13 + #14, // #14 + #15, // #15 + '>', // #16 + '<', // #17 + #18, // #18 + #19, // #19 + #20, // #20 + #21, // #21 + #22, // #22 + #23, // #23 + #24, // #24 up arrow + #25, // #25 down arrow + #26, // #26 right arrow + #27, // #27 left arrow + #28, // #28 + #29, // #29 + #30, // #30 + #31, // #31 + ' ', // ' ' + '!', // '!' + '"', // '"' + '#', // '#' + '$', // '$' + '%', // '%' + '&', // '&' + '''', // '''' + '(', // '(' + ')', // ')' + '*', // '*' + '+', // '+' + ',', // ',' + '-', // '-' + '.', // '.' + '/', // '/' + '0', // '0' + '1', // '1' + '2', // '2' + '3', // '3' + '4', // '4' + '5', // '5' + '6', // '6' + '7', // '7' + '8', // '8' + '9', // '9' + ':', // ':' + ';', // ';' + '<', // '<' + '=', // '=' + '>', // '>' + '?', // '?' + '@', // '@' + 'A', // 'A' + 'B', // 'B' + 'C', // 'C' + 'D', // 'D' + 'E', // 'E' + 'F', // 'F' + 'G', // 'G' + 'H', // 'H' + 'I', // 'I' + 'J', // 'J' + 'K', // 'K' + 'L', // 'L' + 'M', // 'M' + 'N', // 'N' + 'O', // 'O' + 'P', // 'P' + 'Q', // 'Q' + 'R', // 'R' + 'S', // 'S' + 'T', // 'T' + 'U', // 'U' + 'V', // 'V' + 'W', // 'W' + 'X', // 'X' + 'Y', // 'Y' + 'Z', // 'Z' + '[', // '[' + '\', // '\' + ']', // ']' + '^', // '^' + '_', // '_' + '`', // '`' + 'a', // 'a' + 'b', // 'b' + 'c', // 'c' + 'd', // 'd' + 'e', // 'e' + 'f', // 'f' + 'g', // 'g' + 'h', // 'h' + 'i', // 'i' + 'j', // 'j' + 'k', // 'k' + 'l', // 'l' + 'm', // 'm' + 'n', // 'n' + 'o', // 'o' + 'p', // 'p' + 'q', // 'q' + 'r', // 'r' + 's', // 's' + 't', // 't' + 'u', // 'u' + 'v', // 'v' + 'w', // 'w' + 'x', // 'x' + 'y', // 'y' + 'z', // 'z' + '{', // '{' + '|', // '|' + '}', // '}' + '~', // '~' + #$E2#$8C#$82, // #127 house + #128, // #195#135 + #129, // #195#188 + #130, // #195#169 + #131, // #195#162 + #132, // #195#164 + #133, // #195#160 + #134, // #195#165 + #135, // #195#167 + #136, // #195#170 + #137, // #195#171 + #138, // #195#168 + #139, // #195#175 + #140, // #195#174 + #141, // #195#172 + #142, // #195#132 + #143, // #195#133 + #144, // #195#137 + #145, // #195#166 + #146, // #195#134 + #147, // #195#180 + #148, // #195#182 + #149, // #195#178 + #150, // #195#187 + #151, // #195#185 + #152, // #195#191 + #153, // #195#150 + #154, // #195#156 + #155, // #194#162 + #156, // #194#163 + #157, // #194#165 + #158, // #226#130#167 + #159, // #198#146 + #160, // #195#161 + #161, // #195#173 + #162, // #195#179 + #163, // #195#186 + #164, // #195#177 + #165, // #195#145 + #166, // #194#170 + #167, // #194#186 + #168, // #194#191 + #169, // #226#140#144 + #170, // #194#172 + #171, // #194#189 + #172, // #194#188 + #173, // #194#161 + #174, // #194#171 + #175, // #194#187 + #176, // #226#150#145 + #177, // #226#150#146 + #178, // #226#150#147 + #179, // #226#148#130 + #180, // #226#148#164 + #181, // #226#149#161 + #182, // #226#149#162 + #183, // #226#149#150 + #184, // #226#149#149 + #185, // #226#149#163 + #186, // #226#149#145 + #187, // #226#149#151 + #188, // #226#149#157 + #189, // #226#149#156 + #190, // #226#149#155 + #191, // #226#148#144 + #192, // #226#148#148 + #193, // #226#148#180 + #$E2#$94#$AC, // #226#148#172 + #195, // #226#148#156 + #$E2#$94#$80, // #196 + #197, // #226#148#188 + #198, // #226#149#158 + #199, // #226#149#159 + #200, // #226#149#154 + #201, // #226#149#148 + #202, // #226#149#169 + #203, // #226#149#166 + #204, // #226#149#160 + #205, // #226#149#144 + #206, // #226#149#172 + #207, // #226#149#167 + #208, // #226#149#168 + #209, // #226#149#164 + #210, // #226#149#165 + #211, // #226#149#153 + #212, // #226#149#152 + #213, // #226#149#146 + #214, // #226#149#147 + #215, // #226#149#171 + #216, // #226#149#170 + #217, // #226#148#152 + #218, // #226#148#140 + #219, // #226#150#136 + #220, // #226#150#132 + #221, // #226#150#140 + #222, // #226#150#144 + #223, // #226#150#128 + #224, // #206#177 + #225, // #195#159 + #226, // #206#147 + #227, // #207#128 + #228, // #206#163 + #229, // #207#131 + #230, // #194#181 + #231, // #207#132 + #232, // #206#166 + #233, // #206#152 + #234, // #206#169 + #235, // #206#180 + #236, // #226#136#158 + #237, // #207#134 + #238, // #206#181 + #239, // #226#136#169 + #240, // #226#137#161 + #241, // #194#177 + #242, // #226#137#165 + #243, // #226#137#164 + #244, // #226#140#160 + #245, // #226#140#161 + #246, // #195#183 + #247, // #226#137#136 + #248, // #194#176 + #249, // #226#136#153 + #250, // #194#183 + #251, // #226#136#154 + #252, // #226#129#191 + #253, // #194#178 + #254, // #226#150#160 + #255 // #194#160 + ); + + +function CP437ToUTF8(const s: string): TfpgString; +begin + Result := SingleByteToUTF8(s, ArrayCP437ToUTF8); +end; + +function CP850ToUTF8(const s: string): TfpgString; +begin + Result := SingleByteToUTF8(s, ArrayCP850ToUTF8); +end; + +function IBMGraphToUTF8(const s: string): TfpgString; +begin + Result := SingleByteToUTF8(s, ArrayIBMGraphToUTF8); +end; + +function IPFToUTF8(const s: string): TfpgString; + // Seaches <AValue> and replaces <ADel> with <AIns>. Case sensitive. + function tiStrTran(AValue, ADel, AIns : string): string; + var + i : integer; + sToChange : string; + begin + result := ''; + sToChange := AValue; + i := UTF8Pos(ADel, sToChange); + while i <> 0 do + begin + result := result + UTF8Copy(sToChange, 1, i-1) + AIns; + UTF8Delete(sToChange, 1, i+UTF8length(ADel)-1); + i := UTF8Pos(ADel, sToChange); + end; + result := result + sToChange; + end; + +begin + // IBM Graph CodePage 437 (kind-of) to Unicode mapping. + // Below is what we had before this function + Result := SingleByteToUTF8(s, ArrayIPFToUTF8); + //Result := s; + //Result := StringReplace(Result, Chr($07), #$E2#$80#$A2, [rfReplaceAll, rfIgnoreCase]); // u+2022 small bullet + //Result := tiStrTran(Result, Char(16), '>' ); + //Result := tiStrTran(Result, Char(17), '<' ); + //Result := tiStrTran(Result, Char($1f), 'â–¼' ); + //Result := tiStrTran(Result, Char(179), '│' ); + //Result := tiStrTran(Result, Char(180), '┤' ); + //Result := tiStrTran(Result, Char(191), 'â”' ); + //Result := tiStrTran(Result, Char(192), 'â””' ); + //Result := tiStrTran(Result, Char(193), 'â”´' ); + //Result := tiStrTran(Result, Char(194), '┬' ); + //Result := tiStrTran(Result, Char(195), '├' ); + //Result := tiStrTran(Result, Char(196), '─' ); + //Result := tiStrTran(Result, Char(197), '┼' ); + //Result := tiStrTran(Result, Char(217), '┘' ); + //Result := tiStrTran(Result, Char(218), '┌' ); +end; + +function SingleByteToUTF8(const s: string; const Table: TCharToUTF8Table): TfpgString; +var + len: Integer; + i: Integer; + Src: PChar; + Dest: PChar; + p: PChar; + c: Char; +begin + if s='' then + begin + Result := s; + exit; + end; + len := length(s); + SetLength(Result, len*4); // UTF-8 is at most 4 bytes + Src := PChar(s); + Dest := PChar(Result); + for i := 1 to len do + begin + c := Src^; + inc(Src); + //if ord(c) < 128 then + //begin + // Dest^ := c; + // inc(Dest); + //end + //else + begin + p := Table[c]; + if p <> nil then + begin + while p^ <> #0 do + begin + Dest^ := p^; + inc(p); + inc(Dest); + end; + end; + end; + end; + SetLength(Result, PtrUInt(Dest)-PtrUInt(Result)); +end; + + end. diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index d4d7886c..822051a5 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -31,6 +31,7 @@ uses function fpgToOSEncoding(aString: TfpgString): string; function fpgFromOSEncoding(aString: string): TfpgString; procedure fpgOpenURL(const aURL: TfpgString); +function fpgFileSize(const AFilename: TfpgString): integer; // *** Common functions for all platforms *** @@ -40,6 +41,11 @@ function fpgAppendPathDelim(const Path: TfpgString): TfpgString; function fpgHasSubDirs(const Dir: TfpgString; AShowHidden: Boolean): Boolean; function fpgAllFilesMask: TfpgString; function fpgConvertLineEndings(const s: TfpgString): TfpgString; +function fpgGetToolkitConfigDir: TfpgString; +{ This is so that when we support LTR and RTL languages, the colon will be + added at the correct place. } +function fpgAddColon(const AText: TfpgString): TfpgString; +function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean; // RTL wrapper filesystem functions with platform independant encoding @@ -51,12 +57,16 @@ function fpgGetCurrentDir: TfpgString; function fpgSetCurrentDir(const NewDir: TfpgString): Boolean; function fpgExpandFileName(const FileName: TfpgString): TfpgString; function fpgFileExists(const FileName: TfpgString): Boolean; +function fpgDeleteFile(const FileName: TfpgString): Boolean; function fpgDirectoryExists(const ADirectory: TfpgString): Boolean; function fpgExtractFileDir(const FileName: TfpgString): TfpgString; function fpgExtractFilePath(const FileName: TfpgString): TfpgString; function fpgExtractFileName(const FileName: TfpgString): TfpgString; function fpgExtractFileExt(const FileName: TfpgString): TfpgString; function fpgForceDirectories(const ADirectory: TfpgString): Boolean; +function fpgChangeFileExt(const FileName, Extension: TfpgString): TfpgString; +function fpgGetAppConfigDir(const Global: Boolean): TfpgString; +function fpgGetAppConfigFile(const Global: Boolean; const SubDir: Boolean): TfpgString; implementation @@ -120,6 +130,13 @@ begin Result := FileExists(fpgToOSEncoding(FileName)); end; +function fpgDeleteFile(const FileName: TfpgString): Boolean; +begin + { Don't remove 'SysUtils.' prefix, it is required under Windows, other + FPC tries to use Windows.DeleteFile API - which is wrong } + Result := SysUtils.DeleteFile(fpgToOSEncoding(FileName)); +end; + function fpgDirectoryExists(const ADirectory: TfpgString): Boolean; begin Result := DirectoryExists(fpgToOSEncoding(ADirectory)); @@ -150,6 +167,21 @@ begin Result := ForceDirectories(fpgToOSEncoding(ADirectory)); end; +function fpgChangeFileExt(const FileName, Extension: TfpgString): TfpgString; +begin + Result := ChangeFileExt(fpgToOSEncoding(Filename), Extension); +end; + +function fpgGetAppConfigDir(const Global: Boolean): TfpgString; +begin + Result := fpgFromOSEncoding(GetAppConfigDir(Global)); +end; + +function fpgGetAppConfigFile(const Global: Boolean; const SubDir: Boolean): TfpgString; +begin + Result := fpgFromOSEncoding(GetAppConfigFile(Global, SubDir)); +end; + function fpgAppendPathDelim(const Path: TfpgString): TfpgString; begin if (Path <> '') and (Path[length(Path)] <> PathDelim) then @@ -191,7 +223,7 @@ begin break; until fpgFindNext(FileInfo) <> 0; finally - FindClose(FileInfo); + SysUtils.FindClose(FileInfo); end; end; end; @@ -227,6 +259,22 @@ begin Inc(i); end; +function fpgGetToolkitConfigDir: TfpgString; +begin + Result := fpgTrimR(fpgGetAppConfigDir(False), ApplicationName, True) + FPG_CONFIG_DIR; +end; + +function fpgAddColon(const AText: TfpgString): TfpgString; +begin + { TODO : Check language direction and add colon at appropriate end. This is very crude! } + Result := AText + ':'; +end; + +function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean; +begin + Result := (AData and (1 shl AIndex) <> 0); +end; + end. diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 39bb4193..5e3ba007 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -34,12 +34,19 @@ type THintEvent = procedure(Sender: TObject; var AHint: TfpgString) of object; + TfpgDragEnterEvent = procedure(Sender, Source: TObject; AMimeList: TStringList; var AMimeChoice: TfpgString; var ADropAction: TfpgDropAction; var Accept: Boolean) of object; + TfpgDragDropEvent = procedure(Sender, Source: TObject; X, Y: integer; AData: variant) of object; + TfpgWidget = class(TfpgWindow) private + FAcceptDrops: boolean; FAlignRect: TfpgRect; FOnClick: TNotifyEvent; FOnDoubleClick: TMouseButtonEvent; + FOnDragDrop: TfpgDragDropEvent; + FOnDragEnter: TfpgDragEnterEvent; + FOnDragLeave: TNotifyEvent; FOnEnter: TNotifyEvent; FOnExit: TNotifyEvent; FOnMouseDown: TMouseButtonEvent; @@ -52,9 +59,12 @@ type FOnResize: TNotifyEvent; FOnScreen: boolean; FOnShowHint: THintEvent; + FDragStartPos: TfpgPoint; + alist: TList; procedure SetActiveWidget(const AValue: TfpgWidget); function IsShowHintStored: boolean; procedure SetFormDesigner(const AValue: TObject); + procedure SetAlign(const AValue: TAlign); protected procedure MsgPaint(var msg: TfpgMessageRec); message FPGM_PAINT; procedure MsgResize(var msg: TfpgMessageRec); message FPGM_RESIZE; @@ -69,6 +79,8 @@ type procedure MsgMouseEnter(var msg: TfpgMessageRec); message FPGM_MOUSEENTER; procedure MsgMouseExit(var msg: TfpgMessageRec); message FPGM_MOUSEEXIT; procedure MsgMouseScroll(var msg: TfpgMessageRec); message FPGM_SCROLL; + procedure MsgDropEnter(var msg: TfpgMessageRec); message FPGM_DROPENTER; + procedure MsgDropExit(var msg: TfpgMessageRec); message FPGM_DROPEXIT; protected FFormDesigner: TObject; FVisible: boolean; @@ -85,6 +97,8 @@ type FBackgroundColor: TfpgColor; FTextColor: TfpgColor; FIsContainer: Boolean; + FOnClickPending: Boolean; + procedure SetAcceptDrops(const AValue: boolean); virtual; function GetOnShowHint: THintEvent; virtual; procedure SetOnShowHint(const AValue: THintEvent); virtual; procedure SetBackgroundColor(const AValue: TfpgColor); virtual; @@ -98,7 +112,7 @@ type function GetHint: TfpgString; virtual; procedure SetHint(const AValue: TfpgString); virtual; procedure DoUpdateWindowPosition; override; - procedure DoAlign(AAlign: TAlign); + procedure DoAlignment; procedure DoResize; procedure DoShowHint(var AHint: TfpgString); procedure HandlePaint; virtual; @@ -122,7 +136,7 @@ type procedure InternalHandleShow; virtual; procedure HandleHide; virtual; procedure MoveAndResize(ALeft, ATop, AWidth, AHeight: TfpgCoord); - procedure RePaint; + procedure RePaint; virtual; { property events } property OnClick: TNotifyEvent read FOnClick write FOnClick; property OnDoubleClick: TMouseButtonEvent read FOnDoubleClick write FOnDoubleClick; @@ -141,8 +155,6 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure AfterConstruction; override; - function GetClientRect: TfpgRect; virtual; - function GetBoundsRect: TfpgRect; virtual; function InDesigner: boolean; procedure InvokeHelp; virtual; procedure Realign; @@ -153,6 +165,7 @@ type procedure Invalidate; // double check this works as developers expect???? property FormDesigner: TObject read FFormDesigner write SetFormDesigner; property Parent: TfpgWidget read GetParent write SetParent; + property AcceptDrops: boolean read FAcceptDrops write SetAcceptDrops default False; property ActiveWidget: TfpgWidget read FActiveWidget write SetActiveWidget; property IsContainer: Boolean read FIsContainer; property Visible: boolean read FVisible write SetVisible default True; @@ -161,13 +174,16 @@ type { Is the widget allowed to receive keyboard focus. } property Focusable: boolean read FFocusable write FFocusable default False; property Focused: boolean read FFocused write FFocused default False; - property Anchors: TAnchors read FAnchors write FAnchors; - property Align: TAlign read FAlign write FAlign; + property Anchors: TAnchors read FAnchors write FAnchors default [anLeft, anTop]; + property Align: TAlign read FAlign write SetAlign default alNone; property Hint: TfpgString read GetHint write SetHint; property ShowHint: boolean read FShowHint write SetShowHint stored IsShowHintStored; property ParentShowHint: boolean read FParentShowHint write SetParentShowHint default True; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; property TextColor: TfpgColor read FTextColor write SetTextColor default clText1; + property OnDragEnter: TfpgDragEnterEvent read FOnDragEnter write FOnDragEnter; + property OnDragLeave: TNotifyEvent read FOnDragLeave write FOnDragLeave; + property OnDragDrop: TfpgDragDropEvent read FOnDragDrop write FOnDragDrop; end; @@ -181,7 +197,8 @@ implementation uses fpg_constants, - fpg_menu; + fpg_menu, + fpg_form; { for OnKeyPress handling } var @@ -202,6 +219,33 @@ begin end; end; +function CompareInts(i1, i2: integer): integer; +begin + if i1 < i2 then + Result := -1 + else if i1 > i2 then + Result := 1 + else + Result := 0; +end; + +function AlignCompare(p1, p2: Pointer): integer; +var + w1: TfpgWidget; + w2: TfpgWidget; +begin + w1 := TfpgWidget(p1); + w2 := TfpgWidget(p2); + case w1.Align of + alTop: Result := CompareInts(w1.Top, w2.Top); + alBottom: Result := CompareInts(w2.Top, w1.Top); + alLeft: Result := CompareInts(w1.Left, w2.Left); + alRight: Result := CompareInts(w2.Left, w1.Left); + else + Result := 0; + end; +end; + { TfpgWidget } @@ -234,6 +278,14 @@ begin FActiveWidget.HandleSetFocus; end; +procedure TfpgWidget.SetAcceptDrops(const AValue: boolean); +begin + if FAcceptDrops = AValue then + exit; + FAcceptDrops := AValue; + DoAcceptDrops(AValue); +end; + function TfpgWidget.GetHint: TfpgString; begin Result := FHint; @@ -256,6 +308,14 @@ begin end; end; +procedure TfpgWidget.SetAlign(const AValue: TAlign); +begin + if FAlign = AValue then + Exit; + FAlign := AValue; + Realign; +end; + procedure TfpgWidget.SetVisible(const AValue: boolean); begin if FVisible = AValue then @@ -341,16 +401,6 @@ begin end; end; -function TfpgWidget.GetClientRect: TfpgRect; -begin - Result.SetRect(0, 0, Width, Height); -end; - -function TfpgWidget.GetBoundsRect: TfpgRect; -begin - Result.SetRect(Left, Top, Width+1, Height+1); -end; - function TfpgWidget.InDesigner: boolean; begin Result := (FFormDesigner <> nil) @@ -416,7 +466,9 @@ begin FShowHint := False; FParentShowHint := True; FBackgroundColor := clWindowBackground; - FTextColor := clText1; + FTextColor := clText1; + FAcceptDrops := False; + FOnClickPending := False; inherited Create(AOwner); @@ -487,6 +539,7 @@ var ss: TShiftState; consumed: boolean; wg: TfpgWidget; + wlast: TfpgWidget; begin if InDesigner then begin @@ -502,13 +555,27 @@ begin HandleKeyPress(key, ss, consumed); if not consumed then begin + { work it's way to one before top level form - forms are not focusable remember } wg := Parent; + wlast := wg; while (not consumed) and (wg <> nil) do begin wg.HandleKeyPress(key, ss, consumed); + wlast := wg; wg := wg.Parent; end; end; + { we should now be at the top level form } + if (not consumed) and (wlast <> nil) then + begin + if (wlast is TfpgForm) and Assigned(wlast.OnKeyPress) then + wlast.OnKeyPress(self, key, ss, consumed); + end; + { now finaly, lets give fpgApplication a chance } + if (not consumed) and Assigned(fpgApplication.OnKeyPress) then + begin + fpgApplication.OnKeyPress(self, key, ss, consumed); + end; end; procedure TfpgWidget.MsgKeyRelease(var msg: TfpgMessageRec); @@ -559,6 +626,7 @@ begin case msg.Params.mouse.Buttons of MOUSE_LEFT: begin + FDragStartPos.SetPoint(msg.Params.mouse.x, msg.Params.mouse.y); mb := mbLeft; HandleLMouseDown(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.shiftstate); end; @@ -585,6 +653,7 @@ var IsDblClick: boolean; begin // writeln('TfpgWidget.MsgMouseUp'); + FDragActive := False; if InDesigner then begin FFormDesigner.Dispatch(msg); @@ -600,6 +669,7 @@ begin case msg.Params.mouse.Buttons of MOUSE_LEFT: begin + FOnClickPending := True; mb := mbLeft; if uLastClickWidget = self then IsDblClick := ((fpgGetTickCount - uLastClickTime) <= DOUBLECLICK_MS) @@ -613,7 +683,7 @@ begin uLastClickTime := fpgGetTickCount; if IsDblClick then begin - + FOnClickPending := False; { When Double Click occurs we don't want single click } HandleDoubleClick(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.Buttons, msg.Params.mouse.shiftstate); if Assigned(FOnDoubleClick) then FOnDoubleClick(self, mb, msg.Params.mouse.shiftstate, @@ -649,6 +719,16 @@ begin Exit; end; + if (msg.Params.mouse.Buttons and MOUSE_LEFT) = MOUSE_LEFT then + begin + if not FDragActive and (FDragStartPos.ManhattanLength(fpgPoint(msg.Params.mouse.x, msg.Params.mouse.y)) > fpgApplication.StartDragDistance) then + begin + FDragActive := True; + // In Windows dragging is a blocking function, so FDragActive is false after this call + DoDragStartDetected; + end; + end; + HandleMouseMove(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.Buttons, msg.Params.mouse.shiftstate); if Assigned(OnMouseMove) then OnMouseMove(self, msg.Params.mouse.shiftstate, @@ -710,6 +790,16 @@ begin msg.Params.mouse.shiftstate, msg.Params.mouse.delta); end; +procedure TfpgWidget.MsgDropEnter(var msg: TfpgMessageRec); +begin + // do nothing +end; + +procedure TfpgWidget.MsgDropExit(var msg: TfpgMessageRec); +begin + // do nothing +end; + function TfpgWidget.GetOnShowHint: THintEvent; begin Result := FOnShowHint; @@ -942,7 +1032,7 @@ end; procedure TfpgWidget.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); begin - if Assigned(FOnClick) then + if FOnClickPending and Assigned(FOnClick) then FOnClick(self); end; @@ -1119,25 +1209,39 @@ var dy: integer; dw: integer; dh: integer; + w: TfpgWidget; begin if (csLoading in ComponentState) then Exit; //==> // writeln('HandleAlignments - ', Classname); FAlignRect := GetClientRect; - DoAlign(alTop); - DoAlign(alBottom); - DoAlign(alLeft); - DoAlign(alRight); - DoAlign(alClient); + alist := TList.Create; + try + for n := 0 to ComponentCount - 1 do + if Components[n] is TfpgWidget then + begin + w := TfpgWidget(Components[n]); + if (w.Align <> alNone) and (w.Visible) then + alist.Add(w); + end; + + DoAlignment; + //DoAlign(alTop); + //DoAlign(alBottom); + //DoAlign(alLeft); + //DoAlign(alRight); + //DoAlign(alClient); + finally + alist.Free; + end; // handle anchors finally for alNone for n := 0 to ComponentCount - 1 do if (Components[n] is TfpgWidget) then begin wg := TfpgWidget(Components[n]); - if (wg.FAlign = alNone) and - ((anBottom in wg.Anchors) or (anRight in wg.Anchors)) then + if (wg.FAlign = alNone) and ([anLeft, anTop] <> wg.Anchors) then begin // we must alter the window dx := 0; @@ -1145,15 +1249,21 @@ begin dw := 0; dh := 0; - if (anLeft in wg.Anchors) and (anRight in wg.Anchors) then - dw := dwidth - else if anRight in wg.Anchors then - dx := dwidth; - - if (anTop in wg.Anchors) and (anBottom in wg.Anchors) then - dh := dheight - else if anBottom in wg.Anchors then - dy := dheight; + if (anRight in wg.Anchors) then + if (anLeft in wg.Anchors) then + dw := dwidth + else + dx := dwidth + else if not (anLeft in wg.Anchors) then + dx := (dwidth div 2); + + if (anBottom in wg.Anchors) then + if (anTop in wg.Anchors) then + dh := dheight + else + dy := dheight + else if not (anTop in wg.Anchors) then + dy := (dheight div 2); wg.MoveAndResizeBy(dx, dy, dw, dh); end; @@ -1188,55 +1298,16 @@ begin MoveAndResize(FLeft + dx, FTop + dy, FWidth + dw, FHeight + dh); end; -function CompareInts(i1, i2: integer): integer; -begin - if i1 < i2 then - Result := -1 - else if i1 > i2 then - Result := 1 - else - Result := 0; -end; - -function AlignCompare(p1, p2: Pointer): integer; +procedure TfpgWidget.DoAlignment; var - w1: TfpgWidget; - w2: TfpgWidget; -begin - w1 := TfpgWidget(p1); - w2 := TfpgWidget(p2); - case w1.Align of - alTop: Result := CompareInts(w1.Top, w2.Top); - alBottom: Result := CompareInts(w2.Top, w1.Top); - alLeft: Result := CompareInts(w1.Left, w2.Left); - alRight: Result := CompareInts(w2.Left, w1.Left); - else - Result := 0; - end; -end; - -procedure TfpgWidget.DoAlign(AAlign: TAlign); -var - alist: TList; w: TfpgWidget; n: integer; begin - alist := TList.Create; - for n := 0 to ComponentCount - 1 do - if Components[n] is TfpgWidget then - begin - w := TfpgWidget(Components[n]); - if (w.Align = AAlign) and (w.Visible) then - alist.Add(w); - end; - - alist.Sort(@AlignCompare); - // and process this list in order for n := 0 to alist.Count - 1 do begin w := TfpgWidget(alist[n]); - case AAlign of + case w.Align of alTop: begin w.MoveAndResize(FAlignRect.Left, FAlignRect.Top, FAlignRect.Width, w.Height); @@ -1267,8 +1338,6 @@ begin w.MoveAndResize(FAlignRect.Left, FAlignRect.Top, FAlignRect.Width, FAlignRect.Height); end; { case } end; - - alist.Free; end; procedure TfpgWidget.DoResize; diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index e242bfb6..6f95d8a8 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -24,19 +24,25 @@ unit fpg_gdi; {$mode objfpc}{$H+} {.$Define Debug} +{.$Define DND_DEBUG} interface uses - Windows, Classes, SysUtils, + Windows, + ActiveX, fpg_base, - fpg_impl; + fpg_impl + {$IFDEF DEBUG} + ,dbugintf + {$ENDIF DEBUG} + ,fpg_OLEDragDrop + ; { Constants missing on windows unit } const - WM_MOUSEWHEEL = $020a; // we could remove this since FPC 2.0.4 VER_PLATFORM_WIN32_CE = 3; CLEARTYPE_QUALITY = 5; @@ -50,6 +56,8 @@ var type // forward declaration TfpgGDIWindow = class; + TGDIDragManager = class; + TfpgGDIDrag = class; TfpgGDIFontResource = class(TfpgFontResourceBase) @@ -140,13 +148,25 @@ type TfpgGDIWindow = class(TfpgWindowBase) private + FDropManager: TfpgOLEDropTarget; + FDropPos: TPoint; + FUserMimeSelection: TfpgString; + FUserAcceptDrag: Boolean; + function GetDropManager: TfpgOLEDropTarget; + procedure HandleDNDLeave(Sender: TObject); + procedure HandleDNDEnter(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD); + procedure HandleDNDPosition(Sender: TObject; KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect); + procedure HandleDNDDrop(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect); + private FMouseInWindow: boolean; FNonFullscreenRect: TfpgRect; FNonFullscreenStyle: longword; FFullscreenIsSet: boolean; FSkipResizeMessage: boolean; + QueueAcceptDrops: boolean; function DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean; procedure WindowSetFullscreen(aFullScreen, aUpdate: boolean); + property DropManager: TfpgOLEDropTarget read GetDropManager; protected FWinHandle: TfpgWinHandle; FModalForWin: TfpgGDIWindow; @@ -164,9 +184,13 @@ type //procedure MoveToScreenCenter; override; procedure DoSetWindowTitle(const ATitle: string); override; procedure DoSetMouseCursor; override; + procedure DoDNDEnabled(const AValue: boolean); override; + procedure DoAcceptDrops(const AValue: boolean); override; + procedure DoDragStartDetected; override; property WinHandle: TfpgWinHandle read FWinHandle; public constructor Create(AOwner: TComponent); override; + destructor Destroy; override; procedure ActivateWindow; override; procedure CaptureMouse; override; procedure ReleaseMouse; override; @@ -175,6 +199,10 @@ type TfpgGDIApplication = class(TfpgApplicationBase) + private + FDrag: TfpgGDIDrag; + procedure SetDrag(const AValue: TfpgGDIDrag); + property Drag: TfpgGDIDrag read FDrag write SetDrag; protected FDisplay: HDC; WindowClass: TWndClass; @@ -234,6 +262,42 @@ type end; + TfpgGDIMimeDataBase = class(TfpgMimeDataBase) + end; + + + { Used mainly for sending drags - being the source of the drag } + TfpgGDIDrag = class(TfpgDragBase) + private + function StringToHandle(const AString: TfpgString): HGLOBAL; + protected + FSource: TfpgGDIWindow; + function GetSource: TfpgGDIWindow; virtual; + public + destructor Destroy; override; + function Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction=daCopy): TfpgDropAction; override; + end; + + + { Used mainly for receiving drags - being the target of the drag } + TGDIDragManager = class(TInterfacedObject, IDropTarget) + private + FDropTarget: TfpgWindowBase; { actually a TfpgWidget } + FRegistered: boolean; + { IDropTarget } + function DragEnter(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult;StdCall; + function DragOver(grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult;StdCall; + function DragLeave: HResult;StdCall; + function Drop(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD):HResult;StdCall; + public + constructor Create(ADropTarget: TfpgWindowBase); reintroduce; + destructor Destroy; override; + procedure RegisterDragDrop; + procedure RevokeDragDrop; + property DropTarget: TfpgWindowBase read FDropTarget; { actually a TfpgWidget } + end; + + implementation uses @@ -249,7 +313,7 @@ var wapplication: TfpgApplication; MouseFocusedWH: HWND; OldMousePos: TPoint; // used to detect fake MouseMove events - + NeedToUnitialize: Boolean; // some required keyboard functions {$INCLUDE fpg_keys_gdi.inc} @@ -434,20 +498,68 @@ begin {$ENDIF} end; +{ ********** Some helper conversion functions ************* } + function WinkeystateToShiftstate(keystate: cardinal): TShiftState; begin - result:= []; - if GetKeyState(vk_menu) < 0 then begin + Result := []; + if GetKeyState(vk_menu) < 0 then Include(result, ssAlt); - end; - if GetKeyState(vk_shift) < 0 then begin + if GetKeyState(vk_shift) < 0 then Include(result, ssShift); - end; - if GetKeyState(vk_control) < 0 then begin + if GetKeyState(vk_control) < 0 then Include(result, ssCtrl); - end; end; +function TranslateToFPGDropActions(const pdwEffects: DWORD): TfpgDropActions; +begin + Result := [daIgnore]; + if (pdwEffects and DROPEFFECT_LINK) <> 0 then + Result := Result + [daLink]; + if (pdwEffects and DROPEFFECT_COPY) <> 0 then + Result := Result + [daCopy]; + if (pdwEffects and DROPEFFECT_MOVE) <> 0 then + Result := Result + [daMove]; +end; + +function TranslateToFPGDropAction(const pdwEffects: DWORD): TfpgDropAction; +begin + if (pdwEffects and DROPEFFECT_LINK) <> 0 then + Result := daLink + else if (pdwEffects and DROPEFFECT_COPY) <> 0 then + Result := daCopy + else if (pdwEffects and DROPEFFECT_MOVE) <> 0 then + Result := daMove + else + Result := daIgnore; +end; + +function TranslateToWinDragEffects(const AActions: TfpgDropActions): DWORD; +begin + Result := DROPEFFECT_NONE; + if daLink in AActions then + Result := Result or DROPEFFECT_LINK; + if daCopy in AActions then + Result := Result or DROPEFFECT_COPY; + if daMove in AActions then + Result := Result or DROPEFFECT_MOVE; +end; + +function TranslateToWinDragEffect(const AAction: TfpgDropAction): DWORD; +begin + if AAction = daIgnore then + Result := DROPEFFECT_NONE + else if daLink = AAction then + Result := DROPEFFECT_LINK + else if daCopy = AAction then + Result := DROPEFFECT_COPY + else if daMove = AAction then + Result := DROPEFFECT_MOVE + else + Result := DROPEFFECT_NONE; { fallback, but should never be reached } +end; + + {$IFDEF wince} procedure WinCESetDibBits(BMP: HBITMAP; awidth, aheight: Integer; aimgdata: Pointer; var bi: TBitmapInfo); var @@ -631,7 +743,7 @@ begin if not (w is TfpgGDIWindow) then begin - {$IFDEF DEBUG} writeln('fpGFX/GDI: Unable to detect Window - using DefWindowProc'); {$ENDIF} + {$IFDEF DEBUG} SendDebug('fpGFX/GDI: Unable to detect Window - using DefWindowProc'); {$ENDIF} Result := Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); Exit; //==> end; @@ -646,8 +758,7 @@ begin WM_KEYDOWN, WM_SYSKEYDOWN: begin - {$IFDEF DEBUG} write(w.ClassName + ': '); {$ENDIF} - {$IFDEF DEBUG} writeln('wm_char, wm_keyup, wm_keydown'); {$ENDIF} + {$IFDEF DEBUG} SendDebug(w.ClassName + ': wm_char, wm_keyup, wm_keydown'); {$ENDIF} kwg := FindKeyboardFocus; if kwg <> nil then w := kwg; @@ -725,16 +836,15 @@ begin if uMsg = WM_MOUSEMOVE then begin {$IFDEF DEBUG} - Writeln('old x=', OldMousePos.x, ' y=', OldMousePos.y); - writeln('new x=', msgp.mouse.x, ' y=', msgp.mouse.y); - writeln('---'); + SendDebugFmt('old x=%d y=%d', [OldMousePos.x, OldMousePos.y]); + SendDebugFmt('new x=%d y=%d', [msgp.mouse.x, msgp.mouse.y]); {$ENDIF} // Check for fake MouseMove messages - Windows sucks! if (OldMousePos.x = msgp.mouse.x) and (OldMousePos.y = msgp.mouse.y) then begin {$IFDEF DEBUG} - writeln('We received fake MouseMove messages'); + SendDebug('We received fake MouseMove messages'); {$ENDIF} Exit; //==> end @@ -790,7 +900,7 @@ begin WM_RBUTTONDOWN: begin {$IFDEF DEBUG} - writeln('fpGUI/GDI:', w.ClassName + ': MouseButtonDown event'); + SendDebug('fpGUI/GDI: ' + w.ClassName + ': MouseButtonDown event'); {$ENDIF} // This is temporary and we should try and move it to // the UI Designer code instead. @@ -807,7 +917,7 @@ begin WM_RBUTTONUP: begin {$IFDEF DEBUG} - writeln('fpGFX/GDI:', w.ClassName + ': MouseButtonUp event'); + SendDebug('fpGFX/GDI: '+ w.ClassName + ': MouseButtonUp event'); {$ENDIF} // This is temporary and we should try and move it to // the UI Designer code instead. @@ -875,8 +985,7 @@ begin msgp.rect.Height := smallint((lParam and $FFFF0000) shr 16); {$IFDEF DEBUG} - write(w.ClassName + ': '); - writeln('WM_SIZE: width=',msgp.rect.width, ' height=',msgp.rect.height); + SendDebugFmt('%s: WM_SIZE w=%d h=%d', [w.ClassName, msgp.rect.width, msgp.rect.Height]); {$ENDIF} // skip minimize... if lparam <> 0 then @@ -886,8 +995,7 @@ begin WM_MOVE: begin {$IFDEF DEBUG} - write(w.ClassName + ': '); - writeln('WM_MOVE'); + SendDebug(w.ClassName + ': WM_MOVE'); {$ENDIF} // window decoration correction ... if (GetWindowLong(w.WinHandle, GWL_STYLE) and WS_CHILD) = 0 then @@ -908,8 +1016,7 @@ begin WM_MOUSEWHEEL: begin {$IFDEF DEBUG} - write(w.ClassName + ': '); - writeln('WM_MOUSEWHEEL: wp=',IntToHex(wparam,8), ' lp=',IntToHex(lparam,8)); + SendDebugFmt('%s: WM_MOUSEWHEEL: wp=%s lp=%s', [w.ClassName, IntToHex(wparam,8), IntToHex(lparam,8)]); {$ENDIF} pt.x := GET_X_LPARAM(lParam); pt.y := GET_Y_LPARAM(lParam); @@ -941,7 +1048,7 @@ begin WM_ACTIVATE: // We currently use WM_NCACTIVATE instead! begin {$IFDEF DEBUG} - writeln(w.ClassName + ': WM_ACTIVATE'); + SendDebug(w.ClassName + ': WM_ACTIVATE'); {$ENDIF} if (Lo(wParam) = WA_INACTIVE) then fpgSendMessage(nil, w, FPGM_DEACTIVATE) @@ -955,11 +1062,19 @@ begin Result := 0; end; + WM_TIMECHANGE: + begin + {$IFDEF DEBUG} + SendDebug(w.ClassName + ': WM_TIMECHANGE'); + {$ENDIF} + writeln('fpGUI/GDI: ' + w.ClassName + ': WM_TIMECHANGE'); + fpgResetAllTimers; + end; + WM_NCACTIVATE: begin {$IFDEF DEBUG} - write(w.ClassName + ': WM_NCACTIVATE '); - writeln(wParam); + SendDebugFmt('%s: WM_NCACTIVATE wparam=%d', [w.ClassName, wParam]); {$ENDIF} if (wParam = 0) then fpgSendMessage(nil, w, FPGM_DEACTIVATE) @@ -969,7 +1084,7 @@ begin if (PopupListFirst <> nil) and (PopupListFirst.Visible) then begin {$IFDEF DEBUG} - writeln(' Blockmsg = True (part 1) : ' + PopupListFirst.ClassName); + SendDebug(' Blockmsg = True (part 1) : ' + PopupListFirst.ClassName); {$ENDIF} // This is ugly but needed for now to get TfpgCombobox to work if (PopupListFirst.ClassName <> 'TDropDownWindow') then @@ -1002,8 +1117,7 @@ begin WM_CLOSE: begin {$IFDEF DEBUG} - write(w.ClassName + ': '); - writeln('WM_Close'); + SendDebug(w.ClassName + ': WM_Close'); {$ENDIF} fpgSendMessage(nil, w, FPGM_CLOSE, msgp); end; @@ -1011,8 +1125,7 @@ begin WM_PAINT: begin {$IFDEF DEBUG} - write(w.ClassName + ': '); - writeln('WM_PAINT'); + SendDebug(w.ClassName + ': WM_PAINT'); {$ENDIF} Windows.BeginPaint(w.WinHandle, @PaintStruct); fpgSendMessage(nil, w, FPGM_PAINT, msgp); @@ -1060,6 +1173,13 @@ begin Result.Sort; end; +procedure TfpgGDIApplication.SetDrag(const AValue: TfpgGDIDrag); +begin + if Assigned(FDrag) then + FDrag.Free; + FDrag := AValue; +end; + function TfpgGDIApplication.GetHiddenWindow: HWND; begin if (FHiddenWindow = 0) then @@ -1137,6 +1257,8 @@ end; destructor TfpgGDIApplication.Destroy; begin + if Assigned(FDrag) then + FDrag.Free; UnhookWindowsHookEx(ActivationHook); inherited Destroy; end; @@ -1163,6 +1285,8 @@ begin if (atimeoutms >= 0) and (not DoMessagesPending) then begin + if Assigned(FOnIdle) then + OnIdle(self); if atimeoutms > 0 then timerid := Windows.SetTimer(ltimerWnd, 1, atimeoutms, nil) else @@ -1229,7 +1353,153 @@ end; var // this are required for Windows MouseEnter & MouseExit detection. uLastWindowHndl: TfpgWinHandle; - + +procedure TfpgGDIWindow.HandleDNDLeave(Sender: TObject); +var + wg: TfpgWidget; +begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIWindow.HandleDNDLeave '); + {$ENDIF} + FUserMimeSelection := ''; + wg := self as TfpgWidget; + if wg.AcceptDrops then { if we get here, this should always be true anyway } + begin + if Assigned(wg.OnDragLeave) then + wg.OnDragLeave(nil); + end; +end; + +procedure TfpgGDIWindow.HandleDNDEnter(Sender: TObject; DataObj: IDataObject; + KeyState: Longint; PT: TPoint; var Effect: DWORD); +var + wg: TfpgWidget; + lMimeList: TStringList; + lMimeChoice: TfpgString; + lAccept: Boolean; + lDropAction: TfpgDropAction; + EnumIntf: IEnumFORMATETC; + msgp: TfpgMessageParams; +begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIWindow.HandleDNDEnter '); + {$ENDIF} + wg := self as TfpgWidget; + if wg.AcceptDrops then + begin + lAccept := False; + + { enumerate the available formats and return them as a StringList } + lMimeList := EnumDataToStringList(DataObj); + try + if lMimeList.Count > 0 then + lMimeChoice := lMimeList[0] + else + {$NOTE We need to replace this message with a resouce string } + raise Exception.Create('fpGUI/GDI: no mime types available for DND operation'); + + lDropAction := TranslateToFPGDropAction(Effect); + if Assigned(wg.OnDragEnter) then + wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept); + finally + lMimeList.Free; + end; + if not lAccept then + Effect := DROPEFFECT_NONE + else + begin + Effect := TranslateToWinDragEffect(lDropAction); + FUserMimeSelection := lMimeChoice; + FUserAcceptDrag := True; + end; + + { Notify widget of drag status, so it can update its look } + if lAccept then + begin + FDropPos.x := PT.x; + FDropPos.y := PT.y; + fillchar(msgp, sizeof(msgp), 0); + msgp.mouse.x := PT.x; + msgp.mouse.y := PT.y; + fpgPostMessage(nil, wg, FPGM_DROPENTER, msgp); + end; + end; +end; + +procedure TfpgGDIWindow.HandleDNDPosition(Sender: TObject; KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect); +var + msgp: TfpgMessageParams; + wg: TfpgWidget; +begin + wg := self as TfpgWidget; + { Notify widget of drag status, so it can update its look. We do the pos + check because OLE framework calls DragOver repeatedly even if the mouse + doesn't move, but simply because the mouse is over the widget. We don't + want that, for performance reasons. } + if FDropPos <> PT then + begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIWindow.HandleDNDPosition '); + {$ENDIF} + FDropPos.x := PT.x; + FDropPos.y := PT.y; + fillchar(msgp, sizeof(msgp), 0); + msgp.mouse.x := PT.x; + msgp.mouse.y := PT.y; + fpgPostMessage(nil, wg, FPGM_DROPENTER, msgp); + end; +end; + +procedure TfpgGDIWindow.HandleDNDDrop(Sender: TObject; DataObj: IDataObject; + KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect); +var + FE: FORMATETC; + stgmed: STGMEDIUM; + data: pchar; + wg: TfpgWidget; + CF: DWORD; + lIsTranslated: Boolean; +begin + if not FUserAcceptDrag then + exit; + + {$IFDEF DND_DEBUG} + Writeln('TfpgGDIWindow.HandleDNDDrop'); + {$ENDIF} + + wg := self as TfpgWidget; + { construct a FORMATETC object } + CF := WindowsClipboardLookup(FUserMimeSelection, lIsTranslated); + FE := GetFormatEtc(CF); + + if DataObj.QueryGetData(FE) = S_OK then + begin + if DataObj.GetData(FE, stgmed) = S_OK then + begin + { Yippie! the data is there, so go get it! } + data := GlobalLock(stgmed.HGLOBAL); + if Assigned(wg.OnDragDrop) then + wg.OnDragDrop(self, nil, pt.x, pt.y, data); + GlobalUnlock(stgmed.HGLOBAL); + { release the data using the COM API } + ReleaseStgMedium(stgmed); + end; + end; +end; + +function TfpgGDIWindow.GetDropManager: TfpgOLEDropTarget; +begin + if not Assigned(FDropManager) then + begin + FDropManager := TfpgOLEDropTarget.Create(self); + FDropManager.OnDragLeave := @HandleDNDLeave; + FDropManager.OnDragEnter := @HandleDNDEnter; + FDropManager.OnDragOver := @HandleDNDPosition; + FDropManager.OnDragDrop := @HandleDNDDrop; + end; + Result := FDropManager; +end; + function TfpgGDIWindow.DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean; var pt, spt: Windows.POINT; @@ -1392,8 +1662,12 @@ begin end else if WindowType = wtModalForm then begin - // set parent window to special hidden window. It helps to hide window taskbar button. - FParentWinHandle := wapplication.GetHiddenWindow; + if FocusRootWidget <> nil then + FParentWinHandle := FocusRootWidget.WinHandle + else + // set parent window to special hidden window. It helps to hide window taskbar button. + FParentWinHandle := wapplication.GetHiddenWindow; + // for modal windows, this is necessary FWinStyle := WS_OVERLAPPEDWINDOW or WS_POPUPWINDOW; FWinStyle := FWinStyle and not (WS_MINIMIZEBOX); @@ -1496,6 +1770,11 @@ begin // the forms require some adjustments before the Window appears SetWindowParameters; FSkipResizeMessage := False; + + if QueueAcceptDrops then + begin + DoAcceptDrops(True); + end; end; procedure TfpgGDIWindow.DoReleaseWindowHandle; @@ -1611,11 +1890,56 @@ begin SetCursor(hc); end; +procedure TfpgGDIWindow.DoDNDEnabled(const AValue: boolean); +begin + { GDI has nothing to do here } +end; + +procedure TfpgGDIWindow.DoAcceptDrops(const AValue: boolean); +begin + if AValue then + begin + if HasHandle then + DropManager.RegisterDragDrop + else + QueueAcceptDrops := True; // we need to do this once we have a winhandle + end + else + begin + if HasHandle then + DropManager.RevokeDragDrop; + QueueAcceptDrops := False; + end; +end; + +procedure TfpgGDIWindow.DoDragStartDetected; +begin + inherited DoDragStartDetected; + { In windows OLE dragging is a blocking function, so it never returns until + OnStartDragDetected is complete. So we need to set FDragActive to False + here. } + FDragActive := False; + if Assigned(wapplication.FDrag) then + FreeAndNil(wapplication.FDrag); +end; + constructor TfpgGDIWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); FWinHandle := 0; + FDropManager := nil; + FDropPos.x := 0; + FDropPos.y := 0; FFullscreenIsSet := false; + FUserMimeSelection := ''; + FUserAcceptDrag := False; +end; + +destructor TfpgGDIWindow.Destroy; +begin + if Assigned(FDropManager) then + FDropManager.Free; + inherited Destroy; end; procedure TfpgGDIWindow.ActivateWindow; @@ -2350,36 +2674,47 @@ begin end; procedure TfpgGDIClipboard.DoSetText(const AValue: TfpgString); +var + mem: THandle; + po2: PWideChar; + str: PWideChar; begin FClipboardText := AValue; - if OpenClipboard(FClipboardWndHandle) then + if OpenClipboard(0) then begin - EmptyClipboard; - SetClipboardData(CF_TEXT, 0); + str := PWideChar(Utf8Decode(AValue)); + if EmptyClipboard then + begin + // Allocate a global memory object for the text. + mem:= globalalloc(GMEM_MOVEABLE or GMEM_DDESHARE, (length(AValue)+1)*2); + if mem <> 0 then + begin + po2:= globallock(mem); + if po2 <> nil then + begin + move(str^, po2^, (length(AValue)+1)*2); + globalunlock(mem); + if SetClipboardData(CF_UNICODETEXT,longword(mem)) <> 0 then + begin + //writeln('Successfully copied to clipboard'); + end; + end + else + begin + globalfree(mem); + end; + end; + end; CloseClipboard; end; end; procedure TfpgGDIClipboard.InitClipboard; begin - {$WARNING This does not work! 'FPGUI' window class was not registered, - so CreateWindowEx always returns 0} - FClipboardWndHandle := Windows.CreateWindowEx( - 0, // extended window style - 'FPGUI', // registered class name - nil, // window name - 0, // window style - 0, // horizontal position of window - 0, // vertical position of window - 10, // window width - 10, // window height - 0, // handle to parent or owner window - 0, // menu handle or child identifier - MainInstance, // handle to application instance - nil // window-creation data - ); + // nothing to do here end; + { TfpgGDIFileList } function TfpgGDIFileList.EncodeAttributesString(attrs: longword @@ -2440,9 +2775,196 @@ begin inherited PopulateSpecialDirs(aDirectory); end; +{ TfpgGDIDrag } + +function TfpgGDIDrag.StringToHandle(const AString: TfpgString): HGLOBAL; +var + dest: HGLOBAL; + l: integer; + p: PChar; +begin + p := PChar(AString); + l := Length(AString)+1; + { allocate and lock a global memory buffer. Make it fixed + data so we don't have to use GlobalLock } + dest := GlobalAlloc(GMEM_FIXED, l); + { Copy the string into the buffer } + Move(p^, PChar(dest)^, l); + Result := dest; +end; + +function TfpgGDIDrag.GetSource: TfpgGDIWindow; +begin + Result := FSource; +end; + +destructor TfpgGDIDrag.Destroy; +begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIDrag.Destroy '); + {$ENDIF} + inherited Destroy; +end; + +function TfpgGDIDrag.Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction): TfpgDropAction; +var + dwEffect: DWORD; + dwResult: HRESULT; + i: Integer; + F: PFormatEtc; + S: string; + M: PStgMedium; + itm: TfpgMimeDataItem; + lEffects: DWORD; + FDataObject: TfpgOLEDataObject; + FDropSource: TfpgOLEDropSource; + lIsTranslated: boolean; +begin + { TODO: this still needs to be implemented } + if FDragging then + begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIDrag.Execute (already dragging)'); + {$ENDIF} + Result := daIgnore; + end + else + begin + {$IFDEF DND_DEBUG} + writeln('TfpgGDIDrag.Execute (new drag)'); + {$ENDIF} + FDragging := True; + wapplication.Drag := self; + lEffects := TranslateToWinDragEffects(ADropActions); + FDataObject := TfpgOLEDataObject.Create; + + for i := 0 to FMimeData.Count-1 do + begin + F := nil; + M := nil; + lIsTranslated := False; + {$Note OLE DND: We are only handling strings at the moment, this needs to be extended to other types too } + itm := FMimeData[i]; + {$IFDEF DND_DEBUG} + writeln(' Processing mime-type: ', itm.Format); + {$ENDIF} + + { description of data we are sending } + New(F); + F^.cfFormat := WindowsClipboardLookup(itm.format, lIsTranslated); + F^.ptd := nil; + F^.dwAspect := DVASPECT_CONTENT; + F^.lindex := -1; + F^.tymed := TYMED_HGLOBAL; + FDataObject.FormatEtcList.Add(F); + + { storage for data we are sending } + s := itm.data; + New(M); + M^.tymed := TYMED_HGLOBAL; + M^.hGlobal := StringToHandle(s); + FDataObject.StgMediumList.Add(M); + + { Original mime type was translated to a known Windows CF_ formats, add + mimetype string as-is as well } + if lIsTranslated then + begin + New(F); + F^.cfFormat := RegisterClipboardFormat(PChar(itm.format)); + F^.ptd := nil; + F^.dwAspect := DVASPECT_CONTENT; + F^.lindex := -1; + F^.tymed := TYMED_HGLOBAL; + FDataObject.FormatEtcList.Add(F); + + { storage for data we are sending } + s := itm.data; + New(M); + M^.tymed := TYMED_HGLOBAL; + M^.hGlobal := StringToHandle(s); + FDataObject.StgMediumList.Add(M); + end; + end; + + { Now let OLE take over from here } + FDropSource := TfpgOLEDropSource.Create; + dwResult := ActiveX.DoDragDrop( FDataObject as IDataObject, + FDropSource as IDropSource, + lEffects, + @dwEffect); + Result := TranslateToFPGDropAction(dwEffect); + + if dwResult = DRAGDROP_S_DROP then + begin + { which action did the user select, and act accordingly } + if dwEffect = DROPEFFECT_COPY then + begin + // nothing to do here + end; + if dwEffect = DROPEFFECT_MOVE then + begin + // Sowehow we need to remove the data from source + end; + end; + +// (FDropSource as IUnknown)._Release; +// (FDataObject as IUnknown)._Release; + end; +end; + +{ TGDIDragManager } + +function TGDIDragManager.DragEnter(const dataObj: IDataObject; + grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult; StdCall; +begin + +end; + +function TGDIDragManager.DragOver(grfKeyState: DWORD; pt: TPoint; + var dwEffect: DWORD): HResult; StdCall; +begin + +end; + +function TGDIDragManager.DragLeave: HResult; StdCall; +begin + +end; + +function TGDIDragManager.Drop(const dataObj: IDataObject; grfKeyState: DWORD; + pt: TPoint; var dwEffect: DWORD): HResult; StdCall; +begin + +end; + +constructor TGDIDragManager.Create(ADropTarget: TfpgWindowBase); +begin + inherited Create; + FDropTarget := ADropTarget; + FRegistered := False; +end; + +destructor TGDIDragManager.Destroy; +begin + if FRegistered then + RevokeDragDrop; + inherited Destroy; +end; + +procedure TGDIDragManager.RegisterDragDrop; +begin + Activex.RegisterDragDrop(TfpgWidget(FDropTarget).WinHandle, self as IDropTarget) +end; + +procedure TGDIDragManager.RevokeDragDrop; +begin + ActiveX.RevokeDragDrop(TfpgWidget(FDropTarget).WinHandle); +end; + initialization wapplication := nil; MouseFocusedWH := 0; + NeedToUnitialize := Succeeded(OleInitialize(nil)); {$IFDEF WinCE} UnicodeEnabledOS := True; @@ -2460,5 +2982,9 @@ initialization FontSmoothingType := ANTIALIASED_QUALITY; {$ENDIF} +finalization + if NeedToUnitialize then + OleUninitialize; + end. diff --git a/src/corelib/gdi/fpg_interface.pas b/src/corelib/gdi/fpg_interface.pas index c75aaa28..ef58e46d 100644 --- a/src/corelib/gdi/fpg_interface.pas +++ b/src/corelib/gdi/fpg_interface.pas @@ -33,6 +33,8 @@ type TfpgApplicationImpl = TfpgGDIApplication; TfpgClipboardImpl = TfpgGDIClipboard; TfpgFileListImpl = TfpgGDIFileList; + TfpgMimeDataImpl = TfpgGDIMimeDataBase; + TfpgDragImpl = TfpgGDIDrag; implementation diff --git a/src/corelib/gdi/fpg_oledragdrop.pas b/src/corelib/gdi/fpg_oledragdrop.pas new file mode 100644 index 00000000..fa17ba67 --- /dev/null +++ b/src/corelib/gdi/fpg_oledragdrop.pas @@ -0,0 +1,1061 @@ +{
+ fpGUI - Free Pascal GUI Toolkit
+
+ Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ distribution, for details of the copyright.
+
+ See the file COPYING.modifiedLGPL, included in this distribution,
+ for details about redistributing fpGUI.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ Description:
+ This unit implements the OLE Drag-n-Drop functionality of Windows.
+ This unit is implemented based on the articles posted on
+ http://www.catch22.net/tuts/dragdrop/
+}
+unit fpg_OLEDragDrop;
+
+{$mode delphi}{$H+}
+
+interface
+
+uses
+ Windows, Classes, ActiveX, ShellAPI, fpg_base;
+
+const
+ CFSTR_FILENAMEMAPA = 'FileNameMap'; { CF_FILENAMEMAPA }
+ CFSTR_FILENAMEMAP = CFSTR_FILENAMEMAPA;
+ CFSTR_FILEDESCRIPTORA = 'FileGroupDescriptor'; { CF_FILEGROUPDESCRIPTORA }
+ CFSTR_FILEDESCRIPTOR = CFSTR_FILEDESCRIPTORA;
+ CFSTR_FILECONTENTS = 'FileContents'; { CF_FILECONTENTS }
+
+type
+ TfpgOLEFormatEtcList = class(TList)
+ private
+ function GetFormatEtc(Index: Integer): PFormatEtc;
+ protected
+ procedure Notify(Ptr: Pointer; Action: TListNotification); override;
+ public
+ constructor CreateCopy(AFormatEtcList: TfpgOLEFormatEtcList);
+ property FormatEtc[Index: Integer]: PFormatEtc read GetFormatEtc; default;
+ end;
+
+
+ TfpgOLEStgMediumList = class(TList)
+ private
+ function GetStgMedium(Index: Integer): PStgMedium;
+ protected
+ procedure Notify(Ptr: Pointer; Action: TListNotification); override;
+ public
+ property StgMedium[Index: Integer]: PStgMedium read GetStgMedium; default;
+ end;
+
+
+ TfpgOLEDropSource = class(TInterfacedObject, IDropSource)
+ private
+ { IDropSource }
+ function QueryContinueDrag(fEscapePressed: BOOL; grfKeyState: Longint): HResult; stdcall;
+ function GiveFeedback(dwEffect: Longint): HResult; stdcall;
+ end;
+
+
+ TfpgOLEDragDropEffect = (deNone, deCopy, deMove, deLink);
+ TfpgOLEDragEnterEvent = procedure(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD) of object;
+ TfpgOLEDragOverEvent = procedure(Sender: TObject; KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect) of object;
+ TfpgOLEDragDropEvent = procedure(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect) of object;
+
+
+ TfpgOLEDropTarget = class(TObject, IInterface, IDropTarget)
+ private
+ FDropTarget: TfpgWindowBase;
+ FRegistered: Boolean;
+ FOnDragEnter: TfpgOLEDragEnterEvent;
+ FOnDragOver: TfpgOLEDragOverEvent;
+ FOnDragLeave: TNotifyEvent;
+ FOnDragDrop: TfpgOLEDragDropEvent;
+ private
+ { IInterface }
+ function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
+ function _AddRef: Integer; stdcall;
+ function _Release: Integer; stdcall;
+ { IDropTarget }
+ function DragEnter(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult;StdCall;
+ function DragOver(grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult; stdcall;
+ function DragLeave: HResult; stdcall;
+ function Drop(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult; stdcall;
+ protected
+ procedure DoDragEnter(DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD); virtual;
+ procedure DoDragOver(KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect); virtual;
+ procedure DoDragLeave;
+ procedure DoDragDrop(DataObj: IDataObject; KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect); virtual;
+ public
+ property OnDragEnter: TfpgOLEDragEnterEvent read FOnDragEnter write FOnDragEnter;
+ property OnDragOver: TfpgOLEDragOverEvent read FOnDragOver write FOnDragOver;
+ property OnDragLeave: TNotifyEvent read FOnDragLeave write FOnDragLeave;
+ property OnDragDrop: TfpgOLEDragDropEvent read FOnDragDrop write FOnDragDrop;
+ public
+ constructor Create(ADropTargetWidget: TfpgWindowBase); reintroduce; { Actually a TfpgWidget }
+ destructor Destroy; override;
+ procedure RegisterDragDrop;
+ procedure RevokeDragDrop;
+ property DropTarget: TfpgWindowBase read FDropTarget;
+ end;
+
+
+ TfpgOLEDataObject = class(TInterfacedObject, IDataObject)
+ private
+ FFormatEtcList: TfpgOLEFormatEtcList;
+ FStgMediumList: TfpgOLEStgMediumList;
+ function LookupFormatEtc(AFormat: TFormatEtc): Integer;
+ protected
+ { IDataObject }
+ function GetData(const formatetcIn: TFormatEtc; out medium: TStgMedium): HResult; stdcall;
+ function GetDataHere(const formatetc: TFormatEtc; out medium: TStgMedium): HResult; stdcall;
+ function QueryGetData(const formatetc: TFormatEtc): HResult; stdcall;
+ function GetCanonicalFormatEtc(const formatetc: TFormatEtc; out formatetcOut: TFormatEtc): HResult; stdcall;
+ function SetData(const formatetc: TFormatEtc; const medium: TStgMedium; fRelease: BOOL): HResult; stdcall;
+ function EnumFormatEtc(dwDirection: DWORD; out enumFormatEtc: IEnumFormatEtc): HResult; stdcall;
+ function DAdvise(const formatetc: TFormatEtc; advf: DWORD; const advSink: IAdviseSink; out dwConnection: DWORD): HResult; stdcall;
+ function DUnadvise(dwConnection: DWORD): HResult; stdcall;
+ function EnumDAdvise(out enumAdvise: IEnumStatData): HResult; stdcall;
+ public
+ constructor Create; overload;
+ constructor Create(AFormatEtcList: TfpgOLEFormatEtcList); overload;
+ destructor Destroy; override;
+ property FormatEtcList: TfpgOLEFormatEtcList read FFormatEtcList;
+ property StgMediumList: TfpgOLEStgMediumList read FStgMediumList;
+ end;
+
+
+ TfpgOLEEnumFormatEtc = class(TInterfacedObject, IEnumFORMATETC)
+ private
+ FFormatEtcList: TfpgOLEFormatEtcList;
+ FIndex: Integer;
+ protected
+ { IEnumFORMATETC }
+ function Next(celt: ULong; out elt:FormatEtc; pceltFetched: pULong=nil): HResult; stdcall;
+ function Skip(celt: ULong): HResult; stdcall;
+ function Reset: HResult; stdcall;
+ function Clone(out Enum: IEnumFormatEtc): HResult; stdcall;
+ public
+ constructor Create(AFormatEtcList: TfpgOLEFormatEtcList);
+ destructor Destroy; override;
+ end;
+
+
+ TDragFilesSource = class(TObject)
+ private
+ FFileNames: TStrings;
+ FAliasFileNames: TStrings;
+ function GetAliasFileNames: TStrings;
+ function GetSourceFileNames: TStrings;
+ procedure SetAliasFileNames(const Value: TStrings);
+ procedure SetSourceFileNames(const Value: TStrings);
+ public
+ constructor Create;
+ destructor Destroy; override;
+ procedure Execute;
+ property SourceFileNames: TStrings read GetSourceFileNames write SetSourceFileNames;
+ property AliasFileNames: TStrings read GetAliasFileNames write SetAliasFileNames;
+ end;
+
+
+ TDragAcceptFilesEvent = function(Sender: TObject; FileNames: TStrings): Boolean of object;
+ TDragAcceptPositionEvent = function(Sender: TObject; PT: TPoint): Boolean of object;
+ TDropFilesEvent = procedure(Sender: TObject; PT: TPoint; FileNames: TStrings) of object;
+
+
+ TDragFilesTarget = class(TfpgOLEDropTarget)
+ private
+ FDragAcceptFiles: Boolean;
+ FOnDragAcceptFiles: TDragAcceptFilesEvent;
+ FOnDragAcceptPosition: TDragAcceptPositionEvent;
+ FOnDropFiles: TDropFilesEvent;
+ procedure GetFileNamesFromDropHandle(DropHandle: HDROP; SL: TStrings);
+ procedure StreamToFile(Stream: IStream; const FileName: string);
+ protected
+ function DoDragAcceptFiles(DataObj: IDataObject): Boolean;
+ function DoDragAcceptPosition(PT: TPoint): Boolean;
+ procedure DoDropFiles(DataObj: IDataObject; PT: TPoint);
+ procedure DoDragEnter(DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD); override;
+ procedure DoDragOver(KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect); override;
+ procedure DoDragDrop(DataObj: IDataObject; KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect); override;
+ public
+ property OnDragAcceptFiles: TDragAcceptFilesEvent read FOnDragAcceptFiles write FOnDragAcceptFiles;
+ property OnDragAcceptPosition: TDragAcceptPositionEvent read FOnDragAcceptPosition write FOnDragAcceptPosition;
+ property OnDropFiles: TDropFilesEvent read FOnDropFiles write FOnDropFiles;
+ end;
+
+
+function WindowsMimeLookup(const CFFormat: string): string;
+function WindowsClipboardLookup(const AMime: string; var IsTranslated: Boolean): DWORD;
+function EnumDataToStringList(DataObj: IDataObject): TStringList;
+function GetFormatEtc(const CFFormat: DWORD): FORMATETC;
+
+implementation
+
+uses
+ SysUtils, ShlObj, fpg_widget;
+
+var
+ CF_FILENAMEMAP: Cardinal;
+ CF_FILEDESCRIPTOR: Cardinal;
+ CF_FILECONTENTS: Cardinal;
+
+
+function WindowsMimeLookup(const CFFormat: string): string;
+begin
+ { replace know clipboard formats with mime types }
+ if CFFormat = 'CF_TEXT' then
+ Result := 'text/plain'
+ else if CFFormat = 'CF_UNICODETEXT' then
+ Result := 'text/plain'
+ else if CFFormat = 'CF_OEMTEXT' then
+ Result := 'text/plain'
+ else if CFFormat = 'CF_HDROP' then
+ Result := 'text/uri-list'
+ else if CFFormat = 'CF_RICHTEXT' then
+ Result := 'text/html'
+ else
+ Result := CFFormat;
+end;
+
+function WindowsClipboardLookup(const AMime: string; var IsTranslated: Boolean): DWORD;
+begin
+ { TODO: We need to improve this implementation }
+ if AMime = 'text/html' then
+ begin
+ { We don't want duplicate CF_TEXT in DataObject, so register some of our
+ known convenience types (from TfpgMimeData) as-is }
+ IsTranslated := False;
+ Result := RegisterClipboardFormat('text/html');
+ end
+ else if Pos('text/', AMime) = 1 then
+ begin
+ IsTranslated := True;
+ Result := CF_TEXT; // fallback result
+ end
+ else
+ begin
+ IsTranslated := False;
+ Result := RegisterClipboardFormat(PChar(AMime));
+ end;
+end;
+
+function WindowsClipboardFormatToString(const CFFormat: integer): string;
+begin
+ { replace know clipboard formats with mime types }
+ case CFFormat of
+ CF_DIF : result := 'CF_DIF';
+ CF_DIB : result := 'CF_DIB';
+ CF_TEXT : result := 'CF_TEXT';
+ CF_SYLK : result := 'CF_SYLK';
+ CF_TIFF : result := 'CF_TIFF';
+ CF_RIFF : result := 'CF_RIFF';
+ CF_WAVE : result := 'CF_WAVE';
+ CF_HDROP : result := 'CF_HDROP';
+ CF_BITMAP : result := 'CF_BITMAP';
+ CF_LOCALE : result := 'CF_LOCALE';
+ CF_OEMTEXT : result := 'CF_OEMTEXT';
+ CF_PALETTE : result := 'CF_PALETTE';
+ CF_PENDATA : result := 'CF_PENDATA';
+ CF_UNICODETEXT : result := 'CF_UNICODETEXT';
+ CF_ENHMETAFILE : result := 'CF_ENHMETAFILE';
+ CF_METAFILEPICT : result := 'CF_METAFILEPICT';
+ else
+ Result := Format('unknown (%d)', [CFFormat]);
+ end;
+end;
+
+function EnumDataToStringList(DataObj: IDataObject): TStringList;
+var
+ FE: FORMATETC;
+ EnumFormats: IEnumFORMATETC;
+ num: integer;
+ lname: string;
+ lMimeName: string;
+ FormatName: array[0..MAX_PATH] of Char;
+ i: integer;
+begin
+ if DataObj.EnumFormatEtc(DATADIR_GET, EnumFormats) <> S_OK then
+ raise Exception.Create('EnumDataToStringList: Failed to get EnumFormatEtc interface');
+
+ Result := TStringList.Create;
+ EnumFormats.Reset;
+ while EnumFormats.Next(1, FE, @num) = S_OK do
+ begin
+ lName := '';
+ i := GetClipboardFormatName(FE.cfFormat,FormatName,MAX_PATH);
+ if i <> 0 then
+ begin
+ lName := FormatName;
+ end
+ else
+ begin
+ lName := WindowsClipboardFormatToString(FE.cfFormat);
+ end;
+ Result.Add(lName);
+ end;
+end;
+
+function GetFormatEtc(const CFFormat: DWORD): FORMATETC;
+begin
+ Result.CfFormat := CFFormat;
+ Result.Ptd := nil;
+ Result.dwAspect := DVASPECT_CONTENT;
+ Result.lindex := -1;
+ Result.tymed := TYMED_HGLOBAL;
+end;
+
+procedure DeepCopyFormatEtc(P1, P2: PFormatEtc);
+begin
+ P2^ := P1^;
+ if P1^.ptd <> nil then begin
+ P2^.ptd := CoTaskMemAlloc(SizeOf(tagDVTARGETDEVICE));
+ P2^.ptd^ := P1^.ptd^;
+ end;
+end;
+
+function DupGlobalMem(hMem: HGLOBAL): HGLOBAL;
+var
+ len: DWORD;
+ Source: Pointer;
+ Dest: HGLOBAL;
+begin
+ len := GlobalSize(hMem);
+ Source := GlobalLock(hMem);
+ Dest := GlobalAlloc(GMEM_FIXED, len);
+ Move(Source^, Pointer(Dest)^, len);
+ GlobalUnlock(hMem);
+ Result := Dest;
+end;
+
+{ TDragFilesSource }
+
+constructor TDragFilesSource.Create;
+begin
+ inherited Create;
+ FFileNames := TStringList.Create;
+ FAliasFileNames := TStringList.Create;
+end;
+
+destructor TDragFilesSource.Destroy;
+begin
+ FreeAndNil(FFileNames);
+ FreeAndNil(FAliasFileNames);
+ inherited Destroy;
+end;
+
+procedure TDragFilesSource.Execute;
+var
+ DataObject: TfpgOLEDataObject;
+ DropSource: TfpgOLEDropSource;
+ dwEffect: DWORD;
+ dwResult: HRESULT;
+ I: Integer;
+ F: PFormatEtc;
+ S: string;
+ M: PStgMedium;
+begin
+ DataObject := TfpgOLEDataObject.Create;
+
+ { append filenames as one long string delimited by #0. ie: something like a PChar }
+ S := '';
+ for I := 0 to FFileNames.Count - 1 do
+ begin
+ SetLength(S, Length(S)+Length(FFileNames[I])+1);
+ Move(FFileNames[I][1], S[Length(S)-Length(FFileNames[I])], Length(FFileNames[I]));
+ S[Length(S)] := #0;
+ end;
+ SetLength(S, Length(S)+1);
+ S[Length(S)] := #0;
+
+ { description of data we are sending }
+ New(F);
+ F^.cfFormat := CF_HDROP;
+ F^.ptd := nil;
+ F^.dwAspect := DVASPECT_CONTENT;
+ F^.lindex := -1;
+ F^.tymed := TYMED_HGLOBAL;
+ DataObject.FormatEtcList.Add(F);
+
+ { storage for data we are sending }
+ New(M);
+ M^.tymed := TYMED_HGLOBAL;
+ M^.hGlobal := Cardinal(GlobalAlloc(GMEM_FIXED, SizeOf(TDropFiles)+Length(S)));
+ PDropFiles(M^.hGlobal)^.pFiles := SizeOf(TDropFiles);
+ PDropFiles(M^.hGlobal)^.pt := Point(0,0);
+ PDropFiles(M^.hGlobal)^.fNC := FALSE;
+ PDropFiles(M^.hGlobal)^.fWide := FALSE;
+ Move(S[1], PChar(M^.hGlobal+SizeOf(TDropFiles))^, Length(S));
+ DataObject.StgMediumList.Add(M);
+
+ if (FAliasFileNames.Count > 0) and (FAliasFileNames.Count = FFileNames.Count) then
+ begin
+ { append filename aliases as one long string delimited by #0. ie: something like a PChar }
+ S := '';
+ for I := 0 to FAliasFileNames.Count - 1 do
+ begin
+ SetLength(S, Length(S)+Length(FAliasFileNames[I])+1);
+ Move(FAliasFileNames[I][1], S[Length(S)-Length(FAliasFileNames[I])], Length(FAliasFileNames[I]));
+ S[Length(S)] := #0;
+ end;
+ SetLength(S, Length(S)+1);
+ S[Length(S)] := #0;
+
+ { description of data we are sending }
+ New(F);
+ F^.cfFormat := CF_FILENAMEMAP;
+ F^.ptd := nil;
+ F^.dwAspect := DVASPECT_CONTENT;
+ F^.lindex := -1;
+ F^.tymed := TYMED_HGLOBAL;
+ DataObject.FormatEtcList.Add(F);
+
+ { storage for data we are sending }
+ New(M);
+ M^.tymed := TYMED_HGLOBAL;
+ M^.hGlobal := Cardinal(GlobalAlloc(GMEM_FIXED, Length(S)));
+ Move(S[1], PChar(M^.hGlobal)^, Length(S));
+ DataObject.StgMediumList.Add(M);
+ end;
+
+ DropSource := TfpgOLEDropSource.Create;
+ dwResult := ActiveX.DoDragDrop(DataObject as IDataObject, DropSource as IDropSource, DROPEFFECT_COPY, @dwEffect);
+
+ if dwResult = DRAGDROP_S_DROP then
+ begin
+ if dwEffect = DROPEFFECT_COPY then
+ begin
+ // nothing to do. If this whas xxx_MOVE, we would remove data from source
+ end;
+ end;
+end;
+
+function TDragFilesSource.GetAliasFileNames: TStrings;
+begin
+ Result := FAliasFileNames;
+end;
+
+function TDragFilesSource.GetSourceFileNames: TStrings;
+begin
+ Result := FFileNames;
+end;
+
+procedure TDragFilesSource.SetAliasFileNames(const Value: TStrings);
+begin
+ FAliasFileNames.Assign(Value);
+end;
+
+procedure TDragFilesSource.SetSourceFileNames(const Value: TStrings);
+begin
+ FFileNames.Assign(Value);
+end;
+
+{ TfpgOLEDropSource }
+
+function TfpgOLEDropSource.GiveFeedback(dwEffect: Integer): HResult;
+begin
+ Result := DRAGDROP_S_USEDEFAULTCURSORS;
+end;
+
+function TfpgOLEDropSource.QueryContinueDrag(fEscapePressed: BOOL; grfKeyState: Integer): HResult;
+begin
+ if FEscapePressed then
+ Result := DRAGDROP_S_CANCEL
+ else if (grfKeyState and (MK_LBUTTON or MK_RBUTTON) = 0) then
+ Result := DRAGDROP_S_DROP
+ else
+ Result := S_OK;
+ {$IFDEF DND_DEBUG}
+ writeln('TfpgOLEDropSource.QueryContinueDrag Result = ', Result);
+ {$ENDIF}
+end;
+
+{ TfpgOLEDataObject }
+
+constructor TfpgOLEDataObject.Create(AFormatEtcList: TfpgOLEFormatEtcList);
+begin
+ inherited Create;
+ FFormatEtcList := TfpgOLEFormatEtcList.CreateCopy(AFormatEtcList);
+ FStgMediumList := TfpgOLEStgMediumList.Create;
+end;
+
+constructor TfpgOLEDataObject.Create;
+begin
+ inherited Create;
+ FFormatEtcList := TfpgOLEFormatEtcList.Create;
+ FStgMediumList := TfpgOLEStgMediumList.Create;
+end;
+
+function TfpgOLEDataObject.DAdvise(const formatetc: TFormatEtc; advf: DWORD;
+ const advSink: IAdviseSink; out dwConnection: DWORD): HResult;
+begin
+ Result := OLE_E_ADVISENOTSUPPORTED;
+end;
+
+destructor TfpgOLEDataObject.Destroy;
+begin
+ FreeAndNil(FFormatEtcList);
+ FreeAndNil(FStgMediumList);
+ inherited Destroy;
+end;
+
+function TfpgOLEDataObject.DUnadvise(dwConnection: DWORD): HResult;
+begin
+ Result := OLE_E_ADVISENOTSUPPORTED;
+end;
+
+function TfpgOLEDataObject.EnumDAdvise(out enumAdvise: IEnumStatData): HResult;
+begin
+ Result := OLE_E_ADVISENOTSUPPORTED;
+end;
+
+function TfpgOLEDataObject.EnumFormatEtc(dwDirection: DWORD;
+ out enumFormatEtc: IEnumFormatEtc): HResult;
+begin
+ if dwDirection = DATADIR_GET then
+ begin
+ enumFormatEtc := TfpgOLEEnumFormatEtc.Create(FFormatEtcList) as IEnumFormatEtc;
+ Result := S_OK;
+ end
+ else begin
+ Result := E_NOTIMPL;
+ end;
+end;
+
+function TfpgOLEDataObject.GetCanonicalFormatEtc(const formatetc: TFormatEtc;
+ out formatetcOut: TFormatEtc): HResult;
+begin
+ // Apparently we have to set this field to NULL even though we don't do anything else
+ formatetcOut.ptd := nil;
+ Result := E_NOTIMPL;
+end;
+
+function TfpgOLEDataObject.GetData(const formatetcIn: TFormatEtc;
+ out medium: TStgMedium): HResult;
+var
+ Idx: Integer;
+begin
+ Idx := LookupFormatEtc(formatetcIn);
+ if Idx = -1 then
+ Result := DV_E_FORMATETC
+ else
+ begin
+ medium.tymed := FFormatEtcList[Idx]^.tymed;
+ medium.PUnkForRelease := nil;
+ if medium.tymed = TYMED_HGLOBAL then
+ begin
+ medium.hGlobal := DupGlobalMem(FStgMediumList[Idx]^.hGlobal);
+ Result := S_OK;
+ end
+ else
+ Result := DV_E_FORMATETC;
+ end;
+end;
+
+function TfpgOLEDataObject.GetDataHere(const formatetc: TFormatEtc;
+ out medium: TStgMedium): HResult;
+begin
+ Result := DV_E_FORMATETC;
+end;
+
+function TfpgOLEDataObject.LookupFormatEtc(AFormat: TFormatEtc): Integer;
+var
+ I: Integer;
+begin
+ Result := -1;
+ for I := 0 to FFormatEtcList.Count - 1 do begin
+ if (FFormatEtcList[I]^.cfFormat = AFormat.cfFormat) and
+ (FFormatEtcList[I]^.dwAspect = AFormat.dwAspect) and
+ (FFormatEtcList[I]^.tymed = AFormat.tymed) then begin
+ Result := I;
+ Break;
+ end;
+ end;
+end;
+
+function TfpgOLEDataObject.QueryGetData(const formatetc: TFormatEtc): HResult;
+begin
+ if LookupFormatEtc(formatetc) >= 0 then begin
+ Result := S_OK;
+ end
+ else begin
+ Result := DV_E_FORMATETC;
+ end;
+end;
+
+function TfpgOLEDataObject.SetData(const formatetc: TFormatEtc;
+ const medium: TStgMedium; fRelease: BOOL): HResult;
+begin
+ Result := E_NOTIMPL;
+end;
+
+{ TfpgOLEEnumFormatEtc }
+
+function TfpgOLEEnumFormatEtc.Clone(out Enum: IEnumFormatEtc): HResult;
+var
+ C: TfpgOLEEnumFormatEtc;
+begin
+ // make a duplicate enumerator
+ C := TfpgOLEEnumFormatEtc.Create(FFormatEtcList);
+ // manually set the index state
+ C.FIndex := FIndex;
+ Enum := C as IEnumFormatEtc;
+ Result := S_OK;
+end;
+
+constructor TfpgOLEEnumFormatEtc.Create(AFormatEtcList: TfpgOLEFormatEtcList);
+begin
+ FFormatEtcList := TfpgOLEFormatEtcList.CreateCopy(AFormatEtcList);
+ FIndex := 0;
+end;
+
+destructor TfpgOLEEnumFormatEtc.Destroy;
+begin
+ FreeAndNil(FFormatEtcList);
+ inherited;
+end;
+
+function TfpgOLEEnumFormatEtc.Next(celt: ULong; out elt:FormatEtc;
+ pceltFetched: pULong): HResult;
+var
+ Copied: Integer;
+ OutBuf: PFormatEtc;
+begin
+ // copy the FORMATETC structures into the caller's buffer
+ OutBuf := PFormatEtc(@elt);
+ Copied := 0;
+ while(FIndex < FFormatEtcList.Count) and (Copied < celt) do begin
+ DeepCopyFormatEtc(FFormatEtcList[FIndex], OutBuf);
+ OutBuf := PFormatEtc(Cardinal(OutBuf) + SizeOf(TFormatEtc));
+ Inc(Copied);
+ FIndex := FIndex + 1;
+ end;
+
+ // store result
+ if (pceltFetched <> nil) then
+ pceltFetched^ := Copied;
+
+ // did we copy all that was requested?
+ if (Copied = celt) then Result := S_OK
+ else Result := S_FALSE;
+end;
+
+function TfpgOLEEnumFormatEtc.Reset: HResult;
+begin
+ FIndex := 0;
+ Result := S_OK;
+end;
+
+function TfpgOLEEnumFormatEtc.Skip(celt: ULong): HResult;
+begin
+ FIndex := FIndex + celt;
+ if FIndex <= FFormatEtcList.Count then Result := S_OK
+ else Result := S_FALSE;
+end;
+
+{ TfpgOLEFormatEtcList }
+
+constructor TfpgOLEFormatEtcList.CreateCopy(AFormatEtcList: TfpgOLEFormatEtcList);
+var
+ I: Integer;
+ P: PFormatEtc;
+begin
+ Create;
+ for I := 0 to AFormatEtcList.Count - 1 do begin
+ New(P);
+ DeepCopyFormatEtc(AFormatEtcList[I], P);
+ Add(P);
+ end;
+end;
+
+function TfpgOLEFormatEtcList.GetFormatEtc(Index: Integer): PFormatEtc;
+begin
+ Result := PFormatEtc(Get(Index));
+end;
+
+procedure TfpgOLEFormatEtcList.Notify(Ptr: Pointer; Action: TListNotification);
+begin
+ if Action = lnDeleted then begin
+ if PFormatEtc(Ptr)^.ptd <> nil then begin
+ CoTaskMemFree(PFormatEtc(Ptr)^.ptd);
+ end;
+ Dispose(PFormatEtc(Ptr));
+ end;
+ inherited;
+end;
+
+{ TfpgOLEStgMediumList }
+
+function TfpgOLEStgMediumList.GetStgMedium(Index: Integer): PStgMedium;
+begin
+ Result := PStgMedium(Get(Index));
+end;
+
+procedure TfpgOLEStgMediumList.Notify(Ptr: Pointer; Action: TListNotification);
+begin
+ if Action = lnDeleted then begin
+ if PStgMedium(Ptr)^.hGlobal <> 0 then begin
+ GlobalFree(PStgMedium(Ptr)^.hGlobal);
+ end;
+ Dispose(Ptr);
+ end;
+ inherited;
+end;
+
+{ TfpgOLEDropTarget }
+
+function TfpgOLEDropTarget.DragEnter(const dataObj: IDataObject;
+ grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult;
+//var
+// Effect: TfpgOLEDragDropEffect;
+begin
+ //dwEffect := DROPEFFECT_NONE;
+ //Effect := deNone;
+ DoDragEnter(dataObj, grfKeyState, pt, dwEffect);
+ //case Effect of
+ // deNone: dwEffect := DROPEFFECT_NONE;
+ // deCopy: dwEffect := DROPEFFECT_COPY;
+ // deMove: dwEffect := DROPEFFECT_MOVE;
+ // deLink: dwEffect := DROPEFFECT_LINK;
+ //end;
+ Result := S_OK;
+end;
+
+function TfpgOLEDropTarget.DragLeave: HResult;
+begin
+ Result := S_OK;
+ DoDragLeave;
+end;
+
+function TfpgOLEDropTarget.DragOver(grfKeyState: DWORD; pt: TPoint;
+ var dwEffect: DWORD): HResult;
+var
+ Effect: TfpgOLEDragDropEffect;
+begin
+ if ((MK_SHIFT and grfKeyState) = MK_SHIFT) and
+ ((dwEffect and DROPEFFECT_MOVE) = DROPEFFECT_MOVE) then begin
+ Effect := deMove;
+ end;
+ if ((MK_CONTROL and grfKeyState) = MK_CONTROL) and
+ ((dwEffect and DROPEFFECT_COPY) = DROPEFFECT_COPY) then begin
+ Effect := deCopy;
+ end;
+ if dwEffect and DROPEFFECT_COPY > 0 then Effect := deCopy
+ else if dwEffect and DROPEFFECT_MOVE > 0 then Effect := deMove
+ else if dwEffect and DROPEFFECT_LINK > 0 then Effect := deLink
+ else Effect := deNone;
+ DoDragOver(grfKeyState, pt, Effect);
+ case Effect of
+ deNone: dwEffect := DROPEFFECT_NONE;
+ deCopy: dwEffect := DROPEFFECT_COPY;
+ deMove: dwEffect := DROPEFFECT_MOVE;
+ deLink: dwEffect := DROPEFFECT_LINK;
+ end;
+ Result := S_OK;
+end;
+
+function TfpgOLEDropTarget.Drop(const dataObj: IDataObject;
+ grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HResult;
+var
+ Effect: TfpgOLEDragDropEffect;
+begin
+ if dwEffect and DROPEFFECT_COPY > 0 then
+ Effect := deCopy
+ else if dwEffect and DROPEFFECT_MOVE > 0 then
+ Effect := deMove
+ else if dwEffect and DROPEFFECT_LINK > 0 then
+ Effect := deLink
+ else
+ Effect := deNone;
+ DoDragDrop(dataObj, grfKeyState, pt, Effect);
+ Result := S_OK;
+end;
+
+function TfpgOLEDropTarget._AddRef: Integer;
+begin
+ Result := 1;
+end;
+
+function TfpgOLEDropTarget._Release: Integer;
+begin
+ Result := 1;
+end;
+
+function TfpgOLEDropTarget.QueryInterface(const IID: TGUID; out Obj): HResult;
+begin
+ if GetInterface(IID, Obj) then
+ Result := 0
+ else
+ Result := E_NOINTERFACE;
+end;
+
+constructor TfpgOLEDropTarget.Create(ADropTargetWidget: TfpgWindowBase);
+begin
+ inherited Create;
+ FDropTarget := ADropTargetWidget;
+ FRegistered := False;
+end;
+
+procedure TfpgOLEDropTarget.RegisterDragDrop;
+begin
+ ActiveX.RegisterDragDrop(TfpgWidget(FDropTarget).WinHandle, Self as IDropTarget);
+ FRegistered := True;
+end;
+
+procedure TfpgOLEDropTarget.RevokeDragDrop;
+begin
+ FRegistered := False;
+ ActiveX.RevokeDragDrop(TfpgWidget(FDropTarget).WinHandle);
+end;
+
+destructor TfpgOLEDropTarget.Destroy;
+begin
+ if FRegistered then RevokeDragDrop;
+ inherited;
+end;
+
+procedure TfpgOLEDropTarget.DoDragEnter(DataObj: IDataObject;
+ KeyState: LongInt; PT: TPoint; var Effect: DWORD);
+begin
+ if Assigned(FOnDragEnter) then begin
+ FOnDragEnter(Self, DataObj, KeyState, PT, Effect);
+ end;
+end;
+
+procedure TfpgOLEDropTarget.DoDragOver(KeyState: LongInt; PT: TPoint;
+ var Effect: TfpgOLEDragDropEffect);
+begin
+ if Assigned(FOnDragOver) then begin
+ FOnDragOver(Self, KeyState, PT, Effect);
+ end;
+end;
+
+procedure TfpgOLEDropTarget.DoDragLeave;
+begin
+ if Assigned(FOnDragLeave) then
+ FOnDragLeave(self);
+end;
+
+procedure TfpgOLEDropTarget.DoDragDrop(DataObj: IDataObject; KeyState: LongInt;
+ PT: TPoint; Effect: TfpgOLEDragDropEffect);
+begin
+ if Assigned(FOnDragDrop) then begin
+ FOnDragDrop(Self, DataObj, KeyState, PT, Effect);
+ end;
+end;
+
+{ TDragFilesTarget }
+
+function TDragFilesTarget.DoDragAcceptFiles(DataObj: IDataObject): Boolean;
+const
+ FormatEtcHDrop: TFormatEtc = (cfFormat:CF_HDROP;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_HGLOBAL);
+ FormatEtcFileDescriptor: TFormatEtc = (cfFormat:0;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_HGLOBAL);
+ FormatEtcFileContents: TFormatEtc = (cfFormat:0;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_ISTREAM);
+var
+ StgMedium: TStgMedium;
+ DropHandle: HDROP;
+ EnumFormatEtc: IEnumFORMATETC;
+ FE: TFormatEtc;
+ FetchedCount: Longint;
+ FormatName: array[0..MAX_PATH] of Char;
+ FileGroupDescriptor: PFileGroupDescriptorA;
+ I, Count: Integer;
+ FileDescriptor: TFileDescriptorA;
+ FileNames: TStringList;
+begin
+ FileNames := TStringList.Create;
+ try
+ if Assigned(FOnDragAcceptFiles) then
+ begin
+ Result := False;
+ FormatEtcFileDescriptor.cfFormat := CF_FILEDESCRIPTOR;
+ FormatEtcFileContents.cfFormat := CF_FILECONTENTS;
+
+ if (DataObj.QueryGetData(FormatEtcHDrop) = S_OK) and
+ (DataObj.GetData(FormatEtcHDrop,StgMedium) = S_OK) then
+ begin
+ DropHandle := StgMedium.hGlobal;
+ GetFileNamesFromDropHandle(DropHandle, FileNames);
+ Result := FOnDragAcceptFiles(Self, FileNames);
+ ReleaseStgMedium(StgMedium);
+ end
+ else
+ if (DataObj.QueryGetData(FormatEtcFileDescriptor) = S_OK) and
+ (DataObj.QueryGetData(FormatEtcFileContents) = S_OK) and
+ (DataObj.GetData(FormatEtcFileDescriptor,StgMedium) = S_OK) then
+ begin
+ FileGroupDescriptor := GlobalLock(StgMedium.hGlobal);
+ if FileGroupDescriptor <> nil then
+ begin
+ Count := FileGroupDescriptor^.cItems;
+ I := 0;
+ while I < Count do
+ begin
+ FileDescriptor := FileGroupDescriptor^.fgd[I];
+ FileNames.Add(FileDescriptor.cFileName);
+ Inc(I);
+ end;
+ GlobalUnlock(StgMedium.hGlobal);
+ end;
+ Result := FOnDragAcceptFiles(Self, FileNames);
+ ReleaseStgMedium(StgMedium);
+ end
+ else
+ begin
+// DataObj.EnumFormatEtc(DATADIR_GET, EnumFormatEtc);
+// EnumFormatEtc.Reset;
+// while EnumFormatEtc.Next(1, FE, @FetchedCount) = S_OK do begin
+// GetClipboardFormatName(FE.cfFormat,FormatName,MAX_PATH);
+// ShowMessage(FormatName);
+// end;
+ end;
+ end
+ else
+ begin
+ Result := True;
+ end;
+ finally
+ FileNames.Free;
+ end;
+end;
+
+procedure TDragFilesTarget.DoDragEnter(DataObj: IDataObject;
+ KeyState: LongInt; PT: TPoint; var Effect: DWORD);
+begin
+ FDragAcceptFiles := DoDragAcceptFiles(DataObj);
+ if FDragAcceptFiles and DoDragAcceptPosition(PT) then
+ inherited DoDragEnter(DataObj, KeyState, PT, Effect)
+ else
+ Effect := DROPEFFECT_NONE;
+end;
+
+procedure TDragFilesTarget.DoDragOver(KeyState: LongInt; PT: TPoint; var Effect: TfpgOLEDragDropEffect);
+begin
+ if FDragAcceptFiles and DoDragAcceptPosition(PT) then
+ inherited DoDragOver(KeyState, PT, Effect)
+ else
+ Effect := deNone;
+end;
+
+procedure TDragFilesTarget.DoDragDrop(DataObj: IDataObject;
+ KeyState: LongInt; PT: TPoint; Effect: TfpgOLEDragDropEffect);
+begin
+ DoDropFiles(DataObj, PT);
+ inherited;
+end;
+
+function TDragFilesTarget.DoDragAcceptPosition(PT: TPoint): Boolean;
+begin
+ if Assigned(FOnDragAcceptPosition) then begin
+ Result := FOnDragAcceptPosition(Self, PT);
+ end else begin
+ Result := True;
+ end;
+end;
+
+procedure TDragFilesTarget.DoDropFiles(DataObj: IDataObject; PT: TPoint);
+const
+ FormatEtcHDrop: TFormatEtc = (cfFormat:CF_HDROP;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_HGLOBAL);
+ FormatEtcFileDescriptor: TFormatEtc =
+ (cfFormat:0;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_HGLOBAL);
+ FormatEtcFileContents: TFormatEtc =
+ (cfFormat:0;ptd:nil;dwAspect:DVASPECT_CONTENT;lindex:-1;tymed:TYMED_ISTREAM);
+var
+ StgMedium, StgMediumContents: TStgMedium;
+ DropHandle: HDROP;
+ FileNames: TStringList;
+ FileGroupDescriptor: PFileGroupDescriptorA;
+ I, Count: Integer;
+ FileDescriptor: TFileDescriptorA;
+ Path: array[0..MAX_PATH] of Char;
+ TempFileName: string;
+begin
+ if not Assigned(FOnDropFiles) then Exit;
+ FileNames := TStringList.Create;
+ try
+ FormatEtcFileDescriptor.cfFormat := CF_FILEDESCRIPTOR;
+ FormatEtcFileContents.cfFormat := CF_FILECONTENTS;
+ if (DataObj.QueryGetData(FormatEtcHDrop) = S_OK) and
+ (DataObj.GetData(FormatEtcHDrop,StgMedium) = S_OK) then begin
+ DropHandle := StgMedium.hGlobal;
+ GetFileNamesFromDropHandle(DropHandle, FileNames);
+ FOnDropFiles(Self, PT, FileNames);
+ ReleaseStgMedium(StgMedium);
+ end else
+ if (DataObj.QueryGetData(FormatEtcFileDescriptor) = S_OK) and
+ (DataObj.QueryGetData(FormatEtcFileContents) = S_OK) and
+ (DataObj.GetData(FormatEtcFileDescriptor,StgMedium) = S_OK) then begin
+ GetTempPath(MAX_PATH, Path);
+ GetTempFileName(Path, 'PXM', 0, Path);
+ FileGroupDescriptor := GlobalLock(StgMedium.hGlobal);
+ if FileGroupDescriptor <> nil then begin
+ Count := FileGroupDescriptor^.cItems;
+ I := 0;
+ while I < Count do begin
+ FileDescriptor := FileGroupDescriptor^.fgd[I];
+ TempFileName := ChangeFileExt(Path, ExtractFileExt(FileDescriptor.cFileName));
+ FormatEtcFileContents.lindex := I;
+ if (DataObj.GetData(FormatEtcFileContents,StgMediumContents) = S_OK) then begin
+ StreamToFile(IStream(StgMediumContents.pstm), TempFileName);
+ FileNames.Clear;
+ FileNames.Add(TempFileName);
+ FOnDropFiles(Self, PT, FileNames);
+ ReleaseStgMedium(StgMediumContents);
+ end;
+ Inc(I);
+ end;
+ GlobalUnlock(StgMedium.hGlobal);
+ end;
+ FOnDropFiles(Self, PT, FileNames);
+ ReleaseStgMedium(StgMedium);
+ ReleaseStgMedium(StgMediumContents);
+ end;
+ finally
+ FileNames.Free;
+ end;
+end;
+
+procedure TDragFilesTarget.GetFileNamesFromDropHandle(DropHandle: HDROP; SL: TStrings);
+var
+ I: Integer;
+ Path: array[0..MAX_PATH] of Char;
+begin
+ for I := 0 to DragQueryFile(DropHandle, $FFFFFFFF, nil, 0) do begin
+ DragQueryFile(DropHandle, I, Path, MAX_PATH);
+ SL.Add(Path);
+ end;
+ DragFinish(DropHandle);
+end;
+
+procedure TDragFilesTarget.StreamToFile(Stream: IStream; const FileName: string);
+const
+ BLOCK_SIZE = 4096;
+var
+ BytesRead: Longint;
+ FileStream: TFileStream;
+ Buffer: array[0..BLOCK_SIZE] of Byte;
+begin
+ FileStream := TFileStream.Create(FileName, fmCreate);
+ try
+ while (Stream.Read(@Buffer[0], BLOCK_SIZE, @BytesRead) = S_OK) and (BytesRead > 0) do begin
+ FileStream.Write(Buffer, BytesRead);
+ end;
+ finally
+ FileStream.Free;
+ end;
+end;
+
+initialization
+ CF_FILENAMEMAP := RegisterClipboardFormat(CFSTR_FILENAMEMAP);
+ CF_FILEDESCRIPTOR := RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);
+ CF_FILECONTENTS := RegisterClipboardFormat(CFSTR_FILECONTENTS);
+
+finalization
+
+end.
+
diff --git a/src/corelib/gdi/fpg_utils_impl.inc b/src/corelib/gdi/fpg_utils_impl.inc index d3bb2f0c..ab4761ae 100644 --- a/src/corelib/gdi/fpg_utils_impl.inc +++ b/src/corelib/gdi/fpg_utils_impl.inc @@ -1,7 +1,7 @@ {%mainunit fpg_utils.pas} uses - Shellapi; + Shellapi, Windows, fpg_constants, fpg_stringutils; // GDI specific implementations of encoding functions @@ -26,3 +26,22 @@ begin end; end; +function fpgFileSize(const AFilename: TfpgString): integer; +var + FindData: TWIN32FindDataW; + FindHandle: THandle; + Str: widestring; +begin + // Don't assign the widestring to TSearchRec.name because it is of type + // string, which will generate a conversion to the system encoding + Str := UTF8Decode(AFilename); + FindHandle:=Windows.FindFirstFileW(PWideChar(Str), FindData); + if FindHandle=Windows.Invalid_Handle_value then + begin + Result:=-1; + exit; + end; + Result := (int64(FindData.nFileSizeHigh) shl 32)+FindData.nFileSizeLow; + Windows.FindClose(FindHandle); +end; + diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk index 11731043..2f606e9f 100644 --- a/src/corelib/gdi/fpgui_toolkit.lpk +++ b/src/corelib/gdi/fpgui_toolkit.lpk @@ -5,7 +5,7 @@ <Name Value="fpgui_toolkit"/>
<Author Value="Graeme Geldenhuys"/>
<CompilerOptions>
- <Version Value="8"/>
+ <Version Value="9"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\"/>
@@ -16,7 +16,6 @@ <SyntaxOptions>
<AllowLabel Value="False"/>
<CPPInline Value="False"/>
- <UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
@@ -31,7 +30,7 @@ <Description Value="fpGUI Toolkit"/>
<License Value="LGPL 2 with static linking exception."/>
<Version Minor="7"/>
- <Files Count="80">
+ <Files Count="81">
<Item1>
<Filename Value="..\stdimages.inc"/>
<Type Value="Include"/>
@@ -352,6 +351,10 @@ <Filename Value="..\..\VERSION_FILE.inc"/>
<Type Value="Include"/>
</Item80>
+ <Item81>
+ <Filename Value="fpg_oledragdrop.pas"/>
+ <UnitName Value="fpg_OLEDragDrop"/>
+ </Item81>
</Files>
<LazDoc Paths="..\..\..\docs\xml\corelib\;..\..\..\docs\xml\corelib\x11\;..\..\..\docs\xml\corelib\gdi\;..\..\..\docs\xml\gui\"/>
<RequiredPkgs Count="1">
diff --git a/src/corelib/gdi/fpgui_toolkit.pas b/src/corelib/gdi/fpgui_toolkit.pas index 2e3e81b6..adc1c74d 100644 --- a/src/corelib/gdi/fpgui_toolkit.pas +++ b/src/corelib/gdi/fpgui_toolkit.pas @@ -1,4 +1,4 @@ -{ This file was automatically created by Lazarus. do not edit!
+{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
@@ -18,7 +18,7 @@ uses fpg_radiobutton, fpg_scrollbar, fpg_style, fpg_tab, fpg_trackbar, fpg_tree,
fpgui_db, fpg_gdi, fpg_impl, fpg_splitter, fpg_hint, fpg_spinedit,
fpg_extgraphics, fpg_ColorMapping, fpg_ColorWheel, fpg_interface,
- fpg_editbtn, fpg_imgfmt_jpg, fpg_imgutils;
+ fpg_editbtn, fpg_imgfmt_jpg, fpg_imgutils, fpg_OLEDragDrop;
implementation
diff --git a/src/corelib/keys.inc b/src/corelib/keys.inc index f8b24b34..4d62c4bf 100644 --- a/src/corelib/keys.inc +++ b/src/corelib/keys.inc @@ -5,7 +5,7 @@ GII info at <http://www.ggi-project.org/packages/libgii.html> } -{%mainunit gfxbase.pas} +{%mainunit fpg_base.pas} const diff --git a/src/corelib/lang_af.inc b/src/corelib/lang_af.inc index 70598111..6dad1634 100644 --- a/src/corelib/lang_af.inc +++ b/src/corelib/lang_af.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> is nie toegewys nie'; rsnewitemdetected = '''n Nuwe item is opgespoor.'; rsabort = 'Staak'; rsabout = 'Aangaande %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Alles'; rsallfiles = 'Alle Lêers'; rscollectionallfonts = 'Alle Lettertipes'; @@ -20,9 +21,11 @@ rsbold = 'Vetdruk'; rscancel = 'Kanselleer'; rscannotcreatedir = 'Kan nie die lêergids skep nie'; rschange = 'Verander'; -rscharactermap = 'Character Map'; +rschangetitle = 'Change Title'; +rscharactermap = 'Karakter Kaart'; rsclose = 'Sluit'; rscollection = 'Versameling'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Bevestig'; rsconfirmation = 'Bevestiging'; rscopy = 'Kopieer'; @@ -36,6 +39,7 @@ rsshortdec = 'Des'; rslongdec = 'Desember'; rsdelete = 'Skrap'; rsdirectories = 'Lêergidse'; +rsdirectory = 'Directory'; rsdrive = 'Dryf'; rsedit = 'Redigeer'; rslanguage = 'Afrikaans'; @@ -61,7 +65,7 @@ rshelp = 'Help'; rsignore = 'Ignoreer'; rsinformation = 'Informasie'; rsinsert = 'Invoeg'; -rsinsertfromcharactermap = 'Insert from Character Map'; +rsinsertfromcharactermap = 'Voeg in van Karakter Kaart'; rsitalic = 'Kursief'; rserritemofwrongtype = 'Die item is nie van <%s> tiepe nie!'; rsshortjan = 'Jan'; @@ -79,6 +83,8 @@ rsmessage = 'Boodskap'; rsfilemodifiedtime = 'Wysigings Tyd'; rsshortmon = 'Ma'; rslongmon = 'Maandag'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Naam'; rsno = 'Nee'; rsnotoall = 'Nee vir Alles'; @@ -113,7 +119,7 @@ rssize = 'Groote'; rsstyle = 'Steil'; rsshortsun = 'So'; rslongsun = 'Sondag'; -rstexttoinsert = 'Text to Insert'; +rstexttoinsert = 'Teks om in te voeg'; rsshortthu = 'Do'; rslongthu = 'Donderdag'; rstoday = 'Vandag'; diff --git a/src/corelib/lang_de.inc b/src/corelib/lang_de.inc index f3f45489..c47c4280 100644 --- a/src/corelib/lang_de.inc +++ b/src/corelib/lang_de.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> nicht zugewiesen'; rsnewitemdetected = 'Es wurde ein neuer Eintrag gefunden.'; rsabort = 'Abbrechen'; rsabout = 'Ãœber %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Alle'; rsallfiles = 'Alle Dateien'; rscollectionallfonts = 'Alle Schriften'; @@ -20,9 +21,11 @@ rsbold = 'Fett'; rscancel = 'Abbrechen'; rscannotcreatedir = 'Kann Verzeichnis nicht anlegen'; rschange = 'Ändern'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Schließen'; rscollection = 'Sammlung'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Bestätigen'; rsconfirmation = 'Bestätigung'; rscopy = 'Kopieren'; @@ -36,6 +39,7 @@ rsshortdec = 'Dez'; rslongdec = 'Dezember'; rsdelete = 'Löschen'; rsdirectories = 'Verzeichnisse'; +rsdirectory = 'Directory'; rsdrive = 'Laufwerk'; rsedit = 'Bearbeiten'; rslanguage = 'Englisch'; @@ -79,6 +83,8 @@ rsmessage = 'Meldung'; rsfilemodifiedtime = 'Änderungszeit'; rsshortmon = 'Mon'; rslongmon = 'Montag'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Name'; rsno = 'Nein'; rsnotoall = 'Nein zu allem'; diff --git a/src/corelib/lang_en.inc b/src/corelib/lang_en.inc index a7db8859..881c23e5 100644 --- a/src/corelib/lang_en.inc +++ b/src/corelib/lang_en.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> not assigned'; rsnewitemdetected = 'A new item has been detected.'; rsabort = 'Abort'; rsabout = 'About %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'All'; rsallfiles = 'All Files'; rscollectionallfonts = 'All Fonts'; @@ -20,9 +21,11 @@ rsbold = 'Bold'; rscancel = 'Cancel'; rscannotcreatedir = 'Cannot create directory'; rschange = 'Change'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Close'; rscollection = 'Collection'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirm'; rsconfirmation = 'Confirmation'; rscopy = 'Copy'; @@ -36,6 +39,7 @@ rsshortdec = 'Dec'; rslongdec = 'December'; rsdelete = 'Delete'; rsdirectories = 'Directories'; +rsdirectory = 'Directory'; rsdrive = 'Drive'; rsedit = 'Edit'; rslanguage = 'English'; @@ -79,6 +83,8 @@ rsmessage = 'Message'; rsfilemodifiedtime = 'Mod. Time'; rsshortmon = 'Mon'; rslongmon = 'Monday'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Name'; rsno = 'No'; rsnotoall = 'No to All'; diff --git a/src/corelib/lang_es.inc b/src/corelib/lang_es.inc index 099f1939..8e3979b0 100644 --- a/src/corelib/lang_es.inc +++ b/src/corelib/lang_es.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> no está asignado'; rsnewitemdetected = 'A new item has been detected.'; rsabort = 'Abortar'; rsabout = 'Acerca de %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Todos'; rsallfiles = 'Todos los Archivos'; rscollectionallfonts = 'Todas las Fuentes'; @@ -20,9 +21,11 @@ rsbold = 'Negrita'; rscancel = 'Cancelar'; rscannotcreatedir = 'No se puede crear la carpeta'; rschange = 'Cambiar'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Cerrar'; rscollection = 'Colección'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirmar'; rsconfirmation = 'Confirmación'; rscopy = 'Copiar'; @@ -36,6 +39,7 @@ rsshortdec = 'Dec'; rslongdec = 'December'; rsdelete = 'Borrar'; rsdirectories = 'Carpetas'; +rsdirectory = 'Directory'; rsdrive = 'Unidad'; rsedit = 'Editar'; rslanguage = 'Español'; @@ -79,6 +83,8 @@ rsmessage = 'Mensaje'; rsfilemodifiedtime = 'Hora de Modif.'; rsshortmon = 'Lun'; rslongmon = 'Lunes'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Nombre'; rsno = 'No'; rsnotoall = 'No a Todo'; diff --git a/src/corelib/lang_fr.inc b/src/corelib/lang_fr.inc index b75ee215..606e333b 100644 --- a/src/corelib/lang_fr.inc +++ b/src/corelib/lang_fr.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> n''''est pas assigné'; rsnewitemdetected = 'Un nouvel item a été détecté'; rsabort = 'Arrêter'; rsabout = 'A propos de %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Tous'; rsallfiles = 'Tous les fichiers'; rscollectionallfonts = 'Toutes les polices'; @@ -20,9 +21,11 @@ rsbold = 'Gras'; rscancel = 'Annuler'; rscannotcreatedir = 'Impossible de créer le répertoire'; rschange = 'Modifier'; -rscharactermap = 'Character Map'; +rschangetitle = 'Change Title'; +rscharactermap = 'Table de caractères'; rsclose = 'Fermer'; rscollection = 'Collection'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirmer'; rsconfirmation = 'Confirmation'; rscopy = 'Copier'; @@ -36,6 +39,7 @@ rsshortdec = 'Déc'; rslongdec = 'Décembre'; rsdelete = 'Supprimer'; rsdirectories = 'Répertoires'; +rsdirectory = 'Directory'; rsdrive = 'Disque'; rsedit = 'Editer'; rslanguage = 'Français'; @@ -79,6 +83,8 @@ rsmessage = 'Message'; rsfilemodifiedtime = 'Date modif.'; rsshortmon = 'Lun'; rslongmon = 'Lundi'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Nom'; rsno = 'Non'; rsnotoall = 'Non à tous'; @@ -113,7 +119,7 @@ rssize = 'Taille'; rsstyle = 'Style'; rsshortsun = 'Dim'; rslongsun = 'Dimanche'; -rstexttoinsert = 'Text to Insert'; +rstexttoinsert = 'Texte à insérer'; rsshortthu = 'Jeu'; rslongthu = 'Jeudi'; rstoday = 'Aujourd''''hui'; diff --git a/src/corelib/lang_it.inc b/src/corelib/lang_it.inc index ece9f08f..2d056311 100644 --- a/src/corelib/lang_it.inc +++ b/src/corelib/lang_it.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> non assegnato'; rsnewitemdetected = 'E'''' stato rilevato un nuovo elemento.'; rsabort = 'Interrompi'; rsabout = 'Informazioni %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Tutto'; rsallfiles = 'Tutti i Files'; rscollectionallfonts = 'Tutti i Fonts'; @@ -20,9 +21,11 @@ rsbold = 'Grassetto'; rscancel = 'Annulla'; rscannotcreatedir = 'Non riesco a creare la cartella'; rschange = 'Cambia'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Chiudi'; rscollection = 'Collezione'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Conferma'; rsconfirmation = 'Conferma'; rscopy = 'Copia'; @@ -36,6 +39,7 @@ rsshortdec = 'Dic'; rslongdec = 'Dicembre'; rsdelete = 'Cancella'; rsdirectories = 'Cartelle'; +rsdirectory = 'Directory'; rsdrive = 'Disco'; rsedit = 'Modifica'; rslanguage = 'Italiano'; @@ -79,6 +83,8 @@ rsmessage = 'Messaggio'; rsfilemodifiedtime = 'Tempo Mod.'; rsshortmon = 'Lun'; rslongmon = 'Lunedì'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Nome'; rsno = 'No'; rsnotoall = 'No a Tutto'; diff --git a/src/corelib/lang_pt.inc b/src/corelib/lang_pt.inc index b6a2d330..76b21500 100644 --- a/src/corelib/lang_pt.inc +++ b/src/corelib/lang_pt.inc @@ -7,6 +7,7 @@ rserrnotassigned = '<%s> not assigned'; rsnewitemdetected = 'A new item has been detected.'; rsabort = 'Abortar'; rsabout = 'About %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Todos'; rsallfiles = 'Todos os arquivos'; rscollectionallfonts = 'All Fonts'; @@ -20,9 +21,11 @@ rsbold = 'Negrito'; rscancel = 'Cancelar'; rscannotcreatedir = 'Não foi possÃvel criar diretório'; rschange = 'Editar'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Fechar'; rscollection = 'Coleção'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirmar'; rsconfirmation = 'Confirmação'; rscopy = 'Copy'; @@ -36,6 +39,7 @@ rsshortdec = 'Dec'; rslongdec = 'December'; rsdelete = 'Deletar'; rsdirectories = 'Diretórios'; +rsdirectory = 'Directory'; rsdrive = 'Drive'; rsedit = 'Editar'; rslanguage = 'Português'; @@ -79,6 +83,8 @@ rsmessage = 'Mensagem'; rsfilemodifiedtime = 'Mod. Time'; rsshortmon = 'Mon'; rslongmon = 'Monday'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Nome'; rsno = 'Não'; rsnotoall = 'Não para todos'; diff --git a/src/corelib/lang_ru.inc b/src/corelib/lang_ru.inc index f1571f0b..e989d927 100644 --- a/src/corelib/lang_ru.inc +++ b/src/corelib/lang_ru.inc @@ -7,6 +7,7 @@ rserrnotassigned = 'Значение <%s> не определено'; rsnewitemdetected = 'Обнаружен новый Ñлемент'; rsabort = 'Прервать'; rsabout = 'Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ %s'; +rsaddcurrentdirectory = 'Add current directory'; rsall = 'Ð’Ñе'; rsallfiles = 'Ð’Ñе файлы'; rscollectionallfonts = 'Ð’Ñе шрифты'; @@ -20,9 +21,11 @@ rsbold = 'Жирный'; rscancel = 'Отмена'; rscannotcreatedir = 'Ðевозможно Ñоздать директорию'; rschange = 'Изменить'; +rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; rsclose = 'Закрыть'; rscollection = 'Группа'; +rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Подтвердить'; rsconfirmation = 'Подтверждение'; rscopy = 'Копировать'; @@ -36,6 +39,7 @@ rsshortdec = 'Дек'; rslongdec = 'Декабрь'; rsdelete = 'Удалить'; rsdirectories = 'Директории'; +rsdirectory = 'Directory'; rsdrive = 'ДиÑк'; rsedit = 'Редактировать'; rslanguage = 'РуÑÑкий'; @@ -79,6 +83,8 @@ rsmessage = 'Сообщение'; rsfilemodifiedtime = 'Изменен'; rsshortmon = 'Пн'; rslongmon = 'Понедельник'; +rsmovedown = 'Move Down'; +rsmoveup = 'Move Up'; rsname = 'Ðазвание'; rsno = 'Ðет'; rsnotoall = 'Ðет Ð´Ð»Ñ Ð²Ñех'; diff --git a/src/corelib/predefinedcolors.inc b/src/corelib/predefinedcolors.inc index 1e6c4b54..ddb333b9 100644 --- a/src/corelib/predefinedcolors.inc +++ b/src/corelib/predefinedcolors.inc @@ -29,12 +29,13 @@ clMoneyGreen = TfpgColor($C0DCC0); clSkyBlue = TfpgColor($A6CAF0); clMedGray = TfpgColor($A0A0A4); + clUIDesignerGreen = TfpgColor($C0E0C0); // System named color identifiers. DON'T CHANGE THE ORDER! - cl_BaseNamedColor = TfpgColor($80000000); + cl_BaseNamedColor = $80000000; clWindowBackground = TfpgColor(cl_BaseNamedColor + 1); clBoxColor = TfpgColor(cl_BaseNamedColor + 2); @@ -67,6 +68,7 @@ clGridSelectionText = TfpgColor(cl_BaseNamedColor + 29); clGridInactiveSel = TfpgColor(cl_BaseNamedColor + 30); clGridInactiveSelText = TfpgColor(cl_BaseNamedColor + 31); + clSplitterGrabBar = TfpgColor(cl_BaseNamedColor + 32); diff --git a/src/corelib/stdimages.inc b/src/corelib/stdimages.inc index 0c880278..c494f96d 100644 --- a/src/corelib/stdimages.inc +++ b/src/corelib/stdimages.inc @@ -1,347 +1,55 @@ -{%mainunit fpg_stdimages.pas} Const - stdimg_list_add_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0,215, 13, 0, 0,215, 13, 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,182,132, - 93,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,164,101, 52,230,206, - 183,230,206,183,164,101, 52,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,164,101, 52,230,206,183,217,173, - 134,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,164,101, 52,230,206,183,217,173,134,164,101, - 52,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,182,132, 93,164,101, 52,164,101, 52, - 164,101, 52,164,101, 52,217,173,134,217,173,134,164,101, 52,164,101, - 52,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, - 255,255,255,255,255,164,101, 52,229,204,180,219,183,149,219,182,148, - 218,180,146,218,179,144,217,173,134,216,170,131,215,168,127,215,166, - 125,224,190,159,164,101, 52,255,255,255,255,255,255,255,255,255,255, - 255,255,164,101, 52,232,211,192,231,209,187,231,209,188,230,206,183, - 230,206,183,230,206,183,230,206,183,230,205,182,230,204,181,230,204, - 182,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,182, - 132, 93,164,101, 52,164,101, 52,164,101, 52,164,101, 52,230,206,183, - 230,206,183,164,101, 52,164,101, 52,164,101, 52,164,101, 52,182,132, - 93,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,164,101, 52,230,206,183,230,206,183, - 164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,164,101, 52,230,206,183,230,206,183,164,101, 52, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,164,101, 52,230,206,183,230,206,183,164,101, 52,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,182, - 132, 93,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255); - -Const - stdimg_menu_saveas_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,216,171,142,205,149,112,189,115, 66,183,104, 53,181,104, - 53,180,103, 52,178,102, 52,176,101, 51,174,100, 51,172, 99, 50,170, - 98, 50,169, 97, 50,168, 96, 49,167, 97, 50,171,105, 60,188,134, 97, - 195,125, 79,235,198,173,234,197,173,254,251,248,254,251,248,254,251, - 248,254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254, - 251,248,254,251,248,200,154,124,199,152,121,173,107, 64,186,108, 56, - 237,202,179,224,162,122,254,250,247, 98,192,136, 98,192,136, 98,192, - 136, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192,136,253, - 249,246,202,141,101,201,155,124,167, 97, 50,187,108, 56,238,204,182, - 225,162,122,254,250,247,191,220,194,191,220,194,191,220,194,191,220, - 194,191,220,194,191,220,194,191,220,194,191,220,194,253,249,246,205, - 144,104,204,158,129,168, 97, 50,187,107, 56,239,206,184,225,162,121, - 254,250,247, 98,192,136, 98,192,136,206,247,255, 41, 41, 41, 82, 82, - 82,206,247,255, 98,192,136, 98,192,136,253,249,246,207,147,106,206, - 163,132,170, 97, 50,186,106, 54,239,208,187,226,162,122,254,251,248, - 206,247,255,206,247,255,206,247,255,206,247,255,206,247,255,206,247, - 255,206,247,255,206,247,255,254,251,248,211,150,109,210,167,138,171, - 98, 50,187,106, 54,240,210,190,226,163,122,226,163,122,206,247,255, - 206,247,255,206,247,255, 41, 41, 41, 82, 82, 82,206,247,255,206,247, - 255,206,247,255,216,153,113,214,153,112,213,171,142,173, 99, 51,187, - 106, 54,242,213,194,227,163,122,208,242,250,206,247,255,206,247,255, - 206,247,255, 82, 82, 82, 41, 41, 41,132,156,165,206,247,255,206,247, - 255,210,247,254,217,155,115,218,176,149,175,100, 51,187,106, 54,242, - 216,197,227,164,123,181,238,254,181,239,255,181,239,255,181,239,255, - 181,239,255, 82, 82, 82, 41, 41, 41, 82, 82, 82,181,239,255,181,239, - 254,220,157,116,221,181,154,177,101, 52,187,107, 54,244,217,199,230, - 166,125,186,236,250,181,239,255, 41, 41, 41, 82, 82, 82,181,239,255, - 181,239,255, 41, 41, 41, 41, 41, 41,181,239,255,186,239,253,218,156, - 116,225,186,159,179,102, 52,187,108, 55,244,220,201,231,167,125,201, - 230,240,181,239,255, 41, 41, 41, 41, 41, 41,181,239,255,132,156,165, - 41, 41, 41, 41, 41, 41,181,239,255,201,239,249,222,160,119,228,190, - 164,180,103, 52,189,110, 58,245,221,204,231,168,126,250,240,232,181, - 239,255,132,156,165, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 132,156,165,181,239,255,247,229,217,224,162,120,231,194,169,182,104, - 53,192,116, 66,246,223,208,232,168,126,252,246,241,198,242,246,148, - 247,255,148,247,255,148,247,255,148,247,255,148,247,255,148,247,255, - 184,228,232,247,230,219,225,163,122,239,213,195,183,106, 54,198,130, - 85,246,223,209,233,170,128,254,250,246,253,250,246,218,241,243,175, - 244,250,153,246,254,153,246,254,175,244,250,218,241,243,249,236,226, - 248,231,219,238,208,186,236,208,189,189,116, 67,214,165,133,246,224, - 209,247,224,209,254,251,248,254,251,247,253,249,246,252,245,240,250, - 240,234,251,242,237,253,249,246,253,250,247,251,241,235,248,233,223, - 236,209,190,205,146,106,226,197,177,225,189,166,217,171,141,201,137, - 94,192,117, 67,189,110, 58,187,108, 55,187,107, 54,187,106, 54,187, - 106, 54,188,108, 57,189,110, 59,187,109, 58,191,116, 68,201,141,101, - 231,206,188,255,255,255); - -Const - stdimg_help_16 : Array[0..821] of byte = ( + stdimg_edit : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 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,192,161,139,164,117, 85,142, 85, 45,142, 85, 45,165,119, 87,193, - 161,139,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,198,169,149,147, 91, 53,203,175, - 155,229,214,203,248,244,241,249,245,242,232,219,209,211,186,167,149, - 94, 56,199,171,151,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,163,116, 84,175,134,105,243,237,233,221,201,186,199,165, - 139,187,145,113,193,153,121,213,183,159,233,218,205,248,243,239,183, - 145,117,166,120, 88,255, 0,255,255, 0,255,255, 0,255,199,170,150, - 174,133,105,243,238,233,183,143,114,165,114, 76,179,135,101,255,255, - 255,255,255,255,193,151,116,197,155,120,215,185,160,249,245,241,180, - 140,112,199,171,151,255, 0,255,255, 0,255,146, 91, 52,242,235,230, - 177,135,105,157,103, 64,163,111, 73,178,132, 98,255,255,255,255,255, - 255,189,146,111,193,150,114,197,155,120,214,183,157,247,241,237,147, - 93, 54,255, 0,255,192,161,139,195,166,145,211,188,173,148, 92, 51, - 154,100, 60,161,108, 69,169,120, 82,200,168,143,204,173,148,183,137, - 101,187,143,107,191,147,112,193,150,115,231,215,201,207,181,161,193, - 161,139,162,115, 83,221,204,192,175,134,106,145, 88, 47,151, 96, 56, - 157,103, 64,167,118, 81,228,212,200,229,214,202,180,134, 98,182,135, - 99,185,139,103,186,142,106,209,178,155,230,215,204,165,118, 86,141, - 83, 43,245,240,237,148, 94, 56,142, 83, 42,148, 91, 51,153, 98, 58, - 159,105, 66,243,237,232,255,255,255,208,181,160,176,127, 90,178,131, - 94,180,133, 96,189,148,117,248,243,240,142, 84, 45,141, 83, 43,245, - 240,237,147, 92, 54,138, 79, 37,144, 86, 45,149, 93, 52,154, 99, 59, - 181,139,109,252,251,249,254,254,254,193,157,130,172,122, 84,173,124, - 86,183,141,108,247,243,239,142, 84, 44,162,115, 83,221,204,192,172, - 130,101,135, 74, 32,139, 80, 39,144, 86, 45,149, 92, 52,153, 98, 58, - 194,161,137,255,255,255,243,236,232,165,114, 75,166,115, 77,195,161, - 134,225,210,198,164,117, 85,192,161,139,195,165,144,208,185,169,135, - 74, 32,135, 74, 32,159,110, 75,160,111, 77,148, 91, 50,168,122, 89, - 255,255,255,253,252,251,161,109, 70,159,106, 67,218,198,183,198,170, - 149,192,161,139,255, 0,255,146, 92, 53,241,234,229,165,120, 88,135, - 74, 32,176,136,108,254,253,253,233,222,214,246,242,239,255,255,255, - 220,202,189,152, 96, 56,179,137,107,242,235,230,145, 91, 52,255, 0, - 255,255, 0,255,198,169,149,173,131,103,242,235,231,166,120, 89,156, - 105, 71,222,206,194,247,243,240,241,234,230,208,184,167,160,111, 77, - 173,130,100,243,237,232,171,128, 98,198,169,149,255, 0,255,255, 0, - 255,255, 0,255,163,116, 84,170,127, 97,240,232,227,208,185,169,172, - 130,101,150, 96, 59,150, 96, 59,172,130,101,209,186,170,240,233,228, - 170,128, 98,163,116, 84,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,198,169,149,145, 91, 52,193,162,141,219,201,189,244, - 239,235,244,239,235,219,201,189,193,163,141,145, 90, 51,199,170,150, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,192,161,139,162,115, 83,141, 83, 43,141, - 83, 43,162,115, 83,192,161,139,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255); - -Const - stdimg_dialog_error_32 : Array[0..3125] of byte = ( - 66, 77, 54, 12, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 32, 0, 0, 0, 32, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 12, 0, 0, 19, 11, 0, 0, 19, 11, 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,254,254,254,249,249,249,242,242,242,233, - 233,233,225,225,225,219,219,219,213,213,213,208,208,208,204,204,204, - 208,208,208,211,211,211,216,216,216,222,222,222,229,229,229,239,239, - 239,247,247,247,252,252,252,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,245,245,245,231,231, - 231,219,219,219,208,208,208,198,198,198,187,187,187,178,178,178,169, - 169,169,162,162,162,156,156,156,153,153,153,154,154,154,157,157,157, - 162,162,162,170,170,170,179,179,179,189,189,189,199,199,199,209,209, - 209,222,222,222,239,239,239,252,252,252,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,245,245,245,233,233,233,220,220,220,208,208,208,195,195, - 195,183,183,183,159,159,170,102,102,164, 44, 44,169, 20, 20,172, 8, - 8,175, 2, 2,177, 7, 7,174, 19, 19,171, 40, 40,165, 96, 96,158, - 149,149,160,172,172,172,184,184,184,197,197,197,209,209,209,222,222, - 222,235,235,235,252,252,252,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254, - 242,242,242,231,231,231,219,219,219,179,179,204, 60, 60,185, 6, 6, - 179, 16, 18,187, 25, 33,199, 39, 52,207, 49, 65,211, 57, 76,215, 48, - 65,210, 38, 50,203, 24, 32,197, 16, 17,184, 6, 6,178, 59, 59,182, - 171,171,196,209,209,209,221,221,221,232,232,232,244,244,244,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,253, - 101,101,208, 10, 10,182, 21, 26,196, 61, 78,218, 54, 70,218, 36, 46, - 211, 25, 30,207, 18, 22,205, 15, 17,203, 18, 22,203, 25, 30,205, 35, - 45,208, 52, 69,213, 55, 75,215, 21, 26,194, 9, 9,181,104,104,206, - 245,245,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,235,235,249, 51, 51,195, 17, 18,191, 59, 74,219, - 51, 64,218, 19, 21,209, 10, 10,206, 10, 10,205, 10, 10,205, 10, 10, - 204, 10, 10,203, 9, 9,203, 9, 9,202, 9, 9,201, 9, 9,200, 19, - 22,203, 47, 62,212, 53, 71,213, 15, 17,187, 54, 54,196,236,236,249, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,239,239,250, 27, - 27,187, 22, 26,198, 66, 82,225, 26, 31,214, 11, 11,210, 11, 11,209, - 11, 11,208, 11, 11,208, 10, 10,207, 10, 10,206, 10, 10,205, 10, 10, - 205, 10, 10,204, 10, 10,204, 9, 9,203, 9, 9,202, 9, 9,202, 24, - 30,206, 59, 78,217, 20, 24,193, 30, 30,188,240,240,250,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,252,252,254, 57, 57,197, 24, 27,202, 64, 78,226, 20, - 22,215, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,211, 11, 11,210, - 11, 11,209, 11, 11,209, 11, 11,208, 11, 11,207, 10, 10,207, 10, 10, - 206, 10, 10,205, 10, 10,204, 10, 10,204, 10, 10,203, 17, 20,205, 56, - 74,217, 21, 25,194, 60, 60,197,252,252,254,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,120,120, - 216, 19, 20,194, 68, 82,229, 19, 21,218, 13, 13,216, 13, 13,215, 12, - 12,214, 12, 12,214, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,211, - 11, 11,210, 11, 11,210, 11, 11,209, 11, 11,208, 11, 11,208, 10, 10, - 207, 10, 10,206, 10, 10,205, 10, 10,205, 17, 19,206, 60, 78,219, 18, - 19,191,124,124,217,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,230,230,247, 17, 17,187, 63, 75,228, 28, 31, - 222, 13, 13,219, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,216, 13, - 13,215, 12, 12,215, 12, 12,214, 12, 12,213, 12, 12,213, 12, 12,212, - 12, 12,211, 11, 11,210, 11, 11,210, 11, 11,209, 11, 11,208, 11, 11, - 208, 11, 11,207, 10, 10,207, 23, 28,210, 53, 69,217, 17, 17,185,232, - 232,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 91, 91,207, 28, 31,208, 53, 61,229, 14, 14,221, 14, 14,221, 14, 14, - 220, 14, 14,220, 14, 14,219, 13, 13,218, 13, 13,218, 13, 13,217, 13, - 13,216, 13, 13,215, 12, 12,215, 12, 12,214, 12, 12,214, 12, 12,213, - 12, 12,212, 12, 12,211, 11, 11,211, 11, 11,210, 11, 11,209, 11, 11, - 209, 11, 11,208, 47, 59,217, 23, 27,200, 94, 94,208,255,255,255,255, - 255,255,255,255,255,255,255,255,240,240,250, 10, 10,183, 70, 82,232, - 29, 30,227, 29, 29,226, 22, 22,224, 14, 14,223, 14, 14,222, 14, 14, - 221, 14, 14,220, 14, 14,220, 14, 14,219, 13, 13,219, 13, 13,218, 13, - 13,217, 13, 13,216, 13, 13,216, 13, 13,215, 12, 12,214, 12, 12,214, - 12, 12,213, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,210, 18, 21, - 212, 60, 77,222, 9, 10,182,242,242,251,255,255,255,255,255,255,255, - 255,255,166,166,228, 24, 25,197,104,111,238, 84, 84,235, 84, 84,234, - 84, 84,234, 72, 72,232, 51, 51,229, 25, 25,225, 15, 15,223, 14, 14, - 222, 14, 14,221, 14, 14,221, 14, 14,220, 14, 14,219, 13, 13,219, 13, - 13,218, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,215, 12, 12,215, - 12, 12,214, 12, 12,213, 12, 12,213, 12, 12,212, 58, 72,223, 20, 22, - 193,170,170,229,255,255,255,255,255,255,255,255,255, 78, 78,204, 55, - 58,217,103,107,240, 82, 82,236, 83, 83,236, 83, 83,236, 83, 83,235, - 82, 82,234, 81, 81,234, 58, 58,230, 26, 26,225, 15, 15,224, 15, 15, - 223, 14, 14,223, 14, 14,222, 14, 14,221, 14, 14,220, 14, 14,220, 14, - 14,219, 13, 13,218, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,216, - 13, 13,215, 12, 12,214, 40, 48,221, 28, 34,205, 82, 82,203,255,255, - 255,255,255,255,255,255,255, 38, 38,193, 88, 94,229, 93, 95,240, 80, - 80,237, 80, 80,237, 80, 80,237,243,243,243,243,243,243,243,243,243, - 243,243,243,243,243,243,241,241,241,239,239,239,239,239,239,239,239, - 239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239, - 239,239,239,239,239,239,239,239, 13, 13,218, 13, 13,217, 23, 23,218, - 51, 56,223, 46, 55,215, 40, 40,192,255,255,255,255,255,255,255,255, - 255, 16, 16,185,109,115,238, 87, 87,240, 79, 79,239, 79, 79,239, 79, - 79,238,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 243,243,243,243,243,243,240,240,240,239,239,239,239,239,239,239,239, - 239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239, - 239,239, 23, 23,221, 57, 57,226, 79, 79,229, 87, 89,229, 76, 87,225, - 19, 19,185,255,255,255,255,255,255,255,255,255, 3, 3,180,120,126, - 244, 81, 82,242, 77, 77,241, 77, 77,240, 77, 77,240,243,243,243,243, - 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 243,243,243,241,241,241,239,239,239,239,239,239,239,239,239,239,239, - 239,239,239,239,239,239,239,239,239,239,241,241,241, 74, 74,231, 76, - 76,231, 76, 76,230, 82, 84,230, 97,110,233, 5, 5,180,255,255,255, - 255,255,255,255,255,255, 16, 16,185,103,108,239, 84, 85,244, 75, 75, - 243, 75, 75,242, 75, 75,241,243,243,243,243,243,243,243,243,243,243, - 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 242,242,242,240,240,240,240,240,240,239,239,239,240,240,240,242,242, - 242,243,243,243,243,243,243, 75, 75,233, 75, 75,232, 75, 75,232, 83, - 85,233, 85, 95,228, 19, 19,186,255,255,255,255,255,255,255,255,255, - 37, 37,193, 82, 86,233, 87, 89,245, 73, 73,244, 73, 73,243, 74, 74, - 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, - 243, 73, 73,234, 72, 72,233, 73, 73,233, 87, 90,235, 69, 76,223, 40, - 40,193,255,255,255,255,255,255,255,255,255, 77, 77,205, 53, 56,223, - 97, 99,247, 72, 72,246, 71, 71,245, 71, 71,245, 71, 71,244, 71, 71, - 243, 72, 72,243, 72, 72,243, 71, 71,242, 71, 71,241, 71, 71,241, 71, - 71,240, 72, 72,240, 72, 72,240, 71, 71,239, 71, 71,239, 71, 71,238, - 71, 71,237, 71, 71,236, 71, 71,237, 71, 71,236, 71, 71,236, 71, 71, - 235, 71, 71,234, 94, 99,237, 44, 49,214, 81, 81,204,255,255,255,255, - 255,255,255,255,255,165,165,228, 29, 30,203,113,118,250, 71, 71,247, - 71, 71,247, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,245, 70, 70, - 244, 70, 70,244, 70, 70,243, 70, 70,242, 69, 69,242, 69, 69,242, 69, - 69,241, 69, 69,240, 70, 70,240, 70, 70,239, 69, 69,239, 69, 69,239, - 69, 69,238, 69, 69,237, 69, 69,237, 70, 70,236, 69, 69,236,108,116, - 241, 25, 26,198,170,170,229,255,255,255,255,255,255,255,255,255,240, - 240,250, 10, 10,184,116,121,249, 77, 78,249, 71, 71,249, 71, 71,248, - 71, 71,248, 71, 71,247, 71, 71,246, 71, 71,246, 71, 71,246, 70, 70, - 245, 70, 70,244, 70, 70,244, 70, 70,243, 70, 70,243, 70, 70,242, 69, - 69,242, 69, 69,241, 69, 69,241, 69, 69,240, 69, 69,239, 68, 68,239, - 68, 68,239, 68, 68,239, 74, 75,239,106,115,240, 11, 11,183,241,241, - 251,255,255,255,255,255,255,255,255,255,255,255,255, 89, 89,208, 45, - 46,223,106,109,252, 71, 71,250, 71, 71,250, 71, 71,250, 71, 71,249, - 71, 71,248, 71, 71,248, 71, 71,247, 71, 71,247, 71, 71,246, 71, 71, - 246, 70, 70,245, 70, 70,245, 70, 70,244, 70, 70,243, 70, 70,243, 70, - 70,242, 69, 69,242, 69, 69,242, 69, 69,241, 69, 69,240, 69, 69,240, - 100,107,242, 43, 45,215, 93, 93,209,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,230,230,247, 17, 17,189,111,115,250, 85, - 86,252, 72, 72,252, 71, 71,251, 71, 71,251, 71, 71,250, 71, 71,250, - 71, 71,249, 71, 71,249, 71, 71,248, 71, 71,247, 71, 71,247, 71, 71, - 246, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,244, 70, 70,244, 70, - 70,243, 70, 70,242, 69, 69,242, 81, 83,242,104,111,241, 18, 18,188, - 232,232,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,120,120,217, 27, 28,206,122,126,254, 79, 79,253, 72, - 72,253, 72, 72,253, 72, 72,252, 71, 71,251, 71, 71,251, 71, 71,250, - 71, 71,250, 71, 71,250, 71, 71,249, 71, 71,248, 71, 71,248, 71, 71, - 247, 71, 71,246, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,245, 75, - 76,245,117,124,247, 28, 29,202,123,123,217,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252, - 254, 55, 55,198, 44, 44,218,121,124,254, 79, 80,254, 72, 72,254, 72, - 72,253, 72, 72,253, 72, 72,253, 72, 72,252, 72, 72,252, 71, 71,251, - 71, 71,250, 71, 71,250, 71, 71,250, 71, 71,249, 71, 71,249, 71, 71, - 248, 71, 71,247, 71, 71,247, 78, 79,247,115,122,248, 43, 45,214, 59, - 59,199,252,252,254,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,238,238,250, 28, 28, - 189, 45, 45,216,125,127,254, 86, 88,254, 72, 72,254, 72, 72,254, 72, - 72,254, 72, 72,254, 72, 72,253, 72, 72,253, 72, 72,253, 72, 72,252, - 71, 71,251, 71, 71,251, 71, 71,250, 71, 71,250, 71, 71,250, 86, 87, - 250,120,126,250, 43, 45,213, 29, 29,189,240,240,250,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,234,234,249, 50, 50,196, 30, 30, - 204,115,117,248,111,114,254, 80, 81,254, 72, 72,254, 72, 72,254, 72, - 72,254, 72, 72,254, 72, 72,254, 72, 72,253, 72, 72,253, 72, 72,253, - 72, 72,252, 81, 82,252,109,113,252,111,116,246, 28, 29,201, 52, 52, - 196,235,235,249,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,249,249,253,105,105,212, 10, 10,184, 53, 54, - 218,122,124,251,117,120,254, 99,100,254, 88, 89,254, 82, 82,254, 77, - 78,254, 82, 82,254, 87, 89,254, 98,100,254,115,119,254,119,123,251, - 50, 51,216, 12, 12,185,105,105,212,250,250,253,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,218,218,244, 74, 74,203, 11, 11,183, 35, 35, - 204, 68, 69,227, 92, 94,239,110,111,246,123,126,252,109,111,246, 91, - 93,238, 67, 68,227, 34, 34,204, 9, 9,183, 77, 77,204,219,219,244, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,237,237,250,162,162,227, 75, 75,204, 38, 38, - 193, 17, 17,186, 4, 4,180, 17, 17,186, 38, 38,194, 77, 77,205,164, - 164,228,238,238,250,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,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, 3, 0, 0,235, 10, 0, 0,235, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 98,146, 94, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98,146, 94, 98,146, 94, + 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255, + 255,255,255,255,160,160,160,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255, 0, 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, + 88, 88, 88,220,220,220,160,160,160,160,160,160, 0, 0, 0,160,160, + 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, + 160,160, 0, 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, 88, 88, 88, + 220,220,220,255,255,255,255,255,255, 88, 88, 88, 48, 48, 48, 0, 0, + 64,195,195,195,220,220,220,255,255,255,255,255,255,255,255,255, 0, + 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, 88, 88, 88,220,220,220, + 255,255,255,255,255,255,255,255,255, 88, 88, 88,168,220,255, 0, 88, + 192, 0, 88,192,195,195,195,220,220,220,255,255,255, 0, 0, 0, 98, + 146, 94, 98,146, 94, 98,146, 94, 88, 88, 88,220,220,220,195,195,195, + 195,195,195,195,195,195,160,160,160,168,220,255,168,220,255,168,220, + 255, 0, 88,192, 0, 88,192,160,160,160, 0, 0, 0, 98,146, 94, 98, + 146, 94, 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255, + 255,255,255,255,255,255, 88,168,255,168,220,255,168,220,255,168,220, + 255,168,220,255, 0, 0, 64, 0, 0, 0, 98,146, 94, 98,146, 94, 98, + 146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255,255, + 255,255,255,160,160,160,168,220,255,168,220,255, 0,128,255, 0,128, + 255, 0, 88,192, 48, 48, 48, 98,146, 94, 98,146, 94, 98,146, 94, 88, + 88, 88,220,220,220,195,195,195,195,195,195,195,195,195,195,195,195, + 195,195,195, 88,168,255,168,220,255, 0,128,255, 0,128,255, 0,128, + 255, 0, 88,192, 48, 48, 48, 98,146, 94, 98,146, 94, 88, 88, 88,220, + 220,220,255,255,255,255,255,255,255,255,255,255,255,255,195,195,195, + 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, + 255, 0, 88,192, 0, 0, 64, 98,146, 94, 88, 88, 88,220,220,220,255, + 255,255,255,255,255,255,255,255,255,255,255,195,195,195,255,255,255, + 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, + 255, 0, 88,192, 98,146, 94, 88, 88, 88,220,220,220,195,195,195,195, + 195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195, + 195,195,195, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, + 255, 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255, + 255,255,255,255,255,195,195,195,255,255,255,255,255,255,255,255,255, + 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 98,146, + 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255,255,255, + 255,255,195,195,195,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 88,168,255, 88,168,255, 0,128,255, 98,146, 94, 88, 88, + 88,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, + 220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, + 88, 88, 88, 88,168,255, 88,168,255, 98,146, 94, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 98,146, 94, 98,146, 94); Const stdimg_menu_save_all_16 : Array[0..821] of byte = ( @@ -448,6 +156,110 @@ Const 255,255,255,255,255,255); Const + stdimg_font_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,128,128,128,135,135,135,133, + 133,133,133,133,133,128,128,128,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 88, 88, 88,102,102,102,108,108,108, 99, + 99, 99, 83, 83, 83,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 81, 81, 81, 84, 84, 84, 81, 81, 81,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 60, 77,162, 76, 89,162, 77, 90,161, 74, 87,161, 73, 84, + 156,255, 0,255, 80, 80, 77, 45, 45, 45, 74, 74, 74,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 36, 59,219, 0, 43,255, 0, 47,255, 0, 39,239, 45, 62,197,255, 0, + 255, 65, 65, 63, 7, 7, 7, 60, 60, 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, + 19, 38,213, 0, 32,255, 80, 88,168,255, 0,255,255, 0,255, 55, 55, + 55, 0, 0, 0, 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 28, 37,212, + 0, 16,255, 86, 89,166,255, 0,255,255, 0,255, 55, 55, 55, 1, 1, + 1, 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 27, 28,213, 0, 3,255, + 85, 85,168,255, 0,255,255, 0,255, 55, 55, 55, 0, 0, 0, 58, 58, + 58,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 27, 27,213, 0, 0,255, 84, 84,166, + 255, 0,255,255, 0,255, 57, 57, 57, 11, 11, 11, 60, 60, 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, 27, 27,220, 3, 4,166, 62, 62, 88,255, 0,255, + 255, 0,255, 71, 71, 71, 49, 49, 49, 71, 71, 71,255, 0,255,255, 0, + 255,100,100,100,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 27, 27,224, 19, 19,138, 52, 52, 32,255, 0,255,255, 0,255, + 78, 78, 78, 93, 93, 93, 76, 76, 76,255, 0,255,255, 0,255, 40, 40, + 40,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 29, + 29,225, 24, 24,153,113,113, 93, 65, 65, 65, 71, 71, 71, 84, 84, 81, + 139,139,138, 75, 75, 75, 74, 74, 74, 66, 66, 66,113,113,113,255, 0, + 255, 78, 78,167, 88, 88,152,255, 0,255,255, 0,255, 48, 48,225, 37, + 38,161,103,103, 98,114,114,111,106,106,103,106,106,115,112,112,115, + 111,111,111,105,105,105,113,113,113,113,113,113,255, 0,255, 83, 83, + 197, 45, 45,204,255, 0,255,255, 0,255, 59, 60,212, 81, 83,247, 72, + 72,146,255, 0,255,255, 0,255, 43, 44,213,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,105,105,181,113,114, + 255, 76, 76,207, 77, 77,191, 97, 98,244,127,128,255, 79, 79,220, 83, + 84,188, 87, 87,223,104,105,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,123,123,178, 80, 80,215, 84, 84, + 223, 80, 80,228, 81, 81,220, 74, 74,218, 79, 79,223, 77, 77,228, 83, + 83,239, 67, 68,231,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_choice_yes_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255, 12,164, 60, 17,171, 71, 13,173, 73,104,175, + 120,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 87,183,107, 78,224,155, 92,234,170, 92,234,171, 35,192,104, 87,167, + 106,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 32,183, 89, + 102,255,205,104,255,201, 85,255,195, 73,252,184, 24,199,107, 85,166, + 102,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,157,207,165, 22,223,131, 47,255,181, + 45,255,174, 30,255,170, 3,255,160, 17,250,157, 12,190, 93, 68,158, + 86,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 68,173, 91, 0,248,147, 1,254,156, 10,254,160, + 18,251,159, 38,250,165, 49,242,160, 70,234,157, 21,183, 87, 74,169, + 94,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 7,173, 65, 7,243,144, 45,243,160, 72,243,171,105,199,139, + 96,231,164,112,241,183,110,233,172,102,224,157, 28,169, 74, 57,157, + 75,255, 0,255,255, 0,255,255, 0,255,255, 0,255,148,199,148, 18, + 202,101, 79,235,162,102,241,178, 85,205,129,255, 0,255,172,211,180, + 89,192,126,129,232,178,130,225,170,129,215,157, 45,168, 78, 63,165, + 77,255, 0,255,255, 0,255,255, 0,255,127,196,134, 86,221,149,112, + 231,171,111,233,173,152,207,158,255, 0,255,255, 0,255,255, 0,255, + 101,183,121,151,227,181,150,221,173,157,217,170, 60,168, 84, 44,152, + 56,255, 0,255,255, 0,255,255, 0,255,138,190,142, 97,180,115, 81, + 180,107,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 109,181,120,173,225,187,170,219,179,181,219,181, 84,174,101, 42,147, + 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,255, 0,255,255, 0,255, + 121,181,123,195,228,198,191,223,191,206,230,203,110,184,122,115,185, + 121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 126,181,126,218,237,218,228,242,228,169,210,169,173,204,172,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 115,168,114,139,187,139,195,215,194,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const stdimg_folder_new_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, @@ -500,56 +312,333 @@ Const 255,255,255,255,255,255); Const - stdimg_edit_paste_16 : Array[0..821] of byte = ( + stdimg_arrow_right : Array[0..137] of byte = ( + 66, 77,138, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 4, 0, 0, 0, 7, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255, 0, 0, + 0, 0, 0, 0,255, 0,255,255, 0,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255, 0, 0, 0, 0, 0, + 0,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, + 0,255); + +Const + stdimg_folder_up_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,155,181,197, 18, 80,118, 1, 68,108, 1, 68, - 108, 1, 68,108, 1, 68,108, 1, 68,108, 1, 68,108, 1, 68,108, 1, - 68,108, 1, 68,108, 1, 68,108, 19, 80,117,162,186,201,255, 0,255, - 255, 0,255, 13, 76,115, 35,127,186, 59,125,167,100,111,115,104,108, - 106,104,108,106,104,108,106,104,108,106,104,108,106, 61,124,163, 61, - 124,163, 61,124,163, 34,123,179, 16, 78,116,255, 0,255,255, 0,255, - 9, 74,114, 38,135,197, 99,109,112,237,238,237,254,254,254,254,254, - 254,254,254,254,238,239,239,253,254,254,100,105,103, 39,135,197, 39, - 135,197, 39,135,197, 3, 68,108,255, 0,255,255, 0,255, 9, 74,114, - 38,135,197,100,104,102,255,255,255,228,231,231,213,216,216,190,194, - 193,180,183,183,255,255,255,255,255,255,100,105,103, 39,135,197, 40, - 134,194, 3, 68,108,255, 0,255,255, 0,255, 9, 74,114, 38,135,197, - 100,104,102,255,255,255,231,233,233,229,231,231,214,217,217,182,185, - 185,255,255,255,255,255,255,255,255,255,100,105,103, 40,134,194, 3, - 68,108,255, 0,255,255, 0,255, 9, 75,114, 38,135,197,100,104,102, - 255,255,255,234,236,236,232,234,234,230,232,232,203,206,205,182,186, - 185,181,185,184,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, - 0,255,255, 0,255, 9, 75,114, 38,135,197,100,104,102,255,255,255, - 237,238,238,235,236,236,233,235,235,231,233,233,216,218,218,202,205, - 204,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, 0,255,255, - 0,255, 9, 75,114, 38,135,197,100,104,102,255,255,255,239,240,240, - 238,239,239,236,237,237,234,235,235,232,234,234,217,219,219,255,255, - 255,100,105,103, 40,134,194, 3, 68,108,255, 0,255,255, 0,255, 9, - 75,114, 38,135,197,100,104,102,255,255,255,239,240,240,181,181,179, - 181,181,179,180,180,178,178,178,177,232,234,234,255,255,255,100,105, - 103, 40,134,194, 3, 68,108,255, 0,255,255, 0,255, 9, 75,115, 38, - 135,197,100,104,102,255,255,255,239,240,240,239,240,240,239,240,240, - 239,240,240,237,239,239,235,237,237,255,255,255,100,105,103, 40,134, - 194, 3, 68,108,255, 0,255,255, 0,255, 9, 75,115, 38,135,197,100, - 104,102,255,255,255,239,240,240,181,181,179,181,181,179,181,181,179, - 181,181,179,238,239,239,255,255,255,100,105,103, 40,134,194, 3, 68, - 108,255, 0,255,255, 0,255, 9, 75,115, 39,136,198,100,104,102,255, - 255,255,239,240,240,239,240,240,239,240,240,239,240,240,239,240,240, - 239,240,240,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, 0, - 255,255, 0,255, 9, 75,115, 39,136,198,100,111,113,241,241,241,224, - 224,224,187,187,187,187,187,187,187,187,187,187,187,187,224,224,224, - 242,242,242,100,109,110, 39,135,197, 3, 68,108,255, 0,255,255, 0, - 255, 13, 77,116, 36,132,192, 62,126,164,100,109,112, 94, 94, 94,124, - 127,127,125,128,128,125,128,128,123,126,126, 94, 94, 94,100,108,110, - 64,124,161, 35,127,185, 16, 78,117,255, 0,255,255, 0,255,155,182, - 197, 18, 80,119, 1, 68,108, 3, 68,107, 91, 92, 92,137,149,149,138, - 151,151,138,151,151,137,149,149, 91, 92, 92, 3, 68,107, 1, 68,108, - 19, 81,118,162,186,201,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,137,138,138, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92,137,138,138,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255); + 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, + 198,167,146,138, 78, 37,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, + 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,169,148,138, 78, 37, + 217,181,149,221,186,154,221,186,154,221,186,154,221,186,154,221,186, + 154,221,186,154,221,186,154,221,186,154,221,186,154,221,186,154,221, + 186,154,221,186,154,217,181,149,138, 79, 37,135, 74, 32,223,192,162, + 213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213,172, + 134,213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213, + 172,134,223,192,162,135, 74, 32,135, 74, 32,226,197,170,215,175,138, + 215,175,138,215,175,138,143, 85, 42,143, 85, 42,143, 85, 42,143, 85, + 42,143, 85, 42,143, 85, 42,215,175,138,215,175,138,215,175,138,226, + 197,170,135, 74, 32,135, 74, 32,228,202,177,217,179,143,217,179,143, + 217,179,143,143, 85, 42,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,217,179,143,217,179,143,228,202,177,135, + 74, 32,135, 74, 32,230,205,181,217,179,143,143, 85, 42,205,164,128, + 143, 85, 42,205,164,128,143, 85, 42,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,217,179,143,230,205,181,135, 74, 32,135, + 74, 32,231,207,184,217,179,143,182,133, 95,143, 85, 42,143, 85, 42, + 143, 85, 42,182,133, 95,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,231,207,184,135, 74, 32,135, 74, 32,232, + 210,188,217,179,143,217,179,143,205,164,128,143, 85, 42,205,164,128, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,232,210,188,135, 74, 32,136, 76, 34,230,209,188,234, + 212,192,234,212,192,234,212,192,234,212,192,234,212,192,226,197,169, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,234,212,192,135, 74, 32,139, 77, 36,136, 76, 34,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,140, 82, 42,218,190,167,227,200,173, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,235,215, + 196,135, 74, 32,135, 74, 32,204,164,133,188,136, 95,188,136, 94,188, + 136, 94,188,136, 94,175,120, 80,144, 86, 46,220,194,172,236,217,199, + 236,217,199,236,217,199,236,217,199,236,217,199,233,214,196,138, 79, + 37,135, 74, 32,209,176,151,218,186,158,205,161,124,205,161,123,205, + 161,124,218,186,158,190,150,120,135, 74, 32,135, 74, 32,135, 74, 32, + 135, 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,168,147,225,210, + 200,144, 89, 49,218,191,169,236,217,200,236,217,200,236,217,200,218, + 191,169,144, 89, 49,225,210,200,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,210, + 200,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,225, + 210,200,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255); + +Const + stdimg_ellipse : Array[0..181] of byte = ( + 66, 77,182, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 10, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, 0, + 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, + 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, + 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0, + 255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, 0,229, + 255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229, 0, 0); + +Const + stdimg_dialog_warning_32 : Array[0..3125] of byte = ( + 66, 77, 54, 12, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 32, 0, 0, 0, 32, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 12, 0, 0, 19, 11, 0, 0, 19, 11, 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,252,252,252,244,244,244,237,237,237,235,235, + 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, + 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, + 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, + 235,235,235,235,237,237,237,242,242,242,248,248,248,254,254,254,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,239,239,239, + 222,222,222,198,198,207,190,190,201,186,186,197,186,186,197,186,186, + 197,186,186,197,186,186,197,186,186,197,186,186,197,186,186,197,186, + 186,197,186,186,197,186,186,197,186,186,197,186,186,197,186,186,197, + 186,186,197,186,186,197,186,186,197,186,186,197,186,186,197,190,190, + 201,189,189,200,197,197,206,223,223,223,246,246,246,255,255,255,255, + 255,255,255,255,255,244,244,244,178,178,210, 22, 22,165, 0, 0,159, + 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0, + 159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, + 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, + 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0, + 159, 21, 21,165,173,173,209,250,250,250,255,255,255,255,255,255,243, + 243,243, 39, 39,171, 61, 61,196,112,112,224,117,117,226,116,116,226, + 113,113,225,111,111,225,108,108,224,105,105,223,102,102,223,100,100, + 222, 97, 97,222, 94, 94,221, 92, 92,220, 89, 89,220, 86, 86,219, 83, + 83,219, 81, 81,218, 78, 78,218, 75, 75,217, 72, 72,216, 69, 69,216, + 67, 67,215, 64, 64,215, 62, 62,214, 54, 54,212, 28, 28,188, 20, 20, + 166,246,246,246,255,255,255,255,255,255,253,253,253, 15, 15,166,121, + 121,221, 20, 20,208, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, + 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0, + 204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, + 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, + 0, 0,204, 10, 10,206, 56, 56,207, 2, 2,160,247,247,251,255,255, + 255,255,255,255,255,255,255, 90, 90,194, 89, 89,200, 58, 58,216, 0, + 0,204,163,163,219,210,210,224,210,210,224,211,211,225,212,212,226, + 212,212,226,213,213,227,214,214,228,215,215,229,216,216,230,216,216, + 230,217,217,231,217,217,231,218,218,232,218,218,232,219,219,233,220, + 220,234,221,221,235,222,222,236,193,193,231, 0, 0,204, 27, 27,209, + 44, 44,192, 53, 53,181,255,255,255,255,255,255,255,255,255,255,255, + 255,221,221,242, 25, 25,168,117,117,221, 8, 8,206, 80, 80,211,224, + 224,224,225,225,225,225,225,225,226,226,226,227,227,227,227,227,227, + 228,228,228,229,229,229,230,230,230,230,230,230,231,231,231,232,232, + 232,233,233,233,234,234,234,234,234,234,235,235,235,236,236,236,237, + 237,237,105,105,219, 3, 3,205, 59, 59,211, 14, 14,166,193,193,232, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,109,109, + 201, 85, 85,197, 68, 68,218, 2, 2,204,179,179,219,224,224,224,225, + 225,225,225,225,225,226,226,226,227,227,227,227,227,227,228,228,228, + 60, 60, 60, 55, 55, 55,230,230,230,231,231,231,232,232,232,233,233, + 233,234,234,234,234,234,234,235,235,235,205,205,231, 7, 7,205, 36, + 36,211, 47, 47,188, 70, 70,186,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,234,234,247, 23, 23,169,121,121, + 220, 14, 14,207, 59, 59,209,223,223,223,224,224,224,224,224,224,225, + 225,225,226,226,226,226,226,226,227,227,227, 55, 55, 55, 53, 53, 53, + 230,230,230,230,230,230,231,231,231,232,232,232,233,233,233,234,234, + 234,234,234,234, 82, 82,215, 8, 8,206, 67, 67,210, 10, 10,163,212, + 212,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,129,129,208, 74, 74,190, 81, 81,220, 0, 0, + 204,162,162,218,223,223,223,224,224,224,224,224,224,225,225,225,226, + 226,226,226,226,226,215,215,215,215,215,215,229,229,229,230,230,230, + 230,230,230,231,231,231,232,232,232,233,233,233,186,186,227, 1, 1, + 204, 47, 47,213, 46, 46,185, 96, 96,196,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 244,244,251, 25, 25,169,121,121,218, 23, 23,209, 42, 42,208,221,221, + 223,223,223,223,224,224,224,224,224,224,225,225,225,226,226,226, 37, + 37, 37, 37, 37, 37,228,228,228,229,229,229,229,229,229,230,230,230, + 231,231,231,232,232,232, 59, 59,211, 14, 14,207, 73, 73,209, 11, 11, + 164,228,228,245,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,151,151,216, + 63, 63,185, 94, 94,222, 0, 0,204,141,141,215,223,223,223,223,223, + 223,224,224,224,224,224,224,225,225,225, 27, 27, 27, 27, 27, 27,227, + 227,227,228,228,228,229,229,229,229,229,229,230,230,230,164,164,223, + 0, 0,204, 60, 60,215, 41, 41,179,120,120,205,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,251,251,253, 35, 35,174,116,116,215, + 34, 34,211, 27, 27,206,215,215,221,223,223,223,223,223,223,224,224, + 224,224,224,224, 13, 13, 13, 13, 13, 13,226,226,226,227,227,227,228, + 228,228,229,229,229,226,226,228, 40, 40,209, 24, 24,209, 75, 75,206, + 16, 16,167,241,241,250,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,172,172,224, 49, 49,178,106,106,223, 1, 1,204, + 121,121,213,222,222,222,222,222,222,223,223,223,224,224,224, 3, 3, + 3, 3, 3, 3,225,225,225,226,226,226,227,227,227,228,228,228,140, + 140,218, 1, 1,204, 75, 75,218, 34, 34,174,144,144,213,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254, + 254,255, 49, 49,179,109,109,211, 47, 47,213, 16, 16,206,206,206,220, + 222,222,222,222,222,222,215,215,215, 0, 0, 0, 0, 0, 0,217,217, + 217,225,225,225,226,226,226,218,218,226, 25, 25,207, 36, 36,211, 74, + 74,203, 27, 27,171,249,249,253,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,232, 36, + 36,173,117,117,224, 4, 4,205,102,102,212,221,221,221,222,222,222, + 204,204,204, 0, 0, 0, 0, 0, 0,206,206,206,225,225,225,225,225, + 225,118,118,216, 4, 4,205, 87, 87,219, 27, 27,170,167,167,222,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 69, 69,186,100,100,205, 59, + 59,216, 7, 7,205,195,195,219,221,221,221,193,193,193, 0, 0, 0, + 0, 0, 0,195,195,195,224,224,224,206,206,223, 12, 12,205, 49, 49, + 214, 70, 70,199, 45, 45,178,254,254,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,211,211,238, 25, 25,170,124,124,224, 8, 8,206, 82, + 82,210,221,221,221,218,218,218,207,207,207,207,207,207,220,220,220, + 223,223,223, 97, 97,213, 9, 9,206, 98, 98,219, 17, 17,166,189,189, + 230,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255, 92, 92,194, 89, 89,199, 72, 72,218, 2, 2,204,180,180,217,221, + 221,221,221,221,221,222,222,222,222,222,222,192,192,220, 4, 4,204, + 64, 64,217, 65, 65,194, 68, 68,186,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,226,226,244, 20, 20, + 168,128,128,224, 15, 15,207, 63, 63,209,220,220,220,221,221,221,221, + 221,221,222,222,222, 74, 74,210, 17, 17,207,104,104,219, 11, 11,163, + 210,210,238,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,114,114,202, 79, 79,193, 85, 85, + 220, 0, 0,204,162,162,215,220,220,220,220,220,220,173,173,217, 1, + 1,204, 80, 80,220, 59, 59,189, 92, 92,194,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,238,238,249, 20, 20,167,128,128,222, 25, 25,209, 44, 44, + 207,218,218,219,220,220,220, 53, 53,208, 28, 28,210,106,106,217, 10, + 10,164,226,226,244,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 137,137,211, 67, 67,187, 99, 99,223, 0, 0,204,143,143,214,152,152, + 214, 1, 1,204, 97, 97,223, 51, 51,184,118,118,204,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,246,246,252, 25, 25,169, + 122,122,218, 36, 36,211, 21, 21,206, 23, 23,205, 42, 42,212,104,104, + 215, 14, 14,165,239,239,249,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,158,158,218, 53, 53,181,113,113,225, + 1, 1,204, 3, 3,205,113,113,225, 41, 41,177,142,142,212,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,252,252,254, 37, 37,174,111,111,213, 66, 66,217, 70, 70,218, + 96, 96,210, 25, 25,170,248,248,252,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180, + 180,227, 22, 22,168,109,109,218,106,106,218, 20, 20,169,165,165,221, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,140,140,211, 12, + 12,165, 8, 8,163,124,124,206,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,252,252,254,251,251,253,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255); + +Const + stdimg_folder_home_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 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, + 198,167,146,138, 78, 37,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, + 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,169,148,138, 78, 37, + 217,181,149,221,186,154, 98,173,106, 89,163, 97, 74,135, 79,117,122, + 118,121,120,121,126,126,126,118,118,118,103,130,106, 95,165,103, 72, + 146, 79, 83,137, 86,217,181,149,138, 79, 37,135, 74, 32,223,192,162, + 213,172,134,195,229,197,142,200,143,101,160,107,216,226,216,149,147, + 149,167,167,167,134,132,134,202,236,206,104,181,114,132,188,135,172, + 203,171,223,192,162,135, 74, 32,135, 74, 32,226,197,170,215,175,138, + 215,175,138,215,175,138,171,172,172,246,245,246,136,136,136,157,157, + 157,127,127,127,254,254,255,130,127,127,215,175,138,215,175,138,226, + 197,170,135, 74, 32,135, 74, 32,228,202,177,217,179,143,217,179,143, + 217,179,143,170,174,177,252,250,248,130,131,131,115,115,115,126,126, + 126,255,255,255,112,116,124,217,179,143,217,179,143,228,202,177,135, + 74, 32,135, 74, 32,230,205,181,217,179,143,217,179,143, 88,152,197, + 94,150,192,218,222,224,245,243,241,237,238,238,247,244,242,193,201, + 212, 60, 97,147, 56, 92,143,217,179,143,230,205,181,135, 74, 32,135, + 74, 32,231,207,184,217,179,143,217,179,143,103,160,205,100,162,205, + 92,149,191,212,215,217,254,248,243,188,202,213, 69,120,167, 91,139, + 179, 71,112,157,217,179,143,231,207,184,135, 74, 32,135, 74, 32,232, + 210,188,217,179,143,217,179,143,217,179,143, 99,156,203, 94,158,204, + 94,150,192,161,185,202, 79,140,186,106,157,196, 78,125,169,217,179, + 143,217,179,143,232,210,188,135, 74, 32,136, 76, 34,230,209,188,234, + 212,192,234,212,192,234,212,192,234,212,192, 95,154,202,102,163,207, + 93,151,194,111,168,206, 78,132,177,217,179,143,217,179,143,217,179, + 143,234,212,192,135, 74, 32,139, 77, 36,136, 76, 34,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,140, 82, 42, 84,138,186, 79,134,180, + 77,125,171,217,179,143,217,179,143,217,179,143,217,179,143,235,215, + 196,135, 74, 32,135, 74, 32,204,164,133,188,136, 95,188,136, 94,188, + 136, 94,188,136, 94,175,120, 80,144, 86, 46,220,194,172,236,217,199, + 236,217,199,236,217,199,236,217,199,236,217,199,233,214,196,138, 79, + 37,135, 74, 32,209,176,151,218,186,158,205,161,124,205,161,123,205, + 161,124,218,186,158,190,150,120,135, 74, 32,135, 74, 32,135, 74, 32, + 135, 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,168,147,225,210, + 200,144, 89, 49,218,191,169,236,217,200,236,217,200,236,217,200,218, + 191,169,144, 89, 49,225,210,200,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,210, + 200,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,225, + 210,200,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255); + +Const + stdimg_arrow_down : Array[0..149] of byte = ( + 66, 77,150, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 7, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 96, 0, 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, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255, 0, 0, 0, + 255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255, 0,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); Const stdimg_dialog_confirmation_32 : Array[0..3125] of byte = ( @@ -739,7 +828,73 @@ Const 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255); Const - stdimg_list_remove_16 : Array[0..821] of byte = ( + stdimg_document : Array[0..1061] of byte = ( + 66, 77, 38, 4, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 18, 0, 0, 0, 18, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 240, 3, 0, 0,235, 10, 0, 0,235, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 98, 98, + 98, 91, 91, 91, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 97, 97, 97, + 255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, + 88, 88, 88, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, + 0,255,255, 0,255, 88, 88, 88,182,193,198,182,193,198,172,189,196, + 163,184,195,154,179,194,145,175,192,136,170,191,127,165,190,118,160, + 189,115,158,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, + 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,225, + 237,244,216,232,242,208,228,240,200,222,238,191,218,236,184,214,233, + 176,209,231,167,204,229,120,161,188, 48, 48, 48, 90, 90, 90,255, 0, + 255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, + 88,222,222,222,233,241,247,137,144,148,132,141,147,127,139,146,122, + 136,145,117,133,143,112,130,142,176,209,231,127,163,188, 48, 48, 48, + 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255, + 255, 0,255, 88, 88, 88,222,222,222,242,246,250,234,242,248,226,238, + 245,218,233,242,210,228,240,201,224,238,193,220,236,186,214,233,133, + 166,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, + 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,251,252,252, + 148,151,152,143,148,151,138,145,149,133,142,148,128,139,146,123,136, + 145,194,219,236,138,168,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, + 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222, + 222,222,255,255,255,252,253,253,244,248,250,235,243,248,228,238,245, + 220,234,243,212,230,241,202,223,236,144,171,188, 48, 48, 48, 90, 90, + 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0, + 255, 88, 88, 88,222,222,222,255,255,255,155,155,155,154,154,154,148, + 151,152,143,148,151,139,145,149,134,143,148,212,226,236,151,174,188, + 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255, + 255, 0,255,255, 0,255, 88, 88, 88,223,223,223,255,255,255,255,255, + 255,255,255,255,254,254,254,245,248,251,237,244,248,227,237,243,220, + 231,238,151,174,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, + 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222, + 255,255,255,155,155,155,155,155,155,155,155,155,155,155,155,246,249, + 251,236,240,244,217,224,231,175,182,190, 48, 48, 48, 90, 90, 90,255, + 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, + 88, 88,222,222,222,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,245,245,246,222,224,226,177,183,188,132,137,143, 48, 48, + 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0, + 255,255, 0,255, 88, 88, 88,222,222,222,255,255,255,155,155,155,155, + 155,155,155,155,155,255,255,255,137,137,137,112,112,112,107,107,107, + 66, 66, 66, 48, 48, 48, 96, 96, 96,255, 0,255,255, 0,255, 0, 0, + 255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,255,255, + 255,255,255,255,255,255,255,255,255,255,252,252,252,112,112,112,206, + 206,206,255,255,255,153,153,153, 48, 48, 48,135,135,135,255, 0,255, + 255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88, + 222,222,222,255,255,255,255,255,255,255,255,255,255,255,255,234,234, + 234,109,109,109,255,255,255,153,153,153, 88, 88, 88,135,135,135,255, + 0,255,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, + 0,255, 88, 88, 88,222,222,222,222,222,222,222,222,222,222,222,222, + 222,222,222,177,183,188, 88, 88, 88,153,153,153, 88, 88, 88,135,135, + 135,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0,255, 0, + 255,255, 0,255,255, 0,255, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 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, 0, 0); + +Const + stdimg_folder_open_file_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, @@ -749,697 +904,245 @@ Const 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,182,132, 93,164,101, 52,164,101, 52, - 164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, - 52,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, - 255,255,255,255,255,164,101, 52,229,204,180,219,183,149,219,182,148, - 218,180,146,218,179,144,217,173,134,216,170,131,215,168,127,215,166, - 125,224,190,159,164,101, 52,255,255,255,255,255,255,255,255,255,255, - 255,255,164,101, 52,232,211,192,231,209,187,231,209,188,230,206,183, - 230,206,183,230,206,183,230,206,183,230,205,182,230,204,181,230,204, - 182,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,182, - 132, 93,164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52, - 164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52,182,132, - 93,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 165,129,103,139, 82, 41,139, 82, 41,157,108, 74,157,108, 74,157,108, + 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157, + 108, 74,139, 82, 41,145,110, 84,255,255,255,255,255,255,139, 82, 41, + 209,165,123,210,165,124,210,165,124,210,165,124,210,165,124,210,165, + 124,210,165,124,210,165,124,210,165,124,210,165,124,210,165,124,209, + 165,123,139, 82, 41,255,255,255,255,255,255,157,104, 63,208,161,116, + 207,159,114,207,159,114,207,159,114,207,159,114,207,159,114,207,159, + 114,207,159,114,207,159,114,207,159,114,207,159,114,208,161,116,139, + 82, 41,255,255,255,139, 82, 41,196,151,112,208,162,119,207,160,117, + 207,160,117,207,160,117,207,160,117,207,160,117,207,160,117,207,160, + 117,207,160,117,207,160,117,207,160,117,208,162,119,196,151,112,139, + 82, 41,139, 82, 41,206,164,127,210,165,123,209,164,122,209,164,122, + 209,164,122,209,164,122,209,164,122,209,164,122,209,164,122,209,164, + 122,209,164,122,209,164,122,210,166,124,212,169,129,139, 82, 41,139, + 82, 41,215,180,148,220,186,153,220,186,153,220,186,153,220,185,152, + 216,179,143,212,169,130,211,168,127,211,168,127,211,168,127,211,168, + 127,211,168,127,212,168,128,209,169,133,139, 82, 41,139, 82, 41,139, + 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41, + 210,173,142,218,180,145,217,179,145,217,179,145,217,179,145,217,179, + 145,217,180,145,217,183,152,139, 82, 41,255,255,255,139, 82, 41,127, + 120,111,253,253,253,248,249,249,243,241,240,205,137, 89,139, 82, 41, + 139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, + 41,139, 82, 41,139, 82, 41,255,255,255,139, 82, 41,142,136,127,242, + 242,242,241,242,241,241,241,241,205,137, 89,255,247,240,253,231,214, + 253,230,212,252,228,208,251,227,203,254,243,232,205,136, 88,139, 82, + 41,255,255,255,255,255,255,139, 82, 41,177,154,132,151,138,124,150, + 137,123,148,136,121,205,137, 89,255,247,242, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92,253,242,231,205,137, 89,139, 82, 41,255,255, + 255,255,255,255,139, 82, 41,218,183,153,212,172,137,212,172,137,213, + 174,140,205,136, 88,254,247,241,252,228,209,251,226,204,249,221,196, + 247,218,192,252,242,233,205,137, 89,139, 82, 41,255,255,255,255,255, + 255,157,103, 62,197,159,132,213,181,155,213,181,155,211,179,152,204, + 135, 87,255,247,241, 93, 93, 93, 92, 92, 92, 92, 92, 92,254,249,243, + 255,247,240,205,137, 89,255,255,255,255,255,255,255,255,255,255,255, + 255,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,205,137, 89,255, + 247,240,255,247,240,255,247,240,255,247,240,255,247,240,255,247,240, + 205,137, 89,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,205,137, 89,205,137, 89,205, + 137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89, 255,255,255,255,255,255); Const - stdimg_arrow_right : Array[0..89] of byte = ( - 66, 77, 90, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0, - 0, 4, 0, 0, 0, 7, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 2, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0,255,255,255, 0,112, 0, 0, 0, 48, 0, - 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 48, 0, 0, - 0,112, 0, 0, 0); - -Const - stdimg_choice_yes_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255, 12,164, 60, 17,171, 71, 13,173, 73,104,175, - 120,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 87,183,107, 78,224,155, 92,234,170, 92,234,171, 35,192,104, 87,167, - 106,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 32,183, 89, - 102,255,205,104,255,201, 85,255,195, 73,252,184, 24,199,107, 85,166, - 102,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,157,207,165, 22,223,131, 47,255,181, - 45,255,174, 30,255,170, 3,255,160, 17,250,157, 12,190, 93, 68,158, - 86,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255, 68,173, 91, 0,248,147, 1,254,156, 10,254,160, - 18,251,159, 38,250,165, 49,242,160, 70,234,157, 21,183, 87, 74,169, - 94,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255, 7,173, 65, 7,243,144, 45,243,160, 72,243,171,105,199,139, - 96,231,164,112,241,183,110,233,172,102,224,157, 28,169, 74, 57,157, - 75,255, 0,255,255, 0,255,255, 0,255,255, 0,255,148,199,148, 18, - 202,101, 79,235,162,102,241,178, 85,205,129,255, 0,255,172,211,180, - 89,192,126,129,232,178,130,225,170,129,215,157, 45,168, 78, 63,165, - 77,255, 0,255,255, 0,255,255, 0,255,127,196,134, 86,221,149,112, - 231,171,111,233,173,152,207,158,255, 0,255,255, 0,255,255, 0,255, - 101,183,121,151,227,181,150,221,173,157,217,170, 60,168, 84, 44,152, - 56,255, 0,255,255, 0,255,255, 0,255,138,190,142, 97,180,115, 81, - 180,107,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 109,181,120,173,225,187,170,219,179,181,219,181, 84,174,101, 42,147, - 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,255, 0,255,255, 0,255, - 121,181,123,195,228,198,191,223,191,206,230,203,110,184,122,115,185, - 121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 126,181,126,218,237,218,228,242,228,169,210,169,173,204,172,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 115,168,114,139,187,139,195,215,194,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255); + stdimg_arrow_left : Array[0..137] of byte = ( + 66, 77,138, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 4, 0, 0, 0, 7, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 84, 0, 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, 0, 0, 0,255, 0, + 255,255, 0,255, 0, 0, 0, 0, 0, 0,255, 0,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0, + 255, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0); Const - stdimg_checkboxes : Array[0..2601] of byte = ( - 66, 77, 42, 10, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 65, 0, 0, 0, 13, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 244, 9, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + stdimg_dialog_error_32 : Array[0..3125] of byte = ( + 66, 77, 54, 12, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 32, 0, 0, 0, 32, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 12, 0, 0, 19, 11, 0, 0, 19, 11, 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,254,254,254,249,249,249,242,242,242,233, + 233,233,225,225,225,219,219,219,213,213,213,208,208,208,204,204,204, + 208,208,208,211,211,211,216,216,216,222,222,222,229,229,229,239,239, + 239,247,247,247,252,252,252,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,245,245,245,231,231, + 231,219,219,219,208,208,208,198,198,198,187,187,187,178,178,178,169, + 169,169,162,162,162,156,156,156,153,153,153,154,154,154,157,157,157, + 162,162,162,170,170,170,179,179,179,189,189,189,199,199,199,209,209, + 209,222,222,222,239,239,239,252,252,252,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,245,245,245,233,233,233,220,220,220,208,208,208,195,195, + 195,183,183,183,159,159,170,102,102,164, 44, 44,169, 20, 20,172, 8, + 8,175, 2, 2,177, 7, 7,174, 19, 19,171, 40, 40,165, 96, 96,158, + 149,149,160,172,172,172,184,184,184,197,197,197,209,209,209,222,222, + 222,235,235,235,252,252,252,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254, + 242,242,242,231,231,231,219,219,219,179,179,204, 60, 60,185, 6, 6, + 179, 16, 18,187, 25, 33,199, 39, 52,207, 49, 65,211, 57, 76,215, 48, + 65,210, 38, 50,203, 24, 32,197, 16, 17,184, 6, 6,178, 59, 59,182, + 171,171,196,209,209,209,221,221,221,232,232,232,244,244,244,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,253, + 101,101,208, 10, 10,182, 21, 26,196, 61, 78,218, 54, 70,218, 36, 46, + 211, 25, 30,207, 18, 22,205, 15, 17,203, 18, 22,203, 25, 30,205, 35, + 45,208, 52, 69,213, 55, 75,215, 21, 26,194, 9, 9,181,104,104,206, + 245,245,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,235,235,249, 51, 51,195, 17, 18,191, 59, 74,219, + 51, 64,218, 19, 21,209, 10, 10,206, 10, 10,205, 10, 10,205, 10, 10, + 204, 10, 10,203, 9, 9,203, 9, 9,202, 9, 9,201, 9, 9,200, 19, + 22,203, 47, 62,212, 53, 71,213, 15, 17,187, 54, 54,196,236,236,249, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,239,239,250, 27, + 27,187, 22, 26,198, 66, 82,225, 26, 31,214, 11, 11,210, 11, 11,209, + 11, 11,208, 11, 11,208, 10, 10,207, 10, 10,206, 10, 10,205, 10, 10, + 205, 10, 10,204, 10, 10,204, 9, 9,203, 9, 9,202, 9, 9,202, 24, + 30,206, 59, 78,217, 20, 24,193, 30, 30,188,240,240,250,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,252,252,254, 57, 57,197, 24, 27,202, 64, 78,226, 20, + 22,215, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,211, 11, 11,210, + 11, 11,209, 11, 11,209, 11, 11,208, 11, 11,207, 10, 10,207, 10, 10, + 206, 10, 10,205, 10, 10,204, 10, 10,204, 10, 10,203, 17, 20,205, 56, + 74,217, 21, 25,194, 60, 60,197,252,252,254,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,120,120, + 216, 19, 20,194, 68, 82,229, 19, 21,218, 13, 13,216, 13, 13,215, 12, + 12,214, 12, 12,214, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,211, + 11, 11,210, 11, 11,210, 11, 11,209, 11, 11,208, 11, 11,208, 10, 10, + 207, 10, 10,206, 10, 10,205, 10, 10,205, 17, 19,206, 60, 78,219, 18, + 19,191,124,124,217,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,230,230,247, 17, 17,187, 63, 75,228, 28, 31, + 222, 13, 13,219, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,216, 13, + 13,215, 12, 12,215, 12, 12,214, 12, 12,213, 12, 12,213, 12, 12,212, + 12, 12,211, 11, 11,210, 11, 11,210, 11, 11,209, 11, 11,208, 11, 11, + 208, 11, 11,207, 10, 10,207, 23, 28,210, 53, 69,217, 17, 17,185,232, + 232,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 91, 91,207, 28, 31,208, 53, 61,229, 14, 14,221, 14, 14,221, 14, 14, + 220, 14, 14,220, 14, 14,219, 13, 13,218, 13, 13,218, 13, 13,217, 13, + 13,216, 13, 13,215, 12, 12,215, 12, 12,214, 12, 12,214, 12, 12,213, + 12, 12,212, 12, 12,211, 11, 11,211, 11, 11,210, 11, 11,209, 11, 11, + 209, 11, 11,208, 47, 59,217, 23, 27,200, 94, 94,208,255,255,255,255, + 255,255,255,255,255,255,255,255,240,240,250, 10, 10,183, 70, 82,232, + 29, 30,227, 29, 29,226, 22, 22,224, 14, 14,223, 14, 14,222, 14, 14, + 221, 14, 14,220, 14, 14,220, 14, 14,219, 13, 13,219, 13, 13,218, 13, + 13,217, 13, 13,216, 13, 13,216, 13, 13,215, 12, 12,214, 12, 12,214, + 12, 12,213, 12, 12,213, 12, 12,212, 12, 12,211, 11, 11,210, 18, 21, + 212, 60, 77,222, 9, 10,182,242,242,251,255,255,255,255,255,255,255, + 255,255,166,166,228, 24, 25,197,104,111,238, 84, 84,235, 84, 84,234, + 84, 84,234, 72, 72,232, 51, 51,229, 25, 25,225, 15, 15,223, 14, 14, + 222, 14, 14,221, 14, 14,221, 14, 14,220, 14, 14,219, 13, 13,219, 13, + 13,218, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,215, 12, 12,215, + 12, 12,214, 12, 12,213, 12, 12,213, 12, 12,212, 58, 72,223, 20, 22, + 193,170,170,229,255,255,255,255,255,255,255,255,255, 78, 78,204, 55, + 58,217,103,107,240, 82, 82,236, 83, 83,236, 83, 83,236, 83, 83,235, + 82, 82,234, 81, 81,234, 58, 58,230, 26, 26,225, 15, 15,224, 15, 15, + 223, 14, 14,223, 14, 14,222, 14, 14,221, 14, 14,220, 14, 14,220, 14, + 14,219, 13, 13,218, 13, 13,218, 13, 13,217, 13, 13,216, 13, 13,216, + 13, 13,215, 12, 12,214, 40, 48,221, 28, 34,205, 82, 82,203,255,255, + 255,255,255,255,255,255,255, 38, 38,193, 88, 94,229, 93, 95,240, 80, + 80,237, 80, 80,237, 80, 80,237,243,243,243,243,243,243,243,243,243, + 243,243,243,243,243,243,241,241,241,239,239,239,239,239,239,239,239, + 239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239, + 239,239,239,239,239,239,239,239, 13, 13,218, 13, 13,217, 23, 23,218, + 51, 56,223, 46, 55,215, 40, 40,192,255,255,255,255,255,255,255,255, + 255, 16, 16,185,109,115,238, 87, 87,240, 79, 79,239, 79, 79,239, 79, + 79,238,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 243,243,243,243,243,243,240,240,240,239,239,239,239,239,239,239,239, + 239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239, + 239,239, 23, 23,221, 57, 57,226, 79, 79,229, 87, 89,229, 76, 87,225, + 19, 19,185,255,255,255,255,255,255,255,255,255, 3, 3,180,120,126, + 244, 81, 82,242, 77, 77,241, 77, 77,240, 77, 77,240,243,243,243,243, + 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 243,243,243,241,241,241,239,239,239,239,239,239,239,239,239,239,239, + 239,239,239,239,239,239,239,239,239,239,241,241,241, 74, 74,231, 76, + 76,231, 76, 76,230, 82, 84,230, 97,110,233, 5, 5,180,255,255,255, + 255,255,255,255,255,255, 16, 16,185,103,108,239, 84, 85,244, 75, 75, + 243, 75, 75,242, 75, 75,241,243,243,243,243,243,243,243,243,243,243, + 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 242,242,242,240,240,240,240,240,240,239,239,239,240,240,240,242,242, + 242,243,243,243,243,243,243, 75, 75,233, 75, 75,232, 75, 75,232, 83, + 85,233, 85, 95,228, 19, 19,186,255,255,255,255,255,255,255,255,255, + 37, 37,193, 82, 86,233, 87, 89,245, 73, 73,244, 73, 73,243, 74, 74, + 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243, + 243, 73, 73,234, 72, 72,233, 73, 73,233, 87, 90,235, 69, 76,223, 40, + 40,193,255,255,255,255,255,255,255,255,255, 77, 77,205, 53, 56,223, + 97, 99,247, 72, 72,246, 71, 71,245, 71, 71,245, 71, 71,244, 71, 71, + 243, 72, 72,243, 72, 72,243, 71, 71,242, 71, 71,241, 71, 71,241, 71, + 71,240, 72, 72,240, 72, 72,240, 71, 71,239, 71, 71,239, 71, 71,238, + 71, 71,237, 71, 71,236, 71, 71,237, 71, 71,236, 71, 71,236, 71, 71, + 235, 71, 71,234, 94, 99,237, 44, 49,214, 81, 81,204,255,255,255,255, + 255,255,255,255,255,165,165,228, 29, 30,203,113,118,250, 71, 71,247, + 71, 71,247, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,245, 70, 70, + 244, 70, 70,244, 70, 70,243, 70, 70,242, 69, 69,242, 69, 69,242, 69, + 69,241, 69, 69,240, 70, 70,240, 70, 70,239, 69, 69,239, 69, 69,239, + 69, 69,238, 69, 69,237, 69, 69,237, 70, 70,236, 69, 69,236,108,116, + 241, 25, 26,198,170,170,229,255,255,255,255,255,255,255,255,255,240, + 240,250, 10, 10,184,116,121,249, 77, 78,249, 71, 71,249, 71, 71,248, + 71, 71,248, 71, 71,247, 71, 71,246, 71, 71,246, 71, 71,246, 70, 70, + 245, 70, 70,244, 70, 70,244, 70, 70,243, 70, 70,243, 70, 70,242, 69, + 69,242, 69, 69,241, 69, 69,241, 69, 69,240, 69, 69,239, 68, 68,239, + 68, 68,239, 68, 68,239, 74, 75,239,106,115,240, 11, 11,183,241,241, + 251,255,255,255,255,255,255,255,255,255,255,255,255, 89, 89,208, 45, + 46,223,106,109,252, 71, 71,250, 71, 71,250, 71, 71,250, 71, 71,249, + 71, 71,248, 71, 71,248, 71, 71,247, 71, 71,247, 71, 71,246, 71, 71, + 246, 70, 70,245, 70, 70,245, 70, 70,244, 70, 70,243, 70, 70,243, 70, + 70,242, 69, 69,242, 69, 69,242, 69, 69,241, 69, 69,240, 69, 69,240, + 100,107,242, 43, 45,215, 93, 93,209,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,230,230,247, 17, 17,189,111,115,250, 85, + 86,252, 72, 72,252, 71, 71,251, 71, 71,251, 71, 71,250, 71, 71,250, + 71, 71,249, 71, 71,249, 71, 71,248, 71, 71,247, 71, 71,247, 71, 71, + 246, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,244, 70, 70,244, 70, + 70,243, 70, 70,242, 69, 69,242, 81, 83,242,104,111,241, 18, 18,188, + 232,232,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,120,120,217, 27, 28,206,122,126,254, 79, 79,253, 72, + 72,253, 72, 72,253, 72, 72,252, 71, 71,251, 71, 71,251, 71, 71,250, + 71, 71,250, 71, 71,250, 71, 71,249, 71, 71,248, 71, 71,248, 71, 71, + 247, 71, 71,246, 71, 71,246, 71, 71,246, 70, 70,245, 70, 70,245, 75, + 76,245,117,124,247, 28, 29,202,123,123,217,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252, + 254, 55, 55,198, 44, 44,218,121,124,254, 79, 80,254, 72, 72,254, 72, + 72,253, 72, 72,253, 72, 72,253, 72, 72,252, 72, 72,252, 71, 71,251, + 71, 71,250, 71, 71,250, 71, 71,250, 71, 71,249, 71, 71,249, 71, 71, + 248, 71, 71,247, 71, 71,247, 78, 79,247,115,122,248, 43, 45,214, 59, + 59,199,252,252,254,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,238,238,250, 28, 28, + 189, 45, 45,216,125,127,254, 86, 88,254, 72, 72,254, 72, 72,254, 72, + 72,254, 72, 72,254, 72, 72,253, 72, 72,253, 72, 72,253, 72, 72,252, + 71, 71,251, 71, 71,251, 71, 71,250, 71, 71,250, 71, 71,250, 86, 87, + 250,120,126,250, 43, 45,213, 29, 29,189,240,240,250,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,234,234,249, 50, 50,196, 30, 30, + 204,115,117,248,111,114,254, 80, 81,254, 72, 72,254, 72, 72,254, 72, + 72,254, 72, 72,254, 72, 72,254, 72, 72,253, 72, 72,253, 72, 72,253, + 72, 72,252, 81, 82,252,109,113,252,111,116,246, 28, 29,201, 52, 52, + 196,235,235,249,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,249,249,253,105,105,212, 10, 10,184, 53, 54, + 218,122,124,251,117,120,254, 99,100,254, 88, 89,254, 82, 82,254, 77, + 78,254, 82, 82,254, 87, 89,254, 98,100,254,115,119,254,119,123,251, + 50, 51,216, 12, 12,185,105,105,212,250,250,253,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,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,127,127,127,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,255,255,255, - 127,127,127,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,255,255,255,127,127,127,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,255,255,255,127,127,127,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,255,255,255,127,127, - 127,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,255,255,255,255, + 255,255,255,255,255,255,218,218,244, 74, 74,203, 11, 11,183, 35, 35, + 204, 68, 69,227, 92, 94,239,110,111,246,123,126,252,109,111,246, 91, + 93,238, 67, 68,227, 34, 34,204, 9, 9,183, 77, 77,204,219,219,244, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, - 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, - 255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255, - 255,127,127,127, 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, - 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, - 127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,127,127, - 127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255,255,255,127, - 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, - 191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127, - 127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191, - 255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52, 52, 52, - 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127, - 127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127, - 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,191,191,191,255, - 255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, - 255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, - 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255,255, - 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, - 191,191,255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,255,255,237,237,250,162,162,227, 75, 75,204, 38, 38, + 193, 17, 17,186, 4, 4,180, 17, 17,186, 38, 38,194, 77, 77,205,164, + 164,228,238,238,250,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127, - 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, - 191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127, - 127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127, - 127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127, - 127, 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,191,191,191, - 255,255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, - 255,255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, - 0, 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255, - 255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255, - 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, - 191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52, - 52, 52, 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, - 52,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127, - 127,127, 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,191,191, - 191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, - 0, 0, 0,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127, - 127,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255, - 255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255, - 255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0, - 127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, - 191,191,255,255,255,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,191,191,191,255,255,255,127,127,127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,191,191,191,255,255,255,127,127, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,191,191, - 255,255,255,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,191,191,191,255,255,255, 0,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,255,255,255,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,255, - 255,255,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,255,255,255,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,255,255,255,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,255,255,255, - 0); - -Const - stdimg_arrow_left : Array[0..89] of byte = ( - 66, 77, 90, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0, - 0, 4, 0, 0, 0, 7, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 2, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0,255,255,255, 0,224, 0, 0, 0,192, 0, - 0, 0,128, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,192, 0, 0, - 0,224, 0, 0, 0); - -Const - stdimg_ellipse : Array[0..181] of byte = ( - 66, 77,182, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 10, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, - 229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, 0, - 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, - 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, - 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0, - 255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, 0,229, - 255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, - 229,255, 0,229,255, 0,229,255, 0,229, 0, 0); - -Const - stdimg_refresh_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,197,157,126,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,225,205,189,189,144,108,174,118, 73,166,105, 57,176, - 122, 79,196,156,124,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,164,101, 52,203,167,139,255, 0,255,225,204,188,172,113, - 68,184,134, 93,206,166,132,216,182,151,219,185,153,211,172,138,195, - 149,111,169,109, 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 165,104, 56,185,136, 96,180,129, 88,180,128, 86,227,202,180,236,218, - 201,231,209,188,227,201,176,222,190,160,210,171,136,206,165,130,211, - 174,142,169,110, 64,255, 0,255,255, 0,255,255, 0,255,167,105, 58, - 241,228,216,212,178,149,244,233,224,243,232,221,237,220,204,210,173, - 143,179,125, 83,166,104, 56,166,105, 57,166,106, 58,169,109, 61,176, - 120, 76,197,157,125,255, 0,255,255, 0,255,166,104, 57,246,238,230, - 245,236,227,245,237,228,230,210,193,179,126, 84,185,136, 97,255, 0, - 255,255, 0,255,217,191,171,175,117, 74,182,124, 79,167,107, 59,167, - 107, 59,255, 0,255,255, 0,255,165,104, 55,246,238,230,235,215,196, - 234,217,201,164,102, 53,217,191,171,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,173,115, 70,225,196,174,200,158,124,164,101, 52,255, - 0,255,255, 0,255,165,103, 54,245,237,229,246,237,229,245,236,228, - 215,184,157,177,122, 79,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,165,103, 54,255, 0,255,255, - 0,255,166,105, 57,164,102, 53,164,102, 53,165,102, 54,165,103, 54, - 165,103, 55,189,143,108,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,198,158,128,164,101, 52,175,120, 76,178,123, 82,178,123, - 82,178,124, 82,164,101, 52,255, 0,255,255, 0,255,165,103, 54,217, - 189,167,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,187,139,102,209,174,145,246,238,231,242,230,219,246,238, - 230,167,108, 61,255, 0,255,255, 0,255,164,102, 54,168,108, 61,221, - 187,162,174,118, 75,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 221,197,179,164,102, 53,233,215,199,235,216,198,245,236,227,168,109, - 62,255, 0,255,255, 0,255,170,111, 65,171,112, 65,169,109, 61,170, - 112, 66,213,184,162,255, 0,255,255, 0,255,183,134, 95,188,141,103, - 235,219,205,245,235,226,246,238,230,246,238,230,169,109, 62,255, 0, - 255,255, 0,255,202,164,135,192,145,106,197,152,114,168,107, 60,164, - 102, 53,168,108, 60,186,139,101,217,187,161,241,228,216,242,230,219, - 243,232,221,206,168,137,234,216,200,169,110, 63,255, 0,255,255, 0, - 255,255, 0,255,169,111, 65,211,173,140,220,189,157,221,190,161,229, - 203,180,233,211,191,238,221,204,240,226,213,231,210,191,178,124, 82, - 187,141,104,174,117, 73,165,104, 55,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,169,109, 63,193,146,107,211,176,143,223,194,168,222, - 193,168,212,177,147,188,140,102,170,112, 67,224,202,185,255, 0,255, - 219,194,174,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,200,161,132,178,125, 83,168,108, 61,176,120, 77,190, - 145,110,225,205,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 212,182,159,255, 0,255); - -Const - stdimg_arrow_down : Array[0..77] of byte = ( - 66, 77, 78, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0, - 0, 7, 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 2, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0,255,255,255, 0,238, 0, 0, 0,198, 0, - 0, 0,130, 0, 0, 0, 0, 0, 0, 0); - -Const - stdimg_font_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 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,128,128,128,135,135,135,133, - 133,133,133,133,133,128,128,128,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255, 88, 88, 88,102,102,102,108,108,108, 99, - 99, 99, 83, 83, 83,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255, 81, 81, 81, 84, 84, 84, 81, 81, 81,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255, 60, 77,162, 76, 89,162, 77, 90,161, 74, 87,161, 73, 84, - 156,255, 0,255, 80, 80, 77, 45, 45, 45, 74, 74, 74,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 36, 59,219, 0, 43,255, 0, 47,255, 0, 39,239, 45, 62,197,255, 0, - 255, 65, 65, 63, 7, 7, 7, 60, 60, 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, - 19, 38,213, 0, 32,255, 80, 88,168,255, 0,255,255, 0,255, 55, 55, - 55, 0, 0, 0, 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 28, 37,212, - 0, 16,255, 86, 89,166,255, 0,255,255, 0,255, 55, 55, 55, 1, 1, - 1, 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255, 27, 28,213, 0, 3,255, - 85, 85,168,255, 0,255,255, 0,255, 55, 55, 55, 0, 0, 0, 58, 58, - 58,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255, 27, 27,213, 0, 0,255, 84, 84,166, - 255, 0,255,255, 0,255, 57, 57, 57, 11, 11, 11, 60, 60, 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, 27, 27,220, 3, 4,166, 62, 62, 88,255, 0,255, - 255, 0,255, 71, 71, 71, 49, 49, 49, 71, 71, 71,255, 0,255,255, 0, - 255,100,100,100,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255, 27, 27,224, 19, 19,138, 52, 52, 32,255, 0,255,255, 0,255, - 78, 78, 78, 93, 93, 93, 76, 76, 76,255, 0,255,255, 0,255, 40, 40, - 40,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 29, - 29,225, 24, 24,153,113,113, 93, 65, 65, 65, 71, 71, 71, 84, 84, 81, - 139,139,138, 75, 75, 75, 74, 74, 74, 66, 66, 66,113,113,113,255, 0, - 255, 78, 78,167, 88, 88,152,255, 0,255,255, 0,255, 48, 48,225, 37, - 38,161,103,103, 98,114,114,111,106,106,103,106,106,115,112,112,115, - 111,111,111,105,105,105,113,113,113,113,113,113,255, 0,255, 83, 83, - 197, 45, 45,204,255, 0,255,255, 0,255, 59, 60,212, 81, 83,247, 72, - 72,146,255, 0,255,255, 0,255, 43, 44,213,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,105,105,181,113,114, - 255, 76, 76,207, 77, 77,191, 97, 98,244,127,128,255, 79, 79,220, 83, - 84,188, 87, 87,223,104,105,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,123,123,178, 80, 80,215, 84, 84, - 223, 80, 80,228, 81, 81,220, 74, 74,218, 79, 79,223, 77, 77,228, 83, - 83,239, 67, 68,231,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255); - -Const - stdimg_radiobuttons : Array[0..2213] of byte = ( - 66, 77,166, 8, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 60, 0, 0, 0, 12, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 112, 8, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255,255,255,255,255,255,191,191,191,191,191,191,191,191,191, - 191,191,191,255,255,255,255,255,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255,255,255,255,255,255,191,191,191,191,191,191,191, - 191,191,191,191,191,255,255,255,255,255,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255,255,255,255,255,255,191,191,191,191,191, - 191,191,191,191,191,191,191,255,255,255,255,255,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255,255,255,255,255,255,191,191,191, - 191,191,191,191,191,191,191,191,191,255,255,255,255,255,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255,255,255,255,255,255,191, - 191,191,191,191,191,191,191,191,191,191,191,255,255,255,255,255,255, - 255, 0,255,255, 0,255,255, 0,255,127,127,127,191,191,191,191,191, - 191,255,255,255,255,255,255,255,255,255,255,255,255,191,191,191,191, - 191,191,255,255,255,255, 0,255,255, 0,255,127,127,127,191,191,191, - 191,191,191,255,255,255,255,255,255,255,255,255,255,255,255,191,191, - 191,191,191,191,255,255,255,255, 0,255,255, 0,255,127,127,127,191, - 191,191,191,191,191,127,127,127,127,127,127,127,127,127,127,127,127, - 191,191,191,191,191,191,255,255,255,255, 0,255,255, 0,255,127,127, - 127,191,191,191,191,191,191,127,127,127,127,127,127,127,127,127,127, - 127,127,191,191,191,191,191,191,255,255,255,255, 0,255,255, 0,255, - 127,127,127,191,191,191,191,191,191,127,127,127,127,127,127,127,127, - 127,127,127,127,191,191,191,191,191,191,255,255,255,255, 0,255,255, - 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, 0, - 255,255, 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,191,191,191,255,255,255, - 255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, - 255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, - 191,255,255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 191,191,191,255,255,255,255, 0,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, - 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255,127,127, - 127, 0, 0, 0,127,127,127,127,127,127,127,127,127, 0, 0, 0, 0, - 0, 0,127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, - 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, - 255,255,127,127,127, 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,191,191, - 191,255,255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, - 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, - 127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127, - 127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, - 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,255,255,255,255,255,255,191,191,191,255,255,255,127, - 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255,255, - 255,127,127,127, 0, 0, 0,127,127,127,127,127,127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,191,191,191, - 255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, - 191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, - 127,127,127,127,127,127,127,127,127, 0, 0, 0, 0, 0, 0,127,127, - 127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, - 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255,255, 0, - 255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, 0,255, - 255, 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, - 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255,255, - 255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191, - 255,255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, - 191,191,255,255,255,255, 0,255,255, 0,255,127,127,127, 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,255, 0,255,255, 0,255,127,127,127, 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,255, 0,255,255, 0,255,127,127, - 127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, - 127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255,255, 0,255, - 127,127,127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,127,127, - 127,127,127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255,255, - 0,255,127,127,127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127, - 127,127,127,127,127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0, - 255,255, 0,255,255, 0,255,127,127,127,127,127,127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127, - 127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127, - 127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127, - 127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127, - 127,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, - 127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,127,127,127,127,127,127,127,127,127,127,127, - 127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127,127,127,127, - 127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127,127, - 127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127, - 127,127,127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127, - 127,127,127,127,127,127,127,127,127,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255); - -Const - stdimg_edit : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0,235, 10, 0, 0,235, 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 98,146, 94, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98,146, 94, 98,146, 94, - 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255, - 255,255,255,255,160,160,160,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255, 0, 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, - 88, 88, 88,220,220,220,160,160,160,160,160,160, 0, 0, 0,160,160, - 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, - 160,160, 0, 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, 88, 88, 88, - 220,220,220,255,255,255,255,255,255, 88, 88, 88, 48, 48, 48, 0, 0, - 64,195,195,195,220,220,220,255,255,255,255,255,255,255,255,255, 0, - 0, 0, 98,146, 94, 98,146, 94, 98,146, 94, 88, 88, 88,220,220,220, - 255,255,255,255,255,255,255,255,255, 88, 88, 88,168,220,255, 0, 88, - 192, 0, 88,192,195,195,195,220,220,220,255,255,255, 0, 0, 0, 98, - 146, 94, 98,146, 94, 98,146, 94, 88, 88, 88,220,220,220,195,195,195, - 195,195,195,195,195,195,160,160,160,168,220,255,168,220,255,168,220, - 255, 0, 88,192, 0, 88,192,160,160,160, 0, 0, 0, 98,146, 94, 98, - 146, 94, 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255, - 255,255,255,255,255,255, 88,168,255,168,220,255,168,220,255,168,220, - 255,168,220,255, 0, 0, 64, 0, 0, 0, 98,146, 94, 98,146, 94, 98, - 146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255,255, - 255,255,255,160,160,160,168,220,255,168,220,255, 0,128,255, 0,128, - 255, 0, 88,192, 48, 48, 48, 98,146, 94, 98,146, 94, 98,146, 94, 88, - 88, 88,220,220,220,195,195,195,195,195,195,195,195,195,195,195,195, - 195,195,195, 88,168,255,168,220,255, 0,128,255, 0,128,255, 0,128, - 255, 0, 88,192, 48, 48, 48, 98,146, 94, 98,146, 94, 88, 88, 88,220, - 220,220,255,255,255,255,255,255,255,255,255,255,255,255,195,195,195, - 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, - 255, 0, 88,192, 0, 0, 64, 98,146, 94, 88, 88, 88,220,220,220,255, - 255,255,255,255,255,255,255,255,255,255,255,195,195,195,255,255,255, - 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, - 255, 0, 88,192, 98,146, 94, 88, 88, 88,220,220,220,195,195,195,195, - 195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195, - 195,195,195, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 0,128, - 255, 98,146, 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255, - 255,255,255,255,255,195,195,195,255,255,255,255,255,255,255,255,255, - 255,255,255, 88,168,255, 88,168,255, 0,128,255, 0,128,255, 98,146, - 94, 88, 88, 88,220,220,220,255,255,255,255,255,255,255,255,255,255, - 255,255,195,195,195,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255, 88,168,255, 88,168,255, 0,128,255, 98,146, 94, 88, 88, - 88,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, - 220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, - 88, 88, 88, 88,168,255, 88,168,255, 98,146, 94, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 98,146, 94, 98,146, 94); - -Const - stdimg_menu_quit_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 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, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31, - 163, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31,163, 31, - 31,163, 31, 31,163, 31, 31,163,255, 0,255,255, 0,255,255, 0,255, - 33, 33,176, 6, 5,193, 0, 0,194, 0, 0,201, 0, 0,206, 0, 0, - 217, 24, 24,228, 26, 26,234, 12, 15,235, 6, 12,236, 26, 36,239, 36, - 48,241, 50, 67,251, 42, 47,189,255, 0,255,255, 0,255, 16, 16,173, - 0, 0,181, 0, 0,190, 0, 0,195,108,108,225,216,216,249,255,255, - 255,255,255,255,227,227,253,133,136,243, 24, 34,233, 31, 43,235, 45, - 60,239, 39, 46,196,255, 0,255,255, 0,255, 16, 16,170, 0, 0,181, - 1, 1,187,142,142,229,255,255,255,223,223,246,144,144,233,139,139, - 235,212,212,246,255,255,255,173,177,248, 32, 44,235, 42, 57,239, 38, - 45,195,255, 0,255,255, 0,255, 18, 18,168, 1, 1,179,105,105,214, - 255,255,255,173,173,233, 10, 10,206, 0, 0,213, 0, 0,221, 2, 2, - 224,149,151,238,255,255,255,147,153,246, 29, 43,237, 37, 44,193,255, - 0,255,255, 0,255, 23, 23,166, 23, 23,185,211,211,242,246,246,252, - 51, 51,207, 30, 30,212, 31, 31,218, 19, 19,222, 0, 0,227, 7, 10, - 227,228,228,250,235,236,254, 41, 53,238, 34, 40,192,255, 0,255,255, - 0,255, 27, 27,164, 51, 51,190,239,239,250,220,220,246, 44, 44,203, - 54, 54,212, 50, 50,217, 54, 54,223, 57, 56,230, 18, 19,230,181,182, - 247,255,255,255, 51, 60,238, 30, 35,190,255, 0,255,255, 0,255, 31, - 31,163, 58, 58,188,227,227,245,239,239,251, 67, 67,206, 61, 61,210, - 155,155,235,158,158,239, 73, 73,227, 74, 74,233,222,222,252,239,240, - 253, 30, 36,234, 28, 31,189,255, 0,255,255, 0,255, 36, 36,162, 65, - 65,188,170,170,222,255,255,255,159,159,229, 74, 74,208,238,238,251, - 244,244,253, 84, 84,224,149,149,239,255,255,255,197,197,244, 14, 16, - 231, 22, 23,187,255, 0,255,255, 0,255, 40, 40,162, 89, 89,193, 97, - 97,194,221,221,238,255,255,255,147,147,224,225,225,247,230,230,249, - 160,160,235,255,255,255,233,233,246,131,131,230, 99, 99,237, 23, 23, - 185,255, 0,255,255, 0,255, 46, 46,163,107,107,195,100,100,195,113, - 113,198,175,175,215,133,133,212,231,231,248,233,233,250,165,165,225, - 208,208,232,135,135,222,123,123,229,141,141,234, 53, 53,186,255, 0, - 255,255, 0,255, 55, 55,165,120,120,195,118,118,196,118,118,200,113, - 113,199,123,123,207,241,241,251,246,246,253,131,131,216,128,128,215, - 137,137,224,143,143,225,150,150,229, 68, 68,186,255, 0,255,255, 0, - 255, 84, 84,167,172,172,222,170,170,219,172,172,222,175,175,225,179, - 179,229,176,176,228,179,179,231,189,189,237,191,191,238,195,195,239, - 197,197,240,209,209,247,163,163,193,255, 0,255,255, 0,255,255, 0, - 255,103,103,175,100,100,172,100,100,171,101,101,172,101,101,172,101, - 101,173,102,102,173,102,102,173,102,102,173,103,103,173,104,104,173, - 104,104,175,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255); - -Const - stdimg_arrow_up : Array[0..77] of byte = ( - 66, 77, 78, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0, - 0, 7, 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 2, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,130, 0, - 0, 0,198, 0, 0, 0,238, 0, 0, 0); - -Const - stdimg_executable_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0,215, 13, 0, 0,215, 13, 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,255, 0,255,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, - 54,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218,199,195,195,159, - 157,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,120, 72, 54,218,199,195,188,151,145,204,176,172,221,202, - 200,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54, - 218,199,195,181,142,133,182,144,135,183,145,137,217,197,193,190,154, - 148,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,120, 72, 54,218,199,195,174,136,122, - 175,135,122,176,137,124,193,162,152,216,196,191,188,153,144,181,143, - 133,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,120, 72, 54,218,199,195,201,177,167,200,176,165,187,155,143, - 183,149,136,171,131,116,198,170,161,194,163,153,175,136,123,177,137, - 125,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,207,185,175,207,186,176,208,187,177,209,187,178,202,178,167, - 187,156,142,205,181,171,209,188,179,173,134,119,171,130,115,172,132, - 117,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,204,182,171,205,183,172,206,184,173,206,185,174,199,174,162, - 176,140,124,191,162,149,203,179,169,170,130,113,153,111, 86,120, 72, - 54,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,202,180,167,203,180,168,203,181,169,204,182,170,176,142,124, - 180,148,131,177,144,127,153,111, 86,120, 72, 54,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,200,177,163,200,178,164,201,178,165,186,158,141,150,106, 81, - 153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,198,174,159,198,175,160,186,159,141,144,100, 72,120, 72, 54, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,195,171,155,159,122, 95,120, 72, 54,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, - 199,195,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 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); Const stdimg_dialog_information_32 : Array[0..3125] of byte = ( @@ -1629,138 +1332,160 @@ Const 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255); Const - stdimg_link : Array[0..449] of byte = ( - 66, 77,194, 1, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 11, 0, 0, 0, 11, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 140, 1, 0, 0, 18, 11, 0, 0, 18, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0,128,128,128,255,255,255,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,128,128,128,255,255,255,255,255,255,255, - 255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255,255,255,255,255, - 255, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255,255,255, - 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255, - 255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, - 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128, - 128,255,255,255,255,255,255,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, - 128,128,128,255,255,255,255,255,255,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,128,128,128,255,255,255,255,255,255,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,128,128,128,255,255,255,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,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128, 0, 0, 0, 0, 0, 0); + stdimg_menu_preferences_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,215,194,180,135, 74, 32,135, 74, 32,135, 74, 32,223,207, + 196,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 135, 74, 32,190,165,146,184,156,134,184,156,134,135, 74, 32,223,207, + 196,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,193, + 196,195,154,158,157,193,196,195,255, 0,255,255, 0,255,135, 74, 32, + 204,187,173,167,145,125,181,149,122,174,139,114,135, 74, 32,223,207, + 196,255, 0,255,255, 0,255,255, 0,255,219,220,220,133,138,136,158, + 161,160,133,138,136,255, 0,255,255, 0,255,135, 74, 32,204,187,173, + 164,141,120,162,138,116,180,149,122,179,147,124,135, 74, 32,255, 0, + 255,255, 0,255,219,220,220,133,138,136,210,211,212,194,195,196,133, + 138,136,255, 0,255,255, 0,255,232,221,213,135, 74, 32,212,200,189, + 164,141,120,164,141,120,190,165,146,135, 74, 32,255, 0,255,219,220, + 220,133,138,136,226,227,228,194,196,198,133,138,136,193,196,195,255, + 0,255,255, 0,255,255, 0,255,243,237,233,135, 74, 32,204,187,173, + 204,187,173,179,147,124,135, 74, 32,193,196,195,133,138,136,211,211, + 212,189,190,191,133,138,136,219,220,220,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,243,237,233,135, 74, 32,135, 74, 32, + 135, 74, 32,133,131,125,170,173,173,200,201,202,189,190,191,133,138, + 136,219,220,220,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 181,183,184,133,138,136,183,184,185,133,138,136,219,220,220,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,219, + 220,220,133,138,136,133,138,136,133,138,136,133,138,136,208,209,210, + 163,164,164,133,138,136,193,196,195,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,219,220,220,133,138,136,243, + 243,243,239,240,240,237,238,238,234,236,236,182,185,186,133,138,136, + 219,220,220,133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,133,138,136,245,246,246,169,172,171,133, + 138,136,247,247,247,226,227,229,170,173,173,245,246,246,255, 0,255, + 219,220,220,133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,219,220,220,133,138,136,255, 0,255,219,220,220,133, + 138,136,250,250,250,133,138,136,255, 0,255,255, 0,255,255, 0,255, + 219,220,220,133,138,136,135,140,138,179,179,179,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,133,138,136,238, + 240,240,133,138,136,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 133,138,136,240,240,240,133,138,136,179,179,179,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,133,138,136,233,235,236,133,138,136,219, + 220,220,255, 0,255,255, 0,255,255, 0,255,255, 0,255,179,179,179, + 133,138,136,238,239,239,133,138,136,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,219,220,220,133,138,136,219,220,220,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,179,179,179, + 133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); Const - stdimg_menu_exit_16 : Array[0..821] of byte = ( + stdimg_folder_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 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,165,193,214,128,167,197, 99,148,184, 22, 94,147, 29, 99,151, - 153,153,153,113,113,113, 84, 84, 84, 81, 81, 81, 79, 79, 79, 76, 76, - 76, 74, 74, 74, 71, 71, 71, 69, 69, 69, 37,103,157, 50,116,168, 61, - 124,175, 71,132,181, 78,138,186, 62,126,173, 32,101,152,255,255,255, - 255,255,255, 88, 88, 88,162,162,162,162,162,162,163,163,163,164,164, - 164,164,164,164,165,165,165, 47,111,165,120,171,210,120,171,211,115, - 167,209,105,160,205, 64,127,174, 35,103,154,255,255,255,255,255,255, - 92, 92, 92,161,161,161, 60,115, 64,160,161,161,163,163,163,163,163, - 163,164,164,164, 54,116,170,125,175,212, 91,154,201, 84,149,199, 88, - 150,200, 65,128,174, 38,105,157,255,255,255,255,255,255, 96, 96, 96, - 160,160,160, 61,118, 65, 54,113, 57,162,162,162,162,162,162,163,163, - 163, 61,121,176,130,179,215, 98,159,204, 90,154,201, 94,155,202, 67, - 129,175, 44,109,160, 55,130, 62, 52,126, 59, 49,121, 55, 46,117, 52, - 73,145, 80, 70,143, 76, 57,115, 61,161,161,161,162,162,162, 69,126, - 180,136,183,217,103,163,207, 97,158,204, 99,159,204, 69,131,177, 49, - 113,164, 59,135, 66,137,203,146,132,200,141,128,198,136,123,195,131, - 119,193,127, 71,143, 77, 59,116, 63,161,161,161, 76,132,186,141,187, - 219,110,168,209,102,166,209, 95,180,223, 71,133,177, 55,117,169, 62, - 139, 70,143,206,153,125,198,135,120,195,129,115,192,124,116,192,124, - 121,194,129, 73,144, 79, 84,127, 87, 84,137,191,148,191,221,117,173, - 212, 99,184,225, 75,212,255, 66,139,184, 61,122,173, 65,144, 74,148, - 210,159,145,208,154,141,205,150,137,203,146,132,200,141, 81,152, 88, - 65,124, 70,159,159,159, 90,142,196,152,195,224,124,179,215,116,175, - 214, 94,196,237, 75,136,179, 69,127,178, 68,148, 77, 66,145, 75, 63, - 141, 72, 61,137, 69, 93,164,101, 90,160, 97, 69,131, 75,158,158,158, - 158,158,158, 96,146,201,158,199,226,131,184,218,125,180,215,126,179, - 215, 79,137,180, 75,132,183,255,255,255,255,255,255,119,119,119,154, - 154,154, 61,138, 69, 73,138, 79,156,156,156,157,157,157,157,157,157, - 102,150,204,162,203,227,137,189,220,131,185,218,132,185,218, 81,139, - 181, 82,137,188,255,255,255,255,255,255,122,122,122,153,153,153, 82, - 145, 89,153,154,153,155,155,155,156,156,156,156,156,156,108,154,208, - 167,206,229,143,193,223,137,189,220,139,189,220, 83,141,182, 90,142, - 194,255,255,255,255,255,255,125,125,125,153,153,153,153,153,153,154, - 154,154,154,154,154,155,155,155,155,155,155,111,157,211,170,209,231, - 171,209,231,152,199,225,145,194,222, 86,143,183, 96,147,198,255,255, - 255,255,255,255,128,128,128,126,126,126,124,124,124,122,122,122,119, - 119,119,117,117,117,114,114,114,113,158,212,111,158,214,135,178,220, - 171,211,232,169,208,230, 88,144,184,103,151,203,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,132,172,220,109,156,212, - 133,177,218, 90,145,185,109,156,207,255,255,255,255,255,255,255,255, + 198,167,146,138, 78, 37,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, + 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,169,148,138, 78, 37, + 217,181,149,221,186,154,221,186,154,221,186,154,221,186,154,221,186, + 154,221,186,154,221,186,154,221,186,154,221,186,154,221,186,154,221, + 186,154,221,186,154,217,181,149,138, 79, 37,135, 74, 32,223,192,162, + 213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213,172, + 134,213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213, + 172,134,223,192,162,135, 74, 32,135, 74, 32,226,197,170,215,175,138, + 215,175,138,215,175,138,215,175,138,215,175,138,215,175,138,215,175, + 138,215,175,138,215,175,138,215,175,138,215,175,138,215,175,138,226, + 197,170,135, 74, 32,135, 74, 32,228,202,177,217,179,143,217,179,143, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,217,179,143,217,179,143,228,202,177,135, + 74, 32,135, 74, 32,230,205,181,217,179,143,217,179,143,217,179,143, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,217,179,143,230,205,181,135, 74, 32,135, + 74, 32,231,207,184,217,179,143,217,179,143,217,179,143,217,179,143, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,217,179,143,231,207,184,135, 74, 32,135, 74, 32,232, + 210,188,217,179,143,217,179,143,217,179,143,217,179,143,217,179,143, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,217,179,143,232,210,188,135, 74, 32,136, 76, 34,230,209,188,234, + 212,192,234,212,192,234,212,192,234,212,192,234,212,192,226,197,169, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, + 143,234,212,192,135, 74, 32,139, 77, 36,136, 76, 34,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,140, 82, 42,218,190,167,227,200,173, + 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,235,215, + 196,135, 74, 32,135, 74, 32,204,164,133,188,136, 95,188,136, 94,188, + 136, 94,188,136, 94,175,120, 80,144, 86, 46,220,194,172,236,217,199, + 236,217,199,236,217,199,236,217,199,236,217,199,233,214,196,138, 79, + 37,135, 74, 32,209,176,151,218,186,158,205,161,124,205,161,123,205, + 161,124,218,186,158,190,150,120,135, 74, 32,135, 74, 32,135, 74, 32, + 135, 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,168,147,225,210, + 200,144, 89, 49,218,191,169,236,217,200,236,217,200,236,217,200,218, + 191,169,144, 89, 49,225,210,200,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,210, + 200,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,225, + 210,200,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,177,202,232, - 108,156,211,112,158,210); + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255); Const - stdimg_menu_save_16 : Array[0..821] of byte = ( + stdimg_edit_delete_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,216,171,142,205,149,112,189,115, 66,183,104, 53,181,104, - 53,180,103, 52,178,102, 52,176,101, 51,174,100, 51,172, 99, 50,170, - 98, 50,169, 97, 50,168, 96, 49,167, 97, 50,171,105, 60,188,134, 97, - 195,125, 79,235,198,173,234,197,173,254,251,248,254,251,248,254,251, - 248,254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254, - 251,248,254,251,248,200,154,124,199,152,121,173,107, 64,186,108, 56, - 237,202,179,224,162,122,254,250,247, 98,192,136, 98,192,136, 98,192, - 136, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192,136,253, - 249,246,202,141,101,201,155,124,167, 97, 50,187,108, 56,238,204,182, - 225,162,122,254,250,247,191,220,194,191,220,194,191,220,194,191,220, - 194,191,220,194,191,220,194,191,220,194,191,220,194,253,249,246,205, - 144,104,204,158,129,168, 97, 50,187,107, 56,239,206,184,225,162,121, - 254,250,247, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192, - 136, 98,192,136, 98,192,136, 98,192,136,253,249,246,207,147,106,206, - 163,132,170, 97, 50,186,106, 54,239,208,187,226,162,122,254,251,248, - 254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254,251, - 248,254,251,248,254,251,248,254,251,248,211,150,109,210,167,138,171, - 98, 50,187,106, 54,240,210,190,226,163,122,226,163,122,225,163,122, - 226,163,123,225,163,123,224,161,120,222,159,119,221,159,118,220,157, - 116,217,155,114,216,153,113,214,153,112,213,171,142,173, 99, 51,187, - 106, 54,242,213,194,227,163,122,227,163,122,226,163,123,226,163,123, - 226,164,123,225,162,121,224,161,120,222,160,119,222,158,117,220,157, - 116,218,155,115,217,155,115,218,176,149,175,100, 51,187,106, 54,242, - 216,197,227,164,123,227,163,122,227,164,122,226,164,123,226,163,123, - 225,163,123,225,162,121,223,160,119,222,159,118,221,158,116,219,156, - 114,220,157,116,221,181,154,177,101, 52,187,107, 54,244,217,199,230, - 166,125,200,140,100,201,141,101,201,142,103,203,146,108,203,146,109, - 202,144,105,200,140,101,200,140,100,200,140,100,200,140,100,218,156, - 116,225,186,159,179,102, 52,187,108, 55,244,220,201,231,167,125,249, - 236,225,249,236,225,249,237,227,252,244,238,253,250,247,253,247,243, - 250,237,229,247,231,219,247,229,217,246,229,216,222,160,119,228,190, - 164,180,103, 52,189,110, 58,245,221,204,231,168,126,250,240,232,250, - 240,232,201,141,102,250,240,233,253,248,243,254,250,248,252,244,239, - 249,233,223,247,231,219,247,229,217,224,162,120,231,194,169,182,104, - 53,192,116, 66,246,223,208,232,168,126,252,246,241,252,246,241,200, - 140,100,250,241,233,251,244,238,253,250,247,253,249,246,250,240,232, - 248,232,221,247,230,219,225,163,122,239,213,195,183,106, 54,198,130, - 85,246,223,209,233,170,128,254,250,246,253,250,246,200,140,100,251, - 243,238,251,241,234,252,246,242,254,251,248,252,246,241,249,236,226, - 248,231,219,238,208,186,236,208,189,189,116, 67,214,165,133,246,224, - 209,247,224,209,254,251,248,254,251,247,253,249,246,252,245,240,250, - 240,234,251,242,237,253,249,246,253,250,247,251,241,235,248,233,223, - 236,209,190,205,146,106,226,197,177,225,189,166,217,171,141,201,137, - 94,192,117, 67,189,110, 58,187,108, 55,187,107, 54,187,106, 54,187, - 106, 54,188,108, 57,189,110, 59,187,109, 58,191,116, 68,201,141,101, - 231,206,188,255,255,255); + 0, 0, 0,255,255,255,186,188,188,145,148,147,173,176,175,255,255, + 255,255,255,255,144,148,146,158,161,160,163,166,164,255,255,255,255, + 255,255,219,220,219,151,153,153,189,191,190,255,255,255,255,255,255, + 255,255,255,141,145,144,250,250,250,151,154,153,169,172,171,159,162, + 161,150,154,152,238,239,239,170,174,172,155,158,157,152,155,154,139, + 142,141,255,255,255,172,175,175,255,255,255,255,255,255,255,255,255, + 186,188,188,142,146,145,246,246,246,153,156,155,171,173,172,143,147, + 144,224,225,224,178,180,180,211,213,212,152,155,154,236,236,236,160, + 163,162,212,213,213,255,255,255,255,255,255,255,255,255,255,255,255, + 141,144,143,221,222,221,142,147,144,201,201,201,138,143,140,206,208, + 207,164,166,165,200,200,200,124,128,127,227,228,228,146,149,148,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,117,121,120, + 203,205,204,133,138,135,166,167,166,146,147,147,179,180,179,146,147, + 146,182,183,182,124,128,127,189,190,189,123,126,125,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,106,110,109,205,206,206, + 108,111,111,172,174,173,109,112,111,175,177,176,108,111,110,178,180, + 179,111,115,114,179,180,180,109,113,112,255,255,255,255,255,255,255, + 255,255,165,118, 87,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32, + 135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, + 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,165,118, 87,135, + 74, 32,221,187,156,207,159,114,207,159,114,207,159,114,207,159,114, + 207,159,114,207,159,114,207,159,114,207,159,114,207,159,114,207,159, + 114,207,159,114,207,159,114,221,187,156,135, 74, 32,135, 74, 32,221, + 187,156,221,187,156,221,187,156,221,187,156,221,187,156,221,187,156, + 221,187,156,221,187,156,221,187,156,221,187,156,221,187,156,221,187, + 156,221,187,156,221,187,156,135, 74, 32,135, 74, 32,221,187,156,202, + 138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88, + 202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, + 88,221,187,156,135, 74, 32,135, 74, 32,221,187,156,134, 82, 44,134, + 81, 43,134, 81, 43,134, 81, 43,134, 81, 43,134, 81, 43,134, 82, 44, + 134, 82, 44,134, 82, 44,134, 82, 44,134, 82, 44,134, 82, 44,221,187, + 156,135, 74, 32,135, 74, 32,221,187,156,106, 91, 78,201,201,201,156, + 156,156,156,156,156,156,156,156,155,155,155,155,155,155,155,155,155, + 155,155,155,155,155,155,155,155,155,106, 91, 78,221,187,156,135, 74, + 32,135, 74, 32,221,187,156,119,124,122,217,217,217,189,189,189,189, + 189,189,189,189,189,189,189,189,188,188,188,188,188,188,188,188,188, + 191,191,191,192,192,192,119,124,122,221,187,156,135, 74, 32,195,165, + 144,135, 74, 32,133,138,136,231,231,231,215,215,215,214,214,214,214, + 214,214,214,214,214,214,214,214,213,213,213,213,213,213,218,218,218, + 220,220,220,133,138,136,135, 74, 32,195,165,144,255,255,255,255,255, + 255,133,138,136,241,241,241,235,235,235,235,235,235,235,235,235,234, + 234,234,234,234,234,234,234,234,234,234,234,234,234,234,233,233,233, + 133,138,136,255,255,255,255,255,255,255,255,255,255,255,255,171,174, + 173,133,138,136,133,138,136,133,138,136,133,138,136,133,138,136,133, + 138,136,133,138,136,133,138,136,133,138,136,133,138,136,171,174,173, + 255,255,255,255,255,255); Const stdimg_btn_cancel_16 : Array[0..821] of byte = ( @@ -1815,52 +1540,156 @@ Const 255,255,255,255,255,255); Const - stdimg_folder_up_16 : Array[0..821] of byte = ( + stdimg_edit_paste_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,155,181,197, 18, 80,118, 1, 68,108, 1, 68, + 108, 1, 68,108, 1, 68,108, 1, 68,108, 1, 68,108, 1, 68,108, 1, + 68,108, 1, 68,108, 1, 68,108, 19, 80,117,162,186,201,255, 0,255, + 255, 0,255, 13, 76,115, 35,127,186, 59,125,167,100,111,115,104,108, + 106,104,108,106,104,108,106,104,108,106,104,108,106, 61,124,163, 61, + 124,163, 61,124,163, 34,123,179, 16, 78,116,255, 0,255,255, 0,255, + 9, 74,114, 38,135,197, 99,109,112,237,238,237,254,254,254,254,254, + 254,254,254,254,238,239,239,253,254,254,100,105,103, 39,135,197, 39, + 135,197, 39,135,197, 3, 68,108,255, 0,255,255, 0,255, 9, 74,114, + 38,135,197,100,104,102,255,255,255,228,231,231,213,216,216,190,194, + 193,180,183,183,255,255,255,255,255,255,100,105,103, 39,135,197, 40, + 134,194, 3, 68,108,255, 0,255,255, 0,255, 9, 74,114, 38,135,197, + 100,104,102,255,255,255,231,233,233,229,231,231,214,217,217,182,185, + 185,255,255,255,255,255,255,255,255,255,100,105,103, 40,134,194, 3, + 68,108,255, 0,255,255, 0,255, 9, 75,114, 38,135,197,100,104,102, + 255,255,255,234,236,236,232,234,234,230,232,232,203,206,205,182,186, + 185,181,185,184,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, + 0,255,255, 0,255, 9, 75,114, 38,135,197,100,104,102,255,255,255, + 237,238,238,235,236,236,233,235,235,231,233,233,216,218,218,202,205, + 204,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, 0,255,255, + 0,255, 9, 75,114, 38,135,197,100,104,102,255,255,255,239,240,240, + 238,239,239,236,237,237,234,235,235,232,234,234,217,219,219,255,255, + 255,100,105,103, 40,134,194, 3, 68,108,255, 0,255,255, 0,255, 9, + 75,114, 38,135,197,100,104,102,255,255,255,239,240,240,181,181,179, + 181,181,179,180,180,178,178,178,177,232,234,234,255,255,255,100,105, + 103, 40,134,194, 3, 68,108,255, 0,255,255, 0,255, 9, 75,115, 38, + 135,197,100,104,102,255,255,255,239,240,240,239,240,240,239,240,240, + 239,240,240,237,239,239,235,237,237,255,255,255,100,105,103, 40,134, + 194, 3, 68,108,255, 0,255,255, 0,255, 9, 75,115, 38,135,197,100, + 104,102,255,255,255,239,240,240,181,181,179,181,181,179,181,181,179, + 181,181,179,238,239,239,255,255,255,100,105,103, 40,134,194, 3, 68, + 108,255, 0,255,255, 0,255, 9, 75,115, 39,136,198,100,104,102,255, + 255,255,239,240,240,239,240,240,239,240,240,239,240,240,239,240,240, + 239,240,240,255,255,255,100,105,103, 40,134,194, 3, 68,108,255, 0, + 255,255, 0,255, 9, 75,115, 39,136,198,100,111,113,241,241,241,224, + 224,224,187,187,187,187,187,187,187,187,187,187,187,187,224,224,224, + 242,242,242,100,109,110, 39,135,197, 3, 68,108,255, 0,255,255, 0, + 255, 13, 77,116, 36,132,192, 62,126,164,100,109,112, 94, 94, 94,124, + 127,127,125,128,128,125,128,128,123,126,126, 94, 94, 94,100,108,110, + 64,124,161, 35,127,185, 16, 78,117,255, 0,255,255, 0,255,155,182, + 197, 18, 80,119, 1, 68,108, 3, 68,107, 91, 92, 92,137,149,149,138, + 151,151,138,151,151,137,149,149, 91, 92, 92, 3, 68,107, 1, 68,108, + 19, 81,118,162,186,201,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,137,138,138, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92,137,138,138,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_help_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 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,192,161,139,164,117, 85,142, 85, 45,142, 85, 45,165,119, 87,193, + 161,139,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,198,169,149,147, 91, 53,203,175, + 155,229,214,203,248,244,241,249,245,242,232,219,209,211,186,167,149, + 94, 56,199,171,151,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,163,116, 84,175,134,105,243,237,233,221,201,186,199,165, + 139,187,145,113,193,153,121,213,183,159,233,218,205,248,243,239,183, + 145,117,166,120, 88,255, 0,255,255, 0,255,255, 0,255,199,170,150, + 174,133,105,243,238,233,183,143,114,165,114, 76,179,135,101,255,255, + 255,255,255,255,193,151,116,197,155,120,215,185,160,249,245,241,180, + 140,112,199,171,151,255, 0,255,255, 0,255,146, 91, 52,242,235,230, + 177,135,105,157,103, 64,163,111, 73,178,132, 98,255,255,255,255,255, + 255,189,146,111,193,150,114,197,155,120,214,183,157,247,241,237,147, + 93, 54,255, 0,255,192,161,139,195,166,145,211,188,173,148, 92, 51, + 154,100, 60,161,108, 69,169,120, 82,200,168,143,204,173,148,183,137, + 101,187,143,107,191,147,112,193,150,115,231,215,201,207,181,161,193, + 161,139,162,115, 83,221,204,192,175,134,106,145, 88, 47,151, 96, 56, + 157,103, 64,167,118, 81,228,212,200,229,214,202,180,134, 98,182,135, + 99,185,139,103,186,142,106,209,178,155,230,215,204,165,118, 86,141, + 83, 43,245,240,237,148, 94, 56,142, 83, 42,148, 91, 51,153, 98, 58, + 159,105, 66,243,237,232,255,255,255,208,181,160,176,127, 90,178,131, + 94,180,133, 96,189,148,117,248,243,240,142, 84, 45,141, 83, 43,245, + 240,237,147, 92, 54,138, 79, 37,144, 86, 45,149, 93, 52,154, 99, 59, + 181,139,109,252,251,249,254,254,254,193,157,130,172,122, 84,173,124, + 86,183,141,108,247,243,239,142, 84, 44,162,115, 83,221,204,192,172, + 130,101,135, 74, 32,139, 80, 39,144, 86, 45,149, 92, 52,153, 98, 58, + 194,161,137,255,255,255,243,236,232,165,114, 75,166,115, 77,195,161, + 134,225,210,198,164,117, 85,192,161,139,195,165,144,208,185,169,135, + 74, 32,135, 74, 32,159,110, 75,160,111, 77,148, 91, 50,168,122, 89, + 255,255,255,253,252,251,161,109, 70,159,106, 67,218,198,183,198,170, + 149,192,161,139,255, 0,255,146, 92, 53,241,234,229,165,120, 88,135, + 74, 32,176,136,108,254,253,253,233,222,214,246,242,239,255,255,255, + 220,202,189,152, 96, 56,179,137,107,242,235,230,145, 91, 52,255, 0, + 255,255, 0,255,198,169,149,173,131,103,242,235,231,166,120, 89,156, + 105, 71,222,206,194,247,243,240,241,234,230,208,184,167,160,111, 77, + 173,130,100,243,237,232,171,128, 98,198,169,149,255, 0,255,255, 0, + 255,255, 0,255,163,116, 84,170,127, 97,240,232,227,208,185,169,172, + 130,101,150, 96, 59,150, 96, 59,172,130,101,209,186,170,240,233,228, + 170,128, 98,163,116, 84,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,198,169,149,145, 91, 52,193,162,141,219,201,189,244, + 239,235,244,239,235,219,201,189,193,163,141,145, 90, 51,199,170,150, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,192,161,139,162,115, 83,141, 83, 43,141, + 83, 43,162,115, 83,192,161,139,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_list_remove_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0,215, 13, 0, 0,215, 13, 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, - 198,167,146,138, 78, 37,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, - 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, - 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,169,148,138, 78, 37, - 217,181,149,221,186,154,221,186,154,221,186,154,221,186,154,221,186, - 154,221,186,154,221,186,154,221,186,154,221,186,154,221,186,154,221, - 186,154,221,186,154,217,181,149,138, 79, 37,135, 74, 32,223,192,162, - 213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213,172, - 134,213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213, - 172,134,223,192,162,135, 74, 32,135, 74, 32,226,197,170,215,175,138, - 215,175,138,215,175,138,143, 85, 42,143, 85, 42,143, 85, 42,143, 85, - 42,143, 85, 42,143, 85, 42,215,175,138,215,175,138,215,175,138,226, - 197,170,135, 74, 32,135, 74, 32,228,202,177,217,179,143,217,179,143, - 217,179,143,143, 85, 42,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,217,179,143,217,179,143,228,202,177,135, - 74, 32,135, 74, 32,230,205,181,217,179,143,143, 85, 42,205,164,128, - 143, 85, 42,205,164,128,143, 85, 42,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,217,179,143,230,205,181,135, 74, 32,135, - 74, 32,231,207,184,217,179,143,182,133, 95,143, 85, 42,143, 85, 42, - 143, 85, 42,182,133, 95,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,231,207,184,135, 74, 32,135, 74, 32,232, - 210,188,217,179,143,217,179,143,205,164,128,143, 85, 42,205,164,128, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,232,210,188,135, 74, 32,136, 76, 34,230,209,188,234, - 212,192,234,212,192,234,212,192,234,212,192,234,212,192,226,197,169, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,234,212,192,135, 74, 32,139, 77, 36,136, 76, 34,135, 74, 32,135, - 74, 32,135, 74, 32,135, 74, 32,140, 82, 42,218,190,167,227,200,173, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,235,215, - 196,135, 74, 32,135, 74, 32,204,164,133,188,136, 95,188,136, 94,188, - 136, 94,188,136, 94,175,120, 80,144, 86, 46,220,194,172,236,217,199, - 236,217,199,236,217,199,236,217,199,236,217,199,233,214,196,138, 79, - 37,135, 74, 32,209,176,151,218,186,158,205,161,124,205,161,123,205, - 161,124,218,186,158,190,150,120,135, 74, 32,135, 74, 32,135, 74, 32, - 135, 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,168,147,225,210, - 200,144, 89, 49,218,191,169,236,217,200,236,217,200,236,217,200,218, - 191,169,144, 89, 49,225,210,200,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,210, - 200,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,225, - 210,200,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,182,132, 93,164,101, 52,164,101, 52, + 164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, + 52,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, + 255,255,255,255,255,164,101, 52,229,204,180,219,183,149,219,182,148, + 218,180,146,218,179,144,217,173,134,216,170,131,215,168,127,215,166, + 125,224,190,159,164,101, 52,255,255,255,255,255,255,255,255,255,255, + 255,255,164,101, 52,232,211,192,231,209,187,231,209,188,230,206,183, + 230,206,183,230,206,183,230,206,183,230,205,182,230,204,181,230,204, + 182,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,182, + 132, 93,164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52, + 164,101, 52,164,101, 52,164,101, 52,164,101, 52,164,101, 52,182,132, + 93,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, @@ -1919,108 +1748,432 @@ Const 255,255,255,255,255,255); Const - stdimg_folder_16 : Array[0..821] of byte = ( + stdimg_edit_cut_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 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, + 0, 0, 0,255,255,255,172,172,226, 37, 37,178, 26, 26,175, 29, 29, + 174,209,209,239,255,255,255,255,255,255,255,255,255,255,255,255,172, + 172,226, 70, 70,190, 27, 27,176, 39, 39,179,209,209,239,255,255,255, + 255,255,255, 49, 49,182, 41, 41,219, 36, 36,209, 31, 31,206, 31, 31, + 177,209,209,239,255,255,255,255,255,255,209,209,239, 29, 29,177, 36, + 36,212, 34, 34,208, 31, 31,206, 39, 39,178,255,255,255,255,255,255, + 19, 19,173, 33, 33,208,255,255,255,117,117,213, 35, 35,211, 52, 52, + 184,255,255,255,255,255,255, 59, 59,187, 37, 37,214,114,114,214,255, + 255,255, 35, 35,210, 22, 22,173,255,255,255,255,255,255, 43, 43,179, + 37, 37,213,134,134,213,255,255,255, 38, 38,208, 13, 13,170,255,255, + 255,255,255,255, 5, 5,169, 38, 39,205,255,255,255,137,137,214, 34, + 34,209, 43, 43,179,255,255,255,255,255,255,172,172,226, 7, 7,168, + 35, 35,209, 73, 73,192, 26, 27,194, 1, 1,166,255,255,255,241,242, + 250, 30, 31,205, 25, 27,193, 74, 74,193, 33, 33,206, 7, 7,167,143, + 143,216,255,255,255,255,255,255,255,255,255,142,142,215, 9, 9,170, + 34, 34,210, 31, 31,206, 16, 17,184, 92, 94,196, 6, 7,169, 26, 26, + 201, 34, 34,209, 33, 33,203, 12, 12,170,171,171,225,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,127,210, + 33, 33,175, 6, 6,166, 70, 75,163, 2, 2,166, 25, 26,199, 37, 37, + 178,131,131,211,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,212,214,213, + 132,137,137,195,198,197,175,178,179, 52, 55,160,231,232,232,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 198,167,146,138, 78, 37,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, - 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, - 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,169,148,138, 78, 37, - 217,181,149,221,186,154,221,186,154,221,186,154,221,186,154,221,186, - 154,221,186,154,221,186,154,221,186,154,221,186,154,221,186,154,221, - 186,154,221,186,154,217,181,149,138, 79, 37,135, 74, 32,223,192,162, - 213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213,172, - 134,213,172,134,213,172,134,213,172,134,213,172,134,213,172,134,213, - 172,134,223,192,162,135, 74, 32,135, 74, 32,226,197,170,215,175,138, - 215,175,138,215,175,138,215,175,138,215,175,138,215,175,138,215,175, - 138,215,175,138,215,175,138,215,175,138,215,175,138,215,175,138,226, - 197,170,135, 74, 32,135, 74, 32,228,202,177,217,179,143,217,179,143, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,217,179,143,217,179,143,228,202,177,135, - 74, 32,135, 74, 32,230,205,181,217,179,143,217,179,143,217,179,143, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,217,179,143,230,205,181,135, 74, 32,135, - 74, 32,231,207,184,217,179,143,217,179,143,217,179,143,217,179,143, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,217,179,143,231,207,184,135, 74, 32,135, 74, 32,232, - 210,188,217,179,143,217,179,143,217,179,143,217,179,143,217,179,143, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,217,179,143,232,210,188,135, 74, 32,136, 76, 34,230,209,188,234, - 212,192,234,212,192,234,212,192,234,212,192,234,212,192,226,197,169, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,217,179, - 143,234,212,192,135, 74, 32,139, 77, 36,136, 76, 34,135, 74, 32,135, - 74, 32,135, 74, 32,135, 74, 32,140, 82, 42,218,190,167,227,200,173, - 217,179,143,217,179,143,217,179,143,217,179,143,217,179,143,235,215, - 196,135, 74, 32,135, 74, 32,204,164,133,188,136, 95,188,136, 94,188, - 136, 94,188,136, 94,175,120, 80,144, 86, 46,220,194,172,236,217,199, - 236,217,199,236,217,199,236,217,199,236,217,199,233,214,196,138, 79, - 37,135, 74, 32,209,176,151,218,186,158,205,161,124,205,161,123,205, - 161,124,218,186,158,190,150,120,135, 74, 32,135, 74, 32,135, 74, 32, - 135, 74, 32,135, 74, 32,135, 74, 32,138, 78, 37,198,168,147,225,210, - 200,144, 89, 49,218,191,169,236,217,200,236,217,200,236,217,200,218, - 191,169,144, 89, 49,225,210,200,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,210, - 200,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,225, - 210,200,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,181,184,183,184,188,187, + 230,232,231,167,172,170,139,144,142,184,187,186,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,231,232,232,136,141,139,223,225,225,245,246,245, + 151,156,154,165,169,168,140,145,143,231,232,232,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,152,156,154,178,182,181,247,247,247,142,147,145,156,160,159, + 179,182,181,182,187,185,172,175,174,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,228,229,229,136, + 141,139,217,220,219,239,240,239,171,175,173,184,187,186,179,184,182, + 203,206,205,137,142,140,197,199,198,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,144,148,146,176,181,179,246, + 247,247,155,159,157,202,204,203,255,255,255,141,146,144,201,206,204, + 172,176,175,156,160,159,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,136,141,139,208,212,210,239,240,239,179, + 183,181,255,255,255,255,255,255,225,227,226,167,172,170,195,200,198, + 142,147,145,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,143,148,146,247,247,247,170,173,172,202,204,203,255, + 255,255,255,255,255,255,255,255,152,156,155,208,211,210,169,173,171, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,221,223,222,145,149,148,162,166,165,255,255,255,255,255,255,255, + 255,255,255,255,255,185,187,186,148,152,150,255,255,255,255,255,255, 255,255,255,255,255,255); Const - stdimg_folder_open_file_16 : Array[0..821] of byte = ( + stdimg_menu_save_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,216,171,142,205,149,112,189,115, 66,183,104, 53,181,104, + 53,180,103, 52,178,102, 52,176,101, 51,174,100, 51,172, 99, 50,170, + 98, 50,169, 97, 50,168, 96, 49,167, 97, 50,171,105, 60,188,134, 97, + 195,125, 79,235,198,173,234,197,173,254,251,248,254,251,248,254,251, + 248,254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254, + 251,248,254,251,248,200,154,124,199,152,121,173,107, 64,186,108, 56, + 237,202,179,224,162,122,254,250,247, 98,192,136, 98,192,136, 98,192, + 136, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192,136,253, + 249,246,202,141,101,201,155,124,167, 97, 50,187,108, 56,238,204,182, + 225,162,122,254,250,247,191,220,194,191,220,194,191,220,194,191,220, + 194,191,220,194,191,220,194,191,220,194,191,220,194,253,249,246,205, + 144,104,204,158,129,168, 97, 50,187,107, 56,239,206,184,225,162,121, + 254,250,247, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192, + 136, 98,192,136, 98,192,136, 98,192,136,253,249,246,207,147,106,206, + 163,132,170, 97, 50,186,106, 54,239,208,187,226,162,122,254,251,248, + 254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254,251, + 248,254,251,248,254,251,248,254,251,248,211,150,109,210,167,138,171, + 98, 50,187,106, 54,240,210,190,226,163,122,226,163,122,225,163,122, + 226,163,123,225,163,123,224,161,120,222,159,119,221,159,118,220,157, + 116,217,155,114,216,153,113,214,153,112,213,171,142,173, 99, 51,187, + 106, 54,242,213,194,227,163,122,227,163,122,226,163,123,226,163,123, + 226,164,123,225,162,121,224,161,120,222,160,119,222,158,117,220,157, + 116,218,155,115,217,155,115,218,176,149,175,100, 51,187,106, 54,242, + 216,197,227,164,123,227,163,122,227,164,122,226,164,123,226,163,123, + 225,163,123,225,162,121,223,160,119,222,159,118,221,158,116,219,156, + 114,220,157,116,221,181,154,177,101, 52,187,107, 54,244,217,199,230, + 166,125,200,140,100,201,141,101,201,142,103,203,146,108,203,146,109, + 202,144,105,200,140,101,200,140,100,200,140,100,200,140,100,218,156, + 116,225,186,159,179,102, 52,187,108, 55,244,220,201,231,167,125,249, + 236,225,249,236,225,249,237,227,252,244,238,253,250,247,253,247,243, + 250,237,229,247,231,219,247,229,217,246,229,216,222,160,119,228,190, + 164,180,103, 52,189,110, 58,245,221,204,231,168,126,250,240,232,250, + 240,232,201,141,102,250,240,233,253,248,243,254,250,248,252,244,239, + 249,233,223,247,231,219,247,229,217,224,162,120,231,194,169,182,104, + 53,192,116, 66,246,223,208,232,168,126,252,246,241,252,246,241,200, + 140,100,250,241,233,251,244,238,253,250,247,253,249,246,250,240,232, + 248,232,221,247,230,219,225,163,122,239,213,195,183,106, 54,198,130, + 85,246,223,209,233,170,128,254,250,246,253,250,246,200,140,100,251, + 243,238,251,241,234,252,246,242,254,251,248,252,246,241,249,236,226, + 248,231,219,238,208,186,236,208,189,189,116, 67,214,165,133,246,224, + 209,247,224,209,254,251,248,254,251,247,253,249,246,252,245,240,250, + 240,234,251,242,237,253,249,246,253,250,247,251,241,235,248,233,223, + 236,209,190,205,146,106,226,197,177,225,189,166,217,171,141,201,137, + 94,192,117, 67,189,110, 58,187,108, 55,187,107, 54,187,106, 54,187, + 106, 54,188,108, 57,189,110, 59,187,109, 58,191,116, 68,201,141,101, + 231,206,188,255,255,255); + +Const + stdimg_arrow_up : Array[0..149] of byte = ( + 66, 77,150, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 7, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 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, 0,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255, 0, 0, 0, + 255, 0,255,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0, + 255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_executable_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0,215, 13, 0, 0,215, 13, 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,255, 0,255,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, + 54,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218,199,195,195,159, + 157,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,120, 72, 54,218,199,195,188,151,145,204,176,172,221,202, + 200,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54, + 218,199,195,181,142,133,182,144,135,183,145,137,217,197,193,190,154, + 148,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,120, 72, 54,218,199,195,174,136,122, + 175,135,122,176,137,124,193,162,152,216,196,191,188,153,144,181,143, + 133,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,120, 72, 54,218,199,195,201,177,167,200,176,165,187,155,143, + 183,149,136,171,131,116,198,170,161,194,163,153,175,136,123,177,137, + 125,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,207,185,175,207,186,176,208,187,177,209,187,178,202,178,167, + 187,156,142,205,181,171,209,188,179,173,134,119,171,130,115,172,132, + 117,153,111, 86,120, 72, 54,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,204,182,171,205,183,172,206,184,173,206,185,174,199,174,162, + 176,140,124,191,162,149,203,179,169,170,130,113,153,111, 86,120, 72, + 54,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,202,180,167,203,180,168,203,181,169,204,182,170,176,142,124, + 180,148,131,177,144,127,153,111, 86,120, 72, 54,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,200,177,163,200,178,164,201,178,165,186,158,141,150,106, 81, + 153,111, 86,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,198,174,159,198,175,160,186,159,141,144,100, 72,120, 72, 54, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,195,171,155,159,122, 95,120, 72, 54,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,218, + 199,195,120, 72, 54,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,120, 72, 54,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_search_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,100,148,186, 34, + 103,157,129,168,198,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,111,156,194, 85,141,188,137,181,221, 24, + 95,151,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,123,164,202,100,151,197,157,193,228,102,153,199, 49,113,165,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,233,207,186, + 219,178,146,211,166,128,208,161,124,210,166,133,174,161,153,117,162, + 204,171,203,232,118,164,206, 64,123,175,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,232,202,176,232,201,174,245,225,205, + 247,229,211,247,229,209,243,221,200,223,186,156,199,168,145,134,174, + 213, 80,135,187,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,241,219,200,237,208,183,248,232,217,245,222,200,243,216,189, + 243,214,187,244,219,194,247,228,210,223,187,157,160,151,149,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,238, + 206,178,247,231,215,246,225,204,244,219,194,244,218,192,243,216,189, + 243,215,187,244,219,194,243,222,201,210,168,135,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,240,206,175,249, + 236,223,245,223,200,245,221,198,244,220,195,244,218,193,243,217,190, + 243,215,189,248,230,211,211,166,128,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,244,211,181,249,237,225,246, + 225,204,245,223,201,245,222,199,244,220,196,244,219,194,244,218,192, + 248,231,214,215,171,135,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,248,219,193,249,235,222,247,231,214,246, + 225,204,245,224,202,245,222,200,245,221,197,246,225,203,245,226,208, + 223,185,153,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,252,234,216,248,226,204,250,238,227,247,231,214,246, + 226,206,246,225,203,246,227,208,249,234,221,236,207,181,236,212,191, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,251,228,206,249,226,205,250,236,222,249,238,226,249, + 237,226,248,233,218,240,213,189,237,208,183,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,252,234,217,250,221,194,246,214,185,244,211,181,243, + 212,184,245,224,205,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_menu_quit_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31, + 163, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31,163, 31, 31,163, 31, + 31,163, 31, 31,163, 31, 31,163,255, 0,255,255, 0,255,255, 0,255, + 33, 33,176, 6, 5,193, 0, 0,194, 0, 0,201, 0, 0,206, 0, 0, + 217, 24, 24,228, 26, 26,234, 12, 15,235, 6, 12,236, 26, 36,239, 36, + 48,241, 50, 67,251, 42, 47,189,255, 0,255,255, 0,255, 16, 16,173, + 0, 0,181, 0, 0,190, 0, 0,195,108,108,225,216,216,249,255,255, + 255,255,255,255,227,227,253,133,136,243, 24, 34,233, 31, 43,235, 45, + 60,239, 39, 46,196,255, 0,255,255, 0,255, 16, 16,170, 0, 0,181, + 1, 1,187,142,142,229,255,255,255,223,223,246,144,144,233,139,139, + 235,212,212,246,255,255,255,173,177,248, 32, 44,235, 42, 57,239, 38, + 45,195,255, 0,255,255, 0,255, 18, 18,168, 1, 1,179,105,105,214, + 255,255,255,173,173,233, 10, 10,206, 0, 0,213, 0, 0,221, 2, 2, + 224,149,151,238,255,255,255,147,153,246, 29, 43,237, 37, 44,193,255, + 0,255,255, 0,255, 23, 23,166, 23, 23,185,211,211,242,246,246,252, + 51, 51,207, 30, 30,212, 31, 31,218, 19, 19,222, 0, 0,227, 7, 10, + 227,228,228,250,235,236,254, 41, 53,238, 34, 40,192,255, 0,255,255, + 0,255, 27, 27,164, 51, 51,190,239,239,250,220,220,246, 44, 44,203, + 54, 54,212, 50, 50,217, 54, 54,223, 57, 56,230, 18, 19,230,181,182, + 247,255,255,255, 51, 60,238, 30, 35,190,255, 0,255,255, 0,255, 31, + 31,163, 58, 58,188,227,227,245,239,239,251, 67, 67,206, 61, 61,210, + 155,155,235,158,158,239, 73, 73,227, 74, 74,233,222,222,252,239,240, + 253, 30, 36,234, 28, 31,189,255, 0,255,255, 0,255, 36, 36,162, 65, + 65,188,170,170,222,255,255,255,159,159,229, 74, 74,208,238,238,251, + 244,244,253, 84, 84,224,149,149,239,255,255,255,197,197,244, 14, 16, + 231, 22, 23,187,255, 0,255,255, 0,255, 40, 40,162, 89, 89,193, 97, + 97,194,221,221,238,255,255,255,147,147,224,225,225,247,230,230,249, + 160,160,235,255,255,255,233,233,246,131,131,230, 99, 99,237, 23, 23, + 185,255, 0,255,255, 0,255, 46, 46,163,107,107,195,100,100,195,113, + 113,198,175,175,215,133,133,212,231,231,248,233,233,250,165,165,225, + 208,208,232,135,135,222,123,123,229,141,141,234, 53, 53,186,255, 0, + 255,255, 0,255, 55, 55,165,120,120,195,118,118,196,118,118,200,113, + 113,199,123,123,207,241,241,251,246,246,253,131,131,216,128,128,215, + 137,137,224,143,143,225,150,150,229, 68, 68,186,255, 0,255,255, 0, + 255, 84, 84,167,172,172,222,170,170,219,172,172,222,175,175,225,179, + 179,229,176,176,228,179,179,231,189,189,237,191,191,238,195,195,239, + 197,197,240,209,209,247,163,163,193,255, 0,255,255, 0,255,255, 0, + 255,103,103,175,100,100,172,100,100,171,101,101,172,101,101,172,101, + 101,173,102,102,173,102,102,173,102,102,173,103,103,173,104,104,173, + 104,104,175,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_menu_exit_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 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,165,193,214,128,167,197, 99,148,184, 22, 94,147, 29, 99,151, + 153,153,153,113,113,113, 84, 84, 84, 81, 81, 81, 79, 79, 79, 76, 76, + 76, 74, 74, 74, 71, 71, 71, 69, 69, 69, 37,103,157, 50,116,168, 61, + 124,175, 71,132,181, 78,138,186, 62,126,173, 32,101,152,255,255,255, + 255,255,255, 88, 88, 88,162,162,162,162,162,162,163,163,163,164,164, + 164,164,164,164,165,165,165, 47,111,165,120,171,210,120,171,211,115, + 167,209,105,160,205, 64,127,174, 35,103,154,255,255,255,255,255,255, + 92, 92, 92,161,161,161, 60,115, 64,160,161,161,163,163,163,163,163, + 163,164,164,164, 54,116,170,125,175,212, 91,154,201, 84,149,199, 88, + 150,200, 65,128,174, 38,105,157,255,255,255,255,255,255, 96, 96, 96, + 160,160,160, 61,118, 65, 54,113, 57,162,162,162,162,162,162,163,163, + 163, 61,121,176,130,179,215, 98,159,204, 90,154,201, 94,155,202, 67, + 129,175, 44,109,160, 55,130, 62, 52,126, 59, 49,121, 55, 46,117, 52, + 73,145, 80, 70,143, 76, 57,115, 61,161,161,161,162,162,162, 69,126, + 180,136,183,217,103,163,207, 97,158,204, 99,159,204, 69,131,177, 49, + 113,164, 59,135, 66,137,203,146,132,200,141,128,198,136,123,195,131, + 119,193,127, 71,143, 77, 59,116, 63,161,161,161, 76,132,186,141,187, + 219,110,168,209,102,166,209, 95,180,223, 71,133,177, 55,117,169, 62, + 139, 70,143,206,153,125,198,135,120,195,129,115,192,124,116,192,124, + 121,194,129, 73,144, 79, 84,127, 87, 84,137,191,148,191,221,117,173, + 212, 99,184,225, 75,212,255, 66,139,184, 61,122,173, 65,144, 74,148, + 210,159,145,208,154,141,205,150,137,203,146,132,200,141, 81,152, 88, + 65,124, 70,159,159,159, 90,142,196,152,195,224,124,179,215,116,175, + 214, 94,196,237, 75,136,179, 69,127,178, 68,148, 77, 66,145, 75, 63, + 141, 72, 61,137, 69, 93,164,101, 90,160, 97, 69,131, 75,158,158,158, + 158,158,158, 96,146,201,158,199,226,131,184,218,125,180,215,126,179, + 215, 79,137,180, 75,132,183,255,255,255,255,255,255,119,119,119,154, + 154,154, 61,138, 69, 73,138, 79,156,156,156,157,157,157,157,157,157, + 102,150,204,162,203,227,137,189,220,131,185,218,132,185,218, 81,139, + 181, 82,137,188,255,255,255,255,255,255,122,122,122,153,153,153, 82, + 145, 89,153,154,153,155,155,155,156,156,156,156,156,156,108,154,208, + 167,206,229,143,193,223,137,189,220,139,189,220, 83,141,182, 90,142, + 194,255,255,255,255,255,255,125,125,125,153,153,153,153,153,153,154, + 154,154,154,154,154,155,155,155,155,155,155,111,157,211,170,209,231, + 171,209,231,152,199,225,145,194,222, 86,143,183, 96,147,198,255,255, + 255,255,255,255,128,128,128,126,126,126,124,124,124,122,122,122,119, + 119,119,117,117,117,114,114,114,113,158,212,111,158,214,135,178,220, + 171,211,232,169,208,230, 88,144,184,103,151,203,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,132,172,220,109,156,212, + 133,177,218, 90,145,185,109,156,207,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 165,129,103,139, 82, 41,139, 82, 41,157,108, 74,157,108, 74,157,108, - 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157, - 108, 74,139, 82, 41,145,110, 84,255,255,255,255,255,255,139, 82, 41, - 209,165,123,210,165,124,210,165,124,210,165,124,210,165,124,210,165, - 124,210,165,124,210,165,124,210,165,124,210,165,124,210,165,124,209, - 165,123,139, 82, 41,255,255,255,255,255,255,157,104, 63,208,161,116, - 207,159,114,207,159,114,207,159,114,207,159,114,207,159,114,207,159, - 114,207,159,114,207,159,114,207,159,114,207,159,114,208,161,116,139, - 82, 41,255,255,255,139, 82, 41,196,151,112,208,162,119,207,160,117, - 207,160,117,207,160,117,207,160,117,207,160,117,207,160,117,207,160, - 117,207,160,117,207,160,117,207,160,117,208,162,119,196,151,112,139, - 82, 41,139, 82, 41,206,164,127,210,165,123,209,164,122,209,164,122, - 209,164,122,209,164,122,209,164,122,209,164,122,209,164,122,209,164, - 122,209,164,122,209,164,122,210,166,124,212,169,129,139, 82, 41,139, - 82, 41,215,180,148,220,186,153,220,186,153,220,186,153,220,185,152, - 216,179,143,212,169,130,211,168,127,211,168,127,211,168,127,211,168, - 127,211,168,127,212,168,128,209,169,133,139, 82, 41,139, 82, 41,139, - 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41, - 210,173,142,218,180,145,217,179,145,217,179,145,217,179,145,217,179, - 145,217,180,145,217,183,152,139, 82, 41,255,255,255,139, 82, 41,127, - 120,111,253,253,253,248,249,249,243,241,240,205,137, 89,139, 82, 41, - 139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, - 41,139, 82, 41,139, 82, 41,255,255,255,139, 82, 41,142,136,127,242, - 242,242,241,242,241,241,241,241,205,137, 89,255,247,240,253,231,214, - 253,230,212,252,228,208,251,227,203,254,243,232,205,136, 88,139, 82, - 41,255,255,255,255,255,255,139, 82, 41,177,154,132,151,138,124,150, - 137,123,148,136,121,205,137, 89,255,247,242, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92,253,242,231,205,137, 89,139, 82, 41,255,255, - 255,255,255,255,139, 82, 41,218,183,153,212,172,137,212,172,137,213, - 174,140,205,136, 88,254,247,241,252,228,209,251,226,204,249,221,196, - 247,218,192,252,242,233,205,137, 89,139, 82, 41,255,255,255,255,255, - 255,157,103, 62,197,159,132,213,181,155,213,181,155,211,179,152,204, - 135, 87,255,247,241, 93, 93, 93, 92, 92, 92, 92, 92, 92,254,249,243, - 255,247,240,205,137, 89,255,255,255,255,255,255,255,255,255,255,255, - 255,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,205,137, 89,255, - 247,240,255,247,240,255,247,240,255,247,240,255,247,240,255,247,240, - 205,137, 89,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,205,137, 89,205,137, 89,205, - 137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89, - 255,255,255,255,255,255); + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,177,202,232, + 108,156,211,112,158,210); + +Const + stdimg_bookmark_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,223,209,197,157,105, 71,135, 74, 32,135, 74, + 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32, + 255, 0,255,150, 96, 59,168,109, 61,215,169,130,182,134, 96,162,115, + 77,166,122, 85,172,129, 95,177,136,103,181,143,111,185,149,118,189, + 155,126,194,160,133,197,165,139,200,169,144,135, 74, 32,255, 0,255, + 135, 74, 32,188,132, 80,216,169,130,179,130, 90,156,107, 66,147,110, + 75,127,111, 86,166,120, 82,169,124, 87,151,124, 95,150,128,101,179, + 137,103,182,141,108,199,167,142,135, 74, 32,255, 0,255,135, 74, 32, + 188,132, 80,216,169,130,179,130, 90,156,107, 66, 26,104,116, 12,108, + 126, 37,107,116, 68,110,109, 9,103,121, 8,102,120,149,130,106,182, + 141,108,198,165,139,135, 74, 32,255, 0,255,135, 74, 32,188,132, 80, + 216,169,130,179,130, 90,156,107, 66, 23,106,120, 64,207,227, 50,182, + 202, 38,157,176, 72,221,240, 18,114,131,145,129,105,182,141,108,197, + 163,137,135, 74, 32,255, 0,255,135, 74, 32,188,132, 80,216,169,130, + 179,130, 90,156,107, 66, 35,106,115, 52,186,206, 79,233,252, 79,233, + 252, 78,231,250, 3, 99,118,162,133,104,182,141,108,195,161,134,135, + 74, 32,255, 0,255,135, 74, 32,188,132, 80,216,169,130,179,130, 90, + 68,104, 99, 19,118,136, 73,224,242, 79,233,252, 79,233,252, 79,232, + 251, 36,151,170, 33,109,119,169,138,108,194,159,131,135, 74, 32,255, + 0,255,135, 74, 32,188,132, 80,216,169,130,162,127, 93, 3, 98,118, + 60,198,216,113,232,247,194,247,254,215,250,254,135,239,252, 74,216, + 235, 19,121,140,108,122,112,193,157,128,135, 74, 32,255, 0,255,135, + 74, 32,188,132, 80,216,169,130,179,130, 90, 68,104,100, 24,106,119, + 3, 97,119,147,221,232,223,250,253, 10,106,125, 18,106,122, 43,111, + 121,163,137,109,191,155,126,135, 74, 32,255, 0,255,135, 74, 32,188, + 132, 80,216,169,130,179,130, 90,156,107, 66,159,111, 71,111,109, 90, + 47,135,150,122,198,210, 62,112,114,175,133, 98,179,137,103,182,141, + 108,190,153,123,135, 74, 32,255, 0,255,135, 74, 32,188,132, 80,216, + 169,130,179,130, 90,156,107, 66,159,111, 71,162,115, 77, 38,106,115, + 13,102,120,146,123, 95,175,133, 98,179,137,103,182,141,108,189,151, + 120,135, 74, 32,255, 0,255,135, 74, 32,182,128, 81,183,136,102,172, + 124, 92,166,122, 89,167,122, 89,167,123, 89,169,126, 92,170,128, 94, + 174,131, 96,175,133, 98,179,137,103,182,141,108,187,149,118,135, 74, + 32,255, 0,255,135, 74, 32,156,104, 67,153, 98, 60,156,102, 64,153, + 102, 63,159,110, 72,166,119, 84,170,126, 90,172,129, 93,174,131, 96, + 176,135,100,179,137,103,182,141,108,186,146,115,135, 74, 32,255, 0, + 255,135, 74, 32,150, 92, 47,203,188,176,236,233,230,249,246,244,249, + 247,244,250,247,245,250,247,245,250,247,245,250,248,245,250,248,246, + 251,248,246,251,248,246,251,249,247,135, 74, 32,255, 0,255,150, 96, + 59,160,101, 54,213,202,193,210,217,213,214,220,217,218,224,221,222, + 228,225,227,231,229,231,235,233,235,239,237,240,242,241,244,246,245, + 249,250,249,253,253,253,135, 74, 32,255, 0,255,223,209,197,157,105, + 71,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, + 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32, + 135, 74, 32,135, 74, 32); + +Const + stdimg_menu_check_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,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, 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, 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, 0, 0, 0, + 0, 0, 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, 0, 0, 0, 0, 0, 0, + 255, 0,255, 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, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255, 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, 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, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); Const stdimg_btn_close_16 : Array[0..821] of byte = ( @@ -2075,6 +2228,400 @@ Const 255,255,255,255,255,255); Const + stdimg_bevel : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 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,255, 0,255, 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,255, 0,255, 0, 0, 0,255, 0,255,200,208,212, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 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,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128,200,208,212,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,255,255,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,255,255,255,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,128,128,128,255,255,255,255, 0,255, + 255, 0,255, 0, 0, 0,255, 0,255,128,128,128,255,255,255,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,128,128,128,255,255, + 255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128,255, + 255,255,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,128,128,128,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,200,208,212,128, + 128,128,255,255,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255, + 128,128,128,255,255,255,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,128,128,128,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,255,255,255, + 200,208,212,128,128,128,255,255,255,255, 0,255,255, 0,255, 0, 0, + 0,255, 0,255,128,128,128,255,255,255,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,128,128,128, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,255,255,255,200,208,212,128,128,128,255,255,255,255, 0,255,255, + 0,255, 0, 0, 0,255, 0,255,128,128,128,255,255,255,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,128,128,128,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,255,255,255,200,208,212,128,128,128,255,255,255, + 255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128,255,255, + 255,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,255,255,255,200,208,212,128,128, + 128,255,255,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,128, + 128,128,255,255,255,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,128,128,128,255,255,255,255, 0,255,255, 0,255, 0, 0, 0, + 255, 0,255,128,128,128,255,255,255,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,128,128,128,255,255,255,255, 0,255,255, 0, + 255, 0, 0, 0,255, 0,255,128,128,128,255,255,255,200,208,212,255, + 255,255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,128,128,128,255,255,255,255, + 0,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128,255,255,255, + 200,208,212,255,255,255,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,128,128,128,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,128,128,128, + 255,255,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,128,128, + 128,255,255,255,200,208,212,255,255,255,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,128,128,128,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,128,128,128,255,255,255,255, 0,255,255, 0,255, 0, 0, 0,255, + 0,255,128,128,128,255,255,255,200,208,212,255,255,255,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,128,128,128,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,128,128,128,255,255,255,255, 0,255,255, 0,255, + 0, 0, 0,255, 0,255,128,128,128,255,255,255,200,208,212,255,255, + 255,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,128, + 128,128,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,128,128,128,255,255,255,255, 0, + 255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128,255,255,255,200, + 208,212,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,128,128,128,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,128,128,128,255, + 255,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, + 255,255,255,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 128,128,128,255,255,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,200,208,212,255,255,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,200,208,212,255, 0,255, + 255, 0,255, 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,255, 0,255, 0, 0, 0); + +Const + stdimg_choice_no_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255, 98, 98,162,164,164,178,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,152,152,171,101,101,160,255, 0,255,255, 0,255, + 255, 0,255, 48, 48,162, 55, 55,241, 19, 19,202,152,152,172,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,135, + 135,164, 17, 17,205, 48, 48,234, 61, 61,154,255, 0,255,255, 0,255, + 8, 8,224, 72, 72,245, 76, 76,240, 5, 5,200,135,135,163,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,116,116,157, 5, 5,205, 90, + 90,239, 90, 90,244, 9, 9,217,255, 0,255,255, 0,255, 34, 34,254, + 55, 55,255, 89, 89,255, 74, 74,237, 5, 5,199,119,119,156,255, 0, + 255,255, 0,255, 98, 98,152, 8, 8,206, 90, 90,237,115,115,255, 85, + 85,255, 54, 54,253,255, 0,255,255, 0,255, 29, 29,255, 43, 43,255, + 57, 57,255, 86, 86,255, 69, 69,235, 5, 5,196,102,102,148, 85, 85, + 147, 9, 9,203, 84, 84,237,106,106,255, 80, 80,255, 65, 65,255, 52, + 52,255,255, 0,255,255, 0,255,255, 0,255, 30, 30,255, 43, 43,255, + 53, 53,255, 74, 74,255, 55, 55,232, 1, 1,187, 6, 6,192, 68, 68, + 237, 88, 88,255, 71, 71,255, 62, 62,255, 54, 54,249,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 31, 31,251, 47, 47,255, + 60, 60,255, 78, 78,255, 49, 49,232, 55, 55,237, 75, 75,255, 56, 56, + 255, 50, 50,255, 55, 55,241,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 77, 77,238, 97, 97,255, + 96, 96,255, 96, 96,255, 98, 98,255, 98, 98,255, 91, 91,255, 73, 73, + 227,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 43, 43,156, 61, 61,244, 99, 99,255, + 99, 99,255,100,100,255,100,100,255, 54, 54,237, 75, 75,146,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 47, 47,123, 0, 0,166, 49, 49,242,107,107,255,106,106,255, + 106,106,255,105,105,255, 33, 33,230, 0, 0,152, 82, 82,127,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 43, 43,115, 0, + 0,164, 55, 55,243,121,121,255,120,120,255,121,121,255,121,121,255, + 120,120,255,116,116,255, 38, 38,229, 0, 0,146, 82, 82,123,255, 0, + 255,255, 0,255,255, 0,255, 45, 45,112, 0, 0,156, 66, 66,242,138, + 138,255,137,137,255,136,136,255,102,102,209,103,103,224,141,141,255, + 136,136,255,132,132,255, 42, 42,227, 0, 0,139, 91, 91,128,255, 0, + 255,255, 0,255, 0, 0,156, 73, 73,242,155,155,255,153,153,255,153, + 153,255,115,115,207,255, 0,255,255, 0,255,110,110,228,158,158,255, + 153,153,255,148,148,255, 47, 47,229, 13, 13,130,255, 0,255,255, 0, + 255, 85, 85,254,174,174,255,169,169,255,168,168,255,119,119,205,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,118,118,228,175,175,255, + 169,169,255,169,169,255, 60, 60,222,255, 0,255,255, 0,255,127,127, + 208,187,187,255,187,187,255,122,122,207,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,126,126,228,200,200,255, + 164,164,255,152,152,199,255, 0,255,255, 0,255,255, 0,255,126,126, + 210,127,127,214,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,121,121,231,154,154,197, + 255, 0,255,255, 0,255); + +Const + stdimg_radiobuttons : Array[0..2213] of byte = ( + 66, 77,166, 8, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 60, 0, 0, 0, 12, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 112, 8, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255,255,255,255,255,255,191,191,191,191,191,191,191,191,191, + 191,191,191,255,255,255,255,255,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255,255,255,255,255,255,191,191,191,191,191,191,191, + 191,191,191,191,191,255,255,255,255,255,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255,255,255,255,255,255,191,191,191,191,191, + 191,191,191,191,191,191,191,255,255,255,255,255,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255,255,255,255,255,255,191,191,191, + 191,191,191,191,191,191,191,191,191,255,255,255,255,255,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255,255,255,255,255,255,191, + 191,191,191,191,191,191,191,191,191,191,191,255,255,255,255,255,255, + 255, 0,255,255, 0,255,255, 0,255,127,127,127,191,191,191,191,191, + 191,255,255,255,255,255,255,255,255,255,255,255,255,191,191,191,191, + 191,191,255,255,255,255, 0,255,255, 0,255,127,127,127,191,191,191, + 191,191,191,255,255,255,255,255,255,255,255,255,255,255,255,191,191, + 191,191,191,191,255,255,255,255, 0,255,255, 0,255,127,127,127,191, + 191,191,191,191,191,127,127,127,127,127,127,127,127,127,127,127,127, + 191,191,191,191,191,191,255,255,255,255, 0,255,255, 0,255,127,127, + 127,191,191,191,191,191,191,127,127,127,127,127,127,127,127,127,127, + 127,127,191,191,191,191,191,191,255,255,255,255, 0,255,255, 0,255, + 127,127,127,191,191,191,191,191,191,127,127,127,127,127,127,127,127, + 127,127,127,127,191,191,191,191,191,191,255,255,255,255, 0,255,255, + 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, 0, + 255,255, 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,191,191,191,255,255,255, + 255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, + 255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, + 191,255,255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 191,191,191,255,255,255,255, 0,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, + 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255,127,127, + 127, 0, 0, 0,127,127,127,127,127,127,127,127,127, 0, 0, 0, 0, + 0, 0,127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, + 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, + 255,255,127,127,127, 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,191,191, + 191,255,255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, + 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, + 127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127, + 127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, + 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,255,255,255,191,191,191,255,255,255,127, + 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255,255, + 255,127,127,127, 0, 0, 0,127,127,127,127,127,127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,191,191,191, + 255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, + 191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, + 127,127,127,127,127,127,127,127,127, 0, 0, 0, 0, 0, 0,127,127, + 127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, + 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255,255, 0, + 255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, 0,255, + 255, 0,255,127,127,127, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,191,191,191,255,255,255,255, + 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255,255, + 255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191, + 255,255,255,255, 0,255,255, 0,255,127,127,127, 0, 0, 0,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, + 191,191,255,255,255,255, 0,255,255, 0,255,127,127,127, 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,255, 0,255,255, 0,255,127,127,127, 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,255, 0,255,255, 0,255,127,127, + 127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, + 127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255,255, 0,255, + 127,127,127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,127,127, + 127,127,127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255,255, + 0,255,127,127,127, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127, + 127,127,127,127,127,127, 0, 0, 0, 0, 0, 0,255,255,255,255, 0, + 255,255, 0,255,255, 0,255,127,127,127,127,127,127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127, + 127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127, + 127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127, + 127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127, + 127,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, + 127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,127,127,127,127,127,127,127,127,127,127,127, + 127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127,127,127,127, + 127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127,127,127, + 127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127,127,127, + 127,127,127,127,127,127,127,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,127,127,127, + 127,127,127,127,127,127,127,127,127,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255); + +Const + stdimg_refresh_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,197,157,126,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,225,205,189,189,144,108,174,118, 73,166,105, 57,176, + 122, 79,196,156,124,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,164,101, 52,203,167,139,255, 0,255,225,204,188,172,113, + 68,184,134, 93,206,166,132,216,182,151,219,185,153,211,172,138,195, + 149,111,169,109, 63,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 165,104, 56,185,136, 96,180,129, 88,180,128, 86,227,202,180,236,218, + 201,231,209,188,227,201,176,222,190,160,210,171,136,206,165,130,211, + 174,142,169,110, 64,255, 0,255,255, 0,255,255, 0,255,167,105, 58, + 241,228,216,212,178,149,244,233,224,243,232,221,237,220,204,210,173, + 143,179,125, 83,166,104, 56,166,105, 57,166,106, 58,169,109, 61,176, + 120, 76,197,157,125,255, 0,255,255, 0,255,166,104, 57,246,238,230, + 245,236,227,245,237,228,230,210,193,179,126, 84,185,136, 97,255, 0, + 255,255, 0,255,217,191,171,175,117, 74,182,124, 79,167,107, 59,167, + 107, 59,255, 0,255,255, 0,255,165,104, 55,246,238,230,235,215,196, + 234,217,201,164,102, 53,217,191,171,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,173,115, 70,225,196,174,200,158,124,164,101, 52,255, + 0,255,255, 0,255,165,103, 54,245,237,229,246,237,229,245,236,228, + 215,184,157,177,122, 79,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,165,103, 54,255, 0,255,255, + 0,255,166,105, 57,164,102, 53,164,102, 53,165,102, 54,165,103, 54, + 165,103, 55,189,143,108,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,198,158,128,164,101, 52,175,120, 76,178,123, 82,178,123, + 82,178,124, 82,164,101, 52,255, 0,255,255, 0,255,165,103, 54,217, + 189,167,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,187,139,102,209,174,145,246,238,231,242,230,219,246,238, + 230,167,108, 61,255, 0,255,255, 0,255,164,102, 54,168,108, 61,221, + 187,162,174,118, 75,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 221,197,179,164,102, 53,233,215,199,235,216,198,245,236,227,168,109, + 62,255, 0,255,255, 0,255,170,111, 65,171,112, 65,169,109, 61,170, + 112, 66,213,184,162,255, 0,255,255, 0,255,183,134, 95,188,141,103, + 235,219,205,245,235,226,246,238,230,246,238,230,169,109, 62,255, 0, + 255,255, 0,255,202,164,135,192,145,106,197,152,114,168,107, 60,164, + 102, 53,168,108, 60,186,139,101,217,187,161,241,228,216,242,230,219, + 243,232,221,206,168,137,234,216,200,169,110, 63,255, 0,255,255, 0, + 255,255, 0,255,169,111, 65,211,173,140,220,189,157,221,190,161,229, + 203,180,233,211,191,238,221,204,240,226,213,231,210,191,178,124, 82, + 187,141,104,174,117, 73,165,104, 55,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,169,109, 63,193,146,107,211,176,143,223,194,168,222, + 193,168,212,177,147,188,140,102,170,112, 67,224,202,185,255, 0,255, + 219,194,174,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,200,161,132,178,125, 83,168,108, 61,176,120, 77,190, + 145,110,225,205,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 212,182,159,255, 0,255); + +Const + stdimg_list_add_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0,215, 13, 0, 0,215, 13, 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,182,132, + 93,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,164,101, 52,230,206, + 183,230,206,183,164,101, 52,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,164,101, 52,230,206,183,217,173, + 134,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,164,101, 52,230,206,183,217,173,134,164,101, + 52,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,182,132, 93,164,101, 52,164,101, 52, + 164,101, 52,164,101, 52,217,173,134,217,173,134,164,101, 52,164,101, + 52,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255,255, + 255,255,255,255,255,164,101, 52,229,204,180,219,183,149,219,182,148, + 218,180,146,218,179,144,217,173,134,216,170,131,215,168,127,215,166, + 125,224,190,159,164,101, 52,255,255,255,255,255,255,255,255,255,255, + 255,255,164,101, 52,232,211,192,231,209,187,231,209,188,230,206,183, + 230,206,183,230,206,183,230,206,183,230,205,182,230,204,181,230,204, + 182,164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,182, + 132, 93,164,101, 52,164,101, 52,164,101, 52,164,101, 52,230,206,183, + 230,206,183,164,101, 52,164,101, 52,164,101, 52,164,101, 52,182,132, + 93,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,164,101, 52,230,206,183,230,206,183, + 164,101, 52,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,164,101, 52,230,206,183,230,206,183,164,101, 52, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,164,101, 52,230,206,183,230,206,183,164,101, 52,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,182, + 132, 93,164,101, 52,164,101, 52,182,132, 93,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255); + +Const stdimg_edit_copy_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, @@ -2127,297 +2674,58 @@ Const 255,255,255,255,255,255); Const - stdimg_edit_delete_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255,255,255,186,188,188,145,148,147,173,176,175,255,255, - 255,255,255,255,144,148,146,158,161,160,163,166,164,255,255,255,255, - 255,255,219,220,219,151,153,153,189,191,190,255,255,255,255,255,255, - 255,255,255,141,145,144,250,250,250,151,154,153,169,172,171,159,162, - 161,150,154,152,238,239,239,170,174,172,155,158,157,152,155,154,139, - 142,141,255,255,255,172,175,175,255,255,255,255,255,255,255,255,255, - 186,188,188,142,146,145,246,246,246,153,156,155,171,173,172,143,147, - 144,224,225,224,178,180,180,211,213,212,152,155,154,236,236,236,160, - 163,162,212,213,213,255,255,255,255,255,255,255,255,255,255,255,255, - 141,144,143,221,222,221,142,147,144,201,201,201,138,143,140,206,208, - 207,164,166,165,200,200,200,124,128,127,227,228,228,146,149,148,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,117,121,120, - 203,205,204,133,138,135,166,167,166,146,147,147,179,180,179,146,147, - 146,182,183,182,124,128,127,189,190,189,123,126,125,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,106,110,109,205,206,206, - 108,111,111,172,174,173,109,112,111,175,177,176,108,111,110,178,180, - 179,111,115,114,179,180,180,109,113,112,255,255,255,255,255,255,255, - 255,255,165,118, 87,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32, - 135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, - 32,135, 74, 32,135, 74, 32,135, 74, 32,135, 74, 32,165,118, 87,135, - 74, 32,221,187,156,207,159,114,207,159,114,207,159,114,207,159,114, - 207,159,114,207,159,114,207,159,114,207,159,114,207,159,114,207,159, - 114,207,159,114,207,159,114,221,187,156,135, 74, 32,135, 74, 32,221, - 187,156,221,187,156,221,187,156,221,187,156,221,187,156,221,187,156, - 221,187,156,221,187,156,221,187,156,221,187,156,221,187,156,221,187, - 156,221,187,156,221,187,156,135, 74, 32,135, 74, 32,221,187,156,202, - 138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88, - 202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, 88,202,138, - 88,221,187,156,135, 74, 32,135, 74, 32,221,187,156,134, 82, 44,134, - 81, 43,134, 81, 43,134, 81, 43,134, 81, 43,134, 81, 43,134, 82, 44, - 134, 82, 44,134, 82, 44,134, 82, 44,134, 82, 44,134, 82, 44,221,187, - 156,135, 74, 32,135, 74, 32,221,187,156,106, 91, 78,201,201,201,156, - 156,156,156,156,156,156,156,156,155,155,155,155,155,155,155,155,155, - 155,155,155,155,155,155,155,155,155,106, 91, 78,221,187,156,135, 74, - 32,135, 74, 32,221,187,156,119,124,122,217,217,217,189,189,189,189, - 189,189,189,189,189,189,189,189,188,188,188,188,188,188,188,188,188, - 191,191,191,192,192,192,119,124,122,221,187,156,135, 74, 32,195,165, - 144,135, 74, 32,133,138,136,231,231,231,215,215,215,214,214,214,214, - 214,214,214,214,214,214,214,214,213,213,213,213,213,213,218,218,218, - 220,220,220,133,138,136,135, 74, 32,195,165,144,255,255,255,255,255, - 255,133,138,136,241,241,241,235,235,235,235,235,235,235,235,235,234, - 234,234,234,234,234,234,234,234,234,234,234,234,234,234,233,233,233, - 133,138,136,255,255,255,255,255,255,255,255,255,255,255,255,171,174, - 173,133,138,136,133,138,136,133,138,136,133,138,136,133,138,136,133, - 138,136,133,138,136,133,138,136,133,138,136,133,138,136,171,174,173, - 255,255,255,255,255,255); - -Const - stdimg_search_16 : Array[0..821] of byte = ( + stdimg_about_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 18, 11, 0, 0, 18, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255,225,188,172,225,188,172,225,188,172,225,188,172,225,188,172,225, + 188,172,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,225,188,172,228,195,181,241,224, + 216,250,243,240,255,255,255,254,253,252,250,243,240,241,224,216,228, + 195,181,225,188,172,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,225,188,172,237,214,205,254,253,252,247,243,239,218,196, + 179,202,169,144,204,173,148,225,204,189,249,246,243,254,253,252,237, + 214,205,225,188,172,255, 0,255,255, 0,255,255, 0,255,225,188,172, + 237,214,205,255,255,255,223,205,191,181,138,105,182,139,107,186,144, + 113,189,150,119,194,155,124,200,163,135,234,220,209,255,255,255,237, + 214,205,225,188,172,255, 0,255,255, 0,255,228,195,181,254,253,252, + 220,201,187,170,123, 87,174,128, 94,205,177,155,251,249,247,255,255, + 255,217,193,175,194,155,125,198,161,132,234,220,209,254,253,252,228, + 195,181,255, 0,255,225,188,172,241,224,216,245,239,235,165,116, 81, + 166,118, 81,171,123, 88,174,128, 93,243,236,231,255,255,255,186,144, + 113,190,149,119,194,155,125,200,164,135,249,246,243,241,224,216,225, + 188,172,225,188,172,250,243,240,202,173,153,158,106, 70,162,111, 75, + 166,117, 81,170,123, 88,243,236,230,255,255,255,182,139,106,186,144, + 112,190,149,118,193,155,125,225,205,189,250,243,240,225,188,172,225, + 188,172,254,253,252,169,125, 93,154,101, 63,159,107, 69,162,111, 76, + 166,117, 82,242,235,229,255,255,255,178,134,100,182,139,106,186,144, + 112,190,150,119,205,173,148,254,253,252,225,188,172,225,188,172,254, + 253,252,166,121, 87,151, 96, 57,154,101, 63,158,106, 69,162,112, 75, + 241,234,229,255,255,255,175,128, 94,178,134,101,182,139,106,186,145, + 112,202,169,144,254,253,252,225,188,172,225,188,172,250,243,240,195, + 164,143,146, 91, 50,151, 95, 57,155,101, 63,189,153,127,234,222,214, + 254,254,254,171,123, 88,174,128, 94,178,133,100,182,138,106,218,196, + 179,250,243,240,225,188,172,225,188,172,241,224,216,243,236,232,147, + 90, 52,147, 90, 50,151, 96, 57,155,101, 63,158,107, 69,162,111, 75, + 166,118, 82,171,122, 88,174,128, 94,181,138,106,247,243,239,241,224, + 216,225,188,172,255, 0,255,228,195,181,254,253,252,210,186,170,143, + 85, 44,147, 90, 50,151, 96, 57,215,194,179,232,220,211,163,112, 76, + 166,118, 81,171,123, 88,223,205,192,254,253,252,228,195,181,255, 0, + 255,255, 0,255,225,188,172,237,214,205,255,255,255,210,186,170,147, + 91, 52,147, 90, 51,220,201,187,237,228,221,159,107, 69,166,117, 81, + 220,201,187,255,255,255,237,214,205,225,188,172,255, 0,255,255, 0, + 255,255, 0,255,225,188,172,237,214,205,254,253,252,243,236,232,195, + 164,142,166,120, 88,169,125, 93,202,173,153,245,239,235,254,253,252, + 237,214,205,225,188,172,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,225,188,172,228,195,181,241,224,216,250,243,240,255, + 255,255,254,253,252,250,243,240,241,224,216,228,195,181,225,188,172, 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,100,148,186, 34, - 103,157,129,168,198,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,111,156,194, 85,141,188,137,181,221, 24, - 95,151,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,123,164,202,100,151,197,157,193,228,102,153,199, 49,113,165,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,233,207,186, - 219,178,146,211,166,128,208,161,124,210,166,133,174,161,153,117,162, - 204,171,203,232,118,164,206, 64,123,175,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,232,202,176,232,201,174,245,225,205, - 247,229,211,247,229,209,243,221,200,223,186,156,199,168,145,134,174, - 213, 80,135,187,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,241,219,200,237,208,183,248,232,217,245,222,200,243,216,189, - 243,214,187,244,219,194,247,228,210,223,187,157,160,151,149,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,238, - 206,178,247,231,215,246,225,204,244,219,194,244,218,192,243,216,189, - 243,215,187,244,219,194,243,222,201,210,168,135,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,240,206,175,249, - 236,223,245,223,200,245,221,198,244,220,195,244,218,193,243,217,190, - 243,215,189,248,230,211,211,166,128,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,244,211,181,249,237,225,246, - 225,204,245,223,201,245,222,199,244,220,196,244,219,194,244,218,192, - 248,231,214,215,171,135,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,248,219,193,249,235,222,247,231,214,246, - 225,204,245,224,202,245,222,200,245,221,197,246,225,203,245,226,208, - 223,185,153,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,252,234,216,248,226,204,250,238,227,247,231,214,246, - 226,206,246,225,203,246,227,208,249,234,221,236,207,181,236,212,191, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,251,228,206,249,226,205,250,236,222,249,238,226,249, - 237,226,248,233,218,240,213,189,237,208,183,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,252,234,217,250,221,194,246,214,185,244,211,181,243, - 212,184,245,224,205,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255,255, 0,255,255, 0,255,225,188,172,225,188,172,225,188,172,225, + 188,172,225,188,172,225,188,172,255, 0,255,255, 0,255,255, 0,255, 255, 0,255,255, 0,255); Const - stdimg_dialog_warning_32 : Array[0..3125] of byte = ( - 66, 77, 54, 12, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 32, 0, 0, 0, 32, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 12, 0, 0, 19, 11, 0, 0, 19, 11, 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,252,252,252,244,244,244,237,237,237,235,235, - 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, - 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, - 235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, - 235,235,235,235,237,237,237,242,242,242,248,248,248,254,254,254,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,239,239,239, - 222,222,222,198,198,207,190,190,201,186,186,197,186,186,197,186,186, - 197,186,186,197,186,186,197,186,186,197,186,186,197,186,186,197,186, - 186,197,186,186,197,186,186,197,186,186,197,186,186,197,186,186,197, - 186,186,197,186,186,197,186,186,197,186,186,197,186,186,197,190,190, - 201,189,189,200,197,197,206,223,223,223,246,246,246,255,255,255,255, - 255,255,255,255,255,244,244,244,178,178,210, 22, 22,165, 0, 0,159, - 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0, - 159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, - 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, - 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0,159, 0, 0, - 159, 21, 21,165,173,173,209,250,250,250,255,255,255,255,255,255,243, - 243,243, 39, 39,171, 61, 61,196,112,112,224,117,117,226,116,116,226, - 113,113,225,111,111,225,108,108,224,105,105,223,102,102,223,100,100, - 222, 97, 97,222, 94, 94,221, 92, 92,220, 89, 89,220, 86, 86,219, 83, - 83,219, 81, 81,218, 78, 78,218, 75, 75,217, 72, 72,216, 69, 69,216, - 67, 67,215, 64, 64,215, 62, 62,214, 54, 54,212, 28, 28,188, 20, 20, - 166,246,246,246,255,255,255,255,255,255,253,253,253, 15, 15,166,121, - 121,221, 20, 20,208, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, - 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0, - 204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, - 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, 0, 0,204, - 0, 0,204, 10, 10,206, 56, 56,207, 2, 2,160,247,247,251,255,255, - 255,255,255,255,255,255,255, 90, 90,194, 89, 89,200, 58, 58,216, 0, - 0,204,163,163,219,210,210,224,210,210,224,211,211,225,212,212,226, - 212,212,226,213,213,227,214,214,228,215,215,229,216,216,230,216,216, - 230,217,217,231,217,217,231,218,218,232,218,218,232,219,219,233,220, - 220,234,221,221,235,222,222,236,193,193,231, 0, 0,204, 27, 27,209, - 44, 44,192, 53, 53,181,255,255,255,255,255,255,255,255,255,255,255, - 255,221,221,242, 25, 25,168,117,117,221, 8, 8,206, 80, 80,211,224, - 224,224,225,225,225,225,225,225,226,226,226,227,227,227,227,227,227, - 228,228,228,229,229,229,230,230,230,230,230,230,231,231,231,232,232, - 232,233,233,233,234,234,234,234,234,234,235,235,235,236,236,236,237, - 237,237,105,105,219, 3, 3,205, 59, 59,211, 14, 14,166,193,193,232, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,109,109, - 201, 85, 85,197, 68, 68,218, 2, 2,204,179,179,219,224,224,224,225, - 225,225,225,225,225,226,226,226,227,227,227,227,227,227,228,228,228, - 60, 60, 60, 55, 55, 55,230,230,230,231,231,231,232,232,232,233,233, - 233,234,234,234,234,234,234,235,235,235,205,205,231, 7, 7,205, 36, - 36,211, 47, 47,188, 70, 70,186,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,234,234,247, 23, 23,169,121,121, - 220, 14, 14,207, 59, 59,209,223,223,223,224,224,224,224,224,224,225, - 225,225,226,226,226,226,226,226,227,227,227, 55, 55, 55, 53, 53, 53, - 230,230,230,230,230,230,231,231,231,232,232,232,233,233,233,234,234, - 234,234,234,234, 82, 82,215, 8, 8,206, 67, 67,210, 10, 10,163,212, - 212,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,129,129,208, 74, 74,190, 81, 81,220, 0, 0, - 204,162,162,218,223,223,223,224,224,224,224,224,224,225,225,225,226, - 226,226,226,226,226,215,215,215,215,215,215,229,229,229,230,230,230, - 230,230,230,231,231,231,232,232,232,233,233,233,186,186,227, 1, 1, - 204, 47, 47,213, 46, 46,185, 96, 96,196,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 244,244,251, 25, 25,169,121,121,218, 23, 23,209, 42, 42,208,221,221, - 223,223,223,223,224,224,224,224,224,224,225,225,225,226,226,226, 37, - 37, 37, 37, 37, 37,228,228,228,229,229,229,229,229,229,230,230,230, - 231,231,231,232,232,232, 59, 59,211, 14, 14,207, 73, 73,209, 11, 11, - 164,228,228,245,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,151,151,216, - 63, 63,185, 94, 94,222, 0, 0,204,141,141,215,223,223,223,223,223, - 223,224,224,224,224,224,224,225,225,225, 27, 27, 27, 27, 27, 27,227, - 227,227,228,228,228,229,229,229,229,229,229,230,230,230,164,164,223, - 0, 0,204, 60, 60,215, 41, 41,179,120,120,205,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,251,251,253, 35, 35,174,116,116,215, - 34, 34,211, 27, 27,206,215,215,221,223,223,223,223,223,223,224,224, - 224,224,224,224, 13, 13, 13, 13, 13, 13,226,226,226,227,227,227,228, - 228,228,229,229,229,226,226,228, 40, 40,209, 24, 24,209, 75, 75,206, - 16, 16,167,241,241,250,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,172,172,224, 49, 49,178,106,106,223, 1, 1,204, - 121,121,213,222,222,222,222,222,222,223,223,223,224,224,224, 3, 3, - 3, 3, 3, 3,225,225,225,226,226,226,227,227,227,228,228,228,140, - 140,218, 1, 1,204, 75, 75,218, 34, 34,174,144,144,213,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254, - 254,255, 49, 49,179,109,109,211, 47, 47,213, 16, 16,206,206,206,220, - 222,222,222,222,222,222,215,215,215, 0, 0, 0, 0, 0, 0,217,217, - 217,225,225,225,226,226,226,218,218,226, 25, 25,207, 36, 36,211, 74, - 74,203, 27, 27,171,249,249,253,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,232, 36, - 36,173,117,117,224, 4, 4,205,102,102,212,221,221,221,222,222,222, - 204,204,204, 0, 0, 0, 0, 0, 0,206,206,206,225,225,225,225,225, - 225,118,118,216, 4, 4,205, 87, 87,219, 27, 27,170,167,167,222,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255, 69, 69,186,100,100,205, 59, - 59,216, 7, 7,205,195,195,219,221,221,221,193,193,193, 0, 0, 0, - 0, 0, 0,195,195,195,224,224,224,206,206,223, 12, 12,205, 49, 49, - 214, 70, 70,199, 45, 45,178,254,254,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,211,211,238, 25, 25,170,124,124,224, 8, 8,206, 82, - 82,210,221,221,221,218,218,218,207,207,207,207,207,207,220,220,220, - 223,223,223, 97, 97,213, 9, 9,206, 98, 98,219, 17, 17,166,189,189, - 230,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255, 92, 92,194, 89, 89,199, 72, 72,218, 2, 2,204,180,180,217,221, - 221,221,221,221,221,222,222,222,222,222,222,192,192,220, 4, 4,204, - 64, 64,217, 65, 65,194, 68, 68,186,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,226,226,244, 20, 20, - 168,128,128,224, 15, 15,207, 63, 63,209,220,220,220,221,221,221,221, - 221,221,222,222,222, 74, 74,210, 17, 17,207,104,104,219, 11, 11,163, - 210,210,238,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,114,114,202, 79, 79,193, 85, 85, - 220, 0, 0,204,162,162,215,220,220,220,220,220,220,173,173,217, 1, - 1,204, 80, 80,220, 59, 59,189, 92, 92,194,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,238,238,249, 20, 20,167,128,128,222, 25, 25,209, 44, 44, - 207,218,218,219,220,220,220, 53, 53,208, 28, 28,210,106,106,217, 10, - 10,164,226,226,244,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 137,137,211, 67, 67,187, 99, 99,223, 0, 0,204,143,143,214,152,152, - 214, 1, 1,204, 97, 97,223, 51, 51,184,118,118,204,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,246,246,252, 25, 25,169, - 122,122,218, 36, 36,211, 21, 21,206, 23, 23,205, 42, 42,212,104,104, - 215, 14, 14,165,239,239,249,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,158,158,218, 53, 53,181,113,113,225, - 1, 1,204, 3, 3,205,113,113,225, 41, 41,177,142,142,212,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,252,252,254, 37, 37,174,111,111,213, 66, 66,217, 70, 70,218, - 96, 96,210, 25, 25,170,248,248,252,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180, - 180,227, 22, 22,168,109,109,218,106,106,218, 20, 20,169,165,165,221, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,140,140,211, 12, - 12,165, 8, 8,163,124,124,206,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,252,252,254,251,251,253,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255); - -Const stdimg_hidden : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, @@ -2470,277 +2778,240 @@ Const 255,255,255, 0, 0, 0); Const - stdimg_document : Array[0..1061] of byte = ( - 66, 77, 38, 4, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 18, 0, 0, 0, 18, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 240, 3, 0, 0,235, 10, 0, 0,235, 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 98, 98, - 98, 91, 91, 91, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 97, 97, 97, - 255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, - 88, 88, 88, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, - 0,255,255, 0,255, 88, 88, 88,182,193,198,182,193,198,172,189,196, - 163,184,195,154,179,194,145,175,192,136,170,191,127,165,190,118,160, - 189,115,158,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, - 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,225, - 237,244,216,232,242,208,228,240,200,222,238,191,218,236,184,214,233, - 176,209,231,167,204,229,120,161,188, 48, 48, 48, 90, 90, 90,255, 0, - 255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, - 88,222,222,222,233,241,247,137,144,148,132,141,147,127,139,146,122, - 136,145,117,133,143,112,130,142,176,209,231,127,163,188, 48, 48, 48, - 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255, - 255, 0,255, 88, 88, 88,222,222,222,242,246,250,234,242,248,226,238, - 245,218,233,242,210,228,240,201,224,238,193,220,236,186,214,233,133, - 166,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, - 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,251,252,252, - 148,151,152,143,148,151,138,145,149,133,142,148,128,139,146,123,136, - 145,194,219,236,138,168,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, - 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222, - 222,222,255,255,255,252,253,253,244,248,250,235,243,248,228,238,245, - 220,234,243,212,230,241,202,223,236,144,171,188, 48, 48, 48, 90, 90, - 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0, - 255, 88, 88, 88,222,222,222,255,255,255,155,155,155,154,154,154,148, - 151,152,143,148,151,139,145,149,134,143,148,212,226,236,151,174,188, - 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255, - 255, 0,255,255, 0,255, 88, 88, 88,223,223,223,255,255,255,255,255, - 255,255,255,255,254,254,254,245,248,251,237,244,248,227,237,243,220, - 231,238,151,174,188, 48, 48, 48, 90, 90, 90,255, 0,255,255, 0,255, - 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222, - 255,255,255,155,155,155,155,155,155,155,155,155,155,155,155,246,249, - 251,236,240,244,217,224,231,175,182,190, 48, 48, 48, 90, 90, 90,255, - 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, - 88, 88,222,222,222,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,245,245,246,222,224,226,177,183,188,132,137,143, 48, 48, - 48, 90, 90, 90,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0, - 255,255, 0,255, 88, 88, 88,222,222,222,255,255,255,155,155,155,155, - 155,155,155,155,155,255,255,255,137,137,137,112,112,112,107,107,107, - 66, 66, 66, 48, 48, 48, 96, 96, 96,255, 0,255,255, 0,255, 0, 0, - 255, 0,255,255, 0,255,255, 0,255, 88, 88, 88,222,222,222,255,255, - 255,255,255,255,255,255,255,255,255,255,252,252,252,112,112,112,206, - 206,206,255,255,255,153,153,153, 48, 48, 48,135,135,135,255, 0,255, - 255, 0,255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 88, 88, 88, - 222,222,222,255,255,255,255,255,255,255,255,255,255,255,255,234,234, - 234,109,109,109,255,255,255,153,153,153, 88, 88, 88,135,135,135,255, - 0,255,255, 0,255,255, 0,255, 0, 0,255, 0,255,255, 0,255,255, - 0,255, 88, 88, 88,222,222,222,222,222,222,222,222,222,222,222,222, - 222,222,222,177,183,188, 88, 88, 88,153,153,153, 88, 88, 88,135,135, - 135,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0,255, 0, - 255,255, 0,255,255, 0,255, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 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, 0, 0); - -Const - stdimg_menu_preferences_16 : Array[0..821] of byte = ( + stdimg_menu_saveas_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,215,194,180,135, 74, 32,135, 74, 32,135, 74, 32,223,207, - 196,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 135, 74, 32,190,165,146,184,156,134,184,156,134,135, 74, 32,223,207, - 196,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,193, - 196,195,154,158,157,193,196,195,255, 0,255,255, 0,255,135, 74, 32, - 204,187,173,167,145,125,181,149,122,174,139,114,135, 74, 32,223,207, - 196,255, 0,255,255, 0,255,255, 0,255,219,220,220,133,138,136,158, - 161,160,133,138,136,255, 0,255,255, 0,255,135, 74, 32,204,187,173, - 164,141,120,162,138,116,180,149,122,179,147,124,135, 74, 32,255, 0, - 255,255, 0,255,219,220,220,133,138,136,210,211,212,194,195,196,133, - 138,136,255, 0,255,255, 0,255,232,221,213,135, 74, 32,212,200,189, - 164,141,120,164,141,120,190,165,146,135, 74, 32,255, 0,255,219,220, - 220,133,138,136,226,227,228,194,196,198,133,138,136,193,196,195,255, - 0,255,255, 0,255,255, 0,255,243,237,233,135, 74, 32,204,187,173, - 204,187,173,179,147,124,135, 74, 32,193,196,195,133,138,136,211,211, - 212,189,190,191,133,138,136,219,220,220,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,243,237,233,135, 74, 32,135, 74, 32, - 135, 74, 32,133,131,125,170,173,173,200,201,202,189,190,191,133,138, - 136,219,220,220,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 181,183,184,133,138,136,183,184,185,133,138,136,219,220,220,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,219, - 220,220,133,138,136,133,138,136,133,138,136,133,138,136,208,209,210, - 163,164,164,133,138,136,193,196,195,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,219,220,220,133,138,136,243, - 243,243,239,240,240,237,238,238,234,236,236,182,185,186,133,138,136, - 219,220,220,133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,133,138,136,245,246,246,169,172,171,133, - 138,136,247,247,247,226,227,229,170,173,173,245,246,246,255, 0,255, - 219,220,220,133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,219,220,220,133,138,136,255, 0,255,219,220,220,133, - 138,136,250,250,250,133,138,136,255, 0,255,255, 0,255,255, 0,255, - 219,220,220,133,138,136,135,140,138,179,179,179,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,133,138,136,238, - 240,240,133,138,136,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 133,138,136,240,240,240,133,138,136,179,179,179,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,133,138,136,233,235,236,133,138,136,219, - 220,220,255, 0,255,255, 0,255,255, 0,255,255, 0,255,179,179,179, - 133,138,136,238,239,239,133,138,136,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,219,220,220,133,138,136,219,220,220,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,179,179,179, - 133,138,136,219,220,220,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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, 0,216,171,142,205,149,112,189,115, 66,183,104, 53,181,104, + 53,180,103, 52,178,102, 52,176,101, 51,174,100, 51,172, 99, 50,170, + 98, 50,169, 97, 50,168, 96, 49,167, 97, 50,171,105, 60,188,134, 97, + 195,125, 79,235,198,173,234,197,173,254,251,248,254,251,248,254,251, + 248,254,251,248,254,251,248,254,251,248,254,251,248,254,251,248,254, + 251,248,254,251,248,200,154,124,199,152,121,173,107, 64,186,108, 56, + 237,202,179,224,162,122,254,250,247, 98,192,136, 98,192,136, 98,192, + 136, 98,192,136, 98,192,136, 98,192,136, 98,192,136, 98,192,136,253, + 249,246,202,141,101,201,155,124,167, 97, 50,187,108, 56,238,204,182, + 225,162,122,254,250,247,191,220,194,191,220,194,191,220,194,191,220, + 194,191,220,194,191,220,194,191,220,194,191,220,194,253,249,246,205, + 144,104,204,158,129,168, 97, 50,187,107, 56,239,206,184,225,162,121, + 254,250,247, 98,192,136, 98,192,136,206,247,255, 41, 41, 41, 82, 82, + 82,206,247,255, 98,192,136, 98,192,136,253,249,246,207,147,106,206, + 163,132,170, 97, 50,186,106, 54,239,208,187,226,162,122,254,251,248, + 206,247,255,206,247,255,206,247,255,206,247,255,206,247,255,206,247, + 255,206,247,255,206,247,255,254,251,248,211,150,109,210,167,138,171, + 98, 50,187,106, 54,240,210,190,226,163,122,226,163,122,206,247,255, + 206,247,255,206,247,255, 41, 41, 41, 82, 82, 82,206,247,255,206,247, + 255,206,247,255,216,153,113,214,153,112,213,171,142,173, 99, 51,187, + 106, 54,242,213,194,227,163,122,208,242,250,206,247,255,206,247,255, + 206,247,255, 82, 82, 82, 41, 41, 41,132,156,165,206,247,255,206,247, + 255,210,247,254,217,155,115,218,176,149,175,100, 51,187,106, 54,242, + 216,197,227,164,123,181,238,254,181,239,255,181,239,255,181,239,255, + 181,239,255, 82, 82, 82, 41, 41, 41, 82, 82, 82,181,239,255,181,239, + 254,220,157,116,221,181,154,177,101, 52,187,107, 54,244,217,199,230, + 166,125,186,236,250,181,239,255, 41, 41, 41, 82, 82, 82,181,239,255, + 181,239,255, 41, 41, 41, 41, 41, 41,181,239,255,186,239,253,218,156, + 116,225,186,159,179,102, 52,187,108, 55,244,220,201,231,167,125,201, + 230,240,181,239,255, 41, 41, 41, 41, 41, 41,181,239,255,132,156,165, + 41, 41, 41, 41, 41, 41,181,239,255,201,239,249,222,160,119,228,190, + 164,180,103, 52,189,110, 58,245,221,204,231,168,126,250,240,232,181, + 239,255,132,156,165, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 132,156,165,181,239,255,247,229,217,224,162,120,231,194,169,182,104, + 53,192,116, 66,246,223,208,232,168,126,252,246,241,198,242,246,148, + 247,255,148,247,255,148,247,255,148,247,255,148,247,255,148,247,255, + 184,228,232,247,230,219,225,163,122,239,213,195,183,106, 54,198,130, + 85,246,223,209,233,170,128,254,250,246,253,250,246,218,241,243,175, + 244,250,153,246,254,153,246,254,175,244,250,218,241,243,249,236,226, + 248,231,219,238,208,186,236,208,189,189,116, 67,214,165,133,246,224, + 209,247,224,209,254,251,248,254,251,247,253,249,246,252,245,240,250, + 240,234,251,242,237,253,249,246,253,250,247,251,241,235,248,233,223, + 236,209,190,205,146,106,226,197,177,225,189,166,217,171,141,201,137, + 94,192,117, 67,189,110, 58,187,108, 55,187,107, 54,187,106, 54,187, + 106, 54,188,108, 57,189,110, 59,187,109, 58,191,116, 68,201,141,101, + 231,206,188,255,255,255); Const - stdimg_choice_no_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255, 98, 98,162,164,164,178,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,152,152,171,101,101,160,255, 0,255,255, 0,255, - 255, 0,255, 48, 48,162, 55, 55,241, 19, 19,202,152,152,172,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,135, - 135,164, 17, 17,205, 48, 48,234, 61, 61,154,255, 0,255,255, 0,255, - 8, 8,224, 72, 72,245, 76, 76,240, 5, 5,200,135,135,163,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,116,116,157, 5, 5,205, 90, - 90,239, 90, 90,244, 9, 9,217,255, 0,255,255, 0,255, 34, 34,254, - 55, 55,255, 89, 89,255, 74, 74,237, 5, 5,199,119,119,156,255, 0, - 255,255, 0,255, 98, 98,152, 8, 8,206, 90, 90,237,115,115,255, 85, - 85,255, 54, 54,253,255, 0,255,255, 0,255, 29, 29,255, 43, 43,255, - 57, 57,255, 86, 86,255, 69, 69,235, 5, 5,196,102,102,148, 85, 85, - 147, 9, 9,203, 84, 84,237,106,106,255, 80, 80,255, 65, 65,255, 52, - 52,255,255, 0,255,255, 0,255,255, 0,255, 30, 30,255, 43, 43,255, - 53, 53,255, 74, 74,255, 55, 55,232, 1, 1,187, 6, 6,192, 68, 68, - 237, 88, 88,255, 71, 71,255, 62, 62,255, 54, 54,249,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255, 31, 31,251, 47, 47,255, - 60, 60,255, 78, 78,255, 49, 49,232, 55, 55,237, 75, 75,255, 56, 56, - 255, 50, 50,255, 55, 55,241,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255, 77, 77,238, 97, 97,255, - 96, 96,255, 96, 96,255, 98, 98,255, 98, 98,255, 91, 91,255, 73, 73, - 227,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255, 43, 43,156, 61, 61,244, 99, 99,255, - 99, 99,255,100,100,255,100,100,255, 54, 54,237, 75, 75,146,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255, 47, 47,123, 0, 0,166, 49, 49,242,107,107,255,106,106,255, - 106,106,255,105,105,255, 33, 33,230, 0, 0,152, 82, 82,127,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 43, 43,115, 0, - 0,164, 55, 55,243,121,121,255,120,120,255,121,121,255,121,121,255, - 120,120,255,116,116,255, 38, 38,229, 0, 0,146, 82, 82,123,255, 0, - 255,255, 0,255,255, 0,255, 45, 45,112, 0, 0,156, 66, 66,242,138, - 138,255,137,137,255,136,136,255,102,102,209,103,103,224,141,141,255, - 136,136,255,132,132,255, 42, 42,227, 0, 0,139, 91, 91,128,255, 0, - 255,255, 0,255, 0, 0,156, 73, 73,242,155,155,255,153,153,255,153, - 153,255,115,115,207,255, 0,255,255, 0,255,110,110,228,158,158,255, - 153,153,255,148,148,255, 47, 47,229, 13, 13,130,255, 0,255,255, 0, - 255, 85, 85,254,174,174,255,169,169,255,168,168,255,119,119,205,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,118,118,228,175,175,255, - 169,169,255,169,169,255, 60, 60,222,255, 0,255,255, 0,255,127,127, - 208,187,187,255,187,187,255,122,122,207,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,126,126,228,200,200,255, - 164,164,255,152,152,199,255, 0,255,255, 0,255,255, 0,255,126,126, - 210,127,127,214,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,121,121,231,154,154,197, - 255, 0,255,255, 0,255); + stdimg_link : Array[0..449] of byte = ( + 66, 77,194, 1, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 11, 0, 0, 0, 11, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 140, 1, 0, 0, 18, 11, 0, 0, 18, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,128,128,128,255,255,255,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,128,128,128,255,255,255,255,255,255,255, + 255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255,255,255,255,255, + 255, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255,255,255, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128,128,255, + 255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,128,128, + 128,255,255,255,255,255,255,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, + 128,128,128,255,255,255,255,255,255,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,128,128,128,255,255,255,255,255,255,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,128,128,128,255,255,255,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,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128, 0, 0, 0, 0, 0, 0); Const - stdimg_edit_cut_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255,255,255,172,172,226, 37, 37,178, 26, 26,175, 29, 29, - 174,209,209,239,255,255,255,255,255,255,255,255,255,255,255,255,172, - 172,226, 70, 70,190, 27, 27,176, 39, 39,179,209,209,239,255,255,255, - 255,255,255, 49, 49,182, 41, 41,219, 36, 36,209, 31, 31,206, 31, 31, - 177,209,209,239,255,255,255,255,255,255,209,209,239, 29, 29,177, 36, - 36,212, 34, 34,208, 31, 31,206, 39, 39,178,255,255,255,255,255,255, - 19, 19,173, 33, 33,208,255,255,255,117,117,213, 35, 35,211, 52, 52, - 184,255,255,255,255,255,255, 59, 59,187, 37, 37,214,114,114,214,255, - 255,255, 35, 35,210, 22, 22,173,255,255,255,255,255,255, 43, 43,179, - 37, 37,213,134,134,213,255,255,255, 38, 38,208, 13, 13,170,255,255, - 255,255,255,255, 5, 5,169, 38, 39,205,255,255,255,137,137,214, 34, - 34,209, 43, 43,179,255,255,255,255,255,255,172,172,226, 7, 7,168, - 35, 35,209, 73, 73,192, 26, 27,194, 1, 1,166,255,255,255,241,242, - 250, 30, 31,205, 25, 27,193, 74, 74,193, 33, 33,206, 7, 7,167,143, - 143,216,255,255,255,255,255,255,255,255,255,142,142,215, 9, 9,170, - 34, 34,210, 31, 31,206, 16, 17,184, 92, 94,196, 6, 7,169, 26, 26, - 201, 34, 34,209, 33, 33,203, 12, 12,170,171,171,225,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,127,210, - 33, 33,175, 6, 6,166, 70, 75,163, 2, 2,166, 25, 26,199, 37, 37, - 178,131,131,211,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,212,214,213, - 132,137,137,195,198,197,175,178,179, 52, 55,160,231,232,232,255,255, + stdimg_checkboxes : Array[0..2601] of byte = ( + 66, 77, 42, 10, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 65, 0, 0, 0, 13, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 244, 9, 0, 0,196, 14, 0, 0,196, 14, 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,181,184,183,184,188,187, - 230,232,231,167,172,170,139,144,142,184,187,186,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,231,232,232,136,141,139,223,225,225,245,246,245, - 151,156,154,165,169,168,140,145,143,231,232,232,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,152,156,154,178,182,181,247,247,247,142,147,145,156,160,159, - 179,182,181,182,187,185,172,175,174,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,228,229,229,136, - 141,139,217,220,219,239,240,239,171,175,173,184,187,186,179,184,182, - 203,206,205,137,142,140,197,199,198,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,144,148,146,176,181,179,246, - 247,247,155,159,157,202,204,203,255,255,255,141,146,144,201,206,204, - 172,176,175,156,160,159,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,136,141,139,208,212,210,239,240,239,179, - 183,181,255,255,255,255,255,255,225,227,226,167,172,170,195,200,198, - 142,147,145,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,143,148,146,247,247,247,170,173,172,202,204,203,255, - 255,255,255,255,255,255,255,255,152,156,155,208,211,210,169,173,171, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,221,223,222,145,149,148,162,166,165,255,255,255,255,255,255,255, - 255,255,255,255,255,185,187,186,148,152,150,255,255,255,255,255,255, - 255,255,255,255,255,255); - -Const - stdimg_menu_check_16 : Array[0..821] of byte = ( - 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 0, 3, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,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, 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, 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, 0, 0, 0, - 0, 0, 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, 0, 0, 0, 0, 0, 0, - 255, 0,255, 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, 0, 0, 0,255, 0,255,255, 0,255, - 255, 0,255, 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, 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, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 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, 0,127,127,127,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,255,255,255, + 127,127,127,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,255,255,255,127,127,127,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,255,255,255,127,127,127,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,255,255,255,127,127, + 127,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, + 255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, + 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,255, + 255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255, + 255,127,127,127, 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, + 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, + 127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,127,127, + 127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255,255,255,127, + 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, + 191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127, + 127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191, + 255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52, 52, 52, + 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127, + 127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127, + 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,191,191,191,255, + 255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, + 255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, + 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255,255, + 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, + 191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127, + 127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191, + 191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127, + 127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127, + 127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127, + 127, 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,191,191,191, + 255,255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, + 255,255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, + 0, 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255, + 255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255,255, + 127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191, + 191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52, + 52, 52, 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, + 52,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127, + 127,127, 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,191,191, + 191,255,255,255,127,127,127, 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,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, + 0, 0, 0,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127, + 127,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255, + 255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,191,191,191,255,255,255, 0,127,127,127, 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,191,191,191,255,255,255,127,127,127, 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,191,191,191,255,255, + 255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0, + 127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, + 191,191,255,255,255,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,191,191,191,255,255,255,127,127,127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,191,191,191,255,255,255,127,127, + 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,191,191, + 255,255,255,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,191,191,191,255,255,255, 0,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,255,255,255,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,255, + 255,255,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,255,255,255,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,255,255,255,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, + 127,127,127,127,127,127,127,127,127,127,127,127,127,127,255,255,255, + 0); diff --git a/src/corelib/x11/fpg_interface.pas b/src/corelib/x11/fpg_interface.pas index c4adf079..3a1e1920 100644 --- a/src/corelib/x11/fpg_interface.pas +++ b/src/corelib/x11/fpg_interface.pas @@ -33,6 +33,8 @@ type TfpgApplicationImpl = TfpgX11Application; TfpgClipboardImpl = TfpgX11Clipboard; TfpgFileListImpl = TfpgX11FileList; + TfpgMimeDataImpl = TfpgX11MimeData; + TfpgDragImpl = TfpgX11Drag; implementation diff --git a/src/corelib/x11/fpg_utils_impl.inc b/src/corelib/x11/fpg_utils_impl.inc index d8625b8c..753b0ea1 100644 --- a/src/corelib/x11/fpg_utils_impl.inc +++ b/src/corelib/x11/fpg_utils_impl.inc @@ -1,7 +1,7 @@ {%mainunit fpg_utils.pas} uses - Unix; + Unix, BaseUnix, fpg_constants, fpg_stringutils; // X11 specific filesystem implementations of encoding functions @@ -40,3 +40,11 @@ begin fpSystem(Helper + ' ' + aURL + '&'); end; +function fpgFileSize(const AFilename: TfpgString): integer; +var + st: baseunix.stat; +begin + if not fpstat(pointer(AFilename),st) >= 0 then + exit(-1); + Result := st.st_size; +end; diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 3d832130..71f06d39 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -19,7 +19,8 @@ unit fpg_x11; {$mode objfpc}{$H+} -{.$Define DEBUG} +{.$Define DEBUG} // general debugging - mostly OS messages though +{.$Define DNDDEBUG} // drag-n-drop specific debugging { TODO : Compiz effects: Menu popup with correct window hint. Same for Combo dropdown window. } @@ -28,6 +29,7 @@ interface uses Classes, SysUtils, + contnrs, X, Xlib, XUtil, @@ -51,6 +53,11 @@ type TfpgGContext = Xlib.TGc; PInt = ^integer; + TAtomArray = array[0..0] of TAtom; + PAtomArray = ^TAtomArray; + + TWindowArray = array[0..0] of TWindow; + PWindowArray = ^TWindowArray; {$HINTS OFF} TXIC = record @@ -119,6 +126,7 @@ type // forward declaration TfpgX11Window = class; + TfpgX11Drag = class; TfpgX11FontResource = class(TfpgFontResourceBase) @@ -205,6 +213,8 @@ type TfpgX11Window = class(TfpgWindowBase) + private + QueueEnabledDrops: boolean; protected FWinFlags: TXWindowStateFlags; FWinHandle: TfpgWinHandle; @@ -220,6 +230,8 @@ type function DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; override; procedure DoUpdateWindowPosition; override; procedure DoSetMouseCursor; override; + procedure DoDNDEnabled(const AValue: boolean); override; + procedure DoAcceptDrops(const AValue: boolean); override; property WinHandle: TfpgWinHandle read FWinHandle; public constructor Create(AOwner: TComponent); override; @@ -235,9 +247,48 @@ type FComposeBuffer: TfpgString; FComposeStatus: TStatus; FEventFilter: TX11EventFilter; + { XDND type list received from Source window } + FDNDTypeList: TObjectList; + { all XDND atoms } + XdndAware: TAtom; + XdndTypeList: TAtom; + XdndSelection: TAtom; + { XDND client messages } + XdndEnter: TAtom; + XdndPosition: TAtom; + XdndStatus: TAtom; + XdndLeave: TAtom; + XdndDrop: TAtom; + XdndFinished: TAtom; + { XDND actions } + XdndActionCopy: TAtom; + XdndActionMove: TAtom; + XdndActionLink: TAtom; + XdndActionAsk: TAtom; + XdndActionPrivate: TAtom; + { XDND variables } + FActionType: TAtom; + FSrcWinHandle: TfpgWinHandle; + FDNDVersion: integer; + FDNDDataType: TAtom; + FSrcTimeStamp: clong; + FLastDropTarget: TfpgWinHandle; + FDropPos: TPoint; + FDrag: TfpgX11Drag; + procedure SetDrag(const AValue: TfpgX11Drag); function ConvertShiftState(AState: Cardinal): TShiftState; function KeySymToKeycode(KeySym: TKeySym): Word; function StartComposing(const Event: TXEvent): TKeySym; + function GetDropActionFromAtom(const AAtom: TAtom): TfpgDropAction; + function GetAtomFromDropAction(const AAction: TfpgDropAction): TAtom; + procedure XdndInit; + procedure ResetDNDVariables; + procedure HandleDNDenter(ATopLevelWindow: TfpgX11Window; const ASource: TWindow; const ev: TXEvent); + procedure HandleDNDleave(ATopLevelWindow: TfpgX11Window; const ASource: TWindow); + procedure HandleDNDposition(ATopLevelWindow: TfpgX11Window; const ASource: TWindow; const x_root: integer; const y_root: integer; const AAction: TAtom; const ATimestamp: x.TTime); + procedure HandleDNDdrop(ATopLevelWindow: TfpgX11Window; const ASource: TWindow; const ATimestamp: x.TTime); + procedure HandleDNDSelection(const ev: TXEvent); + property Drag: TfpgX11Drag read FDrag write SetDrag; protected FDisplay: PXDisplay; DisplayDepth: integer; @@ -251,8 +302,9 @@ type xia_motif_wm_hints: TAtom; xia_wm_protocols: TAtom; xia_wm_delete_window: TAtom; - netlayer: TNETWindowLayer; + xia_wm_state: TAtom; xia_targets: TAtom; + netlayer: TNETWindowLayer; InputMethod: PXIM; InputContext: PXIC; FLastKeySym: TKeySym; // Used for KeyRelease event @@ -295,6 +347,40 @@ type end; + TfpgX11MimeData = class(TfpgMimeDataBase) + end; + + + TfpgX11Drag = class(TfpgDragBase) + private + FLastTarget: TfpgWinHandle; + FUseVersion: integer; + FTargetIsDNDAware: Boolean; + FStatusPending: Boolean; + FDropAccepted: Boolean; + FProposedAction: TAtom; + FAcceptedAction: TAtom; + FMimeTypesArray: array of TAtom; + xia_plain_text: TAtom; + procedure SetTypeListProperty; + procedure InitializeMimeTypesToAtoms; + procedure Dragging(ev: TXEvent); + function IsDNDAware(win: TWindow): boolean; + procedure SendDNDLeave(ATarget: TWindow); + procedure SendDNDEnter(ATarget: TWindow); + procedure SendDNDPosition(ATarget: TWindow; x_root: cint; y_root: cint; AAction: TAtom; ATime: X.TTime); + procedure SendDNDDrop; + procedure HandleDNDStatus(ATarget: TWindow; AAccept: integer; ARect: TfpgRect; AAction: TAtom); + procedure HandleSelectionRequest(ev: TXEvent); + protected + FSource: TfpgX11Window; + function GetSource: TfpgX11Window; virtual; + public + destructor Destroy; override; + function Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction = daCopy): TfpgDropAction; override; + end; + + function fpgColorToX(col: TfpgColor): longword; @@ -309,13 +395,24 @@ uses fpg_widget, fpg_popupwindow, fpg_stringutils, // used for GetTextWidth + fpg_utils, fpg_form, // for modal event support cursorfont, - xatom; // used for XA_WM_NAME + xatom, // used for XA_WM_NAME + math; + +type + TDNDSrcType = class(TObject) + public + Name: TfpgString; + ID: integer; + end; var xapplication: TfpgApplication; +const + FPG_XDND_VERSION: culong = 4; // our supported XDND version // some externals @@ -335,6 +432,8 @@ function XdbeDeallocateBackBufferName(ADisplay: PXDisplay; ABuffer: TfpgWinHandl function XOpenIM(para1: PDisplay; para2: PXrmHashBucketRec; para3: Pchar; para4: Pchar): PXIM; cdecl; external; function XCreateIC(para1: PXIM; para2: array of const): PXIC; cdecl; external; +const + AltGrMask = 1 shl 13; // missing from X unit function ConvertTo565Pixel(rgb: longword): word; begin @@ -504,9 +603,9 @@ end; procedure ProcessSelection(var ev: TXEvent); var s: string; - actual: TAtom; - format: integer; - count, remaining: longword; + actualformat: TAtom; + actualtype: cint; + count, remaining: culong; data: PChar; begin if ev.xselection._property > 0 then @@ -515,7 +614,7 @@ begin ev.xselection._property, 0, 16000, TBool(false), // delete 0, // type - @actual, @format, @count, @remaining, + @actualformat, @actualtype, @count, @remaining, @data); s := data; @@ -539,7 +638,6 @@ begin e._type := SelectionNotify; e.requestor := ev.xselectionrequest.requestor; e.selection := ev.xselectionrequest.selection; -// e.selection := xapplication.xia_clipboard; e.target := ev.xselectionrequest.target; e.time := ev.xselectionrequest.time; e._property := ev.xselectionrequest._property; @@ -547,18 +645,82 @@ begin if e.target = xapplication.xia_targets then begin a := XA_STRING; - XChangeProperty(xapplication.Display, e.requestor, e._property, - XA_ATOM, 32, PropModeReplace, PByte(@a), Sizeof(TAtom)); // I think last parameter is right? + XChangeProperty(xapplication.Display, e.requestor, e._property, XA_ATOM, + 32, PropModeReplace, PByte(@a), Sizeof(TAtom)); // I think last parameter is right? end else begin XChangeProperty(xapplication.Display, e.requestor, e._property, e.target, - 8, 0, PByte(@fpgClipboard.FClipboardText[1]), Length(fpgClipboard.FClipboardText)); + 8, PropModeReplace, PByte(@fpgClipboard.FClipboardText[1]), Length(fpgClipboard.FClipboardText)); end; XSendEvent(xapplication.Display, e.requestor, false, 0, @e ); end; +function IsTopLevel(AWin: TWindow): Boolean; +var + actualtype: TAtom = None; + actualformat: cint; + count, remaining: culong; + data: pchar = nil; +begin + XGetWindowProperty(xapplication.Display, AWin, xapplication.xia_wm_state, 0, 0, + TBool(False), AnyPropertyType, @actualtype, @actualformat, @count, + @remaining, @data); + if data <> nil then + XFree(data); + Result := actualtype <> None; +end; + +{ find toplevel window that contains mouse co-ordinates x, y (co-ordinates are + from root window) } +function FindWindow(ARoot: TWindow; const x, y: cint): TWindow; +var + wattr: TXWindowAttributes; + r, p: TWindow; + children: PWindowArray = nil; + numchildren: cuint = 0; + i: integer; +begin + XGetWindowAttributes(xapplication.Display, ARoot, @wattr); + if (wattr.map_state <> IsUnmapped) and + ((x >= wattr.x) and (x < (wattr.x + wattr.width))) and + ((y >= wattr.y) and (y < (wattr.y + wattr.height))) then + begin + // mapped and inside, is it a top-level? + if (IsTopLevel(ARoot)) then + begin + Result := ARoot; + exit; + end; + if XQueryTree(xapplication.Display, ARoot, @r, @p, @children, @numchildren) <> 0 then + begin + if (numchildren > 0) then + begin + r := None; + { upon return from XQueryTree, children are listed in the current + stacking order, from bottom-most (first) to top-most (last) } + for i := numchildren-1 downto 0 do + begin + r := FindWindow(children^[i], x - wattr.x, y - wattr.y); + if r <> None then + break; + end; + + XFree(children); + if r <> None then + begin + Result := r; + exit; + end; + Result := ARoot; // a fallback Result - we should never get here though + end; + end; + end + else + Result := None; +end; + // File utils function ExtractTargetSymLinkPath(ALink: string): string; begin @@ -573,6 +735,13 @@ end; { TfpgX11Application } +procedure TfpgX11Application.SetDrag(const AValue: TfpgX11Drag); +begin + if Assigned(FDrag) then + FDrag.Free; + FDrag := AValue; +end; + function TfpgX11Application.ConvertShiftState(AState: Cardinal): TShiftState; begin Result := []; @@ -592,11 +761,12 @@ begin Include(Result, ssAlt); if (AState and Mod2Mask) <> 0 then Include(Result, ssNum); - if (AState and Mod4Mask) <> 0 then + { NOTE: Mod3Mask is normally unused for some reason } + if (AState and Mod4Mask) <> 0 then { aka "Windows key" } Include(Result, ssSuper); if (AState and Mod5Mask) <> 0 then Include(Result, ssScroll); - if (AState and (1 shl 13)) <> 0 then + if (AState and AltGrMask) <> 0 then Include(Result, ssAltGr); end; @@ -627,7 +797,7 @@ begin 0..Ord('a')-1, Ord('z')+1..$bf, $f7: Result := KeySym; Ord('a')..Ord('z'), $c0..$f6, $f8..$ff: - Result := KeySym - 32; + Result := KeySym - 32; // ignore case: convert lowercase a-z to A-Z keysyms; $20a0..$20ac: Result := Table_20aX[KeySym]; $fe20: Result := keyTab; $fe50..$fe60: Result := Table_feXX[KeySym]; @@ -685,6 +855,424 @@ begin Length(FComposeBuffer), @Result, @FComposeStatus); end; +function TfpgX11Application.GetDropActionFromAtom(const AAtom: TAtom): TfpgDropAction; +begin + if AAtom = XdndActionCopy then + Result := daCopy + else if AAtom = XdndActionMove then + Result := daMove + else if AAtom = XdndActionLink then + Result := daLink + else + Result := daCopy; { the safe fallback option } +end; + +function TfpgX11Application.GetAtomFromDropAction(const AAction: TfpgDropAction): TAtom; +begin + case AAction of + daCopy: Result := XdndActionCopy; + daMove: Result := XdndActionMove; + daLink: Result := XdndActionLink; + else + Result := XdndActionCopy; { the safe fallback option } + end; +end; + +procedure TfpgX11Application.XdndInit; +begin + XdndAware := XInternAtom(FDisplay, 'XdndAware', False); + XdndTypeList := XInternAtom(FDisplay, 'XdndTypeList', False); + XdndSelection := XInternAtom(FDisplay, 'XdndSelection', False); + + // client messages + XdndEnter := XInternAtom(FDisplay, 'XdndEnter', False); + XdndPosition := XInternAtom(FDisplay, 'XdndPosition', False); + XdndStatus := XInternAtom(FDisplay, 'XdndStatus', False); + XdndLeave := XInternAtom(FDisplay, 'XdndLeave', False); + XdndDrop := XInternAtom(FDisplay, 'XdndDrop', False); + XdndFinished := XInternAtom(FDisplay, 'XdndFinished', False); + + // actions + XdndActionCopy := XInternAtom(FDisplay, 'XdndActionCopy', False); + XdndActionMove := XInternAtom(FDisplay, 'XdndActionMove', False); + XdndActionLink := XInternAtom(FDisplay, 'XdndActionLink', False); + XdndActionAsk := XInternAtom(FDisplay, 'XdndActionAsk', False); + XdndActionPrivate := XInternAtom(FDisplay, 'XdndActionPrivate', False); +end; + +procedure TfpgX11Application.ResetDNDVariables; +var + msgp: TfpgMessageParams; +begin + if FLastDropTarget <> 0 then + begin + fillchar(msgp, sizeof(msgp), 0); + fpgPostMessage(nil, FindWindowByHandle(FLastDropTarget), FPGM_DROPEXIT, msgp); + end; + FDNDTypeList.Clear; + FActionType := 0; + FSrcWinHandle := 0; + FLastDropTarget := 0; + FDropPos.X := 0; + FDropPos.Y := 0; +end; + +procedure TfpgX11Application.HandleDNDenter(ATopLevelWindow: TfpgX11Window; + const ASource: TWindow; const ev: TXEvent); +var + actualtype: TAtom; + actualformat: cint; + count, remaining: culong; + xdndtypes: PAtomArray; + i: integer; + s: TfpgString; + itm: TDNDSrcType; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Application.HandleDNDenter'); + {$ENDIF} + ResetDNDVariables; + FSrcWinHandle := ASource; + FDNDVersion := min(FPG_XDND_VERSION, (ev.xclient.data.l[1] and $FF000000) shr 24); + {$IFDEF DNDDEBUG} + writeln(Format(' ver(%d) check-XdndTypeList(%s) data=%xh,%d,%d,%d,%d', + [ FDNDVersion, + BoolToStr(fpgIsBitSet(ev.xclient.data.l[1], 0), True), + ev.xclient.data.l[0], + ev.xclient.data.l[1], + ev.xclient.data.l[2], + ev.xclient.data.l[3], + ev.xclient.data.l[4] ])); + writeln(Format(' * We will be using XDND v%d protocol *', [FDNDVersion])); + if fpgIsBitSet(ev.xclient.data.l[1], 0) then + writeln(' ** We need to fetch XdndTypeList (>3 types)'); + {$ENDIF} + + // read typelist + if fpgIsBitSet(ev.xclient.data.l[1], 0) then + begin + // now fetch the data + XGetWindowProperty(Display, FSrcWinHandle, + XdndTypeList, 0, 16000, + TBool(False), + AnyPropertyType, + @actualtype, @actualformat, @count, @remaining, + @xdndtypes); + + {$IFDEF DNDDEBUG} + s := XGetAtomName(Display, actualtype); + writeln('Actual fetch -----------------------'); + writeln(Format(' ActualType: %s (%d)', [s, ActualType])); + writeln(' Actualformat = ', ActualFormat); + writeln(' count = ', count); + writeln(' remaining = ', remaining); + {$ENDIF} + + if (actualtype <> XA_ATOM) or (actualformat <> 32) then + count := 0; + end + else + begin + count := 3; + xdndtypes := @ev.xclient.data.l[2]; + end; + + for i := 0 to count-1 do + begin + if xdndtypes^[i] <> 0 then + begin + s := XGetAtomName(FDisplay, xdndtypes^[i]); + {$IFDEF DNDDEBUG} + writeln(Format(' Format #%d = %s (%d)', [i+1, s, xdndtypes^[i]])); + {$ENDIF} + // store each supported data type for later use + itm := TDNDSrcType.Create; + itm.Name := s; + itm.ID := xdndtypes^[i]; + FDNDTypeList.Add(itm); + end; + end; + if count > 3 then + XFree(xdndtypes); +end; + +procedure TfpgX11Application.HandleDNDleave(ATopLevelWindow: TfpgX11Window; + const ASource: TWindow); +var + wg: TfpgWidget; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Application.HandleDNDleave'); + {$ENDIF} + if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window } + begin + wg := FindWindowByHandle(FLastDropTarget) as TfpgWidget; + if wg.AcceptDrops then + begin + if Assigned(wg.OnDragLeave) then + wg.OnDragLeave(wg); + end; + end; + ResetDNDVariables; +end; + +procedure TfpgX11Application.HandleDNDposition(ATopLevelWindow: TfpgX11Window; const ASource: TWindow; + const x_root: integer; const y_root: integer; const AAction: TAtom; const ATimestamp: x.TTime); +var + Msg: TXEvent; + dx, dy, dx2, dy2: cint; + child: TWindow; + prevchild: TWindow; + + ret_root: TfpgWinHandle; + ret_child: TfpgWinHandle; + root_x, root_y: integer; + child_x, child_y: integer; + + s: string; + i: integer; + lTargetWinHandle: TWindow; + w: TfpgX11Window; + wg: TfpgWidget; + wg2: TfpgWidget; + msgp: TfpgMessageParams; + lDragEnterEvent: TfpgDragEnterEvent; + lDropAction: TfpgDropAction; + lAccept: Boolean; + lMimeChoice: TfpgString; + lMimeList: TStringList; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Application.HandleDNDposition (toplevel window = ', ATopLevelWindow.Name, ')'); + {$ENDIF} + lAccept := False; + FSrcWinHandle := ASource; + FActionType := AAction; + FSrcTimeStamp := ATimeStamp; + lTargetWinHandle := ATopLevelWindow.WinHandle; + lMimeChoice := 'text/plain'; + + {$IFDEF DNDDEBUG} + s := XGetAtomName(FDisplay, AAction); + writeln(Format(' requested action: %s (%d)', [s, AAction])); + writeln(' x_root: ', x_root, ' y_root: ', y_root); + {$ENDIF} + + // Find window under cursor, and position of cursor inside that window + XTranslateCoordinates(FDisplay, XDefaultRootWindow(FDisplay), ATopLevelWindow.WinHandle, + x_root, y_root, @dx, @dy, @ret_child); + child := ret_child; + prevchild := ATopLevelWindow.WinHandle; + while ret_child <> 0 do // If we have chidren, iterate until we reach the top most child + begin + child := ret_child; + dx2 := dx; + dy2 := dy; + XTranslateCoordinates(FDisplay, prevchild, child, + dx2, dy2, @dx, @dy, @ret_child); + prevchild := child; + end; + + if child <> 0 then + w := FindWindowByHandle(child) + else + w := ATopLevelWindow; + + {$IFDEF DNDDEBUG} + writeln(Format('x:%d y:%d child:%d (%x)', [dx, dy, w.WinHandle, w.WinHandle])); + {$ENDIF} + + if Assigned(w) then + begin + lTargetWinHandle := w.WinHandle; + {$IFDEF DNDDEBUG} + writeln('dragging over window: ', w.Name); + {$ENDIF} + if w is TfpgWidget then // TODO: We could use Interfaces here eg: IDragDropEnabled + begin + wg := TfpgWidget(w); + if FLastDropTarget <> lTargetWinHandle then + begin + if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window } + begin + wg2 := FindWindowByHandle(FLastDropTarget) as TfpgWidget; + if wg2.AcceptDrops then + begin + if Assigned(wg2.OnDragLeave) then + wg2.OnDragLeave(wg2); + end; + fillchar(msgp, sizeof(msgp), 0); + { Notify the widget so it can reset its looks if needed } + fpgPostMessage(nil, wg2, FPGM_DROPEXIT, msgp); + end; + end; + FLastDropTarget := lTargetWinHandle; + if wg.AcceptDrops then + begin + if Assigned(wg.OnDragEnter) then + begin + lDropAction := GetDropActionFromAtom(AAction); + lMimeList := TStringList.Create; + for i := 0 to FDNDTypeList.Count-1 do + lMimeList.Add(TDNDSrcType(FDNDTypeList[i]).Name); + + { Use the first mime-type as the default option presented. The mime-list + should always be from most specific to least specific. } + if lMimeList.Count > 0 then + lMimeChoice := lMimeList[0] + else + {$NOTE We need to replace this message with a resouce string } + raise Exception.Create('fpGUI/X11: no mime types available for DND operation'); + + { TODO: We need to populate the Source parameter. } + wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept); + lMimeList.Free; + FActionType := GetAtomFromDropAction(lDropAction); + end; + + { Notify widget of drag status, so it can update its look } + if lAccept then + begin + FDropPos.X := dx; + FDropPos.Y := dy; + fillchar(msgp, sizeof(msgp), 0); + msgp.mouse.x := dx; + msgp.mouse.y := dy; + fpgPostMessage(nil, w, FPGM_DROPENTER, msgp); + end; + end; + end; + end; + + FDNDDataType := None; + for i := 0 to FDNDTypeList.Count-1 do + begin + { This list must be from most specific to least specific } + if TDNDSrcType(FDNDTypeList[i]).Name = lMimeChoice then + begin + FDNDDataType := TDNDSrcType(FDNDTypeList[i]).ID; + break; + end; + end; + + // send message to confirm drop will be accepted in specified rectangle + FillChar(Msg, SizeOf(Msg), 0); + Msg.xany._type := ClientMessage; + Msg.xany.display := FDisplay; + Msg.xclient.window := FSrcWinHandle; // source winhandle msg is going to + Msg.xclient.message_type := XdndStatus; + Msg.xclient.format := 32; + + Msg.xclient.data.l[0] := ATopLevelWindow.WinHandle; // always top-level window + if lAccept then + begin + Msg.xclient.data.l[1] := 1; + Msg.xclient.data.l[4] := FActionType; + end + else + begin + Msg.xclient.data.l[1] := 0; + Msg.xclient.data.l[4] := None; + end; + Msg.xclient.data.l[2] := 0; // x & y co-ordinates + Msg.xclient.data.l[3] := 0; // w & h co-ordinates + + XSendEvent(FDisplay, FSrcWinHandle, False, NoEventMask, @Msg); +end; + +procedure TfpgX11Application.HandleDNDdrop(ATopLevelWindow: TfpgX11Window; + const ASource: TWindow; const ATimestamp: x.TTime); +var + Msg: TXEvent; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Application.HandleDNDdrop'); + {$ENDIF} + { TODO: Must XConvertSelection always be called? } + if FDNDDataType <> None then + XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp); + + { send message to signal drop is finished } + FillChar(Msg, SizeOf(Msg), 0); + Msg.xany._type := ClientMessage; + Msg.xany.display := FDisplay; + Msg.xclient.window := FSrcWinHandle; // source winhandle msg is going to + Msg.xclient.message_type := XdndFinished; + Msg.xclient.format := 32; + + Msg.xclient.data.l[0] := ATopLevelWindow.FWinHandle; // winhandle of target window + if FDNDDataType = None then + Msg.xclient.data.l[1] := 0 // drop NOT accepted + else + Msg.xclient.data.l[1] := 1; // drop accepted - target can remove the data + Msg.xclient.data.l[2] := FActionType; // this should be the action we accepted + + XSendEvent(FDisplay, FSrcWinHandle, False, NoEventMask, @Msg); +end; + +procedure TfpgX11Application.HandleDNDSelection(const ev: TXEvent); +var + actualtype: TAtom; + actualformat: cint; + count, remaining, dummy: culong; + s: variant; + data: PChar; + wg: TfpgWidget; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Application.HandleDNDselection'); + {$ENDIF} + if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window } + begin + wg := FindWindowByHandle(FLastDropTarget) as TfpgWidget; + if not wg.AcceptDrops then + Exit; + end; + + { do not get data yet, just see how much there is } + XGetWindowProperty(FDisplay, ev.xselection.requestor, + ev.xselection._property, 0, 0, + TBool(false), + AnyPropertyType, + @actualtype, @actualformat, @count, @remaining, + @data); + + { we handle the DND selection here } + {$IFDEF DNDDEBUG} + s := XGetAtomName(FDisplay, actualtype); + writeln(Format(' ActualType: %s (%d)', [s, ActualType])); + writeln(' Actualformat = ', ActualFormat); + writeln(' count = ', count); + writeln(' remaining = ', remaining); + writeln('-----------------'); + {$ENDIF} + + if remaining > 0 then { we have data - now fetch it! } + begin + XGetWindowProperty(FDisplay, ev.xselection.requestor, + ev.xselection._property, 0, remaining, + TBool(false), + AnyPropertyType, + @actualtype, @actualformat, @count, @dummy, + @data); + s := data; + end; + + if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window } + begin + wg := FindWindowByHandle(FLastDropTarget) as TfpgWidget; + if wg.AcceptDrops then + begin + if Assigned(wg.OnDragDrop) then + wg.OnDragDrop(nil, nil, FDropPos.X, FDropPos.Y, s); + end; + end; + {$IFDEF DNDDEBUG} + writeln(' s = ', s); + {$ENDIF} + ResetDNDVariables; +end; + function TfpgX11Application.DoGetFontFaceList: TStringList; var pfs: PFcFontSet; @@ -740,11 +1328,16 @@ begin DefaultColorMap := XDefaultColorMap(FDisplay, DefaultScreen); // Initialize atoms - xia_clipboard := XInternAtom(FDisplay, 'CLIPBOARD', longbool(0)); - xia_targets := XInternAtom(FDisplay, 'TARGETS', longbool(0)); - xia_motif_wm_hints := XInternAtom(FDisplay, '_MOTIF_WM_HINTS', longbool(0)); - xia_wm_protocols := XInternAtom(FDisplay, 'WM_PROTOCOLS', longbool(0)); - xia_wm_delete_window := XInternAtom(FDisplay, 'WM_DELETE_WINDOW', longbool(0)); + xia_clipboard := XInternAtom(FDisplay, 'CLIPBOARD', TBool(False)); + xia_targets := XInternAtom(FDisplay, 'TARGETS', TBool(False)); + xia_motif_wm_hints := XInternAtom(FDisplay, '_MOTIF_WM_HINTS', TBool(False)); + xia_wm_protocols := XInternAtom(FDisplay, 'WM_PROTOCOLS', TBool(False)); + xia_wm_delete_window := XInternAtom(FDisplay, 'WM_DELETE_WINDOW', TBool(False)); + xia_wm_state := XInternAtom(FDisplay, 'WM_STATE', TBool(False)); + + { initializa the XDND atoms } + FDNDTypeList := TObjectList.Create; + XdndInit; netlayer := TNETWindowLayer.Create(FDisplay); @@ -764,7 +1357,7 @@ destructor TfpgX11Application.Destroy; begin netlayer.Free; XCloseDisplay(FDisplay); - + FDNDTypeList.Free; inherited Destroy; end; @@ -778,7 +1371,7 @@ var rootw: TfpgWinHandle; parentw: TfpgWinHandle; childs: ^TfpgWinHandle; - cnum: longword; + cnum: cuint; begin childs := nil; if XQueryTree(xapplication.display, wh, @rootw, @parentw, @childs, @cnum) <> 0 then @@ -852,7 +1445,6 @@ var xfd: integer; KeySym: TKeySym; Popup: TfpgWidget; - status: TStatus; needToWait: boolean; // debug purposes only @@ -890,7 +1482,7 @@ var procedure ReportLostWindow(const event: TXEvent); begin {$IFDEF DEBUG} - writeln('fpGFX/X11: ', GetXEventName(event._type), ' can''t find <', + writeln('fpGUI/X11: ', GetXEventName(event._type), ' can''t find <', IntToHex(event.xany.window, 9), '>'); {$ENDIF} end; @@ -1063,6 +1655,19 @@ begin ClosePopups; end; end; + end + else + begin + if Assigned(Drag) then // button released + begin + Drag.SendDNDDrop; + { TODO: Start timeout in case XdndFinished is not received, so we can free Drag } +// writeln('Freeing Drag Object'); + if not Drag.FDropAccepted then + begin + FreeAndNil(FDrag); + end; + end; end; w := FindWindowByHandle(ev.xbutton.window); // restore w @@ -1143,34 +1748,41 @@ begin until not XCheckTypedWindowEvent(display, ev.xmotion.window, X.MotionNotify, @ev); w := FindWindowByHandle(ev.xmotion.window); if not Assigned(w) then - ReportLostWindow(ev); - if xapplication.TopModalForm <> nil then - begin - ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); - if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then - blockmsg := true; - end; - if not blockmsg then + ReportLostWindow(ev) + else begin - msgp.mouse.x := ev.xmotion.x; - msgp.mouse.y := ev.xmotion.y; - msgp.mouse.Buttons := (ev.xmotion.state and $FF00) shr 8; - msgp.mouse.shiftstate := ConvertShiftState(ev.xmotion.state); - fpgPostMessage(nil, FindWindowByHandle(ev.xmotion.window), FPGM_MOUSEMOVE, msgp); + if Assigned(Drag) then + begin + if ((ev.xmotion.state and $FF00) shr 8) = MOUSE_LEFT then + Drag.Dragging(ev); + end; + if xapplication.TopModalForm <> nil then + begin + ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); + if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then + blockmsg := true; + end; + if not blockmsg then + begin + msgp.mouse.x := ev.xmotion.x; + msgp.mouse.y := ev.xmotion.y; + msgp.mouse.Buttons := (ev.xmotion.state and $FF00) shr 8; + msgp.mouse.shiftstate := ConvertShiftState(ev.xmotion.state); + fpgPostMessage(nil, w, FPGM_MOUSEMOVE, msgp); + end; end; end; - // message blockings for modal windows + { one use is for message blockings for modal windows, or XDND etc. } X.ClientMessage: begin - w := FindWindowByBackupHandle(ev.xclient.window); + w := FindWindowByHandle(ev.xclient.window); if not Assigned(w) then ReportLostWindow(ev); // WM_PROTOCOLS message if Assigned(w) and (ev.xclient.message_type = xia_wm_protocols) then begin - //WriteLn(XGetAtomName(FDisplay, TAtom(ev.xclient.data.l[0]))); if (ev.xclient.data.l[0] = netlayer.NetAtom[naWM_PING]) then begin // always respond to pings or the wm will kill us @@ -1182,14 +1794,86 @@ begin begin // This is ugly!!!!!!!!!!!!!!! ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); - if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then + if (ew <> nil) and (TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then blockmsg := true; end; if not blockmsg then fpgPostMessage(nil, FindWindowByHandle(ev.xclient.window), FPGM_CLOSE); end; - end; // WM_PROTOCOLS + end + { XDND protocol - XdndEnter } + else if Assigned(w) and (ev.xclient.message_type = XdndEnter) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndEnter event received'); + {$ENDIF} + HandleDNDenter(w, ev.xclient.data.l[0], ev); + end + { XDND protocol - XdndPosition } + else if Assigned(w) and (ev.xclient.message_type = XdndPosition) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndPosition event received'); + {$ENDIF} + HandleDNDposition(w, // top level window + ev.xclient.data.l[0], // Source window + (ev.xclient.data.l[2] and $FFFF0000) shr 16, // x_root + ev.xclient.data.l[2] and $0000FFFF, // y_root + ev.xclient.data.l[4], // action + ev.xclient.data.l[3]); // timestamp + end + { XDND protocol - XdndStatus } + else if Assigned(w) and (ev.xclient.message_type = XdndStatus) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndStatus event received'); + {$ENDIF} + if Assigned(Drag) then + begin + Drag.HandleDNDStatus( + ev.xclient.data.l[0], + ev.xclient.data.l[1] and 1, + fpgRect( + (ev.xclient.data.l[2] shr 16) and $FFFF, + ev.xclient.data.l[2] and $FFFF, + (ev.xclient.data.l[3] shr 16) and $FFFF, + ev.xclient.data.l[3] and $FFFF), + ev.xclient.data.l[4]); + end; + end + { XDND protocol - XdndLeave } + else if Assigned(w) and (ev.xclient.message_type = XdndLeave) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndLeave event received'); + {$ENDIF} + HandleDNDleave(w, ev.xclient.data.l[0]); + end + { XDND protocol - XdndDrop } + else if Assigned(w) and (ev.xclient.message_type = XdndDrop) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndDrop event received'); + writeln(' ClassName = ', w.ClassName); + writeln(' Name = ', w.Name); + {$ENDIF} + HandleDNDdrop(w, ev.xclient.data.l[0], ev.xclient.data.l[2]); + end + { XDND protocol - XdndFinished } + else if Assigned(w) and (ev.xclient.message_type = XdndFinished) then + begin + {$IFDEF DNDDEBUG} + writeln('ClientMessage.XdndFinished event received'); + {$ENDIF} + if Assigned(Drag) then + begin + {$IFDEF DNDDEBUG} + writeln('Freeing Drag Object'); + {$ENDIF} + FreeAndNil(FDrag); + end; + end; end; X.ConfigureNotify: @@ -1230,12 +1914,35 @@ begin X.SelectionNotify: begin - ProcessSelection(ev); + { Handle XDND data } + if ev.xselection._property = XdndSelection then + begin + {$IFDEF DNDDEBUG} + writeln('XdndSelection message received'); + {$ENDIF} + HandleDNDSelection(ev); + end + else { Handle X Selections - clipboard data } + ProcessSelection(ev); end; X.SelectionRequest: begin - ProcessSelectionRequest(ev); + if ev.xselectionrequest.selection = XdndSelection then + begin + {$IFDEF DNDDEBUG} + writeln('found a XdndSelection request'); + {$ENDIF} + if Assigned(Drag) then + Drag.HandleSelectionRequest(ev); + end + else + begin + {$IFDEF DEBUG} + writeln('found a clipboard selection request'); + {$ENDIF} + ProcessSelectionRequest(ev); + end; end; X.SelectionClear: @@ -1265,6 +1972,18 @@ begin w := FindWindowByHandle(ev.xmap.window); if w <> nil then Include(w.FWinFlags, xwsfMapped); + + { X11 is too efficient, so new windows don't need a OnResize when mapped, + but because Windows GDI does so, we want the same events under X11. + Lets fake one. } + if w <> nil then + begin + msgp.rect.Left := w.Left; + msgp.rect.Top := w.Top; + msgp.rect.Width := w.Width; + msgp.rect.Height := w.Height; + fpgPostMessage(nil, w, FPGM_RESIZE, msgp); + end; end; X.UnmapNotify: @@ -1303,7 +2022,7 @@ begin end; else - WriteLn('fpGFX/X11: Unhandled X11 event received: ', GetXEventName(ev._type)); + WriteLn('fpGUI/X11: Unhandled X11 event received: ', GetXEventName(ev._type)); end; end; @@ -1425,6 +2144,12 @@ begin fpgApplication.netlayer.WindowSetSupportPING(FWinHandle); XFree(WMHints); + + { we need to set the XdndAware property } + if QueueEnabledDrops then + begin + DoDNDEnabled(True); + end; end; hints.flags := 0; @@ -1476,6 +2201,8 @@ begin lmwh := 0; if fpgApplication.PrevModalForm <> nil then lmwh := TfpgX11Window(fpgApplication.PrevModalForm).WinHandle + else if FocusRootWidget <> nil then + lmwh := TfpgX11Window(FocusRootWidget).WinHandle else if fpgApplication.MainForm <> nil then lmwh := TfpgX11Window(fpgApplication.MainForm).WinHandle; if lmwh <> 0 then @@ -1494,7 +2221,7 @@ begin if ((FWindowType = wtWindow) or (FWindowType = wtModalForm)) and (waBorderless in FWindowAttributes) and not (waX11SkipWMHints in FWindowAttributes) then begin prop := X.None; - prop := XInternAtom(xapplication.display, '_MOTIF_WM_INFO', longbool(0)); + prop := XInternAtom(xapplication.display, '_MOTIF_WM_INFO', TBool(False)); if prop = X.None then begin // writeln('Window Manager does not support MWM hints. Bypassing window manager control for borderless window.'); @@ -1633,6 +2360,8 @@ begin end; case FMouseCursor of + mcDefault: shape := XC_left_ptr; + mcArrow: shape := XC_arrow; mcSizeEW: shape := XC_sb_h_double_arrow; mcSizeNS: shape := XC_sb_v_double_arrow; mcIBeam: shape := XC_xterm; @@ -1644,6 +2373,8 @@ begin mcCross: shape := XC_crosshair; mcHourGlass: shape := XC_watch; mcHand: shape := XC_hand2; + mcDrag: shape := XC_target; + mcNoDrop: shape := XC_pirate; else shape := XC_left_ptr; //XC_arrow; end; @@ -1655,6 +2386,25 @@ begin FMouseCursorIsDirty := False; end; +procedure TfpgX11Window.DoDNDEnabled(const AValue: boolean); +begin + // notify XDND protocol that we can handle DND + if AValue then + begin + if HasHandle then + XChangeProperty(xapplication.Display, WinHandle, xapplication.XdndAware, XA_ATOM, 32, PropModeReplace, @FPG_XDND_VERSION, 1) + else + QueueEnabledDrops := True; // we need to do this once we have a winhandle + end + else + XDeleteProperty(xapplication.Display, WinHandle, xapplication.XdndAware); +end; + +procedure TfpgX11Window.DoAcceptDrops(const AValue: boolean); +begin + { TODO : Remove EnableDrops, then recurse from here to parent top level from, and set XDNDAware property for form. } +end; + procedure TfpgX11Window.DoSetWindowTitle(const ATitle: string); var tp: TXTextProperty; @@ -1680,6 +2430,7 @@ begin inherited Create(AOwner); FWinHandle := 0; FBackupWinHandle := 0; + QueueEnabledDrops := False; end; procedure TfpgX11Window.ActivateWindow; @@ -2358,7 +3109,7 @@ procedure TfpgX11Clipboard.DoSetText(const AValue: TfpgString); begin FClipboardText := AValue; XSetSelectionOwner(xapplication.Display, xapplication.xia_clipboard, - FClipboardWndHandle, 0); + FClipboardWndHandle, CurrentTime); end; procedure TfpgX11Clipboard.InitClipboard; @@ -2450,6 +3201,321 @@ begin end; +{ TfpgX11Drag } + +procedure TfpgX11Drag.SetTypeListProperty; +begin + XChangeProperty(xapplication.Display, FSource.WinHandle, + xapplication.XdndTypeList, XA_ATOM, 32, + PropModeReplace, @FMimeTypesArray[0], Length(FMimeTypesArray)); +end; + +procedure TfpgX11Drag.InitializeMimeTypesToAtoms; +var + sl: TStringList; + i: integer; + a: TAtom; + s: PChar; +begin + { free old array } + SetLength(FMimeTypesArray, 0); + { set size of new array. Extra element for the terminating x.None value } + SetLength(FMimeTypesArray, FMimedata.Count+1); + + sl := FMimeData.Formats as TStringList; + try + for i := 0 to FMimeData.Count-1 do + begin + s := PChar(sl[i]); + a := XInternAtom(xapplication.Display, s, TBool(False)); + FMimeTypesArray[i] := a; + end; + FMimeTypesArray[i+1] := x.None; // termination value + finally + sl.Free; + end; +end; + +procedure TfpgX11Drag.Dragging(ev: TXEvent); +var + dx, dy: cint; + child: TWindow; + lTarget: TWindow; +begin + lTarget := FindWindow(ev.xmotion.root, ev.xmotion.x_root, ev.xmotion.y_root); + if FLastTarget <> lTarget then + begin + if FLastTarget <> 0 then { meaning we had a target before } + SendDNDLeave(FLastTarget); + + FLastTarget := lTarget; + FTargetIsDNDAware := IsDNDAware(lTarget); + {$IFDEF DNDDEBUG} + writeln('IsDNDAware = ', BoolToStr(FTargetIsDNDAware, True)); + {$ENDIF} + FStatusPending := False; + FDropAccepted := False; + FAcceptedAction := X.None; + + if FTargetIsDNDAware then + SendDNDEnter(FLastTarget); + end; + + if FTargetIsDNDAware and not FStatusPending then + begin + SendDNDPosition(FLastTarget, ev.xmotion.x_root, ev.xmotion.y_root, + FProposedAction, ev.xmotion.time); + // this is to avoid sending XdndPosition messages over and over + // if the target is not responding + FStatusPending := True; + end; +end; + +function TfpgX11Drag.IsDNDAware(win: TWindow): boolean; +var + actualtype: TAtom; + actualformat: cint; + count, remaining, dummy: culong; + s: TfpgString; + data: PChar; + lversion: culong; +begin + if (win = None) then + begin + Result := False; + exit; + end; + XGetWindowProperty(xapplication.Display, win, xapplication.XdndAware, 0, $8000000, + TBool(False), XA_ATOM, @actualtype, @actualformat, @count, @remaining, @data); + + if count = 0 then + begin + if data <> nil then + XFree(data); + Result := False; + exit; + end; + + lversion := Integer(data[0]); + FUseVersion := min(Integer(FPG_XDND_VERSION), Integer(lversion)); + Result := True; + + {$IFDEF DNDDEBUG} + writeln(Format('IsDNDAware theirs:%d ours:%d using:%d', [lversion, FPG_XDND_VERSION, FUseVersion])); + {$ENDIF} +end; + +procedure TfpgX11Drag.SendDNDLeave(ATarget: TWindow); +var + xev: TXEvent; +begin + xev.xany._type := X.ClientMessage; + xev.xany.display := xapplication.Display; + xev.xclient.window := ATarget; + xev.xclient.message_type := xapplication.XdndLeave; + xev.xclient.format := 32; + + xev.xclient.data.l[0] := FSource.WinHandle; + xev.xclient.data.l[1] := 0; + + xev.xclient.data.l[2] := 0; + xev.xclient.data.l[3] := 0; + xev.xclient.data.l[4] := 0; + + XSendEvent(xapplication.Display, ATarget, False, NoEventMask, @xev); +end; + +procedure TfpgX11Drag.SendDNDEnter(ATarget: TWindow); +var + xev: TXEvent; + i, n: integer; + s: PChar; + sl: TStrings; +begin + xev.xany._type := X.ClientMessage; + xev.xany.display := xapplication.Display; + xev.xclient.window := ATarget; + xev.xclient.message_type := xapplication.XdndEnter; + xev.xclient.format := 32; + + xev.xclient.data.l[0] := FSource.WinHandle; + + n := FMimeData.Count; + + if n > 3 then + i := 1 + else + i := 0; + xev.xclient.data.l[1] := i or (FUseVersion shl 24); + + if n <= 3 then + begin + for i := 0 to 2 do + begin + if i < n then + xev.xclient.data.l[2+i] := FMimeTypesArray[i] + else + xev.xclient.data.l[2+i] := x.None; + end; + end + else + begin + { available types are in the XdndTypeList property instead } + xev.xclient.data.l[2] := x.None; + xev.xclient.data.l[3] := x.None; + xev.xclient.data.l[4] := x.None; + end; + + XSendEvent(xapplication.Display, ATarget, False, NoEventMask, @xev); +end; + +procedure TfpgX11Drag.SendDNDPosition(ATarget: TWindow; x_root: cint; + y_root: cint; AAction: TAtom; ATime: X.TTime); +var + xev: TXEvent; +begin + xev.xany._type := X.ClientMessage; + xev.xany.display := xapplication.Display; + xev.xclient.window := ATarget; + xev.xclient.message_type := xapplication.XdndPosition; + xev.xclient.format := 32; + + xev.xclient.data.l[0] := FSource.WinHandle; + xev.xclient.data.l[1] := 0; + + xev.xclient.data.l[2] := (x_root shl 16) or y_root; // root coordinates + xev.xclient.data.l[3] := ATime; // timestamp for retrieving data + xev.xclient.data.l[4] := AAction; // requested action + + XSendEvent(xapplication.Display, ATarget, False, NoEventMask, @xev); +end; + +procedure TfpgX11Drag.SendDNDDrop; +var + xev: TXEvent; +begin + if FDropAccepted then + begin + xev.xany._type := X.ClientMessage; + xev.xany.display := xapplication.Display; + xev.xclient.window := FLastTarget; + xev.xclient.message_type := xapplication.XdndDrop; + xev.xclient.format := 32; + + xev.xclient.data.l[0] := FSource.WinHandle; // from; + xev.xclient.data.l[1] := 0; // reserved + xev.xclient.data.l[2] := CurrentTime; // timestamp + xev.xclient.data.l[3] := 0; + xev.xclient.data.l[4] := 0; + + XSendEvent(xapplication.Display, FLastTarget, False, NoEventMask, @xev); + end + else + SendDNDLeave(FLastTarget); + FSource.MouseCursor := mcDefault; +end; + +procedure TfpgX11Drag.HandleDNDStatus(ATarget: TWindow; AAccept: integer; + ARect: TfpgRect; AAction: TAtom); +begin + if ATarget = FLastTarget then + begin + FStatusPending := False; + if AAccept = 1 then + begin + FDropAccepted := True; + FAcceptedAction := AAction; + FSource.MouseCursor := mcDrag; + end + else + begin + FDropAccepted := False; + FAcceptedAction := X.None; { AAction should equal None, but lets just make sure } + FSource.MouseCursor := mcNoDrop; + end; + end; + { TODO: If we waited to long, we have a timeout } +end; + +procedure TfpgX11Drag.HandleSelectionRequest(ev: TXEvent); +var + e: TXSelectionEvent; + s: string; + v: variant; +begin + e._type := SelectionNotify; + e.requestor := ev.xselectionrequest.requestor; + e.selection := ev.xselectionrequest.selection; + e.target := ev.xselectionrequest.target; + e.time := ev.xselectionrequest.time; + e._property := ev.xselectionrequest._property; + + s := XGetAtomName(xapplication.Display, e.target); + if FMimeData.HasFormat(s) then + begin + if s = 'text/plain' then + XChangeProperty(xapplication.Display, e.requestor, e._property, e.target, + 8, PropModeReplace, PByte(@FMimeData.Text[1]), Length(FMimeData.Text)) + else if s = 'text/html' then + begin + XChangeProperty(xapplication.Display, e.requestor, e._property, e.target, + 8, PropModeReplace, PByte(@FMimeData.HTML[1]), Length(FMimeData.HTML)) + end + else + begin + { transfering as raw bytes of data } + v := FMimeData.GetData(s); + s := v; + XChangeProperty(xapplication.Display, e.requestor, e._property, e.target, + 8, PropModeReplace, PByte(@s[1]), Length(s)); + end; + + end; + + XSendEvent(xapplication.Display, e.requestor, false, NoEventMask, @e ); +end; + +function TfpgX11Drag.GetSource: TfpgX11Window; +begin + Result := FSource; +end; + +destructor TfpgX11Drag.Destroy; +begin + {$IFDEF DNDDEBUG} + writeln('TfpgX11Drag.Destroy '); + {$ENDIF} + FSource.MouseCursor := mcDefault; + XDeleteProperty(xapplication.Display, FSource.WinHandle, xapplication.XdndAware); + XDeleteProperty(xapplication.Display, FSource.WinHandle, xapplication.XdndTypeList); + SetLength(FMimeTypesArray, 0); + inherited Destroy; +end; + +function TfpgX11Drag.Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction): TfpgDropAction; +var + win: TWindow; +begin + if FDragging then + Result := daIgnore + else + begin + FDragging := True; + xia_plain_text := XInternAtom(xapplication.Display, 'text/plain', TBool(False)); + FProposedAction := xapplication.GetAtomFromDropAction(ADefaultAction); + xapplication.Drag := self; + + XSetSelectionOwner(xapplication.Display, xapplication.XdndSelection, FSource.WinHandle, CurrentTime); + win := XGetSelectionOwner(xapplication.Display, xapplication.XdndSelection); + if win <> FSource.WinHandle then + raise Exception.Create('fpGUI/X11: Application failed to aquire selection owner status'); + + InitializeMimeTypesToAtoms; + if FMimeData.Count > 3 then + SetTypeListProperty; + end; +end; + initialization xapplication := nil; diff --git a/src/fpmake.pas b/src/fpmake.pp index 5afc82ea..a99975a0 100644 --- a/src/fpmake.pas +++ b/src/fpmake.pp @@ -42,13 +42,16 @@ program fpmake; uses sysutils, fpmkunit; +const + {$I VERSION_FILE.inc} + var T: TTarget; P: TPackage; begin with Installer do begin P := AddPackage('fpgui'); - P.Version := '0.6.3'; + P.Version := FPGUI_VERSION; P.Author := 'Graeme Geldenhuys'; P.Email := 'graemeg@gmail.com'; P.License := 'Modified LGPL'; @@ -62,7 +65,7 @@ begin if we set the package name to fpgui as above. This base install dir can be overridden by passing -B to fpmake. The line below will cause the units to be output in ../lib/<cpu-os>/fpgui } - Defaults.UnitInstallDir := Format('../lib/%s-%s/', [CurrentCPU, CurrentOS]); +// Defaults.UnitInstallDir := Format('../lib/%s-%s/', [CurrentCPU, CurrentOS]); { If you installed FPC to a non-standard location, you need to specify where fpmake can find the compiler and RTL units. You can pass that @@ -72,9 +75,10 @@ begin // else // Defaults.GlobalUnitDir := Format('c:\fpc\2.2.3\units\%s-%s', [CurrentCPU, CurrentOS]); - if Defaults.OS in AllUnixOSes - then Defaults.Options := Defaults.Options + '-dX11' - else Defaults.Options := Defaults.Options + '-dGDI'; + if Defaults.OS in AllUnixOSes then + Defaults.Options.Add('-dX11') + else + Defaults.Options.Add('-dGDI'); P.SourcePath.Add('corelib'); P.SourcePath.Add('corelib/x11', AllUnixOSes); @@ -88,64 +92,81 @@ begin P.UnitPath.Add('gui'); P.UnitPath.Add('gui/db'); + P.IncludePath.Add('.'); P.IncludePath.Add('corelib'); P.IncludePath.Add('corelib/x11', AllUnixOSes); P.IncludePath.Add('corelib/gdi', AllWindowsOSes); P.IncludePath.Add('gui'); { todo: add unit and include dependency for all } +{ P.Sources.AddSrcFiles('corelib/*.pas'); P.Sources.AddSrcFiles('gui/*.pas'); - if Defaults.OS in AllUnixOSes - then P.Sources.AddSrcFiles('corelib/x11/*.pas') - else P.Sources.AddSrcFiles('corelib/gdi/*.pas'); - - { x11 and gdi common } -// if Defaults.OS in AllUnixOSes -// then - P.Targets.AddUnit('corelib/x11/fpg_impl.pas', AllWindowsOSes); -// else - P.Targets.AddUnit('corelib/gdi/fpg_impl.pas', AllUnixOSes); -// T := P.Targets.AddUnit('fpg_impl.pas'); - - { corelib/x11 } - T := P.Targets.AddUnit('fpg_keyconv_x11.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_netlayer_x11.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_x11.pas', AllUnixOSes); -{ with T.Dependencies do begin - AddUnit('fpg_xft_x11'); - AddUnit('fpg_netlayer_x11'); - AddUnit('fpg_base'); - AddUnit('fpg_impl'); - end; } - T := P.Targets.AddUnit('fpg_xft_x11.pas', AllUnixOSes); - - { corelib/gdi } - T := P.Targets.AddUnit('fpg_gdi.pas', AllWindowsOSes); + if Defaults.OS in AllUnixOSes then + P.Sources.AddSrcFiles('corelib/x11/*.pas') + else + P.Sources.AddSrcFiles('corelib/gdi/*.pas'); +} { corelib } T := P.Targets.AddUnit('fpg_base.pas'); + T.Dependencies.AddInclude('keys.inc'); + T.Dependencies.AddInclude('predefinedcolors.inc'); T := P.Targets.AddUnit('fpg_imagelist.pas'); T := P.Targets.AddUnit('fpg_popupwindow.pas'); T := P.Targets.AddUnit('fpg_translations.pas'); T := P.Targets.AddUnit('fpg_cmdlineparams.pas'); T := P.Targets.AddUnit('fpg_imgfmt_bmp.pas'); + T := P.Targets.AddUnit('fpg_imgfmt_jpg.pas'); T := P.Targets.AddUnit('fpg_stdimages.pas'); + T.Dependencies.AddInclude('stdimages.inc'); T := P.Targets.AddUnit('fpg_utils.pas'); + T.Dependencies.AddInclude('fpg_utils_impl.inc', AllUnixOSes); + T.Dependencies.AddInclude('fpg_utils_impl.inc', AllWindowsOSes); + T := P.Targets.AddUnit('fpg_imgutils.pas'); T := P.Targets.AddUnit('fpg_command_intf.pas'); T := P.Targets.AddUnit('fpg_main.pas'); + T.Dependencies.AddInclude('VERSION_FILE.inc'); + T.Dependencies.AddInclude('fpg_msgqueue.inc'); T := P.Targets.AddUnit('fpg_stringhashlist.pas'); T := P.Targets.AddUnit('fpg_widget.pas'); T := P.Targets.AddUnit('fpg_constants.pas'); + T.Dependencies.AddInclude('lang_en.inc'); + T.Dependencies.AddInclude('lang_af.inc'); + T.Dependencies.AddInclude('lang_de.inc'); + T.Dependencies.AddInclude('lang_es.inc'); + T.Dependencies.AddInclude('lang_fr.inc'); + T.Dependencies.AddInclude('lang_it.inc'); + T.Dependencies.AddInclude('lang_pt.inc'); + T.Dependencies.AddInclude('lang_ru.inc'); T.ResourceStrings := True; - T := P.Targets.AddUnit('fpg_strings.pas'); +// T := P.Targets.AddUnit('fpg_strings.pas'); // this unit is not used in fpGUI T := P.Targets.AddUnit('fpg_wuline.pas'); T := P.Targets.AddUnit('fpg_extinterpolation.pas'); T := P.Targets.AddUnit('fpg_pofiles.pas'); T := P.Targets.AddUnit('fpg_stringutils.pas'); + T := P.Targets.AddUnit('fpg_extgraphics.pas'); + + + { corelib/x11 } + T := P.Targets.AddUnit('fpg_keyconv_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_netlayer_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_xft_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_impl.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_x11.pas', AllUnixOSes); + T.Dependencies.AddUnit('fpg_xft_x11'); + T.Dependencies.AddUnit('fpg_netlayer_x11'); + T.Dependencies.AddUnit('fpg_base'); + T.Dependencies.AddUnit('fpg_impl'); + T := P.Targets.AddUnit('fpg_interface.pas', AllUnixOSes); + + + { corelib/gdi } + T := P.Targets.AddUnit('fpg_impl.pas', AllWindowsOSes); + T := P.Targets.AddUnit('fpg_gdi.pas', AllWindowsOSes); + T.Dependencies.AddInclude('fpg_keys_gdi.inc', AllWindowsOSes); + T := P.Targets.AddUnit('fpg_interface.pas', AllWindowsOSes); - { corelib include files } -// T := P.Sources.AddSrc('keys.inc'); { gui/db } T := P.Targets.AddUnit('fpgui_db.pas'); @@ -169,6 +190,14 @@ begin T := P.Targets.AddUnit('fpg_trackbar.pas'); T := P.Targets.AddUnit('fpg_button.pas'); T := P.Targets.AddUnit('fpg_dialogs.pas'); + T.Dependencies.AddInclude('charmapdialog.inc'); + T.Dependencies.AddInclude('colordialog.inc'); + T.Dependencies.AddInclude('inputquerydialog.inc'); + T.Dependencies.AddInclude('messagedialog.inc'); + T.Dependencies.AddInclude('newdirdialog.inc'); + T.Dependencies.AddInclude('promptuserdialog.inc'); + T.Dependencies.AddInclude('selectdirdialog.inc'); + T.Dependencies.AddInclude('logo.inc'); T := P.Targets.AddUnit('fpg_gauge.pas'); T := P.Targets.AddUnit('fpg_iniutils.pas'); T := P.Targets.AddUnit('fpg_memo.pas'); @@ -182,6 +211,10 @@ begin T := P.Targets.AddUnit('fpg_menu.pas'); T := P.Targets.AddUnit('fpg_progressbar.pas'); T := P.Targets.AddUnit('fpg_style.pas'); + T := P.Targets.AddUnit('fpg_spinedit.pas'); + T := P.Targets.AddUnit('fpg_colorwheel.pas'); + T := P.Targets.AddUnit('fpg_colormapping.pas'); + T := P.Targets.AddUnit('fpg_editbtn.pas'); Run; end; diff --git a/src/gui/colordialog.inc b/src/gui/colordialog.inc index 6914257e..93d8d731 100644 --- a/src/gui/colordialog.inc +++ b/src/gui/colordialog.inc @@ -25,10 +25,10 @@ type TfpgColorSelectDialog = class(TfpgBaseDialog) private {@VFD_HEAD_BEGIN: ColorSelectDialog} - PageControl1: TfpgPageControl; - TabSheet1: TfpgTabSheet; - TabSheet2: TfpgTabSheet; - ComboBox1: TfpgComboBox; + pcColorSelect: TfpgPageControl; + tsColorWheel: TfpgTabSheet; + tsColorNames: TfpgTabSheet; + cbColorPalette: TfpgComboBox; ColorListBox1: TfpgColorListBox; Label1: TfpgLabel; Label2: TfpgLabel; @@ -43,11 +43,13 @@ type pnlColorPreview: TfpgBevel; {@VFD_HEAD_END: ColorSelectDialog} FViaRGB: Boolean; // to prevent recursive changes - function GetSelectedColor: TfpgColor; - procedure SetSelectedColor(const AValue: TfpgColor); - procedure ColorChanged(Sender: TObject); - procedure RGBChanged(Sender: TObject); - procedure UpdateRGBComponents; + function GetSelectedColor: TfpgColor; + procedure SetSelectedColor(const AValue: TfpgColor); + procedure ColorChanged(Sender: TObject); + procedure RGBChanged(Sender: TObject); + procedure UpdateRGBComponents; + procedure PopulatePaletteColorCombo; + procedure cbColorPaletteChange(Sender: TObject); public constructor Create(AOwner: TComponent); override; procedure AfterCreate; override; @@ -71,7 +73,7 @@ begin try frm.ColorWheel.SetSelectedColor(APresetColor); if frm.ShowModal = mrOK then - Result := frm.ValueBar.SelectedColor; + Result := frm.SelectedColor; finally frm.Free; end; @@ -81,12 +83,15 @@ end; function TfpgColorSelectDialog.GetSelectedColor: TfpgColor; begin - // + if pcColorSelect.ActivePageIndex = 0 then + Result := ValueBar.SelectedColor + else + Result := ColorListBox1.Color; end; procedure TfpgColorSelectDialog.SetSelectedColor(const AValue: TfpgColor); begin - // + ColorWheel.SetSelectedColor(AValue); end; procedure TfpgColorSelectDialog.ColorChanged(Sender: TObject); @@ -123,6 +128,27 @@ begin edB.Value := rgb.Blue; end; +procedure TfpgColorSelectDialog.PopulatePaletteColorCombo; +begin + cbColorPalette.Items.Clear; + cbColorPalette.Items.Add('cpStandardColors'); + cbColorPalette.Items.Add('cpSystemColors'); + cbColorPalette.Items.Add('cpWebColors'); + cbColorPalette.FocusItem := 0; + cbColorPalette.OnChange := @cbColorPaletteChange; +end; + +procedure TfpgColorSelectDialog.cbColorPaletteChange(Sender: TObject); +begin + if cbColorPalette.Text = 'cpStandardColors' then + ColorListBox1.ColorPalette := cpStandardColors + else if cbColorPalette.Text = 'cpSystemColors' then + ColorListBox1.ColorPalette := cpSystemColors + else + ColorListBox1.ColorPalette := cpWebColors; + ColorListBox1.SetFocus; +end; + constructor TfpgColorSelectDialog.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -135,15 +161,15 @@ begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: ColorSelectDialog} Name := 'ColorSelectDialog'; - SetPosition(316, 186, 328, 375); + SetPosition(340, 164, 328, 375); WindowTitle := 'Color Select Dialog'; Hint := ''; WindowPosition := wpOneThirdDown; - PageControl1 := TfpgPageControl.Create(self); - with PageControl1 do + pcColorSelect := TfpgPageControl.Create(self); + with pcColorSelect do begin - Name := 'PageControl1'; + Name := 'pcColorSelect'; SetPosition(4, 4, 320, 332); Anchors := [anLeft,anRight,anTop,anBottom]; ActivePageIndex := 0; @@ -151,26 +177,26 @@ begin TabOrder := 1; end; - TabSheet1 := TfpgTabSheet.Create(PageControl1); - with TabSheet1 do + tsColorWheel := TfpgTabSheet.Create(pcColorSelect); + with tsColorWheel do begin - Name := 'TabSheet1'; + Name := 'tsColorWheel'; SetPosition(3, 24, 314, 305); Text := 'Color Wheel'; end; - TabSheet2 := TfpgTabSheet.Create(PageControl1); - with TabSheet2 do + tsColorNames := TfpgTabSheet.Create(pcColorSelect); + with tsColorNames do begin - Name := 'TabSheet2'; + Name := 'tsColorNames'; SetPosition(3, 24, 314, 305); Text := 'Predefined'; end; - ComboBox1 := TfpgComboBox.Create(TabSheet2); - with ComboBox1 do + cbColorPalette := TfpgComboBox.Create(tsColorNames); + with cbColorPalette do begin - Name := 'ComboBox1'; + Name := 'cbColorPalette'; SetPosition(8, 24, 299, 22); Anchors := [anLeft,anRight,anTop]; FontDesc := '#List'; @@ -178,21 +204,19 @@ begin TabOrder := 1; end; - ColorListBox1 := TfpgColorListBox.Create(TabSheet2); + ColorListBox1 := TfpgColorListBox.Create(tsColorNames); with ColorListBox1 do begin Name := 'ColorListBox1'; SetPosition(8, 72, 299, 224); Anchors := [anLeft,anRight,anTop,anBottom]; - ColorPalette := cpStandardColors; + Color := TfpgColor($00FFFF); FontDesc := '#List'; Hint := ''; - HotTrack := False; - PopupFrame := False; TabOrder := 2; end; - Label1 := TfpgLabel.Create(TabSheet2); + Label1 := TfpgLabel.Create(tsColorNames); with Label1 do begin Name := 'Label1'; @@ -202,7 +226,7 @@ begin Text := 'Select a color palette'; end; - Label2 := TfpgLabel.Create(TabSheet2); + Label2 := TfpgLabel.Create(tsColorNames); with Label2 do begin Name := 'Label2'; @@ -212,22 +236,23 @@ begin Text := 'Available colors:'; end; - ColorWheel := TfpgColorWheel.Create(TabSheet1); + ColorWheel := TfpgColorWheel.Create(tsColorWheel); with ColorWheel do begin Name := 'ColorWheel'; SetPosition(8, 8, 204, 204); end; - ValueBar := TfpgValueBar.Create(TabSheet1); + ValueBar := TfpgValueBar.Create(tsColorWheel); with ValueBar do begin Name := 'ValueBar'; SetPosition(240, 8, 64, 204); + Value := 1; OnChange := @ColorChanged; end; - edR := TfpgSpinEdit.Create(TabSheet1); + edR := TfpgSpinEdit.Create(tsColorWheel); with edR do begin Name := 'edR'; @@ -237,7 +262,7 @@ begin OnChange := @RGBChanged; end; - edG := TfpgSpinEdit.Create(TabSheet1); + edG := TfpgSpinEdit.Create(tsColorWheel); with edG do begin Name := 'edG'; @@ -247,7 +272,7 @@ begin OnChange := @RGBChanged; end; - edB := TfpgSpinEdit.Create(TabSheet1); + edB := TfpgSpinEdit.Create(tsColorWheel); with edB do begin Name := 'edB'; @@ -257,7 +282,7 @@ begin OnChange := @RGBChanged; end; - Label3 := TfpgLabel.Create(TabSheet1); + Label3 := TfpgLabel.Create(tsColorWheel); with Label3 do begin Name := 'Label3'; @@ -268,7 +293,7 @@ begin Text := 'Red'; end; - Label4 := TfpgLabel.Create(TabSheet1); + Label4 := TfpgLabel.Create(tsColorWheel); with Label4 do begin Name := 'Label4'; @@ -279,7 +304,7 @@ begin Text := 'Green'; end; - Label5 := TfpgLabel.Create(TabSheet1); + Label5 := TfpgLabel.Create(tsColorWheel); with Label5 do begin Name := 'Label5'; @@ -290,7 +315,7 @@ begin Text := 'Blue'; end; - pnlColorPreview := TfpgBevel.Create(TabSheet1); + pnlColorPreview := TfpgBevel.Create(tsColorWheel); with pnlColorPreview do begin Name := 'pnlColorPreview'; @@ -309,6 +334,8 @@ begin btnCancel.Top := Height - btnCancel.Height - FSpacing; btnOK.Left := btnCancel.Left - FDefaultButtonWidth - 6; btnOK.Top := btnCancel.Top; + + PopulatePaletteColorCombo; end; diff --git a/src/gui/fpg_animation.pas b/src/gui/fpg_animation.pas index fedfa545..36972877 100644 --- a/src/gui/fpg_animation.pas +++ b/src/gui/fpg_animation.pas @@ -65,6 +65,7 @@ type public property Position; published + property Align; property Enabled; property Interval; property ImageFileName; diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index 9a29e004..ae6584b8 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -37,6 +37,8 @@ type TfpgGridDrawState = set of (gdSelected, gdFocused, gdFixed); + TfpgGridHeaderStyle = (ghsButton, ghsThin, ghsFlat); + TfpgFocusChangeNotify = procedure(Sender: TObject; ARow, ACol: Integer) of object; TfpgRowChangeNotify = procedure(Sender: TObject; ARow: Integer) of object; TfpgCanSelectCellEvent = procedure(Sender: TObject; const ARow, ACol: Integer; var ACanSelect: boolean) of object; @@ -52,6 +54,7 @@ type private FColResizing: boolean; FDragPos: integer; // used for column resizing + FHeaderStyle: TfpgGridHeaderStyle; FOnDrawCell: TfpgDrawCellEvent; FResizedCol: integer; // used for column resizing FDefaultColWidth: integer; @@ -83,9 +86,11 @@ type FAlternativeBGColor: TfpgColor; function GetFontDesc: string; function GetHeaderFontDesc: string; + function GetTotalColumnWidth: integer; procedure HScrollBarMove(Sender: TObject; position: integer); procedure SetFontDesc(const AValue: string); procedure SetHeaderFontDesc(const AValue: string); + procedure SetHeaderStyle(const AValue: TfpgGridHeaderStyle); procedure SetRowSelect(const AValue: boolean); procedure SetScrollBarStyle(const AValue: TfpgScrollStyle); procedure VScrollBarMove(Sender: TObject; position: integer); @@ -139,6 +144,7 @@ type property HeaderFontDesc: string read GetHeaderFontDesc write SetHeaderFontDesc; property FocusCol: Integer read FFocusCol write SetFocusCol default -1; property FocusRow: Integer read FFocusRow write SetFocusRow default -1; + property HeaderStyle: TfpgGridHeaderStyle read FHeaderStyle write SetHeaderStyle default ghsButton; property RowSelect: boolean read FRowSelect write SetRowSelect; property ColumnCount: Integer read GetColumnCount; property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; @@ -147,6 +153,7 @@ type property ShowGrid: boolean read FShowGrid write SetShowGrid default True; property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth; property HeaderHeight: integer read FHeaderHeight; + property TotalColumnWidth: integer read GetTotalColumnWidth; // property ColResizing: boolean read FColResizing write FColResizing; property ColumnWidth[ACol: Integer]: integer read GetColumnWidth write SetColumnWidth; property ColumnBackgroundColor[ACol: Integer]: TfpgColor read GetColumnBackgroundColor write SetColumnBackgroundColor; @@ -207,6 +214,15 @@ begin Result := FHeaderFont.FontDesc; end; +function TfpgBaseGrid.GetTotalColumnWidth: integer; +var + i: integer; +begin + Result := 0; + for i := 0 to ColumnCount-1 do + Result := Result + ColumnWidth[i]; +end; + procedure TfpgBaseGrid.SetFontDesc(const AValue: string); begin FFont.Free; @@ -225,6 +241,14 @@ begin RePaint; end; +procedure TfpgBaseGrid.SetHeaderStyle(const AValue: TfpgGridHeaderStyle); +begin + if FHeaderStyle = AValue then + exit; + FHeaderStyle := AValue; + Repaint; +end; + procedure TfpgBaseGrid.SetRowSelect(const AValue: boolean); begin if FRowSelect = AValue then @@ -370,10 +394,27 @@ var r: TfpgRect; x: integer; begin - // Here we can implement a head style check - Canvas.DrawButtonFace(ARect, [btfIsEmbedded]); r := ARect; - InflateRect(r, -2, -2); + // Here we can implement a head style check + case FHeaderStyle of + ghsButton: + begin + Canvas.DrawButtonFace(ARect, [btfIsEmbedded]); + InflateRect(r, -2, -2); + end; + ghsThin: + begin + Canvas.DrawBevel(ARect); + end; + ghsFlat: + begin + Canvas.Color:= clGridHeader; + Canvas.FillRectangle(r); + Canvas.Color:= clShadow2; + Canvas.DrawLine(r.Left, r.Bottom, r.Right, r.Bottom); { bottom line } + Canvas.DrawLine(r.Right, r.Bottom, r.Right, r.Top-1); { right line } + end; + end; Canvas.AddClipRect(r); // text may not overshoot header border (* // drawing grid lines @@ -579,16 +620,17 @@ begin begin Dec(VHeight, FHScrollBar.Height); FHScrollBar.Min := 0; - FHScrollBar.SliderSize := 0.2; if go_SmoothScroll in FOptions then begin FHScrollBar.Max := cw - vw; FHScrollBar.Position := FXOffset; + FHScrollBar.SliderSize := TotalColumnWidth / Width; end else begin FHScrollBar.Max := ColumnCount-1; FHScrollBar.Position := FFirstCol; + FHScrollBar.SliderSize := 1 / ColumnCount; end; FHScrollBar.RepaintSlider; end; @@ -931,10 +973,10 @@ begin lCol := FFirstCol; if delta > 0 then // scroll down - inc(FFirstRow, abs(delta)) + inc(FFirstRow, abs(delta)*3) else // scroll up if FFirstRow > 0 then - dec(FFirstRow, abs(delta)); + dec(FFirstRow, abs(delta)*3); // apply limits if FFirstRow > RowCount - VisibleLines then @@ -1231,6 +1273,7 @@ begin FScrollBarStyle := ssAutoBoth; FUpdateCount := 0; FOptions := []; + FHeaderStyle := ghsButton; FFont := fpgGetFont('#Grid'); FHeaderFont := fpgGetFont('#GridHeader'); diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas index 19b31049..52a17486 100644 --- a/src/gui/fpg_button.pas +++ b/src/gui/fpg_button.pas @@ -13,6 +13,9 @@ Description: Defines a push button control. + + TODO: + * multi-line button text. It must take into account image position as well. } unit fpg_button; @@ -42,7 +45,7 @@ type FImageName: string; FClicked: Boolean; FShowImage: Boolean; - FClickOnPush: Boolean; + FClickOnPush: Boolean; { Used for group buttons where click happens on "down" state. Normal buttons, the click happens on "release" state } FGroupIndex: integer; FAllowAllUp: boolean; FModalResult: TfpgModalResult; @@ -62,6 +65,7 @@ type procedure SetAllowAllUp(const Value: boolean); procedure DoPush; procedure DoRelease(x, y: integer); + procedure SetAllowMultiLineText(const AValue: boolean); protected FImageMargin: integer; FImageSpacing: integer; @@ -72,6 +76,7 @@ type FFont: TfpgFont; FDefault: boolean; FState: integer; // 0 - normal // 1 - hover + FAllowMultiLineText: boolean; procedure SetShowImage(AValue: Boolean); procedure HandlePaint; override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; @@ -85,8 +90,9 @@ type property AllowAllUp: boolean read FAllowAllUp write SetAllowAllUp default False; { Buttons behave like toggle buttons. This is an alias for GroupIndex > 0 } property AllowDown: Boolean read GetAllowDown write SetAllowDown; + property AllowMultiLineText: boolean read FAllowMultiLineText write SetAllowMultiLineText default False; property Default: boolean read FDefault write SetDefault default False; - property Down: Boolean read FDown write SetDown; + property Down: Boolean read FDown write SetDown default False; { The button will not show focus. It might also have a different down state (look). This is similar to Focusable = False, but the appearance of the down state might differ. } property Embedded: Boolean read FEmbedded write SetEmbedded default False; @@ -127,12 +133,15 @@ type together. } TfpgButton = class(TfpgBaseButton) published + property Align; property AllowAllUp; property AllowDown; + property AllowMultiLineText; property BackgroundColor default clButtonFace; property Default; property Down; property Embedded; + property Enabled; property Flat; property FontDesc; property GroupIndex; @@ -157,6 +166,10 @@ type property Top; property Width; property OnClick; + property OnDragEnter; + property OnDragLeave; + property OnDragDrop; + property OnDragStartDetected; property OnMouseDown; property OnMouseExit; property OnMouseEnter; @@ -302,6 +315,7 @@ begin FDefault := False; FAllowAllUp := False; FState := 0; + FAllowMultiLineText := False; end; destructor TfpgBaseButton.Destroy; @@ -509,6 +523,7 @@ var lBtnFlags: TFButtonFlags; clr: TfpgColor; img: TfpgImage; + lTextFlags: TFTextFlags; begin // inherited HandlePaint; Canvas.ClearClipRect; @@ -532,6 +547,12 @@ begin Include(lBtnFlags, btfHover) else if FFlat then Include(lBtnFlags, btfFlat); + end + else + begin + { while in the designer we want hover effect all the time } + if FFlat then + Include(lBtnFlags, btfHover); end; if not FFlat and FDefault then @@ -577,8 +598,33 @@ begin Canvas.DrawImage(ix + pofs, iy + pofs, img); img.Free; end; + end; - fpgStyle.DrawString(Canvas, tx+pofs, ty+pofs, Text, Enabled); + + { EXPERIMENTAL: multi-line button text + Only in this condition do we support multi-line text } + if AllowMultiLineText and (FImageLayout = ilImageLeft) then + begin + r.SetRect(0, 0, Width, Height); + InflateRect(r, -3, -3); { same as focus rectangle } + if FShowImage and Assigned(FImage) then + begin + ix := FImageMargin + FImage.Width; + if FImageSpacing > 0 then + ix += FImageSpacing; + OffsetRect(r, ix, 0); + r.Width -= ix; + end; + if FDown then + OffsetRect(r, pofs, pofs); + + lTextFlags := [txtHCenter, txtVCenter{, txtWrap}]; + if not Enabled then + lTextFlags += [txtDisabled]; + Canvas.DrawText(r, Text, lTextFlags); + end + else + fpgStyle.DrawString(Canvas, tx+pofs, ty+pofs, Text, Enabled); end; procedure TfpgBaseButton.DoPush; @@ -618,7 +664,7 @@ begin FDown := False; RePaint; fpgApplication.ProcessMessages; - if PtInRect(r, Point(x, y)) then + if PtInRect(r, Point(x, y)) and FOnClickPending then Click; end; end @@ -629,7 +675,7 @@ begin FDown := False; RePaint; fpgApplication.ProcessMessages; - if PtInRect(r, Point(x, y)) then + if PtInRect(r, Point(x, y)) and FOnClickPending then Click; end; end; @@ -638,10 +684,18 @@ begin FClicked := False; end; +procedure TfpgBaseButton.SetAllowMultiLineText(const AValue: boolean); +begin + if FAllowMultiLineText = AValue then exit; + FAllowMultiLineText := AValue; + Repaint; +end; + procedure TfpgBaseButton.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); begin if (keycode = keyReturn) or (keycode = keySpace) or (keycode = keyPEnter) then begin + FOnClickPending := True; DoPush; Consumed := True; end @@ -653,8 +707,9 @@ procedure TfpgBaseButton.HandleKeyRelease(var keycode: word; var shiftstate: TSh begin if (keycode = keyReturn) or (keycode = keySpace) or (keycode = keyPEnter) then begin - DoRelease(1, 1); // fake co-ordinates to it executes the Click + DoRelease(1, 1); // fake co-ordinates so it executes the Click Consumed := True; + FOnClickPending := False; end else inherited; @@ -732,8 +787,11 @@ begin if Assigned(FCommand) then // ICommand takes preference to OnClick FCommand.Execute - else if Assigned(OnClick) then - OnClick(self); + else + begin + if Assigned(OnClick) then + OnClick(self); + end; end; function TfpgBaseButton.GetCommand: ICommand; diff --git a/src/gui/fpg_checkbox.pas b/src/gui/fpg_checkbox.pas index a075a4cd..e6d5c35b 100644 --- a/src/gui/fpg_checkbox.pas +++ b/src/gui/fpg_checkbox.pas @@ -65,9 +65,11 @@ type TfpgCheckBox = class(TfpgBaseCheckBox) published + property Align; property BackgroundColor; property BoxLayout; property Checked; + property Enabled; property FontDesc; property Height; property Hint; diff --git a/src/gui/fpg_colorwheel.pas b/src/gui/fpg_colorwheel.pas index 43ebb8a9..a6b3795b 100644 --- a/src/gui/fpg_colorwheel.pas +++ b/src/gui/fpg_colorwheel.pas @@ -62,7 +62,9 @@ type property Saturation: double Read FSaturation; procedure SetSelectedColor(const NewColor: TfpgColor); published + property Align; property BackgroundColor; + property Enabled; property ValueBar: TfpgValueBar Read FValueBar Write SetValueBar; property MarginWidth: longint Read FMarginWidth Write SetMarginWidth default 5; property CursorSize: longint Read FCursorSize Write SetCursorSize default 5; @@ -98,11 +100,13 @@ type constructor Create(AOwner: TComponent); override; procedure SetHS(Hue: longint; Sat: double); published + property Align; property BackgroundColor; + property Enabled; property Value: double Read FValue Write SetValue; property SelectedColor: TfpgColor Read GetSelectedColor; - property MarginWidth: longint Read FMarginWidth Write SetMarginWidth; - property CursorHeight: longint Read FCursorHeight Write SetCursorHeight; + property MarginWidth: longint Read FMarginWidth Write SetMarginWidth default 5; + property CursorHeight: longint Read FCursorHeight Write SetCursorHeight default 10; property OnChange: TNotifyEvent Read FOnChange Write FOnChange; end; @@ -197,12 +201,16 @@ begin // but draw an outline Canvas.SetLineStyle(1, lsDash); Canvas.DrawRectangle(GetClientRect); + Canvas.SetLineStyle(1, lsSolid); + Canvas.Color := clUIDesignerGreen; + Canvas.FillArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 0, 360); Canvas.Color := clHilite1; - Canvas.DrawArc(Width div 2, Height div 2, DrawWidth div 2 + 1, - DrawHeight div 2 + 1, 45, 180); + Canvas.DrawArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 45, 180); Canvas.Color := clShadow1; - Canvas.DrawArc(Width div 2, Height div 2, DrawWidth div 2 + 1, - DrawHeight div 2 + 1, 225, 180); + Canvas.DrawArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 225, 180); + Canvas.TextColor := clShadow1; + Canvas.DrawText(5, 5, Name + ': ' + ClassName); + DrawCursor; Exit; //==> end; @@ -427,13 +435,19 @@ begin begin // when designing just draw // a rectangle to indicate + Canvas.Color := clBlack; Canvas.SetLineStyle(1, lsDash); Canvas.DrawRectangle(GetClientRect); if (Width < MarginWidth * 2) or (Height < MarginWidth * 2) then Exit; //==> r := GetClientRect; - InflateRect(r, FMarginWidth, FMarginWidth); + InflateRect(r, -FMarginWidth, -FMarginWidth); + Canvas.Color := clShadow1; + Canvas.SetLineStyle(1, lsSolid); Canvas.DrawRectangle(r); + Canvas.TextColor := clShadow1; + Canvas.DrawText(5, 5, Width, Height, Name + ': ' + ClassName, TextFlagsDflt + [txtWrap]); + DrawCursor; exit; end; @@ -494,7 +508,7 @@ begin inherited Create(AOwner); FMarginWidth := 5; FValue := 1.0; - Width := 100; + Width := 80; Height := 100; Name := 'ValueBar'; FCursorHeight := 10; diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index 632a4918..5afbf326 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -135,8 +135,11 @@ type TfpgComboBox = class(TfpgBaseStaticCombo) published + property AcceptDrops; + property Align; property BackgroundColor default clBoxColor; property DropDownCount; + property Enabled; property ExtraHint; property FocusItem; property FontDesc; @@ -153,6 +156,10 @@ type property Width; property OnChange; property OnCloseUp; + property OnDragDrop; + property OnDragEnter; + property OnDragLeave; + property OnDragStartDetected; property OnDropDown; property OnEnter; property OnExit; diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 73c668c3..a190cf43 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -50,7 +50,10 @@ uses fpg_tree, fpg_ColorWheel, fpg_spinedit, - fpg_tab; + fpg_tab, + fpg_menu, + fpg_iniutils, + fpg_imagelist; type TfpgMsgDlgType = (mtAbout, mtWarning, mtError, mtInformation, mtConfirmation, @@ -79,22 +82,27 @@ type TfpgMessageBox = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MessageBox} + FButton: TfpgButton; + {@VFD_HEAD_END: MessageBox} FLines: TStringList; FFont: TfpgFont; FTextY: integer; FLineHeight: integer; FMaxLineWidth: integer; - FButton: TfpgButton; FCentreText: Boolean; - protected - procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; - procedure HandlePaint; override; - procedure HandleShow; override; + procedure FormPaint(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + function GetFontDesc: string; + procedure SetFontDesc(const AValue: string); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + procedure AfterCreate; override; procedure SetMessage(AMessage: string); property CentreText: Boolean read FCentreText write FCentreText default False; + property FontDesc: string read GetFontDesc write SetFontDesc; end; @@ -153,6 +161,8 @@ type btnUpDir: TfpgButton; btnDirNew: TfpgButton; btnShowHidden: TfpgButton; + btnGoHome: TfpgButton; + btnBookmark: TfpgButton; pnlFileInfo: TfpgPanel; edFilename: TfpgEdit; chlFilter: TfpgComboBox; @@ -162,6 +172,8 @@ type FFilterList: TStringList; FFilter: string; FInitialDir: string; + FBookmarkMenu: TfpgPopupMenu; + FIni: TfpgIniFile; procedure SetFilter(const Value: string); function GetFontDesc: string; function GetShowHidden: boolean; @@ -177,9 +189,14 @@ type procedure DirChange(Sender: TObject); procedure UpDirClick(Sender: TObject); procedure btnDirNewClicked(Sender: TObject); + procedure btnGoHomeClicked(Sender: TObject); + procedure btnBookmarkClicked(Sender: TObject); procedure edFilenameChanged(Sender: TObject); procedure UpdateButtonState; function HighlightFile(const AFilename: string): boolean; + function CreatePopupMenu: TfpgPopupMenu; + procedure BookmarkItemClicked(Sender: TObject); + procedure ShowConfigureBookmarks; protected procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure btnOKClick(Sender: TObject); override; @@ -195,7 +212,6 @@ type property InitialDir: string read FInitialDir write SetInitialDir; property ShowHidden: boolean read GetShowHidden write SetShowHidden; end; - { This lets us use a single include file for both the Interface and Implementation sections. } @@ -210,6 +226,7 @@ type {$I charmapdialog.inc} {$I colordialog.inc} {$I inputquerydialog.inc} +{$I managebookmarksdialog.inc} @@ -403,21 +420,11 @@ end; { TfpgMessageBox } -procedure TfpgMessageBox.HandleKeyPress(var keycode: word; - var shiftstate: TShiftState; var consumed: boolean); -begin - inherited HandleKeyPress(keycode, shiftstate, consumed); - if keycode = keyEscape then - Close; -end; - -procedure TfpgMessageBox.HandlePaint; +procedure TfpgMessageBox.FormPaint(Sender: TObject); var n, y: integer; tw: integer; begin - inherited HandlePaint; - Canvas.SetFont(FFont); y := FTextY; for n := 0 to FLines.Count-1 do @@ -431,30 +438,42 @@ begin end; end; -procedure TfpgMessageBox.HandleShow; +procedure TfpgMessageBox.FormShow(Sender: TObject); +begin + FButton.Text := cMsgDlgBtnText[mbOK] +end; + +procedure TfpgMessageBox.FormKeyPressed(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEscape then + begin + Consumed := False; + Close; + end; +end; + +function TfpgMessageBox.GetFontDesc: string; +begin + Result := FFont.FontDesc; +end; + +procedure TfpgMessageBox.SetFontDesc(const AValue: string); begin - inherited HandleShow; - FButton.SetFocus; + FFont.Free; + FFont := fpgGetFont(AValue); + RePaint; end; constructor TfpgMessageBox.Create(AOwner: TComponent); begin inherited Create(AOwner); - WindowPosition := wpOneThirdDown; - Sizeable := False; - FLines := TStringList.Create; FFont := fpgGetFont('#Label1'); FTextY := 10; FLineHeight := FFont.Height + 4; - MinWidth := 200; FMaxLineWidth := 500; FCentreText := False; - - FButton := TfpgButton.Create(self); - FButton.Text := cMsgDlgBtnText[mbOK]; - FButton.Width := 75; - FButton.ModalResult := mrOK; end; destructor TfpgMessageBox.Destroy; @@ -464,6 +483,38 @@ begin inherited Destroy; end; +procedure TfpgMessageBox.AfterCreate; +begin + inherited AfterCreate; + {@VFD_BODY_BEGIN: MessageBox} + Name := 'MessageBox'; + SetPosition(330, 199, 419, 138); + WindowTitle := 'Message'; + Hint := ''; + WindowPosition := wpOneThirdDown; + MinWidth := 200; + Sizeable := False; + OnShow := @FormShow; + OnPaint := @FormPaint; + OnKeyPress := @FormKeyPressed; + + FButton := TfpgButton.Create(self); + with FButton do + begin + Name := 'FButton'; + SetPosition(8, 8, 75, 23); + Text := 'OK'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 1; + OnKeyPress := @FormKeyPressed; + end; + + {@VFD_BODY_END: MessageBox} +end; + procedure TfpgMessageBox.SetMessage(AMessage: string); var outw: integer; @@ -698,6 +749,8 @@ var end; begin + if Desc = '' then + exit; cp := 1; c := Desc[1]; @@ -863,6 +916,7 @@ begin Items.Add('48'); Items.Add('64'); Items.Add('72'); + FocusItem := 4; // 10 point font OnChange := @OnParamChange; end; @@ -1016,7 +1070,7 @@ begin chlDir := TfpgComboBox.Create(self); with chlDir do begin - SetPosition(8, 12, 526, 22); + SetPosition(8, 12, 484, 24); Anchors := [anLeft, anRight, anTop]; FontDesc := '#List'; OnChange := @DirChange; @@ -1027,6 +1081,7 @@ begin begin SetPosition(8, 44, 622, 200); Anchors := [anLeft, anRight, anTop, anBottom]; + Options := [go_AlternativeColor, go_SmoothScroll]; OnRowChange := @ListChanged; OnDoubleClick := @GridDblClicked; end; @@ -1034,44 +1089,75 @@ begin btnUpDir := TfpgButton.Create(self); with btnUpDir do begin - SetPosition(540, 11, 26, 24); + SetPosition(500, 11, 24, 24); Anchors := [anRight, anTop]; Text := ''; FontDesc := '#Label1'; ImageName := 'stdimg.folderup'; // Do NOT localize - ModalResult := mrNone; Focusable := False; + ImageSpacing := 0; + ImageMargin := -1; OnClick := @UpDirClick; end; btnDirNew := TfpgButton.Create(self); with btnDirNew do begin - SetPosition(572, 11, 26, 24); + SetPosition(526, 11, 24, 24); Anchors := [anRight, anTop]; Text := ''; FontDesc := '#Label1'; ImageName := 'stdimg.foldernew'; // Do NOT localize - ModalResult := mrNone; Focusable := False; + ImageSpacing := 0; + ImageMargin := -1; OnClick := @btnDirNewClicked; end; btnShowHidden := TfpgButton.Create(self); with btnShowHidden do begin - SetPosition(604, 11, 26, 24); + SetPosition(552, 11, 24, 24); Anchors := [anRight, anTop]; Text := ''; FontDesc := '#Label1'; ImageName := 'stdimg.hidden'; // Do NOT localize - ModalResult := mrNone; Focusable := False; GroupIndex := 1; AllowAllUp := True; + ImageSpacing := 0; + ImageMargin := -1; OnClick := @DirChange; end; + btnGoHome := TfpgButton.Create(self); + with btnGoHome do + begin + SetPosition(578, 11, 24, 24); + Anchors := [anRight, anTop]; + Text := ''; + FontDesc := '#Label1'; + ImageName := 'stdimg.folderhome'; // Do NOT localize + Focusable := False; + ImageSpacing := 0; + ImageMargin := -1; + OnClick := @btnGoHomeClicked; + end; + + btnBookmark := TfpgButton.Create(self); + with btnBookmark do + begin + SetPosition(604, 11, 24, 24); + Anchors := [anRight, anTop]; + Text := ''; + FontDesc := '#Label1'; + ImageName := 'stdimg.bookmark'; // Do NOT localize + Focusable := False; + ImageSpacing := 0; + ImageMargin := -1; + OnClick := @btnBookmarkClicked; + end; + { Create lower Panel details } pnlFileInfo := TfpgPanel.Create(self); @@ -1210,6 +1296,8 @@ end; destructor TfpgFileDialog.Destroy; begin + FIni.Free; + FBookmarkMenu.Free; FFilterList.Free; inherited Destroy; end; @@ -1252,6 +1340,19 @@ begin end; end; +procedure TfpgFileDialog.btnGoHomeClicked(Sender: TObject); +begin + SetCurrentDirectory(GetUserDir); +end; + +procedure TfpgFileDialog.btnBookmarkClicked(Sender: TObject); +begin + if Assigned(FBookmarkMenu) then + FBookmarkMenu.Free; + FBookmarkMenu := CreatePopupMenu; + FBookmarkMenu.ShowAt(self, btnBookmark.Left, btnBookmark.Bottom); +end; + procedure TfpgFileDialog.edFilenameChanged(Sender: TObject); begin UpdateButtonState; @@ -1299,6 +1400,9 @@ begin grid.Update; grid.SetFocus; + + if FOpenMode then // when saving file, we want to keep file name + edFilename.Clear; end; function TfpgFileDialog.HighlightFile(const AFilename: string): boolean; @@ -1317,6 +1421,75 @@ begin Result := False; end; +function TfpgFileDialog.CreatePopupMenu: TfpgPopupMenu; +var + i: integer; + s: TfpgString; + lst: TStringList; + mi: TfpgMenuItem; +begin + Result := TfpgPopupMenu.Create(nil); + with Result do + begin + lst := TStringList.Create; + try + if not Assigned(FIni) then + FIni := TfpgINIFile.CreateExt(fpgGetToolkitConfigDir + FPG_BOOKMARKS_FILE); + FIni.ReadSection(FPG_BOOKMARK_SECTION, lst); + // add previous bookmarks to menu + for i := 0 to lst.Count-1 do + begin + mi := AddMenuItem(lst[i], '', @BookmarkItemClicked); + end; + // Now add static items + if lst.Count > 0 then + AddMenuItem('-', '', nil); + finally + lst.Free; + end; + mi := AddMenuItem(rsAddCurrentDirectory, '', @BookmarkItemClicked); + mi.Tag := 1; + mi := AddMenuItem(rsConfigureBookmarks + '...', '', @BookmarkItemClicked); + mi.Tag := 2; + end; +end; + +procedure TfpgFileDialog.BookmarkItemClicked(Sender: TObject); +var + mi: TfpgMenuItem; + s: TfpgString; +begin + if Sender is TfpgMenuItem then + mi := TfpgMenuItem(Sender); + if mi = nil then + Exit; + if mi.Tag = 1 then // Add current directory + begin + FIni.WriteString(FPG_BOOKMARK_SECTION, grid.FileList.DirectoryName, grid.FileList.DirectoryName); + end + else if mi.Tag = 2 then // configure bookmarks + begin + ShowConfigureBookmarks; + end + else + begin // bookmark has been clicked + s := FIni.ReadString(FPG_BOOKMARK_SECTION, mi.Text, '.'); + SetCurrentDirectory(s); + end; +end; + +procedure TfpgFileDialog.ShowConfigureBookmarks; +var + frm: TConfigureBookmarksForm; +begin + frm := TConfigureBookmarksForm.Create(FIni); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + procedure TfpgFileDialog.ProcessFilterString; var p: integer; @@ -1369,7 +1542,7 @@ begin if (i >= 0) and (i < FFilterList.Count) then Result := FFilterList[i] else - Result := '*'; + Result := AllFilesMask; end; function TfpgFileDialog.RunOpenFile: boolean; @@ -1378,12 +1551,12 @@ var fname: string; begin FOpenMode := True; - sdir := ExtractFileDir(FileName); + sdir := fpgExtractFileDir(FileName); if sdir = '' then sdir := '.'; SetCurrentDirectory(sdir); - fname := ExtractFileName(FileName); + fname := fpgExtractFileName(FileName); if not HighlightFile(fname) then edFilename.Text := fname; @@ -1436,6 +1609,7 @@ end; {$I charmapdialog.inc} {$I colordialog.inc} {$I inputquerydialog.inc} +{$I managebookmarksdialog.inc} end. diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas index 5dd25fb0..dd7958ab 100644 --- a/src/gui/fpg_edit.pas +++ b/src/gui/fpg_edit.pas @@ -159,10 +159,13 @@ type public property PopupMenu; // UI Designer doesn't fully support it yet published + property AcceptDrops; + property Align; property AutoSelect; property AutoSize; property BackgroundColor default clBoxColor; property BorderStyle; + property Enabled; property ExtraHint; property FontDesc; property HeightMargin; @@ -179,6 +182,10 @@ type property Text; property TextColor; property OnChange; + property OnDragEnter; + property OnDragLeave; + property OnDragDrop; + property OnDragStartDetected; property OnEnter; property OnExit; property OnKeyPress; @@ -220,20 +227,11 @@ type Still to implement !!} property CustomDecimalSeparator: TfpgChar read FDecimalseparator write SetDecimalSeparator; property CustomThousandSeparator: TfpgChar read FThousandSeparator write SetThousandSeparator; - property NegativeColor: TfpgColor read FNegativeColor write SetNegativeColor; + property NegativeColor: TfpgColor read FNegativeColor write SetNegativeColor default clRed; property HideSelection; // property MaxLength; { probably MaxValue and MinValue } property TabOrder; - property TextColor; property ShowThousand: boolean read FShowThousand write FShowThousand default False; - property OnChange; - property OnEnter; - property OnExit; - property OnKeyPress; - property OnMouseEnter; - property OnMouseExit; - property OnPaint; - property OnShowHint; public constructor Create(AOwner: TComponent); override; published @@ -254,7 +252,9 @@ type property OldColor; property Text; published + property Align; property CustomThousandSeparator; + property Enabled; property Hint; property NegativeColor; property ParentShowHint; @@ -292,9 +292,11 @@ type property OldColor; property Text; published + property Align; property CustomDecimalSeparator; property CustomThousandSeparator; property Decimals: integer read FDecimals write SetDecimals default -1; + property Enabled; property FixedDecimals: boolean read FFixedDecimals write SetFixedDecimals default False; property Hint; property NegativeColor; @@ -331,9 +333,11 @@ type property OldColor; property Text; published + property Align; property CustomDecimalSeparator; property CustomThousandSeparator; property Decimals: integer read FDecimals write SetDecimals default 2; + property Enabled; property Hint; property NegativeColor; property ParentShowHint; @@ -341,6 +345,7 @@ type property ShowHint; property ShowThousand default True; property TabOrder; + property TextColor; property Value: Currency read GetValue write SetValue; property OnChange; property OnEnter; @@ -1178,7 +1183,7 @@ procedure TfpgBaseEdit.DefaultPopupPaste(Sender: TObject); begin if ReadOnly then Exit; - PasteFromClipboard + PasteFromClipboard; end; procedure TfpgBaseEdit.DefaultPopupClearAll(Sender: TObject); @@ -1643,6 +1648,7 @@ procedure TfpgBaseNumericEdit.SetNegativeColor(const AValue: TfpgColor); begin if FNegativeColor=AValue then exit; FNegativeColor:=AValue; + FormatEdit; end; procedure TfpgBaseNumericEdit.SetThousandSeparator(const AValue: TfpgChar); @@ -1799,8 +1805,8 @@ begin FAlignment := taRightJustify; FDecimalSeparator := DecimalSeparator; FThousandSeparator := ThousandSeparator; - NegativeColor := clRed; - OldColor := TextColor; + FNegativeColor := clRed; + FOldColor := TextColor; end; { TfpgEditInteger } diff --git a/src/gui/fpg_editbtn.pas b/src/gui/fpg_editbtn.pas index 70c6da00..0cba4f18 100644 --- a/src/gui/fpg_editbtn.pas +++ b/src/gui/fpg_editbtn.pas @@ -70,14 +70,16 @@ type public constructor Create(AOwner: TComponent); override; published - property ExtraHint; - property FileName: TfpgString read GetFileName write SetFileName; - property InitialDir: TfpgString read FInitialDir write FInitialDir; - property Filter: TfpgString read FFilter write SetFilter; - property ReadOnly; - property TabOrder; - property OnButtonClick; - property OnShowHint; + property Align; + property Enabled; + property ExtraHint; + property FileName: TfpgString read GetFileName write SetFileName; + property InitialDir: TfpgString read FInitialDir write FInitialDir; + property Filter: TfpgString read FFilter write SetFilter; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; end; @@ -92,13 +94,15 @@ type public constructor Create(AOwner: TComponent); override; published - property Directory: TfpgString read GetDirectory write SetDirectory; - property ExtraHint; - property RootDirectory: TfpgString read FRootDirectory write FRootDirectory; - property ReadOnly; - property TabOrder; - property OnButtonClick; - property OnShowHint; + property Align; + property Directory: TfpgString read GetDirectory write SetDirectory; + property Enabled; + property ExtraHint; + property RootDirectory: TfpgString read FRootDirectory write FRootDirectory; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; end; @@ -111,11 +115,14 @@ type public constructor Create(AOwner: TComponent); override; published - property FontDesc: TfpgString read GetFontDesc write SetFontDesc; - property ReadOnly; - property TabOrder; - property OnButtonClick; - property OnShowHint; + property Align; + property Enabled; + property ExtraHint; + property FontDesc: TfpgString read GetFontDesc write SetFontDesc; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; end; diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas index 20b6ee8d..4dd011d0 100644 --- a/src/gui/fpg_editcombo.pas +++ b/src/gui/fpg_editcombo.pas @@ -58,6 +58,7 @@ uses fpg_main, fpg_widget, fpg_popupwindow, + fpg_menu, fpg_combobox; type @@ -72,10 +73,14 @@ type FSelectedItem: integer; FMaxLength: integer; FNewItem: boolean; + FDefaultPopupMenu: TfpgPopupMenu; procedure SetAllowNew(const AValue: TAllowNew); procedure InternalBtnClick(Sender: TObject); procedure InternalListBoxSelect(Sender: TObject); procedure InternalListBoxKeyPress(Sender: TObject; var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); + procedure DefaultPopupInsertFromCharmap(Sender: TObject); + procedure DoPaste(const AText: TfpgString); + procedure SetDefaultPopupMenuItemsState; protected FDropDown: TfpgPopupWindow; FDrawOffset: integer; @@ -86,11 +91,14 @@ type function GetText: string; virtual; function HasText: boolean; virtual; procedure SetText(const AValue: string); virtual; + procedure ShowDefaultPopupMenu(const x, y: integer; const shiftstate: TShiftState); virtual; procedure HandleResize(AWidth, AHeight: TfpgCoord); override; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseDown(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandlePaint; override; property AutoCompletion: Boolean read FAutocompletion write FAutoCompletion default False; property AllowNew: TAllowNew read FAllowNew write SetAllowNew default anNo; @@ -109,6 +117,7 @@ type TfpgEditCombo = class(TfpgBaseEditCombo) published + property Align; property AllowNew; property AutoCompletion; property BackgroundColor; @@ -145,6 +154,14 @@ uses fpg_listbox, fpg_dialogs; +const + // internal popupmenu item names + //ipmCut = 'miDefaultCut'; + //ipmCopy = 'miDefaultCopy'; + //ipmPaste = 'miDefaultPaste'; + //ipmClearAll = 'miDefaultClearAll'; + ipmCharmap = 'miDefaultCharmap'; + var OriginalFocusRoot: TfpgWidget; @@ -372,6 +389,74 @@ begin Repaint; end; +procedure TfpgBaseEditCombo.DefaultPopupInsertFromCharmap(Sender: TObject); +var + s: TfpgString; +begin + if FAllowNew= anNo then + Exit; + s := fpgShowCharMap; + if s <> '' then + //SetText(s); + DoPaste(s); +end; + +procedure TfpgBaseEditCombo.DoPaste(const AText: TfpgString); +var + s: string; + prevval: TfpgString; + i: integer; +begin + prevval := FText; + s := AText; + if (FMaxLength <= 0) or (UTF8Length(FText) < FMaxLength) then + begin + UTF8Insert(s, FText, FCursorPos + UTF8Length(s)); + Inc(FCursorPos); + FSelStart := FCursorPos; + if Assigned(FDropDown) then + FDropDown.Close; + FSelectedItem := -1; + for i := 0 to FItems.Count-1 do + if SameText(UTF8Copy(FItems.Strings[i], 1, UTF8Length(FText)), FText) then + begin + FSelectedItem:= i; + DoDropDown; + Break; + end; + if FSelectedItem = -1 then + FNewItem:= True; + end; + Repaint; + if prevval <> Text then + DoOnChange; +end; + +procedure TfpgBaseEditCombo.SetDefaultPopupMenuItemsState; +var + i: integer; + itm: TfpgMenuItem; +begin + //for i := 0 to FDefaultPopupMenu.ComponentCount-1 do + //begin + // if FDefaultPopupMenu.Components[i] is TfpgMenuItem then + // begin + // itm := TfpgMenuItem(FDefaultPopupMenu.Components[i]); + // // enabled/disable menu items + // if itm.Name = ipmCut then + // itm.Enabled := (not ReadOnly) and (FSelOffset <> 0) + // else if itm.Name = ipmCopy then + // itm.Enabled := FSelOffset <> 0 + // else if itm.Name = ipmPaste then + // itm.Enabled := (not ReadOnly) and (fpgClipboard.Text <> '') + // else if itm.Name = ipmClearAll then + // itm.Enabled := (not ReadOnly) and (Text <> '') + // else if itm.Name = ipmCharmap then + // itm.Enabled := (not ReadOnly); + // end; + //end; +end; + procedure TfpgBaseEditCombo.SetText(const AValue: string); var i: integer; @@ -398,6 +483,32 @@ begin end; end; +procedure TfpgBaseEditCombo.ShowDefaultPopupMenu(const x, y: integer; + const shiftstate: TShiftState); +var + itm: TfpgMenuItem; +begin + if not Assigned(FDefaultPopupMenu) then + begin + FDefaultPopupMenu := TfpgPopupMenu.Create(nil); + //itm := FDefaultPopupMenu.AddMenuItem(rsCut, '', @DefaultPopupCut); + //itm.Name := ipmCut; + //itm := FDefaultPopupMenu.AddMenuItem(rsCopy, '', @DefaultPopupCopy); + //itm.Name := ipmCopy; + //itm := FDefaultPopupMenu.AddMenuItem(rsPaste, '', @DefaultPopupPaste); + //itm.Name := ipmPaste; + //itm := FDefaultPopupMenu.AddMenuItem(rsDelete, '', @DefaultPopupClearAll); + //itm.Name := ipmClearAll; + //itm := FDefaultPopupMenu.AddMenuItem('-', '', nil); + //itm.Name := 'N1'; + itm := FDefaultPopupMenu.AddMenuItem(rsInsertFromCharacterMap, '', @DefaultPopupInsertFromCharmap); + itm.Name := ipmCharmap; + end; + + SetDefaultPopupMenuItemsState; + FDefaultPopupMenu.ShowAt(self, x, y); +end; + procedure TfpgBaseEditCombo.HandleResize(AWidth, AHeight: TfpgCoord); begin inherited HandleResize(AWidth, AHeight); @@ -595,6 +706,25 @@ begin PaintInternalButton; end; +procedure TfpgBaseEditCombo.HandleRMouseDown(x, y: integer; + shiftstate: TShiftState); +begin + // keyMenu was pressed + if shiftstate = [ssExtra1] then + HandleRMouseUp(x, y, []) + else + inherited HandleRMouseDown(x, y, shiftstate); +end; + +procedure TfpgBaseEditCombo.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleRMouseUp(x, y, shiftstate); + //if Assigned(PopupMenu) then + // PopupMenu.ShowAt(self, x, y) + //else + ShowDefaultPopupMenu(x, y, ShiftState); +end; + procedure TfpgBaseEditCombo.HandlePaint; var r: TfpgRect; @@ -770,7 +900,8 @@ end; destructor TfpgBaseEditCombo.Destroy; begin - FDropDown.Free; + if not Assigned(FDropDown) then + FDropDown.Free; inherited Destroy; end; diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas index 57c156a6..2eb6e899 100644 --- a/src/gui/fpg_form.pas +++ b/src/gui/fpg_form.pas @@ -51,6 +51,8 @@ type FOnHide: TNotifyEvent; FOnShow: TNotifyEvent; FOnHelp: TfpgHelpEvent; + FDNDEnabled: boolean; + procedure SetDNDEnabled(const AValue: boolean); protected FModalResult: TfpgModalResult; FParentForm: TfpgBaseForm; @@ -71,6 +73,7 @@ type procedure DoOnClose(var CloseAction: TCloseAction); virtual; function DoOnHelp(AHelpType: THelpType; AHelpContext: THelpContext; const AHelpKeyword: String; const AHelpFile: String; var AHandled: Boolean): Boolean; virtual; // properties + property DNDEnabled: boolean read FDNDEnabled write SetDNDEnabled default False; property Sizeable: boolean read FSizeable write FSizeable; property ModalResult: TfpgModalResult read FModalResult write FModalResult; property FullScreen: boolean read FFullScreen write FFullScreen default False; @@ -106,6 +109,7 @@ type TfpgForm = class(TfpgBaseForm) published property BackgroundColor; + property DNDEnabled; property FullScreen; property Height; property Hint; @@ -133,6 +137,7 @@ type property OnEnter; property OnExit; property OnHide; + property OnKeyPress; property OnMouseDown; property OnMouseEnter; property OnMouseExit; @@ -153,7 +158,11 @@ implementation uses fpg_main, fpg_popupwindow, - fpg_menu; + fpg_menu + {$IFDEF DEBUG} + ,dbugintf + {$ENDIF} + ; type // to access protected methods @@ -180,6 +189,13 @@ end; { TfpgBaseForm } +procedure TfpgBaseForm.SetDNDEnabled(const AValue: boolean); +begin + if FDNDEnabled = AValue then exit; + FDNDEnabled := AValue; + DoDNDEnabled(AValue); +end; + procedure TfpgBaseForm.SetWindowTitle(const ATitle: string); begin FWindowTitle := ATitle; @@ -188,9 +204,14 @@ end; procedure TfpgBaseForm.MsgActivate(var msg: TfpgMessageRec); begin -// writeln('BaseForm - MsgActivate'); + {$IFDEF DEBUG} + SendDebug(Classname + ' ' + Name + '.BaseForm - MsgActivate'); + {$ENDIF} if (fpgApplication.TopModalForm = nil) or (fpgApplication.TopModalForm = self) then begin + {$IFDEF DEBUG} + SendDebug('Inside if block'); + {$ENDIF} FocusRootWidget := self; if FFormDesigner <> nil then @@ -275,6 +296,7 @@ begin FModalResult := mrNone; FFullScreen := False; FIsContainer := True; + FDNDEnabled := False; end; destructor TfpgBaseForm.Destroy; @@ -386,7 +408,9 @@ var i: integer; wg: TfpgWidget; begin -// writeln(Classname, '.Keypress'); + {$IFDEF DEBUG} + SendDebug(Classname + '.Keypress'); + {$ENDIF} // find the TfpgMenuBar if not consumed then begin diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 112a1f33..320c2408 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -56,6 +56,7 @@ type property Font; property HeaderFont; published + property Align; property ColumnCount; property Columns; property FocusRow; @@ -125,6 +126,7 @@ type public property Font; published + property Align; property AlternateBGColor; property BackgroundColor; // property ColResizing; @@ -133,11 +135,13 @@ type property ColumnWidth; property DefaultColWidth; property DefaultRowHeight; + property Enabled; property FocusCol; property FocusRow; property FontDesc; property HeaderFontDesc; property HeaderHeight; + property HeaderStyle; property Hint; property Options; property ParentShowHint; diff --git a/src/gui/fpg_hyperlink.pas b/src/gui/fpg_hyperlink.pas index 2c850a97..5d84c718 100644 --- a/src/gui/fpg_hyperlink.pas +++ b/src/gui/fpg_hyperlink.pas @@ -50,6 +50,7 @@ type constructor Create(AOwner: TComponent); override; procedure GoHyperLink; published + property Align; property Alignment; property Autosize; property FontDesc; diff --git a/src/gui/fpg_iniutils.pas b/src/gui/fpg_iniutils.pas index 1c8fe45a..857ccf63 100644 --- a/src/gui/fpg_iniutils.pas +++ b/src/gui/fpg_iniutils.pas @@ -52,6 +52,7 @@ function gINI(const AFileName: string = ''): TfpgINIFile; implementation uses + fpg_base, fpg_main, fpg_constants, fpg_utils; @@ -71,12 +72,12 @@ end; constructor TfpgINIFile.CreateExt(const AFileName: string; AReadOnly: Boolean); var - lDir: string; - lFileName: string; + lDir: TfpgString; + lFileName: TfpgString; begin FReadOnly := AReadOnly; - lDir := ExtractFileDir(AFileName); - lFileName := ExtractFileName(AFileName); + lDir := fpgExtractFileDir(AFileName); + lFileName := fpgExtractFileName(AFileName); if lDir = '' then lDir := GetAppConfigDir(False); @@ -84,7 +85,7 @@ begin lDir := lDir + PathDelim; { We used a non-Global config dir, so should be able to create the dir } - if not ForceDirectories(lDir) then + if not fpgForceDirectories(lDir) then raise Exception.CreateFmt(rsErrFailedToCreateDir, [lDir]); diff --git a/src/gui/fpg_label.pas b/src/gui/fpg_label.pas index 409116b9..0f9c8b4b 100644 --- a/src/gui/fpg_label.pas +++ b/src/gui/fpg_label.pas @@ -68,9 +68,12 @@ type TfpgLabel = class(TfpgCustomLabel) published + property AcceptDrops; + property Align; property Alignment; property AutoSize; property BackgroundColor; + property Enabled; property FontDesc; property Height; property Hint; @@ -90,6 +93,10 @@ type property Width; property WrapText; property OnClick; + property OnDragEnter; + property OnDragLeave; + property OnDragDrop; + property OnDragStartDetected; property OnDoubleClick; property OnMouseDown; property OnMouseEnter; diff --git a/src/gui/fpg_listbox.pas b/src/gui/fpg_listbox.pas index 4b6d162e..a0cb8e93 100644 --- a/src/gui/fpg_listbox.pas +++ b/src/gui/fpg_listbox.pas @@ -92,8 +92,8 @@ type property AutoHeight: boolean read FAutoHeight write SetAutoHeight default False; property FocusItem: integer read FFocusItem write SetFocusItem; property FontDesc: string read GetFontDesc write SetFontDesc; - property HotTrack: boolean read FHotTrack write FHotTrack; - property PopupFrame: boolean read FPopupFrame write SetPopupFrame; + property HotTrack: boolean read FHotTrack write FHotTrack default False; + property PopupFrame: boolean read FPopupFrame write SetPopupFrame default False; property DragToReorder: boolean read FDragToReorder write FDragToReorder default False; public constructor Create(AOwner: TComponent); override; @@ -117,6 +117,8 @@ type TfpgTextListBox = class(TfpgBaseListBox) protected FItems: TStringList; + function GetText: string; virtual; + procedure SetText(const AValue: string); virtual; procedure DrawItem(num: integer; rect: TfpgRect; flags: integer); override; procedure Exchange(Index1, Index2: Integer); override; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override; @@ -125,16 +127,19 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; function ItemCount: integer; override; - function Text: string; + property Text: string read GetText write SetText stored False; end; // The standard strings listbox we will actually use in a GUI. TfpgListBox = class(TfpgTextListBox) published + property AcceptDrops; + property Align; property AutoHeight; property BackgroundColor default clListBox; property DragToReorder; + property Enabled; property FocusItem; property FontDesc; property Hint; @@ -144,8 +149,19 @@ type property PopupFrame; property ShowHint; property TabOrder; + property Text; property TextColor; + property OnChange; property OnDoubleClick; + property OnDragDrop; + property OnDragEnter; + property OnDragLeave; + property OnDragStartDetected; + property OnEnter; + property OnExit; + property OnKeyPress; + property OnScroll; + property OnSelect; property OnShowHint; end; @@ -181,7 +197,7 @@ type // procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override; property Items: TList read FItems; property Color: TfpgColor read GetColor write SetColor; - property ColorPalette: TfpgColorPalette read FColorPalette write SetColorPalette; + property ColorPalette: TfpgColorPalette read FColorPalette write SetColorPalette default cpStandardColors; property ShowColorNames: Boolean read FShowColorNames write SetShowColorNames default True; public constructor Create(AOwner: TComponent); override; @@ -192,11 +208,14 @@ type TfpgColorListBox = class(TfpgBaseColorListBox) published + property AcceptDrops; + property Align; property AutoHeight; property BackgroundColor default clListBox; property Color; property ColorPalette; property DragToReorder; + property Enabled; property FocusItem; property FontDesc; property Hint; @@ -208,6 +227,10 @@ type property ShowHint; property TabOrder; property TextColor; + property OnDragEnter; + property OnDragLeave; + property OnDragDrop; + property OnDragStartDetected; end; @@ -855,6 +878,35 @@ end; { TfpgTextListBox } +function TfpgTextListBox.GetText: string; +begin + if (ItemCount > 0) and (FocusItem <> -1) then + result := FItems[FocusItem] + else + result := ''; +end; + +procedure TfpgTextListBox.SetText(const AValue: string); +var + i: integer; +begin + if AValue = '' then + SetFocusItem(-1) // nothing selected + else + begin + for i := 0 to FItems.Count-1 do + begin + if SameText(Items.Strings[i], AValue) then + begin + SetFocusItem(i); + Exit; //==> + end; + end; + // if we get here, we didn't find a match + SetFocusItem(-1); + end; +end; + procedure TfpgTextListBox.DrawItem(num: integer; rect: TfpgRect; flags: integer); begin //if num < 0 then @@ -905,14 +957,6 @@ begin result := FItems.Count; end; -function TfpgTextListBox.Text: string; -begin - if (ItemCount > 0) and (FocusItem <> -1) then - result := FItems[FocusItem] - else - result := ''; -end; - { TColorItem } constructor TColorItem.Create (const AColorName: string; const AColorValue: TfpgColor); diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index 12ed4364..cd9268f4 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -249,7 +249,9 @@ type function AddItem: TfpgLVItem; function NewItem: TfpgLVItem; published + property Align; property Columns: TfpgLVColumns read FColumns; + property Enabled; property HScrollBar: TfpgScrollBar read FHScrollBar; property ItemHeight: Integer read GetItemHeight; property ItemIndex: Integer read FItemIndex write SetItemIndex; diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 37f21a42..789da3c3 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -60,12 +60,15 @@ type FWrapping: boolean; FLongestLineWidth: TfpgCoord; FPopupMenu: TfpgPopupMenu; + FDefaultPopupMenu: TfpgPopupMenu; + FReadOnly: Boolean; + FUpdateCount: integer; function GetFontDesc: string; procedure SetFontDesc(const AValue: string); procedure RecalcLongestLine; procedure DeleteSelection; procedure DoCopy; - procedure DoPaste; + procedure DoPaste(const AText: TfpgString); procedure AdjustCursor; function LineCount: integer; function GetLineText(linenum: integer): string; @@ -81,10 +84,21 @@ type function GetText: TfpgString; procedure SetCursorLine(aValue: integer); procedure UpdateScrollBarCoords; + procedure DefaultPopupCut(Sender: TObject); + procedure DefaultPopupCopy(Sender: TObject); + procedure DefaultPopupPaste(Sender: TObject); + procedure DefaultPopupClearAll(Sender: TObject); + procedure DefaultPopupInsertFromCharmap(Sender: TObject); + procedure SetDefaultPopupMenuItemsState; + procedure ShowDefaultPopupMenu(const x, y: integer; const shiftstate: TShiftState); virtual; + procedure SetReadOnly(const AValue: Boolean); + procedure ResetSelectionVariables; + procedure SetCursorPos(const AValue: integer); protected procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleResize(dwidth, dheight: integer); override; @@ -94,11 +108,19 @@ type procedure HandleMouseEnter; override; procedure HandleMouseExit; override; procedure HandleHide; override; + procedure RePaint; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure UpdateScrollBars; - function SelectionText: string; + function SelectionText: TfpgString; + procedure CopyToClipboard; + procedure CutToClipboard; + procedure PasteFromClipboard; + procedure Clear; + procedure BeginUpdate; + procedure EndUpdate; + property CursorPos: integer read FCursorPos write SetCursorPos; property CursorLine: integer read FCursorLine write SetCursorLine; property Font: TfpgFont read FFont; property LineHeight: integer read FLineHeight; @@ -108,11 +130,14 @@ type property UseTabs: boolean read FUseTabs write FUseTabs default False; property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; published + property Align; property BackgroundColor default clBoxColor; + property Enabled; property FontDesc: string read GetFontDesc write SetFontDesc; property Hint; property Lines: TStringList read FLines; property ParentShowHint; + property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; property ShowHint; property TabOrder; property TextColor; @@ -130,14 +155,25 @@ function CreateMemo(AOwner: TComponent; x, y, w, h: TfpgCoord): TfpgMemo; implementation uses - fpg_stringutils; + fpg_stringutils + ,fpg_constants + ,fpg_dialogs + ; + +const + // internal popupmenu item names + ipmCut = 'miDefaultCut'; + ipmCopy = 'miDefaultCopy'; + ipmPaste = 'miDefaultPaste'; + ipmClearAll = 'miDefaultClearAll'; + ipmCharmap = 'miDefaultCharmap'; + type // custom stringlist that will notify the memo of item changes TfpgMemoStrings = class(TStringList) protected Memo: TfpgMemo; - procedure RefreshMemo; public constructor Create(AMemo: TfpgMemo); reintroduce; destructor Destroy; override; @@ -149,15 +185,6 @@ type { TfpgMemoStrings } -procedure TfpgMemoStrings.RefreshMemo; -begin - if Assigned(Memo) and (Memo.HasHandle) then - begin - Memo.Invalidate; - Memo.UpdateScrollBars; - end; -end; - constructor TfpgMemoStrings.Create(AMemo: TfpgMemo); begin inherited Create; @@ -172,28 +199,30 @@ end; function TfpgMemoStrings.Add(const s: String): Integer; begin + Memo.BeginUpdate; Result := inherited Add(s); - RefreshMemo; + Memo.EndUpdate; end; procedure TfpgMemoStrings.Delete(Index: Integer); begin -// writeln('Delete''s Index = ', Index); + Memo.BeginUpdate; inherited Delete(Index); - RefreshMemo; + Memo.EndUpdate; end; procedure TfpgMemoStrings.Insert(Index: Integer; const S: string); begin -// writeln('Insert''s Index = ', Index); + Memo.BeginUpdate; inherited Insert(Index, S); - RefreshMemo; + Memo.EndUpdate; end; procedure TfpgMemoStrings.Clear; begin + Memo.BeginUpdate; inherited Clear; - RefreshMemo; + Memo.EndUpdate; end; @@ -217,13 +246,18 @@ var MaxLine: integer; yp: integer; begin - if (aValue < 0) or (aValue = FCursorLine) then + if (aValue < 0) or (aValue = FCursorLine) or (AValue > FLines.Count-1) then Exit; // wrong value + if aValue < FFirstLine then begin FFirstLine := aValue; // moves the selected line to the top of the displayed rectangle FCursorLine := aValue; FCursorPos := 0; + FSelStartPos := FCursorPos; + FSelStartLine := FCursorLine; + FSelEndLine := -1; + AdjustCursor; RePaint; Exit; end; @@ -243,15 +277,21 @@ begin FFirstLine := aValue; FCursorLine := aValue; FCursorPos := 0; + FSelStartPos := FCursorPos; + FSelStartLine := FCursorLine; + FSelEndLine := -1; + AdjustCursor; RePaint; - Exit; end else begin FCursorLine := aValue; FCursorPos := 0; + FSelStartPos := FCursorPos; + FSelStartLine := FCursorLine; + FSelEndLine := -1; + AdjustCursor; RePaint; - Exit; end; end; @@ -280,6 +320,144 @@ begin FHScrollBar.UpdateWindowPosition; end; +procedure TfpgMemo.DefaultPopupCut(Sender: TObject); +begin + if ReadOnly then + Exit; + CutToClipboard; +end; + +procedure TfpgMemo.DefaultPopupCopy(Sender: TObject); +begin + if ReadOnly then + Exit; + CopyToClipboard; +end; + +procedure TfpgMemo.DefaultPopupPaste(Sender: TObject); +begin + if ReadOnly then + Exit; + PasteFromClipboard; +end; + +procedure TfpgMemo.DefaultPopupClearAll(Sender: TObject); +begin + if ReadOnly then + Exit; + Clear; +end; + +procedure TfpgMemo.DefaultPopupInsertFromCharmap(Sender: TObject); +var + s: TfpgString; +begin + if ReadOnly then + Exit; + s := fpgShowCharMap; + if s <> '' then + DoPaste(s); +end; + +procedure TfpgMemo.SetDefaultPopupMenuItemsState; +var + i: integer; + itm: TfpgMenuItem; + b: boolean; + + function SomethingSelected: boolean; + begin + Result := SelectionText <> ''; + end; + +begin + b := SomethingSelected; + for i := 0 to FDefaultPopupMenu.ComponentCount-1 do + begin + if FDefaultPopupMenu.Components[i] is TfpgMenuItem then + begin + itm := TfpgMenuItem(FDefaultPopupMenu.Components[i]); + // enabled/disable menu items + if itm.Name = ipmCut then + itm.Enabled := (not ReadOnly) and b + else if itm.Name = ipmCopy then + itm.Enabled := b + else if itm.Name = ipmPaste then + itm.Enabled := (not ReadOnly) and (fpgClipboard.Text <> '') + else if itm.Name = ipmClearAll then + itm.Enabled := (not ReadOnly) and (Text <> '') + else if itm.Name = ipmCharmap then + itm.Enabled := (not ReadOnly); + end; + end; +end; + +procedure TfpgMemo.ShowDefaultPopupMenu(const x, y: integer; + const shiftstate: TShiftState); +var + itm: TfpgMenuItem; +begin + if not Assigned(FDefaultPopupMenu) then + begin + FDefaultPopupMenu := TfpgPopupMenu.Create(nil); + itm := FDefaultPopupMenu.AddMenuItem(rsCut, '', @DefaultPopupCut); + itm.Name := ipmCut; + itm := FDefaultPopupMenu.AddMenuItem(rsCopy, '', @DefaultPopupCopy); + itm.Name := ipmCopy; + itm := FDefaultPopupMenu.AddMenuItem(rsPaste, '', @DefaultPopupPaste); + itm.Name := ipmPaste; + itm := FDefaultPopupMenu.AddMenuItem(rsDelete, '', @DefaultPopupClearAll); + itm.Name := ipmClearAll; + itm := FDefaultPopupMenu.AddMenuItem('-', '', nil); + itm.Name := 'N1'; + itm := FDefaultPopupMenu.AddMenuItem(rsInsertFromCharacterMap, '', @DefaultPopupInsertFromCharmap); + itm.Name := ipmCharmap; + end; + + SetDefaultPopupMenuItemsState; + FDefaultPopupMenu.ShowAt(self, x, y); +end; + +procedure TfpgMemo.SetReadOnly(const AValue: Boolean); +begin + if FReadOnly = AValue then exit; + FReadOnly := AValue; + RePaint; +end; + +procedure TfpgMemo.ResetSelectionVariables; +begin + FSelecting := False; + FSelStartPos := FCursorPos; + FSelEndPos := FCursorPos; + FSelStartLine := FCursorLine; + FSelEndLine := FCursorLine; + FMouseDragging := False; +end; + +procedure TfpgMemo.SetCursorPos(const AValue: integer); +var + x: integer; +begin + if FCursorPos = AValue then + exit; + + if AValue = 0 then + FCursorPos := AValue + else + begin + x := UTF8Length(FLines[CursorLine]); + if AValue > x then { can't set Cursorpos greater than number of characters on that line } + FCursorPos := x + else + FCursorPos := AValue; + end; + FSelStartPos := FCursorPos; + FSelEndPos := FCursorPos; + AdjustCursor; + Repaint; +end; + constructor TfpgMemo.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -288,7 +466,6 @@ begin FHeight := FFont.Height * 3 + 4; FWidth := 120; FLineHeight := FFont.Height + 2; - FSelecting := False; FSideMargin := 3; FMaxLength := 0; FWrapping := False; @@ -299,19 +476,18 @@ begin FTabWidth := 4; FMinWidth := 20; FMinHeight := 30; + FPopupMenu := nil; + FDefaultPopupMenu := nil; + FReadOnly := False; + FUpdateCount := 0; FLines := TfpgMemoStrings.Create(self); FFirstLine := 0; FCursorLine := 0; - FCursorPos := 0; - FSelStartPos := FCursorPos; - FSelEndPos := 0; - FSelStartLine := -1; - FSelEndLine := -1; + ResetSelectionVariables; FDrawOffset := 0; - FMouseDragging := False; FVScrollBar := TfpgScrollBar.Create(self); FVScrollBar.Orientation := orVertical; @@ -327,6 +503,8 @@ end; destructor TfpgMemo.Destroy; begin + if Assigned(FDefaultPopupMenu) then + FDefaultPopupMenu.Free; TfpgMemoStrings(FLines).Free; FFont.Free; inherited Destroy; @@ -362,6 +540,8 @@ var len: integer; st: integer; begin + if ReadOnly then + Exit; if FSelEndLine < 0 then Exit; @@ -410,84 +590,42 @@ begin FCursorPos := selsp; FCursorLine := selsl; + FSelStartPos := FCursorPos; + FSelEndPos := FCursorPos; + FSelStartLine := selsl; FSelEndLine := -1; end; procedure TfpgMemo.DoCopy; -var - n: integer; - selsl: integer; - selsp: integer; - selel: integer; - selep: integer; - ls: string; - len: integer; - st: integer; - s: string; begin if FSelEndLine < 0 then Exit; - if (FSelStartLine shl 16) + FSelStartPos <= (FSelEndLine shl 16) + FSelEndPos then - begin - selsl := FSelStartLine; - selsp := FSelStartPos; - selel := FSelEndLine; - selep := FSelEndPos; - end - else - begin - selel := FSelStartLine; - selep := FSelStartPos; - selsl := FSelEndLine; - selsp := FSelEndPos; - end; - - s := ''; - - for n := selsl to selel do - begin - if n > selsl then - s := s + #13#10; - - ls := GetLineText(n); - - if selsl < n then - st := 0 - else - st := selsp; - - if selel > n then - len := UTF8Length(ls) - else - len := selep - st; - - s := s + UTF8Copy(ls, st + 1, len); - end; - - //SetClipboardText(s); + fpgClipboard.Text := SelectionText; end; -procedure TfpgMemo.DoPaste; -{ +procedure TfpgMemo.DoPaste(const AText: TfpgString); var - s: string; - si: string; - si8: string; - lineend: string; + s: TfpgString; + si: TfpgString; { beginning of line to cursor } + si8: TfpgString; + lineend: TfpgString; { from cursor to end of line } n: integer; l: integer; lcnt: integer; -} begin - Exit; - (* + if ReadOnly then + Exit; DeleteSelection; - s := GetClipboardText; + s := AText; si := UTF8Copy(CurrentLine,1,FCursorPos); lineend := UTF8Copy(CurrentLine,FCursorPos+1, UTF8Length(CurrentLine)); - l := FCursorLine; + if FCursorLine = -1 then { first time in, FLines has no data yet } + l := 0 + else + l := FCursorLine; + n := 1; lcnt := 0; si8 := ''; @@ -495,8 +633,10 @@ begin begin if (s[n] = #13) or (s[n] = #10) then begin - if lcnt = 0 then SetLineText(l, si + si8) - else FLines.Insert(l-1, si + si8); + if lcnt = 0 then + SetLineText(l, si + si8) + else + FLines.Insert(l, si + si8); si := ''; si8 := ''; @@ -524,13 +664,13 @@ begin end else begin - FLines.Insert(l-1, si); + FLines.Insert(l, si); FCursorLine := l; end; AdjustCursor; + ResetSelectionVariables; Repaint; -*) end; procedure TfpgMemo.AdjustCursor; @@ -747,6 +887,12 @@ begin inherited; end; +procedure TfpgMemo.RePaint; +begin + if FUpdateCount <= 0 then + inherited RePaint; +end; + procedure TfpgMemo.VScrollBarMove(Sender: TObject; position: integer); begin if FFirstLine <> position then @@ -783,7 +929,7 @@ begin InflateRect(r, -2, -2); Canvas.SetClipRect(r); - if Enabled then + if Enabled and not ReadOnly then Canvas.SetColor(FBackgroundColor) else Canvas.SetColor(clWindowBackground); @@ -895,31 +1041,35 @@ begin prevval := Text; s := AText; - // Printable characters only - // Note: This is now UTF-8 compliant! - if (Ord(AText[1]) > 31) and (Ord(AText[1]) < 127) or (Length(AText) > 1) then + if (not consumed) and (not ReadOnly) then begin - if (FMaxLength <= 0) or (UTF8Length(FLines.Text) < FMaxLength) then + // Printable characters only + // Note: This is now UTF-8 compliant! + if (Ord(AText[1]) > 31) and (Ord(AText[1]) < 127) or (Length(AText) > 1) then begin - if FCursorLine < 0 then - FCursorLine := 0; - DeleteSelection; - ls := GetLineText(FCursorLine); - UTF8Insert(s, ls, FCursorPos + 1); - SetLineText(FCursorLine, ls); - Inc(FCursorPos); - FSelStartPos := FCursorPos; - FSelStartLine := FCursorLine; - FSelEndLine := -1; - AdjustCursor; + if (FMaxLength <= 0) or (UTF8Length(FLines.Text) < FMaxLength) then + begin + if FCursorLine < 0 then + FCursorLine := 0; + DeleteSelection; + ls := GetLineText(FCursorLine); + UTF8Insert(s, ls, FCursorPos + 1); + SetLineText(FCursorLine, ls); + Inc(FCursorPos); + FSelStartPos := FCursorPos; + FSelStartLine := FCursorLine; + FSelEndLine := -1; + AdjustCursor; + end; + + consumed := True; end; - consumed := True; + if prevval <> Text then + if Assigned(FOnChange) then + FOnChange(self); end; - if prevval <> Text then - if Assigned(FOnChange) then - FOnChange(self); if consumed then RePaint; @@ -932,15 +1082,8 @@ var ls: string; ls2: string; hasChanged: boolean; - - procedure StopSelection; - begin - FSelStartLine := FCursorLine; - FSelStartPos := FCursorPos; - FSelEndLine := -1; - end; - begin + fpgApplication.HideHint; Consumed := True; hasChanged := False; case CheckClipBoardKey(keycode, shiftstate) of @@ -950,14 +1093,19 @@ begin end; ckPaste: begin - DoPaste; - hasChanged := True; + DoPaste(fpgClipboard.Text); + if not ReadOnly then + hasChanged := True; end; ckCut: begin DoCopy; DeleteSelection; - hasChanged := True; + if not ReadOnly then + begin + AdjustCursor; + hasChanged := True; + end; end; else Consumed := False; @@ -974,7 +1122,6 @@ begin if FCursorPos > 0 then begin Dec(FCursorPos); - if (ssCtrl in shiftstate) then // word search... (* @@ -984,14 +1131,12 @@ begin while (FCursorPos > 0) and pgfIsAlphaNum(copy(CurrentLine,FCursorPos,1)) do Dec(FCursorPos); *); - end;// left keyRight: if FCursorPos < UTF8Length(CurrentLine) then begin Inc(FCursorPos); - if (ssCtrl in shiftstate) then // word search... (* @@ -1001,7 +1146,6 @@ begin while (FCursorPos < length(CurrentLine)) and not pgfIsAlphaNum(copy(CurrentLine,FCursorPos+1,1)) do Inc(FCursorPos); *); - end;// right keyUp: @@ -1074,11 +1218,11 @@ begin FSelEndLine := FCursorLine; end else - StopSelection; + ResetSelectionVariables; end; end; - if not Consumed then + if (not Consumed) and (not ReadOnly) then begin consumed := True; @@ -1118,7 +1262,7 @@ begin keyDelete: begin ls := GetLineText(FCursorLine); - if FSelEndLine > -1 then + if SelectionText <> '' then DeleteSelection else if FCursorPos < UTF8Length(ls) then begin @@ -1165,8 +1309,8 @@ begin if Consumed then begin - StopSelection; AdjustCursor; + ResetSelectionVariables; end; end; @@ -1190,6 +1334,7 @@ var ls: string; begin inherited HandleLMouseDown(x, y, shiftstate); + ResetSelectionVariables; // searching the appropriate character position lnum := FFirstLine + (y - FSideMargin) div LineHeight; @@ -1219,9 +1364,11 @@ begin begin FSelEndLine := lnum; FSelEndpos := cp; + FSelecting := True; end else begin + FSelecting := False; FSelStartLine := lnum; FSelStartPos := cp; FSelEndLine := -1; @@ -1229,11 +1376,22 @@ begin Repaint; end; +procedure TfpgMemo.HandleRMouseDown(x, y: integer; shiftstate: TShiftState); +begin + // keyMenu was pressed + if shiftstate = [ssExtra1] then + HandleRMouseUp(x, y, []) + else + inherited HandleRMouseDown(x, y, shiftstate); +end; + procedure TfpgMemo.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); begin inherited HandleRMouseUp(x, y, shiftstate); if Assigned(PopupMenu) then - PopupMenu.ShowAt(self, x, y); + PopupMenu.ShowAt(self, x, y) + else + ShowDefaultPopupMenu(x, y, ShiftState); end; procedure TfpgMemo.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); @@ -1276,6 +1434,7 @@ begin FSelEndLine := lnum; FSelEndPos := cp; FCursorPos := cp; + FSelecting := True; Repaint; end; @@ -1396,23 +1555,105 @@ begin end; end; -function TfpgMemo.SelectionText: string; +function TfpgMemo.SelectionText: TfpgString; +var + n: integer; + selsl: integer; + selsp: integer; + selel: integer; + selep: integer; + ls: string; + len: integer; + st: integer; + s: TfpgString; begin - { - if FSelOffset <> 0 then + if (FSelStartLine shl 16) + FSelStartPos <= (FSelEndLine shl 16) + FSelEndPos then begin - if FSelOffset < 0 then - begin - Result := Copy(FText,1+FSelStart + FSelOffset,-FSelOffset); - end - else - begin - result := Copy(FText,1+FSelStart,FSelOffset); - end; + selsl := FSelStartLine; + selsp := FSelStartPos; + selel := FSelEndLine; + selep := FSelEndPos; end else -} - Result := ''; + begin + selel := FSelStartLine; + selep := FSelStartPos; + selsl := FSelEndLine; + selsp := FSelEndPos; + end; + + s := ''; + for n := selsl to selel do + begin + if n > selsl then + s := s + LineEnding; + + ls := GetLineText(n); + + if selsl < n then + st := 0 + else + st := selsp; + + if selel > n then + len := UTF8Length(ls) + else + len := selep - st; + + s := s + UTF8Copy(ls, st + 1, len); + end; + + Result := s; +end; + +procedure TfpgMemo.CopyToClipboard; +begin + DoCopy; +end; + +procedure TfpgMemo.CutToClipboard; +begin + DoCopy; + DeleteSelection; + AdjustCursor; + ResetSelectionVariables; + RePaint; +end; + +procedure TfpgMemo.PasteFromClipboard; +begin + DoPaste(fpgClipboard.Text); +end; + +procedure TfpgMemo.Clear; +begin + FLines.Clear; + { not sure if all of these are required } + FFirstLine := 0; + FCursorLine := 0; + FCursorPos := 0; + FSelStartPos := FCursorPos; + FSelEndPos := 0; + FSelStartLine := -1; + FSelEndLine := -1; + FDrawOffset := 0; + + Repaint; +end; + +procedure TfpgMemo.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TfpgMemo.EndUpdate; +begin + Dec(FUpdateCount); + if FUpdateCount <= 0 then + begin + Invalidate; + UpdateScrollBars; + end; end; function TfpgMemo.GetText: TfpgString; diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas index 06e64b6f..dbe3a90a 100644 --- a/src/gui/fpg_menu.pas +++ b/src/gui/fpg_menu.pas @@ -123,7 +123,7 @@ type procedure HandlePaint; override; procedure HandleShow; override; procedure HandleClose; override; - procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean); virtual; + procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect; AFlags: TfpgMenuItemFlags); virtual; procedure DrawRow(line: integer; const AItemFocused: boolean); virtual; function ItemHeight(mi: TfpgMenuItem): integer; virtual; procedure PrepareToShow; @@ -150,10 +150,13 @@ type FMenuOptions: TfpgMenuOptions; FPrevFocusItem: integer; FFocusItem: integer; + FClicked: Boolean; + FLastItemClicked: integer; procedure SetFocusItem(const AValue: integer); procedure DoSelect; procedure CloseSubmenus; function ItemWidth(mi: TfpgMenuItem): integer; + procedure InternalReset; protected FItems: TList; // stores visible items only property FocusItem: integer read FFocusItem write SetFocusItem; @@ -407,6 +410,8 @@ var begin inherited HandleMouseMove(x, y, btnstate, shiftstate); + newf := CalcMouseCol(x); + // process menu options if mnuo_nofollowingmouse in FMenuOptions then begin @@ -415,17 +420,19 @@ begin end else if mnuo_autoopen in FMenuOptions then begin - if not Focused then - ActivateMenu; +// if not Focused then + FLastItemClicked := newf; + FClicked := True; + ActivateMenu; end else begin - if not Focused then - Exit; + if not FClicked then + exit + else + FLastItemClicked := newf; end; - - newf := CalcMouseCol(x); if not VisibleItem(newf).Selectable then Exit; //==> @@ -452,17 +459,31 @@ begin if ComponentCount = 0 then Exit; // We have no menu items in MainMenu. + + newf := CalcMouseCol(x); + if (FLastItemClicked <> -1) and (FLastItemClicked <> newf) then + begin + // do nothing + //FClicked := not FClicked + end + else + begin + if VisibleItem(newf).Selectable then + FClicked := not FClicked; + end; - if not Focused then + if FClicked then + begin ActivateMenu; - //else - //begin - //CloseSubmenus; - //DeActivateMenu; - //Exit; //==> - //end; - - newf := CalcMouseCol(x); + FLastItemClicked := newf; + end + else + begin + CloseSubmenus; + DeActivateMenu; + FLastItemClicked := -1; + exit; //==> + end; if not VisibleItem(newf).Selectable then Exit; //==> @@ -531,7 +552,9 @@ begin FBeforeShow := nil; FFocusItem := -1; FPrevFocusItem := -1; + FLastItemClicked := -1; FFocusable := False; + FClicked := False; FBackgroundColor := Parent.BackgroundColor; FTextColor := Parent.TextColor; // calculate the best height based on font @@ -554,6 +577,12 @@ begin Result := fpgStyle.MenuFont.TextWidth(mi.Text) + (2*6); end; +procedure TfpgMenuBar.InternalReset; +begin + FClicked := False; + FLastItemClicked := -1; +end; + procedure TfpgMenuBar.DrawColumn(col: integer; focus: boolean); var n: integer; @@ -736,6 +765,7 @@ begin Result:= TfpgMenuItem(Components[AMenuPos]); end; + { TfpgPopupMenu } procedure TfpgPopupMenu.DoSelect; @@ -765,7 +795,11 @@ begin op.Close; op := op.OpenerPopup; end; + // notify menubar that we clicked a menu item + if Assigned(OpenerMenuBar) then + OpenerMenuBar.InternalReset; VisibleItem(FFocusItem).Click; + FFocusItem := -1; end; { if/else } // if OpenerMenuBar <> nil then @@ -1017,35 +1051,32 @@ begin Result := TfpgMenuItem(FItems.Items[ind]); end; -procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean); +procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect; AFlags: TfpgMenuItemFlags); var s: string; x: integer; img: TfpgImage; + lFlags: TfpgMenuItemFlags; begin + lFlags := AFlags; if mi.Separator then begin - Canvas.SetColor(clShadow1); - Canvas.DrawLine(rect.Left+1, rect.Top+2, rect.Right, rect.Top+2); - Canvas.SetColor(clHilite2); - Canvas.DrawLine(rect.Left+1, rect.Top+3, rect.Right, rect.Top+3); + fpgStyle.DrawMenuItemSeparator(Canvas, rect); end else begin // process Check mark if needed if mi.Checked then begin - img := fpgImages.GetImage('stdimg.check'); // Do NOT localize - if AItemFocused then - img.Invert; - Canvas.DrawImage(rect.Left, rect.Top, img); - if AItemFocused then - img.Invert; // restore image to original state + lFlags := lFlags + [mifChecked]; + fpgStyle.DrawMenuItemImage(Canvas, rect.Left, rect.Top, rect, lFlags); + lFlags := lFlags - [mifChecked]; end; // process menu item Text x := rect.Left + FSymbolWidth + FTextMargin; mi.DrawText(Canvas, x+cImgWidth, rect.top, cImgWidth); + Canvas.SetColor(Canvas.TextColor); // reset text default color // process menu item Hot Key text if mi.HotKeyDef <> '' then @@ -1057,10 +1088,9 @@ begin // process menu item submenu arrow image if mi.SubMenu <> nil then begin - Canvas.SetColor(Canvas.TextColor); - x := (rect.height div 2) - 3; - img := fpgImages.GetImage('sys.sb.right'); // Do NOT localize - Canvas.DrawImage(rect.right-x-2, rect.Top + ((rect.Height-img.Height) div 2), img); + lFlags := lFlags + [mifSubMenu]; + fpgStyle.DrawMenuItemImage(Canvas, rect.Left, rect.Top, rect, lFlags); + lFlags := lFlags - [mifSubMenu]; end; end; end; @@ -1070,25 +1100,33 @@ var n: integer; r: TfpgRect; mi: TfpgMenuItem; + lFlags: TfpgMenuItemFlags; begin - Canvas.BeginDraw; r.SetRect(FMargin, FMargin, FWidth-(2*FMargin), FHeight-(2*FMargin)); for n := 0 to VisibleCount-1 do begin mi := VisibleItem(n); - + lFlags := []; r.height := ItemHeight(mi); if line = n then begin + if AItemFocused then + lFlags := [mifSelected]; // refering to menu item in active popup menu + if mi.Separator then + lFlags := lFlags + [mifSeparator]; if AItemFocused and (not mi.Separator) then begin - if MenuFocused then + if MenuFocused then // refering to popup menu window begin + lFlags := lFlags + [mifHasFocus]; Canvas.SetColor(clSelection); if mi.Selectable then - Canvas.SetTextColor(clSelectionText) + begin + lFlags := lFlags + [mifEnabled]; + Canvas.SetTextColor(clSelectionText); + end else Canvas.SetTextColor(clMenuDisabled); end @@ -1102,6 +1140,7 @@ begin begin if mi.Enabled then begin + lFlags := lFlags + [mifEnabled]; Canvas.SetColor(BackgroundColor); Canvas.SetTextColor(clMenuText); end @@ -1111,9 +1150,9 @@ begin Canvas.SetTextColor(clMenuDisabled); end; end; - Canvas.FillRectangle(r); - DrawItem(mi, r, AItemFocused); - Canvas.EndDraw(r.Left, r.Top, r.Width, r.Height); + fpgStyle.DrawMenuRow(Canvas, r, lFlags); + DrawItem(mi, r, lFlags); + Exit; //==> end; inc(r.Top, ItemHeight(mi) ); diff --git a/src/gui/fpg_panel.pas b/src/gui/fpg_panel.pas index b58b516d..66ed5778 100644 --- a/src/gui/fpg_panel.pas +++ b/src/gui/fpg_panel.pas @@ -73,8 +73,11 @@ type protected procedure HandlePaint; override; published + property AcceptDrops; + property Align; property BackgroundColor; property BorderStyle; + property Enabled; property Height; property Hint; property Left; @@ -91,6 +94,10 @@ type property Width; property OnClick; property OnDoubleClick; + property OnDragDrop; + property OnDragEnter; + property OnDragLeave; + property OnDragStartDetected; property OnMouseDown; property OnMouseMove; property OnMouseUp; @@ -129,9 +136,12 @@ type destructor Destroy; override; property Font: TfpgFont read FFont; published + property AcceptDrops; + property Align; property Alignment: TAlignment read GetAlignment write SetAlignment default taCenter; property BackgroundColor; property BorderStyle; + property Enabled; property FontDesc: string read GetFontDesc write SetFontDesc; property Height; property Hint; @@ -154,6 +164,11 @@ type property WrapText: boolean read GetWrapText write SetWrapText default False; property OnClick; property OnDoubleClick; + property OnDragDrop; + property OnDragEnter; + property OnDragLeave; + property OnDragStartDetected; + property OnPaint; property OnShowHint; end; @@ -180,9 +195,12 @@ type function GetClientRect: TfpgRect; override; property Font: TfpgFont read FFont; published + property AcceptDrops; + property Align; property Alignment: TAlignment read GetAlignment write SetAlignment default taLeftJustify; property BackgroundColor; property BorderStyle; + property Enabled; property FontDesc: string read GetFontDesc write SetFontDesc; property Height; property Hint; @@ -201,6 +219,11 @@ type property Width; property OnClick; property OnDoubleClick; + property OnDragDrop; + property OnDragEnter; + property OnDragLeave; + property OnDragStartDetected; + property OnPaint; property OnShowHint; end; @@ -209,7 +232,7 @@ function CreateBevel(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord AStyle: TPanelStyle): TfpgBevel; function CreatePanel(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; AText: string; - AStyle: TPanelStyle; AALignment: TAlignment= taCenter; ALayout: TLayout= tlCenter; + AStyle: TPanelStyle = bsRaised; AALignment: TAlignment= taCenter; ALayout: TLayout= tlCenter; AMargin: integer= 2; ALineSpace: integer= 2): TfpgPanel; function CreateGroupBox(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; AText: string; @@ -333,21 +356,24 @@ begin else Canvas.SetLineStyle(2, lsSolid); + { top } if FPanelBorder = bsSingle then Canvas.DrawLine(0, 0, Width - 1, 0) else Canvas.DrawLine(0, 1, Width - 1, 1); + { left } if FPanelBorder = bsSingle then Canvas.DrawLine(0, 1, 0, Height - 1) else Canvas.DrawLine(1, 1, 1, Height - 1); if Style = bsRaised then - Canvas.SetColor(clShadow2) + Canvas.SetColor(clShadow1) else Canvas.SetColor(clHilite2); + { right, then bottom } Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); Canvas.DrawLine(0, Height - 1, Width, Height - 1); end; @@ -597,7 +623,7 @@ begin if Style = bsRaised then Canvas.SetColor(clHilite2) else - Canvas.SetColor(clShadow2); + Canvas.SetColor(clShadow1); if FPanelBorder = bsSingle then begin @@ -611,7 +637,7 @@ begin end; if Style = bsRaised then - Canvas.SetColor(clShadow2) + Canvas.SetColor(clShadow1) else Canvas.SetColor(clHilite2); diff --git a/src/gui/fpg_popupcalendar.pas b/src/gui/fpg_popupcalendar.pas index af27568b..ea6eb617 100644 --- a/src/gui/fpg_popupcalendar.pas +++ b/src/gui/fpg_popupcalendar.pas @@ -221,12 +221,14 @@ type public constructor Create(AOwner: TComponent); override; published + property Align; property BackgroundColor; { Clicking on calendar Today button will close the popup calendar by default } property CloseOnSelect: boolean read FCloseOnSelect write SetCloseOnSelect default True; property DateFormat: string read FDateFormat write SetDateFormat; property DateValue: TDateTime read FDate write SetDateValue; property DayColor: TfpgColor read FDayColor write SetDayColor; + property Enabled; property FontDesc; property Hint; property HolidayColor: TfpgColor read FHolidayColor write SetHolidayColor; diff --git a/src/gui/fpg_progressbar.pas b/src/gui/fpg_progressbar.pas index ee6b2405..e106577c 100644 --- a/src/gui/fpg_progressbar.pas +++ b/src/gui/fpg_progressbar.pas @@ -60,7 +60,9 @@ type TfpgProgressBar = class(TfpgCustomProgressBar) published + property Align; property BackgroundColor default $c4c4c4; + property Enabled; property Hint; property ShowCaption; property Max; diff --git a/src/gui/fpg_radiobutton.pas b/src/gui/fpg_radiobutton.pas index 9410a000..e04a2b2c 100644 --- a/src/gui/fpg_radiobutton.pas +++ b/src/gui/fpg_radiobutton.pas @@ -61,9 +61,11 @@ type destructor Destroy; override; property Font: TfpgFont read FFont; published + property Align; property AutoSize: boolean read FAutoSize write SetAutoSize default False; property BackgroundColor; property Checked: boolean read FChecked write SetChecked default False; + property Enabled; property FontDesc: string read GetFontDesc write SetFontDesc; property Hint; property BoxLayout: TBoxLayout read GetBoxLayout write SetBoxLayout default tbLeftBox; diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 55db9f59..dd0a4c7c 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -43,7 +43,6 @@ type TfpgScrollBarPart = (sbpNone, sbpUpBack, sbpPageUpBack, sbpSlider, sbpDownForward, sbpPageDownForward); - { TfpgScrollBar } TfpgScrollBar = class(TfpgWidget) private @@ -72,7 +71,7 @@ type FMousePosition: TPoint; FOnScroll: TScrollNotifyEvent; procedure ScrollTimer(Sender: TObject); - procedure DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False); virtual; + procedure DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False; const ButtonEnabled: Boolean= True); virtual; procedure DrawSlider(recalc: boolean); virtual; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; @@ -98,6 +97,8 @@ type property Min: integer read FMin write SetMin default 0; property Max: integer read FMax write SetMax default 100; property OnScroll: TScrollNotifyEvent read FOnScroll write FOnScroll; + published + property Align; end; @@ -139,13 +140,13 @@ begin Canvas.BeginDraw; // Do not remove - Scrollbars do painting outside HandlePaint as well! if Orientation = orVertical then begin - DrawButton(0, 0, Width, Width, 'sys.sb.up', FScrollbarDownPart = sbpUpBack); - DrawButton(0, Height-Width, Width, Width, 'sys.sb.down', FScrollbarDownPart = sbpDownForward); + DrawButton(0, 0, Width, Width, 'sys.sb.up', (FScrollbarDownPart = sbpUpBack) and (FPosition <> FMin), (FPosition <> FMin) and (Parent.Enabled)); + DrawButton(0, Height-Width, Width, Width, 'sys.sb.down', (FScrollbarDownPart = sbpDownForward) and (FPosition <> FMax), (FPosition <> FMax) and (Parent.Enabled)); end else begin - DrawButton(0, 0, Height, Height, 'sys.sb.left', FScrollbarDownPart = sbpUpBack); - DrawButton(Width-Height, 0, Height, Height, 'sys.sb.right', FScrollbarDownPart = sbpDownForward); + DrawButton(0, 0, Height, Height, 'sys.sb.left', (FScrollbarDownPart = sbpUpBack) and (FPosition <> FMin), (FPosition <> FMin) and (Parent.Enabled)); + DrawButton(Width-Height, 0, Height, Height, 'sys.sb.right', (FScrollbarDownPart = sbpDownForward) and (FPosition <> FMax), (FPosition <> FMax) and (Parent.Enabled)); end; DrawSlider(FRecalc); @@ -323,9 +324,9 @@ begin end; // only called from inside HandlePaint so no need for BeginDraw..EndDraw calls -procedure TfpgScrollBar.DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False); +procedure TfpgScrollBar.DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False; const ButtonEnabled: Boolean= True); var - img: TfpgImage; + img, imgdisabled: TfpgImage; dx: integer; dy: integer; begin @@ -344,7 +345,16 @@ begin Canvas.SetColor(clText1); img := fpgImages.GetImage(imgname); if img <> nil then - Canvas.DrawImage(x + w div 2 - (img.Width div 2) + dx, y + h div 2 - (img.Height div 2) + dy, img); + begin + if ButtonEnabled then + Canvas.DrawImage(x + w div 2 - (img.Width div 2) + dx, y + h div 2 - (img.Height div 2) + dy, img) + else + begin + imgdisabled := img.CreateDisabledImage; + Canvas.DrawImage(x + w div 2 - (img.Width div 2) + dx, y + h div 2 - (img.Height div 2) + dy, imgdisabled); + imgdisabled.Free; + end; + end; end; // only called from inside HandlePaint so no need for BeginDraw..EndDraw calls @@ -516,14 +526,13 @@ begin if FScrollbarDownPart = sbpSlider then begin FSliderDragStart := FSliderPos; - Invalidate; //DrawSlider(False); + Invalidate; end else if not (FScrollbarDownPart in [sbpNone, sbpSlider]) then begin FScrollTimer.Interval := 300; FScrollTimer.Enabled := True; - - Invalidate; //HandlePaint; + Invalidate; end; end; @@ -540,7 +549,7 @@ begin FScrollbarDownPart := sbpNone; if WasPressed then - Invalidate; //HandlePaint; + Invalidate; end; procedure TfpgScrollBar.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); diff --git a/src/gui/fpg_spinedit.pas b/src/gui/fpg_spinedit.pas index 21548f97..99c4e697 100644 --- a/src/gui/fpg_spinedit.pas +++ b/src/gui/fpg_spinedit.pas @@ -327,10 +327,7 @@ end; procedure TfpgAbstractSpinEdit.HandlePaint; begin - Canvas.Clear(BackgroundColor); - if FButtonUp.HasHandle then - fpgPostMessage(self, FButtonUp, FPGM_PAINT); -// FButtonDown.Invalidate; + Canvas.Clear(BackgroundColor); end; procedure TfpgAbstractSpinEdit.HandleResize(AWidth, AHeight: TfpgCoord); @@ -385,15 +382,11 @@ var begin r := AButton.GetClientRect; - InflateRect(r, -1, -1); // button borders + InflateRect(r, -2, -2); // button borders if AButton.Down then OffsetRect(r, 1, 1); - // TfpgRect to TRect - Result.Left := r.Left; - Result.Top := r.Top; - Result.Right := r.Right; - Result.Bottom := r.Bottom; + Result := fpgRectToRect(r); end; procedure TfpgAbstractSpinEdit.ButtonUpPaint(Sender: TObject); @@ -707,6 +700,11 @@ begin begin FValue := FValue + FIncrement; FEdit.Value := FValue; + end + else if not IsMaxLimitReached then + begin + FValue := FMaxValue; + FEdit.Value := FValue; end; if KeyCode = KeyDown then @@ -714,6 +712,11 @@ begin begin FValue := FValue - FIncrement; FEdit.Value := FValue; + end + else if not IsMinLimitReached then + begin + FValue := FMinValue; + FEdit.Value := FValue; end; if KeyCode = KeyPageUp then @@ -1110,9 +1113,13 @@ begin begin FValue := 0; FEdit.Value := FValue; + DoOnChange; end else if (StrToInt(FEdit.Text) <= FMaxValue) and (StrToInt(FEdit.Text) >= FMinValue) then - FValue := FEdit.Value + begin + FValue := FEdit.Value; + DoOnChange; + end else FEdit.Value := FValue; @@ -1121,6 +1128,13 @@ begin begin Inc(FValue, FIncrement); FEdit.Value := FValue; + DoOnChange; + end + else if not IsMaxLimitReached then + begin + FValue := FMaxValue; + FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyDown then @@ -1128,18 +1142,27 @@ begin begin Dec(FValue, FIncrement); FEdit.Value := FValue; + DoOnChange; + end + else if not IsMinLimitReached then + begin + FValue := FMinValue; + FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyPageUp then begin FValue := FMaxValue; FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyPageDown then begin FValue := FMinValue; FEdit.Value := FValue; + DoOnChange; end; EnableButtons; diff --git a/src/gui/fpg_splitter.pas b/src/gui/fpg_splitter.pas index 6094656b..8790b58e 100644 --- a/src/gui/fpg_splitter.pas +++ b/src/gui/fpg_splitter.pas @@ -28,14 +28,11 @@ uses fpg_main, fpg_widget; -const - clColorGrabBar = $839EFE; // Pale navy blue - cSplitterWidth = 8; type - NaturalNumber = 1..High(Integer); + TfpgSnapEvent = procedure(Sender: TObject; const AClosed: boolean) of object; TfpgSplitter = class(TfpgWidget) private @@ -49,18 +46,21 @@ type FOldSize: Integer; FSplit: Integer; FMouseOver: Boolean; + FOnSnap: TfpgSnapEvent; procedure CalcSplitSize(X, Y: Integer; out NewSize, Split: Integer); function FindControl: TfpgWidget; procedure SetColorGrabBar(const AValue: TfpgColor); procedure UpdateControlSize; procedure UpdateSize(const X, Y: Integer); protected + procedure DoOnSnap(const AClosed: Boolean); function DoCanResize(var NewSize: Integer): Boolean; virtual; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleMouseEnter; override; procedure HandleMouseExit; override; + procedure HandleDoubleClick(x, y: integer; button: word; shiftstate: TShiftState); override; procedure HandlePaint; override; procedure StopSizing; dynamic; Procedure DrawGrabBar(ARect: TfpgRect); virtual; @@ -68,7 +68,10 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; published - property ColorGrabBar: TfpgColor read FColorGrabBar write SetColorGrabBar default clColorGrabBar; + property Align; + property AutoSnap: boolean read FAutoSnap write FAutoSnap default True; + property ColorGrabBar: TfpgColor read FColorGrabBar write SetColorGrabBar default clSplitterGrabBar; + property OnSnap: TfpgSnapEvent read FOnSnap write FOnSnap; end; function CreateSplitter(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; @@ -76,6 +79,10 @@ function CreateSplitter(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCo implementation +const + cSplitterWidth = 8; + + function CreateSplitter(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; AnAlign: TAlign): TfpgSplitter; begin @@ -127,12 +134,11 @@ var r: TfpgRect; begin Result := nil; - p := Point(Left, Top); case Align of - alLeft: Dec(p.X); - alRight: Inc(p.X, Width); - alTop: Dec(p.Y); - alBottom: Inc(p.Y, Height); + alLeft: p := Point(Left-2, Top + (Height div 2)); + alRight: p := Point(Right+2, Top + (Height div 2)); + alTop: p := Point(Left + (Width div 2), Top-2); + alBottom: p := Point(Left + (Width div 2), Bottom+2); else Exit; end; @@ -174,16 +180,10 @@ begin begin case Align of alLeft, alRight: -// FControl.Width := FNewSize; // (1) - FControl.SetPosition(FControl.Left, FControl.Top, FNewSize, FControl.Height); // (2) + FControl.SetPosition(FControl.Left, FControl.Top, FNewSize, FControl.Height); alTop, alBottom: -// FControl.Height := FNewSize; // (1) - FControl.SetPosition(FControl.Left, FControl.Top, FControl.Width, FNewSize); // (2) + FControl.SetPosition(FControl.Left, FControl.Top, FControl.Width, FNewSize); end; -// FControl.UpdateWindowPosition; // (1) - // vvzh: - // Lines marked with (1) work wrong under Linux (e.g. folding/unfolding Memo1) - // Lines marked with (2) work OK under both platforms. Why? Parent.Realign; // if Assigned(FOnMoved) then FOnMoved(Self); FOldSize := FNewSize; @@ -195,12 +195,21 @@ begin CalcSplitSize(X, Y, FNewSize, FSplit); end; +procedure TfpgSplitter.DoOnSnap(const AClosed: Boolean); +begin + if Assigned(FOnSnap) then + FOnSnap(self, AClosed); +end; + function TfpgSplitter.DoCanResize(var NewSize: Integer): Boolean; begin // Result := CanResize(NewSize); // omit onCanResize call Result := True; if Result and (NewSize <= FMinSize) and FAutoSnap then + begin NewSize := 0; + DoOnSnap(NewSize = 0); + end; end; procedure TfpgSplitter.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); @@ -238,7 +247,9 @@ begin Inc(FMaxSize, FControl.Height); end; UpdateSize(X, Y); + CaptureMouse; + {AllocateLineDC; with ValidParentForm(Self) do if ActiveControl <> nil then @@ -304,13 +315,40 @@ begin Repaint; end; +procedure TfpgSplitter.HandleDoubleClick(x, y: integer; button: word; + shiftstate: TShiftState); +begin + inherited HandleDoubleClick(x, y, button, shiftstate); + if FAutoSnap then + begin + if FNewSize = 0 then + begin + FNewSize := FMinSize+1; + DoCanResize(FNewSize); + end + else + begin + FNewSize := 0; + DoCanResize(FNewSize); + end; + end; +end; + procedure TfpgSplitter.HandlePaint; var lRect: TfpgRect; begin Canvas.SetColor(clWindowBackground); Canvas.FillRectangle(GetClientRect); - + + { just to make it's borders more visible in the designer } + if csDesigning in ComponentState then + begin + Canvas.SetColor(clInactiveWgFrame); + Canvas.SetLineStyle(1, lsDash); + Canvas.DrawRectangle(0, 0, Width, Height); + end; + case Align of alRight, alLeft: @@ -459,7 +497,7 @@ begin // FResizeStyle := rsPattern; FOldSize := -1; FMouseOver := False; - FColorGrabBar := clColorGrabBar; + FColorGrabBar := clSplitterGrabBar; end; destructor TfpgSplitter.Destroy; diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas index 9999fa83..66f73d2d 100644 --- a/src/gui/fpg_tab.pas +++ b/src/gui/fpg_tab.pas @@ -71,6 +71,8 @@ type property PageControl: TfpgPageControl read FPageControl write SetPageControl; property TabVisible: boolean read FTabVisible write FTabVisible; published + property BackgroundColor; + property Enabled; property Text: string read GetText write SetText; property OnPaint; end; @@ -99,6 +101,7 @@ type FTabPosition: TfpgTabPosition; FPopupMenu: TfpgPopupMenu; FTabOptions: TfpgTabOptions; + FLastRClickPos: TfpgPoint; function GetActivePageIndex: integer; function GetPage(AIndex: integer): TfpgTabSheet; function GetPageCount: Integer; @@ -135,6 +138,7 @@ type public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + function TabSheetAtPos(const x, y: integer): TfpgTabSheet; function AppendTabSheet(ATitle: string): TfpgTabSheet; procedure RemoveTabSheet(ATabSheet: TfpgTabSheet); property PageCount: Integer read GetPageCount; @@ -144,7 +148,9 @@ type property OnClosingTabSheet: TTabSheetClosing read FOnClosingTabSheet write FOnClosingTabSheet; published property ActivePageIndex: integer read GetActivePageIndex write SetActivePageIndex; + property Align; property BackgroundColor; + property Enabled; property FixedTabWidth: integer read FFixedTabWidth write SetFixedTabWidth default 0; property FixedTabHeight: integer read FFixedTabHeight write SetFixedTabHeight default 21; property Hint; @@ -636,9 +642,11 @@ procedure TfpgPageControl.pmCloseTab(Sender: TObject); var ts: TfpgTabSheet; begin - ts := ActivePage; + ts := TabSheetAtPos(FLastRClickPos.x, FLastRClickPos.y); + if not Assigned(ts) then + ts := ActivePage; if ts = nil then - Exit; + exit; RemovePage(ts); DoTabSheetClosing(ts); ts.Free; @@ -978,104 +986,48 @@ end; procedure TfpgPageControl.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); var - h: TfpgTabSheet; - lp: integer; // left position - bw: integer; // button width - bh: integer; // button height - p1, p2: integer; // tab boundaries for mouse click to take affect + ts: TfpgTabSheet; begin // debugln('>> TfpgPageControl.HandleLMouseUp'); - h := TfpgTabSheet(FPages.First); - if h = nil then - Exit; //==> - - lp := FMargin; - if MaxButtonWidthSum > (Width-(FMargin*2)) then - h := FFirstTabButton; - - case TabPosition of - tpTop: - begin - p1 := FMargin; - p2 := ButtonHeight; - end; - - tpBottom: - begin - p1 := Height - FMargin - ButtonHeight; - p2 := Height - FMargin; - end; - - tpRight: - begin - p1 := Width - MaxButtonWidth; - p2 := Width; - end; - - tpLeft: - begin - p1 := FMargin; - p2 := FMargin + MaxButtonWidth; - end; - end; - - if TabPosition in [tpTop, tpBottom] then - begin - if (y > p1) and (y < p2) then - begin - while h <> nil do - begin - bw := ButtonWidth(h.Text); // initialize button width - if (x > lp) and (x < lp + bw) then - begin - if h <> ActivePage then - ActivePage := h; - exit; - end; { if } - lp := lp + bw; - if h <> TfpgTabSheet(FPages.Last) then - h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) - else - h := nil; - end; { while } - end; { if } - end; - - if TabPosition in [tpLeft, tpRight] then - begin - if (x > p1) and (x < p2) then - begin - while h <> nil do - begin - bh := ButtonHeight; // initialize button height - if (y > lp) and (y < lp + bh) then - begin - if h <> ActivePage then - ActivePage := h; - exit; - end; { if } - lp := lp + bh; - if h <> TfpgTabSheet(FPages.Last) then - h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) - else - h := nil; - end; { while } - end; { if } - end; + ts := TfpgTabSheet(FPages.First); + if ts = nil then + exit; //==> { This means there are no tabs } + + ts := TabSheetAtPos(x, y); + + if Assigned(ts) then + ActivePage := ts; inherited HandleLMouseUp(x, y, shiftstate); end; procedure TfpgPageControl.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); +var + ts: TfpgTabSheet; + s: TfpgString; begin inherited HandleRMouseUp(x, y, shiftstate); -// ShowDefaultPopupMenu(x, y, ShiftState); + + { store the position for later usage } + FLastRClickPos := fpgPoint(x,y); + if to_PMenuClose in FTabOptions then begin + ts := TabSheetAtPos(x, y); + {$NOTE TODO: This text needs to become a resource string } + if Assigned(ts) then + s := Format('Close "%s" Tab', [ts.Text]) + else + s := 'Close Tab'; + if not Assigned(FPopupMenu) then begin FPopupMenu := TfpgPopupMenu.Create(self); - FPopupMenu.AddMenuItem('Close Tab', '', @pmCloseTab); + FPopupMenu.AddMenuItem(s, '', @pmCloseTab); + end + else + begin + FPopupMenu.MenuItem(0).Text := s; { This is dangerous but works for now } end; FPopupMenu.ShowAt(self, x, y); end; @@ -1160,6 +1112,92 @@ begin inherited Destroy; end; +function TfpgPageControl.TabSheetAtPos(const x, y: integer): TfpgTabSheet; +var + h: TfpgTabSheet; + lp: integer; // left position + bw: integer; // button width + bh: integer; // button height + p1, p2: integer; // tab boundaries for mouse click to take affect +begin + Result := nil; + h := TfpgTabSheet(FPages.First); + + lp := FMargin; + if MaxButtonWidthSum > (Width-(FMargin*2)) then + h := FFirstTabButton; + + case TabPosition of + tpTop: + begin + p1 := FMargin; + p2 := ButtonHeight; + end; + + tpBottom: + begin + p1 := Height - FMargin - ButtonHeight; + p2 := Height - FMargin; + end; + + tpRight: + begin + p1 := Width - MaxButtonWidth; + p2 := Width; + end; + + tpLeft: + begin + p1 := FMargin; + p2 := FMargin + MaxButtonWidth; + end; + end; + + if TabPosition in [tpTop, tpBottom] then + begin + if (y > p1) and (y < p2) then + begin + while h <> nil do + begin + bw := ButtonWidth(h.Text); // initialize button width + if (x > lp) and (x < lp + bw) then + begin + if h <> ActivePage then + Result := h; + exit; + end; { if } + lp := lp + bw; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; { while } + end; { if } + end; + + if TabPosition in [tpLeft, tpRight] then + begin + if (x > p1) and (x < p2) then + begin + while h <> nil do + begin + bh := ButtonHeight; // initialize button height + if (y > lp) and (y < lp + bh) then + begin + if h <> ActivePage then + Result := h; + exit; + end; { if } + lp := lp + bh; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; { while } + end; { if } + end; +end; + function TfpgPageControl.AppendTabSheet(ATitle: string): TfpgTabSheet; begin Result := TfpgTabSheet.Create(self); diff --git a/src/gui/fpg_trackbar.pas b/src/gui/fpg_trackbar.pas index 524a4c4c..9134a96d 100644 --- a/src/gui/fpg_trackbar.pas +++ b/src/gui/fpg_trackbar.pas @@ -68,6 +68,7 @@ type public constructor Create(AOwner: TComponent); override; published + property Align; property BackgroundColor; property Hint; property Min: integer read FMin write SetMin default 0; @@ -115,7 +116,9 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; published + property Align; property BackgroundColor; + property Enabled; property Position: integer read FPosition write SetTBPosition default 0; property ScrollStep: integer read FScrollStep write FScrollStep default 1; property Min: integer read FMin write SetMin default 0; diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index b61b0c29..570e1011 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -48,6 +48,8 @@ uses type + TfpgNodeAttachMode = (naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert); + PfpgTreeColumnWidth = ^TfpgTreeColumnWidth; TfpgTreeColumnWidth = record next: PfpgTreeColumnWidth; @@ -55,6 +57,7 @@ type end; // forward declaration + TfpgTreeView = class; TfpgTreeNode = class; TfpgTreeNodeFindMethod = procedure(ANode: TfpgTreeNode; var AFound: boolean) of object; @@ -77,6 +80,7 @@ type FText: TfpgString; FTextColor: TfpgColor; FHasChildren: Boolean; + FTree: TfpgTreeView; procedure SetCollapsed(const AValue: boolean); procedure SetInactSelColor(const AValue: TfpgColor); procedure SetInactSelTextColor(const AValue: TfpgColor); @@ -87,6 +91,7 @@ type procedure SetTextColor(const AValue: TfpgColor); procedure DoRePaint; procedure SetHasChildren(const AValue: Boolean); + procedure DoTreeCheck(ANode: TfpgTreeNode); public constructor Create; destructor Destroy; override; @@ -99,11 +104,12 @@ type function FindSubNode(AData: TObject; ARecursive: Boolean): TfpgTreeNode; overload; function GetMaxDepth: integer; function GetMaxVisibleDepth: integer; - procedure Append(var aValue: TfpgTreeNode); + procedure Append(var ANode: TfpgTreeNode); procedure Clear; // remove all nodes recursively procedure Collapse; procedure Expand; procedure Remove(var aNode: TfpgTreeNode); + procedure MoveTo(Destination: TfpgTreeNode; Mode: TfpgNodeAttachMode); procedure UnregisterSubNode(aNode: TfpgTreeNode); // parent color settings function ParentInactSelColor: TfpgColor; @@ -203,12 +209,6 @@ type procedure DrawHeader(ACol: integer; ARect: TfpgRect; AFlags: integer); virtual; procedure DoChange; virtual; procedure DoExpand(ANode: TfpgTreeNode); virtual; - // only visual (visible) nodes - function NextVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; - function PrevVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; - // any next node, even if node is collapsed - function NextNode(ANode: TfpgTreeNode): TfpgTreeNode; - function PrevNode(ANode: TfpgTreeNode): TfpgTreeNode; // the nodes between the given node and the direct next node function SpaceToVisibleNext(aNode: TfpgTreeNode): integer; function StepToRoot(aNode: TfpgTreeNode): integer; @@ -220,6 +220,14 @@ type function GetColumnWidth(AIndex: word): word; procedure GotoNextNodeUp; procedure GotoNextNodeDown; + procedure FullCollapse; + procedure FullExpand; + // any next node, even if node is collapsed + function NextNode(ANode: TfpgTreeNode): TfpgTreeNode; + function PrevNode(ANode: TfpgTreeNode): TfpgTreeNode; + // only visual (visible) nodes + function NextVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; + function PrevVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; property Font: TfpgFont read FFont; // Invisible node that starts the tree property RootNode: TfpgTreeNode read GetRootNode; @@ -227,7 +235,9 @@ type property ImageList: TfpgImageList read FImageList write FImageList; property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; published + property Align; property DefaultColumnWidth: word read FDefaultColumnWidth write SetDefaultColumnWidth default 15; + property Enabled; property FontDesc: string read GetFontDesc write SetFontDesc; property IndentNodeWithNoImage: boolean read FIndentNodeWithNoImage write SetIndentNodeWithNoImage default True; property NoImageIndent: integer read FNoImageIndent write FNoImageIndent default 16; @@ -346,6 +356,12 @@ begin end; end; +procedure TfpgTreeNode.DoTreeCheck(ANode: TfpgTreeNode); +begin + if ANode.FTree <> FTree then + raise Exception.Create('Nodes must be of the same tree'); +end; + constructor TfpgTreeNode.Create; begin FData := nil; @@ -404,20 +420,21 @@ begin end; end; -procedure TfpgTreeNode.Append(var aValue: TfpgTreeNode); +procedure TfpgTreeNode.Append(var ANode: TfpgTreeNode); begin - aValue.Parent := self; - aValue.Next := nil; + DoTreeCheck(ANode); + ANode.Parent := self; + ANode.Next := nil; if FFirstSubNode = nil then - FFirstSubNode := aValue; + FFirstSubNode := ANode; - aValue.prev := FLastSubNode; + ANode.Prev := FLastSubNode; if FLastSubNode <> nil then - FLastSubNode.Next := aValue; + FLastSubNode.Next := ANode; - FLastSubNode := aValue; + FLastSubNode := ANode; end; function TfpgTreeNode.FindSubNode(AText: string; ARecursive: Boolean): TfpgTreeNode; @@ -536,6 +553,7 @@ begin writeln('TfpgTreeNode.AppendText'); {$ENDIF} h := TfpgTreeNode.Create; + h.FTree := FTree; h.Text := AText; Append(h); result := h; @@ -659,6 +677,53 @@ begin aNode.parent := nil; end; +procedure TfpgTreeNode.MoveTo(Destination: TfpgTreeNode; Mode: TfpgNodeAttachMode); +begin + if Destination = nil then + Exit; + DoTreeCheck(Destination); + + Parent.Remove(self); + case Mode of + naAdd: + begin + Destination.Parent.Append(self); + end; + naAddFirst: + begin + Next := Destination.Parent.FirstSubNode; + Next.Prev := self; + Destination.Parent.FFirstSubNode := self; + Parent := Destination.Parent; + end; + naAddChild: + begin + Destination.Append(self); + end; + naAddChildFirst: + begin + Next := Destination.FirstSubNode; + if Assigned(Destination.FirstSubNode) then + Destination.FirstSubNode.Prev := self; + Destination.FFirstSubNode := self; + Parent := Destination; + if Destination.LastSubNode = nil then + Destination.FLastSubNode := self; + end; + naInsert: + begin + Prev := Destination.Prev; + Next := Destination; + Parent := Destination.Parent; + Destination.Prev := self; + if Prev = nil then + Parent.FFirstSubNode := self + else + Prev.Next := self; + end; + end; { case } +end; + procedure TfpgTreeNode.Clear; var n: TfpgTreeNode; @@ -758,7 +823,10 @@ end; function TfpgTreeview.GetRootNode: TfpgTreeNode; begin if FRootNode = nil then + begin FRootNode := TfpgTreeNode.Create; + FRootNode.FTree := self; + end; FRootNode.TextColor := clText1; FRootnode.SelTextColor := clSelectionText; FRootnode.SelColor := clSelection; @@ -796,10 +864,14 @@ begin n := AValue.Parent; while n <> nil do begin - n.Expand; - DoExpand(n); + if n.Collapsed then + begin + n.Expand; + DoExpand(n); + end; n := n.parent; end; + UpdateScrollbars; end; dy := GetAbsoluteNodeTop(FSelection); @@ -809,7 +881,7 @@ begin begin if FVScrollBar.Max = 0 then // the first time and no expansion happened before. FVScrollBar.Max := dy + Height; - FVScrollbar.Position := dy + nh - vh; + FVScrollbar.Position := dy + nh - (vh div 2); FYOffset := FVScrollbar.Position; UpdateScrollBars; if FHScrollbar.Visible then // HScrollbar appeared so we need to adjust position again @@ -1082,10 +1154,45 @@ begin end; procedure TfpgTreeView.GotoNextNodeDown; +var + lNode: TfpgTreeNode; begin - if Selection = RootNode.LastSubNode then + if (Selection = RootNode.LastSubNode) and (RootNode.LastSubNode.CountRecursive = 0) then Exit; - Selection := NextNode(Selection); + + lNode := NextNode(Selection); + if lNode <> nil then + Selection := lNode; +end; + +procedure TfpgTreeView.FullCollapse; +var + n: TfpgTreeNode; +begin + n := NextNode(RootNode); + repeat + if n <> nil then + begin + n.Collapse; + end; + n := NextNode(n); + until n = nil; + Repaint; +end; + +procedure TfpgTreeView.FullExpand; +var + n: TfpgTreeNode; +begin + n := NextNode(RootNode); + repeat + if n <> nil then + begin + n.Expand; + end; + n := NextNode(n); + until n = nil; + Repaint; end; procedure TfpgTreeview.PreCalcColumnLeft; @@ -1126,8 +1233,11 @@ begin FVScrollbar.Visible := VisibleHeight < (GetNodeHeightSum * GetNodeHeight); FVScrollbar.Min := 0; FVScrollbar.Max := (GetNodeHeightSum * GetNodeHeight) - VisibleHeight + FHScrollbar.Height; + FVScrollbar.PageSize := (VisibleHeight div 4) * 3; // three quarters of the height + FVScrollbar.ScrollStep := GetNodeHeight; // up/down buttons move the height of the font FHScrollbar.Min := 0; FHScrollbar.Max := MaxNodeWidth - VisibleWidth + FVScrollbar.Width; + FHScrollbar.PageSize := (VisibleWidth div 4) * 3; // three quarters of the height FHScrollbar.Visible := MaxNodeWidth > Width - 2; if not FVScrollbar.Visible then begin @@ -1224,7 +1334,7 @@ begin x := x + FXOffset; cancel := False; last := RootNode; - while not (((i - 1) * GetNodeHeight - 2 <= y) and ((i) * GetNodeHeight + 2 >= y)) do + while not ((((i - 1) * GetNodeHeight) <= y) and ((i * GetNodeHeight) >= y)) do begin node := NextVisualNode(last); if node = nil then @@ -1430,25 +1540,26 @@ begin Canvas.SetColor(h.ParentInactSelColor); Canvas.SetTextColor(h.ParentInActSelTextColor); end; - Canvas.FillRectangle(w - FXOffset, YPos - FYOffset + col - GetNodeHeight + FFont.Ascent div 2 - 2, GetNodeWidth(h), GetNodeHeight); + // draw selection rectangle + Canvas.FillRectangle(w - FXOffset, ACenterPos - (GetNodeHeight div 2), GetNodeWidth(h), GetNodeHeight); if (ImageList <> nil) and ShowImages then begin AImageItem := ImageList.Item[h.ImageIndex]; if AImageItem <> nil then begin - Canvas.DrawImagePart(w - FXOffset + 1, ACenterPos - 4, AImageItem.Image, 0, 0, 16, 16); - Canvas.DrawString(w - FXOffset + 1 + AImageItem.Image.Width + 2, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawImagePart(w - FXOffset + 1, ACenterPos - 8, AImageItem.Image, 0, 0, 16, 16); + Canvas.DrawString(w - FXOffset + 1 + AImageItem.Image.Width + 2, ACenterPos - (GetNodeHeight div 2), h.text); end else begin if FIndentNodeWithNoImage then - Canvas.DrawString(w - FXOffset + 1 + FNoImageIndent + 2 {spacer}, ACenterPos - FFont.Ascent div 2, h.text) + Canvas.DrawString(w - FXOffset + 1 + FNoImageIndent + 2 {spacer}, ACenterPos - (GetNodeHeight div 2), h.text) else - Canvas.DrawString(w - FXOffset + 1, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawString(w - FXOffset + 1, ACenterPos - (GetNodeHeight div 2), h.text); end; end else - Canvas.DrawString(w - FXOffset + 1, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawString(w - FXOffset + 1, ACenterPos - (GetNodeHeight div 2), h.text); Canvas.SetTextColor(h.ParentTextColor); end else @@ -1458,19 +1569,19 @@ begin AImageItem := ImageList.Item[h.ImageIndex]; if AImageItem <> nil then begin - Canvas.DrawImagePart(w - FXOffset + 1, ACenterPos - 4, AImageItem.Image, 0, 0, 16, 16); - Canvas.DrawString(w - FXOffset + 1 + AImageItem.Image.Width + 2, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawImagePart(w - FXOffset + 1, ACenterPos - 8, AImageItem.Image, 0, 0, 16, 16); + Canvas.DrawString(w - FXOffset + 1 + AImageItem.Image.Width + 2, ACenterPos - (GetNodeHeight div 2), h.text); end else begin if FIndentNodeWithNoImage then - Canvas.DrawString(w - FXOffset + 1 + FNoImageIndent + 2 {spacer}, ACenterPos - FFont.Ascent div 2, h.text) + Canvas.DrawString(w - FXOffset + 1 + FNoImageIndent + 2 {spacer}, ACenterPos - (GetNodeHeight div 2), h.text) else - Canvas.DrawString(w - FXOffset + 1, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawString(w - FXOffset + 1, ACenterPos - (GetNodeHeight div 2), h.text); end end else - Canvas.DrawString(w - FXOffset + 1, ACenterPos - FFont.Ascent div 2, h.text); + Canvas.DrawString(w - FXOffset + 1, ACenterPos - (GetNodeHeight div 2), h.text); end; { if/else } Canvas.SetLineStyle(1, FTreeLineStyle); @@ -1680,7 +1791,16 @@ begin Selection := RootNode.FirstSubNode; end; end; - + + keyPageUp: + begin + FVScrollbar.PageUp; + end; + + keyPageDown: + begin + FVScrollbar.PageDown; + end; else Consumed := False; end; @@ -1699,23 +1819,25 @@ procedure TfpgTreeview.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); var i: integer; + dy: integer; begin inherited HandleMouseScroll(x, y, shiftstate, delta); - if delta > 0 then + dy := (VisibleHeight div 3); // mouse scrolling is 1/3 of the height + if delta > 0 then // scrolling down begin - inc(FYOffset, FScrollWheelDelta); + inc(FYOffset, dy); //FScrollWheelDelta); i := (GetNodeHeightSum * GetNodeHeight) - VisibleHeight + FHScrollbar.Height; if FYOffset > i then FYOffset := i; - i := FVScrollbar.Position + FScrollWheelDelta; + i := FVScrollbar.Position + dy; FVScrollbar.Position := i; end else - begin - dec(FYOffset, FScrollWheelDelta); + begin // scrolling up + dec(FYOffset, dy); //FScrollWheelDelta); if FYOffset < 0 then FYOffset := 0; - i := FVScrollbar.Position - FScrollWheelDelta; + i := FVScrollbar.Position - dy; FVScrollbar.Position := i; end; UpdateScrollbars; @@ -1807,7 +1929,7 @@ function TfpgTreeView.NextNode(ANode: TfpgTreeNode): TfpgTreeNode; begin while ANode.Next = nil do begin - ANode := ANode.Parent; + ANode := ANode.Parent; // back out one level depth if ANode = nil then exit; //==> end; diff --git a/src/gui/inputquerydialog.inc b/src/gui/inputquerydialog.inc index 5b063233..094a58e2 100644 --- a/src/gui/inputquerydialog.inc +++ b/src/gui/inputquerydialog.inc @@ -30,6 +30,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: fpgQueryDialog} procedure SetupCaptions; + procedure edtTextKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); public procedure AfterCreate; override; end; @@ -47,8 +48,10 @@ begin try dlg.WindowTitle := ACaption; dlg.lblText.Text := APrompt; + dlg.edtText.Text := Value; Result := dlg.ShowModal = mrOK; - Value := dlg.edtText.Text; + if Result then + Value := dlg.edtText.Text; finally dlg.Free; end; @@ -62,6 +65,12 @@ begin btnCancel.Text := rsCancel; end; +procedure TfpgQueryDialog.edtTextKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEnter then + btnOK.Click; +end; + procedure TfpgQueryDialog.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} @@ -94,6 +103,7 @@ begin TabOrder := 2; Text := ''; FontDesc := '#Edit1'; + OnKeyPress := @edtTextKeyPressed; end; btnOK := TfpgButton.Create(self); diff --git a/src/gui/managebookmarksdialog.inc b/src/gui/managebookmarksdialog.inc new file mode 100644 index 00000000..ceef4cba --- /dev/null +++ b/src/gui/managebookmarksdialog.inc @@ -0,0 +1,227 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit contains the dialog to manage bookmarks from the + File Open/Save dialog. +} + +{%mainunit fpg_dialogs.pas} + +{$IFDEF read_interface} + + TConfigureBookmarksForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: ConfigureBookmarksForm} + grdBookmarks: TfpgStringGrid; + btnChangeTitle: TfpgButton; + btnDelete: TfpgButton; + btnClose: TfpgButton; + btnMoveUp: TfpgButton; + btnMoveDown: TfpgButton; + {@VFD_HEAD_END: ConfigureBookmarksForm} + FIni: TfpgIniFile; + procedure SetupCaptions; + procedure PopulateGrid; + procedure UpdateINIFile; + procedure btnChangeTitleClicked(Sender: TObject); + procedure btnDeleteClicked(Sender: TObject); + public + constructor Create(var AIniFile: TfpgIniFile); reintroduce; + destructor Destroy; override; + procedure AfterCreate; override; + end; + + +{$ENDIF read_interface} + +{$IFDEF read_implementation} + +procedure TConfigureBookmarksForm.SetupCaptions; +begin + WindowTitle := rsConfigureBookmarks; + btnClose.Text := rsClose; + btnMoveUp.Text := rsMoveUp; + btnMoveDown.Text := rsMoveDown; + btnChangeTitle.Text := rsChangeTitle; + btnDelete.Text := rsDelete; + grdBookmarks.ColumnTitle[0] := rsName; + grdBookmarks.ColumnTitle[1] := rsDirectory; +end; + +procedure TConfigureBookmarksForm.PopulateGrid; +var + i: integer; + lst: TStringList; +begin + lst := TStringList.Create; + FIni.ReadSection(FPG_BOOKMARK_SECTION, lst); + grdBookmarks.RowCount := lst.Count; + grdBookmarks.BeginUpdate; + for i := 0 to lst.Count-1 do + begin + grdBookmarks.Cells[0, i] := lst[i]; + grdBookmarks.Cells[1, i] := FIni.ReadString(FPG_BOOKMARK_SECTION, lst[i], ''); + end; + grdBookmarks.EndUpdate; + lst.Free; +end; + +procedure TConfigureBookmarksForm.UpdateINIFile; +var + i: integer; +begin + FIni.EraseSection(FPG_BOOKMARK_SECTION); + for i := 0 to grdBookmarks.RowCount-1 do + begin + FIni.WriteString(FPG_BOOKMARK_SECTION, grdBookmarks.Cells[0, i], grdBookmarks.Cells[1, i]); + end; +end; + +procedure TConfigureBookmarksForm.btnChangeTitleClicked(Sender: TObject); +var + s: TfpgString; +begin + if (grdBookmarks.RowCount = 0) or (grdBookmarks.FocusRow = -1) then + Exit; + s := grdBookmarks.Cells[0, grdBookmarks.FocusRow]; + if fpgInputQuery('Bookmark', 'Enter new bookmark name', s) then + begin + s := StringReplace(s, '=', '-', [rfReplaceAll]); // don't allow '=' sign in name (ini file requirement) + grdBookmarks.Cells[0, grdBookmarks.FocusRow] := s; + end; +end; + +procedure TConfigureBookmarksForm.btnDeleteClicked(Sender: TObject); +begin + if (grdBookmarks.RowCount = 0) or (grdBookmarks.FocusRow = -1) then + Exit; + grdBookmarks.DeleteRow(grdBookmarks.FocusRow); +end; + +constructor TConfigureBookmarksForm.Create(var AIniFile: TfpgIniFile); +begin + inherited Create(nil); + FIni := AIniFile; +end; + +destructor TConfigureBookmarksForm.Destroy; +begin + UpdateINIFile; + inherited Destroy; +end; + +procedure TConfigureBookmarksForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: ConfigureBookmarksForm} + Name := 'ConfigureBookmarksForm'; + SetPosition(331, 184, 596, 237); + WindowTitle := 'Configure Bookmarks'; + Hint := ''; + ShowHint := True; + WindowPosition := wpOneThirdDown; + + grdBookmarks := TfpgStringGrid.Create(self); + with grdBookmarks do + begin + Name := 'grdBookmarks'; + SetPosition(8, 8, 473, 218); + Anchors := [anLeft,anRight,anTop,anBottom]; + AddColumn('Title', 150, taLeftJustify); + AddColumn('Directory', 300, taLeftJustify); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := True; + TabOrder := 1; + Options := [go_SmoothScroll, go_AlternativeColor] + end; + + btnChangeTitle := TfpgButton.Create(self); + with btnChangeTitle do + begin + Name := 'btnChangeTitle'; + SetPosition(489, 8, 100, 24); + Anchors := [anRight,anTop]; + Text := 'btnChangeTitle'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @btnChangeTitleClicked; + end; + + btnDelete := TfpgButton.Create(self); + with btnDelete do + begin + Name := 'btnDelete'; + SetPosition(489, 36, 100, 24); + Anchors := [anRight,anTop]; + Text := 'btnDelete'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + OnClick := @btnDeleteClicked; + end; + + btnMoveUp := TfpgButton.Create(self); + with btnMoveUp do + begin + Name := 'btnMoveUp'; + SetPosition(489, 80, 100, 24); + Anchors := [anRight,anTop]; + Text := 'btnMoveUp'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'sys.sb.up'; + TabOrder := 4; + end; + + btnMoveDown := TfpgButton.Create(self); + with btnMoveDown do + begin + Name := 'btnMoveDown'; + SetPosition(489, 108, 100, 24); + Anchors := [anRight,anTop]; + Text := 'btnMoveDown'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'sys.sb.down'; + TabOrder := 5; + end; + + btnClose := TfpgButton.Create(self); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(489, 204, 100, 24); + Anchors := [anRight,anBottom]; + Text := 'btnClose'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'stdimg.close'; + ModalResult := mrOK; + TabOrder := 6; + end; + + {@VFD_BODY_END: ConfigureBookmarksForm} + {%endregion} + + SetupCaptions; + PopulateGrid; +end; +{$ENDIF read_implementation} + diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc index d09f11c8..6a96d046 100644 --- a/src/gui/selectdirdialog.inc +++ b/src/gui/selectdirdialog.inc @@ -7,6 +7,7 @@ tv: TfpgTreeView; FRootDir: TfpgString; FShowHidden: Boolean; + FImagelist: TfpgImageList; function GetAbsolutePath(Node: TfpgTreeNode): TfpgString; procedure InitializeTreeview; procedure SetRootDir(const AValue: TfpgString); @@ -19,6 +20,7 @@ {$ENDIF} public constructor Create(AOwner: TComponent); override; + destructor Destroy; override; procedure AfterCreate; override; { return the selected directory or set initial selected dir } property SelectedDir: TfpgString read GetSelectedDir write SetSelectedDir; @@ -158,6 +160,7 @@ begin for i := 0 to SortList.Count - 1 do begin NewNode := Node.AppendText(SortList[i]); + NewNode.ImageIndex := 0; // NewNode := TV.Items.AddChild(Node, SortList[i]); // if subdirectories then indicate so. { Todo: Fix this by adding HasChildren to Treeview } @@ -245,9 +248,20 @@ end; {$ENDIF} constructor TfpgSelectDirDialog.Create(AOwner: TComponent); +var + img: TfpgImage; begin inherited Create(AOwner); FShowHidden := False; + FImagelist := TfpgImageList.Create; + img := fpgImages.GetImage('stdimg.folder').ImageFromSource; + FImageList.AddImage(img); +end; + +destructor TfpgSelectDirDialog.Destroy; +begin + FImagelist.Free; + inherited Destroy; end; procedure TfpgSelectDirDialog.AfterCreate; @@ -263,7 +277,10 @@ begin begin Name := 'tv'; SetPosition(FSpacing, FSpacing, 288, 322); - OnExpand :=@NodeExpanded; + Anchors := [anTop, anLeft, anRight, anBottom]; + ImageList := FImageList; + ShowImages := True; + OnExpand := @NodeExpanded; end; // reposition buttons diff --git a/tools/wipfc/de_DE.nls b/tools/wipfc/de_DE.nls new file mode 100644 index 00000000..b98ba943 --- /dev/null +++ b/tools/wipfc/de_DE.nls @@ -0,0 +1,24 @@ +#German + +Country=49 +CodePage=850 +Note="Anmerkung&colon." +Caution="ACHTUNG&colon." +Warning="ACHTUNG&colon." +Reference="Nachschlagewerk" +olChars=abcdefghijklmnopqrstuvwxyz„”á +olClose1=. +olClose2=) +ulItemId1=o +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# Words defines the characters that make words. This is used for +# searching and data compression. The following is for Code page 850. + +Grammer +Words=0-9+A-Z+a-z++‚+„+…+Ž++”+™+š+·+á +eGrammer diff --git a/tools/wipfc/en_GB.nls b/tools/wipfc/en_GB.nls new file mode 100644 index 00000000..61f0e98e --- /dev/null +++ b/tools/wipfc/en_GB.nls @@ -0,0 +1,24 @@ +#U.K. English text + +Country=44 +CodePage=850 +Note="Note&colon." +Caution="CAUTION&colon." +Warning="Warning&colon." +Reference="Reference" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=. +olClose2=) +ulItemId1= +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# Words defines the characters that make words. This is used for +# searching and data compression. The following is for Code page 850. + +Grammer +Words=0-9+A-Z+a-z +eGrammer diff --git a/tools/wipfc/en_US.nls b/tools/wipfc/en_US.nls new file mode 100644 index 00000000..c7132bfa --- /dev/null +++ b/tools/wipfc/en_US.nls @@ -0,0 +1,24 @@ +#U.S. English text + +Country=1 +CodePage=850 +Note="Note&colon." +Caution="CAUTION&colon." +Warning="Warning&colon." +Reference="Reference" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=. +olClose2=) +ulItemId1= +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# Words defines the characters that make words. This is used for +# searching and data compression. The following is for Code page 850. + +Grammer +Words=0-9+A-Z+a-z +eGrammer diff --git a/tools/wipfc/entit932.txt b/tools/wipfc/entit932.txt new file mode 100644 index 00000000..37687201 --- /dev/null +++ b/tools/wipfc/entit932.txt @@ -0,0 +1,202 @@ +-&mdash.
+-&ndash.
+ &rbl.
+!&xclm.
+!&xclam.
+"&cdq.
+"&odq.
+#&numsign.
+$&dollar.
+%&percent.
+&&.
+'&apos.
+'&csq.
+`&osq.
+`&grave.
+(&lpar.
+(&lparen.
+)&rpar.
+)&rparen.
+*&asterisk.
+.&period.
++&plus.
+,&comma.
+-&dash.
+-&emdash.
+-&endash.
+-&hyphen.
+-&minus.
+.&per.
+/&slash.
+/&slr.
+:&colon.
+;&semi.
+>>.
+>>sym.
+=&eq.
+=&equals.
+=&eqsym.
+<<.
+<<sym.
+@&atsign.
+{&lbrace.
+{&lbrc.
+|&splitvbar.
+|&vbar.
+|&lor.
+}&rbrace.
+}&rbrc.
+[&lbracket.
+[&lbrk.
+\&bslash.
+\&bsl.
+]&rbracket.
+]&rbrk.
+^&caret.
+^&and.
+_&us.
+~&tilde.
+~&similar.
+ &house.
+C&Cc.
+u&ue.
+e&ea.
+a&ac.
+a&ae.
+a&ag.
+a&ao.
+c&cc.
+e&ec.
+e&ee.
+e&eg.
+i&ie.
+i&ic.
+i&ig.
+A&Ae.
+A&Ao.
+ð&angstrom.
+E&Ea.
+ æ.
+ Æ.
+o&oc.
+o&oe.
+o&og.
+u&uc.
+u&ug.
+y&ye.
+O&Oe.
+U&Ue.
+‘¢.
+’&Lsterling.
+\¥.
+f&fnof.
+a&aa.
+i&ia.
+o&oa.
+u&ua.
+n&nt.
+N&Nt.
+a&aus.
+o&ous.
+ &invq.
+ &lnotrev.
+úT&lnot.
+úT¬sym.
+1/2½.
+1/4¼.
+ &inve.
+s&odqf.
+t&cdqf.
+ƒ¿&alpha.
+„@&Alpha.
+„B&Beta.
+„C&Gamma.
+ƒÎ&pi.
+ƒ°&Sigma.
+ƒÐ&sigma.
+ƒÊ&mu.
+Ą&tau.
+„U&Phi.
+ƒ¦&Theta.
+Ħ&Omega.
+ƒÂ&delta.
+‡&infinity.
+ƒÓ&phi.
+ƒÃ&epsilon.
+¿&intersect.
+ß&identical.
+}&plusmin.
+}&pm.
+†&ge.
+†&gesym.
+…&le.
+…&lesym.
+ &inttop.
+ &intbot.
+€÷.
+à&nearly.
+‹°ree.
+‹°.
+¥&bullet.
+¥&dot.
+ã&sqrt.
+n&supn.
+2².
+&sqbul.
+&box14.
+&box12.
+&box34.
+&bx1012.
+&bx2021.
+&bx0021.
+&bx0012.
+&bx2022.
+&bx2020.
+&bx0022.
+&bx2002.
+&bx2001.
+&bx1002.
+&bx1210.
+&bx2120.
+&bx2200.
+&bx0220.
+&bx2202.
+&bx0222.
+&bx2220.
+&bx0202.
+&bx2222.
+&bx1202.
+&bx1201.
+&bx0212.
+&bx0121.
+&bx2100.
+&bx1200.
+&bx0210.
+&bx0120.
+&bx2121.
+&bx1212.
+&bxas.
+&bxbj.
+&bxcr.
+&bxcj.
+&bxde.
+&bxtj.
+&bxh.
+&bxll.
+&bxlr.
+&bxri.
+&bxrj.
+&bxul.
+&bxur.
+&bxv.
+ &BOX.
+ &BOXBOT.
+ &BOXLEFT.
+ &BOXRIGHT.
+ &BOXTOP.
+&darrow.
+&uarrow.
+&larrow.
+&rarrow.
+>&rahead.
+
\ No newline at end of file diff --git a/tools/wipfc/entit934.txt b/tools/wipfc/entit934.txt new file mode 100644 index 00000000..8d19825f --- /dev/null +++ b/tools/wipfc/entit934.txt @@ -0,0 +1,201 @@ +-&mdash.
+-&ndash.
+ &rbl.
+!&xclm.
+!&xclam.
+"&cdq.
+"&odq.
+#&numsign.
+$&dollar.
+%&percent.
+&&.
+'&apos.
+'&csq.
+`&osq.
+`&grave.
+(&lpar.
+(&lparen.
+)&rpar.
+)&rparen.
+*&asterisk.
+.&period.
++&plus.
+,&comma.
+-&dash.
+-&emdash.
+-&endash.
+-&hyphen.
+-&minus.
+.&per.
+/&slash.
+/&slr.
+:&colon.
+;&semi.
+>>.
+>>sym.
+=&eq.
+=&equals.
+=&eqsym.
+<<.
+<<sym.
+@&atsign.
+{&lbrace.
+{&lbrc.
+|&splitvbar.
+|&vbar.
+|&lor.
+}&rbrace.
+}&rbrc.
+[&lbracket.
+[&lbrk.
+\&bslash.
+\&bsl.
+]&rbracket.
+]&rbrk.
+^&caret.
+^&and.
+_&us.
+~&tilde.
+~&similar.
+&house.
+€&Cc.
+&ue.
+‚&ea.
+ƒ&ac.
+„&ae.
+…&ag.
+†&ao.
+‡&cc.
+ˆ&ec.
+‰&ee.
+Š&eg.
+‹&ie.
+Œ&ic.
+&ig.
+Ž&Ae.
+&Ao.
+&angstrom.
+&Ea.
+‘æ.
+’Æ.
+“&oc.
+”&oe.
+•&og.
+–&uc.
+—&ug.
+˜&ye.
+™&Oe.
+š&Ue.
+ݢ.
+œ&Lsterling.
+¥.
+Ÿ&fnof.
+ &aa.
+¡&ia.
+¢&oa.
+£&ua.
+¤&nt.
+¥&Nt.
+¦&aus.
+§&ous.
+¨&invq.
+©&lnotrev.
+ª&lnot.
+ª¬sym.
+«½.
+¬¼.
+&inve.
+®&odqf.
+¯&cdqf.
+à&alpha.
+A&Alpha.
+á&Beta.
+â&Gamma.
+ã&pi.
+ä&Sigma.
+å&sigma.
+æ&mu.
+ç&tau.
+è&Phi.
+é&Theta.
+ê&Omega.
+ë&delta.
+ì&infinity.
+í&phi.
+î&epsilon.
+ï&intersect.
+ð&identical.
+ñ&plusmin.
+ñ&pm.
+ò&ge.
+ò&gesym.
+ó&le.
+ó&lesym.
+ô&inttop.
+õ&intbot.
+ö÷.
+÷&nearly.
+ø°ree.
+ø°.
+ù&bullet.
+ú&dot.
+û&sqrt.
+ü&supn.
+ý².
+þ&sqbul.
+°&box14.
+±&box12.
+²&box34.
+µ&bx1012.
+¶&bx2021.
+·&bx0021.
+¸&bx0012.
+¹&bx2022.
+º&bx2020.
+»&bx0022.
+¼&bx2002.
+½&bx2001.
+¾&bx1002.
+Æ&bx1210.
+Ç&bx2120.
+È&bx2200.
+É&bx0220.
+Ê&bx2202.
+Ë&bx0222.
+Ì&bx2220.
+Í&bx0202.
+Î&bx2222.
+Ï&bx1202.
+Ð&bx1201.
+Ñ&bx0212.
+Ò&bx0121.
+Ó&bx2100.
+Ô&bx1200.
+Õ&bx0210.
+Ö&bx0120.
+×&bx2121.
+Ø&bx1212.
+Á&bxas.
+Á&bxbj.
+Å&bxcr.
+Å&bxcj.
+Â&bxde.
+Â&bxtj.
+Ä&bxh.
+À&bxll.
+Ù&bxlr.
+´&bxri.
+´&bxrj.
+Ú&bxul.
+¿&bxur.
+³&bxv.
+Û&BOX.
+Ü&BOXBOT.
+Ý&BOXLEFT.
+Þ&BOXRIGHT.
+ß&BOXTOP.
+&darrow.
+&uarrow.
+&larrow.
+&rarrow.
+&rahead.
diff --git a/tools/wipfc/entit938.txt b/tools/wipfc/entit938.txt new file mode 100644 index 00000000..3f74faa0 --- /dev/null +++ b/tools/wipfc/entit938.txt @@ -0,0 +1,202 @@ +-&mdash.
+-&ndash.
+ &rbl.
+!&xclm.
+!&xclam.
+"&cdq.
+"&odq.
+#&numsign.
+$&dollar.
+%&percent.
+&&.
+'&apos.
+'&csq.
+`&osq.
+`&grave.
+(&lpar.
+(&lparen.
+)&rpar.
+)&rparen.
+*&asterisk.
+.&period.
++&plus.
+,&comma.
+-&dash.
+-&emdash.
+-&endash.
+-&hyphen.
+-&minus.
+.&per.
+/&slash.
+/&slr.
+:&colon.
+;&semi.
+>>.
+>>sym.
+=&eq.
+=&equals.
+=&eqsym.
+<<.
+<<sym.
+@&atsign.
+{&lbrace.
+{&lbrc.
+|&splitvbar.
+|&vbar.
+|&lor.
+}&rbrace.
+}&rbrc.
+[&lbracket.
+[&lbrk.
+\&bslash.
+\&bsl.
+]&rbracket.
+]&rbrk.
+^&caret.
+^&and.
+_&us.
+~&tilde.
+~&similar.
+ &house.
+‘&Cc.
+ &ue.
+ &ea.
+ &ac.
+ &ae.
+ &ag.
+ &ao.
+ &cc.
+ &ec.
+ &ee.
+ &eg.
+ &ie.
+ &ic.
+ &ig.
+ &Ae.
+ &Ao.
+ &angstrom.
+ &Ea.
+ æ.
+ Æ.
+ &oc.
+ &oe.
+ &og.
+ &uc.
+ &ug.
+ &ye.
+ &Oe.
+ &Ue.
+‘¢.
+’&sterlin.
+¥.
+ &fnof.
+ &aa.
+ &ia.
+ &oa.
+ &ua.
+ &nt.
+ &Nt.
+ &aus.
+ &ous.
+ &invq.
+ &lnotrev.
+ &lnot.
+ ¬sym.
+ ½.
+ ¼.
+ &inve.
+s&odqf.
+t&cdqf.
+ƒ¿&alpha.
+„@&Alpha.
+„B&Beta.
+ƒ¡&Gamma.
+ƒÎ&pi.
+ƒ°&Sigma.
+ƒÐ&sigma.
+ƒÊ&mu.
+Ą&tau.
+„U&Phi.
+ƒ¦&Theta.
+Ħ&Omega.
+ƒÂ&delta.
+‡&infinity.
+ƒÓ&phi.
+ƒÃ&epsilon.
+ŠÇ&intersect.
+ŠÆ&indentical.
+}&plusmin.
+}&pm.
+†&ge.
+†&gesym.
+…&le.
+…&lesym.
+ &inttop.
+ &intbot.
+€÷.
+ &nearly.
+‹°ree.
+‹°.
+E&bullet.
+D&dot.
+ŠÄ&sqrt.
+ &supn.
+ ².
+¡&sqbul.
+&box14.
+&box12.
+&box34.
+&bx1012.
+&bx2021.
+&bx0021.
+&bx0012.
+&bx2022.
+&bx2020.
+&bx0022.
+&bx2002.
+&bx2001.
+&bx1002.
+&bx1210.
+&bx2120.
+&bx2200.
+&bx0220.
+&bx2202.
+&bx0222.
+&bx2220.
+&bx0202.
+&bx2222.
+&bx1202.
+&bx1201.
+&bx0212.
+&bx0121.
+&bx2100.
+&bx1200.
+&bx0210.
+&bx0120.
+&bx2121.
+&bx1212.
+&bxas.
+&bxbj.
+&bxcr.
+&bxcj.
+&bxde.
+&bxtj.
+&bxh.
+&bxll.
+&bxlr.
+&bxri.
+&bxrj.
+&bxul.
+&bxur.
+&bxv.
+¡&BOX.
+ &BOXBOT.
+ &BOXLEFT.
+ &BOXRIGHT.
+ &BOXTOP.
+«&darrow.
+ª&uarrow.
+©&larrow.
+¨&rarrow.
+>&rahead.
+
\ No newline at end of file diff --git a/tools/wipfc/entity.txt b/tools/wipfc/entity.txt new file mode 100644 index 00000000..d38b7986 --- /dev/null +++ b/tools/wipfc/entity.txt @@ -0,0 +1,203 @@ +-&mdash.
+-&ndash.
+ &rbl.
+!&xclm.
+!&xclam.
+"&cdq.
+"&odq.
+#&numsign.
+$&dollar.
+%&percent.
+&&.
+'&apos.
+'&csq.
+`&osq.
+`&grave.
+(&lpar.
+(&lparen.
+)&rpar.
+)&rparen.
+*&asterisk.
+.&period.
++&plus.
+,&comma.
+-&dash.
+-&emdash.
+-&endash.
+-&hyphen.
+-&minus.
+.&per.
+/&slash.
+/&slr.
+:&colon.
+;&semi.
+>>.
+>>sym.
+=&eq.
+=&equals.
+=&eqsym.
+<<.
+<<sym.
+@&atsign.
+{&lbrace.
+{&lbrc.
+|&splitvbar.
+|&vbar.
+|&lor.
+}&rbrace.
+}&rbrc.
+[&lbracket.
+[&lbrk.
+\&bslash.
+\&bsl.
+]&rbracket.
+]&rbrk.
+^&caret.
+^&and.
+_&us.
+~&tilde.
+~&similar.
+&house.
+€&Cc.
+&ue.
+‚&ea.
+ƒ&ac.
+„&ae.
+…&ag.
+†&ao.
+‡&cc.
+ˆ&ec.
+‰&ee.
+Š&eg.
+‹&ie.
+Œ&ic.
+&ig.
+Ž&Ae.
+&Ao.
+&angstrom.
+&Ea.
+‘æ.
+’Æ.
+“&oc.
+”&oe.
+•&og.
+–&uc.
+—&ug.
+˜&ye.
+™&Oe.
+š&Ue.
+ݢ.
+œ&Lsterling.
+¥.
+Ÿ&fnof.
+ &aa.
+¡&ia.
+¢&oa.
+£&ua.
+¤&nt.
+¥&Nt.
+¦&aus.
+§&ous.
+¨&invq.
+©&lnotrev.
+ª&lnot.
+ª¬sym.
+«½.
+¬¼.
+&inve.
+®&odqf.
+¯&cdqf.
+à&alpha.
+A&Alpha.
+á&Beta.
+â&Gamma.
+ã&pi.
+ä&Sigma.
+å&sigma.
+æ&mu.
+ç&tau.
+è&Phi.
+é&Theta.
+ê&Omega.
+ë&delta.
+ì&infinity.
+í&phi.
+î&epsilon.
+ï&intersect.
+ð&identical.
+ñ&plusmin.
+ñ&pm.
+ò&ge.
+ò&gesym.
+ó&le.
+ó&lesym.
+ô&inttop.
+õ&intbot.
+ö÷.
+÷&nearly.
+ø°ree.
+ø°.
+ù&bullet.
+ú&dot.
+û&sqrt.
+ü&supn.
+ý².
+þ&sqbul.
+°&box14.
+±&box12.
+²&box34.
+µ&bx1012.
+¶&bx2021.
+·&bx0021.
+¸&bx0012.
+¹&bx2022.
+º&bx2020.
+»&bx0022.
+¼&bx2002.
+½&bx2001.
+¾&bx1002.
+Æ&bx1210.
+Ç&bx2120.
+È&bx2200.
+É&bx0220.
+Ê&bx2202.
+Ë&bx0222.
+Ì&bx2220.
+Í&bx0202.
+Î&bx2222.
+Ï&bx1202.
+Ð&bx1201.
+Ñ&bx0212.
+Ò&bx0121.
+Ó&bx2100.
+Ô&bx1200.
+Õ&bx0210.
+Ö&bx0120.
+×&bx2121.
+Ø&bx1212.
+Á&bxas.
+Á&bxbj.
+Å&bxcr.
+Å&bxcj.
+Â&bxde.
+Â&bxtj.
+Ä&bxh.
+À&bxll.
+Ã&bxle.
+Ã&bxlj.
+Ù&bxlr.
+´&bxri.
+´&bxrj.
+Ú&bxul.
+¿&bxur.
+³&bxv.
+Û&BOX.
+Ü&BOXBOT.
+Ý&BOXLEFT.
+Þ&BOXRIGHT.
+ß&BOXTOP.
+&darrow.
+&uarrow.
+&larrow.
+&rarrow.
+&rahead.
diff --git a/tools/wipfc/fr_CA.nls b/tools/wipfc/fr_CA.nls new file mode 100644 index 00000000..935ca3e2 --- /dev/null +++ b/tools/wipfc/fr_CA.nls @@ -0,0 +1,24 @@ +#Canadian French + +Country=2 +CodePage=850 +Note="Remarque&colon." +Caution="ATTENTION!" +Warning="Avertissement&per." +Reference="R‚f‚rence" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=. +olClose2=) +ulItemId1=o +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# WORDS defines the characters that make words. This is used for +# searching and data compression. The following is for Code page 850. + +Grammer +Words=0-9+A-Z+a-z+€++‚+ƒ+…+‡+ˆ+‰+Š+‹+Œ++“+”+–+—+˜+™+š+µ+¶+·+Ò+Ó+Ô+×+â+ê+ë +eGrammer diff --git a/tools/wipfc/fr_FR.nls b/tools/wipfc/fr_FR.nls new file mode 100644 index 00000000..79f10afb --- /dev/null +++ b/tools/wipfc/fr_FR.nls @@ -0,0 +1,24 @@ +#French + +Country=33 +CodePage=437 +Note="Remarque&colon." +Caution="ATTENTION!" +Warning="Avertissement&per." +Reference="R‚f‚rence" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=. +olClose2=) +ulItemId1=o +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# WORDS defines the characters that make words. This is used for" +# searching and data compression. The following is for Code page 437." + +Grammer +Words=0-9+A-Z+a-z+€++‚+ƒ+…+‡+ˆ+‰+Š+‹+Œ++”+–+—+˜+™+š+Ž+„+‘+’+”+¨+•+™++ž +eGrammer diff --git a/tools/wipfc/ja_JA.nls b/tools/wipfc/ja_JA.nls new file mode 100644 index 00000000..8257150b --- /dev/null +++ b/tools/wipfc/ja_JA.nls @@ -0,0 +1,22 @@ +# Japanese text + +Country=81 +CodePage=932 +Note="’&colon." +Caution="’&colon." +Warning="Œx&colon." +Reference="Reference" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=. +olClose2=) +ulItemId1=o +ulItemId2=- +ulItemId3=¥ +cgraphicFontFaceName=MINCHO +cgraphicFontWidth=6 +cgraphicFontHeight=12 +Grammer +Words=0-9+A-Z+a-z+‚O-‚X+‚`-‚y+‚-‚š +RemoveNL=@-üü +eGrammer + diff --git a/tools/wipfc/wipfc.exe.zip b/tools/wipfc/wipfc.exe.zip Binary files differnew file mode 100644 index 00000000..2111dc32 --- /dev/null +++ b/tools/wipfc/wipfc.exe.zip diff --git a/tools/wipfc/wipfc.tar.gz b/tools/wipfc/wipfc.tar.gz Binary files differnew file mode 100644 index 00000000..dc2963b8 --- /dev/null +++ b/tools/wipfc/wipfc.tar.gz diff --git a/tools/wipfc/xx_YY.nls b/tools/wipfc/xx_YY.nls new file mode 100644 index 00000000..5e45d7c7 --- /dev/null +++ b/tools/wipfc/xx_YY.nls @@ -0,0 +1,24 @@ +#User defined (currently US English) + +Country=1 +CodePage=850 +Note="Note&colon. " +Caution="CAUTION&colon. " +Warning="Warning&colon. " +Reference="Reference" +olChars=abcdefghijklmnopqrstuvwxyz +olClose1=&per. +olClose2=) +ulItemId1=o +ulItemId2=- +ulItemId3=-- +cgraphicFontFaceName="Courier" +cgraphicFontWidth=11 +cgraphicFontHeight=18 + +# Words defines the characters that make words. This is used for +# searching and data compression. The following is for Code page 850. + +Grammer +Words=0-9+A-Z+a-z +eGrammer diff --git a/uidesigner/icons.inc b/uidesigner/icons.inc index 20efd4dd..6af0aa1e 100644 --- a/uidesigner/icons.inc +++ b/uidesigner/icons.inc @@ -3217,3 +3217,195 @@ Const 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, 0); + +Const + stdimg_vfd_colorwheel : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,255, 93, 93,255,115,114,244,131,137,218,135,157,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 70, 70,255, 92, 93,255,114, + 114,255,137,137,246,154,158,219,157,178,193,154,198,166,148,216,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 70, 70,255, 92, 92,255,115,115,255,137,137,255,159, + 159,248,176,181,222,177,201,195,173,219,168,164,238,141,141,240,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,219, 70, 60, + 238, 92, 86,255,115,114,255,137,137,255,159,159,255,181,182,250,200, + 203,223,198,222,196,191,240,169,169,244,143,143,241,116,117,237,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,196, 91, 70,215,114, 97, + 235,137,125,254,158,158,255,181,181,255,204,203,251,223,226,225,219, + 245,199,198,248,171,171,244,145,145,241,118,119,238,255, 0,255,255, + 0,255,255, 0,255,153, 92, 55,174,113, 78,193,136,102,212,158,132, + 232,181,164,251,203,201,255,226,226,254,246,248,227,227,251,200,200, + 248,174,173,244,147,147,241,120,120,238, 93, 94,234,255, 0,255,255, + 0,255,132,114, 58,151,136, 81,170,158,106,189,180,133,209,203,166, + 229,226,202,248,248,241,255,255,255,229,229,251,202,202,248,176,175, + 244,149,149,241,122,122,237, 96, 96,234,255, 0,255,255, 0,255,109, + 136, 58,127,158, 79,148,180,105,167,203,133,186,225,164,206,247,200, + 225,255,225,244,255,244,231,231,251,204,204,249,177,177,245,150,151, + 241,124,124,238, 97, 97,234,255, 0,255,255, 0,255, 86,157, 53,106, + 180, 74,124,203,100,144,225,127,164,248,159,183,255,183,203,255,202, + 222,255,222,219,233,238,206,206,249,179,179,245,152,153,241,126,126, + 238,100, 99,235,255, 0,255,255, 0,255,255, 0,255, 83,203, 65,102, + 225, 90,121,247,118,141,255,141,160,255,160,180,255,180,199,255,199, + 200,234,216,194,208,232,181,181,245,154,154,242,128,128,239,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 60,225, 53, 79,247, 77, 98, + 255, 99,119,255,119,138,255,137,157,255,157,177,255,176,182,237,194, + 177,210,210,169,183,225,156,156,241,129,130,239,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 57,255, 57, 76,255, 76, 95, + 255, 95,115,255,115,135,255,134,154,255,154,162,239,172,160,212,189, + 154,185,205,144,158,220,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 53,255, 53, 73,255, 73, 93, + 255, 92,111,255,112,131,255,131,142,240,149,143,213,166,139,188,182, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 69,255, 70, 89, + 255, 89,108,255,109,121,243,127,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + stdimg_vfd_valuebar : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 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,242,209, + 0,243,209, 0,242,209, 0,242,209, 0,243,209, 0,242,210, 0,242, + 210, 0,243,209, 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,231,199, 0,231,199, + 0,231,198, 0,230,199, 0,230,199, 0,231,198, 0,231,199, 0,231, + 198, 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,219,188, 0,220,188, 0,219,188, + 0,219,188, 0,219,188, 0,220,188, 0,219,188, 0,219,188, 0,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 0, 0, 0,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0, + 196,167, 0,196,167, 0,196,167, 0,196,167, 0,196,167, 0,195,167, + 0,195,167, 0,196,167, 0,196,167, 0,196,167, 0,192,192,192,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0,196,167, 0, + 196,167, 0,196,167, 0,196,167, 0,196,167, 0,196,167, 0,196,167, + 0,196,167, 0,196,167, 0,196,167, 0,192,192,192,255, 0,255,255, + 0,255,255, 0,255,255, 0,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,192,192,192,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,161,135, 0,161,135, 0, + 161,135, 0,161,136, 0,161,135, 0,161,135, 0,161,135, 0,161,136, + 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,149,125, 0,150,125, 0,150,125, 0, + 149,124, 0,150,125, 0,150,124, 0,149,125, 0,150,125, 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,137,114, 0,138,114, 0,137,114, 0,138,114, 0, + 137,115, 0,138,114, 0,138,114, 0,138,115, 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,126,104, 0,126,104, 0,126,104, 0,126,103, 0,126,103, 0, + 126,103, 0,126,103, 0,126,104, 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,115, + 93, 0,115, 93, 0,115, 93, 0,114, 93, 0,114, 93, 0,115, 93, 0, + 115, 93, 0,115, 93, 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,102, 83, 0,103, + 83, 0,103, 83, 0,103, 82, 0,103, 82, 0,103, 82, 0,103, 83, 0, + 102, 83, 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, 91, 72, 0, 91, 72, 0, 91, + 72, 0, 92, 72, 0, 91, 72, 0, 91, 72, 0, 91, 72, 0, 91, 72, 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, 80, 62, 0, 80, 61, 0, 79, 61, 0, 79, + 62, 0, 80, 61, 0, 80, 62, 0, 80, 62, 0, 79, 61, 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, 68, 51, 0, 68, 51, 0, 68, 51, 0, 68, 51, 0, 68, + 50, 0, 68, 51, 0, 68, 51, 0, 68, 51, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + + +Const + stdimg_vfd_splitter : Array[0..1397] of byte = ( + 66, 77,118, 5, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 21, 0, 0, 0, 21, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 64, 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, 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,146,119,119,146,119,119,146,119,119,146,119, + 119,146,119,119,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,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,193,192,194,219,223,223,219,223,223,219,223,223,146,119,119, + 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,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,193,192, + 194,219,223,223,193,192,194,219,223,223,146,119,119,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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,193,192,194,193,192,194, + 146,119,119,193,192,194,146,119,119,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, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,193,192,194,219,223,223,193,192,194,219, + 223,223,146,119,119,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,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,193,192,194,219,223,223,193,192,194,219,223,223,146,119, + 119,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,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,128, 0, 0,255, 0,255,193, + 192,194,193,192,194,146,119,119,193,192,194,146,119,119,255, 0,255, + 128, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128, 0, 0,128, 0, 0,255, 0,255,193,192,194,219,223, + 223,193,192,194,219,223,223,146,119,119,255, 0,255,128, 0, 0,128, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128, 0, 0,128, + 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0, + 128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0,255, 0,255, + 255, 0,255,255, 0,255,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, + 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, + 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0, + 255, 0,255,255, 0,255,255, 0,255, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0, + 128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, 0,128, 0, + 0,128, 0, 0,128, 0, 0,128, 0, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,128, 0, 0,128, 0, 0,255, 0,255,193,192,194,219, + 223,223,193,192,194,219,223,223,146,119,119,255, 0,255,128, 0, 0, + 128, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128, 0, 0,255, 0,255,193,192,194,193,192,194,146,119, + 119,193,192,194,146,119,119,255, 0,255,128, 0, 0,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 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,193,192,194,219,223,223,193,192,194,219,223,223, + 146,119,119,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,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,193,192,194,219,223,223,193,192,194,219,223,223,146,119,119,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,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,193,192,194, + 193,192,194,146,119,119,193,192,194,146,119,119,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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,193,192,194,219,223,223,193, + 192,194,219,223,223,146,119,119,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,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,193,192,194,219,223,223,219,223,223,219,223, + 223,146,119,119,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,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,193,192,194,193,192,194,193,192,194,193,192,194,193,192,194, + 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,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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); + diff --git a/uidesigner/images/colorwheel.bmp b/uidesigner/images/colorwheel.bmp Binary files differnew file mode 100644 index 00000000..b4d8bf6b --- /dev/null +++ b/uidesigner/images/colorwheel.bmp diff --git a/uidesigner/images/splitter.bmp b/uidesigner/images/splitter.bmp Binary files differnew file mode 100644 index 00000000..bad37743 --- /dev/null +++ b/uidesigner/images/splitter.bmp diff --git a/uidesigner/images/valuebar.bmp b/uidesigner/images/valuebar.bmp Binary files differnew file mode 100644 index 00000000..904c0455 --- /dev/null +++ b/uidesigner/images/valuebar.bmp diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index b974d262..0243ec46 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -190,6 +190,7 @@ begin Name := 'frmAbout'; SetPosition(378, 267, 276, 180); WindowTitle := 'Product Information...'; + Hint := ''; Sizeable := False; WindowPosition := wpScreenCenter; @@ -221,6 +222,7 @@ begin SetPosition(194, 148, 75, 24); Anchors := [anRight,anBottom]; Text := 'Close'; + Down := False; FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.close'; @@ -285,12 +287,14 @@ var x, y: integer; wgc: TVFDWidgetClass; btn: TwgPaletteButton; + mi: TfpgMenuItem; begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: frmMain} Name := 'frmMain'; - SetPosition(84, 123, 754, 92); + SetPosition(338, 140, 754, 92); WindowTitle := 'frmMain'; + Hint := ''; ShowHint := True; WindowPosition := wpUser; MinHeight := 82; @@ -310,10 +314,12 @@ begin Name := 'btnNewForm'; SetPosition(4, 28, 25, 24); Text := ''; + Down := False; FontDesc := '#Label1'; - Hint := 'Create a new form'; + Hint := 'Add New Form to Unit'; ImageMargin := -1; ImageName := 'vfd.newform'; + ImageSpacing := 0; TabOrder := 1; Focusable := False; OnClick := @(maindsgn.OnNewForm); @@ -325,10 +331,12 @@ begin Name := 'btnOpen'; SetPosition(30, 28, 25, 24); Text := ''; + Down := False; FontDesc := '#Label1'; Hint := 'Open a file'; ImageMargin := -1; ImageName := 'stdimg.open'; + ImageSpacing := 0; TabOrder := 2; Focusable := False; OnClick := @(maindsgn.OnLoadFile); @@ -340,12 +348,15 @@ begin Name := 'btnSave'; SetPosition(56, 28, 25, 24); Text := ''; + Down := False; FontDesc := '#Label1'; Hint := 'Save the current form design'; ImageMargin := -1; ImageName := 'stdimg.save'; + ImageSpacing := 0; TabOrder := 3; Focusable := False; + Tag := 10; OnClick := @(maindsgn.OnSaveFile); end; @@ -367,6 +378,7 @@ begin SetPosition(4, 67, 144, 22); Anchors := [anLeft,anBottom]; FontDesc := '#List'; + Hint := ''; Items.Add('-'); TabOrder := 5; FocusItem := 0; @@ -377,12 +389,15 @@ begin begin Name := 'filemenu'; SetPosition(464, 64, 120, 20); - AddMenuItem('New', '', @(maindsgn.OnNewFile)); - AddMenuItem('Open', '', @(maindsgn.OnLoadFile)); + AddMenuItem('Create New File...', '', @(maindsgn.OnNewFile)); + AddMenuItem('Open...', '', @(maindsgn.OnLoadFile)); FFileOpenRecent := AddMenuItem('Open Recent...', '', nil); - AddMenuItem('Save As...', '', @(maindsgn.OnSaveFile)); AddMenuItem('-', '', nil); - AddMenuItem('New Form...', '', @(maindsgn.OnNewForm)); + mi := AddMenuItem('Save', '', @(maindsgn.OnSaveFile)); + mi.Tag := 10; + AddMenuItem('Save As New Template Unit...', '', @(maindsgn.OnSaveFile)); + AddMenuItem('-', '', nil); + AddMenuItem('Add New Form to Unit...', '', @(maindsgn.OnNewForm)); AddMenuItem('-', '', nil); AddMenuItem('Exit', '', @(maindsgn.OnExit)); end; @@ -702,6 +717,7 @@ end; procedure TPropertyList.Clear; begin FList.Clear; + Widget := nil; end; constructor TPropertyList.Create; @@ -798,7 +814,7 @@ end; function TwgPropertyList.RowHeight: integer; begin - Result := 22; + Result := 23; end; procedure TwgPropertyList.OnUpdateProperty(Sender: TObject); @@ -893,7 +909,8 @@ begin begin btn := wgPalette.Components[n] as TwgPaletteButton; btn.SetPosition(x, y, 30, 28); - + btn.ImageMargin := -1; + btn.ImageSpacing := 0; Inc(x, 32); if (x+30) >= wgpalette.Width then begin @@ -969,8 +986,8 @@ begin editor := prop.CreateEditor(Self); x := 3 + NameWidth; - y := FMargin + (FFocusItem - FFirstItem) * RowHeight; - editor.SetPosition(x, y - 1, Width - ScrollBarWidth - x, RowHeight); + y := FMargin + ((FFocusItem - FFirstItem) * RowHeight); + editor.SetPosition(x, y, Width - FMargin - ScrollBarWidth - x, RowHeight-1); // last -1 is so cell border lines are still visible editor.CreateLayout; editor.OnUpdate := @OnUpdateProperty; editor.LoadValue(Props.Widget); diff --git a/uidesigner/uidesigner.lpi b/uidesigner/uidesigner.lpi index 597c7e3c..63d091e8 100644 --- a/uidesigner/uidesigner.lpi +++ b/uidesigner/uidesigner.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> @@ -9,10 +9,9 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -112,7 +111,7 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> <SearchPaths> <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> @@ -120,7 +119,6 @@ <SyntaxOptions> <AllowLabel Value="False"/> <CPPInline Value="False"/> - <UseAnsiStrings Value="True"/> </SyntaxOptions> </Parsing> <CodeGeneration> diff --git a/uidesigner/uidesigner.lpr b/uidesigner/uidesigner.lpr index 9f0a715f..968a45dc 100644 --- a/uidesigner/uidesigner.lpr +++ b/uidesigner/uidesigner.lpr @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Library - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -23,7 +23,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, SysUtils, fpg_main, vfdmain, vfdresizer, vfdforms, + Classes, SysUtils, fpg_base, fpg_main, vfdmain, vfdresizer, vfdforms, vfdfile, newformdesigner, vfdwidgets, vfdformparser, vfdeditors, vfdwidgetclass, vfdutils, vfdprops, vfddesigner, vfdpropeditgrid; diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas index 5405b9bb..5966865b 100644 --- a/uidesigner/vfddesigner.pas +++ b/uidesigner/vfddesigner.pas @@ -43,6 +43,8 @@ uses type + TfpgEditMode = (emWidgetOrder, emTabOrder); + TOtherWidget = class(TfpgWidget) protected FFont: TfpgFont; @@ -116,8 +118,7 @@ type procedure SelectNextWidget(fw: boolean); procedure MoveResizeWidgets(dx, dy, dw, dh: integer); procedure DeleteWidgets; - procedure EditWidgetOrder; - procedure EditTabOrder; + procedure EditWidgetOrTabOrder(AMode: TfpgEditMode); procedure InsertWidget(pwg: TfpgWidget; x, y: integer; wgc: TVFDWidgetClass); procedure UpdatePropWin; procedure OnPropTextChange(Sender: TObject); @@ -142,8 +143,12 @@ implementation uses vfdmain, - TypInfo; + TypInfo, + fpg_tree; +const + cEditOrder: array[TfpgEditMode] of string = ('Widget Order', 'Tab Order'); + { TWidgetDesigner } @@ -636,134 +641,80 @@ begin end; -procedure TFormDesigner.EditWidgetOrder; +procedure TFormDesigner.EditWidgetOrTabOrder(AMode: TfpgEditMode); var frm: TWidgetOrderForm; n, fi: integer; cd: TWidgetDesigner; identlevel: integer; + lFocused: TfpgTreeNode; + lNode: TfpgTreeNode; + s: string; - procedure AddChildWidgets(pwg: TfpgWidget; slist: TStrings); + procedure AddChildWidgets(AParent: TfpgWidget; ATreeNode: TfpgTreeNode); var f: integer; fcd: TWidgetDesigner; + lNode: TfpgTreeNode; begin - for f := 0 to FWidgets.Count - 1 do + for f := 0 to FWidgets.Count-1 do begin fcd := TWidgetDesigner(FWidgets.Items[f]); - - if fcd.Widget.Parent = pwg then + if fcd.Widget.Parent = AParent then begin - frm.list.Items.AddObject(StringOfChar(' ', identlevel) + fcd.Widget.Name + ' : ' + fcd.Widget.ClassName, fcd); - Inc(identlevel); - AddChildWidgets(fcd.Widget, slist); - Dec(identlevel); + if AMode = emTabOrder then + s := ' (' + IntToStr(fcd.Widget.TabOrder) + ')' + else + s := ''; + lNode := ATreeNode.AppendText(fcd.Widget.Name + ': ' + fcd.Widget.ClassName + s); + lNode.Data := fcd; + if fcd.Selected then + lFocused := lNode; + AddChildWidgets(fcd.Widget, lNode); end; - - if fcd.Selected then - fi := f + 1; end; end; - + begin frm := TWidgetOrderForm.Create(nil); - fi := 1; + frm.WindowTitle := cEditOrder[AMode]; + frm.lblTitle.Text := Format(frm.lblTitle.Text, [cEditOrder[AMode]]); + fi := 0; identlevel := 0; + frm.Treeview1.RootNode.Clear; + lFocused := nil; - AddChildWidgets(FForm, frm.list.Items); - - if fi <= frm.list.ItemCount then - frm.list.FocusItem := fi; + AddChildWidgets(FForm, frm.Treeview1.RootNode); + frm.Treeview1.FullExpand; + if lFocused <> nil then + frm.Treeview1.Selection := lFocused + else + frm.Treeview1.Selection := frm.Treeview1.Rootnode.FirstSubNode; + frm.Treeview1.SetFocus; + if frm.ShowModal = mrOK then begin - for n := 0 to FWidgets.Count - 1 do - TWidgetDesigner(FWidgets.Items[n]).Widget.Visible := False; - - for n := 0 to FWidgets.Count - 1 do - FWidgets.Items[n] := frm.List.Items.Objects[n]; - - for n := 0 to FWidgets.Count - 1 do - begin - cd := TWidgetDesigner(FWidgets.Items[n]); - cd.Widget.Visible := True; - end; - - for n := 0 to FWidgets.Count - 1 do + n := 0; + lNode := frm.Treeview1.NextNode(frm.Treeview1.RootNode); + while lNode <> nil do begin - cd := TWidgetDesigner(FWidgets.Items[n]); - if cd.Selected then + if AMode = emWidgetOrder then begin - // re-creating the resizers - cd.Selected := False; - cd.Selected := True; - end; - end; - - end; - frm.Free; -end; - -procedure TFormDesigner.EditTabOrder; -const - cDivider = ' : '; -var - frm: TWidgetOrderForm; - n, fi: integer; - identlevel: integer; - taborder: integer; - - procedure AddChildWidgets(pwg: TfpgWidget; slist: TStrings); - var - f: integer; - fcd: TWidgetDesigner; - begin - for f := 0 to FWidgets.Count - 1 do - begin - fcd := TWidgetDesigner(FWidgets.Items[f]); - - if fcd.Widget.Parent = pwg then + FWidgets.Items[n] := lNode.Data; + end + else if AMode = emTabOrder then begin - frm.list.Items.AddObject(StringOfChar(' ', identlevel) + fcd.Widget.Name + cDivider + fcd.Widget.ClassName, fcd); - Inc(identlevel, 2); - AddChildWidgets(fcd.Widget, slist); - Dec(identlevel, 2); + if IsPublishedProp(TWidgetDesigner(lNode.Data).Widget, 'TabOrder') then + begin + TWidgetDesigner(lNode.Data).Widget.TabOrder := n; + end; end; - - if fcd.Selected then - fi := f + 1; + lNode := frm.Treeview1.NextNode(lNode); + n := n + 1; end; - end; - -begin - frm := TWidgetOrderForm.Create(nil); - frm.WindowTitle := 'Tab Order'; - fi := 1; - identlevel := 0; - - AddChildWidgets(FForm, frm.list.Items); - - if fi <= frm.list.ItemCount then - frm.list.FocusItem := fi; - - if frm.ShowModal = mrOK then - begin - taborder := 1; - for n := 0 to frm.List.Items.Count - 1 do - begin - try - if IsPublishedProp(TWidgetDesigner(frm.List.Items.Objects[n]).Widget, 'TabOrder') then - begin -// SetPropValue(TWidgetDesigner(frm.List.Items.Objects[n]).Widget, 'TabOrder', taborder); - TWidgetDesigner(frm.List.Items.Objects[n]).Widget.TabOrder := taborder; - inc(taborder); - end; - except - // do nothing. TabOrder was not published - end; - end; - end; { if } + end; { if } frm.Free; end; @@ -799,7 +750,7 @@ begin 'F4: edit items' + LineEnding}, 'Small help'); keyF2: - EditWidgetOrder; + EditWidgetOrTabOrder(emTabOrder); //keyF4: //if frmProperties.btnEdit.Visible then @@ -868,13 +819,13 @@ begin begin frmProperties.lstProps.ReleaseEditor; PropList.Clear; + PropList.Widget := wg; for n := 0 to wgc.PropertyCount-1 do begin PropList.AddItem(wgc.GetProperty(n)); if UpperCase(wgc.GetProperty(n).Name) = UpperCase(lastPropName) then i := n; end; - PropList.Widget := wg; frmProperties.lstProps.Update; if i > -1 then frmProperties.lstProps.FocusItem := i; @@ -1545,7 +1496,7 @@ constructor TOtherWidget.Create(AOwner: TComponent); begin inherited; wgClassName := 'TfpgWidget'; - FBackgroundColor := $C0E0C0; + FBackgroundColor := clUIDesignerGreen; FFont := fpgStyle.DefaultFont; FWidth := 120; FHeight := 32; diff --git a/uidesigner/vfdformparser.pas b/uidesigner/vfdformparser.pas index e08d9ce2..693107e0 100644 --- a/uidesigner/vfdformparser.pas +++ b/uidesigner/vfdformparser.pas @@ -25,6 +25,7 @@ interface uses Classes, SysUtils, + fpg_base, fpg_main, fpg_widget, fpg_form, @@ -59,6 +60,7 @@ function CheckSymbol(var s: string; const sym: string): boolean; function GetIntValue(var s: string): integer; function GetBoolValue(var s: string): boolean; function GetFloatValue(var s: string): extended; +function GetColorValue(var s: string): integer; implementation @@ -240,6 +242,28 @@ begin // Result := u8(Result); end; +function GetColorValue(var s: string): integer; +var + n: integer; + ns: string; +begin + SkipSpaces(s); + GetIdentifier(s); // extract 'TfpgColor' identifier + CheckSymbol(s, '('); + SkipSpaces(s); + ns := ''; + n := 1; + while (n <= length(s)) and (s[n] in ['$','0'..'9','a'..'f','A'..'F']) do + begin + ns := ns + s[n]; + Inc(n); + end; + Result := StrToIntDef(ns, clWindowBackground); + Delete(s, 1, length(ns)); + SkipSpaces(s); + CheckSymbol(s, ')'); +end; + function GetIdentifier(var s: string): string; var n: integer; diff --git a/uidesigner/vfdforms.pas b/uidesigner/vfdforms.pas index ec60265d..00e90855 100644 --- a/uidesigner/vfdforms.pas +++ b/uidesigner/vfdforms.pas @@ -30,11 +30,11 @@ uses fpg_label, fpg_edit, fpg_button, - fpg_listbox, fpg_combobox, fpg_trackbar, fpg_checkbox, - fpg_panel; + fpg_panel, + fpg_tree; type @@ -83,17 +83,17 @@ type procedure AfterCreate; override; procedure OnButtonClick(Sender: TObject); end; - + TWidgetOrderForm = class(TVFDDialog) public {@VFD_HEAD_BEGIN: WidgetOrderForm} - l1: TfpgLabel; - list: TfpgListBox; + lblTitle: TfpgLabel; btnOK: TfpgButton; btnCancel: TfpgButton; btnUp: TfpgButton; btnDown: TfpgButton; + TreeView1: TfpgTreeView; {@VFD_HEAD_END: WidgetOrderForm} constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -187,7 +187,7 @@ begin l1 := CreateLabel(self, 8, 8, 'Form name:'); edName := CreateEdit(self, 8, 28, 180, 0); - edName.Text := 'frm'; + edName.Text := ''; edName.OnKeyPress := @OnedNameKeyPressed; btnOK := CreateButton(self, 196, 8, 80, rsOK, @OnButtonClick); btnCancel := CreateButton(self, 196, 36, 80, rsCancel, @OnButtonClick); @@ -254,67 +254,54 @@ begin inherited AfterCreate; {@VFD_BODY_BEGIN: WidgetOrderForm} Name := 'WidgetOrderForm'; - SetPosition(534, 173, 312, 258); + SetPosition(534, 173, 426, 398); WindowTitle := 'Widget order'; Hint := ''; WindowPosition := wpScreenCenter; - l1 := TfpgLabel.Create(self); - with l1 do + lblTitle := TfpgLabel.Create(self); + with lblTitle do begin - Name := 'l1'; - SetPosition(4, 4, 108, 16); + Name := 'lblTitle'; + SetPosition(4, 4, 248, 16); FontDesc := '#Label1'; Hint := ''; - Text := 'Form widget order:'; - end; - - list := TfpgListBox.Create(self); - with list do - begin - Name := 'list'; - SetPosition(4, 24, 220, 228); - Anchors := [anLeft,anRight,anTop,anBottom]; - FontDesc := '#List'; - Hint := ''; - HotTrack := False; - PopupFrame := False; - TabOrder := 1; + Text := 'Form %s:'; end; btnOK := TfpgButton.Create(self); with btnOK do begin Name := 'btnOK'; - SetPosition(232, 24, 75, 24); + SetPosition(346, 24, 75, 24); Anchors := [anRight,anTop]; Text := 'OK'; FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.ok'; + ModalResult := mrOK; TabOrder := 2; - OnClick := @OnButtonClick; end; btnCancel := TfpgButton.Create(self); with btnCancel do begin Name := 'btnCancel'; - SetPosition(232, 52, 75, 24); + SetPosition(346, 52, 75, 24); Anchors := [anRight,anTop]; Text := 'Cancel'; FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.cancel'; + ModalResult := mrCancel; TabOrder := 3; - OnClick := @OnButtonClick; end; btnUp := TfpgButton.Create(self); with btnUp do begin Name := 'btnUp'; - SetPosition(232, 108, 75, 24); + SetPosition(346, 108, 75, 24); Anchors := [anRight,anTop]; Text := 'Up'; FontDesc := '#Label1'; @@ -328,7 +315,7 @@ begin with btnDown do begin Name := 'btnDown'; - SetPosition(232, 136, 75, 24); + SetPosition(346, 136, 75, 24); Anchors := [anRight,anTop]; Text := 'Down'; FontDesc := '#Label1'; @@ -338,82 +325,45 @@ begin OnClick := @OnButtonClick; end; + TreeView1 := TfpgTreeView.Create(self); + with TreeView1 do + begin + Name := 'TreeView1'; + SetPosition(4, 24, 336, 368); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 7; + end; + {@VFD_BODY_END: WidgetOrderForm} end; procedure TWidgetOrderForm.OnButtonClick(Sender: TObject); var - i: integer; - n: integer; - myilev: integer; - - function IdentLevel(astr: string): integer; - var - s: string; - f: integer; - begin - Result := 0; - s := astr; - f := 1; - while (f <= length(s)) and (s[f] = ' ') do - begin - Inc(Result); - Inc(f); - end; - end; - + lNode: TfpgTreeNode; begin - if Sender = btnOK then - ModalResult := mrOK - else if Sender = btnCancel then - ModalResult := mrCancel - else + lNode := Treeview1.Selection; + if lNode = nil then + exit; + + if Sender = btnUp then begin - // up / down - i := list.FocusItem; - if i < 0 then - Exit; - - myilev := IdentLevel(list.Items[i]); - - if Sender = btnUP then - begin - if (i > 0) and (IdentLevel(list.Items[i - 1]) = myilev) then - begin - list.Items.Move(i, i - 1); - - n := i; - while (n < list.Items.Count) and (IdentLevel(list.Items[n]) > myilev) do - begin - list.Items.Move(n, n - 1); - Inc(n); - end; - - list.FocusItem := i - 1; - end; - end - else if Sender = btnDOWN then - if (i < list.Items.Count-1) then - begin - n := i; - while (n < list.Items.Count) and (IdentLevel(list.Items[n]) > myilev) do - Inc(n); - - if (i = n) and (i < list.Items.Count-1) and (IdentLevel(list.Items[i]) > myilev) then - Exit; - - if (n > list.Items.Count-1) then - Exit; //==> - - while (n >= i) do - begin - list.Items.Move(n, n + 1); - Dec(n); - end; - - list.FocusItem := i + 1; - end; + if lNode.Prev = nil then + exit; // nothing to do + lNode.MoveTo(lNode.Prev, naInsert); + end + else + begin // btnDown + if (lNode.Next = nil) then + exit; // nothing to do + if (lNode.Next.Next = nil) then // the last node doesn't have a next + lNode.MoveTo(lNode.Next, naAdd) + else + lNode.MoveTo(lNode.Next.Next, naInsert); end; + + Treeview1.Invalidate; end; { TVFDDialogBase } @@ -575,6 +525,7 @@ begin begin Name := 'edtDefaultExt'; SetPosition(28, 216, 68, 24); + ExtraHint := ''; Hint := ''; TabOrder := 5; Text := ''; diff --git a/uidesigner/vfdmain.pas b/uidesigner/vfdmain.pas index a6b8f0b2..38af725a 100644 --- a/uidesigner/vfdmain.pas +++ b/uidesigner/vfdmain.pas @@ -179,7 +179,7 @@ var begin fname := EditedFileName; - if ((Sender as TComponent).Name = 'btnSave') + if ((Sender as TComponent).Tag = 10) and (EditedFileName <> '') then fname := EditedFileName else @@ -277,19 +277,44 @@ procedure TMainDesigner.OnNewForm(Sender: TObject); var fd: TFormDesigner; nfrm: TNewFormForm; + + function DoesNameAlreadyExist(const AName: string): boolean; + var + i: integer; + begin + Result := False; + for i := 0 to FDesigners.Count-1 do + begin + if TFormDesigner(FDesigners[i]).Form.Name = AName then + begin + Result := True; + break; + end; + end; + end; begin nfrm := TNewFormForm.Create(nil); - if nfrm.ShowModal = mrOK then - if nfrm.edName.Text <> '' then + try + if nfrm.ShowModal = mrOK then begin - fd := TFormDesigner.Create; - fd.Form.Name := nfrm.edName.Text; - fd.Form.WindowTitle := nfrm.edName.Text; + if DoesNameAlreadyExist(nfrm.edName.Text) then + begin + TfpgMessageDialog.Critical('Name Conflict','The form name already exists in the current unit, please try again'); + exit; + end; + fd := TFormDesigner.Create; + if nfrm.edName.Text <> '' then + fd.Form.Name := nfrm.edName.Text; + fd.Form.WindowTitle := fd.Form.Name; fd.OneClickMove := OneClickMove; FDesigners.Add(fd); + SelectedForm := fd; fd.Show; end; - nfrm.Free; + + finally + nfrm.Free; + end; end; procedure TMainDesigner.CreateWindows; @@ -392,13 +417,13 @@ end; procedure TMainDesigner.OnEditWidgetOrder(Sender: TObject); begin if SelectedForm <> nil then - SelectedForm.EditWidgetOrder; + SelectedForm.EditWidgetOrTabOrder(emWidgetOrder); end; procedure TMainDesigner.OnEditTabOrder(Sender: TObject); begin if SelectedForm <> nil then - SelectedForm.EditTabOrder; + SelectedForm.EditWidgetOrTabOrder(emTabOrder); end; procedure TMainDesigner.OnExit(Sender: TObject); diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas index 687254ea..b0c659fe 100644 --- a/uidesigner/vfdprops.pas +++ b/uidesigner/vfdprops.pas @@ -92,6 +92,16 @@ type function CreateEditor(AOwner: TComponent): TVFDPropertyEditor; override; procedure OnExternalEdit(wg: TfpgWidget); override; end; + + + TPropertyColor = class(TVFDWidgetProperty) + public + function ParseSourceLine(wg: TfpgWidget; const line: string): boolean; override; + function GetPropertySource(wg: TfpgWidget; const ident: string): string; override; + function GetValueText(wg: TfpgWidget): string; override; + function CreateEditor(AOwner: TComponent): TVFDPropertyEditor; override; + procedure OnExternalEdit(wg: TfpgWidget); override; + end; TGPEType = (gptInteger, gptString, gptFloat); @@ -331,7 +341,7 @@ begin Edit.Anchors := Anchors; // Edit.OnChange := @UpdateProperty; Edit.OnKeyPress := @EditKeyPressed; - Edit.OnExit :=@EditExit; + Edit.OnExit := @EditExit; Edit.Visible := True; end; @@ -657,7 +667,7 @@ begin try SetEnumProp(wg, Name, sval); except - Writeln('invalid enum value: "' + sval + '" for ' + Name); +// Writeln('invalid enum value: "' + sval + '" for ' + Name); Result := False; end; end; @@ -767,7 +777,7 @@ end; function TPropertyFloat.GetPropertySource(wg: TfpgWidget; const ident: string): string; begin - Result := ident + Name + ' := ' + FloatToStr(GetFloatProp(wg, Name)) + ';' + LineEnding + Result := ident + Name + ' := ' + FloatToStr(GetFloatProp(wg, Name)) + ';' + LineEnding; end; function TPropertyFloat.GetValueText(wg: TfpgWidget): string; @@ -782,5 +792,86 @@ begin etype := gptFloat; end; +{ TPropertyColor } + +function TPropertyColor.ParseSourceLine(wg: TfpgWidget; const line: string): boolean; +var + s: string; + ival: integer; +begin + s := line; + Result := False; + if UpperCase(GetIdentifier(s)) <> UpperCase(Name) then + Exit; + + Result := CheckSymbol(s, ':='); + if Result then + begin + ival := GetColorValue(s); + Result := CheckSymbol(s, ';'); + end; + + if Result then + try + SetOrdProp(wg, Name, ival); + except +// Writeln('invalid ordinal value: "', ival, '" for ', Name); + Result := False; + end; +end; + +function TPropertyColor.GetPropertySource(wg: TfpgWidget; const ident: string): string; +var + PropInfo: PPropInfo; + i: integer; + c: TfpgColor; + nc: TfpgColor; +begin + PropInfo := GetPropInfo(wg.ClassType, Name); + i := GetOrdProp(wg, Name); + if PropInfo^.Default <> i then + begin + if fpgIsNamedColor(TfpgColor(i)) then + Result := ident + Name + ' := TfpgColor($' + IntToHex(i, 8) + ');' + LineEnding + else + begin + c := fpgColorToRGB(TfpgColor(i)); + Result := ident + Name + ' := TfpgColor($' + IntToHex(c, 6) + ');' + LineEnding; + end; + end + else + Result := ''; +end; + +function TPropertyColor.GetValueText(wg: TfpgWidget): string; +var + PropInfo: PPropInfo; + i: integer; + c: TfpgColor; +begin + PropInfo := GetPropInfo(wg.ClassType, Name); + i := GetOrdProp(wg, Name); + c := fpgColorToRGB(TfpgColor(i)); + Result := '$' + IntToHex(c, 6); +end; + +function TPropertyColor.CreateEditor(AOwner: TComponent): TVFDPropertyEditor; +begin + Result := TExternalPropertyEditor.Create(AOwner, self); +end; + +procedure TPropertyColor.OnExternalEdit(wg: TfpgWidget); +var + PropInfo: PPropInfo; + i: integer; + c: TfpgColor; +begin + PropInfo := GetPropInfo(wg.ClassType, Name); + i := GetOrdProp(wg, Name); + c := fpgColorToRGB(TfpgColor(i)); + c := fpgSelectColorDialog(c); + SetOrdProp(wg, Name, c); +end; + end. diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas index 654abf5f..8ac4a08c 100644 --- a/uidesigner/vfdwidgets.pas +++ b/uidesigner/vfdwidgets.pas @@ -64,6 +64,8 @@ uses fpg_popupcalendar, fpg_gauge, fpg_editbtn, + fpg_ColorWheel, + fpg_splitter, vfdpropeditgrid, vfdmain; @@ -294,6 +296,21 @@ begin 'vfd.editfont', @stdimg_vfd_editfont, sizeof(stdimg_vfd_editfont), 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.colorwheel', @stdimg_vfd_colorwheel, + sizeof(stdimg_vfd_colorwheel), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.valuebar', @stdimg_vfd_valuebar, + sizeof(stdimg_vfd_valuebar), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.splitter', @stdimg_vfd_splitter, + sizeof(stdimg_vfd_splitter), + 0, 0); end; procedure AddWidgetPosProps(wgc: TVFDWidgetClass); @@ -313,21 +330,33 @@ begin wc := TVFDWidgetClass.Create(TfpgForm); wc.NameBase := 'frm'; wc.AddProperty('WindowTitle', TPropertyString, ''); -// wc.AddProperty('WindowPosition', TPropertyEnum, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('Sizeable', TPropertyBoolean, 'Can the form be resized at runtime'); + //wc.AddProperty('BackgroundColor', TPropertyColor, ''); + //wc.AddProperty('TextColor', TPropertyColor, ''); + //wc.AddProperty('MaxHeight', TPropertyInteger, ''); + //wc.AddProperty('MaxWidth', TPropertyInteger, ''); + //wc.AddProperty('MinHeight', TPropertyInteger, ''); + //wc.AddProperty('MinWidth', TPropertyInteger, ''); + //wc.AddProperty('FullScreen', TPropertyBoolean, ''); + //wc.AddProperty('WindowPosition', TPropertyEnum, ''); FVFDFormWidget := wc; // Label wc := TVFDWidgetClass.Create(TfpgLabel); wc.NameBase := 'Label'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('Alignment', TPropertyEnum, 'Horizontal text alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the label text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Layout', TPropertyEnum, 'Vertical text layout'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Text', TPropertyString, 'Label text'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.AddProperty('WrapText', TPropertyBoolean, 'If True text will wrap when it doesn''t fit the width'); wc.WidgetIconName := 'vfd.label'; RegisterVFDWidget(wc); @@ -335,39 +364,50 @@ begin // Edit wc := TVFDWidgetClass.Create(TfpgEdit); wc.NameBase := 'Edit'; -// wc.AddProperty('Color', TPropertyColor, 'Text color'); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('AutoSelect', TPropertyBoolean, 'On receiving focus, auto select text'); wc.AddProperty('AutoSize', TPropertyBoolean, 'Change Height based on FontDesc being set'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('BorderStyle', TPropertyEnum, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('ExtraHint', TPropertyString, ''); - wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); - wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('IgnoreMouseCursor', TPropertyBoolean, 'If True, then mouse pointer doesn''t change'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('Text', TPropertyString, 'Initial text'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.edit'; RegisterVFDWidget(wc); // Memo wc := TVFDWidgetClass.Create(TfpgMemo); wc.NameBase := 'Memo'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Lines', TPropertyStringList, ''); - wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.memo'; RegisterVFDWidget(wc); // Button wc := TVFDWidgetClass.Create(TfpgButton); wc.NameBase := 'Button'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.AddProperty('AllowAllUp', TPropertyBoolean, ''); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Down', TPropertyBoolean, 'Only valid when in group mode'); wc.AddProperty('Embedded', TPropertyBoolean, 'No focus rectangle will be drawn. eg: Toolbar buttons'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Flat', TPropertyBoolean, 'Only draw button borders when mouse hovers over button'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); @@ -381,26 +421,34 @@ begin wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowImage', TPropertyBoolean, 'Boolean value'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.button'; RegisterVFDWidget(wc); // CheckBox wc := TVFDWidgetClass.Create(TfpgCheckBox); wc.NameBase := 'CheckBox'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.checkbox'; RegisterVFDWidget(wc); // RadioButton wc := TVFDWidgetClass.Create(TfpgRadioButton); wc.NameBase := 'RadioButton'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); @@ -408,53 +456,73 @@ begin wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.radiobutton'; RegisterVFDWidget(wc); // ComboBox wc := TVFDWidgetClass.Create(TfpgComboBox); wc.NameBase := 'ComboBox'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Items', TPropertyStringList, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.combobox'; RegisterVFDWidget(wc); // Calendar ComboBox wc := TVFDWidgetClass.Create(TfpgCalendarCombo); wc.NameBase := 'CalendarCombo'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('DateFormat', TPropertyString, 'Standard RTL date formatting applies'); + wc.AddProperty('DayColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('HolidayColor', TPropertyColor, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('SelectedColor', TPropertyColor, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); - wc.AddProperty('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); wc.WidgetIconName := 'vfd.combodateedit'; RegisterVFDWidget(wc); // Calendar ComboBox Checkbox wc := TVFDWidgetClass.Create(TfpgCalendarCheckCombo); wc.NameBase := 'CalendarCombo'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); wc.AddProperty('DateFormat', TPropertyString, 'Standard RTL date formatting applies'); + wc.AddProperty('DayColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('HolidayColor', TPropertyColor, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('SelectedColor', TPropertyColor, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); - wc.AddProperty('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); wc.WidgetIconName := 'vfd.combodatecheckedit'; RegisterVFDWidget(wc); // ListBox wc := TVFDWidgetClass.Create(TfpgListBox); wc.NameBase := 'ListBox'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('AutoHeight', TPropertyBoolean, ''); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.Addproperty('DragToReorder', TPropertyBoolean, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('HotTrack', TPropertyBoolean, ''); @@ -469,9 +537,13 @@ begin // Color ListBox wc := TVFDWidgetClass.Create(TfpgColorListBox); wc.NameBase := 'ColorListBox'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('AutoHeight', TPropertyBoolean, ''); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Color', TPropertyColor, 'The currently selected color'); wc.AddProperty('ColorPalette', TPropertyEnum, ''); wc.Addproperty('DragToReorder', TPropertyBoolean, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('HotTrack', TPropertyBoolean, ''); @@ -486,16 +558,20 @@ begin // StringGrid wc := TVFDWidgetClass.Create(TfpgStringGrid); wc.NameBase := 'Grid'; - wc.AddProperty('Columns', TPropertyDBColumns, ''); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('AlternateBGColor', TPropertyColor, 'The color of every alternative row. Dependent on grid Options property.'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Columns', TPropertyDBColumns, 'Defines the various columns for a grid. At least one column must exist.'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('HeaderFontDesc', TPropertyFontDesc, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); - wc.AddProperty('RowCount', TPropertyInteger, ''); - wc.AddProperty('RowSelect', TPropertyBoolean, ''); - wc.AddProperty('ShowHeader', TPropertyBoolean, ''); + wc.AddProperty('RowCount', TPropertyInteger, 'Default number of rows in the grid'); + wc.AddProperty('RowSelect', TPropertyBoolean, 'If enabled, a whole row is selected, not just a cell'); + wc.AddProperty('ShowGrid', TPropertyBoolean, 'Must the grid lines be shown'); + wc.AddProperty('ShowHeader', TPropertyBoolean, 'Must the grid header be visible'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); - wc.AddProperty('ShowGrid', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.stringgrid'; RegisterVFDWidget(wc); @@ -503,13 +579,16 @@ begin // Bevel wc := TVFDWidgetClass.Create(TfpgBevel); wc.NameBase := 'Bevel'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentBackgroundColor', TPropertyBoolean, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); - wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); wc.AddProperty('Shape', TPropertyEnum, 'Box, Frame, TopLine, Spacer etc..'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); wc.WidgetIconName := 'vfd.bevel'; wc.Container := True; RegisterVFDWidget(wc); @@ -517,17 +596,22 @@ begin // Panel wc := TVFDWidgetClass.Create(TfpgPanel); wc.NameBase := 'Panel'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('Alignment', TPropertyEnum, 'Text alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Layout', TPropertyEnum, 'Layout of the caption'); wc.AddProperty('LineSpace', TPropertyInteger, 'Line spacing between wrapped caption'); - wc.AddProperty('Margin', TPropertyInteger, 'Margin of text'); - wc.AddProperty('ParentBackgroundColor', TPropertyBoolean, ''); + wc.AddProperty('Margin', TPropertyInteger, 'Margin width around the borders that the text should not paint in.'); + wc.AddProperty('ParentBackgroundColor', TPropertyBoolean, 'Should the color of the parent be used instead.'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); wc.AddProperty('Text', TPropertyString, 'The panel caption'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.AddProperty('WrapText', TPropertyBoolean, 'Should the panel text be wrapped'); wc.WidgetIconName := 'vfd.panel'; wc.Container := True; @@ -536,15 +620,19 @@ begin // GroupBox wc := TVFDWidgetClass.Create(TfpgGroupBox); wc.NameBase := 'GroupBox'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('Alignment', TPropertyEnum, 'Text alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('Margin', TPropertyInteger, 'Margin of text'); + wc.AddProperty('Margin', TPropertyInteger, 'Margin width around the borders that the text should not paint in.'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); - wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Text', TPropertyString, 'The panel caption'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.groupbox'; wc.Container := True; RegisterVFDWidget(wc); @@ -552,34 +640,44 @@ begin // ProgressBar wc := TVFDWidgetClass.Create(TfpgProgressBar); wc.NameBase := 'ProgressBar'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Max', TPropertyInteger, ''); + wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Position', TPropertyInteger, ''); wc.AddProperty('ShowCaption', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.progressbar'; RegisterVFDWidget(wc); // TrackBar wc := TVFDWidgetClass.Create(TfpgTrackBar); wc.NameBase := 'TrackBar'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Max', TPropertyInteger, ''); wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Orientation', TPropertyEnum, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); - wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Position', TPropertyInteger, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowPosition', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.trackbar'; RegisterVFDWidget(wc); // ListView wc := TVFDWidgetClass.Create(TfpgListView); wc.NameBase := 'ListView'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('MultiSelect', TPropertyBoolean, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -592,7 +690,9 @@ begin // Treeview wc := TVFDWidgetClass.Create(TfpgTreeView); wc.NameBase := 'TreeView'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('DefaultColumnWidth',TPropertyInteger, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc',TPropertyFontDesc, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -601,6 +701,7 @@ begin wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowImages',TPropertyBoolean, 'Boolean value'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TreeLineColor', TPropertyColor, ''); wc.AddProperty('TreeLineStyle', TPropertyEnum, ''); wc.WidgetIconName := 'vfd.treeview'; RegisterVFDWidget(wc); @@ -609,6 +710,9 @@ begin wc := TVFDPageControlWidgetClass.Create(TfpgPageControl); wc.NameBase := 'PageControl'; wc.AddProperty('ActivePageIndex', TPropertyInteger, ''); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FixedTabWidth', TPropertyInteger, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -617,6 +721,7 @@ begin wc.AddProperty('Style', TPropertyEnum, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('TabPosition', TPropertyEnum, ''); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.WidgetIconName := 'vfd.pagecontrol'; wc.Container := True; wc.BlockMouseMsg := False; @@ -625,6 +730,8 @@ begin // TabSheet wc := TVFDWidgetClass.Create(TfpgTabSheet); wc.NameBase := 'TabSheet'; + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('Text', TPropertyString, 'The tab title'); wc.WidgetIconName := 'vfd.tabsheet'; wc.Container := True; @@ -633,12 +740,17 @@ begin // Gauge wc := TVFDWidgetClass.Create(TfpgGauge); wc.NameBase := 'Gauge'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('Color', TPropertyColor, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('FirstColor', TPropertyColor, ''); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Kind', TPropertyEnum, ''); - wc.AddProperty('MinValue', TPropertyInteger, ''); wc.AddProperty('MaxValue', TPropertyInteger, ''); + wc.AddProperty('MinValue', TPropertyInteger, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Progress', TPropertyInteger, ''); + wc.AddProperty('SecondColor', TPropertyColor, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowText', TPropertyBoolean, 'Boolean value'); wc.WidgetIconName := 'vfd.gauge'; @@ -648,31 +760,39 @@ begin // Integer Edit wc := TVFDWidgetClass.Create(TfpgEditInteger); wc.NameBase := 'EditInteger'; - wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('NegativeColor', TPropertyColor, 'Color used for negative values'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); -// wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); wc.AddProperty('Value', TPropertyInteger, 'Initial value'); +// wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); wc.WidgetIconName := 'vfd.editinteger'; RegisterVFDWidget(wc); // Float Edit wc := TVFDWidgetClass.Create(TfpgEditFloat); wc.NameBase := 'EditFloat'; - wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.Addproperty('Decimals', TPropertyInteger, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('FixedDecimals', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('NegativeColor', TPropertyColor, 'Color used for negative values'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); - wc.AddProperty('Value', TPropertyFloat, 'Initial value'); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); - wc.AddProperty('FixedDecimals', TPropertyBoolean, ''); - wc.Addproperty('Decimals', TPropertyInteger, ''); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); + wc.AddProperty('Value', TPropertyFloat, 'Initial value'); // wc.AddProperty('CustomDecimalSeparator', TPropertyString, 'Decimal separator character'); // wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); wc.WidgetIconName := 'vfd.editfloat'; @@ -681,15 +801,19 @@ begin // Currency Edit wc := TVFDWidgetClass.Create(TfpgEditCurrency); wc.NameBase := 'EditCurrency'; - wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); - wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.Addproperty('Decimals', TPropertyInteger, ''); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('NegativeColor', TPropertyColor, 'Color used for negative values'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); - wc.AddProperty('Value', TPropertyFloat, 'Initial value'); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); - wc.Addproperty('Decimals', TPropertyInteger, ''); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('TextColor', TPropertyColor, ''); + wc.AddProperty('Value', TPropertyFloat, 'Initial value'); // wc.AddProperty('CustomDecimalSeparator', TPropertyString, 'Decimal separator character'); // wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); wc.WidgetIconName := 'vfd.editcurrency'; @@ -735,10 +859,12 @@ begin // Filename Edit wc := TVFDWidgetClass.Create(TfpgFileNameEdit); wc.NameBase := 'FilenameEdit'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('ExtraHint', TPropertyString, ''); wc.AddProperty('FileName', TPropertyString, 'Preset filename in edit component'); - wc.AddProperty('InitialDir', TPropertyString, 'Initial starting directory of the dialog'); wc.AddProperty('Filter', TPropertyString, 'Filename filters used in the dialog'); + wc.AddProperty('InitialDir', TPropertyString, 'Initial starting directory of the dialog'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.editfilename'; RegisterVFDWidget(wc); @@ -746,8 +872,10 @@ begin // Directory Edit wc := TVFDWidgetClass.Create(TfpgDirectoryEdit); wc.NameBase := 'DirectoryEdit'; - wc.AddProperty('ExtraHint', TPropertyString, ''); + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); wc.AddProperty('Directory', TPropertyString, 'Preset directory name in edit component'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('ExtraHint', TPropertyString, ''); wc.AddProperty('RootDirectory', TPropertyString, 'Initial starting directory of the dialog'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.editdirectory'; @@ -756,11 +884,47 @@ begin // Font Edit wc := TVFDWidgetClass.Create(TfpgFontEdit); wc.NameBase := 'DirectoryEdit'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('ExtraHint', TPropertyString, ''); wc.AddProperty('FontDesc', TPropertyString, 'Specify a preset font description'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.editfont'; RegisterVFDWidget(wc); + // Color wheel + wc := TVFDWidgetClass.Create(TfpgColorWheel); + wc.NameBase := 'ColorWheel'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('CursorSize', TPropertyInteger, 'Size of cross-hair in color wheel'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('MarginWidth', TPropertyInteger, 'The margin that will not be painted on four sides of widget'); + wc.AddProperty('WhiteAreaPercent', TPropertyInteger, 'The percentage of the centre of the wheel which is white'); + wc.WidgetIconName := 'vfd.colorwheel'; + RegisterVFDWidget(wc); + + // Value Bar - works in accordance with color wheel + wc := TVFDWidgetClass.Create(TfpgValueBar); + wc.NameBase := 'ValueBar'; + wc.AddProperty('Align', TPropertyEnum, 'Component alignment'); + wc.AddProperty('BackgroundColor', TPropertyColor, ''); + wc.AddProperty('CursorHeight', TPropertyInteger, 'Size of selection cursor'); + wc.AddProperty('Enabled', TPropertyBoolean, ''); + wc.AddProperty('MarginWidth', TPropertyInteger, 'The margin that will not be painted on four sides of widget'); + wc.AddProperty('Value', TPropertyFloat, ''); + wc.WidgetIconName := 'vfd.valuebar'; + RegisterVFDWidget(wc); + + // Splitter - works in accordance with color wheel + wc := TVFDWidgetClass.Create(TfpgSplitter); + wc.NameBase := 'Splitter'; + wc.AddProperty('Align', TPropertyEnum, ''); + wc.AddProperty('ColorGrabBar', TPropertyColor, ''); + wc.AddProperty('AutoSnap', TPropertyBoolean, ''); + wc.WidgetIconName := 'vfd.splitter'; + RegisterVFDWidget(wc); + // Other - do not delete!!! this should be the last... wc := TVFDWidgetClass.Create(TOtherWidget); wc.NameBase := 'Custom'; |