diff options
166 files changed, 6630 insertions, 2759 deletions
diff --git a/docs/INSTALL.txt b/docs/INSTALL.txt index 806b7d82..26eee168 100644 --- a/docs/INSTALL.txt +++ b/docs/INSTALL.txt @@ -5,8 +5,8 @@ - Building fpGUI from the Command Line - ==================================== +Building fpGUI from the Command Line +â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• This is still a work in progress until I can find a suitable solution. I'm not 100% satisfied with this, but it's a quick and dirty way to get things @@ -28,12 +28,12 @@ The extrafpc.cfg file located in the src directory is combined with your global fpc.cfg file. The local extrafpc.cfg file sets up all the required search and include paths to compile the CoreLib and GUI directories. -All compiled units (*.o and *.ppu) are saved in the <fpgui>/lib directory. This +All compiled units (*.o and *.ppu) are saved in the <fpgui>/lib directory. This makes the search paths for you applications a little easier to setup. - Building fpGUI using Lazarus - ============================ +Building fpGUI using Lazarus +â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• I use a Lazarus feature call Packages that compiles the required units and keeps track of the compiled units and paths when creating @@ -54,8 +54,8 @@ applications. source. The compiled units will be placed in the <project>/units directory. -When you create you own project, all you need to do is tell Lazarus to -associate the 'fpgui_package.lpk' with your project and it will automatically +When you create you own project, all you need to do is tell Lazarus to +associate the 'fpgui_package.lpk' with your project and it will automatically find all the fpGUI compiled units and source for you. * Creating a new project. Select Project->New Project. Select @@ -69,8 +69,8 @@ find all the fpGUI compiled units and source for you. automatically include the paths to the fpGUI compiled units for you. - Building fpGUI from the Free Pascal Text IDE - ============================================ +Building fpGUI from the Free Pascal Text IDE +â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• First you would need to setup the 'fp' IDE to find the related files. As far as I understand the text mode IDE has it's own built-in compiler @@ -93,7 +93,7 @@ so doesn't read the standard fpc.cfg file. Again change the paths to point to your actual directories and X11 or GDI corelib backend. - /home/graemeg/programming/fpGUI/src/corelib + /home/graemeg/programming/fpGUI/src/corelib /home/graemeg/programming/fpGUI/src/corelib/x11 * Now changes to 'Miscellaneous' tab, PPU output directory. Type in @@ -106,11 +106,11 @@ so doesn't read the standard fpc.cfg file. directories for you! * Now you are ready to open your projects main program unit (F3) and - compiling it by pressing (F9). + compiling it by pressing (F9). - Compiling any of the examples from the Command Line - =================================================== +Compiling any of the examples from the Command Line +â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• You need to compile fpGUI first as mentioned above! Every project in the ../examples directory has it's own extrafpc.cfg file. @@ -123,17 +123,22 @@ Example: fpc @extrafpc.cfg docedit.lpr - MacOSX instructions and known issues - ==================================== +Mac OSX instructions and known issues +â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• -NOTE: - MacOSX is still an unsupported platform, but some users have reported +NOTE #1: + MacOSX is still an unsupported platform, but users have reported that it works, so I decided to add some of their notes here for any other Mac users that want to try fpGUI. -To run fpGUI based application under MacOSX, you use the X11 backend. X11 -is included with all recent MacOSX versions (in older OSX versions it was -a separate install - but included on the install DVD). +NOTE #2: + It seems Apple stopped shipping X11 with OSX. From OSX 10.9 you need to + install X11 Server support by downloading it from the open source project + named XQuartz [http://xquartz.macosforge.org/landing/]. + +To compile and run fpGUI based application under MacOSX, you use the X11 backend. +X11 is included with all recent MacOSX versions (in older OSX versions it was a +separate install - but included on the install DVD). An example workflow to work with any fpgui app is: a) launch X11 (Applications -> Utilities) @@ -156,14 +161,20 @@ d) type ./appname to start the application "appname" choose the path during installation, so probably other OSX users will have to double check the correct X11 library path. + If you still get the error about the missing X11 the you might have to setup + a generic symlink. eg: + + cd /usr/X11/lib + sudo ln -s libX11.6.dylib libX11.dylib + sudo ln -s libXft.2.dylib libXft.dylib + sudo ln -s libfontconfig.1.dylib libfontconfig.dylib + * Compiling from the command line, the compiler cannot create the - sub-directory "units" used by most demos inluded with fpGUI. So remember to - create such a directory if the compiler fails. The compiler output will + sub-directory "units" used by most demos included with fpGUI. So remember to + create such a directory if the compilation fails. The compiler output will clearly state such a situation. When using Lazarus or Maximus IDE to compile fpGUI projects, the IDE will creates the missing unit output path for you. - =================[ END ]=================== - - + â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•[ END ]â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• diff --git a/docs/build_html.sh b/docs/build_html.sh deleted file mode 100755 index b43cdd63..00000000 --- a/docs/build_html.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# fpc/bin must be in your PATH - -app=fpdoc -#app=/opt/fpc_2.5.1/x86_64-linux/bin/fpdoc -#app=/media/flash16gig/programming/fpdoc_ipf/fpdoc - -$app \ - --package=fpgui \ - --format=html \ - --output=html/ \ - --charset=UTF-8 \ - --footer-date='yyyy-mm-dd' \ - --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 \ - --input='-Fi../src/corelib -Fi../src ../src/corelib/fpg_main.pas' --descr=xml/corelib/fpg_main.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_extinterpolation.pas' --descr=xml/corelib/fpg_extinterpolation.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_imgfmt_bmp.pas' --descr=xml/corelib/fpg_imgfmt_bmp.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_widget.pas' --descr=xml/corelib/fpg_widget.xml \ - --input='-Fi../src/corelib -Fi../src/corelib/x11 ../src/corelib/fpg_utils.pas' --descr=xml/corelib/fpg_utils.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.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_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 \ - -# --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ -# --input='-Fi../src/corelib ../src/corelib/fpg_.pas' --descr=xml/corelib/fpg_.xml \ - - diff --git a/docs/build_ipf.sh b/docs/build_ipf.sh deleted file mode 100755 index bdb841b1..00000000 --- a/docs/build_ipf.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# fpc/bin must be in your PATH - -app=fpdoc -#app=/opt/fpc_2.5.1/x86_64-linux/bin/fpdoc -#app=/media/flash16gig/programming/fpdoc_ipf/fpdoc - -$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 \ - --input='-Fi../src/corelib -Fi../src ../src/corelib/fpg_main.pas' --descr=xml/corelib/fpg_main.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_extinterpolation.pas' --descr=xml/corelib/fpg_extinterpolation.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_imgfmt_bmp.pas' --descr=xml/corelib/fpg_imgfmt_bmp.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_widget.pas' --descr=xml/corelib/fpg_widget.xml \ - --input='-Fi../src/corelib -Fi../src/corelib/x11 ../src/corelib/fpg_utils.pas' --descr=xml/corelib/fpg_utils.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.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_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 \ - -# --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ -# --input='-Fi../src/corelib ../src/corelib/fpg_.pas' --descr=xml/corelib/fpg_.xml \ - - diff --git a/docs/build_rtf.sh b/docs/build_rtf.sh deleted file mode 100755 index 33b1825e..00000000 --- a/docs/build_rtf.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# fpc/bin must be in your PATH - -app=fpdoc -#app=/opt/fpc_2.5.1/x86_64-linux/bin/fpdoc -#app=/media/flash16gig/programming/fpdoc_ipf/fpdoc - -$app \ - --package=fpgui \ - --format=rtf \ - --output=fpgui.rtf \ - --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 \ - --input='-Fi../src/corelib -Fi../src ../src/corelib/fpg_main.pas' --descr=xml/corelib/fpg_main.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_extinterpolation.pas' --descr=xml/corelib/fpg_extinterpolation.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_imgfmt_bmp.pas' --descr=xml/corelib/fpg_imgfmt_bmp.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_widget.pas' --descr=xml/corelib/fpg_widget.xml \ - --input='-Fi../src/corelib -Fi../src/corelib/x11 ../src/corelib/fpg_utils.pas' --descr=xml/corelib/fpg_utils.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.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_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 \ - -# --input='-Fi../src/gui ../src/gui/fpg_.pas' --descr=xml/gui/fpg_.xml \ -# --input='-Fi../src/corelib ../src/corelib/fpg_.pas' --descr=xml/corelib/fpg_.xml \ - - diff --git a/docs/builddocs.pas b/docs/builddocs.pas deleted file mode 100644 index c85abe58..00000000 --- a/docs/builddocs.pas +++ /dev/null @@ -1,221 +0,0 @@ -{ - 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, Process; - -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; - FDivider: string; - procedure FileSearch(SearchDir: string; ExtensionMask: string; var FileList: TStrings; Recursive: boolean = True); - function ExtractFileNameOnly(AFilename: string): string; - procedure BuildCommandLine; - procedure WriteScript; - procedure ExecuteFPDoc; - 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.BuildCommandLine; -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 - // fix command line separators at the same time - FCommand := FCommand + FDivider + Format(cFileLine, [SetDirSeparators(Format(cFilePath, [FPasFiles[j]])), FXMLFiles[i]]); - end; - end; - end; - -// FCommand := SetDirSeparators(FCommand); - {.$IFDEF Windows} - FCommand := StringReplace(FCommand, '''', '"', [rfReplaceAll]); - {.$ENDIF} -end; - -procedure TBuildDocsApp.WriteScript; -begin - FXMLFiles.Text := FCommand; - {$IFDEF Windows} - FXMLFiles.SaveToFile('runme2.bat'); - {$else} - FXMLFiles.SaveToFile('runme2.sh'); - {$endif} -end; - -procedure TBuildDocsApp.ExecuteFPDoc; -var - p: TProcess; -begin - p := TProcess.Create(nil); - try -// writeln('------------ START -------------------'); -// writeln(FCommand); -// writeln('------------ END -------------------'); - p.CommandLine := FCommand; - p.Options := [poWaitOnExit]; - p.Execute; - finally - p.Free; - end; -end; -procedure TBuildDocsApp.DoRun; -var - ErrorMsg: String; -begin - // quick check parameters - ErrorMsg:=CheckOptions('hs','help'); - if ErrorMsg<>'' then begin - ShowException(Exception.Create(ErrorMsg)); - Terminate; - Exit; - end; - - // parse parameters - if HasOption('h','help') then - begin - WriteHelp; - Terminate; - Exit; - end; - - if HasOption('s','script') then - FDivider := {$ifdef unix}' \' + LineEnding {$else} '' {$endif} - else - FDivider := ''; - - BuildCommandLine; - - if HasOption('s','script') then - WriteScript - else - ExecuteFPDoc; - - // 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'); - writeln(''); - writeln(' -h Show this help'); - writeln(' -s Generate a script/batch file to run later. Recommended'); - writeln(' for Linux systems.'); - writeln(''); - writeln('If no command line parameters are specified, it will execute FPDoc.'); - writeln('This option is recommended for Windows systems.'); - writeln(''); -end; - -var - Application: TBuildDocsApp; - -begin - Application:=TBuildDocsApp.Create(nil); - Application.Title:='Build Docs App'; - Application.Run; - Application.Free; -end. - diff --git a/docs/fpGUIHelpIntegration.lpk b/docs/fpGUIHelpIntegration.lpk index 81c16ce8..7c06a92a 100644 --- a/docs/fpGUIHelpIntegration.lpk +++ b/docs/fpGUIHelpIntegration.lpk @@ -24,7 +24,7 @@ "/> <License Value="LGPL "/> - <Version Major="1" Minor="2"/> + <Version Major="1" Minor="3"/> <Files Count="1"> <Item1> <Filename Value="pkghelpfpGUI.pas"/> diff --git a/docs/fpc_lang_ref.ipf b/docs/fpc_lang_ref.ipf index abe951e9..366edb3e 100644 --- a/docs/fpc_lang_ref.ipf +++ b/docs/fpc_lang_ref.ipf @@ -1,3 +1,5 @@ +.* This file is encoded using IBM850 encoding +.* :encoding=IBM850: :userdoc. :title.Free Pascal&colon. Language Reference guide :docprof toc=123456. @@ -9,9 +11,9 @@ .nameit symbol='fpcversion' text='2&per.4' .nameit symbol='date' text='December 2009' .nameit symbol='progref' text='Programmer&apos.s Guide [ http://www.freepascal.org/docs.var ]' -.nameit symbol='ra' text='â–º' -.nameit symbol='la' text='â—„' -.nameit symbol='dar' text='â–¼' +.nameit symbol='ra' text='>' +.nameit symbol='la' text='<' +.nameit symbol='dar' text='v' .nameit symbol='uar' text='^' .nameit symbol='linux' text='Linux' .* ============================================================== @@ -31,10 +33,6 @@ Document version &fpcversion. (r617) Written by :hp1.Michael van Canneyt:ehp1. .br LaTeX to IPF conversion by :hp1.Graeme Geldenhuys:ehp1. -:p. -:p. -:p. -:note.:color fc=red.Please switch DocView to using the UTF-8 text encoding for this document.:color fc=default. .* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .* % About this guide @@ -42,33 +40,33 @@ LaTeX to IPF conversion by :hp1.Graeme Geldenhuys:ehp1. :h2.About this guide :p. This document serves as the reference for the Pascal langauge as implemented -by the &fpc. compiler. It describes all Pascal constructs supported by -&fpc., and lists all supported data types. It does not, however, give a -detailed explanation of the Pascal language: it is not a tutorial. -The aim is to list which Pascal constructs are supported, and to show +by the &fpc. compiler. It describes all Pascal constructs supported by +&fpc., and lists all supported data types. It does not, however, give a +detailed explanation of the Pascal language: it is not a tutorial. +The aim is to list which Pascal constructs are supported, and to show where the &fpc. implementation differs from the &tp. or &delphi. implementations. :p. -The &tp. and &delphi. Pascal compilers introduced various features in the +The &tp. and &delphi. Pascal compilers introduced various features in the Pascal language. The Free Pascal compiler emulates these compilers in the appropriate mode of the compiler: certain features are available only -if the compiler is switched to the appropriate mode. When required for -a certain feature, the use of the :hp1.-M:ehp1. command-line switch or +if the compiler is switched to the appropriate mode. When required for +a certain feature, the use of the :hp1.-M:ehp1. command-line switch or :hp1.{$MODE}:ehp1. directive will be indicated in the text. More information about the various modes can be found in the user's manual and the programmer's manual. :p. Earlier versions of this document also contained the reference documentation -of the :hp1.system:ehp1. unit and :hp1.objpas:ehp1. unit. This has been moved to the +of the :hp1.system:ehp1. unit and :hp1.objpas:ehp1. unit. This has been moved to the RTL reference guide. .* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .* % Notations :h3.Notations :p. -Throughout this document, we will refer to functions, types and variables +Throughout this document, we will refer to functions, types and variables with :font facename=Courier size=16x16.typewriter:font facename='System Proportional'. font. Files are referred to with a sans font: :font facename=Sans size=16x16.filename:font facename='System Proportional'.. @@ -85,35 +83,35 @@ other, then the diagram is ended. :p. Syntactical elements are written like this: :cgraphic. -&ra.&ra.─── syntactical elemements are like this ───────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ syntactical elemements are like this ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. :ecgraphic. :p. Keywords which must be typed exactly as in the diagram: :cgraphic. -&ra.&ra.─── :hp2.keywords are like this:ehp2. ─────────────────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ :hp2.keywords are like this:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. :ecgraphic. :p. When something can be repeated, there is an arrow around it: :cgraphic. -&ra.&ra.─────┬─ this can be repeated ─┬─────────────────────────────────────────────&ra.&la. - ^────────────────────────┘ +&ra.&ra.ÄÄÄÄÄÂÄ this can be repeated ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. When there are different possibilities, they are listed in rows: :cgraphic. -&ra.&ra.─────┬─ First possibility ──┬───────────────────────────────────────────────&ra.&la. - └─ Second possibility ─┘ +&ra.&ra.ÄÄÄÄÄÂÄ First possibility ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ Second possibility ÄÙ :ecgraphic. :p. Note, that one of the possibilities can be empty: :cgraphic. -&ra.&ra.─────┬──────────────────────┬───────────────────────────────────────────────&ra.&la. - ├─ First possibility ─┤ - └─ Second possibility ─┘ +&ra.&ra.ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ First possibility Ä´ + ÀÄ Second possibility ÄÙ :ecgraphic. :p. @@ -126,7 +124,7 @@ combined and nested. .* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :h2.About the Pascal Language :p. -The language Pascal was originally designed by Niklaus Wirth around 1970. It +The language Pascal was originally designed by Niklaus Wirth around 1970. It has evolved significantly since that day, with a lot of contributions by the various compiler constructors (Notably: Borland). The basic elements have been kept throughout the years: @@ -141,13 +139,13 @@ kept throughout the years: :p. The &tp. and &delphi. Pascal compilers introduced various features in -the Pascal language, most notably easier string handling and object +the Pascal language, most notably easier string handling and object orientedness. The &fpc. compiler initially emulated most of &tp. and later on &delphi.. It emulates these compilers in the appropriate mode -of the compiler: certain features are available only if the compiler is +of the compiler: certain features are available only if the compiler is switched to the appropriate mode. When required for a certain feature, the use of the -M command-line switch or {$MODE } directive will be indicated in the -text. More information about the various modes can be found in the User's +text. More information about the various modes can be found in the User's Manual and the Programmer's Manual. @@ -156,13 +154,13 @@ Manual and the Programmer's Manual. .* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :h2.Pascal Tokens :p. -Tokens are the basic lexical building blocks of source code: they +Tokens are the basic lexical building blocks of source code: they are the 'words' of the language: characters are combined into tokens according to the rules of the programming language. There are five classes of tokens: :parml tsize=20 break=none. :pt.:hp2.reserved words:ehp2. -:pd. These are words which have a fixed meaning in the language. They cannot +:pd. These are words which have a fixed meaning in the language. They cannot be changed or redefined. :pt.:hp2.identifiers:ehp2. @@ -178,7 +176,7 @@ so on. :pt.:hp2.constants:ehp2. :pd.Numerical or character constants are used to denote actual values in the -source code, such as 1 (integer constant) or 2.3 (float constant) or +source code, such as 1 (integer constant) or 2.3 (float constant) or 'String constant' (a string: a piece of text). :eparml. @@ -195,18 +193,18 @@ various ways to denote strings&comma. numbers&comma. identifiers etc&per. symbols in a Pascal source file. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Recognised symbols:ehp2. -&ra.&ra.─── letter ──┬─ A..Z ─┬─────────────────────────────────────────────────────&ra.&la. - └─ a..z ─┘ +&ra.&ra.ÄÄÄ letter ÄÄÂÄ A..Z ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ a..z ÄÙ -&ra.&ra.─── digit ─ 0..9 ───────────────────────────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ digit Ä 0..9 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.─── hex digit ──┬─ 0..9 ─┬──────────────────────────────────────────────────&ra.&la. - ├─ A..Z ─┤ - └─ a..z ─┘ -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ hex digit ÄÄÂÄ 0..9 ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ A..Z Ä´ + ÀÄ a..z ÄÙ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -222,11 +220,11 @@ and the following character pairs too: :exmp. :p. -When used in a range specifier, the character pair (. is equivalent to the -left square bracket [. Likewise, the character pair .) is equivalent to the +When used in a range specifier, the character pair (. is equivalent to the +left square bracket [. Likewise, the character pair .) is equivalent to the right square bracket ]. When used for comment delimiters, the character pair (* is equivalent to the left brace { and the character pair *) is equivalent -to the right brace }. These character pairs retain their normal meaning in +to the right brace }. These character pairs retain their normal meaning in string expressions. .* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -235,7 +233,7 @@ string expressions. :p. Comments are pieces of the source code which are completely discarded by the compiler. They exist only for the benefit of the programmer, so he can explain -certain pieces of code. For the compiler, it is as if the comments were not +certain pieces of code. For the compiler, it is as if the comments were not present. :p. @@ -247,7 +245,7 @@ Function Beautiful: Integer; :p. The use of (* and *) as comment delimiters dates from the very first days of -the Pascal language. It has been replaced mostly by the use of { and } as +the Pascal language. It has been replaced mostly by the use of { and } as comment delimiters, as in the following example: :xmp. { My beautiful function returns an interesting result } @@ -313,7 +311,7 @@ The compiler will react with a 'invalid character' error when it encounters such constructs, regardless of the :hp1.-Mturbo:ehp1. switch. :nt. -In :hp1.TP:ehp1. and :hp1.Delphi:ehp1. mode, nested comments are not allowed, +In :hp1.TP:ehp1. and :hp1.Delphi:ehp1. mode, nested comments are not allowed, for maximum compatibility with existing code for those compilers. :ent. @@ -324,12 +322,12 @@ for maximum compatibility with existing code for those compilers. :h3.Reserved words :p. Reserved words are part of the Pascal language, and as such, cannot be -redefined by the programmer. Throughout the syntax diagrams they will be +redefined by the programmer. Throughout the syntax diagrams they will be denoted using a :hp2.bold:ehp2. typeface. Pascal is not case sensitive so the compiler will accept any combination of upper or lower case letters for reserved words. :p. -We make a distinction between &tp. and &delphi. reserved words. In +We make a distinction between &tp. and &delphi. reserved words. In :hp2.TP:ehp2. mode, only the &tp. reserved words are recognised, but the &delphi. ones can be redefined. By default, &fpc. recognises the &delphi. reserved words. @@ -357,7 +355,7 @@ end not shl :h4.&fpc. reserved words :p. -On top of the &tp. reserved words, &fpc. also considers the +On top of the &tp. reserved words, &fpc. also considers the following as reserved words: .* * * * :xmp. @@ -411,7 +409,7 @@ that these types can be redefined in other units. The programmer is however :p. Identifiers denote programmer defined names for specific constants, types, variables, procedures and functions, units, and programs. All programmer -defined names in the source code – excluding reserved words – are designated +defined names in the source code - excluding reserved words - are designated as identifiers. :p. @@ -421,14 +419,14 @@ character, or an underscore (_). The following diagram gives the basic syntax for identifiers. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Identifiers:ehp2. -&ra.&ra.─── identifier ──┬─ letter ─┬─┬──────────────┬──────────────────────────────&ra.&la. - └─── _ ────┘ ^─┬─ letter ─┬─┘ - ├─ digit ──┤ - └─── _ ────┘ -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ identifier ÄÄÂÄ letter ÄÂÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÄÄ _ ÄÄÄÄÙ ^ÄÂÄ letter ÄÂÄÙ + ÃÄ digit ÄÄ´ + ÀÄÄÄ _ ÄÄÄÄÙ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -477,15 +475,15 @@ Most identifiers (constants, variables, functions or methods, properties) can have a hint directive appended to their definition: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Hint directives:ehp2. -&ra.&ra.─── hint directive ──┬─────────────────┬────────────────────────────────────&ra.&la. - ├── Deprecated ───┤ - ├─ Experimental ──┤ - ├─── Platform ────┤ - └─ Unimplemented ─┘ -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ hint directive ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄÄ Deprecated ÄÄÄ´ + ÃÄ Experimental ÄÄ´ + ÃÄÄÄ Platform ÄÄÄÄ´ + ÀÄ Unimplemented ÄÙ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -567,7 +565,7 @@ Note that case is insignificant when using hexadecimal constants. :li. As of version 1.0.7, Octal format (base 8) is also supported. To specify a constant in octal format, prepend it with a ampersand (&.). -For instance 15 is specified in octal notation as &.17. +For instance 15 is specified in octal notation as &.17. :li. Binary notation (base 2). A binary number can be specified by preceding it with a percent sign (%). Thus, 255 can be @@ -578,46 +576,46 @@ specified in binary notation as %11111111. The following diagrams show the syntax for numbers. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Numbers:ehp2. -&ra.&ra.─── hex digit sequence ──┬── hex digit ──┬──────────────────────────────────&ra.&la. - &uar.───────────────┘ +&ra.&ra.ÄÄÄ hex digit sequence ÄÄÂÄÄ hex digit ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + &uar.ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── octal digit sequence ──┬── octal digit ──┬──────────────────────────────&ra.&la. - &uar.─────────────────┘ +&ra.&ra.ÄÄÄ octal digit sequence ÄÄÂÄÄ octal digit ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + &uar.ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── binary digit sequence ──┬┬─ 1 ─┬┬───────────────────────────────────────&ra.&la. - │└─ 0 ─┘│ - &uar.───────┘ +&ra.&ra.ÄÄÄ binary digit sequence ÄÄÂÂÄ 1 ÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ³ÀÄ 0 ÄÙ³ + &uar.ÄÄÄÄÄÄÄÙ -&ra.&ra.─── digit sequence ──┬── digit ──┬──────────────────────────────────────────&ra.&la. - ^───────────┘ +&ra.&ra.ÄÄÄ digit sequence ÄÄÂÄÄ digit ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── unsigned integer ──┬────── digit sequence ───────┬──────────────────────&ra.&la. - ├─ $ ─ hex digit sequence ────┤ - ├─ & ─ octal digit sequence ──┤ - └─ % ─ binary digit sequence ─┘ +&ra.&ra.ÄÄÄ unsigned integer ÄÄÂÄÄÄÄÄÄ digit sequence ÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ $ Ä hex digit sequence ÄÄÄÄ´ + ÃÄ & Ä octal digit sequence ÄÄ´ + ÀÄ % Ä binary digit sequence ÄÙ -&ra.&ra.─── hex digit sequence ──┬── hex digit ──┬──────────────────────────────────&ra.&la. - ^───────────────┘ +&ra.&ra.ÄÄÄ hex digit sequence ÄÄÂÄÄ hex digit ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── sign ──┬── + ──┬────────────────────────────────────────────────────────&ra.&la. - └── - ──┘ +&ra.&ra.ÄÄÄ sign ÄÄÂÄÄ + ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÄ - ÄÄÙ -&ra.&ra.─── unsigned real ─ digit sequence ─┬────────────────────┬┬──────────────┬──&ra.&la. - â”” . ─ digit sequence ┘└ scale factor ┘ +&ra.&ra.ÄÄÄ unsigned real Ä digit sequence ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄ&ra.&la. + À . Ä digit sequence ÙÀ scale factor Ù -&ra.&ra.─── scale factor ─┬─ E ─┬┬──────┬─ digit sequence ──────────────────────────&ra.&la. - └─ e ─┘└ sign ┘ +&ra.&ra.ÄÄÄ scale factor ÄÂÄ E ÄÂÂÄÄÄÄÄÄÂÄ digit sequence ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ e ÄÙÀ sign Ù -&ra.&ra.─── unsigned number ──┬─── unsigned real ──┬────────────────────────────────&ra.&la. - └─ unsigned integer ─┘ +&ra.&ra.ÄÄÄ unsigned number ÄÄÂÄÄÄ unsigned real ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ unsigned integer ÄÙ -&ra.&ra.─── signed number ──┬────────┬─ unsigned number ────────────────────────────&ra.&la. - └─ sign ─┘ +&ra.&ra.ÄÄÄ signed number ÄÄÂÄÄÄÄÄÄÄÄÂÄ unsigned number ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ sign ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :nt. @@ -630,18 +628,18 @@ Octal and Binary notation are not supported in TP or Delphi compatibility mode. .* % Labels :h3.Labels :p. -A label is a name for a location in the source code to which can be +A label is a name for a location in the source code to which can be jumped to from another location with a :hp2.goto:ehp2. statement. A Label is a standard identifier with the exception that it can start with a digit. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Label:ehp2. -&ra.&ra.─── label ──┬─ digit sequence ─┬────────────────────────────────────────────&ra.&la. - └── identifier ────┘ +&ra.&ra.ÄÄÄ label ÄÄÂÄ digit sequence ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÄ identifier ÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :nt. @@ -657,42 +655,42 @@ the goto statement. :h3.Character strings :p. A character string (or string for short) is a sequence of zero or more -characters (byte sized), enclosed in single quotes, and on a single -line of the program source code: no literal carriage return or linefeed +characters (byte sized), enclosed in single quotes, and on a single +line of the program source code: no literal carriage return or linefeed characters can appear in the string. :p. A character set with nothing between the quotes ('') is an empty string. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Character strings:ehp2. -&ra.&ra.─── character string ──┬┬─ quoted string ──┬┬───────────────────────────────&ra.&la. - │└─ control string ─┘│ - ^────────────────────┘ +&ra.&ra.ÄÄÄ character string ÄÄÂÂÄ quoted string ÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ³ÀÄ control string ÄÙ³ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── quoted string ─ ' ──┬─ string character ─┬─ ' ──────────────────────────&ra.&la. - ^────────────────────┘ +&ra.&ra.ÄÄÄ quoted string Ä ' ÄÄÂÄ string character ÄÂÄ ' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── string character ──┬─ Any character except ' or CR ─┬───────────────────&ra.&la. - └────────────── " ───────────────┘ +&ra.&ra.ÄÄÄ string character ÄÄÂÄ Any character except ' or CR ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ " ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── control string ──┬─ # ─ unsigned integer ─┬─────────────────────────────&ra.&la. - ^────────────────────────┘ +&ra.&ra.ÄÄÄ control string ÄÄÂÄ # Ä unsigned integer ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. The string consists of standard, 8-bit ASCII characters or Unicode (normally UTF-8 encoded) characters. The :hp1.control string:ehp1. can be used to specify characters which cannot be typed on a keyboard, such as :hp1.#27:ehp1. for -the escape character. +the escape character. :p. -The single quote character can be embedded in the string by typing it twice. -The C construct of escaping characters in the string (using a backslash) +The single quote character can be embedded in the string by typing it twice. +The C construct of escaping characters in the string (using a backslash) is not supported in Pascal. :p. @@ -732,8 +730,8 @@ on unices (including Mac OS X), and as :exmp. on a classic Mac-like operating system. - -It is possible to use other character sets in strings: in that case the + +It is possible to use other character sets in strings: in that case the codepage of the source file must be specified with the :hp1.{$CODEPAGE XXX}:ehp1. directive or with the :hp2.-Fc:ehp2. command line option for the compiler. In that case the characters in a string will be interpreted as characters from the @@ -759,20 +757,20 @@ Just as in &tp., &fpc. supports both ordinary and typed constants. .* % Ordinary constants :h3 name=constants_ordinary.Ordinary constants :p. -Ordinary constants declarations are constructed using an identifier name -followed by an "=" token, and followed by an optional expression consisting -of legal combinations of numbers, characters, boolean values or enumerated -values as appropriate. The following syntax diagram shows how to construct +Ordinary constants declarations are constructed using an identifier name +followed by an "=" token, and followed by an optional expression consisting +of legal combinations of numbers, characters, boolean values or enumerated +values as appropriate. The following syntax diagram shows how to construct a legal declaration of an ordinary constant. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Constant declaration:ehp2. -&ra.&ra.─── constant declaration ─┬─ identifier ─ = ─ expression ─ hint directives ─ ; ─┬───&ra.&la. - ^─────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ constant declaration ÄÂÄ identifier Ä = Ä expression Ä hint directives Ä ; ÄÂÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -783,7 +781,7 @@ declaration. :p. Operators such as +, -, *, /, not, and, or, div, mod, ord, chr, -sizeof, pi, int, trunc, round, frac, odd can be used, however. +sizeof, pi, int, trunc, round, frac, odd can be used, however. For more information on expressions, see the section :link reftype=hd refid=expressions.Expressions:elink.&per. @@ -812,7 +810,7 @@ in a compiler error: :p. For string constants, the type of the string is dependent on some compiler -switches. If a specific type is desired, a typed constant should be used, +switches. If a specific type is desired, a typed constant should be used, as explained in the following section. :p. @@ -830,37 +828,37 @@ for constants of complex structures (defined later in the manual). Their definition is quite simple. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Constant declaration:ehp2. typed -&ra.&ra.─── constant ───┬─ identifier ─ : ─ type ─ = ─ type constant ─ hint directives ─ ; ─┬───&ra.&la. - declaration ^───────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ constant ÄÄÄÂÄ identifier Ä : Ä type Ä = Ä type constant Ä hint directives Ä ; ÄÂÄÄÄ&ra.&la. + declaration ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── typed constant ──┬────── constant ───────┬──────────────────────────────&ra.&la. - ├─ address constant ─┤ - ├─ array constant ─┤ - ├─ record constant ─┤ - └─ procedural constant ─┘ +&ra.&ra.ÄÄÄ typed constant ÄÄÂÄÄÄÄÄÄ constant ÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ address constant Ä´ + ÃÄ array constant Ä´ + ÃÄ record constant Ä´ + ÀÄ procedural constant ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. -Contrary to ordinary constants, a value can be assigned to them at -run-time. This is an old concept from &tp., which has been -replaced with support for initialized variables: For a detailed +Contrary to ordinary constants, a value can be assigned to them at +run-time. This is an old concept from &tp., which has been +replaced with support for initialized variables: For a detailed description, see :link reftype=hd refid='variables_initializedvars'.Initialized variables:elink.. -Support for assigning values to typed constants is controlled by the -:hp2.{$J}:ehp2. directive: it can be switched off, but is on by default +Support for assigning values to typed constants is controlled by the +:hp2.{$J}:ehp2. directive: it can be switched off, but is on by default (for &tp. compatibility). Initialized variables are always allowed. :nt. It should be stressed that typed constants are automatically initialized at program start. -This is also true for :hp1.local:ehp1. typed constants and initialized variables. -Local typed constants are also initialized at program start. If their value was -changed during previous invocations of the function, they will retain their +This is also true for :hp1.local:ehp1. typed constants and initialized variables. +Local typed constants are also initialized at program start. If their value was +changed during previous invocations of the function, they will retain their changed value, i.e. they are not initialized each time the function is invoked. :ent. @@ -870,8 +868,8 @@ changed value, i.e. they are not initialized each time the function is invoked. :p. A special kind of constant declaration block is the :hp1.resourcestring:ehp1. block. Resourcestring declarations are much like constant string -declarations: resource strings act as constant strings, but they -can be localized by means of a set of special routines in the +declarations: resource strings act as constant strings, but they +can be localized by means of a set of special routines in the :hp1.objpas:ehp1. unit. A resource string declaration block is only allowed in the :hp1.Delphi:ehp1. or :hp1.ObjFPC:ehp1. modes. @@ -890,13 +888,13 @@ at runtime with some special mechanisms in the :hp1.objpas:ehp1. unit. :p. Semantically, the strings act like ordinary constants; It is not allowed -to assign values to them (except through the special mechanisms in the -objpas unit). However, they can be used in assignments or expressions as -ordinary string constants. The main use of the resourcestring section is +to assign values to them (except through the special mechanisms in the +objpas unit). However, they can be used in assignments or expressions as +ordinary string constants. The main use of the resourcestring section is to provide an easy means of internationalization. :p. -More on the subject of resourcestrings can be found in the +More on the subject of resourcestrings can be found in the :link reftype=hd database='prog.inf' refid=0.&progref.:elink., and in the :hp1.objpas:ehp1. unit reference. @@ -914,7 +912,7 @@ resourcestring If the localization routines translate :hp1.Part1:ehp1. and :hp1.Part2:ehp1., the :hp1.Sentence:ehp1. constant will not be translated automatically: it has a separate entry in the resource string tables, and must therefor be -translated separately. The above construct simply says that the +translated separately. The above construct simply says that the initial value of :hp1.Sentence:ehp1. equals :hp1.Part1+' '+Part2:ehp1.. :ent. @@ -938,7 +936,7 @@ end. :exmp. :p. -This will print 'Yes.' or 'No.' depending on the value of B, even if the +This will print 'Yes.' or 'No.' depending on the value of B, even if the constants Yes and No have been localized by some localization mechanism. :ent. @@ -953,31 +951,31 @@ that can be used to denote this custom type when declaring variables further in the source code. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Type declaration:ehp2. -&ra.&ra.─── type declaration ─── identifier ─ = ─ type ─ ; ─────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ type declaration ÄÄÄ identifier Ä = Ä type Ä ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. There are 7 major type classes: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Types:ehp2. -&ra.&ra.─── type ──┬─── simple type ────┬──────────────────────────────────────────&ra.&la. - ├─ string type ─┤ - ├─ structured type ─┤ - ├─ pointer type ─┤ - ├─ procedural type ─┤ - ├─ generic type ─┤ - ├─ specialized type ─┤ - └─ type identifier ─┘ +&ra.&ra.ÄÄÄ type ÄÄÂÄÄÄ simple type ÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ string type Ä´ + ÃÄ structured type Ä´ + ÃÄ pointer type Ä´ + ÃÄ procedural type Ä´ + ÃÄ generic type Ä´ + ÃÄ specialized type Ä´ + ÀÄ type identifier ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -985,7 +983,7 @@ The last case, :hp1.type identifier:ehp1., is just a means to give another name to a type. This presents a way to make types platform independent, by only using these types, and then defining these types for each platform individually. Any programmer who then uses these custom types doesn't have to worry -about the underlying type size: it is opaque to him. It also allows to use shortcut names +about the underlying type size: it is opaque to him. It also allows to use shortcut names for fully qualified type names. e.g. define :hp1.system.longint:ehp1. as :hp1.Olongint:ehp1. and then redefine :hp1.longint:ehp1.. @@ -997,23 +995,23 @@ The base or simple types of &fpc. are the &delphi. types. We will discuss each type separately. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Simple types:ehp2. -&ra.&ra.─── simple type ──┬─ ordinal type ─┬───────────────────────────────────────&ra.&la. - └─ real type ─┘ +&ra.&ra.ÄÄÄ simple type ÄÄÂÄ ordinal type ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ real type ÄÙ -&ra.&ra.─── real type ─── real type identifier ─────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ real type ÄÄÄ real type identifier ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. .* ................................................................... :h4.Ordinal types :p. -With the exception of :hp1.int64:ehp1., :hp1.qword:ehp1. and Real types, -all base types are ordinal types. Ordinal types have the following +With the exception of :hp1.int64:ehp1., :hp1.qword:ehp1. and Real types, +all base types are ordinal types. Ordinal types have the following characteristics: :ol. :li. Ordinal types are countable and ordered, i.e. it is, in principle, @@ -1036,7 +1034,7 @@ A list of pre-defined integer types are presented below. :lm margin=10. :cgraphic. :hp2.Name:ehp2. -──────────── +ÄÄÄÄÄÄÄÄÄÄÄÄ Integer Shortint SmallInt @@ -1052,7 +1050,7 @@ A list of pre-defined integer types are presented below. WordBool LongBool Char -──────────── +ÄÄÄÄÄÄÄÄÄÄÄÄ :ecgraphic. :lm margin=1. @@ -1064,7 +1062,7 @@ some Pascal constructs will not work with these two integer types. :cgraphic. :hp2.Type Range Size in bytes:ehp2. -──────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Byte 0 .. 255 1 Shortint -128 .. 127 1 Smallint -32768 .. 32767 2 @@ -1075,18 +1073,18 @@ some Pascal constructs will not work with these two integer types. Longword 0 .. 4294967295 4 Int64 -9223372036854775808 .. 9223372036854775807 8 QWord 0 .. 18446744073709551615 8 -──────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :ecgraphic. :p. The :hp1.integer:ehp1. type maps to the smallint type in the default &fpc. mode. It maps to either a longint in either Delphi or ObjFPC -mode. The :hp1.cardinal:ehp1. type is currently always mapped to the +mode. The :hp1.cardinal:ehp1. type is currently always mapped to the longword type. :nt. -All decimal constants which do no fit within the -2147483648..2147483647 range -are silently and automatically parsed as 64-bit integer constants as of version +All decimal constants which do no fit within the -2147483648..2147483647 range +are silently and automatically parsed as 64-bit integer constants as of version 1.9.0. Earlier versions would convert it to a real-typed constant. :ent. @@ -1103,18 +1101,18 @@ to a boolean value, can also be assigned to a boolean type. :cgraphic. :hp2.Name Size Ord(True):ehp2. -───────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Boolean 1 1 ByteBool 1 Any nonzero value WordBool 2 Any nonzero value LongBool 4 Any nonzero value -───────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :ecgraphic. :p. &fpc. also supports the :hp1.ByteBool:ehp1., :hp1.WordBool:ehp1. and :hp1.LongBool:ehp1. types. These are of type :hp1.Byte:ehp1., :hp1.Word:ehp1. or :hp1.Longint:ehp1., but are -assignment compatible with a :hp1.Boolean:ehp1.: the value :hp1.False:ehp1. is +assignment compatible with a :hp1.Boolean:ehp1.: the value :hp1.False:ehp1. is equivalent to 0 (zero) and any nonzero value is considered :hp1.True:ehp1. when converting to a boolean value. A boolean value of :hp1.True:ehp1. is converted to -1 in case it is assigned to a variable of type :hp1.LongBool:ehp1.. @@ -1138,7 +1136,7 @@ way that when the result is known, the rest of the expression will no longer be evaluated: this is called short-cut boolean evaluation. :p. -In the following example, the function :hp1.Func:ehp1. will never be called, +In the following example, the function :hp1.Func:ehp1. will never be called, which may have strange side-effects. :xmp. @@ -1163,20 +1161,20 @@ enumeration type, where a value is assigned to a particular element of the enumeration list. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Enumeration types:ehp2. -&ra.&ra.─── enumerated type ─ ( ─┬┬── identifier list ───┬┬─ ) ─────────────────────&ra.&la. - │└─ assigned enum list ─┘│ - ^────────── , ───────────┘ +&ra.&ra.ÄÄÄ enumerated type Ä ( ÄÂÂÄÄ identifier list ÄÄÄÂÂÄ ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ³ÀÄ assigned enum list ÄÙ³ + ^ÄÄÄÄÄÄÄÄÄÄ , ÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── identifier list ──┬─ identifier ─┬──────────────────────────────────────&ra.&la. - ^────── , ─────┘ +&ra.&ra.ÄÄÄ identifier list ÄÄÂÄ identifier ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄ , ÄÄÄÄÄÙ -&ra.&ra.─── assigned enum list ──┬─ identifier ─ := ─ expression ─┬─────────────────&ra.&la. - ^─────────────── , ──────────────┘ +&ra.&ra.ÄÄÄ assigned enum list ÄÄÂÄ identifier Ä := Ä expression ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ , ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -1226,8 +1224,8 @@ this kind of enumeration types. Trying to do this anyhow will result in a compiler error. :li. Enumeration types are stored using a default, independent of the actual number of values: the compiler does not try to optimize for space. -This behaviour can be changed with the :hp2.{$PACKENUM n}:ehp2. compiler -directive, which tells the compiler the minimal number of bytes to be +This behaviour can be changed with the :hp2.{$PACKENUM n}:ehp2. compiler +directive, which tells the compiler the minimal number of bytes to be used for enumeration types. For instance: :xmp. @@ -1256,12 +1254,12 @@ A subrange type is a range of values from an ordinal type (the host type). To de one must specify its limiting values: the highest and lowest value of the type. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Subrange types:ehp2. -&ra.&ra.─── subrange type ─ constant ─ .. ─ constant ───────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ subrange type Ä constant Ä .. Ä constant ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -1300,7 +1298,7 @@ platform, refer to the &progref.. :cgraphic. :hp2.Type Range Significant digits Size in bytes:ehp2. -────────────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Real platform dependent ??? 4 or 8 Single 1.5E-45 .. 3.4E38 7-8 4 Double 5.0E-324 .. 1.7E308 15-16 8 @@ -1308,7 +1306,7 @@ platform, refer to the &progref.. Comp -2E64+1 .. 2E63-1 19-20 8 Currency -922337203685477.5808 .. 19-20 8 922337203685477.5807 -────────────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :ecgraphic. :p. @@ -1346,7 +1344,7 @@ quotes, as follows: 'a' or 'A' are both character constants. :p. A character can also be specified by its character -value (commonly an ASCII code), by preceding the ordinal value with the +value (commonly an ASCII code), by preceding the ordinal value with the number symbol (#). For example specifying :hp1.#65:ehp1. would be the same as :hp1.'A':ehp1. :p. @@ -1370,22 +1368,22 @@ It also supports AnsiStrings (with unlimited length) as in Delphi. To declare a variable as a string, use the following type specification: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.String Type:ehp2. -&ra.&ra.─── string type ─ :hp2.string:ehp2. ──┬──────────────────────────────┬─────────────────&ra.&la. - └─ [ ── unsigned integer ── ] ─┘ +&ra.&ra.ÄÄÄ string type Ä :hp2.string:ehp2. ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ [ ÄÄ unsigned integer ÄÄ ] ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. -If there is a size specifier, then its maximum value - indicating the maximum +If there is a size specifier, then its maximum value - indicating the maximum size of the string - is 255. :p. -The meaning of a string declaration statement without size indicator is +The meaning of a string declaration statement without size indicator is interpreted differently depending on the :hp2.{$H}:ehp2. switch. If no size -indication is present, the above declaration can declare an AnsiString or +indication is present, the above declaration can declare an AnsiString or a short string. :p. Whatever the actual type, AnsiStrings and short strings can be used @@ -1439,8 +1437,8 @@ Error: string length must be a value from 1 to 255 :p. For short strings, the length is stored in the character at index 0. Old -&tp. code relies on this, and it is implemented similarly in &fpc.. -Despite this, to write portable code, it is best to set the length of a +&tp. code relies on this, and it is implemented similarly in &fpc.. +Despite this, to write portable code, it is best to set the length of a shortstring with the :hp1.SetLength():ehp1. call, and to retrieve it with the :hp1.Length():ehp1. call. These functions will always work, whatever the internal representation of the short strings or other strings in use: @@ -1452,16 +1450,16 @@ this allows easy switching between the various string types. :h4 name=character_types_ansistrings.AnsiStrings :p. AnsiStrings are strings that have no length limit. They are reference -counted and are guaranteed to be null terminated. Internally, an ansistring is treated as +counted and are guaranteed to be null terminated. Internally, an ansistring is treated as a pointer: the actual content of the string is stored on the heap, as much -memory as needed to store the string content is allocated. +memory as needed to store the string content is allocated. -This is all handled transparantly, i.e. they can be manipulated as a normal -short string. Ansistrings can be defined using the predefined :hp2.AnsiString:ehp2. -type. +This is all handled transparantly, i.e. they can be manipulated as a normal +short string. Ansistrings can be defined using the predefined :hp2.AnsiString:ehp2. +type. :nt. -The null-termination does not mean that null characters (char(0) or #0) +The null-termination does not mean that null characters (char(0) or #0) cannot be used: the null-termination is not used internally, but is there for convenience when dealing with external routines that expect a null-terminated string (as most C routines do). @@ -1469,19 +1467,19 @@ null-terminated string (as most C routines do). :p. If the {$H} switch is on, then a string definition using the -regular :hp1.String:ehp1. keyword and that doesn't contain a length specifier, +regular :hp1.String:ehp1. keyword and that doesn't contain a length specifier, will be regarded as an ansistring as well. If a length specifier is present, a short string will be used, regardless of the {$H} setting. :p. If the string is empty (''), then the internal pointer representation -of the string pointer is :hp1.Nil:ehp1.. If the string is not empty, then the +of the string pointer is :hp1.Nil:ehp1.. If the string is not empty, then the pointer points to a structure in heap memory. :p. The internal representation as a pointer, and the automatic null-termination -make it possible to typecast an ansistring to a pchar. If the string is empty -(so the pointer is Nil) then the compiler makes sure that the typecasted +make it possible to typecast an ansistring to a pchar. If the string is empty +(so the pointer is Nil) then the compiler makes sure that the typecasted pchar will point to a null byte. :p. @@ -1493,13 +1491,13 @@ string. A statement :exmp. :p. -results in the reference count of :hp1.S2:ehp1. being decreased with 1, +results in the reference count of :hp1.S2:ehp1. being decreased with 1, the reference count of :hp1.S1:ehp1. is increased by 1, and finally :hp1.S1:ehp1. (as a pointer) is copied to :hp1.S2:ehp1.. This is a significant speed-up in the code. :p. -If the reference count of a string reaches zero, then the memory occupied +If the reference count of a string reaches zero, then the memory occupied by the string is deallocated automatically, and the pointer is set to :hp1.Nil:ehp1., so no memory leaks arise. @@ -1507,7 +1505,7 @@ by the string is deallocated automatically, and the pointer is set to When an ansistring is declared, the &fpc. compiler initially allocates just memory for a pointer, not more. This pointer is guaranteed to be :hp1.Nil:ehp1., meaning that the string is initially empty. This is -true for local and global ansistrings or ansistrings that are part of a +true for local and global ansistrings or ansistrings that are part of a structure (arrays, records or objects). :p. @@ -1519,16 +1517,16 @@ var :exmp. :p. -will copy the value :hp1.Nil:ehp1. 100,000 times into :hp1.A:ehp1.. -When :hp1.A:ehp1. goes out of scope, then the reference +will copy the value :hp1.Nil:ehp1. 100,000 times into :hp1.A:ehp1.. +When :hp1.A:ehp1. goes out of scope, then the reference count of the 100,000 strings will be decreased by 1 for each -of these strings. All this happens invisible to the programmer, +of these strings. All this happens invisible to the programmer, but when considering performance issues, this is important. :p. -Memory for the string content will be allocated only when the string is -assigned a value. If the string goes out of scope, then its reference -count is automatically decreased by 1. If the reference count reaches +Memory for the string content will be allocated only when the string is +assigned a value. If the string goes out of scope, then its reference +count is automatically decreased by 1. If the reference count reaches zero, the memory reserved for the string is released. :p. @@ -1557,7 +1555,7 @@ and passing it to a C routine that modifies the string. :p. The :hp1.Length():ehp1. function must be used to get the length of an -ansistring: the length is not stored at character 0 of the ansistring. +ansistring: the length is not stored at character 0 of the ansistring. The construct :xmp. @@ -1618,7 +1616,7 @@ It is therefore :hp2.not:ehp2. advisable to typecast one of the following: :ol. :li. Expressions. :li. Strings that have a reference count larger than 1. -In this case you should call :hp1.UniqueString():ehp1. to ensure the +In this case you should call :hp1.UniqueString():ehp1. to ensure the string has a reference count 1. :eol. @@ -1627,18 +1625,18 @@ string has a reference count 1. .* ................................................................... :h4 name=character_types_widestrings.WideStrings :p. -WideStrings (used to represent Unicode character strings) are implemented in much -the same way as AnsiStrings: reference counted, null-terminated arrays, only they +WideStrings (used to represent Unicode character strings) are implemented in much +the same way as AnsiStrings: reference counted, null-terminated arrays, only they are implemented as arrays of :hp1.WideChars:ehp1. instead of regular :hp1.Chars:ehp1.. A :hp1.WideChar:ehp1. is a two-byte character (an element of a DBCS: Double Byte -Character Set). Mostly the same rules apply for WideStrings as for +Character Set). Mostly the same rules apply for WideStrings as for AnsiStrings. The compiler transparently converts WideStrings to AnsiStrings and vice versa. :p. Similarly to the typecast of an Ansistring to a PChar null-terminated array of characters, a WideString can be converted to a PWideChar -null-terminated array of characters. +null-terminated array of characters. Note that the :hp1.PWideChar:ehp1. array is terminated by 2 null bytes instead of 1, so a typecast to a PChar is not automatic. @@ -1750,20 +1748,20 @@ the unit :hp2.strings:ehp2. must be used. :p. However, it is possible to do some pointer arithmetic. The -operators + and - can be used to do operations +operators + and - can be used to do operations on :hp1.PChar:ehp1. pointers. In the table below, :hp1.P:ehp1. and :hp1.Q:ehp1. are of type :hp1.PChar:ehp1., and :hp1.I:ehp1. is of type :hp1.Longint:ehp1.. :cgraphic. :hp2.Operation Result:ehp2. -──────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ P + I Adds I to the address pointed to by P. I + P Adds I to the address pointed to by P. P - I Substracts I from the address pointed to by P. P - Q Returns, as an integer, the distance between 2 addresses (or the number of characters between P and Q) -──────────────────────────────────────────────────────────────────── +ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :ecgraphic. @@ -1775,25 +1773,25 @@ A structured type is a type that can hold multiple values in one variable. Stuctured types can be nested to unlimited levels. :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Structured Types:ehp2. -&ra.&ra.─── structured type ──┬──── array type ────┬───────────────────────────&ra.&la. - ├──── record type ────┤ - ├──── object type ────┤ - ├──── class type ────┤ - ├─ class reference type ─┤ - ├──── interface type ────┤ - ├──── set type ────┤ - └───── file type ──────┘ +&ra.&ra.ÄÄÄ structured type ÄÄÂÄÄÄÄ array type ÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄÄÄÄ record type ÄÄÄÄ´ + ÃÄÄÄÄ object type ÄÄÄÄ´ + ÃÄÄÄÄ class type ÄÄÄÄ´ + ÃÄ class reference type Ä´ + ÃÄÄÄÄ interface type ÄÄÄÄ´ + ÃÄÄÄÄ set type ÄÄÄÄ´ + ÀÄÄÄÄÄ file type ÄÄÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. Unlike Delphi, &fpc. does not support the keyword :hp1.packed:ehp1. for all -structured types. In the following sections each of the possible -structured types is discussed. It will be mentioned when a type supports +structured types. In the following sections each of the possible +structured types is discussed. It will be mentioned when a type supports the :hp1.packed:ehp1. keyword. @@ -1860,15 +1858,15 @@ There are some more restrictions to elements of bitpacked structures: :li. The address cannot be retrieved, unless the bit size is a multiple of 8 and the element happens to be stored on a byte boundary. :li. An element of a bitpacked structure cannot be used as a var parameter, -unless the bit size is a multiple of 8 and the element happens to be stored +unless the bit size is a multiple of 8 and the element happens to be stored on a byte boundary. :eul. :p. -To determine the size of an element in a bitpacked structure, there is the -:hp1.BitSizeOf():ehp1. function. It returns the size - in bits - of the element. -For other types or elements of structures which are not bitpacked, this will -simply return the size in bytes multiplied by 8, i.e., the return value is +To determine the size of an element in a bitpacked structure, there is the +:hp1.BitSizeOf():ehp1. function. It returns the size - in bits - of the element. +For other types or elements of structures which are not bitpacked, this will +simply return the size in bytes multiplied by 8, i.e., the return value is then the same as :hp1.8*SizeOf:ehp1.. :p. @@ -1880,25 +1878,25 @@ The size of bitpacked records and arrays is limited: :eul. :p. -The reason is that the offset of an element must be calculated with +The reason is that the offset of an element must be calculated with the maximum integer size of the system. .* ................................................................... :h4 name=structured_types_arrays.Arrays :p. -&fpc. supports arrays as in &tp.. Multi-dimensional arrays and (bit)packed +&fpc. supports arrays as in &tp.. Multi-dimensional arrays and (bit)packed arrays are also supported, as well as the dynamic arrays of &delphi.: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Array types:ehp2. -&ra.&ra.── array type ─┬───────────────┬─ :hp2.array:ehp2. ─┬────────────────────────────┬─ :hp2.of:ehp2. ─ type ──&ra.&la. - ├─ :hp2.packed:ehp2. ─┤ └─ :hp2.[:ehp2. ─┬─ ordinal type ─┬─ :hp2.]:ehp2. ─┘ - └─ :hp2.bitpacked:ehp2. ─┘ ^────── , ───────┘ +&ra.&ra.ÄÄ array type ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.array:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.of:ehp2. Ä type ÄÄ&ra.&la. + ÃÄ :hp2.packed:ehp2. Ä´ ÀÄ :hp2.[:ehp2. ÄÂÄ ordinal type ÄÂÄ :hp2.]:ehp2. ÄÙ + ÀÄ :hp2.bitpacked:ehp2. ÄÙ ^ÄÄÄÄÄÄ , ÄÄÄÄÄÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. @@ -1951,32 +1949,32 @@ program testarray1; type TA = Array[0..9, 0..9] of Integer; - -var + +var A, B: TA; I, J: Integer; begin for I := 0 to 9 do - for J := 0 to 9 do + for J := 0 to 9 do A[I,J] := I * J; for I := 0 to 9 do begin - for J := 0 to 9 do + for J := 0 to 9 do Write(A[I, J]:2, ' '); writeln; end; B := A; writeln; for I := 0 to 9 do - for J := 0 to 9 do + for J := 0 to 9 do A[9-I, 9-J] := I * J; for I := 0 to 9 do begin - for J := 0 to 9 do + for J := 0 to 9 do write(B[I, J]:2, ' '); writeln; end; -end. +end. :exmp. :p. @@ -1997,12 +1995,12 @@ Type :p. When declaring a variable of a dynamic array type, the initial length of the array is zero. The actual length of the array must be set with the standard -:hp1.SetLength():ehp1. function, which will allocate the necessary memory to contain +:hp1.SetLength():ehp1. function, which will allocate the necessary memory to contain the array elements on the heap. The following example will set the length to 1000: :xmp. -var +var A: TByteArray; begin SetLength(A, 1000); @@ -2013,26 +2011,26 @@ After a call to :hp1.SetLength():ehp1., valid array indexes are 0 to 999: the ar index is always zero-based. :p. -Note that the length of the array is set in elements, not in bytes of -allocated memory (although these may be the same). The amount of -memory allocated is the size of the array multiplied by the size of +Note that the length of the array is set in elements, not in bytes of +allocated memory (although these may be the same). The amount of +memory allocated is the size of the array multiplied by the size of 1 element in the array. The memory will be disposed of at the exit of the -current procedure or function. +current procedure or function. :p. -It is also possible to resize the array: in that case, as much of the +It is also possible to resize the array: in that case, as much of the elements in the array as will fit in the new size, will be kept. The array can be resized to zero, which effectively resets the variable. :p. -At all times, trying to access an element of the array with an index -that is not in the current length of the array will generate a run-time +At all times, trying to access an element of the array with an index +that is not in the current length of the array will generate a run-time error. :p. -Dynamic arrays are reference counted: assignment of one dynamic array-type -variable to another will let both variables point to the same array. -Contrary to ansistrings, an assignment to an element of one array will +Dynamic arrays are reference counted: assignment of one dynamic array-type +variable to another will let both variables point to the same array. +Contrary to ansistrings, an assignment to an element of one array will be reflected in the other: there is no copy-on-write. Consider the following example: @@ -2057,33 +2055,33 @@ program testarray1; type TA = array of array of Integer; - -var + +var A, B: TA; I, J: Integer; begin Setlength(A, 10, 10); for I := 0 to 9 do - for J := 0 to 9 do + for J := 0 to 9 do A[I, J] := I * J; for I:=0 to 9 do begin - for J := 0 to 9 do + for J := 0 to 9 do Write(A[I, J]:2, ' '); writeln; end; B := A; writeln; for I := 0 to 9 do - for J := 0 to 9 do + for J := 0 to 9 do A[9-I, 9-J] := I * J; for I := 0 to 9 do begin - for J := 0 to 9 do + for J := 0 to 9 do Write(B[I, J]:2, ' '); writeln; end; -end. +end. :exmp. :p. @@ -2097,7 +2095,7 @@ reference count of A (and B) is decreased with 1. As soon as the reference count reaches zero the memory, allocated for the contents of the array, is disposed of. :p. -It is also possible to copy and/or resize the array with the standard +It is also possible to copy and/or resize the array with the standard :hp1.Copy():ehp1. function, which acts as the copy function for strings: :xmp. @@ -2105,8 +2103,8 @@ program testarray3; type TA = array of Integer; - -var + +var A, B: TA; I: Integer; @@ -2114,10 +2112,10 @@ begin Setlength(A, 10); for I := 0 to 9 do A[I] := I; - B := Copy(A, 3, 6); + B := Copy(A, 3, 6); for I := 0 to 5 do Writeln(B[I]); -end. +end. :exmp. :p. @@ -2128,14 +2126,14 @@ Starting at the element at index 3 (i.e. the fourth element) of the array. The :hp1.Length():ehp1. function will return the number of elements in the array. The :hp1.Low():ehp1. function on a dynamic array will always return 0, and the :hp1.High():ehp1. function will return the value :hp1.Length-1:ehp1., i.e., the value of the -highest allowed array index. +highest allowed array index. :h5.Packing and unpacking an array :p. Arrays can be packed and bitpacked. Two array types which have the same index -type and element type, but which are differently packed are not assignment +type and element type, but which are differently packed are not assignment compatible. :p. @@ -2146,7 +2144,7 @@ routine, as in the following example: :xmp. var - foo: array [ 'a'..'f' ] of Boolean + foo: array [ 'a'..'f' ] of Boolean = ( false, false, true, false, false, false ); bar: packed array [ 42..47 ] of Boolean; baz: array [ '0'..'5' ] of Boolean; @@ -2168,27 +2166,27 @@ More information about the pack and unpack routines can be found in the The syntax diagram for a record type is: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Record types:ehp2. -&ra.&ra.── record type ─┬───────────────┬─ :hp2.record:ehp2. ─┬──────────────┬─ :hp2.end:ehp2. ───────────&ra.&la. - ├─ :hp2.packed:ehp2. ─┤ └─ field list ─┘ - └─ :hp2.bitpacked:ehp2. ─┘ +&ra.&ra.ÄÄ record type ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.record:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.end:ehp2. ÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ :hp2.packed:ehp2. Ä´ ÀÄ field list ÄÙ + ÀÄ :hp2.bitpacked:ehp2. ÄÙ -&ra.&ra.── field list ─┬─── fixed fields ───────────────────────┬─┬─────┬───────────&ra.&la. - └─┬─────────────────────┬─ variant part ─┘ └─ ; ─┘ - └─ fixed fields ─ ; ─┘ +&ra.&ra.ÄÄ field list ÄÂÄÄÄ fixed fields ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ variant part ÄÙ ÀÄ ; ÄÙ + ÀÄ fixed fields Ä ; ÄÙ -&ra.&ra.── fixed fields ─┬─ identifier list ─ : ─ type ─┬───────────────────────────&ra.&la. - └──────────── ; ───────────────┘ +&ra.&ra.ÄÄ fixed fields ÄÂÄ identifier list Ä : Ä type ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÄÄÄÄÄÄÄÄÄÄÄ ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.── variant part ─ :hp2.case:ehp2. ─┬────────────────┬─ ordinal type identifier ─ :hp2.of:ehp2. ─┬─ variant─┬───&ra.&la. - â”” identifier ─ : ┘ ^──── ; ───┘ +&ra.&ra.ÄÄ variant part Ä :hp2.case:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ ordinal type identifier Ä :hp2.of:ehp2. ÄÂÄ variantÄÂÄÄÄ&ra.&la. + À identifier Ä : Ù ^ÄÄÄÄ ; ÄÄÄÙ -&ra.&ra.── variant ─┬─ constant ─ , ─┬─ : ─ ( ─┬────────────────┬─ ) ───────────────&ra.&la. - ^────────────────┘ ^── field list ──┘ +&ra.&ra.ÄÄ variant ÄÂÄ constant Ä , ÄÂÄ : Ä ( ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ^ÄÄ field list ÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -2250,7 +2248,7 @@ each part is first rounded up to two. So in the above example: :ul. :li. :hp1.SizeOf():ehp1. would return 24 for :hp1.Point:ehp1. :li. It would result in 24 for :hp1.RPoint}:ehp1. -:li. Finally, 26 would be the size of :hp1.BetterRPoint:ehp1. +:li. Finally, 26 would be the size of :hp1.BetterRPoint:ehp1. :li. For :hp1.MyRec:ehp1., the value would be 12. :eul. @@ -2258,9 +2256,9 @@ each part is first rounded up to two. So in the above example: If a typed file with records, produced by a &tp. program, must be read, then chances are that attempting to read that file correctly will fail. The reason for this is that by default, elements of a record are aligned at -2-byte boundaries, for performance reasons. +2-byte boundaries, for performance reasons. :p. -This default behaviour can be changed with the :hp1.{$PACKRECORDS N}:ehp1. +This default behaviour can be changed with the :hp1.{$PACKRECORDS N}:ehp1. switch. Possible values for :hp1.N:ehp1. are 1, 2, 4, 16 or :hp1.Default:ehp1. This switch tells the compiler to align elements of a record or object or class that have size larger than :hp1.n:ehp1. on :hp1.n:ehp1. byte boundaries. @@ -2298,7 +2296,7 @@ type Trec4 = Record A,B : Byte; end; - + {$PackRecords 4} Trec5 = Record A : Byte; @@ -2312,7 +2310,7 @@ type B : Array[1..3] of byte; C : byte; end; - + {$PackRecords 4} Trec7 = Record A : Byte; @@ -2386,10 +2384,10 @@ right after A, hence, the total size of the record is 3. :li.For Trec3, the sizes of A,B are 1, and hence they are aligned on 1 byte boundaries. The same is true for Trec4. -:li.For Trec5, since the size of B – 3 – is smaller than 4, B will be on a 4-byte boundary, as this +:li.For Trec5, since the size of B - 3 - is smaller than 4, B will be on a 4-byte boundary, as this is the first power of two that is larger than its size. The same holds for Trec6. -:li.For Trec7, B is aligned on a 4 byte boundary, since its size – 7 – is larger than 4. However, in +:li.For Trec7, B is aligned on a 4 byte boundary, since its size - 7 - is larger than 4. However, in Trec8, it is aligned on a 8-byte boundary, since 8 is the first power of two that is greater than 7, thus making the total size of the record 16. :eul. @@ -2427,12 +2425,12 @@ Note the :hp1.{$PackRecords 2}:ehp1. after the first declaration! &fpc. supports the set types as in &tp.. The prototype of a set declaration is: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Set types:ehp2. -&ra.&ra.── set type ── :hp2.set:ehp2. ── :hp2.of:ehp2. ── ordinal type ───────────────────────────────────&ra.&la. +&ra.&ra.ÄÄ set type ÄÄ :hp2.set:ehp2. ÄÄ :hp2.of:ehp2. ÄÄ ordinal type ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -2478,13 +2476,13 @@ its data for instance in memory. Here is the type declaration for a file type: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.File types:ehp2. -&ra.&ra.── file type ── :hp2.file:ehp2. ─┬─────────────┬───────────────────────────────────────&ra.&la. - └─ :hp2.of:ehp2. ─ type ─┘ +&ra.&ra.ÄÄ file type ÄÄ :hp2.file:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.of:ehp2. Ä type ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -2522,12 +2520,12 @@ address in memory, where the data of another variable may be stored. A pointer type can be defined as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Pointer types:ehp2. -&ra.&ra.── pointer type ── ^ ── type identifier ────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄ pointer type ÄÄ ^ ÄÄ type identifier ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -2716,24 +2714,24 @@ types. syntax diagram: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Procedural types:ehp2. -&ra.&ra.── procedural type ─┬─ function header ──┬┬───────────────┬┬─────────────────────┬──────&ra.&la. - └─ procedure header ─┘└─ :hp2.of:ehp2. ─ :hp2.object:ehp2. ─┘└─ ; ─ call modifier ─┘ +&ra.&ra.ÄÄ procedural type ÄÂÄ function header ÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄ&ra.&la. + ÀÄ procedure header ÄÙÀÄ :hp2.of:ehp2. Ä :hp2.object:ehp2. ÄÙÀÄ ; Ä call modifier ÄÙ -&ra.&ra.── function header ── :hp2.function:ehp2. ─ formal parameter list ─ : ─ result type ───────────────&ra.&la. +&ra.&ra.ÄÄ function header ÄÄ :hp2.function:ehp2. Ä formal parameter list Ä : Ä result type ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.── procedure header ── :hp2.procedure:ehp2. ─ formal parameter list ───────────────────────────────&ra.&la. +&ra.&ra.ÄÄ procedure header ÄÄ :hp2.procedure:ehp2. Ä formal parameter list ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.── call modifiers ─┬─ :hp2.register:ehp2. ─┬───────────────────────────────────────────────────────&ra.&la. - ├─ :hp2.cdecl:ehp2. ─┤ - ├─ :hp2.pascal:ehp2. ─┤ - ├─ :hp2.stdcall:ehp2. ─┤ - ├─ :hp2.safecall:ehp2. ─┤ - └─ :hp2.inline:ehp2. ─┘ +&ra.&ra.ÄÄ call modifiers ÄÂÄ :hp2.register:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ :hp2.cdecl:ehp2. Ä´ + ÃÄ :hp2.pascal:ehp2. Ä´ + ÃÄ :hp2.stdcall:ehp2. Ä´ + ÃÄ :hp2.safecall:ehp2. Ä´ + ÀÄ :hp2.inline:ehp2. ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -3018,27 +3016,27 @@ The variables must be declared in a variable declaration section of a unit or a It looks as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Variable declaration:ehp2. -&ra.&ra.── variable declaration ── identifier ── : ── type ─┬──────────────────┬──&ra. - └─ :hp2.=:ehp2. ─ expression ─┘ +&ra.&ra.ÄÄ variable declaration ÄÄ identifier ÄÄ : ÄÄ type ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄ&ra. + ÀÄ :hp2.=:ehp2. Ä expression ÄÙ -&ra.───┬──────────────────────┬─ hintdirective ── :hp2.;:ehp2. ─────────────────────────────&ra.&la. - └─ variable modifiers ─┘ +&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ hintdirective ÄÄ :hp2.;:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ variable modifiers ÄÙ -&ra.&ra.── variable modifiers ─┬─┬───── :hp2.absolute:ehp2. ─┬─ integer expression ─┬───────────────────────┬┬─&ra. - ^ │ └─ identifier ─┘ ││ - │ ├────────────────────── :hp2.; export:ehp2. ───────────────────────────────┤│ - │ ├────────────────────── :hp2.; cvar:ehp2. ─────────────────────────────────┤│ - │ ├─ :hp2.; external:ehp2. ─┬───────────────────┬┬──────────────────────────┬┤│ - │ │ └─ string constant ─┘└─ :hp2.name:ehp2. ─ string constant ─┘││ - │ └────────────────────── hintdirective ──────────────────────────┘│ - └──────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄ variable modifiers ÄÂÄÂÄÄÄÄÄ :hp2.absolute:ehp2. ÄÂÄ integer expression ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄ&ra. + ^ ³ ÀÄ identifier ÄÙ ³³ + ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :hp2.; export:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´³ + ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :hp2.; cvar:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´³ + ³ ÃÄ :hp2.; external:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´³ + ³ ³ ÀÄ string constant ÄÙÀÄ :hp2.name:ehp2. Ä string constant ÄÙ³³ + ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ hintdirective ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.─────────────────────────────────────────────────────────────────────────────&ra.&la. +&ra.ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -3092,7 +3090,7 @@ above case). :eol. :p. -Note that assembler names must be unique. It’s not possible to declare or export 2 variables with the +Note that assembler names must be unique. It's not possible to declare or export 2 variables with the same assembler name. @@ -3133,7 +3131,7 @@ even better way of doing this: :xmp. const SDefault = 'This is an initialized string'; - + var S: String = SDefault; :exmp. @@ -3217,39 +3215,39 @@ value on the fly, or to check the values which are written to the property. The declaration is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Properties:ehp2. -&ra.&ra.── property definition ── identifier ─┬──────────────────────┬─ property specifiers ──────&ra.&la. - └─ property interface ─┘ +&ra.&ra.ÄÄ property definition ÄÄ identifier ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ property specifiers ÄÄÄÄÄÄ&ra.&la. + ÀÄ property interface ÄÙ -&ra.&ra.── property interface ─┬───────────────────────────┬─ : ── type identifier ──&ra. - └─ property parameter list ─┘ +&ra.&ra.ÄÄ property interface ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ : ÄÄ type identifier ÄÄ&ra. + ÀÄ property parameter list ÄÙ -&ra.───┬───────────────────────────┬─────────────────────────────────────────────&ra.&la. - └─ :hp2.index:ehp2. ─ integerconstant ─┘ +&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.index:ehp2. Ä integerconstant ÄÙ -&ra.&ra.── property parameter list ── :hp2.[:ehp2. ─┬─ parameter declaration ─┬─ :hp2.]:ehp2. ────────────&ra.&la. - ^─────────── ; ───────────┘ +&ra.&ra.ÄÄ property parameter list ÄÄ :hp2.[:ehp2. ÄÂÄ parameter declaration ÄÂÄ :hp2.]:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄ ; ÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.── property specifiers ─┬──────────────────┬┬───────────────────┬┬─────────────────────┬───&ra.&la. - └─ read specifier ─┘└─ write specifier ─┘└─ default specifier ─┘ +&ra.&ra.ÄÄ property specifiers ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄ&ra.&la. + ÀÄ read specifier ÄÙÀÄ write specifier ÄÙÀÄ default specifier ÄÙ -&ra.&ra.── read specifier ── :hp2.read:ehp2. ── field or function ─────────────────────────────&ra.&la. +&ra.&ra.ÄÄ read specifier ÄÄ :hp2.read:ehp2. ÄÄ field or function ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.── write specifier ── :hp2.write:ehp2. ── field or function ───────────────────────────&ra.&la. +&ra.&ra.ÄÄ write specifier ÄÄ :hp2.write:ehp2. ÄÄ field or function ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.── default specifier ──┬─ :hp2.default:ehp2. ──┬────────────┬┬─────────────────────────&ra.&la. - │ └─ constant ─┘│ - └──────── :hp2.nodefault:ehp2. ───────┘ +&ra.&ra.ÄÄ default specifier ÄÄÂÄ :hp2.default:ehp2. ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ³ ÀÄ constant ÄÙ³ + ÀÄÄÄÄÄÄÄÄ :hp2.nodefault:ehp2. ÄÄÄÄÄÄÄÙ -&ra.&ra.── field or procedure ──┬─── field identifier ───┬──────────────────────────&ra.&la. - └─ procedure identifier ─┘ +&ra.&ra.ÄÄ field or procedure ÄÄÂÄÄÄ field identifier ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ procedure identifier ÄÙ -&ra.&ra.── field or function ──┬─── field identifier ───┬───────────────────────────&ra.&la. - └─ function identifier ──┘ +&ra.&ra.ÄÄ field or function ÄÄÂÄÄÄ field identifier ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ function identifier ÄÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -3266,15 +3264,15 @@ function GetMyInt: Integer; procedure SetMyInt(AValue: Integer); property MyProp: Integer read GetMyInt write SetMyInt; - + implementation uses sysutils; var - FMyInt: Integer; - + FMyInt: Integer; + function GetMyInt: Integer; begin Result := FMyInt; @@ -3284,7 +3282,7 @@ procedure SetMyInt(AValue: Integer); begin if ((AValue mod 2) = 1) then raise Exception.Create('MyProp can only contain even value'); - FMyInt := AValue; + FMyInt := AValue; end; end. @@ -3312,8 +3310,8 @@ uses sysutils; var - FMyInt: Integer; - + FMyInt: Integer; + function GetMyInt: Integer; begin Result := FMyInt; @@ -3323,7 +3321,7 @@ procedure SetMyInt(AValue: Integer); begin If ((AValue mod 2) = 1) then Raise Exception.Create('Only even values are allowed'); - FMyInt := AValue; + FMyInt := AValue; end; end. @@ -3346,7 +3344,7 @@ property MyProp: Integer read GetMyInt write SetMyInt; implementation -end. +end. :exmp. :p. @@ -3374,13 +3372,13 @@ objects. Here we present some technical questions regarding object oriented prog :p. Objects should be treated as a special kind of record. The record contains all the fields that are -declared in the objects definition, and pointers to the methods that are associated to the objects’ type. +declared in the objects definition, and pointers to the methods that are associated to the objects' type. :p. An object is declared just as a record would be declared; except that now, procedures and functions -can be declared as if they were part of the record. Objects can “inherit†fields and methods from -“parent†objects. This means that these fields and methods can be used as if they were included in -the objects declared as a “child†object. +can be declared as if they were part of the record. Objects can "inherit" fields and methods from +"parent" objects. This means that these fields and methods can be used as if they were included in +the objects declared as a "child" object. :p. Furthermore, a concept of visibility is introduced: fields, procedures and functions can be declared as @@ -3395,30 +3393,30 @@ limited to the implementation of the current unit. The prototype declaration of an object is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Object types:ehp2. -&ra.&ra.───┬──────────┬─ :hp2.object:ehp2. ─┬────────────┬─┬─ component list ─┬─ end ────────────&ra.&la. - └─ :hp2.packed:ehp2. ─┘ └─ heritage ─┘ ^──────────────────┘ +&ra.&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.object:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÄÂÄ component list ÄÂÄ end ÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.packed:ehp2. ÄÙ ÀÄ heritage ÄÙ ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── heritage ── ( ── object type identifier ── ) ─────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ heritage ÄÄ ( ÄÄ object type identifier ÄÄ ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.─── component list ─┬───────────────────────────────┬┬──────────────────────┬─&ra. - └─ object visibility specifier ─┘└┬─ field definition ─┬┘ - ^────────────────────┘ +&ra.&ra.ÄÄÄ component list ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ&ra. + ÀÄ object visibility specifier ÄÙÀÂÄ field definition ÄÂÙ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.───┬───────────────────────┬───────────────────────────────────────────────────&ra.&la. - └┬─ method definition ─┬┘ - ^─────────────────────┘ +&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÂÄ method definition ÄÂÙ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── field definition ── identifier list ── : ── type ── ; ──┬───────────┬─────&ra.&la. - └─ :hp2.static;:ehp2. ─┘ +&ra.&ra.ÄÄÄ field definition ÄÄ identifier list ÄÄ : ÄÄ type ÄÄ ; ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.static;:ehp2. ÄÙ -&ra.&ra.─── object visibility specifier ─┬─ :hp2.private:ehp2. ─┬──────────────────────────────&ra.&la. - ├─ :hp2.protected:ehp2. ─┤ - └─ :hp2.public:ehp2. ─┘ +&ra.&ra.ÄÄÄ object visibility specifier ÄÂÄ :hp2.private:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ :hp2.protected:ehp2. Ä´ + ÀÄ :hp2.public:ehp2. ÄÙ -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. .* TODO: The "method definition" is missing from the above graph. @@ -3449,7 +3447,7 @@ outside the unit in which :hp1.TObj:ehp1. is declared. :note. In MacPas mode, the :hp1.Object:ehp1. keyword is replaced by the :hp1.class:ehp1. -keyword for compatibility with other pascal compilers available on the Mac. +keyword for compatibility with other pascal compilers available on the Mac. That means that objects cannot be used in MacPas mode. :nt. @@ -3526,7 +3524,7 @@ end; :p. One cannot access fields that are in a private or protected sections of an object from -outside the objects’ methods. If this is attempted anyway, the compiler will complain about +outside the objects' methods. If this is attempted anyway, the compiler will complain about an unknown identifier. :p. @@ -3586,7 +3584,7 @@ will be the following :exmp. :p. -Note that the last line of code references the object type itself (cl), +Note that the last line of code references the object type itself (cl), and not an instance of the object (cl1 or cl2). @@ -3600,24 +3598,24 @@ constructor and the destructor explicitly when using objects. The declaration of a constructor or destructor is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Constructors and Destructors:ehp2. -&ra.&ra.─── constructor declaration ── constructor header ── ; ── subroutine block ──────&ra.&la. +&ra.&ra.ÄÄÄ constructor declaration ÄÄ constructor header ÄÄ ; ÄÄ subroutine block ÄÄÄÄÄÄ&ra.&la. -&ra.&ra.─── destructor declaration ── destructor header ── ; ── subroutine block ────────&ra.&la. +&ra.&ra.ÄÄÄ destructor declaration ÄÄ destructor header ÄÄ ; ÄÄ subroutine block ÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.─── constructor header ── :hp2.constructor:ehp2. ──┬───────── identifier ──────────┬────────&ra. - └─ qualified method identifier ─┘ +&ra.&ra.ÄÄÄ constructor header ÄÄ :hp2.constructor:ehp2. ÄÄÂÄÄÄÄÄÄÄÄÄ identifier ÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ&ra. + ÀÄ qualified method identifier ÄÙ -&ra.──── formal parameter list ───────────────────────────────────────────────────────&ra.&la. +&ra.ÄÄÄÄ formal parameter list ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.─── destructor header ── :hp2.destructor:ehp2. ──┬───────── identifier ──────────┬──────────&ra. - └─ qualified method identifier ─┘ +&ra.&ra.ÄÄÄ destructor header ÄÄ :hp2.destructor:ehp2. ÄÄÂÄÄÄÄÄÄÄÄÄ identifier ÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ&ra. + ÀÄ qualified method identifier ÄÙ -&ra.──── formal parameter list ───────────────────────────────────────────────────────&ra.&la. +&ra.ÄÄÄÄ formal parameter list ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -3635,7 +3633,7 @@ i.e. an identifier of the form :hp1.objectidentifier.methodidentifier:ehp1.. :p. &fpc. supports also the extended syntax of the :hp1.New:ehp1. and :hp1.Dispose:ehp1. procedures. In case a dynamic variable of an object type must be allocated -the constructor’s name can be specified in the call to :hp1.New:ehp1.. +the constructor's name can be specified in the call to :hp1.New:ehp1.. The :hp1.New:ehp1. is implemented as a function which returns a pointer to the instantiated object. Consider the following declarations: @@ -3676,7 +3674,7 @@ pp^.init; :p. In the last case, the compiler will issue a warning that the extended syntax of :hp1.New:ehp1. and :hp1.Dispose:ehp1. must be used to generate instances of an -object. It is possible to ignore this warning, but it’s better programming practice to +object. It is possible to ignore this warning, but it's better programming practice to use the extended syntax to create instances of an object. Similarly, the :hp1.Dispose:ehp1. procedure accepts the name of a destructor. The destructor will then be called, before removing the object from the heap. @@ -3704,30 +3702,30 @@ declaration, with some additional specifiers, as can be seen from the following diagram, which is part of the object declaration: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Methods:ehp2. -&ra.&ra.─── method definition ─┬─ function header ─┬─ ; ── method directives ─────────────&ra.&la. - ├─ procedure header ─┤ - ├─ constructor header ─┤ - └─ destructor header ─┘ +&ra.&ra.ÄÄÄ method definition ÄÂÄ function header ÄÂÄ ; ÄÄ method directives ÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ procedure header Ä´ + ÃÄ constructor header Ä´ + ÀÄ destructor header ÄÙ + +&ra.&ra.ÄÄÄ method directives ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄ&ra.&la. + ÀÄ :hp2.virtual:ehp2. Ä ; ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÙÀÄ call modifier Ä ; ÄÙ + ÀÄ :hp2.abstract:ehp2. Ä ; ÄÙ -&ra.&ra.─── method directives ─┬──────────────────────────────────┬┬─────────────────────┬───&ra.&la. - └─ :hp2.virtual:ehp2. ─ ; ─┬────────────────┬─┘└─ call modifier ─ ; ─┘ - └─ :hp2.abstract:ehp2. ─ ; ─┘ - -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. -from the point of view of declarations, :hp1.Method definitions:ehp1. are +from the point of view of declarations, :hp1.Method definitions:ehp1. are normal function or procedure declarations. -Contrary to &tp. and &delphi., fields can be declared after methods in the same +Contrary to &tp. and &delphi., fields can be declared after methods in the same block, i.e. the following will generate an error when compiling with &delphi. or &tp., but not with &fpc.: :xmp. -type +type MyObj = object procedure Doit; Field: Longint; @@ -3842,7 +3840,7 @@ As it is visible, both the parent and child objects have a method called :hp1.Doit:ehp1.. Consider now the following declarations and calls: :xmp. -var +var ParentA, ParentB: PParent; Child: PChild; begin @@ -3888,9 +3886,9 @@ static methods, only on virtual methods. :p. To be able to do this, the compiler keeps - per object type - a table with -virtual methods: the VMT (Virtual Method Table). This is simply a table +virtual methods: the VMT (Virtual Method Table). This is simply a table with pointers to each of the virtual methods: each virtual method has its -fixed location in this table (an index). The compiler uses this table to +fixed location in this table (an index). The compiler uses this table to look up the actual method that must be used. When a descendent object overrides a method, the entry of the parent method is overwritten in the VMT. More information about the VMT can be found in :link reftype=hd database='prog.inf' refid=0.&progref.:elink.. @@ -3904,12 +3902,12 @@ the VMT of the actual type that it was created with. :h5 name='objects_abstract_methods'.Abstract Methods :p. An abstract method is a special kind of virtual method. A method that is -declared :hp1.abstract:ehp1. does not have an implementation for this method. +declared :hp1.abstract:ehp1. does not have an implementation for this method. It is up to inherited objects to override and implement this method. :p. -From this it follows that a method can not be abstract if it is not virtual -(this can be seen from the syntax diagram). A second consequence is that +From this it follows that a method can not be abstract if it is not virtual +(this can be seen from the syntax diagram). A second consequence is that an instance of an object that has an abstract method cannot be created directly. @@ -4022,7 +4020,7 @@ var :exmp. :p. -The main difference is that the variable A will take up as much +The main difference is that the variable A will take up as much space on the stack as the size of the object (TSomeObject). The variable B, on the other hand, will always take just the size of a pointer on the stack. The actual class data is on the heap. @@ -4031,7 +4029,7 @@ a pointer on the stack. The actual class data is on the heap. From this, a second difference follows: a class must :hp2.always:ehp2. be initialized through its constructor, whereas for an object, this is not necessary. Calling the constructor allocates the necessary memory on the heap for the -class instance data. +class instance data. :nt. In earlier versions of &fpc. it was necessary, in order to use classes, @@ -4056,55 +4054,55 @@ In fact, the compiler will give a warning if it encounters the The prototype declaration of a class is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Class types:ehp2. -&ra.&ra.───┬──────────┬─ :hp2.class:ehp2. ─┬────────────┬─┬────────────────────┬─ end ──────────────&ra.&la. - └─ :hp2.packed:ehp2. ─┘ └─ heritage ─┘ └┬ component list ─┬─┘ - ^─────────────────┘ - -&ra.&ra.─── heritage ── ( ── class type identifier ──┬──────────────────────────┬─ ) ────&ra.&la. - └─ implemented interfaces ─┘ - -&ra.&ra.─── implemented interfaces ─┬ , ── interface identifier ──┬──────────────────────&ra.&la. - ^─────────────────────────────┘ - -&ra.&ra.─── component list ─┬────────────────────────┬┬──────────────────────┬─&ra. - └─ visibility specifier ─┘└┬─ field definition ─┬┘ - ^────────────────────┘ - -&ra.───┬───────────────────────────┬──────────────────────────────────────────────────&ra.&la. - └┬┬── method definition ──┬┬┘ - │└─ property definition ─┘│ - ^─────────────────────────┘ - -&ra.&ra.─── field definition ── identifier list ── : ── type ── ; ──┬───────────┬────────&ra.&la. - └─ :hp2.static;:ehp2. ─┘ - -&ra.&ra.─── method definition ─┬┬─────────┬┬─ function header ──┬┬── ; ────────&ra. - │└─ :hp2.class:ehp2. ─┘└─ procedure header ─┘│ - ├───── constructor header ────────┤ - └───── destructor header ─────────┘ - -&ra.────┬─────────────────────────────────────────┬┬──────────────────────┬───────────&ra.&la. - └─┬┬─ :hp2.virtual:ehp2. ─┬┬──────────────────┬┬─ ; ─┘└─ call modifiers ─ ; ─┘ - │└─ :hp2.dynamic:ehp2. ─┘└─ ; ── :hp2.abstract:ehp2. ──┘│ - ├──────── :hp2.override:ehp2. ───────────────┤ - └─ :hp2.message:ehp2. ─┬─ integer constant ─┬┘ - └─ string constant ──┘ - -&ra.&ra.─── class visibility specifier ─┬─ :hp2.private:ehp2. ─┬──────────────────────────────────&ra.&la. - ├─ :hp2.protected:ehp2. ─┤ - ├─ :hp2.public:ehp2. ─┤ - └─ :hp2.published:ehp2. ─┘ - -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.class:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ end ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.packed:ehp2. ÄÙ ÀÄ heritage ÄÙ À component list ÄÂÄÙ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ heritage ÄÄ ( ÄÄ class type identifier ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ ) ÄÄÄÄ&ra.&la. + ÀÄ implemented interfaces ÄÙ + +&ra.&ra.ÄÄÄ implemented interfaces Ä , ÄÄ interface identifier ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ component list ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ&ra. + ÀÄ visibility specifier ÄÙÀÂÄ field definition ÄÂÙ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +&ra.ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÂÂÄÄ method definition ÄÄÂÂÙ + ³ÀÄ property definition ÄÙ³ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ field definition ÄÄ identifier list ÄÄ : ÄÄ type ÄÄ ; ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.static;:ehp2. ÄÙ + +&ra.&ra.ÄÄÄ method definition ÄÂÂÄÄÄÄÄÄÄÄÄÂÂÄ function header ÄÄÂÂÄÄ ; ÄÄÄÄÄÄÄÄ&ra. + ³ÀÄ :hp2.class:ehp2. ÄÙÀÄ procedure header ÄÙ³ + ÃÄÄÄÄÄ constructor header ÄÄÄÄÄÄÄÄ´ + ÀÄÄÄÄÄ destructor header ÄÄÄÄÄÄÄÄÄÙ + +&ra.ÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄÂÂÄ :hp2.virtual:ehp2. ÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄ ; ÄÙÀÄ call modifiers Ä ; ÄÙ + ³ÀÄ :hp2.dynamic:ehp2. ÄÙÀÄ ; ÄÄ :hp2.abstract:ehp2. ÄÄÙ³ + ÃÄÄÄÄÄÄÄÄ :hp2.override:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ÀÄ :hp2.message:ehp2. ÄÂÄ integer constant ÄÂÙ + ÀÄ string constant ÄÄÙ + +&ra.&ra.ÄÄÄ class visibility specifier ÄÂÄ :hp2.private:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ :hp2.protected:ehp2. Ä´ + ÃÄ :hp2.public:ehp2. Ä´ + ÀÄ :hp2.published:ehp2. ÄÙ + +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. :nt. In MacPas mode, the :hp1.Object:ehp1. keyword is replaced by the :hp1.class:ehp1. -keyword for compatibility with other pascal compilers available on the Mac. +keyword for compatibility with other pascal compilers available on the Mac. That means that in MacPas mode, the reserved word 'class' in the above diagram may be replaced by the reserved word 'object'. :ent. @@ -4139,7 +4137,7 @@ they are implemented in other modules. :pt.:hp2.Published:ehp2. :pd.Is the same as a :hp1.Public:ehp1. section, but the compiler generates also type information that is needed for automatic streaming of -these classes if the compiler is in the {$M+} state. Fields defined in +these classes if the compiler is in the {$M+} state. Fields defined in a :hp1.published:ehp1. section must be of class type. Array properties cannot be in a published section. @@ -4151,8 +4149,8 @@ interfaces. This feature will be discussed in the next chapter. :p. Classes can contain :hp1.class:ehp1. methods: these are functions that do not -require an instance. The :hp1.self:ehp1. identifier is valid in such methods, -but refers to the class pointer (the VMT). +require an instance. The :hp1.self:ehp1. identifier is valid in such methods, +but refers to the class pointer (the VMT). :p. Similar to objects, if the {$STATIC ON} directive is active, then a class @@ -4194,7 +4192,7 @@ will be the following :exmp. :p. -Note that the last line of code references the class type itself (TMyClass), +Note that the last line of code references the class type itself (TMyClass), and not an instance of the class (c1 or c2). :p. @@ -4202,20 +4200,20 @@ It is also possible to define class reference types: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Class reference type:ehp2. -&ra.&ra.─── :hp2.class of:ehp2. ── classtype ──────────────────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ :hp2.class of:ehp2. ÄÄ classtype ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -└──────────────────────────────────────────────────────────────────────────────┘ +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. Class reference types are used to create instances of a certain class, which -is not yet known at compile time, but which is specified at run time. +is not yet known at compile time, but which is specified at run time. Essentially, a variable of a class reference type contains a pointer to the -definition of the speficied class. This can be used to construct an instance -of the class corresponding to the definition, or to check inheritance. +definition of the speficied class. This can be used to construct an instance +of the class corresponding to the definition, or to check inheritance. The following example shows how it works: :xmp. @@ -4243,7 +4241,7 @@ end; :exmp. :p. -On return of the :hp1.CreateComponent:ehp1. function, C will contain an +On return of the :hp1.CreateComponent:ehp1. function, C will contain an instance of the class TEdit. Note that the following call will fail to compile: @@ -4269,7 +4267,7 @@ type function CheckObjectBetween(Instance: TObject): boolean; begin - if not (Instance is TMinClass) + if not (Instance is TMinClass) or ((Instance is TMaxClass) and (Instance.ClassType <> TMaxClass)) then raise Exception.Create('SomeError') end; @@ -4288,7 +4286,7 @@ More about instantiating a class can be found in the next section. :p. Classes must be created using one of their constructors (there can be multiple constructors). Remember that a class is a pointer to an object on -the heap. When a variable of some class is declared, the compiler just +the heap. When a variable of some class is declared, the compiler just allocates room for this pointer, not the entire object. The constructor of a class returns a pointer to an initialized instance of the object on the heap. So, to initialize an instance of some class, one would do the following: @@ -4315,8 +4313,8 @@ value of the {$PackRecords} directive. :li. Just as for objects and records, a packed class can be declared. This has the same effect as on an object, or record, namely that the elements are aligned on 1-byte boundaries. i.e. as close as possible. -:li. :hp1.SizeOf(class):ehp1. will return the same as :hp1.SizeOf(Pointer):ehp1., -since a class is but a pointer to an object. To get the size of the class +:li. :hp1.SizeOf(class):ehp1. will return the same as :hp1.SizeOf(Pointer):ehp1., +since a class is but a pointer to an object. To get the size of the class instance data, use the :hp1.TObject.InstanceSize:ehp1. method. :eul. :ent. @@ -4341,21 +4339,21 @@ Declaration of methods in classes follows the same rules as method declarations in objects: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Methods:ehp2. -&ra.&ra.─── method definition ─┬─ function header ─┬─ ; ── method directives ─────────────────&ra.&la. - ├─ procedure header ─┤ - ├─ constructor header ─┤ - └─ destructor header ─┘ - -&ra.&ra.─── method directives ──┬──────────────────────────────────┬┬──────────────────────┬─────&ra.&la. - ├─ :hp2.virtual:ehp2. ─ ; ─┬─────────────────┬┘└─ call modifiers ─ ; ─┘ - │ └─ :hp2.abstract:ehp2. ─ ; ──┤ - ├──────── :hp2.reintroduce:ehp2. ─ ; ────────┤ - └─ :hp2.message:ehp2. ─ constant expression ─┘ - -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ method definition ÄÂÄ function header ÄÂÄ ; ÄÄ method directives ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ procedure header Ä´ + ÃÄ constructor header Ä´ + ÀÄ destructor header ÄÙ + +&ra.&ra.ÄÄÄ method directives ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄ&ra.&la. + ÃÄ :hp2.virtual:ehp2. Ä ; ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÙÀÄ call modifiers Ä ; ÄÙ + ³ ÀÄ :hp2.abstract:ehp2. Ä ; ÄÄ´ + ÃÄÄÄÄÄÄÄÄ :hp2.reintroduce:ehp2. Ä ; ÄÄÄÄÄÄÄÄ´ + ÀÄ :hp2.message:ehp2. Ä constant expression ÄÙ + +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. @@ -4379,7 +4377,7 @@ begin Classes have virtual methods, just as objects do. There is however a difference between the two. For objects, it is sufficient to redeclare the same method in a descendent object with the keyword :hp1.virtual:ehp1. to -override it. For classes, the situation is different: virtual methods +override it. For classes, the situation is different: virtual methods :hp2.must:ehp2. be overridden with the :hp1.override:ehp1. keyword. Failing to do so, will start a :hp2.new:ehp2. batch of virtual methods, hiding the previous one. The :hp1.Inherited:ehp1. keyword will not jump to the inherited method, if @@ -4389,11 +4387,11 @@ one. The :hp1.Inherited:ehp1. keyword will not jump to the inherited method, if The following code is :hp2.wrong:ehp2.: :xmp. -type +type TObjParent = class procedure MyProc; virtual; end; - + ObjChild = class(TObjParent) procedure MyProc; virtual; end; @@ -4414,11 +4412,11 @@ produce strange effects. The correct declaration is as follows: :xmp. -type +type TObjParent = class procedure MyProc; virtual; end; - + TObjChild = Class(TObjParent) procedure MyProc; override; end; @@ -4428,15 +4426,15 @@ type This will compile and run without warnings or errors. :p. -If the virtual method should really be replaced with a method with the +If the virtual method should really be replaced with a method with the same name, then the :hp1.reintroduce:ehp1. keyword can be used: :xmp. -type +type TObjParent = class procedure MyProc; virtual; end; - + TObjChild = Class(TObjParent) procedure MyProc; reintroduce; end; @@ -4447,9 +4445,9 @@ This new method is no longer virtual. :p. To be able to do this, the compiler keeps - per class type - a table with -virtual methods: the VMT (Virtual Method Table). This is simply a table +virtual methods: the VMT (Virtual Method Table). This is simply a table with pointers to each of the virtual methods: each virtual method has its -fixed location in this table (an index). The compiler uses this table to +fixed location in this table (an index). The compiler uses this table to look up the actual method that must be used at runtime. When a descendent object overrides a method, the entry of the parent method is overwritten in the VMT. More information about the VMT can be found in the &progref.. @@ -4474,13 +4472,13 @@ procedure or function declaration, as in the following example: :p. Class methods are methods that do not have an instance (i.e. Self does not -point to a class instance) but which follow the scoping and inheritance +point to a class instance) but which follow the scoping and inheritance rules of a class. They can be used to return information about the current -class, for instance for registration or use in a class factory. Since no +class, for instance for registration or use in a class factory. Since no instance is available, no information available in instances can be used. :p. -Class methods can be called from inside a regular method, but can also be called +Class methods can be called from inside a regular method, but can also be called using a class identifier: :xmp. @@ -4506,10 +4504,10 @@ begin :exmp. :p. -The reverse is not possible: Inside a class method, the Self identifier -points to the VMT table of the class. No fields, properties or -regular methods are available inside a class method. Accessing a regular -property or method will result in a compiler error. +The reverse is not possible: Inside a class method, the Self identifier +points to the VMT table of the class. No fields, properties or +regular methods are available inside a class method. Accessing a regular +property or method will result in a compiler error. :p. Note that class methods can be virtual, and can be overridden. @@ -4530,7 +4528,7 @@ GTK. In difference with &delphi., &fpc. also accepts strings as message identifiers. Message methods are always virtual. :p. -As can be seen in the class declaration diagram, message methods are +As can be seen in the class declaration diagram, message methods are declared with a :hp1.message:ehp1. keyword, followed by an integer constant expression. @@ -4560,7 +4558,7 @@ type MsgID: Cardinal; Data: Pointer; end; - + var Msg: TMSg; begin @@ -4570,7 +4568,7 @@ begin :p. In this example, the Dispatch() method will look at the object and all -its ancestors (starting at the object, and searching up the inheritance +its ancestors (starting at the object, and searching up the inheritance class tree), to see if a message method with message :hp1.MsgID:ehp1. has been declared. If such a method is found, it is called, and passed the Msg parameter. @@ -4622,7 +4620,7 @@ type constructor Create(AOwner: TComponent); override; end; -constructor TMyClass.Create(AOwner: TComponent); +constructor TMyClass.Create(AOwner: TComponent); begin inherited; // Do more things @@ -4646,12 +4644,12 @@ type constructor CreateNew(AOwner: TComponent; DoExtra: Boolean); end; -constructor TMyClass.Create(AOwner: TComponent); +constructor TMyClass.Create(AOwner: TComponent); begin inherited; end; -constructor TMyClass.CreateNew(AOwner: TComponent; DoExtra: Boolean); +constructor TMyClass.CreateNew(AOwner: TComponent; DoExtra: Boolean); begin inherited Create(AOwner); // Do stuff @@ -4697,52 +4695,52 @@ value on the fly. Moreover, properties can be read-only or write only. The prototype declaration of a property is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Properties:ehp2. -&ra.&ra.─── property definition ── :hp2.property:ehp2. ── identifier ─┬──────────────────────┬───&ra. - └─ property interface ─┘ - -&ra.──── property specifier ── hint directive ─────────────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄ property definition ÄÄ :hp2.property:ehp2. ÄÄ identifier ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄ&ra. + ÀÄ property interface ÄÙ + +&ra.ÄÄÄÄ property specifier ÄÄ hint directive ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + +&ra.&ra.ÄÄÄ property interface ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ : ÄÄ type identifier ÄÄ&ra. + ÀÄ property parameter list ÄÙ -&ra.&ra.─── property interface ─┬───────────────────────────┬─ : ── type identifier ──&ra. - └─ property parameter list ─┘ +&ra.ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ :hp2.index:ehp2. ÄÄ integer constant ÄÙ -&ra.─────┬─────────────────────────────┬───────────────────────────────────────────&ra.&la. - └─ :hp2.index:ehp2. ── integer constant ─┘ +&ra.&ra.ÄÄÄ property parameter list ÄÄ [ ÄÄ parameter declaration ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄÄÄÄÄ ; ÄÄÄÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.─── property parameter list ── [ ── parameter declaration ─┬──────────────────&ra.&la. - ^───────── ; ────────────┘ +&ra.&ra.ÄÄÄ property specifiers ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄ&ra. + ÀÄ read specifier ÄÙ ÃÄÄÄ write specifier ÄÄÄÄ´ + ÀÄ implements specifier ÄÙ -&ra.&ra.─── property specifiers ──┬──────────────────┬─┬────────────────────────┬─────&ra. - └─ read specifier ─┘ ├─── write specifier ────┤ - └─ implements specifier ─┘ +&ra.ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra. + ÀÄ default specifier ÄÙÀÄ stored specifier ÄÙ -&ra.─────┬─────────────────────┬┬────────────────────┬─────────────────────────────&ra. - └─ default specifier ─┘└─ stored specifier ─┘ +&ra.ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ default array property specifier ÄÙ -&ra.─────┬────────────────────────────────────┬────────────────────────────────────&ra.&la. - └─ default array property specifier ─┘ +&ra.&ra.ÄÄÄÄ read specifier ÄÄ :hp2.read:ehp2. ÄÄ field or method ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.──── read specifier ── :hp2.read:ehp2. ── field or method ───────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄÄ write specifier ÄÄ :hp2.write:ehp2. ÄÄ field or method ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.──── write specifier ── :hp2.write:ehp2. ── field or method ─────────────────────────────&ra.&la. +&ra.&ra.ÄÄÄÄ implements specifier ÄÄ :hp2.implements:ehp2. ÄÄ identifier ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. -&ra.&ra.──── implements specifier ── :hp2.implements:ehp2. ── identifier ────────────────────────&ra.&la. +&ra.&ra.ÄÄÄÄ default specifier ÄÂÄ :hp2.default:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ³ ÀÄ constant ÄÙ³ + ÀÄÄÄÄÄ :hp2.nodefault:ehp2. ÄÄÄÄÄÄÄÄÄÙ -&ra.&ra.──── default specifier ─┬─ :hp2.default:ehp2. ─┬────────────┬┬───────────────────────────&ra.&la. - │ └─ constant ─┘│ - └───── :hp2.nodefault:ehp2. ─────────┘ +&ra.&ra.ÄÄÄÄ stored specifier ÄÄ :hp2.stored:ehp2. ÄÂÄ constant ÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ identifier ÄÙ -&ra.&ra.──── stored specifier ── :hp2.stored:ehp2. ─┬─ constant ───┬─────────────────────────────&ra.&la. - └─ identifier ─┘ - -&ra.&ra.──── field or method ──┬─ field identifier ──┬────────────────────────────────&ra.&la. - └─ method identifier ─┘ +&ra.&ra.ÄÄÄÄ field or method ÄÄÂÄ field identifier ÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÀÄ method identifier ÄÙ -&ra.&ra.──── default array property specifier ── ; ── :hp2.default:ehp2. ────────────────────────&ra.&la. - -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄÄ default array property specifier ÄÄ ; ÄÄ :hp2.default:ehp2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -4787,7 +4785,7 @@ type property Z: Longint read GetZ; end; -var +var MyClass: TMyClass; :exmp. @@ -4834,7 +4832,7 @@ the same type. The following is an example of a property with an index: :xmp. {$mode objfpc} -type +type TPoint = class(TObject) private FX: Longint; @@ -4863,7 +4861,7 @@ begin end; end; -var +var P: TPoint; begin @@ -4902,7 +4900,7 @@ type as the index, and the second argument is a parameter of the same type as the property type. As an example, see the following declaration: :xmp. -type +type TIntList = class private Function GetInt(I: Longint): Longint; @@ -4914,7 +4912,7 @@ type property StrItems[S: String]: String read GetAsString write SetAsstring; end; -var +var AIntList: TIntList; :exmp. @@ -4977,8 +4975,8 @@ The :hp1.stored specifier:ehp1. should be either a boolean constant, a boolean field of the class, or a parameterless function which returns a boolean result. This specifier has no result on the class behaviour. It is an aid for the streaming system: the stored specifier is specified in the RTTI -generated for a class (it can only be streamed if RTTI is generated), -and is used to determine whether a property should be streamed or not: +generated for a class (it can only be streamed if RTTI is generated), +and is used to determine whether a property should be streamed or not: it saves space in a stream. It is not possible to specify the 'Stored' directive for array properties. @@ -5112,7 +5110,7 @@ identifier. :p. When the compiler looks for unit files, it adds the extension :hp1..ppu:ehp1. -to the name of the unit. On &linux. and in operating systems where filenames +to the name of the unit. On &linux. and in operating systems where filenames are case sensitive when looking for a unit, the following mechanism is used: @@ -5123,19 +5121,19 @@ used: :eol. :p. -Additionally, If a unit name is longer than 8 characters, the compiler -will first look for a unit name with this length, and then it will -truncate the name to 8 characters and look for it again. -For compatibility reasons, this is also true on platforms that +Additionally, If a unit name is longer than 8 characters, the compiler +will first look for a unit name with this length, and then it will +truncate the name to 8 characters and look for it again. +For compatibility reasons, this is also true on platforms that support long file names. :p. Note that the above search is performed in each directory in the search -path. +path. :p. The program block contains the statements that will be executed when the -program is started. Note that these statements need not necessarily be the +program is started. Note that these statements need not necessarily be the first statements that are executed: the initialization code of the units may also contain statements that are executed prior to the program code. @@ -5148,38 +5146,38 @@ The structure of a program block is discussed below. used by a program or another unit. The syntax for a unit is as follows: :cgraphic. -┌──────────────────────────────────────────────────────────────────────────────┠+ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :hp2.Units:ehp2. -&ra.&ra.─── unit ── unit header ── interface part ── implementation part ────────────&ra. - -&ra.─────┬────────────────────────────────────────────┬─ :hp2.end:ehp2. ── . ─────────────────&ra.&la. - ├─ initialization part ─┬───────────────────┬┤ - │ â”” finalization part ┘│ - └─ :hp2.begin:ehp2. ─┬─ statement ─┬───────────────────┘ - ^───── ; ─────┘ - -&ra.&ra.─── unit header ── :hp2.unit:ehp2. ── unit identifier ── ; ──────────────────────────────&ra.&la. - -&ra.&ra.─── interface part ── :hp2.interface:ehp2. ─┬───────────────┬┬┬─────────────────────────────┬┬──&ra.&la. - └─ uses clause ─┘│├─ constant declaration part ─┤│ - │├─ type declatation part ─┤│ - │└─ procedure headers part ─┘│ - ^───────────────────────────────┘ - -&ra.&ra.─── procedure headers part ─┬─ procedure header ─┬─ ; ─┬───────────────────────┬─────&ra.&la. - └─ function header ─┘ └─ call modifiers ── ; ─┘ - -&ra.&ra.─── implementation part ── :hp2.implementation:ehp2. ─┬───────────────┬─ declaration part ──────&ra.&la. - ^─ uses clause ─┘ - -&ra.&ra.─── initialization part ── :hp2.initialization:ehp2. ─┬─ statement ─┬────────────────────&ra.&la. - ^───── ; ─────┘ - -&ra.&ra.─── finalization part ── :hp2.finalization:ehp2. ─┬─ statement ─┬────────────────────────&ra.&la. - ^───── ; ─────┘ - -└──────────────────────────────────────────────────────────────────────────────┘ +&ra.&ra.ÄÄÄ unit ÄÄ unit header ÄÄ interface part ÄÄ implementation part ÄÄÄÄÄÄÄÄÄÄÄÄ&ra. + +&ra.ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ :hp2.end:ehp2. ÄÄ . ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ÃÄ initialization part ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ À finalization part Ù³ + ÀÄ :hp2.begin:ehp2. ÄÂÄ statement ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ^ÄÄÄÄÄ ; ÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ unit header ÄÄ :hp2.unit:ehp2. ÄÄ unit identifier ÄÄ ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + +&ra.&ra.ÄÄÄ interface part ÄÄ :hp2.interface:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄ&ra.&la. + ÀÄ uses clause ÄÙ³ÃÄ constant declaration part Ä´³ + ³ÃÄ type declatation part Ä´³ + ³ÀÄ procedure headers part ÄÙ³ + ^ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ procedure headers part ÄÂÄ procedure header ÄÂÄ ; ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄ&ra.&la. + ÀÄ function header ÄÙ ÀÄ call modifiers ÄÄ ; ÄÙ + +&ra.&ra.ÄÄÄ implementation part ÄÄ :hp2.implementation:ehp2. ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ declaration part ÄÄÄÄÄÄ&ra.&la. + ^Ä uses clause ÄÙ + +&ra.&ra.ÄÄÄ initialization part ÄÄ :hp2.initialization:ehp2. ÄÂÄ statement ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄ ; ÄÄÄÄÄÙ + +&ra.&ra.ÄÄÄ finalization part ÄÄ :hp2.finalization:ehp2. ÄÂÄ statement ÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ&ra.&la. + ^ÄÄÄÄÄ ; ÄÄÄÄÄÙ + +ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :ecgraphic. :p. @@ -5228,7 +5226,7 @@ The type :hp1.SomeBType:ehp1. is defined in unit :hp1.b:ehp1.. :p. All functions and methods that are declared in the interface part must be implemented in the implementation part of the unit, except for -declarations of external functions or procedures. If a declared method +declarations of external functions or procedures. If a declared method or function is not implemented in the implementation part, the compiler will give an error, for example the following: @@ -5254,23 +5252,23 @@ unita.pp(5,10) Error: Forward declaration not solved "MyFunction&colon.SmallInt; :p. The implementation part is primarily intended for the implementation of the functions and procedures declared in the interface part. However, it can -also contain declarations of it's own: The declarations inside the -implementation part are :hp2.not:ehp2. accessible outside the unit. +also contain declarations of it's own: The declarations inside the +implementation part are :hp2.not:ehp2. accessible outside the unit. :p. The initialization and finalization part of a unit are optional: :p. -The initialization block is used to initialize certain variables or -execute code that is necessary for the correct functioning of the unit. +The initialization block is used to initialize certain variables or +execute code that is necessary for the correct functioning of the unit. The initialization parts of the units -are executed in the order that the compiler loaded the units when compiling +are executed in the order that the compiler loaded the units when compiling a program. They are executed before the first statement of the program is executed. :p. The finalization part of the units are executed in the reverse order of the -initialization execution. They are used for instance to clean up any resources +initialization execution. They are used for instance to clean up any resources allocated in the initialization part of the unit, or during the lifetime of the program. The finalization part is always executed in the case of a normal program termination: whether it is because the final :hp1.end:ehp1. is @@ -5292,7 +5290,7 @@ end. :exmp. :p. -An initialization section by itself (i.e. without finalization) may simply be +An initialization section by itself (i.e. without finalization) may simply be replaced by a statement block. That is, the following: :xmp. @@ -5367,7 +5365,7 @@ on the target processor and emulation options. :h2.Object Pascal Grammar :p.This section describes the Object Pascal grammar in a EBNF -(Extended Backus–Naur Form) like style. The syntax only covers the +(Extended Backus-Naur Form) like style. The syntax only covers the :hp1.ObjFPC:ehp1. mode of the &fpc. compiler. :cgraphic. diff --git a/docs/fpdoc.css b/docs/fpdoc.css new file mode 100644 index 00000000..87e90189 --- /dev/null +++ b/docs/fpdoc.css @@ -0,0 +1,207 @@ +/* + Custom style sheets created for fpGUI class documentation. + Graeme Geldenhuys - 2015-03-10 + + I found the default blue theme of FPDoc a bit dated and needed some change. + Rather than play with colour, I muted the colours used and opted to rather + use fonts to add some style to the layout. + + TODO: + - Add media support +*/ + +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:300; + src:local("Open Sans Light"),local("OpenSans-Light"),url(//fonts.gstatic.com/s/opensans/v10/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:400; + src:local("Open Sans"),local("OpenSans"),url(//fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:600; + src:local("Open Sans Semibold"),local("OpenSans-Semibold"),url(//fonts.gstatic.com/s/opensans/v10/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:700; + src:local("Open Sans Bold"),local("OpenSans-Bold"),url(//fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:800; + src:local("Open Sans Extrabold"),local("OpenSans-Extrabold"),url(//fonts.gstatic.com/s/opensans/v10/EInbV5DfGHOiMmvb1Xr-honF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Droid Sans Mono'; + font-style:normal; + font-weight:400; + src:local("Droid Sans Mono"),local("DroidSansMono"),url(//fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format("woff") +} + +/* +@media (max-width: 980px) { + body { + font-size:calc-em(14px) + } +} +*/ + +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { + margin: 0px; + padding: 0px; + border: 0px none; + font-size: 14px; +} + +body { + background-color: white; + color: rgb(64, 66, 68); + width: 80%; + padding: 35px; + box-sizing: border-box; + font-weight: 400; +} + +body, p, th, td, caption, h1, h2, h3, ul, ol, dl { +/* color: black; */ + font-family: "Open Sans",Arial,Helvetica,sans-serif; +} + +/* +tt, span.kw, pre { + font-family: "Droid Sans Mono", "Courier New", monospace; +} +*/ + +pre { + font-family: "Droid Sans Mono", "Courier New", monospace; + color: #FFF; + display: block; + background-color: #404244; + padding: 25px; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 300; + margin: 1.5em 0px 0.8em; +} + +p { + line-height: 1.56em; + margin-bottom: 1.5em; + color: #404244; + max-width: 85%; + +} + +/* +body, p, th, td, caption, ul, ol, dl, tt, span.kw, pre { + font-size: 14px +} +*/ + +h1 { + margin-bottom: 1em; + font-size: 2.5em; +} + +h2 { + font-size: 2em; +} + +a { + color: #5CAA15; + text-decoration: none; + transition-duration: 0.3s; +} + +a:hover { + color:#46a2da +} + +p.cmt { + color: gray; + max-width: 100%; +} + +/* +table, table td, table th { + border: 1px solid #EEE; +} +*/ + +/* source fragments */ +span.code { + white-space: nowrap +} + +table.remark { + background-color: #ffffc0; + width: 80% +} + +table.bar { + background-color: #EEE; + padding: 8px; +} + +td p { + margin: 0; +} + +td b { + font-weight: normal; +} + +td b a { + color: #08860A; +} + +dt { + float: left; +} + +dd { + margin: 0px 0px 0px 110px; + padding: 0px 0px 0.5em; + width: 80%; +} + +/* keywords in source fragments */ +span.kw { + font-weight: bold +} + +/* comments in source fragments */ +span.cmt { + color: #729046; +} + + +span.toggletreeclose { + background: url(minus.png) center left no-repeat; + padding-left: 20px; +} + +span.toggletreeopen { + background: url(plus.png) center left no-repeat; + padding-left: 20px; +} + +ul.classtreelist li { + padding-left: 30px; } + +ul.classtreelist { list-style-type:none; } + +li.classtree ul { display: block; } + +li.classtreeclosed ul { display: none; } diff --git a/docs/fpgui-docs-project.xml b/docs/fpgui-docs-project.xml index 48395aba..cfb985c5 100644 --- a/docs/fpgui-docs-project.xml +++ b/docs/fpgui-docs-project.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <docproject> <packages> - <!-- Multiple packages can be entered. - If only one is specified, it is selected. + <!-- Multiple packages can be entered. + If only one is specified, it is selected. "name" is a mandatory attribute a "units" tag is required, and a "descriptions" tag as well --> @@ -131,6 +131,7 @@ <description file="xml/gui/fpg_basegrid.xml"/> <description file="xml/gui/fpg_form.xml"/> <description file="xml/gui/fpg_grid.xml"/> + <description file="xml/gui/fpg_panel.xml"/> </descriptions> </package> </packages> @@ -154,6 +155,8 @@ ## Options for HTML output <option name="footer-date" value="yyyy-mm-dd"/> + <option name="css-file" value="fpdoc.css"/> + <option name="hide-protected" value="true"/> --> </options> </docproject> diff --git a/docs/html/fpdoc.css b/docs/html/fpdoc.css deleted file mode 100644 index 723e6fed..00000000 --- a/docs/html/fpdoc.css +++ /dev/null @@ -1,160 +0,0 @@ -/* - Feel free to use this file as a template for your own style sheets. -*/ - -body { - background: white -} - -body, p, th, td, caption, h1, h2, h3, ul, ol, dl { - color: black; - font-family: sans-serif -} - -tt, span.kw, pre { - font-family: monospace, Courier -} - -body, p, th, td, caption, ul, ol, dl, tt, span.kw, pre { - font-size: 14px -} - -A:link { - color: blue -} - -A:visited { - color: darkblue -} - -A:active { - color: red -} - -A { - text-decoration: none -} - -A:hover { - text-decoration: underline -} - -h1, h2, td.h2 { - color: #005A9C -} - -/* Especially for Netscape on Linux: */ -h3, td.h3 { - font-size: 12pt -} - -/* source fragments */ -span.code { - white-space: nowrap -} - -/* symbols in source fragments */ -span.sym { - color: darkred -} - -/* keywords in source fragments */ -span.kw { - font-weight: bold -} - -/* comments in source fragments */ -span.cmt { - color: darkcyan; - font-style: italic -} - -/* directives in source fragments */ -span.dir { - color: darkyellow; - font-style: italic -} - -/* numbers in source fragments */ -span.num { - color: darkmagenta -} - -/* characters (#...) in source fragments */ -span.chr { - color: darkcyan -} - -/* strings in source fragments */ -span.str { - color: blue -} - -/* assembler passages in source fragments */ -span.asm { - color: green -} - -td.pre { - white-space: pre -} - -p.cmt { - color: gray -} - -span.warning { - color: red; - font-weight: bold -} - -/* !!!: How should we define this...? */ -span.file { - color: darkgreen -} - -table.remark { - background-color: #ffffc0; -} - -table.bar { - background-color: #a0c0ff; -} - -span.bartitle { - font-weight: bold; - font-style: italic; - color: darkblue -} - -span.footer { - font-style: italic; - color: darkblue -} - -/* definition list */ -dl { - border: 3px double #ccc; - padding: 0.5em; -} - -/* definition list: term */ -dt { - float: left; - clear: left; - width: auto; /* normally browsers default width of largest item */ - padding-right: 20px; - font-weight: bold; - color: darkgreen; -} - -/* definition list: description */ -dd { - margin: 0 0 0 110px; - padding: 0 0 0.5em 0; -} - -/* for browsers in standards compliance mode */ -td p { - margin: 0; -} diff --git a/docs/manifest.xml b/docs/manifest.xml index addb40c3..d0abae93 100644 --- a/docs/manifest.xml +++ b/docs/manifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> <packages> <package name="fpgui"> - <version major="1" minor="2" micro="0" build="0"/> - <filename>fpgui-1.2.0-0.zip</filename> + <version major="1" minor="4" micro="0" build="0"/> + <filename>fpgui-1.4.0-0.zip</filename> <author>Graeme Geldenhuys</author> <license>Modified LGPL</license> <email>graemeg@gmail.com</email> diff --git a/docs/release_process.txt b/docs/release_process.txt new file mode 100644 index 00000000..a97e0b8a --- /dev/null +++ b/docs/release_process.txt @@ -0,0 +1,50 @@ +Release process +=============== + +1. Create new release branch off 'develop': + git checkout -b release-1.x develop + +2. Bump version numbers + + docview/src/docview.rc + src/VERSION_FILE.inc + fpgui_toolkit.lpk (both X11 & gdi) + docs/manifest.xml + +3. Run localization script to update all *.po files + +4. Switch to 'develop' branch + +5. Bump version numbers - same files as step 2. + +6. Push both release and develop branches + +7. Build new documentation + [ ] INF + [ ] HTML for website + +8. Build new DocView + +9. Archive Docview and INF and release to SourceForge (Github?) + +10. Archive HTML and release to SourceForge. + +11. Push HTML API docs to website. + - Use rsync script in fpgui_website repository. + + + +Release notification +==================== + +1. Update website with new release and changelog + +2. Post message to FPC Users mailing list + +3. Post message to Lazarus mailing list + +4. Post message to Lazarus Forum (3rd party) + +5. Update Wikipedia (English and Afrikaans) + +6. Update FPC's wiki about fpGUI diff --git a/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas new file mode 100644 index 00000000..d85fadf2 --- /dev/null +++ b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas @@ -0,0 +1,7 @@ +{ This will draw a red arc, starting at the 6 o'clock position, and + drawing 90 degrees of the arc, ending at the 3 o'clock position. } +procedure TMainForm.FormPaint; // the forms OnPaint event handler +begin + Canvas.Color := clRed; + Canvas.DrawArc(5, 5, 100, 100, 270, 90); +end; diff --git a/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas new file mode 100644 index 00000000..897ac0ec --- /dev/null +++ b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas @@ -0,0 +1,8 @@ +{ This will draw a red filled arc, starting at the 6 o'clock position, and + drawing 45 degrees of the arc, ending at the half-past-four position. } +procedure TMainForm.FormPaint; // the form's OnPaint event handler. +begin + Canvas.Color := clRed; + Canvas.FillArc(5, 5, 100, 100, 270, 45); +end; + diff --git a/docs/xml/corelib/fpg_base.xml b/docs/xml/corelib/fpg_base.xml index f052e2f0..3c922712 100644 --- a/docs/xml/corelib/fpg_base.xml +++ b/docs/xml/corelib/fpg_base.xml @@ -3,7 +3,7 @@ <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 +fpGUI uses the LGPL v2 license with a 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, OpenSolaris and @@ -18,75 +18,70 @@ For more information, see the fpGUI Toolkit website at: <url href="http://fpgui. <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 -(eg: Carbon used in Mac OS-X) you would implement all the abstract methods + <p>When implementing support for a completely new windowing system +(eg: Carbon used in Mac OSX) you would implement all the abstract methods defined in this unit. </p> </descr> - <!-- alias type Visibility: default --> - <element name="TfpgCoord"> - <short>A custom type used to represent X and Y coordinates.</short> - <descr>Internally TfpgCoord is actually a Integer type. We created a custom -alias type for use in fpGUI in the event that we might want to change the + +<element name="TfpgCoord"> +<short>A custom type used to represent X and Y coordinates.</short> +<descr>Internally TfpgCoord is actually a Integer type. We created a custom +alias type for use in fpGUI in the event that we might want to change the underlying type in the future. Example to floating points. </descr> - <seealso/> - </element> - <!-- alias type Visibility: default --> - <element name="TfpgColor"> - <short>Represents a color in integer format.</short> - <descr> - <p>TfpgColor is always in RRGGBB (Red, Green, Blue) format, no matter the +</element> + +<element name="TfpgColor"> +<short>Represents a color in integer format.</short> +<descr> +<p>TfpgColor is always in AARRGGBB (Alpha, Red, Green, Blue) format, no matter the operating system. </p> - <p>The <var>fpg_base</var> unit also contains definitions of many useful color -constants. It defines the standard predefined Delphi colors (like clRed, -clMagenta etc.), the 140 web safe colors using the defacto standard names as -used by Netscape and Internet Explorer web browsers. As well as some internal -color constants used by many GUI components (like clText, clWindowBackground -etc.). -</p> - </descr> - <seealso/> - </element> - <!-- record type Visibility: default --> - <element name="TRGBTriple"> - <short>A record structure holding the RGBA values of a color</short> - <descr><printshort id="TRGBTriple"/>.</descr> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TRGBTriple.Alpha"> - <short>Alpha support has not really been implemented in fpGUI yet.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration type Visibility: default --> - <element name="TWindowType"> - <short>Enum type defining what types of windows can be created.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowType.wtChild"> - <short>The window being created is a child on another window. This normally +<p>The <var>fpg_base</var> unit also contains definitions of many useful color +constants. It defines the standard predefined Delphi colors (like clRed, +clMagenta etc.), the 140 web safe colors using the defacto standard names as +used by Netscape and Internet Explorer web browsers. As well as some internal +color constants used by many GUI components (like clText, clWindowBackground +etc.).</p></descr> +<seealso> +<link id="fpg_base.TRGBTriple">TRGBTriple</link> +</seealso> +</element> + +<element name="TRGBTriple"> +<short>A record structure holding the RGBA values of a color</short> +<descr><printshort id="TRGBTriple"/>.</descr> +</element> + +<element name="TRGBTriple.Alpha"> +<short>Alpha support has not really been implemented in fpGUI yet.</short> +</element> + +<element name="TWindowType"> +<short>Enum type defining what types of windows can be created.</short> +</element> + +<element name="TWindowType.wtChild"> +<short>The window being created is a child on another window. This normally means no titlebar or window borders are going to be created.</short> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowType.wtWindow"> - <short>This would specify a standard window with titlebar and window borders.</short> - <descr>This would specify a standard window with titlebar and window borders. It grabs input focus, and appears in the taskbar.</descr> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowType.wtModalForm"> - <short>This windows type is similar to wtWindow, but grabs focus.</short> - <descr>This windows is the same as <link id="#fpgui.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"> - <short>This window will normally not have a titlebar or window borders.</short> - <descr>This window will normally not have a titlebar or window borders and will appear above other windows. It is used for example in the dropdown window of a ComboBox or a tooltip window or popup menus. This type of window does not steal focus.</descr> - </element> +</element> + +<element name="TWindowType.wtWindow"> +<short>This would specify a standard window with titlebar and window borders. It grabs input +focus, and appears in the taskbar.</short> +</element> + +<element name="TWindowType.wtModalForm"> +<short>This windows is similar to <link id="#fpgui.fpg_base.TWindowType.wtWindow">wtWindow</link>, but grabs +the input focus until it has closed. This window normally doesn't appear in the taskbar.</short> +</element> + +<element name="TWindowType.wtPopup"> +<short>This window will normally not have a titlebar or window borders and will appear above other windows. It +is used for example in the dropdown window of a ComboBox or a tooltip window or popup menus. This type of +window does not steal focus.</short> +</element> <element name="TWindowAttribute"> <short>An enum types defining extra attributes of a window.</short> @@ -130,7 +125,7 @@ the first time.</short> <link id="fpg_base.TWindowAttribute">TWindowAttribute</link> </seealso> </element> - + <!-- enumeration type Visibility: default --> <element name="TMouseCursor"> <short>Enum types of the available mouse cursor shapes.</short> @@ -371,7 +366,7 @@ the first time.</short> <element name="TfpgRect"> <short>A graphical (pixel based) rectangle structure used throughout fpGUI.</short> <descr> - <p>Note that this structure is not a class, so static allocations are + <p>Note that this structure is not a class, so static allocations are allowed. This makes it much easier to use in Widgets and in fpGUI internal messages.</p> <p>Think of the pixel screen/grid like the grid of a spreadsheet (or as a magnified look of the top corner of your screen). @@ -387,11 +382,11 @@ messages.</p> +---+---+--- | | | </pre> - <p>x is at (0,0). A pixel is always 1x1, you don't get smaller (we are not using sub-pixels like on LCD screens, because they don't apply to all screens). + <p>x is at (0,0). A pixel is always 1x1, you don't get smaller (we are not using sub-pixels like on LCD screens, because they don't apply to all screens). </p> - <p>So with that example, Width = 1 pixel and Height = 1 pixel. In the case of -Classes.Bounds() the Right and Bottom values are (1,1) which looking at the -above image will be wrong, the pixel only covers one block, so in a screen/pixel + <p>So with that example, Width = 1 pixel and Height = 1 pixel. In the case of +Classes.Bounds() the Right and Bottom values are (1,1) which looking at the +above image will be wrong, the pixel only covers one block, so in a screen/pixel environment, Right, Bottom is also (0,0), the same as Top/Left. This is what TfpgRect.Right and TfpgRect.Bottom will report. </p> @@ -406,20 +401,20 @@ TfpgRect.Right and TfpgRect.Bottom will report. +---+---+--- | | | </pre> - <p>In this example we have a rectangle. Top/Left = (0,0) and Bottom/Right = (1,1). -This means Width = 2 pixels and Height = 2 pixels. Clearly visible in the image + <p>In this example we have a rectangle. Top/Left = (0,0) and Bottom/Right = (1,1). +This means Width = 2 pixels and Height = 2 pixels. Clearly visible in the image above. </p> - <p>But if we call Classes.Bounds(0,0,2,2) it reports Bottom/Right as (2,2) which -is wrong (again looking at the image above as reference). This is my point. + <p>But if we call Classes.Bounds(0,0,2,2) it reports Bottom/Right as (2,2) which +is wrong (again looking at the image above as reference). This is my point. Bounds() cannot be used in this case in a graphical environment. </p> - <p>The reason I don't use a grid layout as shown below, is -because if the mouse is over the rectangle containing x, the OS (graphics system) reports its -position as (0,0). You don't have to have the mouse pointer over the intersecting -lines at (0,0) as indicated in the image below. The whole square containing + <p>The reason I don't use a grid layout as shown below, is +because if the mouse is over the rectangle containing x, the OS (graphics system) reports its +position as (0,0). You don't have to have the mouse pointer over the intersecting +lines at (0,0) as indicated in the image below. The whole square containing the x is referenced as (0,0), hence the grid layout as show in the images above, -and what fpGUI uses. The same grid layout as used in TfpgStringGrid or any +and what fpGUI uses. The same grid layout as used in TfpgStringGrid or any Spreadsheet program etc. </p> <pre>. @@ -646,7 +641,7 @@ 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 +four values in a single API call. Thus improving efficiency and reduces resize calculations and screen redraws.</p> </descr> </element> @@ -657,7 +652,7 @@ calculations and screen redraws.</p> 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 properties of a control until the -<var>UpdateWindowPosition</var> method is called. For more information on why this is so, +<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link> help.</remark></descr> <seealso> @@ -671,7 +666,7 @@ help.</remark></descr> 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 properties of a control until the -<var>UpdateWindowPosition</var> method is called. For more information on why this +<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link> help.</remark></descr> <seealso> @@ -687,7 +682,7 @@ controls that have their Align property set to alTop, alBottom or alClient, chan this property at runtime has no effect. </p> <remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the -<var>UpdateWindowPosition</var> method is called. For more information on why this is so, +<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link> help.</remark></descr> <seealso> @@ -703,7 +698,7 @@ controls that have their Align property set to alLeft, alRight or alClient, chan this property at runtime has no effect. </p> <remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the -<var>UpdateWindowPosition</var> method is called. For more information on why this +<var>UpdateWindowPosition</var> method is called. For more information on why this is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link> help.</remark></descr> <seealso> @@ -769,11 +764,32 @@ you must keep copy of the original image before you call <var>Invert</var>.</des <descr/> </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.UpdateImage"> - <short>Updates the internal image resources and OS resources from image data</short> - <descr/> - </element> +<element name="TfpgImageBase.UpdateImage"> +<short>Updates the internal image resources and OS resources from image data</short> +<descr><printshort id="TfpgImageBase.UpdateImage"/>. This method must always be called <b>after</b> +you populated the <var>ImageData</var> array. Then only does it allocate OS resources.</descr> +<seealso> + <link id="TfpgImageBase.ImageData"/> +</seealso> +</element> + +<element name="TfpgImageBase.ImageData"> +<short>Internal representation of color data of the image</short> +<descr><printshort id="TfpgImageBase.ImageData"/>. This method gives you a pointer to the image date +which is always in the format ARGB. If you update the internal data you <b>always</b> need to call +<var>UpdateImage</var> afterwards.</descr> +<seealso> + <link id="TfpgImageBase.UpdateImage"/> +</seealso> +</element> + +<element name="TfpgImageBase.ImageDataSize"> +<short>Tells you the size of the image data</short> +<descr><printshort id="TfpgImageBase.ImageDataSize"/>. You would need this if you work directly with +the ImageData values.</descr> +</element> + + <!-- property Visibility: public --> <element name="TfpgImageBase.Width"> @@ -807,7 +823,7 @@ you must keep copy of the original image before you call <var>Invert</var>.</des <element name="TfpgBaseInterpolation"> <short>A abstract class representing a base Interpolation filter.</short> <descr>This is used as the base class to implement Interpolation filters like -Gaussian, Sinc etc... These decendant filters are used in the +Gaussian, Sinc etc... These decendant filters are used in the <link id="#fpgui.fpg_base.TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> function. </descr> <seealso> @@ -823,9 +839,9 @@ Gaussian, Sinc etc... These decendant filters are used in the <!-- procedure Visibility: public --> <element name="TfpgCanvasBase.DrawLine"> <short>Draws a line</short> - <descr><printshort id="#fpgui.fpg_base.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 + <descr><printshort id="#fpgui.fpg_base.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> </element> @@ -897,7 +913,7 @@ returns the correct enum type detected. <!-- 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 + <descr>This function calculates and returns the average color by using AColor1 and AColor2. The Alpha value also gets taken into account. </descr> </element> @@ -913,7 +929,7 @@ rectangle ARect. If it is, the function returns True, otherwise False. <!-- 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 + <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> </element> @@ -929,7 +945,7 @@ Right. And the Top is always smaller than the Bottom. For a detailed explanation see: http://www.nondot.org/~sabre/graphpro/line6.html </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> @@ -958,7 +974,7 @@ value to draw the arc.</p> <dt>h</dt> <dd>The height of the whole arc</dd> <dt>a1</dt> -<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock +<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock position. A value of 270 is the 6 o'clock position. Positive values move counter-clockwise, and negative values move clockwise.</dd> <dt>a2</dt> @@ -974,7 +990,7 @@ goes counter-clockwise, and a negative values goes clockwise.</dd> <element name="TfpgCanvasBase.FillArc.a1"> -<descr>This is the starting point of the arc. A value of 0 is the 3 o'clock +<descr>This is the starting point of the arc. A value of 0 is the 3 o'clock position. A value of 270 is the 6 o'clock position. Positive values move counter-clockwise, and negative values move clockwise.</descr> </element> @@ -994,7 +1010,7 @@ value to draw and fill the arc.</p> <dt>h</dt> <dd>The height of the whole arc</dd> <dt>a1</dt> -<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock +<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock position. A value of 270 is the 6 o'clock position. Positive values move counter-clockwise, and negative values move clockwise.</dd> <dt>a2</dt> @@ -1125,6 +1141,28 @@ contains the help for the application.</descr> or HelpKeyword as parameter. The default help viewer is fpGUI's DocView.</descr> </element> +<element name="TfpgApplicationBase.MainForm"> +<short>Identifies which form in the application is the main form</short> +<descr><p><printshort id="TfpgApplicationBase.MainForm"/>. Use the MainForm property to +determine the form that acts as the application's main window. The first form that is +show will be assigned as the main form of the application. If the main form closes, +then all other forms are closed too, and the application quits.</p> +<p>There are cases where the first form that was created and show, you don't want to +act as the application's main form. In such a case, simply assign the form you want to +act as the application's main form to the <var>MainForm</var> property.</p></descr> +<seealso> + <link id="TfpgApplicationBase.CreateForm"/> +</seealso> +</element> + +<element name="TfpgApplicationBase.CreateForm"> +<short>Creates a new form</short> +<descr><printshort id="TfpgApplicationBase.CreateForm"/>. Call CreateForm to dynamically create +a form at runtime. CreateForm creates a new form of the type specified by the InstanceClass +parameter and assigns it to the variable given by the Reference parameter. The owner of +the new form is the fpgApplication object.</descr> +</element> + <element name="TfpgBaseTimer.Enabled"> <short>Allows you to enable or disable the timer</short> diff --git a/docs/xml/corelib/fpg_main.xml b/docs/xml/corelib/fpg_main.xml index 613c0feb..654cd763 100644 --- a/docs/xml/corelib/fpg_main.xml +++ b/docs/xml/corelib/fpg_main.xml @@ -29,7 +29,7 @@ </element> <element name="fpgColorToRGB"> <short>Convert a color to the RGB values of that color</short> - <descr><printshort id="fpgColorToRGB"/>. Not all <link id="fpg_base.TfpgColor">TfpgColor</link> values are in RGB format. + <descr><printshort id="fpgColorToRGB"/>. Not all <link id="fpg_base.TfpgColor">TfpgColor</link> values are in RGB format. For example, you get "named" colors too (eg: clWindowBackground), which is simply an index value, but later translated to a real RGB value via the theming system.</descr> </element> @@ -91,6 +91,20 @@ planned.</p></descr> <short>fake</short> </element> +<element name="TfpgApplication.GetFormByClassName"> +<short>Finds a form instance by its ClassName property</short> +<descr><printshort id="TfpgApplication.GetFormByClassName"/>. This only works if the form has +been created with <var>fpgApplication.CreateForm()</var>. If no form is found, then nil is +returned.</descr> +</element> + +<element name="TfpgApplication.GetFormByName"> +<short>Finds a form instance by its Name property</short> +<descr><printshort id="TfpgApplication.GetFormByName"/>. This only works if the form has +been created with <var>fpgApplication.CreateForm()</var>. If no form is found, then nil is +returned.</descr> +</element> + <element name="TfpgTimer"> <short>A timer component for fpGUI applications</short> @@ -113,6 +127,19 @@ until the timer is disabled when the Enabled property is set to False.</descr> <descr><printshort id="TfpgWindow"/>.</descr> </element> +<element name="TfpgImageBase"> +<short>The base class representing a image</short> +<descr><printshort id="TfpgImageBase"/>.</descr> +</element> + +<element name="TfpgImageBase.ImageData"> +<short>Contains the pixel data of the image. The data format is in AARRGGBB format.</short> +<descr><printshort id="TfpgImageBase.ImageData"/>.</descr> +</element> + + + + </module> <!-- fpg_main --> </package> diff --git a/docs/xml/corelib/fpg_utils.xml b/docs/xml/corelib/fpg_utils.xml index 6c0ad9df..6323f257 100644 --- a/docs/xml/corelib/fpg_utils.xml +++ b/docs/xml/corelib/fpg_utils.xml @@ -7,14 +7,12 @@ <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> </element> -<!-- function Visibility: default --> <element name="fpgFromOSEncoding"> <short>Converts OS specific filesystem encoding to fpGUI string</short> <descr>This function is specific to filesystem strings like Paths, Filenames @@ -22,7 +20,6 @@ implementations and some have platform specific implementations.</p></descr> </descr> </element> -<!-- procedure Visibility: default --> <element name="fpgOpenURL"> <short>Launches the users Web Browser using the specified URL</short> <descr>On each platform, this function will try and find the appropriate (system @@ -30,34 +27,101 @@ implementations and some have platform specific implementations.</p></descr> </descr> </element> -<!-- argument Visibility: default --> <element name="fpgOpenURL.aURL"> <short>URL address to go to</short> </element> -<!-- function Visibility: default --> +<element name="fpgFileSize"> +<short>Returns the given file's size in bytes</short> +<descr><printshort id="fpgFileSize"/>.</descr> +</element> + <element name="fpgAddTrailingValue"> <short>If ALine is not '', add the trailing value AValue</short> <descr>If ALine is not '', add the trailing value AValue </descr> </element> -<!-- argument Visibility: default --> <element name="fpgAddTrailingValue.ALine"> <short>The source string</short> </element> -<!-- argument Visibility: default --> <element name="fpgAddTrailingValue.AValue"> <short>The value that must be added</short> </element> -<!-- argument Visibility: default --> <element name="fpgAddTrailingValue.ADuplicates"> <short>Are duplicate AValue's allowed</short> </element> -</module> +<element name="fpgAppendPathDelim"> +<short>Appends the path delimiter to the given string</short> +<descr><printshort id="fpgAppendPathDelim"/>.</descr> +</element> + +<element name="fpgHasSubDirs"> +<short>This function returns True if the directory passed has subdirectories</short> +<descr><printshort id="fpgHasSubDirs"/>.</descr> +</element> + +<element name="fpgConvertLineEndings"> +<short>Replaces all line endings in the string with the native line ending</short> +<descr><printshort id="fpgConvertLineEndings"/>.</descr> +</element> + +<element name="fpgAddColon"> +<short>Appends a colon symbol to the given text</short> +<descr><printshort id="fpgAddColon"/>. This is so that when we support LTR and RTL +languages, the colon will be added at the correct place. Currently the RTL behaviour +has not been implemented yet.</descr> +</element> + +<element name="fpgIsBitSet"> +<short>Read a specific bit value in a LongInt variable</short> +<descr>This procedure allows you to read a specific AIndex bit value from the AData variable.</descr> +<seealso> + <link id="fpgSetBit"/> + <link id="fpgGetBit"/> +</seealso> +<version>Deprecated in v1.4</version> +</element> + +<element name="fpgGetBit"> +<short>Read a specific bit value in a LongInt variable</short> +<descr>This procedure allows you to read a specific ABit bit value from the AData variable.</descr> +<seealso> + <link id="fpgSetBit"/> +</seealso> +<version>Added in v1.4</version> +</element> + +<element name="fpgSetBit"> +<short>Set a specific bit value in a LongInt variable</short> +<descr>This function allows you to set a specific ABit bit value in a the AData variable.</descr> +<seealso> + <link id="fpgGetBit"/> +</seealso> +<version>Added in v1.4</version> +</element> + +<element name="fpgGetToolkitConfigDir"> +<short>Returns the general fpGUI Toolkit config file</short> +<descr><printshort id="fpgGetToolkitConfigDir"/>. This is used to store user defined values +that apply to the whole fpGUI toolkit and applications developed with fpGUI. Things like +directory bookmarks, global themes, fonts etc.</descr> +</element> + +<element name="fpgAllFilesMask"> +<short>Returns the all files mask used to filter files</short> +<descr><printshort id="fpgAllFilesMask"/>. This is used in the File Dialog, File Grid and +many other places. Because FPC 2.2.2 and later contains the ALLFilesMask variable, this +function is now deprecated.</descr> +<version>Deprecated in v1.4</version> +</element> + + + +</module> </package> </fpdoc-descriptions> diff --git a/docs/xml/fpgui_topic_embedded_forms.xml b/docs/xml/fpgui_topic_embedded_forms.xml index 4472ce4d..e3545473 100644 --- a/docs/xml/fpgui_topic_embedded_forms.xml +++ b/docs/xml/fpgui_topic_embedded_forms.xml @@ -14,7 +14,7 @@ in multiple places in your application. <p>At first you will be tempted to design a "frame" using a TfpgForm descendant, because that is what the UI Designer will create for you by default. Please refrain from using TfpgForm descendants as "frames" because there are quite a few pitfalls. -Instead, use TfpgBevel as the base class for a UI Frame design. This eliminates +Instead, use TfpgFrame as the base class for a UI Frame design. This eliminates all the possible problems you might get. You can still use the UI Designer because, the UI Designer simply ignores the base class of any UI design - it only care about what is inside the designer comment markers. @@ -33,7 +33,7 @@ form will most likely be ignored - giving undesired results.</li> </ul> <p> -Simply using TfpgBevel (or soon to appear TfpgFrame) as your base class for embedded forms/frames +Simply using TfpgFrame as your base class for embedded forms/frames will resolve all these issues for you. For an example of this, take a look at the demo project in [fpgui]/examples/embedded_form/ directory. </p> diff --git a/docs/xml/gui/fpg_form.xml b/docs/xml/gui/fpg_form.xml index 6a3027b1..c6c2e3d7 100644 --- a/docs/xml/gui/fpg_form.xml +++ b/docs/xml/gui/fpg_form.xml @@ -25,6 +25,41 @@ horizontally. </short> </element> +<element name="TfpgBaseForm"> +<short>TfpgBaseForm is the base class from which to derive a window such as a form or dialog</short> +<descr><printshort id="TfpgBaseForm"/>.</descr> +</element> + +<element name="TfpgBaseForm.OnCloseQuery"> +<short>Occurs when close is attempted</short> +<descr><p><printshort id="TfpgBaseForm.OnCloseQuery"/>. Use OnCloseQuery to specify the conditions +under which the form can close. An OnCloseQuery event handler returns a Boolean CanClose value +that determines whether a form is allowed to close. Its default value is True.</p> +<p>You can use an OnCloseQuery event handler to ask users if they are sure they really want +the form closed immediately. For example, you can use the handler to display a message box +that prompts the user to save a file before closing the form.</p></descr> +<seealso> +<link id="fpg_form.TfpgBaseForm.OnClose">OnClose</link> +</seealso> +</element> + +<element name="TfpgBaseForm.OnClose"> +<short>Occurs when the form closes</short> +<descr><p><printshort id="TfpgBaseForm.OnClose"/>. Use OnClose to perform special processing when +the form closes. The OnClose event specifies which event handler to call when a form is about +to close. The handler specified by OnClose might, for example, test to make sure all fields in +a data-entry form have valid contents before allowing the form to close.</p> +<p>A form is closed by the Close method or when the user chooses Close from the form's system +menu.</p> +<remark>Closing or hiding the main form terminates the application.</remark></descr> +<seealso> +<link id="fpg_form.TfpgBaseForm.OnCloseQuery">OnCloseQuery</link> +</seealso></element> + +<!-- inherited docs --> +<element name="TfpgForm.OnCloseQuery" link="#fpgui.fpg_form.TfpgBaseForm.OnCloseQuery"></element> +<element name="TfpgForm.OnClose" link="#fpgui.fpg_form.TfpgBaseForm.OnClose"></element> + </module> </package> </fpdoc-descriptions> diff --git a/docs/xml/gui/fpg_panel.xml b/docs/xml/gui/fpg_panel.xml new file mode 100644 index 00000000..ee376026 --- /dev/null +++ b/docs/xml/gui/fpg_panel.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fpdoc-descriptions> +<package name="fpGUI"> + +<module name="fpg_panel"> +<short>This unit defines various panel and frame widgets</short> +<descr><printshort id="#fpgui.fpg_panel"/>. More specifically, it defines +a Panel, Bevel, Frame, ImagePanel and GroupBox control.</descr> + +<element name="TfpgAbstractPanel"> +<short>Base class for a Panel, Bevel etc</short> +<descr><printshort id="TfpgAbstractPanel"/>.</descr> +</element> + +<element name="TfpgBevel"> +<short>Draws a panel with various borders</short> +<descr><printshort id="TfpgBevel"/>. This widget doesn't have a text +label though, unlike TfpgPanel.</descr> +<seealso> + <link id="TfpgPanel"/> +</seealso> +</element> + +<element name="TfpgPanel"> +<short>Draws a panel with various borders and has a text label</short> +<descr><printshort id="TfpgPanel"/>. If you don't need the text label, +then it is recommended that you rather use the TfpgBevel widget.</descr> +<seealso> + <link id="TfpgBevel"/> +</seealso> +</element> + +<element name="TfpgGroupBox"> +<short>Draws a panel width a caption</short> +<descr><p><printshort id="TfpgGroupBox"/>. This is similar in functionality +to the TfpgPanel, but the Text label is drawn in the border of the panel, whereas +in the TfpgPanel in is drawn within the client area.</p> +<p>This widget is frequently used to hold radiobutton groups.</p></descr> +<seealso> + <link id="TfpgPanel"/> +</seealso> +</element> + +<element name="TfpgFrame"> +<short>A panel that acts like an embedded Form</short> +<descr><printshort id="TfpgFrame"/>. This widget should be used (instead of TfpgForm), +if you want to embed a reusable "form" inside other forms. You are able to +design such frames with the UI designer too.</descr> +<seealso> + <link id="#fpgui.fpg_form.TfpgForm">fpg_form.TfpgForm</link> +</seealso> +</element> + +<element name="TfpgImagePanel"> +<short>A panel to display an image</short> +<descr><printshort id="TfpgImagePanel"/>. This was previously done by simply using a +TfpgWidget and implementing the image painting in the OnPaint event. But this class +just saves you a bit of time.</descr> +</element> + + + +</module> +</package> +</fpdoc-descriptions> + diff --git a/docview/components/richtext/CanvasFontManager.pas b/docview/components/richtext/CanvasFontManager.pas index edeb8cb9..e650141b 100644 --- a/docview/components/richtext/CanvasFontManager.pas +++ b/docview/components/richtext/CanvasFontManager.pas @@ -222,7 +222,7 @@ begin // if nothing found, use default font of fpGUI if FontDesc = '' then - FontDesc := fpgApplication.DefaultFont.FontDesc; + FontDesc := fpgStyle.DefaultFont.FontDesc; end; @@ -242,7 +242,7 @@ destructor TCanvasFontManager.Destroy; var i: Integer; begin - FCanvas.Font := fpgApplication.DefaultFont; + FCanvas.Font := fpgStyle.DefaultFont; FDefaultFont.Free; for i := 0 to FFontCache.Count-1 do diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index e0cc3b62..f6582802 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -470,7 +470,7 @@ end; Procedure TRichTextSettings.AssignFont(var AFont: TfpgFont; NewFont: TfpgFont ); begin If NewFont = Nil Then - NewFont := fpgApplication.DefaultFont; + NewFont := fpgStyle.DefaultFont; if FontSame( NewFont, AFont ) then begin diff --git a/docview/images/go-down.bmp b/docview/images/go-down.bmp Binary files differindex 60676d0b..47b2b56c 100644 --- a/docview/images/go-down.bmp +++ b/docview/images/go-down.bmp diff --git a/docview/images/go-next.bmp b/docview/images/go-next.bmp Binary files differindex 1da9e144..4d1d6800 100644 --- a/docview/images/go-next.bmp +++ b/docview/images/go-next.bmp diff --git a/docview/images/go-previous.bmp b/docview/images/go-previous.bmp Binary files differindex 6143639b..f2a908c2 100644 --- a/docview/images/go-previous.bmp +++ b/docview/images/go-previous.bmp diff --git a/docview/images/go-up.bmp b/docview/images/go-up.bmp Binary files differindex 7b916d8f..af8b200a 100644 --- a/docview/images/go-up.bmp +++ b/docview/images/go-up.bmp diff --git a/docview/src/arrows.inc b/docview/src/arrows.inc index bfe510a5..e9d485e3 100644 --- a/docview/src/arrows.inc +++ b/docview/src/arrows.inc @@ -1,380 +1,208 @@ Const - usr_arrow_up : Array[0..1549] of byte = ( - 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, - 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,169,227,197,133,218,175,131,219,174,131, - 222,176,132,223,177,132,224,177,132,223,177,131,221,175, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,169,228,198, 30,189,108, 16,190,102, 18, - 196,106, 19,201,109, 20,203,110, 19,199,108,132,223,177, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,169,228,198, 41,193,116, 16,191,102, 18, - 198,107, 20,204,111, 21,208,113, 19,202,109,132,224,177, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,166,227,196, 56,195,124, 16,189,101, 17, - 195,105, 18,199,107, 19,200,108, 18,198,107,132,223,176, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,165,225,194, 74,199,135, 20,186,102, 16, - 189,101, 16,191,103, 17,192,103, 16,191,102,131,220,175, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, - 58, 4,115, 58, 5,120, 61,162,222,192, 69,193,130, 42,187,114, 14, - 182, 96, 14,184, 97, 14,184, 98, 14,183, 97,130,217,172, 5,121, 62, - 4,115, 58, 4,115, 58, 4,115, 58, 4,118, 58,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 40,138, 88,160,215, - 187,165,219,191,163,219,190,160,220,189, 65,187,125, 58,188,121, 25, - 179,101, 12,176, 92, 12,176, 92, 12,175, 92,129,213,170,128,211,169, - 128,209,168,121,203,160, 31,133, 79, 3,114, 59,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,148, - 100,152,213,181, 81,184,132, 65,181,121, 59,181,119, 52,180,115, 44, - 179,110, 17,170, 92, 10,168, 87, 9,167, 87, 9,166, 86, 23,168, 94, - 114,200,156, 41,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, - 60, 73,161,116,141,209,173, 64,177,119, 52,173,111, 45,172,107, 39, - 171,104, 28,168, 97, 9,161, 83, 7,160, 81, 14,161, 86,106,195,149, - 57,154,104, 3,117, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, - 85, 4,118, 58, 89,172,130,125,202,162, 49,172,108, 40,168,102, 33, - 165, 97, 26,162, 92, 15,158, 84, 8,155, 79, 95,190,141, 72,167,118, - 4,118, 59, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0,118, 59, 3,118, 60,101,182,140,105,194,148, 35,166, 99, 28, - 163, 94, 22,160, 89, 14,157, 84, 80,184,131, 85,178,130, 3,117, 59, - 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 0,114, 62, 9,118, 62,112,191,150, 82,185,133, 24, - 161, 90, 17,158, 86, 67,179,121,100,187,142, 8,120, 61, 7,118, 59, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255, 5,113, 59, 16,124, 69,118,195,156, 58, - 175,114, 53,173,111,109,193,150, 15,123, 68, 4,116, 56,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 24,129, 75,117, - 197,156,114,197,154, 23,131, 75, 5,117, 60,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,118, 59, 34, - 139, 85, 34,141, 85, 3,117, 60,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, - 118, 60, 4,118, 60, 0, 85, 85,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0); + usr_arrow_up: 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,238,238,238,238,238,238,238,238,238,238,238,238, 24,117, + 69, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 24,117, 70,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238, 4,115, 58,165,223, + 193,129,213,170,129,215,171,130,217,172,130,218,173,130,217,173, 4, + 115, 58,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238, 4,115, 58,169,226,197, 22,182, + 101, 15,186, 99, 16,190,102, 17,193,103,131,222,176, 4,115, 58,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238, 4,115, 58,173,228,200, 31,189,109, 16,191, + 102, 18,197,106, 19,201,109,132,227,179, 4,115, 58,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238, 4,115, 58,176,229,202, 49,195,120, 17,192,103, 19,200, + 108, 21,207,113,133,229,180, 4,115, 58,238,238,238,238,238,238,238, + 238,238,238,238,238, 56,123, 89, 4,115, 58, 4,115, 58, 4,115, 58, + 10,119, 63,178,230,203, 75,201,137, 16,189,101, 17,195,105, 18,199, + 107,132,225,178, 11,121, 65, 4,115, 58, 4,115, 58, 4,115, 58, 56, + 123, 89,144,162,153, 45,137, 90,181,224,202,188,229,208,184,229,206, + 179,229,203, 99,205,151, 25,186,104, 15,188,100, 16,190,101,131,220, + 175,130,219,174,130,217,172,123,211,166, 31,131, 79,144,162,153,238, + 238,238, 79,129,103, 88,167,127,176,223,199,119,203,160,108,202,154, + 99,202,150, 67,193,129, 13,179, 94, 13,181, 95, 13,180, 95, 15,178, + 95,106,206,155, 57,154,104, 80,130,104,238,238,238,238,238,238,227, + 227,227, 31,118, 73,127,195,160,151,213,181,105,197,150, 96,197,145, + 86,195,139, 29,176,102, 11,172, 89, 11,171, 89, 77,193,133, 85,179, + 131, 31,118, 73,227,227,227,238,238,238,238,238,238,238,238,238,196, + 199,197, 20,119, 67,156,212,183,122,201,160, 90,190,139, 81,188,134, + 56,180,116, 8,163, 83, 44,175,108,110,195,151, 17,118, 65,196,199, + 197,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,144, + 162,153, 45,136, 89,160,215,187, 95,189,140, 77,182,128, 68,179,122, + 26,162, 92,113,196,154, 35,131, 82,144,162,153,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, 79, + 129,103, 79,163,120,145,210,176, 72,180,125, 63,177,118,106,194,149, + 62,154,107, 80,130,104,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,227,227,227, 31, + 118, 73,114,188,149,114,197,154,106,194,149, 91,178,133, 31,118, 73, + 227,227,227,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,196,199,197, 21, + 120, 68,135,202,167,126,199,162, 21,120, 68,196,199,197,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,144,162,153, 45, + 135, 89, 44,135, 88,144,162,153,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238, 92,135,113, 92, + 135,113,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238); Const - usr_arrow_down : Array[0..1549] of byte = ( - 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, - 109, 54, 5,112, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 57, 35, - 142, 87, 36,149, 90, 3,113, 57,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 22,130, 76,119, - 216,167,120,221,170, 24,137, 79, 5,117, 60,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255, 5,113, 59, 15,123, 68,114,209,161, 57, - 206,131, 59,211,134,117,221,169, 15,126, 69, 4,116, 56,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 0,114, 62, 9,119, 63,102,198,149, 72,204,137, 17, - 195,105, 19,200,108, 74,214,143,105,208,157, 9,122, 63, 7,118, 59, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0,118, 59, 5,119, 60, 94,186,138, 85,201,142, 14,185, 98, 16, - 189,101, 17,193,103, 17,194,104, 87,211,148, 89,193,139, 4,118, 60, - 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, - 85, 4,118, 58, 89,175,131,129,211,169, 19,177, 96, 13,179, 94, 14, - 183, 97, 14,185, 98, 15,186, 99, 15,185, 99,100,208,153, 74,175,123, - 4,119, 60, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, - 60, 73,160,116,144,212,177, 71,186,128, 52,183,116, 15,173, 93, 12, - 175, 92, 12,177, 93, 12,178, 94, 12,177, 93, 18,177, 96,108,204,156, - 57,157,105, 3,118, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,149, - 100,154,213,182, 86,186,134, 70,182,125, 63,182,121, 51,180,114, 24, - 173, 96, 10,169, 88, 10,170, 88, 10,169, 88, 10,168, 87, 23,170, 95, - 114,201,156, 40,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 41,138, 88,163,216, - 189,168,219,193,164,218,190,160,216,187, 65,178,121, 58,178,116, 49, - 176,111, 34,170,101, 9,162, 84, 8,161, 83,126,205,165,126,204,164, - 126,203,163,119,198,158, 29,131, 79, 3,114, 59,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, - 58, 4,115, 58, 5,119, 60,162,217,189, 69,179,123, 60,176,116, 50, - 172,109, 42,168,103, 26,162, 92, 6,154, 78,126,202,163, 5,119, 60, - 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,164,218,190, 71,180,124, 62,176,118, 52, - 173,111, 44,169,105, 35,165, 98, 17,158, 86,126,202,163, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,165,218,191, 73,181,125, 64,177,119, 54, - 173,112, 45,169,105, 36,166, 99, 24,161, 91,126,202,163, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, - 173,112, 46,170,106, 37,166,100, 26,162, 92,127,203,164, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, - 173,112, 46,170,106, 36,166, 99, 26,162, 92,127,203,164, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,115, 58,165,218,191,160,216,187,156,214,184,150, - 212,180,146,210,177,141,208,174,136,206,170,128,203,164, 4,115, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 4,117, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, - 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0); + usr_arrow_down: 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,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238, 92,135,113, 92,135,113,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,144,162,153, 42,137, 88, 42,137, 88,144,162,153,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,196,199,197, 21,121, + 69,116,209,162,117,211,163, 21,122, 69,196,199,197,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,227,227,227, 31,119, 73, 93,190,140, 76,209, + 141, 78,213,144, 95,196,145, 31,119, 74,227,227,227,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238, 79,130,103, 78,168,122,109,214,160, 18,196,105, 20,203, + 110,108,224,165, 66,166,114, 80,130,104,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,144,162,153, + 44,138, 89,148,219,183, 49,195,121, 17,192,103, 18,197,106, 31,201, + 115,120,219,168, 36,135, 84,144,162,153,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,196,199,197, 20,119, 67,144,211,177, + 101,204,152, 59,194,125, 15,185, 98, 15,188,101, 16,189,101, 50,197, + 123,113,206,159, 17,119, 66,196,199,197,238,238,238,238,238,238,238, + 238,238,227,227,227, 31,118, 73,117,190,152,131,209,169, 82,194,137, + 77,195,135, 30,182,105, 13,180, 95, 13,180, 95, 13,179, 94, 78,197, + 137, 85,182,131, 31,118, 73,227,227,227,238,238,238,238,238,238, 79, + 129,103, 81,162,122,155,214,184, 93,190,141, 88,192,138, 81,192,135, + 66,188,126, 12,171, 90, 11,171, 89, 10,170, 89, 12,169, 88,104,199, + 151, 56,152,102, 80,130,104,238,238,238,144,162,153, 44,135, 88,170, + 219,194,175,222,198,173,221,197,170,220,194, 86,189,136, 77,186,130, + 31,170, 99, 8,162, 83,127,206,165,126,205,164,126,204,164,120,199, + 159, 31,129, 78,144,162,153, 56,123, 89, 4,115, 58, 4,115, 58, 4, + 115, 58, 10,117, 62,173,221,197, 89,188,137, 80,184,130, 52,173,111, + 6,154, 78,126,202,163, 10,117, 62, 4,115, 58, 4,115, 58, 4,115, + 58, 56,123, 89,238,238,238,238,238,238,238,238,238,238,238,238, 4, + 115, 58,176,222,199, 93,189,140, 84,185,133, 71,180,124, 6,154, 78, + 126,202,163, 4,115, 58,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238, 4,115, 58,177, + 223,199, 95,190,141, 85,186,134, 65,178,120, 6,154, 78,126,202,163, + 4,115, 58,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238, 4,115, 58,177,223,200, 95, + 190,141, 85,186,134, 55,174,113, 6,154, 78,126,202,163, 4,115, 58, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238, 4,115, 58,176,222,199,171,220,195,166, + 218,191,145,210,177,126,202,163,126,202,163, 4,115, 58,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238, 24,117, 69, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 4,115, 58, 4,115, 58, 24,117, 69,238,238,238,238,238,238, + 238,238,238,238,238,238); Const - usr_arrow_left : Array[0..1549] of byte = ( - 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255, 0,102, 51, 3,110, 55,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, - 89, 45, 27,129, 76, 6,116, 60,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 2,101, 51, 37, - 139, 87,121,206,163, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 54,152,102,117, - 208,161,129,216,172, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 0,102, 51, 3,114, 58, 69,166,117,111,206,157, 28, - 185,105,128,219,173, 9,125, 65, 4,115, 58, 4,115, 58, 4,115, 58, - 4,115, 58, 4,115, 58, 4,115, 59,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 3, 88, 44, 7,118, 60, 83,176,129, 99,198,148, 20,177, 97, 14, - 182, 96,128,221,174,132,225,178,134,230,181,133,229,180,132,225,178, - 131,221,175,130,217,173, 8,118, 60, 0,102, 51,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,109, - 55, 13,121, 66, 97,185,140, 83,187,134, 12,165, 87, 11,172, 90, 13, - 180, 95, 15,187,100, 17,193,104, 18,198,107, 18,197,106, 17,193,103, - 15,186, 99,127,215,170, 8,117, 60, 0,102, 51,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 0,128, 0, 4,116, 58, 21,130, - 73,108,192,149, 68,179,122, 6,154, 78, 7,160, 82, 9,167, 87, 11, - 174, 91, 13,180, 95, 14,184, 98, 15,187,100, 15,187, 99, 14,184, 98, - 13,179, 95,126,212,168, 8,117, 61, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 3,119, 59, 32,138, 84,113,196, - 154, 54,173,112, 13,157, 83, 16,158, 85, 15,158, 84, 15,164, 87, 11, - 167, 87, 10,171, 89, 11,174, 91, 12,176, 92, 12,176, 92, 11,174, 91, - 11,170, 90,132,211,170, 8,117, 61, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255, 3,117, 59, 32,136, 84,116,196, - 155, 62,177,117, 23,161, 90, 28,163, 94, 33,165, 97, 37,167,100, 43, - 171,105, 44,175,107, 40,176,106, 35,175,103, 35,175,103, 41,175,107, - 54,178,114,149,213,180, 8,117, 61, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,116, 58, 22,128, - 73,116,195,154, 85,186,135, 35,166, 99, 40,168,102, 45,170,106, 50, - 172,109, 54,173,112, 58,175,115, 61,176,117, 63,177,118, 65,178,120, - 65,178,120,154,214,184, 9,118, 62, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,114, - 57, 15,123, 68,108,188,148,107,195,150, 49,172,109, 52,173,111, 57, - 175,114, 62,177,118, 66,178,120, 68,179,122, 71,181,125, 73,181,126, - 74,182,127,159,216,187, 10,118, 63, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 5,117, 58, 8,119, 61, 99,182,139,127,203,164, 66,178,120, 65, - 178,120,157,215,185,161,217,188,163,218,190,164,218,191,166,219,192, - 166,219,192,166,219,192, 10,118, 63, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255, 0,118, 59, 4,116, 60, 85,170,126,142,209,175, 82, - 185,132,160,217,188, 11,123, 65, 4,115, 58, 4,115, 58, 4,115, 58, - 4,115, 58, 4,115, 58, 4,117, 59, 0,128, 64,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255, 0,116, 70, 4,117, 59, 69,158,113,152, - 212,181,165,218,191, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255, 0,128, 0, 3,116, 58, 52, - 146, 98,159,214,186, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 5, - 117, 60, 37,136, 84, 7,117, 60, 0,128, 64,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255, 4,115, 57, 4,116, 58, 0,128, 64,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0); + usr_arrow_left: 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,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,145,162,154, 56, + 123, 89,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,227,227,227, 79,130,103, 32,131, 80, 4,115, 58,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,196,199, + 197, 31,119, 74, 58,160,108,125,215,169, 4,115, 58,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,144,162,153, 18,120, 67, 89,195, + 140,110,220,165,131,222,176, 4,115, 58,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 227,227,227, 79,130,103, 36,135, 84,114,213,163, 84,218,151, 21,201, + 110,131,222,176, 10,120, 64, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 24,117, 69,238,238,238,238,238,238,196,199,197, 31,118, 73, + 64,160,110,118,213,165, 51,200,124, 17,194,105, 17,193,103,130,219, + 174,129,216,172,128,212,169,127,207,166,126,202,163,126,202,163, 4, + 115, 58,238,238,238,144,162,153, 21,120, 68, 91,181,134,101,202,150, + 25,181,101, 13,181, 96, 14,183, 97, 14,182, 97, 13,179, 94, 11,173, + 90, 9,166, 86, 7,158, 81, 6,154, 78,126,202,163, 4,115, 58, 92, + 135,113, 44,135, 89,119,196,157, 84,187,135, 34,172,102, 32,175,102, + 23,175, 98, 14,173, 92, 11,172, 89, 10,169, 88, 9,164, 85, 7,158, + 81, 6,154, 78, 6,154, 78,126,202,163, 4,115, 58, 92,135,113, 49, + 138, 91,130,201,165, 99,191,144, 53,173,112, 60,178,117, 66,182,123, + 71,185,127, 66,183,122, 53,176,113, 39,168,101, 29,163, 94, 32,164, + 96, 43,169,104,155,214,184, 4,115, 58,238,238,238,144,162,153, 25, + 123, 72,114,188,150,132,205,167, 77,182,128, 73,181,125, 79,183,130, + 84,185,133, 88,187,136, 89,188,137, 90,188,138, 89,188,137, 88,187, + 136,166,218,191, 4,115, 58,238,238,238,238,238,238,196,199,197, 31, + 118, 73, 86,166,125,151,212,181,106,194,148, 87,186,135, 92,189,139, + 172,221,196,174,222,197,174,222,198,174,222,197,172,221,196,170,220, + 194, 4,115, 58,238,238,238,238,238,238,238,238,238,227,227,227, 79, + 129,103, 50,139, 94,150,210,179,136,207,170,100,192,145,177,223,199, + 10,117, 62, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 24,117, + 69,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,144, + 162,153, 23,121, 70,126,194,159,163,217,189,181,224,202, 4,115, 58, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,196, + 199,197, 31,118, 73, 88,167,127,177,223,200, 4,115, 58,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,227, + 227,227, 79,129,103, 46,137, 90, 4,115, 58,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,145,162,154, 56,123, 89,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238); Const - usr_arrow_right : Array[0..1549] of byte = ( - 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, - 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, - 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 2, - 82, 42,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 30, - 131, 78, 3, 93, 47,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,122, - 207,164, 41,141, 90, 2,102, 51,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,130, - 216,172,118,214,166, 58,159,107, 4,112, 56,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 57, 4,115, - 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 61,131, - 219,174, 31,198,113,114,222,167, 74,180,127, 4,116, 59,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, - 163,126,203,163,126,203,164,127,207,166,129,212,169,130,216,172,131, - 220,175, 17,195,105, 26,204,115,105,223,163, 90,195,142, 9,119, 62, - 2, 86, 44,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, - 163, 6,154, 78, 6,154, 78, 8,161, 82, 10,168, 87, 12,176, 92, 14, - 183, 97, 16,189,101, 17,193,103, 19,194,105, 89,211,149,103,201,152, - 15,125, 68, 4,110, 56,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, - 163, 6,154, 78, 6,154, 78, 6,156, 79, 8,163, 84, 10,169, 88, 12, - 175, 92, 13,179, 94, 14,182, 96, 14,182, 96, 13,180, 95, 71,196,132, - 112,202,156, 22,131, 74, 3,119, 59, 0,128, 0,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,133,205, - 168, 7,154, 79, 6,154, 78, 6,154, 78, 6,156, 79, 8,161, 82, 9, - 165, 85, 12,170, 88, 18,174, 94, 21,175, 96, 22,173, 97, 19,170, 93, - 58,182,119,117,199,157, 34,139, 85, 4,118, 59,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,151,213, - 181, 52,173,111, 40,168,102, 33,165, 97, 33,165, 97, 39,167,102, 45, - 171,107, 46,173,107, 43,173,106, 39,171,104, 34,169,100, 28,165, 95, - 65,178,120,120,198,159, 34,138, 86, 3,117, 59,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,156,215, - 185, 65,178,120, 65,178,120, 65,178,120, 63,177,118, 61,176,117, 58, - 175,115, 54,173,112, 50,172,109, 45,170,106, 40,168,102, 88,188,137, - 120,197,157, 24,129, 75, 4,115, 58,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,160,217, - 188, 74,182,127, 74,182,127, 73,181,126, 71,181,125, 68,179,122, 66, - 178,120, 62,177,118, 58,175,115, 54,174,112,111,197,152,113,191,151, - 16,124, 69, 3,116, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,166,219, - 192,166,219,192,166,219,192,166,219,192,164,218,191,163,218,190,161, - 217,188, 69,180,123, 71,180,124,130,204,166,103,183,141, 9,118, 61, - 5,114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,117, 58, 4,115, - 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 60,165, - 218,191, 87,187,135,144,210,176, 91,173,131, 3,116, 59, 0,118, 55, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169, - 220,193,155,213,183, 74,161,116, 4,116, 59, 0,106, 64,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,164, - 217,190, 57,149,102, 3,118, 60, 0, 85, 85,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 41, - 137, 88, 5,117, 59,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,117, 59, 3, - 114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, - 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, - 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, - 255, 0, 0); + usr_arrow_right: 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,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238, 56,123, 89,144,162,153,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, 4,115, + 58, 31,131, 80, 80,130,104,227,227,227,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238, 4,115, 58,123,211, + 166, 58,159,107, 31,119, 74,196,199,197,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238, 4,115, 58,129,215,171,108,213, + 160, 88,192,138, 18,120, 67,144,162,153,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238, 24,117, 69, 4,115, 58, 4,115, 58, + 4,115, 58, 4,115, 58, 10,119, 63,129,214,171, 17,186,100, 82,211, + 146,115,215,165, 36,137, 85, 79,130,103,227,227,227,238,238,238,238, + 238,238,238,238,238, 4,115, 58,126,202,163,126,202,163,126,202,163, + 126,204,164,127,209,167,129,213,170, 14,183, 97, 16,191,102, 52,203, + 127,120,218,168, 65,164,113, 31,119, 73,196,199,197,238,238,238,238, + 238,238, 4,115, 58,126,202,163, 6,154, 78, 6,154, 78, 6,156, 79, + 8,164, 84, 11,172, 90, 13,179, 94, 14,185, 98, 15,188,100, 28,191, + 108,103,210,156, 93,186,138, 21,121, 69,144,162,153,238,238,238, 4, + 115, 58,126,202,163, 6,154, 78, 6,154, 78, 6,154, 78, 7,160, 82, + 9,167, 87, 11,174, 91, 14,178, 95, 23,184,102, 31,186,108, 38,186, + 111, 85,198,141,118,201,158, 44,135, 88, 92,135,113, 4,115, 58,156, + 215,185, 59,175,116, 51,172,110, 43,169,104, 47,172,107, 61,182,120, + 73,190,130, 80,195,137, 77,196,136, 73,194,132, 68,190,128,109,202, + 155,137,206,170, 52,141, 95, 92,135,113, 4,115, 58,163,217,189, 84, + 185,133, 88,187,136, 91,188,139, 92,189,139, 92,190,140, 92,193,141, + 90,194,141, 85,194,138, 88,195,140,140,212,175,122,194,155, 27,123, + 73,144,162,153,238,238,238, 4,115, 58,167,219,192,170,220,194,173, + 221,197,175,222,198,176,222,199,176,222,199,100,193,145, 97,193,143, + 115,200,157,159,217,187, 91,169,128, 31,118, 73,196,199,197,238,238, + 238,238,238,238, 24,117, 69, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 10,117, 62,182,224,203,111,196,153,145,210,177,156,212,183, + 53,141, 96, 79,129,103,227,227,227,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, 4, + 115, 58,187,227,206,171,220,195,131,197,163, 23,121, 70,144,162,153, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238, 4,115, 58,183, + 225,203, 91,169,130, 31,118, 73,196,199,197,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238, 4,115, 58, 47,138, 90, 80, + 130,104,227,227,227,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238,238, 56,123, 89,144,162,153,238,238,238,238, + 238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, + 238,238,238,238,238,238); diff --git a/docview/src/docdump/docdump.lpr b/docview/src/docdump/docdump.lpr index a642b0c0..db2aac45 100644 --- a/docview/src/docdump/docdump.lpr +++ b/docview/src/docdump/docdump.lpr @@ -35,16 +35,8 @@ procedure TDocDump.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 + if (ParamCount = 0) or HasOption('h','help') then + begin WriteHelp; Terminate; Exit; @@ -84,7 +76,8 @@ end; procedure TDocDump.WriteHelp; begin { add your help code here } - writeln('Usage: ',ExeName,' -h'); + writeln('Usage: ',ExeName,' <INF file>'); + writeln(' -h display this help'); end; var diff --git a/docview/src/docview.project b/docview/src/docview.project new file mode 100644 index 00000000..df16da93 --- /dev/null +++ b/docview/src/docview.project @@ -0,0 +1,38 @@ +[ProjectOptions] +ProjectDir=/home/graemeg/devel/fpgui/example/apps/ide/src/ +ProjectName=docview.project +MainUnit=docview.lpr +TargetFile=docview${EXEEXT} +DefaultMake=0 +UnitOutputDir=units/${TARGET}/ +MakeOptionsCount=4 +MakeOptionEnabled1=1,1,1,1,1,1 +MakeOptionEnabled2=1,1,1,1,1,0 +MakeOptionEnabled3=0,1,0,0,0,1 +MakeOptionEnabled4=0,0,0,0,0,1 +MacroCount=3 +Macro1=TargetCPU=i386 +Macro2=TargetOS=win32 +Macro3=tiOPF_fpGUI_Dir=/home/graemeg/devel/tiopf/ +UnitDirsCount=7 +UnitDirEnabled1=1,1,1,1,0,1,0,1,0,0 +UnitDirEnabled2=1,1,1,1,0,1,1,1,0,0 +UnitDirEnabled3=1,1,1,0,0,1,1,1,0,0 +UnitDirEnabled4=0,0,0,1,0,0,1,1,0,0 +UnitDirEnabled5=1,1,1,1,0,1,1,0,0,0 +UnitDirEnabled6=1,1,1,1,0,1,1,0,0,0 +UnitDirEnabled7=1,1,1,1,0,1,1,0,0,0 +MakeOption1=-l -Mobjfpc -Sch +MakeOption2=-gl -O- +MakeOption3=-B +MakeOption4=-O2 -XX -Xs -CX +UnitDir1=${FPGUIDIR}/src/ +UnitDir2=${FPGUIDIR}/src/corelib/ +UnitDir3=${FPGUIDIR}/src/corelib/x11/ +UnitDir4=${FPGUIDIR}/src/corelib/gdi/ +UnitDir5=${FPGUIDIR}/src/gui/ +UnitDir6=${FPGUIDIR}/src/gui/db/ +UnitDir7=../components/richtext/ + +[Units] +UnitCount=0 diff --git a/docview/src/docview.rc b/docview/src/docview.rc index 749a08de..35c0ade5 100644 --- a/docview/src/docview.rc +++ b/docview/src/docview.rc @@ -1,8 +1,8 @@ MAINICON ICON "../images/docview-48x48.ico" 1 VERSIONINFO -FILEVERSION 1, 2, 0, 0 -PRODUCTVERSION 1, 2, 0, 0 +FILEVERSION 1, 4, 0, 0 +PRODUCTVERSION 1, 4, 0, 0 FILEFLAGSMASK 0 FILEOS 0x40000 FILETYPE 1 @@ -13,12 +13,12 @@ FILETYPE 1 { VALUE "CompanyName", "fpGUI Toolkit" VALUE "FileDescription", "fpGUI's INF Documentation Viewer" - VALUE "FileVersion", "1.2.0" + VALUE "FileVersion", "1.4.0" VALUE "InternalName", "docview" VALUE "LegalCopyright", "GNU Public License" VALUE "OriginalFilename", "docview" VALUE "ProductName", "fpGUI Toolkit" - VALUE "ProductVersion", "1.2.0" + VALUE "ProductVersion", "1.4.0" } } BLOCK "VarFileInfo" diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 802c3600..00a192ea 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -2,9 +2,16 @@ unit frm_main; {$mode objfpc}{$H+} +{$IFDEF WINDOWS} + {$define ABOUT_SYSMENU} +{$ENDIF} + interface uses + {$IFDEF ABOUT_SYSMENU} + Windows, // Used for HMENU to add a new menu to the window System Menu. This feature is just for fun. + {$ENDIF} SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_tab, fpg_tree, fpg_splitter, fpg_menu, fpg_button, fpg_listbox, fpg_label, fpg_edit, fpg_radiobutton, fpg_progressbar, fpg_imagelist, @@ -202,6 +209,7 @@ type // Used in loading contents procedure AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; ALevel: longint; var ATopicIndex: longint ); procedure ClearIndexComponents; + procedure ProcessAboutMsg(var Msg: TfpgMessageRec); message FPGM_ABOUT; // Note manipulations -------------------------------- // make sure that note insert positions are not in @@ -634,6 +642,11 @@ end; procedure TMainForm.MainFormShow(Sender: TObject); var lFilename: TfpgString; + {$IFDEF ABOUT_SYSMENU} + hSysMenu: HMENU; +const + ID_ABOUT = 200001; // Must match the definition in fpg_gdi.pas + {$ENDIF} begin bvlBody.Realign; @@ -660,6 +673,12 @@ begin OpenFile(lFilename, '', true); end; end; + // This is just for fun! ;-) + {$IFDEF ABOUT_SYSMENU} + hSysMenu := GetSystemMenu(self.WinHandle, false); + AppendMenu(hSysMenu, MF_SEPARATOR, 0, nil); + AppendMenu(hSysMenu, MF_STRING, ID_ABOUT, PChar('&About fpGUI Toolkit...')); + {$ENDIF} end; procedure TMainForm.MainFormDestroy(Sender: TObject); @@ -889,7 +908,7 @@ end; procedure TMainForm.miToolsShowEnvVariablesClicked(Sender: TObject); function LGetEnvVarValue(const AVariable: string): string; begin - Result := Format('%s = ''%s''', [AVariable, GetEnvironmentVariable(AVariable)]); + Result := Format('%s = ''%s''', [AVariable, SysUtils.GetEnvironmentVariable(AVariable)]); end; begin RichView.Clear; @@ -2223,6 +2242,11 @@ begin IndexLoaded := False; end; +procedure TMainForm.ProcessAboutMsg(var Msg: TfpgMessageRec); +begin + TfpgMessageDialog.AboutFPGui; +end; + procedure TMainForm.CorrectNotesPositions(Topic: TTopic; AText: pchar); var NoteIndex: longint; @@ -2724,7 +2748,6 @@ begin img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); FImages.AddImage(img); - // load toolbar images fpgImages.AddMaskedBMP( 'dv.arrowleft', @usr_arrow_left, diff --git a/examples/apps/debugserver/frm_main.pas b/examples/apps/debugserver/frm_main.pas index 436a170c..27ac382c 100644 --- a/examples/apps/debugserver/frm_main.pas +++ b/examples/apps/debugserver/frm_main.pas @@ -307,7 +307,7 @@ begin //else // grdMessages.Items.InsertItem(LI, 0); grdMessages.Cells[0, r] := IntToStr(AMsg.MsgType); - grdMessages.Cells[1, r] := FormatDateTime('HH:mm:ss', AMsg.MsgTimeStamp); + grdMessages.Cells[1, r] := FormatDateTime('HH:nn:ss', AMsg.MsgTimeStamp); grdMessages.Cells[2, r] := AMsg.Msg; grdMessages.FocusCol := 0; grdMessages.FocusRow := grdMessages.RowCount-1; diff --git a/examples/apps/fpcunit/fpg_guitestrunner.pas b/examples/apps/fpcunit/fpg_guitestrunner.pas index ca1a7f81..400fa0d1 100644 --- a/examples/apps/fpcunit/fpg_guitestrunner.pas +++ b/examples/apps/fpcunit/fpg_guitestrunner.pas @@ -7,11 +7,10 @@ interface uses SysUtils, Classes, // fpGUI toolkit - fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_basegrid, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, fpg_progressbar, - fpg_radiobutton, fpg_tab, fpg_menu, fpg_panel, fpg_popupcalendar, - fpg_gauge, fpg_splitter, fpg_imagelist, + fpg_base, fpg_main, fpg_form, fpg_label, fpg_button, + fpg_memo, + fpg_dialogs, fpg_tree, fpg_progressbar, + fpg_menu, fpg_panel, fpg_splitter, fpg_imagelist, // FPCUnit support fpcunit, testregistry, testdecorator; @@ -310,6 +309,7 @@ end; procedure TGUITestRunnerForm.btnRunClicked(Sender: TObject); begin + tvTests.FullExpand; if tvTests.Selection = nil then begin TfpgMessageDialog.Critical('No selection', 'Please select a test case first.'); @@ -474,16 +474,6 @@ begin SetPosition(305, 196, 530, 547); WindowTitle := 'GUI Test Runner'; - bvlTree := TfpgBevel.Create(self); - with bvlTree do - begin - Name := 'bvlTree'; - SetPosition(4, 8, 512, 364); - Shape := bsSpacer; - MinHeight := 200; - Align := alClient; - end; - bvlButtons := TfpgBevel.Create(self); with bvlButtons do begin @@ -511,6 +501,16 @@ begin Align := alBottom; end; + bvlTree := TfpgBevel.Create(self); + with bvlTree do + begin + Name := 'bvlTree'; + SetPosition(4, 8, 512, 364); + Shape := bsSpacer; + MinHeight := 200; + Align := alClient; + end; + pbName1 := TfpgProgressBar.Create(bvlTree); with pbName1 do begin diff --git a/examples/apps/ide/TODO b/examples/apps/ide/TODO index 9a90c33e..72b9f0db 100644 --- a/examples/apps/ide/TODO +++ b/examples/apps/ide/TODO @@ -1,6 +1,6 @@ Personal todo list for fpGUI IDE project - + Legend ====== @@ -22,8 +22,8 @@ fpGUI IDE [ ] Assembly window [ ] CPU window [x] Syntax highlighting with descent speed. -[ ] Basic Search dialog -[x] Find in Files dialog +[x] Basic Search dialog +[ ] Find in Files dialog [ ] Regex support in all search dialogs [ ] External Tools setup and usage [ ] Keyboard Shortcuts dialog @@ -36,7 +36,7 @@ fpGUI IDE [ ] Unit Testing framework integration (with DUnit2 project) [ ] Code Templates support [o] File Browser tabsheet implementation. File navigation and opening of files. -[ ] GoTo Line Number dialog +[x] GoTo Line Number dialog [ ] Converting all UI to MiG Layout Manager based dialogs. [ ] TextEdit: enable line drawing functionality. eg: some key combination with the cursor (arrow) keys allows line drawing. Double and single line diff --git a/examples/apps/ide/src/extrafpc.cfg b/examples/apps/ide/src/extrafpc.cfg index 2132065d..7d50b94c 100644 --- a/examples/apps/ide/src/extrafpc.cfg +++ b/examples/apps/ide/src/extrafpc.cfg @@ -1,9 +1,6 @@ --FUunits +-FUunits/$fpctarget -Fu../../../../lib/$fpctarget -Fi. --Xs --XX --CX #ifdef mswindows -WG #endif diff --git a/examples/apps/ide/src/fpg_textedit.pas b/examples/apps/ide/src/fpg_textedit.pas index 3e88f3d1..6acea537 100644 --- a/examples/apps/ide/src/fpg_textedit.pas +++ b/examples/apps/ide/src/fpg_textedit.pas @@ -1583,17 +1583,20 @@ begin ckCopy: begin CopyToClipboard; + consumed := True; end; ckPaste: begin // if not ReadOnly then PasteFromClipboard; + consumed := True; end; ckCut: begin CutToClipboard; + consumed := True; end; end; @@ -1611,6 +1614,8 @@ begin SLine := FLines[CaretPos.Y]; + if not consumed then + begin case keycode of keyBackspace: begin @@ -1728,7 +1733,8 @@ begin end; consumed := True; end; - end; + end; // case keycode + end; // if not consumed if CaretScroll then begin diff --git a/examples/apps/ide/src/frm_configureide.pas b/examples/apps/ide/src/frm_configureide.pas index fad0418f..51061a42 100644 --- a/examples/apps/ide/src/frm_configureide.pas +++ b/examples/apps/ide/src/frm_configureide.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -229,7 +229,6 @@ constructor TConfigureIDEForm.Create(AOwner: TComponent); begin inherited Create(AOwner); FInternalMacroList := TIDEMacroList.Create; - OnKeyPress := @FormKeyPressed; end; destructor TConfigureIDEForm.Destroy; @@ -248,6 +247,7 @@ begin Hint := ''; ShowHint := True; WindowPosition := wpOneThirdDown; + OnKeyPress := @FormKeyPressed; btnCancel := TfpgButton.Create(self); with btnCancel do diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index fe903c31..8a8f3c12 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -118,6 +118,7 @@ type procedure AddUnitToProject(const AUnitName: TfpgString); procedure miProjectAddUnitToProject(Sender: TObject); procedure tvProjectDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure tvProjectKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); procedure grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean); procedure TabSheetClosing(Sender: TObject; ATabSheet: TfpgTabSheet); procedure BuildTerminated(Sender: TObject); @@ -541,18 +542,18 @@ var r: TfpgTreeNode; n: TfpgTreeNode; begin - u := TUnit.Create; - u.FileName := AUnitName; - u.Opened := True; - GProject.UnitList.Add(u); - // add reference to tabsheet - pcEditor.ActivePage.TagPointer := u; - s := fpgExtractRelativepath(GProject.ProjectDir, u.FileName); - r := GetUnitsNode; - n := r.AppendText(s); - // add reference to treenode - n.Data := u; - tvProject.Invalidate; + u := GProject.UnitList.AddFilename(AUnitName); + if Assigned(n) then + begin + // add reference to tabsheet + pcEditor.ActivePage.TagPointer := u; + s := u.GetRelativePath; + r := GetUnitsNode; + n := r.AppendText(s); + // add reference to treenode + n.Data := u; + tvProject.Invalidate; + end; end; procedure TMainForm.miProjectAddUnitToProject(Sender: TObject); @@ -587,6 +588,38 @@ begin end; end; +procedure TMainForm.tvProjectKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); +var + r: TfpgTreeNode; + n: TfpgTreeNode; + i: integer; +begin + if keyCode = keyDelete then + begin + r := GetUnitsNode; + if r.FindSubNode(tvProject.Selection.Text, False) = tvProject.Selection then + begin + // remove from project, then from tree view + n := tvProject.Selection; + tvProject.GotoNextNodeUp; + r.Remove(n); + tvProject.Invalidate; + GProject.UnitList.Remove(TUnit(n.Data)); + + for i := 0 to pcEditor.PageCount-1 do + begin + if pcEditor.Pages[i].TagPointer = n.Data then + begin + pcEditor.Pages[i].TagPointer := nil; + break + end; + end; + TUnit(n.Data).Free; + n.Free; + end; + end; +end; + procedure TMainForm.grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean); var cr: TClipboardKeyType; @@ -1478,6 +1511,7 @@ begin Hint := ''; TabOrder := 20; OnDoubleClick := @tvProjectDoubleClick; + OnKeyPress := @tvProjectKeyPressed; end; tsFiles := TfpgTabSheet.Create(pnlTool); @@ -1597,7 +1631,7 @@ begin begin Name := 'mnuProject'; SetPosition(476, 140, 172, 20); - AddMenuItem('Options...', rsKeyCtrl+rsKeyShift+'O', @miProjectOptions); + AddMenuItem('Options...', rsKeyCtrl+rsKeyShift+'F11', @miProjectOptions); AddMenuItem('-', '', nil); AddMenuItem('New (empty)...', '', @miProjectNew); AddMenuItem('New from Template...', '', @miProjectNewFromTemplate); diff --git a/examples/apps/ide/src/frm_projectoptions.pas b/examples/apps/ide/src/frm_projectoptions.pas index 1e1c318a..a3e43d6a 100644 --- a/examples/apps/ide/src/frm_projectoptions.pas +++ b/examples/apps/ide/src/frm_projectoptions.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -103,6 +103,7 @@ type procedure CleanupCompilerDirs; procedure CleanupUserMacrosGrid; procedure SaveToMacroList(AList: TIDEMacroList); + procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -582,6 +583,12 @@ begin // AList.SetValue(cMacro_FPCSrcDir, edtFPCSrcDir.Directory); end; +procedure TProjectOptionsForm.FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEscape then + Close; +end; + constructor TProjectOptionsForm.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -603,6 +610,7 @@ begin WindowTitle := 'Project Options'; Hint := ''; ShowHint := True; + OnKeyPress := @FormKeyPressed; btnCancel := TfpgButton.Create(self); with btnCancel do diff --git a/examples/apps/ide/src/maximus.lpi b/examples/apps/ide/src/maximus.lpi index accb3570..01a377d7 100644 --- a/examples/apps/ide/src/maximus.lpi +++ b/examples/apps/ide/src/maximus.lpi @@ -42,7 +42,6 @@ <Unit0> <Filename Value="maximus.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="maximus"/> </Unit0> <Unit1> <Filename Value="frm_main.pas"/> @@ -52,7 +51,6 @@ <Unit2> <Filename Value="frm_configureide.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="frm_configureide"/> </Unit2> <Unit3> <Filename Value="ideconst.pas"/> @@ -67,7 +65,6 @@ <Unit5> <Filename Value="frm_debug.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="frm_debug"/> </Unit5> <Unit6> <Filename Value="project.pas"/> @@ -77,7 +74,6 @@ <Unit7> <Filename Value="unitlist.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="UnitList"/> </Unit7> <Unit8> <Filename Value="frm_projectoptions.pas"/> @@ -97,47 +93,42 @@ <Unit11> <Filename Value="ideimages.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="ideimages"/> </Unit11> <Unit12> <Filename Value="stringhelpers.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="stringhelpers"/> </Unit12> <Unit13> <Filename Value="frm_procedurelist.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="frm_procedurelist"/> </Unit13> <Unit14> - <Filename Value="mpaslex.pas"/> + <Filename Value="filemonitor.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="mPasLex"/> + <UnitName Value="filemonitor"/> </Unit14> <Unit15> - <Filename Value="filemonitor.pas"/> + <Filename Value="synregexpr.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="filemonitor"/> </Unit15> <Unit16> - <Filename Value="synregexpr.pas"/> + <Filename Value="fpg_textedit.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="SynRegExpr"/> + <UnitName Value="fpg_textedit"/> </Unit16> <Unit17> - <Filename Value="fpg_textedit.pas"/> + <Filename Value="frm_find.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="fpg_textedit"/> </Unit17> <Unit18> - <Filename Value="frm_find.pas"/> + <Filename Value="sha1.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="frm_find"/> + <UnitName Value="Sha1"/> </Unit18> <Unit19> - <Filename Value="sha1.pas"/> + <Filename Value="mPasLex.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="Sha1"/> + <UnitName Value="mPasLex"/> </Unit19> </Units> </ProjectOptions> @@ -162,11 +153,7 @@ </Optimizations> </CodeGeneration> <Other> - <CompilerMessages> - <UseMsgFile Value="True"/> - </CompilerMessages> <CustomOptions Value="-dDEBUGSVRx"/> - <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> </CONFIG> diff --git a/examples/apps/ide/src/maximus.lpr b/examples/apps/ide/src/maximus.lpr index cf9c439f..13a2047e 100644 --- a/examples/apps/ide/src/maximus.lpr +++ b/examples/apps/ide/src/maximus.lpr @@ -39,7 +39,6 @@ uses ideimages, stringhelpers, frm_procedurelist, - mPasLex, filemonitor, SynRegExpr, fpg_textedit, diff --git a/examples/apps/ide/src/unitlist.pas b/examples/apps/ide/src/unitlist.pas index 827326e7..e6c09a69 100644 --- a/examples/apps/ide/src/unitlist.pas +++ b/examples/apps/ide/src/unitlist.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -31,6 +31,7 @@ type function GetUnitName: TfpgString; public constructor Create; + function GetRelativePath: TfpgString; property FileName: TfpgString read FFilename write FFilename; property UnitName: TfpgString read GetUnitName; property Opened: Boolean read FOpened write FOpened; @@ -48,6 +49,8 @@ type function Count: integer; function FindByName(const AUnitName: TfpgString): TUnit; function FileExists(const AFilename: TfpgString): Boolean; + function AddFileName(const AFilename: TfpgString): TUnit; + function Remove(AUnit: TUnit): integer; procedure Add(NewUnit: TUnit); procedure Clear; procedure Delete(AIndex: integer); @@ -58,7 +61,8 @@ type implementation uses - fpg_utils; + fpg_utils, + project; { TUnitList } @@ -128,6 +132,25 @@ begin end; end; +function TUnitList.AddFileName(const AFilename: TfpgString): TUnit; +var + u: TUnit; +begin + if not FileExists(AFilename) then + begin + u := TUnit.Create; + u.FileName := AFilename; + u.Opened := True; + Add(u); + Result := u; + end; +end; + +function TUnitList.Remove(AUnit: TUnit): integer; +begin + Result := FList.Remove(AUnit); +end; + procedure TUnitList.Add(NewUnit: TUnit); var l: Integer; @@ -176,6 +199,11 @@ begin Result := fpgExtractFileName(Filename); end; +function TUnit.GetRelativePath: TfpgString; +begin + Result := fpgExtractRelativepath(GProject.ProjectDir, FileName); +end; + constructor TUnit.Create; begin inherited Create; diff --git a/examples/apps/ide/src/units/i386-freebsd/.gitignore b/examples/apps/ide/src/units/i386-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/i386-linux/.gitignore b/examples/apps/ide/src/units/i386-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/i386-win32/.gitignore b/examples/apps/ide/src/units/i386-win32/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-win32/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/x86_64-freebsd/.gitignore b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/x86_64-linux/.gitignore b/examples/apps/ide/src/units/x86_64-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/x86_64-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/colorwheel/colorwheel_test.lpi b/examples/gui/colorwheel/colorwheel_test.lpi index 3ad6b196..a0be0fc2 100644 --- a/examples/gui/colorwheel/colorwheel_test.lpi +++ b/examples/gui/colorwheel/colorwheel_test.lpi @@ -38,7 +38,6 @@ <Unit0> <Filename Value="colorwheel_test.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="colorwheel_test"/> </Unit0> <Unit1> <Filename Value="frm_main.pas"/> @@ -64,8 +63,5 @@ <UseAnsiStrings Value="False"/> </SyntaxOptions> </Parsing> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> </CONFIG> diff --git a/examples/gui/colorwheel/frm_main.pas b/examples/gui/colorwheel/frm_main.pas index 3633b740..612ea6c1 100644 --- a/examples/gui/colorwheel/frm_main.pas +++ b/examples/gui/colorwheel/frm_main.pas @@ -8,10 +8,34 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_widget, fpg_edit, fpg_form, fpg_label, fpg_button, fpg_dialogs, fpg_menu, fpg_checkbox, - fpg_panel, fpg_ColorWheel; + fpg_panel, fpg_ColorWheel, fpg_spinedit; type + TColorPickedEvent = procedure(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor) of object; + + + TPickerButton = class(TfpgButton) + private + FContinuousResults: Boolean; + FOnColorPicked: TColorPickedEvent; + FColorPos: TPoint; + FColor: TfpgColor; + FColorPicking: Boolean; + private + procedure DoColorPicked; + protected + 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; + public + constructor Create(AOwner: TComponent); override; + published + property ContinuousResults: Boolean read FContinuousResults write FContinuousResults; + property OnColorPicked: TColorPickedEvent read FOnColorPicked write FOnColorPicked; + end; + + TMainForm = class(TfpgForm) private {@VFD_HEAD_BEGIN: MainForm} @@ -28,36 +52,134 @@ type Label4: TfpgLabel; Label5: TfpgLabel; Label6: TfpgLabel; - edR: TfpgEdit; - edG: TfpgEdit; - edB: TfpgEdit; + edR: TfpgSpinEdit; + edG: TfpgSpinEdit; + edB: TfpgSpinEdit; + lblHex: TfpgLabel; Label7: TfpgLabel; Label8: TfpgLabel; Bevel2: TfpgBevel; Label9: TfpgLabel; chkCrossHair: TfpgCheckBox; chkBGColor: TfpgCheckBox; + btnPicker: TPickerButton; + chkContinuous: TfpgCheckBox; {@VFD_HEAD_END: MainForm} FViaRGB: Boolean; // to prevent recursive changes - procedure btnQuitClicked(Sender: TObject); - procedure chkCrossHairChange(Sender: TObject); - procedure chkBGColorChange(Sender: TObject); - procedure UpdateHSVComponents; - procedure UpdateRGBComponents; - procedure ColorChanged(Sender: TObject); - procedure RGBChanged(Sender: TObject); + FColorPicking: Boolean; + procedure btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor); + procedure chkContinuousChanged(Sender: TObject); + procedure btnQuitClicked(Sender: TObject); + procedure chkCrossHairChange(Sender: TObject); + procedure chkBGColorChange(Sender: TObject); + procedure UpdateHSVComponents; + procedure UpdateRGBComponents; + procedure ColorChanged(Sender: TObject); + procedure RGBChanged(Sender: TObject); public constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; + procedure AfterCreate; override; end; {@VFD_NEWFORM_DECL} implementation - {@VFD_NEWFORM_IMPL} +function ConvertToHexa(Value: Integer): string; +var + ValH,ValL: Integer; +begin +ValH:= Value div 16; +ValL:= Value mod 16; +case ValH of + 15: + Result:= 'F'; + 14: + Result:= 'E'; + 13: + Result:= 'D'; + 12: + Result:= 'C'; + 11: + Result:= 'B'; + 10: + Result:= 'A'; + else + Result:= IntToStr(ValH); + end; +case ValL of + 15: + Result:= Result+'F'; + 14: + Result:= Result+'E'; + 13: + Result:= Result+'D'; + 12: + Result:= Result+'C'; + 11: + Result:= Result+'B'; + 10: + Result:= Result+'A'; + else + Result:= Result+IntToStr(ValL); + end; +end; + +function Hexa(Red,Green,Blue: Integer): string; +begin +Result:= '$'+ConvertToHexa(Red)+ConvertToHexa(Green)+ConvertToHexa(Blue); +end; + +{ TPickerButton } + +procedure TPickerButton.DoColorPicked; +var + pt: TPoint; +begin + pt := WindowToScreen(self, FColorPos); + FColor := fpgApplication.GetScreenPixelColor(pt); + if Assigned(FOnColorPicked) then + FOnColorPicked(self, FColorPos, FColor); +end; + +procedure TPickerButton.HandleLMouseDown(X, Y: integer; ShiftState: TShiftState); +begin + inherited HandleLMouseDown(X, Y, ShiftState); + MouseCursor := mcCross; + FColorPicking := True; + CaptureMouse; +end; + +procedure TPickerButton.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleLMouseUp(x, y, shiftstate); + ReleaseMouse; + FColorPicking := False; + MouseCursor := mcDefault; + DoColorPicked; +end; + +procedure TPickerButton.HandleMouseMove(x, y: integer; btnstate: word; + shiftstate: TShiftState); +begin + //inherited HandleMouseMove(x, y, btnstate, shiftstate); + if not FColorPicking then + Exit; + FColorPos.x := x; + FColorPos.y := y; + if FContinuousResults then + DoColorPicked; +end; + +constructor TPickerButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FColorPicking := False; + FContinuousResults := False; +end; + procedure TMainForm.ColorChanged(Sender: TObject); begin UpdateHSVComponents; @@ -71,18 +193,30 @@ var c: TfpgColor; begin FViaRGB := True; // revent recursive updates - rgb.Red := StrToInt(edR.Text); - rgb.Green := StrToInt(edG.Text); - rgb.Blue := StrToInt(edB.Text); + rgb.Red := edR.Value; + rgb.Green := edG.Value; + rgb.Blue := edB.Value; c := RGBTripleTofpgColor(rgb); ColorWheel1.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event FViaRGB := False; + lblHex.Text:= 'Hex = '+ Hexa(rgb.Red,rgb.Green,rgb.Blue); end; constructor TMainForm.Create(AOwner: TComponent); begin inherited Create(AOwner); FViaRGB := False; + FColorPicking := False; +end; + +procedure TMainForm.btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor); +begin + ColorWheel1.SetSelectedColor(AColor); +end; + +procedure TMainForm.chkContinuousChanged(Sender: TObject); +begin + btnPicker.ContinuousResults := chkContinuous.Checked; end; procedure TMainForm.btnQuitClicked(Sender: TObject); @@ -127,9 +261,10 @@ var begin c := ValueBar1.SelectedColor; rgb := fpgColorToRGBTriple(c); - edR.Text := IntToStr(rgb.Red); - edG.Text := IntToStr(rgb.Green); - edB.Text := IntToStr(rgb.Blue); + edR.Value := rgb.Red; + edG.Value := rgb.Green; + edB.Value := rgb.Blue; + lblHex.Text:= 'Hex = '+ Hexa(rgb.Red,rgb.Green,rgb.Blue); end; procedure TMainForm.AfterCreate; @@ -138,6 +273,7 @@ begin Name := 'MainForm'; SetPosition(349, 242, 537, 411); WindowTitle := 'ColorWheel test app'; + Hint := ''; WindowPosition := wpUser; Button1 := TfpgButton.Create(self); @@ -166,6 +302,7 @@ begin begin Name := 'ValueBar1'; SetPosition(304, 20, 52, 244); + Value := 1; OnChange := @ColorChanged; end; @@ -174,6 +311,7 @@ begin begin Name := 'Bevel1'; SetPosition(20, 288, 76, 56); + Hint := ''; end; Label1 := TfpgLabel.Create(self); @@ -275,39 +413,55 @@ begin Text := 'Blue'; end; - edR := TfpgEdit.Create(self); + edR := TfpgSpinEdit.Create(self); with edR do begin Name := 'edR'; SetPosition(296, 280, 44, 26); TabOrder := 13; - Text := '255'; + MinValue := 0; + MaxValue := 255; + Value := 255; FontDesc := '#Edit1'; OnExit := @RGBChanged; end; - edG := TfpgEdit.Create(self); + edG := TfpgSpinEdit.Create(self); with edG do begin Name := 'edG'; SetPosition(296, 308, 44, 26); TabOrder := 14; - Text := '255'; + MinValue := 0; + MaxValue := 255; + Value := 255; FontDesc := '#Edit1'; OnExit := @RGBChanged; end; - edB := TfpgEdit.Create(self); + edB := TfpgSpinEdit.Create(self); with edB do begin Name := 'edB'; SetPosition(296, 336, 44, 26); TabOrder := 15; - Text := '255'; + MinValue := 0; + MaxValue := 255; + Value := 255; FontDesc := '#Edit1'; OnExit := @RGBChanged; end; + lblHex := TfpgLabel.Create(self); + with lblHex do + begin + Name := 'lblHex'; + SetPosition(380, 316, 120, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Hex = '; + end; + Label7 := TfpgLabel.Create(self); with Label7 do begin @@ -333,6 +487,7 @@ begin begin Name := 'Bevel2'; SetPosition(388, 8, 2, 260); + Hint := ''; Style := bsLowered; end; @@ -353,6 +508,7 @@ begin Name := 'chkCrossHair'; SetPosition(396, 32, 128, 20); FontDesc := '#Label1'; + Hint := ''; TabOrder := 20; Text := 'Large CrossHair'; OnChange := @chkCrossHairChange; @@ -364,11 +520,37 @@ begin Name := 'chkBGColor'; SetPosition(396, 56, 132, 20); FontDesc := '#Label1'; + Hint := ''; TabOrder := 21; Text := 'New BG Color'; OnChange := @chkBGColorChange; end; + btnPicker := TPickerButton.Create(self); + with btnPicker do + begin + Name := 'btnPicker'; + SetPosition(116, 372, 80, 23); + Text := 'Picker'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 24; + OnColorPicked := @btnColorPicked; + end; + + chkContinuous := TfpgCheckBox.Create(self); + with chkContinuous do + begin + Name := 'chkContinous'; + SetPosition(205, 375, 90, 19); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 25; + Text := 'Continous'; + OnChange := @chkContinuousChanged; + end; + {@VFD_BODY_END: MainForm} // link the two components @@ -376,6 +558,9 @@ begin // ColorWheel1.BackgroundColor := clFuchsia; // ValueBar1.BackgroundColor := clFuchsia; // ColorWheel1.CursorSize := 400; + UpdateHSVComponents; + if not FViaRGB then + UpdateRGBComponents; end; diff --git a/examples/gui/customwindow/close.bmp b/examples/gui/customwindow/close.bmp Binary files differnew file mode 100644 index 00000000..af6745a5 --- /dev/null +++ b/examples/gui/customwindow/close.bmp diff --git a/examples/gui/customwindow/custom_window.lpi b/examples/gui/customwindow/custom_window.lpi new file mode 100644 index 00000000..2059fa29 --- /dev/null +++ b/examples/gui/customwindow/custom_window.lpi @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <General> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="custom_window"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="custom_window.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="custom_window"/> + </Unit0> + <Unit1> + <Filename Value="images.inc"/> + <IsPartOfProject Value="True"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + </SearchPaths> + </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/customwindow/custom_window.lpr b/examples/gui/customwindow/custom_window.lpr new file mode 100644 index 00000000..eab06e5d --- /dev/null +++ b/examples/gui/customwindow/custom_window.lpr @@ -0,0 +1,352 @@ +{ This was a very quick and dirty demo to show how custom windows with your + own style of borders (eg: like Chrome or elementryOS) can be implement. + There is obviously lots of scope for improving this code and creating + custom widgets to make better use of code reuse and abstraction. } +program custom_window; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + fpg_base, fpg_main, fpg_form, fpg_button, + fpg_stylemanager, fpg_cmdlineparams, fpg_grid, + fpg_StringGridBuilder, fpg_editbtn, fpg_checkbox, + fpg_panel, fpg_dialogs; + +type + + TMainForm = class(TfpgForm) + procedure ResizeClicked(Sender: TObject); + private + {@VFD_HEAD_BEGIN: MainForm} + btnQuit: TfpgButton; + Grid1: TfpgStringGrid; + FilenameEdit1: TfpgFileNameEdit; + btnGo: TfpgButton; + CheckBox1: TfpgCheckBox; + bvlTitle: TfpgBevel; + btnClose: TfpgImagePanel; + btnResize: TfpgImagePanel; + bvlTasks: TfpgBevel; + {@VFD_HEAD_END: MainForm} + FLastPos: TPoint; + FMouseTracked: Boolean; + procedure TitleMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure TitleMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure TitleMouseMoved(Sender: TObject; AShift: TShiftState; const AMousePos: TPoint); + procedure btnCloseClicked(Sender: TObject); + procedure PaintTasksPanel(Sender: TObject); + procedure PaintTitle(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure btnQuitClicked(Sender: TObject); + procedure btnGoClicked(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +const + cBackground = TfpgColor($FFf5f5f5); + cGradientTop = TfpgColor($FFe5e5e5); + cGradientBottom = TfpgColor($FFbcbcbc); + cBorder = TfpgColor($FF7c7c7c); + cGrayPanel = TfpgColor($FFdedede); + + { tip: probably best to use specific fonts for specific OSes } + cHeader1 = 'Arial-11:bold:antialias=true'; + cHeader2 = 'Arial-10:antialias=true'; + +{$I images.inc} + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.ResizeClicked(Sender: TObject); +begin + ShowMessage('I''ll leave this one up to you to implement and experiment with. ;-)', 'Hint'); +end; + +procedure TMainForm.TitleMouseDown(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + FMouseTracked := True; + FLastPos := bvlTitle.WindowToScreen(self, AMousePos); + bvlTitle.CaptureMouse; +end; + +procedure TMainForm.TitleMouseUp(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + FMouseTracked := False; + bvlTitle.ReleaseMouse; +end; + +procedure TMainForm.TitleMouseMoved(Sender: TObject; AShift: TShiftState; + const AMousePos: TPoint); +var + dx, dy: integer; + pt: TPoint; +begin + pt := WindowToScreen(self, AMousePos); + if not FMouseTracked then + begin + FLastPos := pt; + Exit; + end; + + dx := pt.X - FLastPos.X; + dy := pt.Y - FLastPos.Y; + Left := Left + dx; + Top := Top + dy; + FLastPos := pt; + UpdateWindowPosition; +end; + +procedure TMainForm.btnCloseClicked(Sender: TObject); +begin + btnQuit.Click; +end; + +procedure TMainForm.PaintTasksPanel(Sender: TObject); +begin + with bvlTasks do + begin + Canvas.Clear(cGrayPanel); + + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); + + Canvas.TextColor := cBorder; + // Output some sample text + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(8, 10, 'Personal'); + Canvas.Font := fpgGetFont(cHeader2); + Canvas.DrawText(20, 30, 'Home'); + Canvas.DrawText(20, 50, 'Documents'); + Canvas.DrawText(20, 70, 'Music'); + Canvas.DrawText(20, 90, 'Pictures'); + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(8, 110, 'Network'); + Canvas.Font := fpgGetFont(cHeader2); + Canvas.DrawText(20, 130, 'Entire network'); + end; +end; + +procedure TMainForm.PaintTitle(Sender: TObject); +var + r: TfpgRect; +begin + r.SetRect(0, 1, Width, 46); + with bvlTitle do + begin + Canvas.GradientFill(r, cGradientTop, cGradientBottom, gdVertical); + + Canvas.Color := TfpgColor($FFc9c9c9); + Canvas.DrawLine(0, Height-2, Width, Height-2); + + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); + + Canvas.TextColor := cBorder; + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(30, 8, Width-60, 20, WindowTitle, [txtHCenter, txtTop]); + end; +end; + +procedure TMainForm.FormPaint(Sender: TObject); +begin + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); +end; + +procedure TMainForm.btnQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.btnGoClicked(Sender: TObject); +var + sgb: TStringGridBuilder; +begin + try + sgb := TStringGridBuilder.CreateCustom(Grid1, FilenameEdit1.FileName, CheckBox1.Checked); + sgb.Run; + finally + sgb.Free; + end; +end; + +constructor TMainForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Include(FWindowAttributes, waBorderLess); // borderless and steals focus like a normal form + FMouseTracked := False; + + fpgSetNamedColor(clWindowBackground, cBackground); + + fpgImages.AddBMP( // 8x9 pixels. + 'my.close', + @img_close, + sizeof(img_close)); + + fpgImages.AddBMP( // 10x11 pixels. + 'my.resize', + @img_resize, + sizeof(img_resize)); +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(464, 271, 866, 473); + WindowTitle := 'fpGUI Custom Window Demo'; + Hint := ''; + OnPaint := @FormPaint; + + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(772, 436, 80, 23); + Text := 'Quit'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnQuitClicked; + end; + + Grid1 := TfpgStringGrid.Create(self); + with Grid1 do + begin + Name := 'Grid1'; + SetPosition(182, 120, 666, 276); + BackgroundColor := TfpgColor($80000002); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := False; + TabOrder := 2; + end; + + FilenameEdit1 := TfpgFileNameEdit.Create(self); + with FilenameEdit1 do + begin + Name := 'FilenameEdit1'; + SetPosition(182, 92, 510, 24); + ExtraHint := ''; + FileName := ''; + Filter := 'CSV Files (*.csv)|*.csv'; + InitialDir := ''; + TabOrder := 3; + end; + + btnGo := TfpgButton.Create(self); + with btnGo do + begin + Name := 'btnGo'; + SetPosition(768, 92, 80, 23); + Text := 'GO'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick := @btnGoClicked; + end; + + CheckBox1 := TfpgCheckBox.Create(self); + with CheckBox1 do + begin + Name := 'CheckBox1'; + SetPosition(184, 68, 120, 19); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 5; + Text := 'Has Header'; + end; + + bvlTitle := TfpgBevel.Create(self); + with bvlTitle do + begin + Name := 'bvlTitle'; + SetPosition(0, 0, 866, 48); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Shape := bsSpacer; + OnPaint := @PaintTitle; + OnMouseMove := @TitleMouseMoved; + OnMouseDown := @TitleMouseDown; + OnMouseUp := @TitleMouseUp; + end; + + btnClose := TfpgImagePanel.Create(bvlTitle); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(9, 8, 8, 9); + OwnsImage := False; + OnClick := @btnCloseClicked; + end; + + btnResize := TfpgImagePanel.Create(bvlTitle); + with btnResize do + begin + Name := 'btnResize'; + SetPosition(849, 8, 10, 11); + OwnsImage := False; + OnClick := @ResizeClicked; + end; + + bvlTasks := TfpgBevel.Create(self); + with bvlTasks do + begin + Name := 'bvlTasks'; + SetPosition(0, 47, 170, 426); + Anchors := [anLeft,anTop,anBottom]; + Hint := ''; + Shape := bsSpacer; + OnPaint := @PaintTasksPanel; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + btnClose.Image := fpgImages.GetImage('my.close'); + btnResize.Image := fpgImages.GetImage('my.resize'); +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + + { Set our new style as the default (before we create any forms), unless + a the end-user specified a different style via the command line. } + if not gCommandLineParams.IsParam('style') then + begin + if fpgStyleManager.SetStyle('Plastic Light Gray') then + fpgStyle := fpgStyleManager.Style; + end; + + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/gui/customwindow/extrafpc.cfg b/examples/gui/customwindow/extrafpc.cfg new file mode 100644 index 00000000..89eafa99 --- /dev/null +++ b/examples/gui/customwindow/extrafpc.cfg @@ -0,0 +1,10 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fu../common/ +-Xs +-XX +-CX +#ifdef mswindows +-WG +#endif + diff --git a/examples/gui/customwindow/images.inc b/examples/gui/customwindow/images.inc new file mode 100644 index 00000000..79663a24 --- /dev/null +++ b/examples/gui/customwindow/images.inc @@ -0,0 +1,57 @@ + +const + img_close: array[0..337] of byte = ( + 66, 77, 82, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0, + 0, 8, 0, 0, 0, 9, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 0, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,226,226,226,238,238,238,225,225,225,223,223,223,223,223, + 223,226,226,226,238,238,238,226,226,226,228,228,228,184,184,184,231, + 231,231,226,226,226,226,226,226,230,230,230,184,184,184,228,228,228, + 172,172,172,160,160,160,173,173,173,231,231,231,231,231,231,173,173, + 173,160,160,160,172,172,172,216,216,216,159,159,159,153,153,153,170, + 170,170,168,168,168,153,153,153,157,157,157,215,215,215,225,225,225, + 219,219,219,165,165,165,149,149,149,149,149,149,162,162,162,218,218, + 218,225,225,225,227,227,227,229,229,229,158,158,158,141,141,141,142, + 142,142,163,163,163,232,232,232,227,227,227,227,227,227,152,152,152, + 136,136,136,146,146,146,144,144,144,136,136,136,154,154,154,228,228, + 228,149,149,149,128,128,128,140,140,140,217,217,217,215,215,215,138, + 138,138,128,128,128,150,150,150,213,213,213,147,147,147,214,214,214, + 226,226,226,226,226,226,214,214,214,146,146,146,213,213,213); + + +const + img_resize: array[0..473] of byte = ( + 66, 77,218, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0, + 0, 10, 0, 0, 0, 11, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 96, 1, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,242,242,242,242,242,242,242,242,242,242,242,242,233,233, + 233,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0, + 0,167,167,167,167,167,167,167,167,167,162,162,162,189,189,189,223, + 223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0, 0,157, + 157,157,157,157,157,157,157,157,193,193,193,226,226,226,224,224,224, + 224,224,224,224,224,224,224,224,224,224,224,224, 0, 0,146,146,146, + 141,141,141,144,144,144,164,164,164,229,229,229,224,224,224,224,224, + 224,224,224,224,224,224,224,224,224,224, 0, 0,131,131,131,175,175, + 175,146,146,146,133,133,133,153,153,153,224,224,224,224,224,224,224, + 224,224,224,224,224,224,224,224, 0, 0,174,174,174,225,225,225,215, + 215,215,146,146,146,208,208,208,228,228,228,239,239,239,227,227,227, + 225,225,225,235,235,235, 0, 0,225,225,225,225,225,225,225,225,225, + 225,225,225,225,225,225,225,225,225,183,183,183,232,232,232,235,235, + 235,201,201,201, 0, 0,226,226,226,226,226,226,226,226,226,226,226, + 226,226,226,226,167,167,167,153,153,153,167,167,167,193,193,193,154, + 154,154, 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226, + 226,226,215,215,215,152,152,152,144,144,144,144,144,144,144,144,144, + 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, + 235,235,235,184,184,184,134,134,134,134,134,134,134,134,134, 0, 0, + 227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,168,168, + 168,115,115,115,115,115,115,115,115,115,115,115,115, 0, 0); + + diff --git a/examples/gui/customwindow/resize.bmp b/examples/gui/customwindow/resize.bmp Binary files differnew file mode 100644 index 00000000..8bb264cf --- /dev/null +++ b/examples/gui/customwindow/resize.bmp diff --git a/examples/gui/customwindow/units/.gitignore b/examples/gui/customwindow/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/customwindow/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/drag_n_drop/dndexample.lpr b/examples/gui/drag_n_drop/dndexample.lpr index c95b97d0..46c5a1f6 100644 --- a/examples/gui/drag_n_drop/dndexample.lpr +++ b/examples/gui/drag_n_drop/dndexample.lpr @@ -64,6 +64,7 @@ procedure TMainForm.Edit1DragEnter(Sender, Source: TObject; var s: string; begin + ShowMimeList(AMimeList); s := 'text/plain'; if chkAccept.Checked then Accept := False @@ -73,7 +74,6 @@ begin begin if AMimeChoice <> s then AMimeChoice := s; - ShowMimeList(AMimeList); end; end; @@ -83,6 +83,7 @@ procedure TMainForm.Bevel1DragEnter(Sender, Source: TObject; var s: string; begin + ShowMimeList(AMimeList); { the mime type we want to accept } s := 'text/html'; { if we wil accept the drop, set Accept to True } @@ -93,7 +94,6 @@ begin if AMimeChoice <> s then AMimeChoice := s; - ShowMimeList(AMimeList); Bevel1.BackgroundColor := clRed; end; end; @@ -121,6 +121,8 @@ end; procedure TMainForm.btnClearClicked(Sender: TObject); begin Grid1.RowCount := 0; + Edit1.Text := ''; + Bevel1.Text := ''; end; procedure TMainForm.LabelDragStartDetected(Sender: TObject); diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi index 872cf6e3..f6efbd83 100644 --- a/examples/gui/filedialog/filedialog.lpi +++ b/examples/gui/filedialog/filedialog.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="filedialog.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="filedialog"/> </Unit0> </Units> </ProjectOptions> @@ -54,6 +53,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr index 315b7885..1294ac06 100644 --- a/examples/gui/filedialog/filedialog.lpr +++ b/examples/gui/filedialog/filedialog.lpr @@ -119,7 +119,7 @@ procedure TMainForm.btnOpenFileClick(Sender: TObject); var dlg: TfpgFileDialog; begin - dlg := TfpgFileDialog.Create(nil); + dlg := TfpgFileDialog.Create(Self); try // defines 3 filters (All Files, Object Pascal and Lazarus Project) dlg.Filter := 'All Files (*)|*|Object Pascal (*.pas;*.lpr;*.pp)|*.pas;*.lpr;*.pp|Lazarus Project (*.lpi)|*.lpi'; diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 173806e9..4b53f260 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -17,7 +17,8 @@ uses fpg_checkbox, fpg_tab, fpg_edit, - fpg_dialogs; + fpg_dialogs, + fpg_scrollbar; type @@ -256,6 +257,14 @@ begin OnDrawCell := @StringGridDrawCell; OnDoubleClick := @StringGridDoubleClicked; OnHeaderClick := @StringGridHeaderClicked; + // Testing various scrollbar styles +// ScrollBarStyle:= ssNone; +// ScrollBarStyle:= ssHorizontal; +// ScrollBarStyle:= ssVertical; + ScrollBarStyle:= ssAutoBoth; +// ScrollBarStyle:= ssHorizVisible; +// ScrollBarStyle:= ssVertiVisible; +// ScrollBarStyle:= ssBothVisible; end; chkShowHeader := TfpgCheckBox.Create(self); diff --git a/examples/gui/listviewtest/listviewtest.lpi b/examples/gui/listviewtest/listviewtest.lpi index 50579565..595a5353 100644 --- a/examples/gui/listviewtest/listviewtest.lpi +++ b/examples/gui/listviewtest/listviewtest.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="listviewtest.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="listviewtest"/> </Unit0> </Units> </ProjectOptions> @@ -53,11 +52,5 @@ <UseAnsiStrings Value="False"/> </SyntaxOptions> </Parsing> - <Other> - <CompilerMessages> - <UseMsgFile Value="True"/> - </CompilerMessages> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> </CONFIG> diff --git a/examples/gui/listviewtest/listviewtest.lpr b/examples/gui/listviewtest/listviewtest.lpr index 38bb6c83..57ab27b6 100644 --- a/examples/gui/listviewtest/listviewtest.lpr +++ b/examples/gui/listviewtest/listviewtest.lpr @@ -9,7 +9,10 @@ uses type + { TMainForm } + TMainForm = class(TfpgForm) + procedure ShowFocusItemChange(Sender: TObject); private FEdit: TfpgEdit; FAddButton: TfpgButton; @@ -18,6 +21,7 @@ type FTmpListView: TfpgListView; FQuitButton: TfpgButton; FCheck: TfpgCheckBox; + FShowFocus: TfpgCheckBox; procedure LVColumnClicked(Listview: TfpgListView; Column: TfpgLVColumn; Button: Integer); procedure CloseBttn(Sender: TObject); procedure AddBttn(Sender: TObject); @@ -35,6 +39,11 @@ type { TMainForm } +procedure TMainForm.ShowFocusItemChange(Sender: TObject); +begin + FListView.ShowFocusRect:=TfpgCheckBox(Sender).Checked; +end; + procedure TMainForm.LVColumnClicked(Listview: TfpgListView; Column: TfpgLVColumn; Button: Integer); begin @@ -260,6 +269,17 @@ begin OnChange := @ShowHeadersChange; end; + FShowFocus := TfpgCheckBox.Create(BottomPanel); + with FShowFocus do begin + Parent := BottomPanel; + Top := 10; + Left := 320; + Width := 130; + Checked := True; + Text := 'Show Item Focus'; + OnChange:=@ShowFocusItemChange; + end; + end; begin diff --git a/examples/gui/modalforms/modalforms.lpi b/examples/gui/modalforms/modalforms.lpi index cc8137c8..2f25e23a 100644 --- a/examples/gui/modalforms/modalforms.lpi +++ b/examples/gui/modalforms/modalforms.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="modalforms.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="modalforms"/> </Unit0> </Units> </ProjectOptions> @@ -54,6 +53,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr index 99f53ab3..bac0af81 100644 --- a/examples/gui/modalforms/modalforms.lpr +++ b/examples/gui/modalforms/modalforms.lpr @@ -99,7 +99,7 @@ procedure TForm1.btnOpenForm2Click(Sender: TObject); var frm: TForm2; begin - frm := TForm2.Create(nil); + frm := TForm2.Create(Self); try frm.ShowModal; writeln('Form2: This should only appear after the form closes.'); @@ -113,6 +113,7 @@ end; constructor TForm1.Create(AOwner: TComponent); begin inherited Create(AOwner); + Visible:=False; WindowTitle := 'Form1'; Sizeable := False; SetPosition(150, 150, 200, 200); @@ -144,7 +145,7 @@ procedure TMainForm.btnOpenForm1Click(Sender: TObject); var frm: TForm1; begin - frm := TForm1.Create(nil); + frm := TForm1.Create(Self); try frm.ShowModal; writeln('Form1: This should only appear after the form closes.'); diff --git a/examples/gui/reporting/u_demo.pas b/examples/gui/reporting/u_demo.pas index 349b0ad1..adad8515 100644 --- a/examples/gui/reporting/u_demo.pas +++ b/examples/gui/reporting/u_demo.pas @@ -1279,12 +1279,10 @@ begin Ckb_Preferences := CreateCheckBox(Self, 650, 30, 'FitWindow preference'); Ckb_Preferences.OnChange := @Ckb_PreferencesChange; P_Zoom := CreatePanel(Self, 650, 60, 200, 60, 'Zoom', bsRaised, taCenter, tlTop, 5); - P_Zoom.BackgroundColor := clPaleGreen; SE_Zoom := CreateSpinEdit(P_Zoom, 10, 25, 55, 20, 20, 200, 1, 5, 100); SE_Zoom.OnChange := @SE_ZoomChange; L_Zoom := CreateLabel(P_Zoom, 70, 25, '%'); P_Layout := CreatePanel(Self, 650, 130, 200, 110, 'Layout', bsRaised, taCenter, tlTop, 5); - P_Layout.BackgroundColor := clPaleGreen; RB_Single := CreateRadiobutton(P_Layout, 10, 25, 'Single'); RB_Single.OnChange := @P_LayoutRBChange; RB_Two := CreateRadiobutton(P_Layout, 10, 50, 'Two pages'); @@ -1295,7 +1293,6 @@ begin Ckb_Preferences.Checked := True; RB_Single.Checked := True; Bt_Exit := CreateButton(Self, 375, 550, 150, 'Exit', @Bt_ExitClick, 'stdimg.exit'); - Bt_Exit.BackgroundColor := clTomato; ZoomValue := '100'; Randomize; for Cpt := 0 to 18 do diff --git a/examples/gui/togglebox/ToggleBoxTest.lpi b/examples/gui/togglebox/ToggleBoxTest.lpi new file mode 100644 index 00000000..327b4258 --- /dev/null +++ b/examples/gui/togglebox/ToggleBoxTest.lpi @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="ToggleBoxTest"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication Use="True" PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="ToggleBoxTest.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="mainfrm.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="mainfrm"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="ToggleBoxTest"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <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/togglebox/ToggleBoxTest.lpr b/examples/gui/togglebox/ToggleBoxTest.lpr new file mode 100644 index 00000000..8866f9c5 --- /dev/null +++ b/examples/gui/togglebox/ToggleBoxTest.lpr @@ -0,0 +1,30 @@ +program ToggleBoxTest; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX} + cthreads, + {$ENDIF} + Classes, + fpg_main, + mainfrm; + +procedure MainProc; +var + frmMain: TfrmMain; +begin + fpgApplication.Initialize; + frmMain:= TfrmMain.Create(nil); + try + frmMain.Show; + fpgApplication.Run; + finally + frmMain.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/gui/togglebox/mainfrm.pas b/examples/gui/togglebox/mainfrm.pas new file mode 100644 index 00000000..ff9a43da --- /dev/null +++ b/examples/gui/togglebox/mainfrm.pas @@ -0,0 +1,44 @@ +unit mainfrm; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, fpg_base, fpg_form, fpg_toggle; + +type + + { TfrmMain } + + TfrmMain = class(TfpgForm) + private + FToggle: TfpgToggle; + public + constructor Create(AOwner: TComponent); override; + end; + + +implementation + +{ TfrmMain } + +constructor TfrmMain.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + WindowTitle:='Yay a toggle!'; + SetWidth(300); + SetHeight(200); + + FToggle := TfpgToggle.Create(Self); + FToggle.SetPosition(10, 10, 200, 20); +// FToggle.Width:=200; + + //FToggle.ToggleSide:=tsLeft; + //FToggle.ToggleWidth:=100; + //FToggle.UseAnimation:=False; + +end; + +end. + diff --git a/examples/gui/video_vlc/frmvlcplayer.pas b/examples/gui/video_vlc/frmvlcplayer.pas index 7b44c1e1..456ac202 100644 --- a/examples/gui/video_vlc/frmvlcplayer.pas +++ b/examples/gui/video_vlc/frmvlcplayer.pas @@ -6,7 +6,7 @@ interface uses SysUtils, Classes, fpg_base, fpg_panel, fpg_button, fpg_main, fpg_form, - fpg_editbtn, fpg_memo, fpg_label, libvlc, vlc, fpg_vlc; + fpg_editbtn, fpg_memo, fpg_label, vlc, fpg_vlc; type @@ -23,14 +23,17 @@ type Button3: TfpgButton; Button4: TfpgButton; Memo1: TfpgMemo; - procedure Sync; + lblTimeLapse: TfpgLabel; {@VFD_HEAD_END: VLCPlayerDemo} + procedure Sync; + procedure DoGUIUpdateTimeLapse; public P : TFpgVLCPlayer; FMsg: String; procedure AfterCreate; override; Procedure InitPlayer; Procedure Log(Const Msg : String); + Procedure UpdateTimeLapse(const Msg: String); Procedure DoPlay(sender : TObject); Procedure DoPause(sender : TObject); Procedure DoResume(sender : TObject); @@ -145,6 +148,7 @@ procedure TVLCPlayerDemoForm.DoOnTimeChanged(Sender: TObject; const time: TDateTime); begin Log('Time changed : '+TimeToStr(Time)); + UpdateTimeLapse(TimeToStr(time)); end; procedure TVLCPlayerDemoForm.DoOnSnapshot(Sender: TObject; @@ -167,6 +171,7 @@ begin SetPosition(424, 319, 813, 574); WindowTitle := 'VLCPlayerDemo'; Hint := ''; + IconName := ''; Panel1 := TfpgPanel.Create(self); with Panel1 do @@ -187,7 +192,7 @@ begin Anchors := [anLeft,anRight,anTop]; ExtraHint := ''; FileName := ''; - Filter := 'Video files|*.avi;*.flv;*.mp4'; + Filter := 'Video files|*.avi;*.flv;*.mp4;*.mkv|Audio files|*.mp3;*.acc;*.flac;*.ogg'; InitialDir := ''; TabOrder := 2; end; @@ -269,6 +274,16 @@ begin TabOrder := 8; end; + lblTimeLapse := TfpgLabel.Create(self); + with lblTimeLapse do + begin + Name := 'lblTimeLapse'; + SetPosition(30, 510, 105, 15); + FontDesc := 'Liberation Sans-12:bold:antialias=true'; + Hint := ''; + Text := 'Label'; + end; + {@VFD_BODY_END: VLCPlayerDemo} {%endregion} end; @@ -306,12 +321,25 @@ begin Memo1.Lines.Add(FMsg); end; +procedure TVLCPlayerDemoForm.DoGUIUpdateTimeLapse; +begin + lblTimeLapse.Text := FMsg; +end; + procedure TVLCPlayerDemoForm.Log(const Msg: String); begin FMsg:=Msg; TThread.Synchronize(Nil,@Self.Sync); end; +procedure TVLCPlayerDemoForm.UpdateTimeLapse(const Msg: String); +begin + FMsg := Msg; + TThread.Synchronize(nil, @self.DoGUIUpdateTimeLapse); +// This could also be used in FPC 3.0+ +// TThread.Queue(nil, @DoGUIUpdateTimeLapse); +end; + procedure TVLCPlayerDemoForm.DoPlay(sender: TObject); begin InitPlayer; diff --git a/examples/gui/video_vlc/testfpguivlc.lpi b/examples/gui/video_vlc/testfpguivlc.lpi index d7a4ad2a..5a13551b 100644 --- a/examples/gui/video_vlc/testfpguivlc.lpi +++ b/examples/gui/video_vlc/testfpguivlc.lpi @@ -42,7 +42,6 @@ <Unit0> <Filename Value="testfpguivlc.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="testfpguivlc"/> </Unit0> <Unit1> <Filename Value="frmvlcplayer.pas"/> @@ -50,17 +49,17 @@ <UnitName Value="frmvlcplayer"/> </Unit1> <Unit2> - <Filename Value="../fpg_vlc.pas"/> + <Filename Value="../../../src/3rdparty/libvlc/fpg_vlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="fpg_vlc"/> </Unit2> <Unit3> - <Filename Value="../../libvlc/libvlc.pp"/> + <Filename Value="../../../src/3rdparty/libvlc/libvlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="libvlc"/> </Unit3> <Unit4> - <Filename Value="../../libvlc/vlc.pas"/> + <Filename Value="../../../src/3rdparty/libvlc/vlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="vlc"/> </Unit4> @@ -76,12 +75,6 @@ <OtherUnitFiles Value="../../../src/3rdparty/libvlc"/> <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <Other> - <CompilerMessages> - <MsgFileName Value=""/> - </CompilerMessages> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> <Debugging> <Exceptions Count="3"> diff --git a/extras/contributed/ats/ats_editor.lpi b/extras/contributed/ats/ats_editor.lpi index 16f21757..f84d4956 100644 --- a/extras/contributed/ats/ats_editor.lpi +++ b/extras/contributed/ats/ats_editor.lpi @@ -1,7 +1,7 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> @@ -11,12 +11,14 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> <ResourceType Value="res"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable ProductVersion=""/> </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -57,10 +59,17 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> - <Other> - <CustomOptions Value="-FUunits/$(TargetCPU)-$(TargetOS)/"/> - <CompilerPath Value="$(CompPath)"/> - </Other> + <Version Value="11"/> + <Target> + <Filename Value="ats_editor"/> + </Target> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)/"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> </CompilerOptions> </CONFIG> diff --git a/extras/contributed/ats/ats_editor.pas b/extras/contributed/ats/ats_editor.pas index 92d5ce3e..876aab71 100644 --- a/extras/contributed/ats/ats_editor.pas +++ b/extras/contributed/ats/ats_editor.pas @@ -5,32 +5,29 @@ program ats_editor; uses SysUtils, Classes, fpg_base, fpg_main, fpg_customgrid, fpg_basegrid, ats_main, fpg_grid, fpg_form, fpg_button, fpg_edit, fpg_menu, fpg_label, - fpg_combobox, fpg_dialogs, fpg_utils; + fpg_combobox, fpg_dialogs, fpg_utils, fpg_panel; const - langtabledata: - {$I atstable.inc} + langtabledata: {$I atstable.inc} type - { TLangGrid } - TLangGrid = class(TfpgCustomGrid) protected procedure DrawCell(ARow, ACol: Integer; ARect: TfpgRect; AFlags: TfpgGridDrawState); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; - function GetRowCount: Integer; override; + function GetRowCount: Integer; override; public atstable: TatsTextTable; procedure UpdateColumns; + published + property FocusCol; + property FocusRow; end; - { TfrmLangTable } TfrmLangTable = class(TfpgForm) - public - menuFile: TfpgPopupMenu; - + private {@VFD_HEAD_BEGIN: frmLangTable} mainmenu: TfpgMenuBar; grid: TLangGrid; @@ -38,23 +35,26 @@ type btnCopyRow: TfpgButton; btnDeleteRow: TfpgButton; btnEdit: TfpgButton; + pmActions: TfpgPopupMenu; + pmFile: TfpgPopupMenu; {@VFD_HEAD_END: frmLangTable} - - procedure AfterCreate; override; - + procedure btnShowTestUsage(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure btnCopyRowClicked(Sender: TObject); + procedure btnDeleteRowClicked(Sender: TObject); + procedure btnNewRowClicked(Sender: TObject); procedure menuProcExit(Sender: TObject); procedure menuProcSave(Sender: TObject); procedure menuProcOpen(Sender: TObject); procedure menuProcNew(Sender: TObject); - - procedure EditClick(Sender : TObject); - + procedure btnEditClicked(Sender : TObject); + public + procedure AfterCreate; override; end; - { TfrmTextEdit } TfrmTextEdit = class(TfpgForm) - public + private {@VFD_HEAD_BEGIN: frmTextEdit} Label1: TfpgLabel; edID: TfpgEdit; @@ -65,18 +65,31 @@ type btnOK: TfpgButton; btnCancel: TfpgButton; {@VFD_HEAD_END: frmTextEdit} - textrow : TatsTextRow; - - procedure AfterCreate; override; - procedure OnLangChange(sender : TObject); - + protected procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; - + public + procedure AfterCreate; override; procedure LoadTexts; end; + TTestUsageForm = class(TfpgForm) + procedure FormShow(Sender: TObject); + private + {@VFD_HEAD_BEGIN: TestUsageForm} + gbTestArea: TfpgGroupBox; + btnFetch: TfpgButton; + edtResource: TfpgEdit; + cbLanguage: TfpgComboBox; + Label1: TfpgLabel; + Label2: TfpgLabel; + {@VFD_HEAD_END: TestUsageForm} + procedure btnFetchClicked(Sender: TObject); + public + procedure AfterCreate; override; + end; + {@VFD_NEWFORM_DECL} var @@ -84,6 +97,102 @@ var {@VFD_NEWFORM_IMPL} +procedure TTestUsageForm.FormShow(Sender: TObject); +begin + cbLanguage.Items.Assign(frmMain.grid.atstable.LangList); + cbLanguage.FocusItem := 0; + edtResource.Text := 'rsLanguage'; +end; + +procedure TTestUsageForm.btnFetchClicked(Sender: TObject); +begin + frmMain.grid.atstable.SelectLang(cbLanguage.Text); + ShowMessage(edtResource.Text + ': '+atsText(edtResource.Text)); +end; + +procedure TTestUsageForm.AfterCreate; +begin + {%region 'Auto-generated GUI code'} + {@VFD_BODY_BEGIN: TestUsageForm} + Name := 'TestUsageForm'; + SetPosition(814, 244, 297, 184); + WindowTitle := 'Test Usage'; + Hint := ''; + IconName := ''; + OnShow := @FormShow; + + gbTestArea := TfpgGroupBox.Create(self); + with gbTestArea do + begin + Name := 'gbTestArea'; + SetPosition(8, 8, 280, 169); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Test Area'; + end; + + btnFetch := TfpgButton.Create(gbTestArea); + with btnFetch do + begin + Name := 'btnFetch'; + SetPosition(126, 130, 147, 24); + Text := 'Fetch Translation'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 9; + OnClick := @btnFetchClicked; + end; + + edtResource := TfpgEdit.Create(gbTestArea); + with edtResource do + begin + Name := 'edtResource'; + SetPosition(8, 86, 265, 24); + ExtraHint := ''; + FontDesc := '#Edit1'; + Hint := ''; + TabOrder := 10; + Text := ''; + end; + + cbLanguage := TfpgComboBox.Create(gbTestArea); + with cbLanguage do + begin + Name := 'cbLanguage'; + SetPosition(8, 41, 110, 24); + ExtraHint := ''; + FontDesc := '#List'; + Hint := ''; + FocusItem := -1; + TabOrder := 11; + end; + + Label1 := TfpgLabel.Create(gbTestArea); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 25, 145, 15); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Set Language:'; + end; + + Label2 := TfpgLabel.Create(gbTestArea); + with Label2 do + begin + Name := 'Label2'; + SetPosition(8, 70, 140, 15); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Text ID to retrieve:'; + end; + + {@VFD_BODY_END: TestUsageForm} + {%endregion} +end; + + { TLangGrid } procedure TLangGrid.DrawCell(ARow, ACol: Integer; ARect: TfpgRect; AFlags: TfpgGridDrawState); @@ -119,10 +228,10 @@ procedure TLangGrid.HandleKeyPress(var keycode: word; var shiftstate: TShiftStat begin if keycode = keyEnter then begin + consumed := True; frmMain.btnEdit.Click; - end - else - inherited HandleKeyPress(keycode, shiftstate, consumed); + end; + inherited HandleKeyPress(keycode, shiftstate, consumed); end; procedure TLangGrid.UpdateColumns; @@ -155,6 +264,7 @@ begin SetPosition(326, 139, 466, 168); WindowTitle := 'Edit Text'; Hint := ''; + IconName := ''; Label1 := TfpgLabel.Create(self); with Label1 do @@ -172,10 +282,10 @@ begin Name := 'edID'; SetPosition(8, 28, 228, 24); ExtraHint := ''; + FontDesc := '#Edit1'; Hint := ''; TabOrder := 1; Text := ''; - FontDesc := '#Edit1'; end; cmbLang1 := TfpgComboBox.Create(self); @@ -183,8 +293,10 @@ begin begin Name := 'cmbLang1'; SetPosition(8, 65, 80, 22); + ExtraHint := ''; FontDesc := '#List'; Hint := ''; + FocusItem := -1; TabOrder := 3; OnChange := @OnLangChange; end; @@ -195,10 +307,10 @@ begin Name := 'edLang1'; SetPosition(100, 64, 356, 24); ExtraHint := ''; + FontDesc := '#Edit1'; Hint := ''; TabOrder := 3; Text := ''; - FontDesc := '#Edit1'; end; cmbLang2 := TfpgComboBox.Create(self); @@ -206,8 +318,10 @@ begin begin Name := 'cmbLang2'; SetPosition(8, 97, 80, 22); + ExtraHint := ''; FontDesc := '#List'; Hint := ''; + FocusItem := -1; TabOrder := 4; OnChange := @OnLangChange; end; @@ -218,10 +332,10 @@ begin Name := 'edLang2'; SetPosition(100, 96, 356, 24); ExtraHint := ''; + FontDesc := '#Edit1'; Hint := ''; TabOrder := 4; Text := ''; - FontDesc := '#Edit1'; end; btnOK := TfpgButton.Create(self); @@ -270,9 +384,12 @@ end; procedure TfrmTextEdit.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); begin - if keycode = keyEnter then btnOK.Click - else if keycode = keyEscape then btnCancel.Click - else inherited HandleKeyPress(keycode, shiftstate, consumed); + if keycode = keyEnter then + btnOK.Click + else if keycode = keyEscape then + btnCancel.Click + else + inherited HandleKeyPress(keycode, shiftstate, consumed); end; procedure TfrmTextEdit.LoadTexts; @@ -283,6 +400,44 @@ begin edLang2.Text := textrow.GetText(cmbLang2.Text, b); end; +procedure TfrmLangTable.btnShowTestUsage(Sender: TObject); +var + frm: TTestUsageForm; +begin + frm := TTestUsageForm.Create(nil); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + +procedure TfrmLangTable.FormShow(Sender: TObject); +begin + grid.SetFocus; +end; + +procedure TfrmLangTable.btnCopyRowClicked(Sender: TObject); +begin + ShowMessage('Copy row to be implemented.'); +end; + +procedure TfrmLangTable.btnDeleteRowClicked(Sender: TObject); +begin + ShowMessage('Delete row to be implemented.'); +end; + +procedure TfrmLangTable.btnNewRowClicked(Sender: TObject); +var + s: string; +begin + if not fpgInputQuery('New row', 'Enter the name of the new Text ID', s) then + Exit; + Grid.atstable.AddRow(s); + Grid.SetFocus; + Grid.FocusRow := Grid.GetRowCount-1; + Grid.FocusCol := 1; +end; procedure TfrmLangTable.AfterCreate; var @@ -290,9 +445,11 @@ var begin {@VFD_BODY_BEGIN: frmLangTable} Name := 'frmLangTable'; - SetPosition(282, 304, 619, 513); + SetPosition(282, 304, 619, 515); WindowTitle := 'ATS Table Editor'; Hint := ''; + IconName := ''; + OnShow := @FormShow; mainmenu := TfpgMenuBar.Create(self); with mainmenu do @@ -306,7 +463,7 @@ begin with grid do begin Name := 'grid'; - SetPosition(0, 28, 619, 447); + SetPosition(0, 28, 619, 448); Anchors := [anLeft,anRight,anTop,anBottom]; end; @@ -314,65 +471,88 @@ begin with btnNewRow do begin Name := 'btnNewRow'; - SetPosition(8, 482, 75, 24); + SetPosition(8, 486, 75, 24); Anchors := [anLeft,anBottom]; Text := 'New Row'; FontDesc := '#Label1'; Hint := ''; ImageName := ''; TabOrder := 2; + OnClick := @btnNewRowClicked; end; btnCopyRow := TfpgButton.Create(self); with btnCopyRow do begin Name := 'btnCopyRow'; - SetPosition(92, 482, 71, 24); + SetPosition(87, 486, 71, 24); Anchors := [anLeft,anBottom]; Text := 'Copy Row'; FontDesc := '#Label1'; Hint := ''; ImageName := ''; TabOrder := 3; + OnClick := @btnCopyRowClicked; end; btnDeleteRow := TfpgButton.Create(self); with btnDeleteRow do begin Name := 'btnDeleteRow'; - SetPosition(292, 482, 83, 24); + SetPosition(247, 486, 83, 24); Anchors := [anLeft,anBottom]; Text := 'Delete Row'; FontDesc := '#Label1'; Hint := ''; ImageName := ''; TabOrder := 4; + OnClick := @btnDeleteRowClicked; end; btnEdit := TfpgButton.Create(self); with btnEdit do begin Name := 'btnEdit'; - SetPosition(188, 482, 79, 24); + SetPosition(163, 486, 79, 24); Anchors := [anLeft,anBottom]; Text := 'Edit Item'; FontDesc := '#Label1'; Hint := ''; ImageName := ''; TabOrder := 5; - OnClick := @EditClick; + OnClick := @btnEditClicked; + end; + + pmActions := TfpgPopupMenu.Create(self); + with pmActions do + begin + Name := 'pmActions'; + SetPosition(400, 130, 180, 22); + AddMenuItem('New Row', 'Ctrl+Ins', @btnNewRowClicked); + AddMenuItem('Copy Row', 'Ctrl+C', @btnCopyRowClicked); + AddMenuItem('Edit Item', 'Enter', @btnEditClicked); + AddMenuItem('Delete Row', 'Ctrl+Del', @btnDeleteRowClicked); + AddSeparator; + AddMenuItem('Test Usage', '', @btnShowTestUsage); + end; + + pmFile := TfpgPopupMenu.Create(self); + with pmFile do + begin + Name := 'pmFile'; + SetPosition(400, 108, 180, 22); + AddMenuItem('&New', 'Ctrl+N', @menuProcNew); + AddMenuItem('&Open...', 'Ctrl+O', @menuProcOpen); + AddMenuItem('&Save...', 'Ctrl+S', @menuProcSave); + AddMenuItem('-', '', nil); + AddMenuItem('&Exit', '', @menuProcExit); end; {@VFD_BODY_END: frmLangTable} - - menuFile := TfpgPopupMenu.Create(self); - menuFile.AddMenuItem('&New', '', @menuProcNew); - menuFile.AddMenuItem('&Open...', '', @menuProcOpen); - menuFile.AddMenuItem('&Save...', '', @menuProcSave); - menuFile.AddMenuItem('-', '', nil); - menuFile.AddMenuItem('&Exit', '', @menuProcExit); - mainmenu.AddMenuItem('&File', nil).SubMenu := menuFile; + // Hook up the menus to the mainmenu + mainmenu.AddMenuItem('&File', nil).SubMenu := pmFile; + mainmenu.AddMenuItem('&Actions', nil).SubMenu := pmActions; grid.atstable := atsTexts; grid.UpdateColumns; @@ -462,7 +642,7 @@ begin grid.Update; end; -procedure TfrmLangTable.EditClick(Sender: TObject); +procedure TfrmLangTable.btnEditClicked(Sender: TObject); var frm : TfrmTextEdit; tr : TatsTextRow; diff --git a/extras/contributed/ats/ats_main.pas b/extras/contributed/ats/ats_main.pas index e8efb251..767d9774 100644 --- a/extras/contributed/ats/ats_main.pas +++ b/extras/contributed/ats/ats_main.pas @@ -45,43 +45,29 @@ type protected function FindRow(const atextid : string) : TatsTextRow; - - function AddRow(const atextid : string) : TatsTextRow; - public constructor Create; destructor Destroy; override; - procedure Clear; - procedure AddLang(const alangid : string); - procedure SetText(const atextid, alangid, atext : string); function GetText(const atextid, alangid : string; var found : boolean) : string; overload; function GetText(const atextid : string) : string; overload; - // later this can prepare a fast search table too: procedure SelectLang(const alangid : string); - //procedure SetFallbackOrder(const alangids : string); - property CurrentLang : string read FCurrentLangId; - public - function LoadFromFile(const afilename : string) : boolean; - function LoadFromPascalFile(const afilename : string) : boolean; - function LoadFromArray(const aarr : array of string) : boolean; - procedure LoadPureText(const fdata : string); - procedure SaveToFile(const afilename : string; aformat : TatsFormat); - + // utility functions function RowCount : integer; function GetRow(arow : integer) : TatsTextRow; + function AddRow(const atextid : string) : TatsTextRow; property LangList : TStringList read FLangIds; end; diff --git a/extras/contributed/ats/ptrparsefunc.pas b/extras/contributed/ats/ptrparsefunc.pas index 7c2c0790..a1e514b7 100644 --- a/extras/contributed/ats/ptrparsefunc.pas +++ b/extras/contributed/ats/ptrparsefunc.pas @@ -1,5 +1,7 @@ unit ptrparsefunc; +{$mode objfpc}{$H+} + interface procedure ppSkipSpaces(var ReadPtr : PChar; bufend : PChar); diff --git a/extras/contributed/ats/readme.txt b/extras/contributed/ats/readme.txt index 9e6941e6..55213279 100644 --- a/extras/contributed/ats/readme.txt +++ b/extras/contributed/ats/readme.txt @@ -8,3 +8,34 @@ use the ats editor to edit that *.ats file. The editor was planned to support *.ats, *.inc and *.csv file formats, but not all of them are implemented. + +Usage (2015-04-02): +I modified the project a bit to make it more user friendly and to show +how it is used. Basically it maintains a list of Resource/Text ID's and +then the translation for each of those in a language column. Any number +of languages can be added. The editor is optimised for quick keyboard +usage, so translation can be done very quickly. You will have to include +a few of the ats units in your own project to use it - just like the +ats_editor project does itself. + +The editor maintains an "atstable.inc" file which is just an array of +text strings. To add a new language, it still needs to be done manually +by editing the atstable.inc file (improving the editor to do this should +be easy) and just adding one or more new language codes. + +I did the following change in the atstable.inc: + + ,' RU="РуÑÑкий" HU="Magyar"' + +After that you run the ats_editor and edit the Resource ID's for those +new languages. + +You set the current language by calling atstable.SelectLang(<LangID>) + +You retrieve the translated text for a specific Resource ID by calling + + atsText(<ResourceID>) + +eg: ShowMessage(atsText('rsCancel'); + + --------[ end ]--------- diff --git a/extras/contributed/editgrid/u_editgrid.pas b/extras/contributed/editgrid/u_editgrid.pas index 17446fa6..30193580 100644 --- a/extras/contributed/editgrid/u_editgrid.pas +++ b/extras/contributed/editgrid/u_editgrid.pas @@ -551,6 +551,7 @@ begin IniCalendarCell; end; FEditing := True; + Enabled:= False; end; procedure TfpgCustomEditGrid.EditGridMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; @@ -736,17 +737,26 @@ procedure TfpgCustomEditGrid.SetReturnWay; begin case FEditWay of edNone: + begin FEditing:= False; + Enabled:= True; + end; edColumn: if FocusCol < Pred(ColumnCount) then FocusCol := FocusCol + 1 else + begin FEditing:= False; + Enabled:= True; + end; edRow: if FocusRow < Pred(RowCount) then FocusRow := FocusRow + 1 else + begin FEditing:= False; + Enabled:= True; + end; end; SetFocus; if FEditing then @@ -764,6 +774,7 @@ begin if FocusCol < Pred(ColumnCount) then FocusCol := FocusCol + 1; FEditing := False; + Enabled:= True; SetFocus; end; @@ -811,6 +822,7 @@ begin FCellEditText.Text := ''; FCellEditText.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -937,6 +949,7 @@ begin FCellEditInteger.Text := ''; FCellEditInteger.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1051,6 +1064,7 @@ begin FCellEditFloat.Text := ''; FCellEditFloat.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1151,6 +1165,7 @@ begin FCellEditCurrency.Text := ''; FCellEditCurrency.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1239,6 +1254,7 @@ begin FCellComboBox.Text := ''; FCellComboBox.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1307,6 +1323,7 @@ begin FCellEditCombo.Text := ''; FCellEditCombo.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1393,6 +1410,7 @@ begin FCellCheckBox.Text := ''; FCellCheckBox.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1482,6 +1500,7 @@ begin //FCellCalendar.Text := ''; FCellCalendar.Visible := False; FEditing := False; + Enabled:= True; SetFocus; end; end; @@ -1671,6 +1690,7 @@ begin IniCalendarCell; end; FEditing := True; + Enabled:= False; end; keyTab: begin diff --git a/extras/contributed/nicegrid/extrafpc.cfg b/extras/contributed/nicegrid/extrafpc.cfg new file mode 100644 index 00000000..49dd2ec7 --- /dev/null +++ b/extras/contributed/nicegrid/extrafpc.cfg @@ -0,0 +1,10 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fi. +-Xs +-XX +-CX +#ifdef mswindows +-WG +#endif + diff --git a/extras/contributed/nicegrid/fpg_nicegrid.pas b/extras/contributed/nicegrid/fpg_nicegrid.pas index 2a27f771..233f9962 100644 --- a/extras/contributed/nicegrid/fpg_nicegrid.pas +++ b/extras/contributed/nicegrid/fpg_nicegrid.pas @@ -386,7 +386,7 @@ type property HeaderFontColor: TfpgColor read FHeaderFontColor write SetHeaderFontColor; property FooterFont: string read FFooterFont write SetFooterFont; property FooterFontColor: TfpgColor read FFooterFontColor write SetFooterFontColor; - property SelectionColor: TfpgColor read FSelectionColor write SetSelectionColor default $00CAFFFF; + property SelectionColor: TfpgColor read FSelectionColor write SetSelectionColor default $FFCAFFFF; property FitToWidth: Boolean read FFitToWidth write SetFitToWidth default False; property AutoColWidth: Boolean read FAutoColWidth write SetAutoColWidth default False; property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; @@ -491,7 +491,7 @@ begin FHeaderLightColor := clHilite1; FHeaderDarkColor := clShadow1; FHeaderFont:='Arial-8'; - FSelectionColor := $00CAFFFF; + FSelectionColor := $FFCAFFFF; FFooterFont := 'Arial-8'; FooterFontColor := clRed; FDefRowHeight := 18; @@ -3417,7 +3417,7 @@ end; constructor TfpgMergeCell.Create; begin inherited Create; - Font := fpgApplication.DefaultFont.FontDesc; + Font := fpgStyle.DefaultFont.FontDesc; end; destructor TfpgMergeCell.Destroy; diff --git a/extras/contributed/nicegrid/main1.pas b/extras/contributed/nicegrid/main1.pas index 67a39621..27d7a3bd 100644 --- a/extras/contributed/nicegrid/main1.pas +++ b/extras/contributed/nicegrid/main1.pas @@ -78,7 +78,7 @@ begin RowCount := 20; AutoAddRow := True; DefColWidth := 100; - Color:=$ECE9D8; + Color := $ffece9d8; GridColor := clSilver; HeaderLine := 2; HeaderColor := clButtonFace; @@ -87,7 +87,7 @@ begin HeaderFontColor := clWhite; HeaderFont := 'MS Sans Serif'; FooterFontColor := clRed; - SelectionColor := 13816575; + SelectionColor := $ffD2D2FF; BeginUpdate; // JP with Columns.Add do begin @@ -105,7 +105,7 @@ begin Width:=100; Font:='Arial-8'; FontColor:=clRed; - Color:=$FFFACD;//14024703; + Color:=$FFFFFACD;//14024703; HorzAlign:=haCenter; end; with Columns.Add do @@ -302,9 +302,9 @@ begin begin BeginUpdate; GridColor := clGray; - HeaderColor := $000000DF; + HeaderColor := $FF0000DF; HeaderDarkColor := clBlack; - HeaderLightColor := $000080FF; + HeaderLightColor := $FF0080FF; HeaderFontColor := clWhite; GutterFontColor:=clWhite; EndUpdate; diff --git a/extras/contributed/nicegrid/nicegrid1.project b/extras/contributed/nicegrid/nicegrid1.project new file mode 100644 index 00000000..580224ad --- /dev/null +++ b/extras/contributed/nicegrid/nicegrid1.project @@ -0,0 +1,68 @@ +[ProjectOptions] +ProjectName=nicegrid1.project +MainUnit=nicegrid1.lpr +TargetFile=nicegrid1${EXEEXT} +DefaultMake=0 +MakeOptionsCount=7 +MakeOptionEnabled1=1,1,1,1,1,1 +MakeOptionEnabled2=1,1,1,1,1,0 +MakeOptionEnabled3=1,1,0,0,0,1 +MakeOptionEnabled4=0,0,0,0,1,1 +MacroCount=4 +Macro1=TargetCPU=i386 +Macro2=TargetOS=win32 +Macro3=FPGUI_DIR=/home/graemeg/programming/fpgui/ +Macro4=tiOPF_fpGUI_Dir=/home/graemeg/programming/3rdParty/tiOPF2/src/ +Macro5=FPGUI_DIR=/home/graemeg/programming/fpgui/ +Macro6=tiOPF_fpGUI_Dir=/home/graemeg/programming/3rdParty/tiOPF2/src/ +UnitDirsCount=8 +UnitDirEnabled1=1,1,1,1,0,0,0,1,0,0 +UnitDirEnabled2=1,1,1,1,0,0,1,1,0,0 +UnitDirEnabled3=1,1,1,0,0,0,1,1,0,0 +UnitDirEnabled4=0,0,0,1,0,0,1,1,0,0 +UnitDirEnabled5=1,1,1,1,0,0,1,1,0,0 +UnitDirEnabled6=1,1,1,1,0,0,1,0,0,0 +UnitDirEnabled7=0,0,0,0,1,1,1,0,0,0 +UnitDirEnabled8=1,0,0,0,0,0,1,1,0,0 +UnitOutputDir=units/${TARGET}/ +MakeOptionEnabled5=1,0,0,0,0,0 +MakeOptionEnabled6=1,0,0,0,0,0 +MakeOptionEnabled7=0,0,0,0,0,0 +MakeOption1=-l -Mobjfpc -Sch +MakeOption2=-g -gl -O- -gw2 -godwarfsets +MakeOption3=-B +MakeOption4=-O2 -XX -Xs -CX +MakeOption5=-veiw +MakeOption6=-dDEBUGSVR +MakeOption7=-dAGGCanvas +UnitDir1=${FPGUIDIR}src/ +UnitDir2=${FPGUIDIR}src/corelib/ +UnitDir3=${FPGUIDIR}src/corelib/x11/ +UnitDir4=${FPGUIDIR}src/corelib/gdi/ +UnitDir5=${FPGUIDIR}src/gui/ +UnitDir6=${FPGUIDIR}src/gui/db/ +UnitDir7=${FPGUILIBDIR} +UnitDir8=${FPGUIDIR}src/corelib/render/software/ + +[Units] +UnitCount=20 +Unit1=builderthread.pas,0 +Unit2=filemonitor.pas,0 +Unit3=fpg_textedit.pas,-1 +Unit4=frm_configureide.pas,0 +Unit5=frm_debug.pas,0 +Unit6=frm_find.pas,-1 +Unit7=frm_main.pas,-1 +Unit8=frm_procedurelist.pas,-1 +Unit9=frm_projectoptions.pas,-1 +Unit10=ideconst.pas,0 +Unit11=ideimages.pas,0 +Unit12=idemacros.pas,-1 +Unit13=ideutils.pas,0 +Unit14=maximus.lpr,0 +Unit15=mPasLex.pas,0 +Unit16=project.pas,-1 +Unit17=sha1.pas,0 +Unit18=stringhelpers.pas,0 +Unit19=synregexpr.pas,0 +Unit20=unitlist.pas,0 diff --git a/languages/fpgui.af.po b/languages/fpgui.af.po index 7a6bb628..98ac495d 100644 --- a/languages/fpgui.af.po +++ b/languages/fpgui.af.po @@ -76,6 +76,10 @@ msgstr "Augustus" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Vetdruk" @@ -100,6 +104,10 @@ msgstr "Verander Titel" msgid "Character Map" msgstr "Karakter Kaart" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Sluit" @@ -108,6 +116,10 @@ msgstr "Sluit" msgid "Collection" msgstr "Versameling" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "Instel Boekmerke" @@ -120,6 +132,10 @@ msgstr "Bevestig" msgid "Confirmation" msgstr "Bevestiging" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Kopieer" @@ -280,6 +296,10 @@ msgstr "Vr" msgid "Friday" msgstr "Vrydag" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Groep" @@ -288,6 +308,10 @@ msgstr "Groep" msgid "Help" msgstr "Help" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "Voorskou" @@ -472,6 +500,10 @@ msgstr "Voorskou" msgid "Recently Used" msgstr "Onlangs gebruik" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Vervang" diff --git a/languages/fpgui.de.po b/languages/fpgui.de.po index e079f440..09e4ae1a 100644 --- a/languages/fpgui.de.po +++ b/languages/fpgui.de.po @@ -75,6 +75,10 @@ msgstr "August" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Fett" @@ -99,6 +103,10 @@ msgstr "" msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Schließen" @@ -107,6 +115,10 @@ msgstr "Schließen" msgid "Collection" msgstr "Sammlung" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -119,6 +131,10 @@ msgstr "Bestätigen" msgid "Confirmation" msgstr "Bestätigung" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Kopieren" @@ -279,6 +295,10 @@ msgstr "Fre" msgid "Friday" msgstr "Freitag" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Gruppe" @@ -287,6 +307,10 @@ msgstr "Gruppe" msgid "Help" msgstr "Hilfe" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -463,6 +487,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -471,6 +499,10 @@ msgstr "" msgid "Recently Used" msgstr "Zuletzt verwendet" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Ersetzen" diff --git a/languages/fpgui.en.po b/languages/fpgui.en.po index fe4e5c70..20f85e86 100644 --- a/languages/fpgui.en.po +++ b/languages/fpgui.en.po @@ -76,6 +76,10 @@ msgstr "" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "" @@ -100,6 +104,10 @@ msgstr "" msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "" @@ -108,6 +116,10 @@ msgstr "" msgid "Collection" msgstr "" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -120,6 +132,10 @@ msgstr "" msgid "Confirmation" msgstr "" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "" @@ -280,6 +296,10 @@ msgstr "" msgid "Friday" msgstr "" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "" @@ -288,6 +308,10 @@ msgstr "" msgid "Help" msgstr "" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -472,6 +500,10 @@ msgstr "" msgid "Recently Used" msgstr "" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "" diff --git a/languages/fpgui.es.po b/languages/fpgui.es.po index c33ce8af..181fa6a3 100644 --- a/languages/fpgui.es.po +++ b/languages/fpgui.es.po @@ -76,6 +76,10 @@ msgstr "" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Negrita" @@ -100,6 +104,10 @@ msgstr "" msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Cerrar" @@ -108,6 +116,10 @@ msgstr "Cerrar" msgid "Collection" msgstr "Colección" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -120,6 +132,10 @@ msgstr "Confirmar" msgid "Confirmation" msgstr "Confirmación" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Copiar" @@ -280,6 +296,10 @@ msgstr "Vie" msgid "Friday" msgstr "Viernes" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Grupo" @@ -288,6 +308,10 @@ msgstr "Grupo" msgid "Help" msgstr "Ayuda" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -472,6 +500,10 @@ msgstr "" msgid "Recently Used" msgstr "Usados Recientemente" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Reemplazar" diff --git a/languages/fpgui.fr.po b/languages/fpgui.fr.po index 9bbc641c..303891bb 100644 --- a/languages/fpgui.fr.po +++ b/languages/fpgui.fr.po @@ -76,6 +76,10 @@ msgstr "Août" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Gras" @@ -100,6 +104,10 @@ msgstr "Changer le titre" msgid "Character Map" msgstr "Table de caractères" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Fermer" @@ -108,6 +116,10 @@ msgstr "Fermer" msgid "Collection" msgstr "Collection" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "Configurer les signets" @@ -120,6 +132,10 @@ msgstr "Confirmer" msgid "Confirmation" msgstr "Confirmation" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Copier" @@ -280,6 +296,10 @@ msgstr "Ven" msgid "Friday" msgstr "Vendredi" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Groupe" @@ -288,6 +308,10 @@ msgstr "Groupe" msgid "Help" msgstr "Aide" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "Prévisualisation" @@ -472,6 +500,10 @@ msgstr "Prévisualisation" msgid "Recently Used" msgstr "Récemment utilisé" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Remplacer" diff --git a/languages/fpgui.it.po b/languages/fpgui.it.po index 9231802a..795ed273 100644 --- a/languages/fpgui.it.po +++ b/languages/fpgui.it.po @@ -76,6 +76,10 @@ msgstr "Agosto" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Grassetto" @@ -100,6 +104,10 @@ msgstr "" msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Chiudi" @@ -108,6 +116,10 @@ msgstr "Chiudi" msgid "Collection" msgstr "Collezione" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -120,6 +132,10 @@ msgstr "Conferma" msgid "Confirmation" msgstr "Conferma" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Copia" @@ -280,6 +296,10 @@ msgstr "Ven" msgid "Friday" msgstr "Venerdì" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Gruppo" @@ -288,6 +308,10 @@ msgstr "Gruppo" msgid "Help" msgstr "Aiuto" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -472,6 +500,10 @@ msgstr "" msgid "Recently Used" msgstr "Usati Recentemente" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Sostituisci" diff --git a/languages/fpgui.po b/languages/fpgui.po index d84c2be4..53eca15f 100644 --- a/languages/fpgui.po +++ b/languages/fpgui.po @@ -62,6 +62,10 @@ msgstr "" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "" @@ -86,6 +90,10 @@ msgstr "" msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "" @@ -94,6 +102,10 @@ msgstr "" msgid "Collection" msgstr "" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -106,6 +118,10 @@ msgstr "" msgid "Confirmation" msgstr "" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "" @@ -254,6 +270,10 @@ msgstr "" msgid "Font Aliases" msgstr "" +#: fpg_constants:rserrreportfontfilemissing +msgid "Font file <%s.fnt> not found" +msgstr "" + #: fpg_constants:rsshortfri msgid "Fri" msgstr "" @@ -262,6 +282,10 @@ msgstr "" msgid "Friday" msgstr "" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "" @@ -270,6 +294,10 @@ msgstr "" msgid "Help" msgstr "" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -278,6 +306,10 @@ msgstr "" msgid "Ignore" msgstr "" +#: fpg_constants:rserrreportimagefilemissing +msgid "Image <%s> is missing" +msgstr "" + #: fpg_constants:rsinformation msgid "Information" msgstr "" @@ -422,6 +454,14 @@ msgstr "" msgid "Owner" msgstr "" +#: fpg_constants:rsfiletypepdf +msgid "PDF Documents" +msgstr "" + +#: fpg_constants:rsreportpage +msgid "Page" +msgstr "" + #: fpg_constants:rspassword msgid "Password" msgstr "" @@ -438,10 +478,22 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + +#: fpg_constants:rsreportpreview +msgid "Preview" +msgstr "" + #: fpg_constants:rscollectionrecentlyused msgid "Recently Used" msgstr "" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "" @@ -482,6 +534,10 @@ msgstr "" msgid "Search" msgstr "" +#: fpg_constants:rsreportsection +msgid "Section" +msgstr "" + #: fpg_constants:rsselect msgid "Select" msgstr "" @@ -542,6 +598,10 @@ msgstr "" msgid "Text to Insert" msgstr "" +#: fpg_constants:rserrreportnopagestoprint +msgid "There are no pages to print" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "" @@ -610,35 +670,7 @@ msgstr "" msgid "Yes to All" msgstr "" -#: fpg_constants:rserrreportimagefilemissing -msgid "Image <%s> is missing" -msgstr "" - -#: fpg_constants:rserrreportnopagestoprint -msgid "There are no pages to print" -msgstr "" - -#: fpg_constants:rserrreportfontfilemissing -msgid "Font file <%s.fnt> not found" -msgstr "" - -#: fpg_constants:rsfiletypepdf -msgid "PDF Documents" -msgstr "" - -#: fpg_constants:rsreportpage -msgid "Page" -msgstr "" - -#: fpg_constants:rsreportsection -msgid "Section" -msgstr "" - #: fpg_constants:rsreportpageof msgid "of" msgstr "" -#: fpg_constants:rsreportpreview -msgid "Preview" -msgstr "" - diff --git a/languages/fpgui.pt.po b/languages/fpgui.pt.po index ab5cddb2..e3ea6725 100644 --- a/languages/fpgui.pt.po +++ b/languages/fpgui.pt.po @@ -76,6 +76,10 @@ msgstr "Agosto" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "" + #: fpg_constants:rsbold msgid "Bold" msgstr "Negrito" @@ -100,6 +104,10 @@ msgstr "Mudar TÃtulo" msgid "Character Map" msgstr "Mapa de Caracteres" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Fechar" @@ -108,6 +116,10 @@ msgstr "Fechar" msgid "Collection" msgstr "Coleção" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" msgstr "" @@ -120,6 +132,10 @@ msgstr "Confirmar" msgid "Confirmation" msgstr "Confirmação" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Copiar" @@ -280,6 +296,10 @@ msgstr "Sex" msgid "Friday" msgstr "Sexta-feira" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Grupo" @@ -288,6 +308,10 @@ msgstr "Grupo" msgid "Help" msgstr "Ajuda" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -472,6 +500,10 @@ msgstr "" msgid "Recently Used" msgstr "Recentemente Usado" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Substituir" diff --git a/languages/fpgui.ru.po b/languages/fpgui.ru.po index 7cf1cc80..2b501756 100644 --- a/languages/fpgui.ru.po +++ b/languages/fpgui.ru.po @@ -30,7 +30,7 @@ msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ %s" #: fpg_constants:rsaddcurrentdirectory msgid "Add current directory" -msgstr "" +msgstr "Добавить текущую директорию" #: fpg_constants:rsall msgid "All" @@ -76,6 +76,10 @@ msgstr "ÐвгуÑÑ‚" msgid "BkSp" msgstr "" +#: fpg_constants:rscolorblue +msgid "Blue" +msgstr "Синий" + #: fpg_constants:rsbold msgid "Bold" msgstr "Жирный" @@ -94,12 +98,16 @@ msgstr "Изменить" #: fpg_constants:rschangetitle msgid "Change Title" -msgstr "" +msgstr "Изменить Заголовок" #: fpg_constants:rscharactermap msgid "Character Map" msgstr "" +#: fpg_constants:rscolorpickerhint +msgid "Click on Picker and maintain click => release to get the color" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Закрыть" @@ -108,9 +116,13 @@ msgstr "Закрыть" msgid "Collection" msgstr "Группа" +#: fpg_constants:rstabsheetcolorwheel +msgid "Color Wheel" +msgstr "" + #: fpg_constants:rsconfigurebookmarks msgid "Configure Bookmarks" -msgstr "" +msgstr "ÐаÑтроить Закладки" #: fpg_constants:rsconfirm msgid "Confirm" @@ -120,6 +132,10 @@ msgstr "Подтвердить" msgid "Confirmation" msgstr "Подтверждение" +#: fpg_constants:rscontinuous +msgid "Continuous" +msgstr "" + #: fpg_constants:rscopy msgid "Copy" msgstr "Копировать" @@ -174,7 +190,7 @@ msgstr "Директории" #: fpg_constants:rsdirectory msgid "Directory" -msgstr "" +msgstr "ДиректориÑ" #: fpg_constants:rskeydown msgid "Down" @@ -270,7 +286,7 @@ msgstr "ПÑевдонимы шрифтов" #: fpg_constants:rserrreportfontfilemissing msgid "Font file <%s.fnt> not found" -msgstr "" +msgstr "Файл шрифта <%s.fnt> не найден" #: fpg_constants:rsshortfri msgid "Fri" @@ -280,6 +296,10 @@ msgstr "Пт" msgid "Friday" msgstr "ПÑтница" +#: fpg_constants:rscolorgreen +msgid "Green" +msgstr "" + #: fpg_constants:rsfilegroup msgid "Group" msgstr "Группа" @@ -288,6 +308,10 @@ msgstr "Группа" msgid "Help" msgstr "Справка" +#: fpg_constants:rshexadecimal +msgid "Hexadecimal" +msgstr "" + #: fpg_constants:rskeyhome msgid "Home" msgstr "" @@ -298,7 +322,7 @@ msgstr "ПропуÑтить" #: fpg_constants:rserrreportimagefilemissing msgid "Image <%s> is missing" -msgstr "" +msgstr "Изображение <%s> не найдено" #: fpg_constants:rsinformation msgid "Information" @@ -442,7 +466,7 @@ msgstr "Владелец" #: fpg_constants:rsfiletypepdf msgid "PDF Documents" -msgstr "" +msgstr "PDF Документы" #: fpg_constants:rsreportpage msgid "Page" @@ -464,6 +488,10 @@ msgstr "" msgid "PgUp" msgstr "" +#: fpg_constants:rstabpredefined +msgid "Predefined" +msgstr "" + #: fpg_constants:rsreportpreview msgid "Preview" msgstr "" @@ -472,6 +500,10 @@ msgstr "" msgid "Recently Used" msgstr "Ранее иÑпользованные" +#: fpg_constants:rscolorred +msgid "Red" +msgstr "" + #: fpg_constants:rsreplace msgid "Replace" msgstr "Заменить" @@ -578,7 +610,7 @@ msgstr "" #: fpg_constants:rserrreportnopagestoprint msgid "There are no pages to print" -msgstr "" +msgstr "Ðет Ñтраниц Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸" #: fpg_constants:rsshortthu msgid "Thu" diff --git a/prototypes/fpgui2/tests/frm_threedee.pas b/prototypes/fpgui2/tests/frm_threedee.pas index 5f6548ed..836de485 100644 --- a/prototypes/fpgui2/tests/frm_threedee.pas +++ b/prototypes/fpgui2/tests/frm_threedee.pas @@ -119,18 +119,18 @@ Const procedure FillRectGradient(Canvas: TfpgCanvas; X, Y, W, H: TfpgCoord; Strip: Integer; Astart, Astop: TfpgColor); var - RGBStart: TFPColor; - RGBStop: TFPColor; + RGBStart: TRGBTriple; + RGBStop: TRGBTriple; RDiff, GDiff, BDiff: Integer; count: Integer; i: Integer; - newcolor: TFPColor; + newcolor: TRGBTriple; Hx, Hy: TfpgCoord; // Coordinates for Horizontal Lines Vx, Vy: TfpgCoord; // Coordinates for Vertical Lines avgcolor: TfpgColor; begin - RGBStart := fpgColorToFPColor(fpgColorToRGB(AStart)); - RGBStop := fpgColorToFPColor(fpgColorToRGB(AStop)); + RGBStart := fpgColorToRGBTriple(fpgColorToRGB(AStart)); + RGBStop := fpgColorToRGBTriple(fpgColorToRGB(AStop)); count := Strip; Hx := X; @@ -151,7 +151,7 @@ begin newcolor.Blue := RGBStart.Blue + (i * BDiff) div count; Canvas.SetLineStyle(1, lsSolid); - Canvas.SetColor(FPColorTofpgColor(newcolor)); + Canvas.SetColor(RGBTripleTofpgColor(newcolor)); Canvas.DrawLine(Hx, Hy, W+2, Hy); // Horizontal Line Canvas.DrawLine(Vx, Vy, Vx, H+2); // Vertical Line // next Horizontal Line: one pixel lower, one pixel shorter on the left diff --git a/src/3rdparty/libvlc/vlc.pas b/src/3rdparty/libvlc/vlc.pas index 0f82b9c0..4b1ca563 100644 --- a/src/3rdparty/libvlc/vlc.pas +++ b/src/3rdparty/libvlc/vlc.pas @@ -322,8 +322,8 @@ Type Property VideoPosition ; Property VideoFractionalPosition ; Property VideoFramesPerSecond; - Property VideoScale : Double; - Property AspectRatio : String; + Property VideoScale; + Property AspectRatio; Published Property AudioDelay ; Property AudioVolume ; @@ -391,7 +391,7 @@ Type TVLCMediaListPlayer = Class(TCustomVLCMediaListPlayer) Public - Property VLC : TVLCLibrary; + Property VLC; Published Property Player; Property PlayMode; diff --git a/src/VERSION_FILE.inc b/src/VERSION_FILE.inc index b0593919..bac1d842 100644 --- a/src/VERSION_FILE.inc +++ b/src/VERSION_FILE.inc @@ -1 +1 @@ -FPGUI_VERSION = '1.2'; +FPGUI_VERSION = '1.4'; diff --git a/src/build.bat b/src/build.bat index 6928adfe..741048db 100644 --- a/src/build.bat +++ b/src/build.bat @@ -18,5 +18,5 @@ echo "You've got the correct output lib directory" :end -fpc -dRELEASE -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas +fpc -dDEBUG -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas diff --git a/src/build.sh b/src/build.sh index 8f90fdae..8a180ceb 100755 --- a/src/build.sh +++ b/src/build.sh @@ -1,6 +1,7 @@ #!/bin/bash -fpctarget=`fpc -iTP`-`fpc -iTO` +fpcbin=fpc +fpctarget=`$fpcbin -iTP`-`$fpcbin -iTO` #echo $fpctarget libpath='../lib/'$fpctarget @@ -12,7 +13,8 @@ if [ ! -d $libpath ]; then fi # Default build -fpc -dRELEASE -dX11 @extrafpc.cfg corelib/x11/fpgui_toolkit.pas +$fpcbin -dDEBUG -dX11 @extrafpc.cfg corelib/x11/fpgui_toolkit.pas + # experimental AggPas-enabled Canvas under X11 -#fpc -dRELEASE -dX11 -dAGGCanvas @extrafpc.cfg corelib/x11/fpgui_toolkit.pas +#$fpcbin -dDEBUG -dX11 -dAGGCanvas @extrafpc.cfg corelib/x11/fpgui_toolkit.pas diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 96332d5d..c110f3b0 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -49,14 +49,6 @@ type Alpha: byte; end; - // Same declaration as in FPImage unit, but we don't use FPImage yet, so declare it here - TFPColor = record - Red: byte; - Green: byte; - Blue: byte; - Alpha: byte; - end deprecated; - TWindowType = (wtChild, wtWindow, wtModalForm, wtPopup); TWindowAttribute = (waSizeable, waAutoPos, waScreenCenterPos, waStayOnTop, @@ -121,7 +113,8 @@ const FPGM_FREEME = 19; FPGM_DROPENTER = 20; FPGM_DROPEXIT = 21; - FPGM_HSCROLL = 22; + FPGM_HSCROLL = 22; + FPGM_ABOUT = 23; FPGM_USER = 50000; FPGM_KILLME = MaxInt; @@ -138,6 +131,7 @@ var FPG_DEFAULT_FONT_DESC: string = 'Liberation Sans-10:antialias=true'; FPG_DEFAULT_SANS: string = 'Liberation Sans'; {$ENDIF} + FPG_DEFAULT_FIXED_FONT_DESC: string = 'Courier New-10'; const UserNamedColorStart = 128; @@ -573,8 +567,11 @@ type function PrevModalForm: TfpgWindowBase; function RemoveWindowFromModalStack(AForm: TfpgWindowBase): Integer; procedure CreateForm(InstanceClass: TComponentClass; out Reference); + function GetFormByClassName(const AClassName: string): TfpgWindowBase; + function GetFormByName(const AName: string): TfpgWindowBase; function GetScreenWidth: TfpgCoord; virtual; abstract; function GetScreenHeight: TfpgCoord; virtual; abstract; + function GetScreenPixelColor(APos: TPoint): TfpgColor; virtual; abstract; function Screen_dpi_x: integer; virtual; abstract; function Screen_dpi_y: integer; virtual; abstract; function Screen_dpi: integer; virtual; abstract; @@ -727,8 +724,8 @@ type destructor Destroy; override; function Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction = daCopy): TfpgDropAction; virtual; abstract; end; - - + + { TfpgBaseTimer } TfpgBaseTimer = class(TObject) @@ -763,9 +760,7 @@ function CheckClipboardKey(AKey: Word; AShiftstate: TShiftState): TClipboardKe { Color } function fpgColorToRGBTriple(const AColor: TfpgColor): TRGBTriple; -function fpgColorToFPColor(const AColor: TfpgColor): TFPColor; deprecated; function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; -function FPColorTofpgColor(const AColor: TFPColor): TfpgColor; deprecated; function fpgGetRed(const AColor: TfpgColor): byte; function fpgGetGreen(const AColor: TfpgColor): byte; function fpgGetBlue(const AColor: TfpgColor): byte; @@ -994,27 +989,11 @@ begin end end; -function fpgColorToFPColor(const AColor: TfpgColor): TFPColor; deprecated; -begin - with Result do - begin - Red := fpgGetRed(AColor); - Green := fpgGetGreen(AColor); - Blue := fpgGetBlue(AColor); - Alpha := fpgGetAlpha(AColor); - end -end; - function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; begin Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16) or (AColor.Alpha shl 24); end; -function FPColorTofpgColor(const AColor: TFPColor): TfpgColor; deprecated; -begin - Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16) or (AColor.Alpha shl 24); -end; - function fpgGetRed(const AColor: TfpgColor): byte; var c: TfpgColor; @@ -1741,9 +1720,12 @@ begin RGBStop := fpgColorToRGBTriple(AStop); if ADirection = gdVertical then - count := ARect.Height + count := ARect.Bottom - ARect.Top else - count := ARect.Width; + count := ARect.Right - ARect.Left; + + if count < 1 then + Exit; // there is nothing to paint RDiff := RGBStop.Red - RGBStart.Red; GDiff := RGBStop.Green - RGBStart.Green; @@ -1858,7 +1840,7 @@ begin SetColor(clText1); SetTextColor(clText1); - SetFont(fpgApplication.DefaultFont); + SetFont(fpgStyle.DefaultFont); SetLineStyle(0, lsSolid); FBeginDrawCount := 0; @@ -2181,7 +2163,7 @@ begin p := FImageData; Inc(p, (FWidth * y) + x); p^ := AValue; -// write(IntToHex(AValue, 6) + ' '); +// write(IntToHex(AValue, 8) + ' '); end; constructor TfpgImageBase.Create; @@ -2518,6 +2500,36 @@ begin end; end; +function TfpgApplicationBase.GetFormByClassName(const AClassName: string): TfpgWindowBase; +var + i: integer; +begin + Result := nil; + for i := 0 to FormCount-1 do + begin + if Forms[i].ClassName = AClassName then + begin + Result := Forms[i]; + break; + end; + end; +end; + +function TfpgApplicationBase.GetFormByName(const AName: string): TfpgWindowBase; +var + i: integer; +begin + Result := nil; + for i := 0 to FormCount-1 do + begin + if Forms[i].Name = AName then + begin + Result := Forms[i]; + break; + end; + end; +end; + procedure TfpgApplicationBase.Terminate; var i: integer; diff --git a/src/corelib/fpg_csvparser.pas b/src/corelib/fpg_csvparser.pas new file mode 100644 index 00000000..f5c0d0ed --- /dev/null +++ b/src/corelib/fpg_csvparser.pas @@ -0,0 +1,320 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2014 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: + Uses a Finite State Machine to parse CSV files. + Graeme Geldenhuys <graemeg@gmail.com> + + This unit shows how one could use the State Design Pattern to implement a + FSM (Finite State Machine) to create a CSV Parser. It handles invalid + CSV as well and will raise an appropriate exception. In the State pattern, + each of the states becomes a subclass of the base class. Each subclass must + implement the abstract method which will handle the input character and + decide on the next state. +} + +unit fpg_CSVParser; + +{$mode objfpc}{$H+} + +interface + +uses + Classes; + +type + { forward declarations } + TCSVParser = class; + TParserStateClass = class of TCSVParserState; + + + { Abstract State object } + TCSVParserState = class(TObject) + private + FParser: TCSVParser; + procedure ChangeState(NewState: TParserStateClass); + procedure AddCharToCurrField(Ch: char); + procedure AddCurrFieldToList; + public + constructor Create(AParser: TCSVParser); + { Must be implemented in the concrete classes to handle the input character + and decide on the next state. } + procedure ProcessChar(Ch: AnsiChar; Pos: integer); virtual; abstract; + end; + + + { A concrete state object - used when starting a new field } + TCSVParserFieldStartState = class(TCSVParserState) + public + procedure ProcessChar(Ch: AnsiChar; Pos: integer); override; + end; + + + { A concrete state object - used while scanning a field } + TCSVParserScanFieldState = class(TCSVParserState) + public + procedure ProcessChar(Ch: AnsiChar; Pos: integer); override; + end; + + + { A concrete state object - used while scanning double quoted fields } + TCSVParserScanQuotedState = class(TCSVParserState) + public + procedure ProcessChar(Ch: AnsiChar; Pos: integer); override; + end; + + + { A concrete state object - used when found the ending double quote } + TCSVParserEndQuotedState = class(TCSVParserState) + public + procedure ProcessChar(Ch: AnsiChar; Pos: integer); override; + end; + + + { A concrete state object - some error occured / invalid CSV structure } + TCSVParserGotErrorState = class(TCSVParserState) + public + procedure ProcessChar(Ch: AnsiChar; Pos: integer); override; + end; + + + { The actual state machine - CSV parser } + TCSVParser = class(TObject) + private + FCurrentLine: string; + FState: TCSVParserState; + { Cache state objects for greater performance. This comes in handy when + parsing a large CSV file. For smaller files you might want to create them + on the fly. } + FFieldStartState: TCSVParserFieldStartState; + FScanFieldState: TCSVParserScanFieldState; + FScanQuotedState: TCSVParserScanQuotedState; + FEndQuotedState: TCSVParserEndQuotedState; + FGotErrorState: TCSVParserGotErrorState; + { Fields used during parsing } + FCurrField: string; + FFieldList: TStrings; + function GetState: TParserStateClass; + procedure SetState(const Value: TParserStateClass); + protected + procedure AddCharToCurrField(Ch: char); + procedure AddCurrFieldToList; + { An example of Self Encapsulating Field refactoring } + property State: TParserStateClass read GetState write SetState; + public + constructor Create; + destructor Destroy; override; + { prodecure to call, to start the parsing process } + procedure ExtractFields(const S: string; const pFieldList: TStrings); + property CurrentLine: string read FCurrentLine; + end; + + +// global singleton function +function gCSVParser: TCSVParser; + + +implementation + +uses + SysUtils; + +var + uCSVParser: TCSVParser; + + +// Lazy mans singleton +function gCSVParser: TCSVParser; +begin + if uCSVParser = nil then + uCSVParser := TCSVParser.Create; + Result := uCSVParser; +end; + +{ TCSVParser } + +constructor TCSVParser.Create; +begin + inherited Create; + FCurrentLine := ''; + FFieldStartState := TCSVParserFieldStartState.Create(Self); + FScanFieldState := TCSVParserScanFieldState.Create(Self); + FScanQuotedState := TCSVParserScanQuotedState.Create(Self); + FEndQuotedState := TCSVParserEndQuotedState.Create(Self); + FGotErrorState := TCSVParserGotErrorState.Create(Self); +end; + +destructor TCSVParser.Destroy; +begin + FFieldStartState.Free; + FScanFieldState.Free; + FScanQuotedState.Free; + FEndQuotedState.Free; + FGotErrorState.Free; + inherited; +end; + +function TCSVParser.GetState: TParserStateClass; +begin + Result := TParserStateClass(FState.ClassType); +end; + +procedure TCSVParser.SetState(const Value: TParserStateClass); +begin + if Value = TCSVParserFieldStartState then + FState := FFieldStartState + else if Value = TCSVParserScanFieldState then + FState := FScanFieldState + else if Value = TCSVParserScanQuotedState then + FState := FScanQuotedState + else if Value = TCSVParserEndQuotedState then + FState := FEndQuotedState + else if Value = TCSVParserGotErrorState then + FState := FGotErrorState; +end; + +procedure TCSVParser.ExtractFields(const S: string; const pFieldList: TStrings); +var + i: integer; + Ch: AnsiChar; +begin + FCurrentLine := S; + FFieldList := pFieldList; + Assert(Assigned(FFieldList), 'FieldList not assigned'); + { Initialize by clearing the string list, and starting in FieldStart state } + FFieldList.Clear; + State := TCSVParserFieldStartState; + FCurrField := ''; + + { Read through all the characters in the string } + for i := 1 to Length(s) do + begin + { Get the next character } + Ch := s[i]; + FState.ProcessChar(Ch, i); + end; + + { If we are in the ScanQuoted or GotError state at the end of the string, + there was a problem with a closing quote. You can add the second if test + for an extra failsafe! } + if (State = TCSVParserScanQuotedState) then + // or (State = TCSVParserGotErrorState) then + raise Exception.Create('Missing closing quote'); + + { If the current field is not empty, add it to the list } + if (FCurrField <> '') then + AddCurrFieldToList; +end; + +procedure TCSVParser.AddCharToCurrField(Ch: char); +begin + FCurrField := FCurrField + Ch; +end; + +procedure TCSVParser.AddCurrFieldToList; +begin + FFieldList.Add(FCurrField); + // Clear the field in preparation for collecting the next one + FCurrField := ''; +end; + +{ TCSVParserState } + +constructor TCSVParserState.Create(AParser: TCSVParser); +begin + inherited Create; + FParser := AParser; +end; + +procedure TCSVParserState.ChangeState(NewState: TParserStateClass); +begin + FParser.State := NewState; +end; + +procedure TCSVParserState.AddCharToCurrField(Ch: char); +begin + FParser.AddCharToCurrField(Ch); +end; + +procedure TCSVParserState.AddCurrFieldToList; +begin + FParser.AddCurrFieldToList; +end; + +{ TCSVParserFieldStartState } + +procedure TCSVParserFieldStartState.ProcessChar(Ch: AnsiChar; Pos: integer); +begin + case Ch of + '"': ChangeState(TCSVParserScanQuotedState); + ',': AddCurrFieldToList; + else + AddCharToCurrField(Ch); + ChangeState(TCSVParserScanFieldState); + end; +end; + +{ TCSVParserScanFieldState } + +procedure TCSVParserScanFieldState.ProcessChar(Ch: AnsiChar; Pos: integer); +begin + if (Ch = ',') then + begin + AddCurrFieldToList; + ChangeState(TCSVParserFieldStartState); + end + else + AddCharToCurrField(Ch); +end; + +{ TCSVParserScanQuotedState } + +procedure TCSVParserScanQuotedState.ProcessChar(Ch: AnsiChar; Pos: integer); +begin + if (Ch = '"') then + ChangeState(TCSVParserEndQuotedState) + else + AddCharToCurrField(Ch); +end; + +{ TCSVParserEndQuotedState } + +procedure TCSVParserEndQuotedState.ProcessChar(Ch: AnsiChar; Pos: integer); +begin + if (Ch = ',') then + begin + AddCurrFieldToList; + ChangeState(TCSVParserFieldStartState); + end + else + ChangeState(TCSVParserGotErrorState); +end; + +{ TCSVParserGotErrorState } + +procedure TCSVParserGotErrorState.ProcessChar(Ch: AnsiChar; Pos: integer); +begin + raise Exception.Create(Format('Error in line at position %d: ' + #10 + + '<%s>', [Pos, FParser.CurrentLine])); +end; + + +initialization + uCSVParser := nil; + +finalization + if uCSVParser <> nil then + uCSVParser.Free; + +end. + diff --git a/src/corelib/fpg_imgutils.pas b/src/corelib/fpg_imgutils.pas index 97f33fb7..79892f5b 100644 --- a/src/corelib/fpg_imgutils.pas +++ b/src/corelib/fpg_imgutils.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -78,11 +78,11 @@ end; function fpgCalculateGray(const AFrom: TfpgColor; const ABrighter: boolean = False; const APercent: integer = 0): TfpgColor; var g: integer; - rgb: TFPColor; + rgb: TRGBTriple; begin with GrayConvMatrix do begin - rgb := fpgColorToFPColor(AFrom); + rgb := fpgColorToRGBTriple(AFrom); g := round(red*rgb.red + green*rgb.green + blue*rgb.blue); if ABrighter then @@ -97,7 +97,7 @@ begin rgb.Green := g; rgb.Blue := g; end; - Result := FPColorTofpgColor(rgb); + Result := RGBTripleTofpgColor(rgb); end; diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index c7275b14..1f063cb5 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -51,7 +51,7 @@ type TfpgMenuItemFlags = set of (mifSelected, mifHasFocus, mifSeparator, mifEnabled, mifChecked, mifSubMenu); - + TfpgTextFlags = set of (txtLeft, txtHCenter, txtRight, txtTop, txtVCenter, txtBottom, txtWrap, txtDisabled, txtAutoSize); @@ -62,7 +62,7 @@ type const AllAnchors = [anLeft, anRight, anTop, anBottom]; TextFlagsDflt = [txtLeft, txtTop]; - + type { ******************************************* @@ -183,6 +183,7 @@ type function DrawText(x, y, w, h: TfpgCoord; const AText: TfpgString; AFlags: TfpgTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer; overload; function DrawText(x, y: TfpgCoord; const AText: TfpgString; AFlags: TfpgTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer; overload; function DrawText(r: TfpgRect; const AText: TfpgString; AFlags: TfpgTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer; overload; + property Window: TfpgWindowBase read FWindow; end; @@ -190,19 +191,32 @@ type will rework this to use a Style Manager like the previous fpGUI. Also support Bitmap based styles for easier theme implementations. } TfpgStyle = class(TObject) + protected + FDefaultFont: TfpgFont; + FFixedFont: TfpgFont; + FMenuAccelFont: TfpgFont; + FMenuDisabledFont: TfpgFont; + FMenuFont: TfpgFont; + procedure SetDefaultFont(AValue: TfpgFont); + procedure SetFixedFont(AValue: TfpgFont); + procedure SetMenuAccelFont(AValue: TfpgFont); + procedure SetMenuDisabledFont(AValue: TfpgFont); + procedure SetMenuFont(AValue: TfpgFont); public - DefaultFont: TfpgFont; - FixedFont: TfpgFont; - MenuFont: TfpgFont; - MenuAccelFont: TfpgFont; - MenuDisabledFont: TfpgFont; constructor Create; virtual; destructor Destroy; override; + { font objects } + property DefaultFont: TfpgFont read FDefaultFont write SetDefaultFont; + property FixedFont: TfpgFont read FFixedFont write SetFixedFont; + property MenuFont: TfpgFont read FMenuFont write SetMenuFont; + property MenuAccelFont: TfpgFont read FMenuAccelFont write SetMenuAccelFont; + property MenuDisabledFont: TfpgFont read FMenuDisabledFont write SetMenuDisabledFont; { General } procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); virtual; overload; procedure DrawControlFrame(ACanvas: TfpgCanvas; r: TfpgRect); overload; function GetControlFrameBorders: TRect; virtual; procedure DrawBevel(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; ARaised: Boolean = True); virtual; + function GetBevelWidth: TfpgCoord; 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; @@ -228,7 +242,7 @@ type function GetCheckBoxSize: integer; virtual; procedure DrawCheckbox(ACanvas: TfpgCanvas; x, y: TfpgCoord; ix, iy: TfpgCoord); virtual; end; - + TMsgHookItem = class Dest: TObject; @@ -261,7 +275,6 @@ type FDisplayParams: string; FScreenWidth: integer; FScreenHeight: integer; - FDefaultFont: TfpgFont; FFontResList: TList; FMessageHookList: TFPList; procedure FreeFontRes(afontres: TfpgFontResource); @@ -283,7 +296,6 @@ type procedure SetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); procedure ShowException(E: Exception); procedure UnsetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); - property DefaultFont: TfpgFont read FDefaultFont; property HintPause: Integer read FHintPause write SetHintPause; property HintWindow: TfpgWindow read FHintWindow; property ScreenWidth: integer read FScreenWidth; @@ -326,12 +338,12 @@ type property Width: integer read FWidth; property Height: integer read FHeight; end; - - + + TfpgClipboard = class(TfpgClipboardImpl) end; - + TfpgFileList = class(TfpgFileListImpl) end; @@ -455,7 +467,6 @@ 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; deprecated; operator = (const AColor1, AColor2: TRGBTriple) b: Boolean; @@ -508,7 +519,7 @@ type end; - TNamedFontItem = class + TNamedFontItem = class(TObject) public FontID: string; FontDesc: string; @@ -1169,14 +1180,6 @@ begin 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; - operator = (const AColor1, AColor2: TRGBTriple) b: Boolean; begin b := (AColor1.Red = AColor2.Red) @@ -1295,7 +1298,7 @@ begin Result := TStringList.Create else Exit; //==> - + for n := 0 to fpgNamedFonts.Count-1 do begin oFont := TNamedFontItem(fpgNamedFonts[n]); @@ -1364,14 +1367,12 @@ begin fpgStyleManager.FreeStyleInstance; fpgStyle := nil; fpgCaret.Free; - + for i := fpgTimers.Count-1 downto 0 do if fpgTimers[i] <> nil then TfpgTimer(fpgTimers[i]).Free; fpgTimers.Free; - FDefaultFont.Free; - for i := FFontResList.Count-1 downto 0 do begin TfpgFontResource(FFontResList[i]).Free; @@ -1380,7 +1381,7 @@ begin FFontResList.Free; FreeAndNil(FModalFormStack); - + for i := 0 to FMessageHookList.Count-1 do TMsgHookItem(FMessageHookList[i]).Free; FreeAndNil(FMessageHookList); @@ -1391,7 +1392,7 @@ begin uMsgQueueList.Delete(i); end; uMsgQueueList.Free; - + inherited Destroy; end; @@ -1502,7 +1503,7 @@ begin ShortDayNames[5] := rsShortThu; ShortDayNames[6] := rsShortFri; ShortDayNames[7] := rsShortSat; - + LongDayNames[1] := rsLongSun; LongDayNames[2] := rsLongMon; LongDayNames[3] := rsLongTue; @@ -1657,7 +1658,6 @@ end; procedure TfpgApplication.InternalInit; begin - FDefaultFont := GetFont(FPG_DEFAULT_FONT_DESC); fpgInitTimers; fpgNamedFonts := TList.Create; @@ -1936,10 +1936,10 @@ begin end; end; nw := Max(wtxt, w); - + wraplst := TStringList.Create; wraplst.Text := AText; - + if (txtWrap in AFlags) then begin for i := 0 to wraplst.Count-1 do @@ -1949,7 +1949,7 @@ begin end; htxt := (Font.Height * wraplst.Count) + (ALineSpace * Pred(wraplst.Count)); - + // Now paint the actual text for i := 0 to wraplst.Count-1 do begin @@ -1964,7 +1964,7 @@ begin nx := x + (w - wtxt) div 2 else // txtLeft is default nx := x; - + // vertical alignment if (txtBottom in AFlags) then ny := y + l + h - htxt @@ -1975,7 +1975,7 @@ begin fpgStyle.DrawString(self, nx, ny, wraplst[i], lEnabled); end; - + wraplst.Free; Result := htxt; end; @@ -2015,10 +2015,13 @@ begin FModalForWin := nil; - if (AOwner <> nil) and (AOwner is TfpgWindow) then - FWindowType := wtChild - else - FWindowType := wtWindow; + if not (FWindowType in [wtModalForm, wtPopup]) then + begin + if (AOwner <> nil) and (AOwner is TfpgWindow) then + FWindowType := wtChild + else + FWindowType := wtWindow; + end; FCanvas := CreateCanvas; end; @@ -2047,13 +2050,48 @@ end; { TfpgStyle } +procedure TfpgStyle.SetDefaultFont(AValue: TfpgFont); +begin + if FDefaultFont = AValue then Exit; + FDefaultFont.Free; + FDefaultFont := AValue; +end; + +procedure TfpgStyle.SetFixedFont(AValue: TfpgFont); +begin + if FFixedFont = AValue then Exit; + FFixedFont.Free; + FFixedFont := AValue; +end; + +procedure TfpgStyle.SetMenuAccelFont(AValue: TfpgFont); +begin + if FMenuAccelFont = AValue then Exit; + FMenuAccelFont.Free; + FMenuAccelFont := AValue; +end; + +procedure TfpgStyle.SetMenuDisabledFont(AValue: TfpgFont); +begin + if FMenuDisabledFont = AValue then Exit; + FMenuDisabledFont.Free; + FMenuDisabledFont := AValue; +end; + +procedure TfpgStyle.SetMenuFont(AValue: TfpgFont); +begin + if FMenuFont = AValue then Exit; + FMenuFont.Free; + FMenuFont := AValue; +end; + constructor TfpgStyle.Create; begin // Setup font aliases fpgSetNamedFont('Label1', FPG_DEFAULT_FONT_DESC); fpgSetNamedFont('Label2', FPG_DEFAULT_FONT_DESC + ':bold'); fpgSetNamedFont('Edit1', FPG_DEFAULT_FONT_DESC); - fpgSetNamedFont('Edit2', 'Courier New-10'); + fpgSetNamedFont('Edit2', FPG_DEFAULT_FIXED_FONT_DESC); fpgSetNamedFont('List', FPG_DEFAULT_FONT_DESC); fpgSetNamedFont('Grid', FPG_DEFAULT_SANS + '-9'); fpgSetNamedFont('GridHeader', FPG_DEFAULT_SANS + '-9:bold'); @@ -2099,20 +2137,20 @@ begin // Global Font Objects - DefaultFont := fpgGetFont(fpgGetNamedFontDesc('Label1')); - FixedFont := fpgGetFont(fpgGetNamedFontDesc('Edit2')); - MenuFont := fpgGetFont(fpgGetNamedFontDesc('Menu')); - MenuAccelFont := fpgGetFont(fpgGetNamedFontDesc('MenuAccel')); - MenuDisabledFont := fpgGetFont(fpgGetNamedFontDesc('MenuDisabled')); + FDefaultFont := fpgGetFont(fpgGetNamedFontDesc('Label1')); + FFixedFont := fpgGetFont(fpgGetNamedFontDesc('Edit2')); + FMenuFont := fpgGetFont(fpgGetNamedFontDesc('Menu')); + FMenuAccelFont := fpgGetFont(fpgGetNamedFontDesc('MenuAccel')); + FMenuDisabledFont := fpgGetFont(fpgGetNamedFontDesc('MenuDisabled')); end; destructor TfpgStyle.Destroy; begin - DefaultFont.Free; - FixedFont.Free; - MenuFont.Free; - MenuAccelFont.Free; - MenuDisabledFont.Free; + FDefaultFont.Free; + FFixedFont.Free; + FMenuFont.Free; + FMenuAccelFont.Free; + FMenuDisabledFont.Free; inherited Destroy; end; @@ -2253,7 +2291,7 @@ begin ACanvas.SetColor(clWindowBackground); ACanvas.SetLineStyle(1, lsSolid); ACanvas.FillRectangle(x, y, w, h); - + if ARaised then ACanvas.SetColor(clHilite2) else @@ -2275,6 +2313,11 @@ begin ACanvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); end; +function TfpgStyle.GetBevelWidth: TfpgCoord; +begin + Result := 1; +end; + procedure TfpgStyle.DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: TArrowDirection); var { diff --git a/src/corelib/fpg_stdimages.pas b/src/corelib/fpg_stdimages.pas index b02331aa..a641fa32 100644 --- a/src/corelib/fpg_stdimages.pas +++ b/src/corelib/fpg_stdimages.pas @@ -288,7 +288,12 @@ begin 'stdimg.executable', @stdimg_executable_16, sizeof(stdimg_executable_16), 0,0); - + + fpgImages.AddMaskedBMP( + 'stdimg.colpicker', + @stdimg_colpicker, + sizeof(stdimg_colpicker), 0,0); + // Dialog icons fpgImages.AddMaskedBMP( diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index 9a135d73..df68a050 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -39,13 +39,14 @@ function fpgFileSize(const AFilename: TfpgString): integer; function fpgAddTrailingValue(const ALine, AValue: TfpgString; ADuplicates: Boolean = True): TfpgString; function fpgAppendPathDelim(const Path: TfpgString): TfpgString; function fpgHasSubDirs(const Dir: TfpgString; AShowHidden: Boolean): Boolean; -function fpgAllFilesMask: TfpgString; +function fpgAllFilesMask: TfpgString; deprecated; 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; +function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean; deprecated; +function fpgGetBit(const AData: LongInt; ABit: Longint): boolean; inline; +procedure fpgSetBit(var AData: Longint; ABit: Longint; const AValue: boolean); inline; +function fpgIntToBin(AValue: uint64; ADigits: byte=64): string; // RTL wrapper filesystem functions with platform independant encoding @@ -214,7 +215,6 @@ begin Result := Path; end; -{function fpgHasSubDirs returns True if the directory passed has subdirectories} function fpgHasSubDirs(const Dir: TfpgString; AShowHidden: Boolean): Boolean; var FileInfo: TSearchRec; @@ -225,7 +225,7 @@ begin if Dir <> '' then begin FCurrentDir := fpgAppendPathDelim(Dir); - FCurrentDir := FCurrentDir + fpgAllFilesMask; + FCurrentDir := FCurrentDir + AllFilesMask; try if fpgFindFirst(FCurrentDir, faAnyFile or $00000080, FileInfo) = 0 then repeat @@ -299,6 +299,31 @@ begin Result := (AData and (1 shl AIndex) <> 0); end; +function fpgGetBit(const AData: LongInt; ABit: Longint): boolean; +begin + Result := (AData and (1 shl ABit) <> 0); +end; + +procedure fpgSetBit(var AData: Longint; ABit: Longint; const AValue: boolean); +begin + if AValue <> fpgGetBit(AData, ABit) then + AData := AData xor (1 shl ABit); +end; + +function fpgIntToBin(AValue: uint64; ADigits: byte=64): string; +begin + SetLength(Result, ADigits); + while ADigits > 0 do + begin + if odd(AValue) then + Result[ADigits] := '1' + else + Result[ADigits] := '0'; + AValue := AValue shr 1; + dec(ADigits); + end; +end; + end. diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 527e2987..150a8284 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -39,8 +39,6 @@ type TfpgDragDropEvent = procedure(Sender, Source: TObject; X, Y: integer; AData: variant) of object; - { TfpgWidget } - TfpgWidget = class(TfpgWindow) private FAcceptDrops: boolean; @@ -176,7 +174,7 @@ type procedure KillFocus; procedure MoveAndResizeBy(const dx, dy, dw, dh: TfpgCoord); procedure SetPosition(aleft, atop, awidth, aheight: TfpgCoord); virtual; - procedure Invalidate; // double check this works as developers expect???? + procedure Invalidate; property FormDesigner: TObject read FFormDesigner write SetFormDesigner; property Parent: TfpgWidget read GetParent write SetParent; property AcceptDrops: boolean read FAcceptDrops write SetAcceptDrops default False; @@ -509,7 +507,7 @@ begin inherited Create(AOwner); - if (AOwner <> nil) and (AOwner is TfpgWidget) then + if (AOwner <> nil) and (AOwner is TfpgWidget) and (not (WindowType in [wtModalForm, wtPopup])) {and not InheritsFrom(TfpgForm)} then begin Parent := TfpgWidget(AOwner); FTabOrder := AOwner.ComponentCount; diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index f1372928..a1d314f6 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -246,6 +246,7 @@ type procedure DoFlush; function GetScreenWidth: TfpgCoord; override; function GetScreenHeight: TfpgCoord; override; + function GetScreenPixelColor(APos: TPoint): TfpgColor; override; function Screen_dpi_x: integer; override; function Screen_dpi_y: integer; override; function Screen_dpi: integer; override; @@ -347,6 +348,10 @@ var OldMousePos: TPoint; // used to detect fake MouseMove events NeedToUnitialize: Boolean; + +const + ID_ABOUT = 200001; + // some required keyboard functions {$INCLUDE fpg_keys_gdi.inc} @@ -1204,6 +1209,13 @@ begin Windows.EndPaint(w.WinHandle, @PaintStruct); end; + WM_SYSCOMMAND: + begin + if wParam = ID_ABOUT then + fpgSendMessage(nil, w, FPGM_ABOUT, msgp) + else + Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); + end else Result := Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); end; @@ -1279,7 +1291,7 @@ begin if MainForm <> nil then lHandle := TfpgGDIWindow(MainForm).FWinHandle else - lHandle := -1; + lHandle := 0; FHiddenWindow := CreateWindow('FPGHIDDEN', '', DWORD(WS_POPUP), 0, 0, 0, 0, lHandle, 0, MainInstance, nil); end; @@ -1405,6 +1417,14 @@ begin // Result := Windows.GetSystemMetrics(SM_CYSCREEN); end; +function TfpgGDIApplication.GetScreenPixelColor(APos: TPoint): TfpgColor; +var + c: longword; +begin + c := Windows.GetPixel(FDisplay, APos.X, APos.Y); + Result := WinColorTofpgColor(c); +end; + function TfpgGDIApplication.Screen_dpi_x: integer; begin Result := GetDeviceCaps(wapplication.display, LOGPIXELSX) @@ -2601,13 +2621,31 @@ var Result := c; end; + function LookAhead: char; + var + i: integer; + lc: char; + begin + i := cp+1; + if i > length(desc) then + lc := #0 + else + lc := desc[i]; + result := lc; + end; + procedure NextToken; begin token := ''; - while (c <> #0) and (c in [' ', 'a'..'z', 'A'..'Z', '_', '0'..'9']) do + while (c <> #0) and (c in [' ', 'a'..'z', 'A'..'Z', '_', '@', '0'..'9']) do begin token := token + c; NextC; + if (c = '-') and (LookAhead in [' ', 'a'..'z', 'A'..'Z', '_']) then + begin + token := token + c; + NextC; + end; end; end; diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk index dfe56c14..3566dc09 100644 --- a/src/corelib/gdi/fpgui_toolkit.lpk +++ b/src/corelib/gdi/fpgui_toolkit.lpk @@ -30,8 +30,8 @@ </CompilerOptions> <Description Value="fpGUI Toolkit"/> <License Value="LGPL 2 with static linking exception."/> - <Version Major="1" Minor="2"/> - <Files Count="104"> + <Version Major="1" Minor="4"/> + <Files Count="107"> <Item1> <Filename Value="..\stdimages.inc"/> <Type Value="Include"/> @@ -448,6 +448,18 @@ <Filename Value="..\..\gui\inputquerydialog.inc"/> <Type Value="Include"/> </Item104> + <Item105> + <Filename Value="..\..\gui\fpg_toggle.pas"/> + <UnitName Value="fpg_toggle"/> + </Item105> + <Item106> + <Filename Value="..\..\gui\fpg_stringgridbuilder.pas"/> + <UnitName Value="fpg_StringGridBuilder"/> + </Item106> + <Item107> + <Filename Value="..\fpg_csvparser.pas"/> + <UnitName Value="fpg_CSVParser"/> + </Item107> </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 12ac41b9..4704d56a 100644 --- a/src/corelib/gdi/fpgui_toolkit.pas +++ b/src/corelib/gdi/fpgui_toolkit.pas @@ -22,7 +22,8 @@ uses fpg_style_win2k, fpg_style_motif, fpg_style_clearlooks, fpg_style_bluecurve, fpg_style_bitmap, fpg_readonly, fpg_imgfmt_png, U_Command, U_Pdf, U_Report, U_ReportImages, U_Visu, fpg_trayicon, Agg2D, fpg_dbugintf, fpg_dbugmsg, - fpg_style_carbon, fpg_style_plastic, fpg_style_win8; + fpg_style_carbon, fpg_style_plastic, fpg_style_win8, fpg_toggle, + fpg_StringGridBuilder, fpg_CSVParser; implementation diff --git a/src/corelib/lang_af.inc b/src/corelib/lang_af.inc index bd15fe69..173dd6b2 100644 --- a/src/corelib/lang_af.inc +++ b/src/corelib/lang_af.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Eienskape'; rsshortaug = 'Aug'; rslongaug = 'Augustus'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Vetdruk'; rscancel = 'Kanselleer'; rscannotcreatedir = 'Kan nie die lêergids skep nie'; rschange = 'Verander'; -rschangetitle = 'Change Title'; +rschangetitle = 'Verander Titel'; rscharactermap = 'Karakter Kaart'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Sluit'; rscollection = 'Versameling'; -rsconfigurebookmarks = 'Configure Bookmarks'; +rstabsheetcolorwheel = 'Color Wheel'; +rsconfigurebookmarks = 'Instel Boekmerke'; rsconfirm = 'Bevestig'; rsconfirmation = 'Bevestiging'; +rscontinuous = 'Continuous'; rscopy = 'Kopieer'; rserrcouldnotopendir = 'Kon nie die lêergids <%s> oop maak nie'; rscreate = 'Skep'; @@ -43,7 +47,7 @@ rslongdec = 'Desember'; rskeydel = 'Del'; rsdelete = 'Skrap'; rsdirectories = 'Lêergidse'; -rsdirectory = 'Directory'; +rsdirectory = 'Lêergids'; rskeydown = 'Down'; rsdrive = 'Dryf'; rsedit = 'Redigeer'; @@ -56,7 +60,7 @@ rskeyesc = 'Esc'; rsexampletext = 'Teks Voorbeeld'; rsexit = 'Staak'; rserrfailedtocreatedir = 'Kon nie die lêergids <%s> skep nie'; -rsfailedtofindhelpviewer = 'Failed to find the help viewer.'; +rsfailedtofindhelpviewer = 'Kon nie die help program find nie.'; rsfalse = 'Onwaar'; rscollectionfavourites = 'Gunstelinge'; rsshortfeb = 'Feb'; @@ -67,14 +71,16 @@ rsfiles = 'Lêers'; rsfind = 'Vind'; rscollectionfixedwidth = 'Vaste wydte'; rscollectionfontaliases = 'Font Kenname'; -rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; +rserrreportfontfilemissing = 'Font lêer" <%s.fnt> is nie gevind nie'; rsshortfri = 'Vr'; rslongfri = 'Vrydag'; +rscolorgreen = 'Green'; rsfilegroup = 'Groep'; rshelp = 'Help'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignoreer'; -rserrreportimagefilemissing = 'Image <%s> is missing'; +rserrreportimagefilemissing = 'Beeld-lêer <%s> is vermis'; rsinformation = 'Informasie'; rskeyins = 'Ins'; rsinsert = 'Invoeg'; @@ -98,8 +104,8 @@ rskeymeta = 'Meta+'; rsfilemodifiedtime = 'Wysigings Tyd'; rsshortmon = 'Ma'; rslongmon = 'Maandag'; -rsmovedown = 'Move Down'; -rsmoveup = 'Move Up'; +rsmovedown = 'Skyf Af'; +rsmoveup = 'Skyf Op'; rsname = 'Naam'; rsno = 'Nee'; rsnotoall = 'Nee vir Alles'; @@ -111,14 +117,16 @@ rslongoct = 'Oktober'; rsopen = 'Open'; rsopenafile = 'Maak ''n leêr op'; rsfileowner = 'Eienaar'; -rsfiletypepdf = 'PDF Documents'; -rsreportpage = 'Page'; +rsfiletypepdf = 'PDF Dokumente'; +rsreportpage = 'Bladsy'; rspassword = 'Wagwoord'; rspaste = 'Plak'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; -rsreportpreview = 'Preview'; +rstabpredefined = 'Predefined'; +rsreportpreview = 'Voorskou'; rscollectionrecentlyused = 'Onlangs gebruik'; +rscolorred = 'Red'; rsreplace = 'Vervang'; rsretry = 'Herprobeer'; rskeyright = 'Right'; @@ -129,7 +137,7 @@ rslongsat = 'Saterdag'; rssave = 'Stoor'; rssaveafile = 'Stoor ''n lêer as'; rssearch = 'Soek'; -rsreportsection = 'Section'; +rsreportsection = 'Seksie'; rsselect = 'Kies'; rsselectadirectory = 'Kies ''n lêergids'; rsselectafont = 'Kies ''n lettertipe'; @@ -145,7 +153,7 @@ rsshortsun = 'So'; rslongsun = 'Sondag'; rskeytab = 'Tab'; rstexttoinsert = 'Teks om in te voeg'; -rserrreportnopagestoprint = 'There are no pages to print'; +rserrreportnopagestoprint = 'Daar is geen bladsye om te druk nie'; rsshortthu = 'Do'; rslongthu = 'Donderdag'; rstoday = 'Vandag'; @@ -163,4 +171,4 @@ rslongwed = 'Woensdag'; rsaddnewitem = 'Wil jy die nuwe item <%s> in die lys bylas?'; rsyes = 'Ja'; rsyestoall = 'Ja vir Alles'; -rsreportpageof = 'of'; +rsreportpageof = 'van'; diff --git a/src/corelib/lang_de.inc b/src/corelib/lang_de.inc index e8fe0a9a..a261926f 100644 --- a/src/corelib/lang_de.inc +++ b/src/corelib/lang_de.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Attribute'; rsshortaug = 'Aug'; rslongaug = 'August'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Fett'; rscancel = 'Abbrechen'; rscannotcreatedir = 'Kann Verzeichnis nicht anlegen'; rschange = 'Ändern'; rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Schließen'; rscollection = 'Sammlung'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Bestätigen'; rsconfirmation = 'Bestätigung'; +rscontinuous = 'Continuous'; rscopy = 'Kopieren'; rserrcouldnotopendir = 'Konnte Verzeichnis <%> nicht anlegen'; rscreate = 'Anlegen'; @@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font-Aliase'; rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; rsshortfri = 'Fre'; rslongfri = 'Freitag'; +rscolorgreen = 'Green'; rsfilegroup = 'Gruppe'; rshelp = 'Hilfe'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ãœbergehen'; rserrreportimagefilemissing = 'Image <%s> is missing'; @@ -117,8 +123,10 @@ rspassword = 'Passwort'; rspaste = 'Einfügen'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Zuletzt verwendet'; +rscolorred = 'Red'; rsreplace = 'Ersetzen'; rsretry = 'Wiederholen'; rskeyright = 'Right'; diff --git a/src/corelib/lang_en.inc b/src/corelib/lang_en.inc index 6a681932..aec26b22 100644 --- a/src/corelib/lang_en.inc +++ b/src/corelib/lang_en.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Attributes'; rsshortaug = 'Aug'; rslongaug = 'August'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Bold'; rscancel = 'Cancel'; rscannotcreatedir = 'Cannot create directory'; rschange = 'Change'; rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Close'; rscollection = 'Collection'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirm'; rsconfirmation = 'Confirmation'; +rscontinuous = 'Continuous'; rscopy = 'Copy'; rserrcouldnotopendir = 'Could not open the directory <%s>'; rscreate = 'Create'; @@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases'; rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; rsshortfri = 'Fri'; rslongfri = 'Friday'; +rscolorgreen = 'Green'; rsfilegroup = 'Group'; rshelp = 'Help'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignore'; rserrreportimagefilemissing = 'Image <%s> is missing'; @@ -117,8 +123,10 @@ rspassword = 'Password'; rspaste = 'Paste'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Recently Used'; +rscolorred = 'Red'; rsreplace = 'Replace'; rsretry = 'Retry'; rskeyright = 'Right'; diff --git a/src/corelib/lang_es.inc b/src/corelib/lang_es.inc index 780af188..f53ccb76 100644 --- a/src/corelib/lang_es.inc +++ b/src/corelib/lang_es.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Atributos'; rsshortaug = 'Aug'; rslongaug = 'August'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Negrita'; rscancel = 'Cancelar'; rscannotcreatedir = 'No se puede crear la carpeta'; rschange = 'Cambiar'; rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Cerrar'; rscollection = 'Colección'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirmar'; rsconfirmation = 'Confirmación'; +rscontinuous = 'Continuous'; rscopy = 'Copiar'; rserrcouldnotopendir = 'No se puede abrir la carpeta <%s>'; rscreate = 'Create'; @@ -70,8 +74,10 @@ rscollectionfontaliases = 'Aliases de Fuentes'; rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; rsshortfri = 'Vie'; rslongfri = 'Viernes'; +rscolorgreen = 'Green'; rsfilegroup = 'Grupo'; rshelp = 'Ayuda'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignorar'; rserrreportimagefilemissing = 'Image <%s> is missing'; @@ -117,8 +123,10 @@ rspassword = 'Contraseña'; rspaste = 'Pegar'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Usados Recientemente'; +rscolorred = 'Red'; rsreplace = 'Reemplazar'; rsretry = 'Reintentar'; rskeyright = 'Right'; diff --git a/src/corelib/lang_fr.inc b/src/corelib/lang_fr.inc index 7409c5ff..0a9a8e21 100644 --- a/src/corelib/lang_fr.inc +++ b/src/corelib/lang_fr.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Attributs'; rsshortaug = 'Aoû'; rslongaug = 'Août'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Gras'; rscancel = 'Annuler'; rscannotcreatedir = 'Impossible de créer le répertoire'; rschange = 'Modifier'; rschangetitle = 'Changer le titre'; rscharactermap = 'Table de caractères'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Fermer'; rscollection = 'Collection'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configurer les signets'; rsconfirm = 'Confirmer'; rsconfirmation = 'Confirmation'; +rscontinuous = 'Continuous'; rscopy = 'Copier'; rserrcouldnotopendir = 'Le répertoire <%s> n''''a pas pu être ouvert'; rscreate = 'Créer'; @@ -56,8 +60,8 @@ rskeyesc = 'Esc'; rsexampletext = 'Texte exemple'; rsexit = 'Sortir'; rserrfailedtocreatedir = 'Le répertoire <%s> n''''a pas pu être ouvert'; -rsfailedtofindhelpviewer = 'Failed to find the help viewer.'; -rsfalse = 'False'; +rsfailedtofindhelpviewer = 'Visualiseur d''aide non trouvé'; +rsfalse = 'Faux'; rscollectionfavourites = 'Favoris'; rsshortfeb = 'Fév'; rslongfeb = 'Février'; @@ -67,14 +71,16 @@ rsfiles = 'Fichiers'; rsfind = 'Trouver'; rscollectionfixedwidth = 'Longueur fixe'; rscollectionfontaliases = 'Alias'; -rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; +rserrreportfontfilemissing = 'Fichier de police <%s.fnt> non trouvé'; rsshortfri = 'Ven'; rslongfri = 'Vendredi'; +rscolorgreen = 'Green'; rsfilegroup = 'Groupe'; rshelp = 'Aide'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignorer'; -rserrreportimagefilemissing = 'Image <%s> is missing'; +rserrreportimagefilemissing = 'Image <%s> introuvable'; rsinformation = 'Information'; rskeyins = 'Ins'; rsinsert = 'Insérer'; @@ -111,14 +117,16 @@ rslongoct = 'Octobre'; rsopen = 'Ouvrir'; rsopenafile = 'Ouvrir un fichier'; rsfileowner = 'Propriétaire'; -rsfiletypepdf = 'PDF Documents'; +rsfiletypepdf = 'Documents PDF'; rsreportpage = 'Page'; rspassword = 'Mot de passe'; rspaste = 'Coller'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; -rsreportpreview = 'Preview'; +rstabpredefined = 'Predefined'; +rsreportpreview = 'Prévisualisation'; rscollectionrecentlyused = 'Récemment utilisé'; +rscolorred = 'Red'; rsreplace = 'Remplacer'; rsretry = 'Retenter'; rskeyright = 'Right'; @@ -145,7 +153,7 @@ rsshortsun = 'Dim'; rslongsun = 'Dimanche'; rskeytab = 'Tab'; rstexttoinsert = 'Texte à insérer'; -rserrreportnopagestoprint = 'There are no pages to print'; +rserrreportnopagestoprint = 'Il n''y a pas de page à imprimer'; rsshortthu = 'Jeu'; rslongthu = 'Jeudi'; rstoday = 'Aujourd''''hui'; @@ -163,4 +171,4 @@ rslongwed = 'Mercredi'; rsaddnewitem = 'Voulez-vous ajouter l''''item <%s> à la liste?'; rsyes = 'Oui'; rsyestoall = 'Oui à tous'; -rsreportpageof = 'of'; +rsreportpageof = 'de'; diff --git a/src/corelib/lang_it.inc b/src/corelib/lang_it.inc index 2ab860ad..26eb36d8 100644 --- a/src/corelib/lang_it.inc +++ b/src/corelib/lang_it.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Attributi'; rsshortaug = 'Ago'; rslongaug = 'Agosto'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Grassetto'; rscancel = 'Annulla'; rscannotcreatedir = 'Non riesco a creare la cartella'; rschange = 'Cambia'; rschangetitle = 'Change Title'; rscharactermap = 'Character Map'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Chiudi'; rscollection = 'Collezione'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Conferma'; rsconfirmation = 'Conferma'; +rscontinuous = 'Continuous'; rscopy = 'Copia'; rserrcouldnotopendir = 'Impossibile aprire la cartella <%s>'; rscreate = 'Crea'; @@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases'; rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; rsshortfri = 'Ven'; rslongfri = 'Venerdì'; +rscolorgreen = 'Green'; rsfilegroup = 'Gruppo'; rshelp = 'Aiuto'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignora'; rserrreportimagefilemissing = 'Image <%s> is missing'; @@ -117,8 +123,10 @@ rspassword = 'Password'; rspaste = 'Incolla'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Usati Recentemente'; +rscolorred = 'Red'; rsreplace = 'Sostituisci'; rsretry = 'Riprova'; rskeyright = 'Right'; diff --git a/src/corelib/lang_pt.inc b/src/corelib/lang_pt.inc index f9c4aa13..fb3dd92b 100644 --- a/src/corelib/lang_pt.inc +++ b/src/corelib/lang_pt.inc @@ -19,17 +19,21 @@ rsfileattributes = 'Atributos'; rsshortaug = 'Ago'; rslongaug = 'Agosto'; rskeybksp = 'BkSp'; +rscolorblue = 'Blue'; rsbold = 'Negrito'; rscancel = 'Cancelar'; rscannotcreatedir = 'Não foi possÃvel criar diretório'; rschange = 'Editar'; rschangetitle = 'Mudar TÃtulo'; rscharactermap = 'Mapa de Caracteres'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Fechar'; rscollection = 'Coleção'; +rstabsheetcolorwheel = 'Color Wheel'; rsconfigurebookmarks = 'Configure Bookmarks'; rsconfirm = 'Confirmar'; rsconfirmation = 'Confirmação'; +rscontinuous = 'Continuous'; rscopy = 'Copiar'; rserrcouldnotopendir = 'Não pode abrir o diretório <%s>'; rscreate = 'Criar'; @@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases'; rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; rsshortfri = 'Sex'; rslongfri = 'Sexta-feira'; +rscolorgreen = 'Green'; rsfilegroup = 'Grupo'; rshelp = 'Ajuda'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'Ignorar'; rserrreportimagefilemissing = 'Image <%s> is missing'; @@ -117,8 +123,10 @@ rspassword = 'Senha'; rspaste = 'Colar'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Recentemente Usado'; +rscolorred = 'Red'; rsreplace = 'Substituir'; rsretry = 'Retentar'; rskeyright = 'Right'; diff --git a/src/corelib/lang_ru.inc b/src/corelib/lang_ru.inc index a6d8a46e..ce5b753e 100644 --- a/src/corelib/lang_ru.inc +++ b/src/corelib/lang_ru.inc @@ -7,7 +7,7 @@ rserrnotassigned = 'Значение <%s> не определено'; rsnewitemdetected = 'Обнаружен новый Ñлемент'; rsabort = 'Прервать'; rsabout = 'Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ %s'; -rsaddcurrentdirectory = 'Add current directory'; +rsaddcurrentdirectory = 'Добавить текущую директорию'; rsall = 'Ð’Ñе'; rsallfiles = 'Ð’Ñе файлы'; rscollectionallfonts = 'Ð’Ñе шрифты'; @@ -19,17 +19,21 @@ rsfileattributes = 'Ðтрибуты'; rsshortaug = 'Ðвг'; rslongaug = 'ÐвгуÑÑ‚'; rskeybksp = 'BkSp'; +rscolorblue = 'Синий'; rsbold = 'Жирный'; rscancel = 'Отмена'; rscannotcreatedir = 'Ðевозможно Ñоздать директорию'; rschange = 'Изменить'; -rschangetitle = 'Change Title'; +rschangetitle = 'Изменить Заголовок'; rscharactermap = 'Character Map'; +rscolorpickerhint = 'Click on Picker and maintain click => release to get the color'; rsclose = 'Закрыть'; rscollection = 'Группа'; -rsconfigurebookmarks = 'Configure Bookmarks'; +rstabsheetcolorwheel = 'Color Wheel'; +rsconfigurebookmarks = 'ÐаÑтроить Закладки'; rsconfirm = 'Подтвердить'; rsconfirmation = 'Подтверждение'; +rscontinuous = 'Continuous'; rscopy = 'Копировать'; rserrcouldnotopendir = 'Ðевозможно открыть директорию <%s>'; rscreate = 'Создать'; @@ -43,7 +47,7 @@ rslongdec = 'Декабрь'; rskeydel = 'Del'; rsdelete = 'Удалить'; rsdirectories = 'Директории'; -rsdirectory = 'Directory'; +rsdirectory = 'ДиректориÑ'; rskeydown = 'Down'; rsdrive = 'ДиÑк'; rsedit = 'Редактировать'; @@ -67,14 +71,16 @@ rsfiles = 'Файлы'; rsfind = 'Ðайти'; rscollectionfixedwidth = 'Моноширинные'; rscollectionfontaliases = 'ПÑевдонимы шрифтов'; -rserrreportfontfilemissing = 'Font file <%s.fnt> not found'; +rserrreportfontfilemissing = 'Файл шрифта <%s.fnt> не найден'; rsshortfri = 'Пт'; rslongfri = 'ПÑтница'; +rscolorgreen = 'Green'; rsfilegroup = 'Группа'; rshelp = 'Справка'; +rshexadecimal = 'Hexadecimal'; rskeyhome = 'Home'; rsignore = 'ПропуÑтить'; -rserrreportimagefilemissing = 'Image <%s> is missing'; +rserrreportimagefilemissing = 'Изображение <%s> не найдено'; rsinformation = 'ИнформациÑ'; rskeyins = 'Ins'; rsinsert = 'Ð’Ñтавка'; @@ -111,14 +117,16 @@ rslongoct = 'ОктÑбрь'; rsopen = 'Открыть'; rsopenafile = 'Открыть файл'; rsfileowner = 'Владелец'; -rsfiletypepdf = 'PDF Documents'; +rsfiletypepdf = 'PDF Документы'; rsreportpage = 'Page'; rspassword = 'Пароль'; rspaste = 'Ð’Ñтавить'; rskeypgdn = 'PgDn'; rskeypgup = 'PgUp'; +rstabpredefined = 'Predefined'; rsreportpreview = 'Preview'; rscollectionrecentlyused = 'Ранее иÑпользованные'; +rscolorred = 'Red'; rsreplace = 'Заменить'; rsretry = 'Повторить'; rskeyright = 'Right'; @@ -145,7 +153,7 @@ rsshortsun = 'Ð’Ñ'; rslongsun = 'ВоÑкреÑенье'; rskeytab = 'Tab'; rstexttoinsert = 'Text to Insert'; -rserrreportnopagestoprint = 'There are no pages to print'; +rserrreportnopagestoprint = 'Ðет Ñтраниц Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸'; rsshortthu = 'Чт'; rslongthu = 'Четверг'; rstoday = 'СегоднÑ'; diff --git a/src/corelib/render/software/Agg2D.pas b/src/corelib/render/software/Agg2D.pas index 229294d2..b77b9ce9 100644 --- a/src/corelib/render/software/Agg2D.pas +++ b/src/corelib/render/software/Agg2D.pas @@ -2653,9 +2653,10 @@ procedure TAgg2D.Font( italic : boolean = false; cache : TAggFontCacheType = AGG_VectorFontCache; angle : double = 0.0 ); +{$IFDEF AGG2D_USE_WINFONTS} var b : int; - +{$ENDIF} begin m_textAngle :=angle; m_fontHeight :=height; @@ -3559,7 +3560,7 @@ procedure TAgg2D.DoSetFontRes(fntres: TfpgFontResourceBase); {$IFDEF WINDOWS} begin {$IFDEF AGG2D_USE_FREETYPE } - Font('c:\WINNT\Fonts\arial.ttf', 10); + Font(GetWindowsFontDir + 'arial.ttf', 10); {$ENDIF } {$IFDEF AGG2D_USE_WINFONTS} Font('Arial', 13); diff --git a/src/corelib/render/software/agg-demos/extrafpc.cfg b/src/corelib/render/software/agg-demos/extrafpc.cfg new file mode 100644 index 00000000..94482a02 --- /dev/null +++ b/src/corelib/render/software/agg-demos/extrafpc.cfg @@ -0,0 +1,21 @@ +-FUunits +-Fu../ +-Fu../ctrl/ +#IFDEF UNIX + -Fu../platform/linux/ +#ENDIF +#IFDEF WINDOWS + -Fu../platform/win/ + -WG +#ENDIF +#IFDEF Carbon + -Fu../platform/mac/ +#ENDIF +-Fu../svg/ +-Fu../util/ +-Fi../ +-Xs +-XX +-CX +-Mdelphi + diff --git a/src/corelib/render/software/agg_2D.pas b/src/corelib/render/software/agg_2D.pas index 45d88e44..0fcbc3d9 100644 --- a/src/corelib/render/software/agg_2D.pas +++ b/src/corelib/render/software/agg_2D.pas @@ -414,9 +414,9 @@ type opt : ViewportOption = XMidYMid ); // Basic Shapes - procedure line (x1 ,y1 ,x2 ,y2 : double ); + procedure line (const x1 ,y1 ,x2 ,y2 : double; AFixAlignment: boolean = false ); procedure triangle (x1 ,y1 ,x2 ,y2 ,x3 ,y3 : double ); - procedure rectangle(x1 ,y1 ,x2 ,y2 : double ); + procedure rectangle(const x1 ,y1 ,x2 ,y2 : double; AFixAlignment: boolean = false); procedure roundedRect(x1 ,y1 ,x2 ,y2 ,r : double ); overload; procedure roundedRect(x1 ,y1 ,x2 ,y2 ,rx ,ry : double ); overload; @@ -443,7 +443,7 @@ type fileName : char_ptr; height : double; bold : boolean = false; italic : boolean = false; - ch : FontCacheType = RasterFontCache; + ch : FontCacheType = VectorFontCache; angle : double = 0.0 ); function fontHeight : double; @@ -1876,13 +1876,25 @@ begin end; { LINE } -procedure Agg2D.line(x1 ,y1 ,x2 ,y2 : double ); +procedure Agg2D.line(const x1, y1, x2, y2: double; AFixAlignment: boolean = false); +var + lx1, ly1, lx2, ly2: double; begin m_path.remove_all; - addLine (x1 ,y1 ,x2 ,y2 ); - drawPath(StrokeOnly ); + lx1 := x1; + ly1 := y1; + lx2 := x2; + ly2 := y2; + if AFixAlignment then + begin + AlignPoint(@lx1, @ly1); + AlignPoint(@lx2, @ly2); + end; + + addLine(lx1, ly1, lx2, ly2); + drawPath(StrokeOnly); end; { TRIANGLE } @@ -1899,13 +1911,27 @@ begin end; { RECTANGLE } -procedure Agg2D.rectangle(x1 ,y1 ,x2 ,y2 : double ); +procedure Agg2D.rectangle(const x1 ,y1 ,x2 ,y2 : double; AFixAlignment: boolean); +var + lx1, ly1, lx2, ly2: double; begin m_path.remove_all; - m_path.move_to(x1 ,y1 ); - m_path.line_to(x2 ,y1 ); - m_path.line_to(x2 ,y2 ); - m_path.line_to(x1 ,y2 ); + + lx1 := x1; + ly1 := y1; + lx2 := x2; + ly2 := y2; + + if AFixAlignment then + begin + AlignPoint(@lx1, @ly1); + AlignPoint(@lx2, @ly2); + end; + + m_path.move_to(lx1 ,ly1 ); + m_path.line_to(lx2 ,ly1 ); + m_path.line_to(lx2 ,ly2 ); + m_path.line_to(lx1 ,ly2 ); m_path.close_polygon; drawPath(FillAndStroke ); @@ -2102,7 +2128,7 @@ procedure Agg2D.font( fileName : char_ptr; height : double; bold : boolean = false; italic : boolean = false; - ch : FontCacheType = RasterFontCache; + ch : FontCacheType = VectorFontCache; angle : double = 0.0 ); var b : int; @@ -2121,10 +2147,11 @@ begin m_fontEngine.hinting_(m_textHints ); if ch = VectorFontCache then - m_fontEngine.height_(height ) + {$NOTE We need to fix this. Translating from font pt to pixels is inaccurate. This is just a temp fix for now. } + m_fontEngine.height_(height * 1.3333 ) // 9pt = ~12px so that is a ratio of 1.3333 else m_fontEngine.height_(worldToScreen(height ) ); -{$ENDIF } +{$ENDIF} {$IFDEF AGG2D_USE_WINFONTS} m_fontEngine.hinting_(m_textHints ); @@ -2167,7 +2194,9 @@ end; procedure Agg2D.textHints(hints : boolean ); begin m_textHints:=hints; - + {$IFNDEF AGG2D_NO_FONT} + m_fontEngine.hinting_(m_textHints ); + {$ENDIF} end; { TEXTWIDTH } @@ -2350,6 +2379,7 @@ end; procedure Agg2D.resetPath; begin m_path.remove_all; + m_path.move_to(0 ,0 ); end; diff --git a/src/corelib/render/software/agg_blur.pas b/src/corelib/render/software/agg_blur.pas index 5ddda2bc..78e6df72 100644 --- a/src/corelib/render/software/agg_blur.pas +++ b/src/corelib/render/software/agg_blur.pas @@ -25,7 +25,7 @@ // http://incubator.quasimondo.com/processing/fast_blur_deluxe.php // (search phrase "Stackblur: Fast But Goodlooking"). // The major improvement is that there's no more division table -// that was very expensive to create for large blur radii. Insted, +// that was very expensive to create for large blur radii. Instead, // for 8-bit per channel and radius not exceeding 254 the division is // replaced by multiplication and shift. // diff --git a/src/corelib/render/software/agg_platform_gdi.inc b/src/corelib/render/software/agg_platform_gdi.inc index 88d3b586..c61d068f 100644 --- a/src/corelib/render/software/agg_platform_gdi.inc +++ b/src/corelib/render/software/agg_platform_gdi.inc @@ -21,6 +21,19 @@ type // to get access to protected methods (seeing that FPC doesn't support Friend-classes) TImageHack = class(TfpgImage); +function GetWindowsFontDir: string; +var + lWinFontPath: array[0..MAX_PATH] of WideChar; + lPasWinFontPath: string; + i: Integer; +begin + // Find for example C:\Windows\Fonts or C:\WINNT\Fonts + Windows.GetWindowsDirectoryW(@lWinFontPath[0], MAX_PATH); + lPasWinFontPath := lWinFontPath; + lPasWinFontPath := IncludeTrailingPathDelimiter(lPasWinFontPath) + 'Fonts' + PathDelim; + Result := lPasWinFontPath; +end; + procedure TAgg2D.DoPutBufferToScreen(x, y, w, h: TfpgCoord); var srcdc: HDC; diff --git a/src/corelib/stdimages.inc b/src/corelib/stdimages.inc index 36255154..510a1ce6 100644 --- a/src/corelib/stdimages.inc +++ b/src/corelib/stdimages.inc @@ -3222,4 +3222,26 @@ Const 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255); +const + stdimg_colpicker: array[0..333] of byte = ( + 66, 77, 78, 1, 0, 0, 0, 0, 0, 0,118, 0, 0, 0, 40, 0, 0, + 0, 18, 0, 0, 0, 18, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 16, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0,132,132, 0, 0,255,255, 0, 0, 0, 0, + 132, 0,132,132,132, 0,206,214,214, 0, 0, 0,255, 0,255,255,255, + 0,255,255,255, 0,255,255,255, 0,255,255,255, 0,255,255,255, 0, + 255,255,255, 0,255,255,255, 0,255,255,255, 0,255,255,255, 0, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0, 85, 34, 34, 37, 85, 85, + 85, 85, 85, 0, 0, 0, 82, 34, 34, 34, 37, 85, 85, 85, 85, 0, 0, + 0, 85, 80, 5, 85, 85, 85, 85, 85, 85, 0, 0, 0, 85, 80, 32, 5, + 85, 85, 85, 85, 85, 0, 0, 0, 85, 85, 1, 64, 85, 85, 85, 85, 85, + 0, 0, 0, 85, 85, 2, 20, 5, 85, 85, 85, 85, 0, 0, 0, 85, 85, + 80, 33, 64, 85, 85, 85, 85, 0, 0, 0, 85, 85, 85, 5,116, 5, 85, + 85, 85, 0, 0, 0, 85, 85, 85, 80, 87, 64, 85, 85, 85, 0, 0, 0, + 85, 85, 85, 85, 5,116, 3, 85, 85, 0, 0, 0, 85, 85, 85, 85, 80, + 83, 48, 69, 85, 0, 0, 0, 85, 85, 85, 85, 85, 54, 3, 52, 85, 0, + 0, 0, 85, 85, 85, 85, 85, 99, 99, 51, 69, 0, 0, 0, 85, 85, 85, + 85, 85, 85, 54, 99, 53, 0, 0, 0, 85, 85, 85, 85, 85, 85, 55, 99, + 53, 0, 0, 0, 85, 85, 85, 85, 85, 85, 83, 51, 69, 0, 0, 0, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0); diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 569772ae..ff6e7272 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -222,6 +222,7 @@ type TfpgX11Window = class(TfpgWindowBase) private QueueEnabledDrops: boolean; + procedure ApplyFormIcon; protected FWinFlags: TXWindowStateFlags; FWinHandle: TfpgWinHandle; @@ -315,6 +316,7 @@ type xia_wm_protocols: TAtom; xia_wm_delete_window: TAtom; xia_wm_state: TAtom; + xia_net_wm_icon: TAtom; xia_targets: TAtom; xia_save_targets: TAtom; netlayer: TNETWindowLayer; @@ -331,6 +333,7 @@ type procedure DoFlush; function GetScreenWidth: TfpgCoord; override; function GetScreenHeight: TfpgCoord; override; + function GetScreenPixelColor(APos: TPoint): TfpgColor; override; function Screen_dpi_x: integer; override; function Screen_dpi_y: integer; override; function Screen_dpi: integer; override; @@ -1068,19 +1071,19 @@ begin {$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), + BoolToStr(fpgGetBit(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 + if fpgGetBit(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 + if fpgGetBit(ev.xclient.data.l[1], 0) then begin // now fetch the data XGetWindowProperty(Display, FSrcWinHandle, @@ -1483,6 +1486,7 @@ begin 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)); + xia_net_wm_icon := XInternAtom(FDisplay, '_NET_WM_ICON', TBool(False)); { initializa the XDND atoms } FDNDTypeList := TObjectList.Create; @@ -1685,7 +1689,7 @@ begin OnIdle(self); fpFD_ZERO(rfds); fpFD_SET(xfd, rfds); - r := fpSelect(xfd + 1, @rfds, nil, nil, {atimeoutms} 50); + r := fpSelect(xfd + 1, @rfds, nil, nil, Min(atimeoutms, 50)); if r <> 0 then // We got a X event or the timeout happened XNextEvent(display, @ev) else @@ -2240,6 +2244,28 @@ begin Result := wa.Height; end; +function TfpgX11Application.GetScreenPixelColor(APos: TPoint): TfpgColor; +var + Image: PXImage; + Pixel: Cardinal; + x_Color: TXColor; +begin + Result := 0; + Image := XGetImage(Display, FRootWindow, APos.X, APos.Y, 1, 1, $FFFFFFFF, ZPixmap); + if Image = nil then + raise Exception.Create('fpGFX/X11: Invalid XImage'); + try + Pixel := XGetPixel(Image, 0, 0); + x_Color.pixel := Pixel; + XQueryColor(Display, DefaultColorMap, @x_Color); + Result := TfpgColor(((x_Color.red and $00FF) shl 16) or + ((x_Color.green and $00FF) shl 8) or + (x_Color.blue and $00FF)); + finally + XDestroyImage(Image); + end; +end; + function TfpgX11Application.Screen_dpi_x: integer; var mm: integer; @@ -2278,6 +2304,45 @@ end; { TfpgX11Window } +procedure TfpgX11Window.ApplyFormIcon; +var + ico: TfpgImage; + ar1: array of longword; // 32 bit CPU's + ar2: array of qword; // 64 bit CPU's + ps: pbyte; + pd: ^TRGBTriple; + i: integer; + iconName: string; +begin + if self is TfpgForm then + iconName := TfpgForm(self).IconName; + if iconName = '' then + Exit; + ico := fpgImages.GetImage(iconName); + if Assigned(ico) then + begin + SetLength(ar1, 2 + (ico.Width * ico.Height)); + ar1[0] := ico.Width; + ar1[1] := ico.Height; + pd := @ar1[2]; + ps := ico.ImageData; + move(ps^,pd^, ico.ImageDataSize); + end + else + exit; // we don't have a icon to set + + {$ifdef cpu64} + setlength(ar2,length(ar1)); + for i := low(ar2) to high(ar2) do + ar2[i] := ar1[i]; // copy array data over + XChangeProperty(xapplication.display, FWinHandle, xapplication.xia_net_wm_icon, + XA_CARDINAL, 32, PropModeReplace, @ar2[0], Length(ar2)); + {$else} + XChangeProperty(xapplication.display, FWinHandle, xapplication.xia_net_wm_icon, + XA_CARDINAL, 32, PropModeReplace, @ar1[0], Length(ar1)); + {$endif} +end; + procedure TfpgX11Window.DoAllocateWindowHandle(AParent: TfpgWindowBase); var pwh: TfpgWinHandle; @@ -2290,11 +2355,13 @@ var WMHints: PXWMHints; prop: TAtom; mwmhints: TMWMHints; + IsToplevel: Boolean; begin if HandleIsValid then Exit; //==> - if AParent <> nil then + IsToplevel := (AParent = nil) or (FWindowType in [wtModalForm, wtPopup]); + if not IsToplevel then pwh := TfpgX11Window(AParent).WinHandle else pwh := xapplication.RootWindow; @@ -2333,16 +2400,16 @@ begin FWinHandle := wh; FBackupWinHandle := wh; - if AParent = nil then // is a toplevel window + if IsToplevel then // is a toplevel window begin { setup a window icon } - IconPixMap := XCreateBitmapFromData(fpgApplication.Display, FWinHandle, + + IconPixMap := XCreateBitmapFromData(xapplication.display, FWinHandle, @IconBitmapBits, IconBitmapWidth, IconBitmapHeight); WMHints := XAllocWMHints; WMHints^.icon_pixmap := IconPixmap; WMHints^.flags := IconPixmapHint; - { setup window grouping posibilities } if (not (waX11SkipWMHints in FWindowAttributes)) and (FWindowType = wtWindow) then begin @@ -2350,8 +2417,7 @@ begin WMHints^.window_group := xapplication.FLeaderWindow; end; - - XSetWMProperties(fpgApplication.Display, FWinHandle, nil, nil, nil, 0, nil, WMHints, nil); + XSetWMProperties(xapplication.display, FWinHandle, nil, nil, nil, 0, nil, WMHints, nil); if (not (waX11SkipWMHints in FWindowAttributes)) and (FWindowType = wtWindow) then begin @@ -2372,6 +2438,9 @@ begin begin DoDNDEnabled(True); end; + + if xapplication.xia_net_wm_icon <> 0 then + ApplyFormIcon; end; FillChar(hints, sizeof(hints), 0); @@ -2427,11 +2496,13 @@ begin // for modal windows, this is necessary if FWindowType = wtModalForm then begin - if Parent = nil then + if IsToplevel then begin lmwh := 0; if fpgApplication.PrevModalForm <> nil then lmwh := TfpgX11Window(fpgApplication.PrevModalForm).WinHandle + {else if AParent <> nil then + lmwh := TfpgX11Window(AParent).WinHandle} { 2011-03-24: Graeme Geldenhuys I commented code this code because it caused more problems that it solved when multiple modal dialogs or prompts are shown in succession. diff --git a/src/corelib/x11/fpgui_toolkit.lpk b/src/corelib/x11/fpgui_toolkit.lpk index ec8c841f..f53dd62e 100644 --- a/src/corelib/x11/fpgui_toolkit.lpk +++ b/src/corelib/x11/fpgui_toolkit.lpk @@ -28,8 +28,8 @@ </CompilerOptions> <Description Value="fpGUI Toolkit"/> <License Value="LGPL 2 with static linking exception."/> - <Version Major="1" Minor="2"/> - <Files Count="107"> + <Version Major="1" Minor="4"/> + <Files Count="110"> <Item1> <Filename Value="../stdimages.inc"/> <Type Value="Include"/> @@ -458,6 +458,18 @@ <Filename Value="../../gui/inputintegerdialog.inc"/> <Type Value="Include"/> </Item107> + <Item108> + <Filename Value="../../gui/fpg_toggle.pas"/> + <UnitName Value="fpg_toggle"/> + </Item108> + <Item109> + <Filename Value="../../gui/fpg_stringgridbuilder.pas"/> + <UnitName Value="fpg_StringGridBuilder"/> + </Item109> + <Item110> + <Filename Value="../fpg_csvparser.pas"/> + <UnitName Value="fpg_CSVParser"/> + </Item110> </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/x11/fpgui_toolkit.pas b/src/corelib/x11/fpgui_toolkit.pas index 86e456f4..be9f3b5a 100644 --- a/src/corelib/x11/fpgui_toolkit.pas +++ b/src/corelib/x11/fpgui_toolkit.pas @@ -22,8 +22,9 @@ uses fpg_stylemanager, fpg_style_win2k, fpg_style_motif, fpg_style_clearlooks, fpg_style_bluecurve, fpg_style_bitmap, fpg_readonly, fpg_imgfmt_png, U_Command, U_Pdf, U_Report, U_ReportImages, U_Visu, fpg_trayicon, Agg2D, - fpg_dbugintf, fpg_dbugmsg, fpg_fontcache, fpg_style_carbon, - fpg_style_plastic, fpg_style_win8, fpg_scrollframe; + fpg_dbugintf, fpg_dbugmsg, fpg_fontcache, fpg_style_carbon, + fpg_style_plastic, fpg_style_win8, fpg_scrollframe, fpg_toggle, + fpg_StringGridBuilder, fpg_CSVParser; implementation diff --git a/src/extrafpc.cfg b/src/extrafpc.cfg index d1600da1..c645739c 100644 --- a/src/extrafpc.cfg +++ b/src/extrafpc.cfg @@ -34,7 +34,6 @@ # For a debug version compile with debuginfo and all codegeneration checks on #IFDEF DEBUG -g - -Crtoi -B #WRITE Compiling Debug Version #ENDIF @@ -91,13 +90,13 @@ # Unit output path -FU../lib/$fpctarget/ -# Generate debugging information for GDI (slows down the compiling process) +# Generate debugging information (slows down the compiling process) # Enable debug info and use the line info unit by default -#-gl +-gl # Always strip debuginfo from the executable --Xs +#-Xs # Write always a nice FPC logo ;) diff --git a/src/gui/colordialog.inc b/src/gui/colordialog.inc index 93d8d731..91ebdf0a 100644 --- a/src/gui/colordialog.inc +++ b/src/gui/colordialog.inc @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -22,6 +22,28 @@ type + TColorPickedEvent = procedure(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor) of object; + + TPickerButton = class(TfpgButton) + private + FContinuousResults: Boolean; + FOnColorPicked: TColorPickedEvent; + FColorPos: TPoint; + FColor: TfpgColor; + FColorPicking: Boolean; + private + procedure DoColorPicked; + protected + 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; + public + constructor Create(AOwner: TComponent); override; + published + property ContinuousResults: Boolean read FContinuousResults write FContinuousResults; + property OnColorPicked: TColorPickedEvent read FOnColorPicked write FOnColorPicked; + end; + TfpgColorSelectDialog = class(TfpgBaseDialog) private {@VFD_HEAD_BEGIN: ColorSelectDialog} @@ -37,19 +59,29 @@ type edR: TfpgSpinEdit; edG: TfpgSpinEdit; edB: TfpgSpinEdit; - Label3: TfpgLabel; - Label4: TfpgLabel; - Label5: TfpgLabel; - pnlColorPreview: TfpgBevel; + lblRed: TfpgLabel; + lblGreen: TfpgLabel; + lblBlue: TfpgLabel; + btnPicker: TPickerButton; + chkContinuous: TfpgCheckBox; + lblHex: TfpgLabel; + edHex: TfpgEdit; {@VFD_HEAD_END: ColorSelectDialog} FViaRGB: Boolean; // to prevent recursive changes + FColorPicking: Boolean; + procedure btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor); + procedure chkContinuousChanged(Sender: TObject); function GetSelectedColor: TfpgColor; procedure SetSelectedColor(const AValue: TfpgColor); procedure ColorChanged(Sender: TObject); + procedure NamedColorChanged(Sender: TObject); procedure RGBChanged(Sender: TObject); procedure UpdateRGBComponents; procedure PopulatePaletteColorCombo; procedure cbColorPaletteChange(Sender: TObject); + procedure OnTabChange(Sender: TObject; tab:TfpgTabSheet); + protected + procedure SetupCaptions; override; public constructor Create(AOwner: TComponent); override; procedure AfterCreate; override; @@ -79,8 +111,120 @@ begin end; end; + +function ConvertToHex(Value: integer): string; +var + ValH, ValL: integer; +begin + ValH := Value div 16; + ValL := Value mod 16; + case ValH of + 15: + Result := 'F'; + 14: + Result := 'E'; + 13: + Result := 'D'; + 12: + Result := 'C'; + 11: + Result := 'B'; + 10: + Result := 'A'; + else + Result := IntToStr(ValH); + end; + case ValL of + 15: + Result := Result + 'F'; + 14: + Result := Result + 'E'; + 13: + Result := Result + 'D'; + 12: + Result := Result + 'C'; + 11: + Result := Result + 'B'; + 10: + Result := Result + 'A'; + else + Result := Result + IntToStr(ValL); + end; +end; + +function Hex(Red, Green, Blue: integer): string; +begin + Result := '$' + ConvertToHex(Red) + ConvertToHex(Green) + ConvertToHex(Blue); +end; + +{ TPickerButton } + +procedure TPickerButton.DoColorPicked; +var + pt: TPoint; +begin + pt := WindowToScreen(self, FColorPos); + FColor := fpgApplication.GetScreenPixelColor(pt); + if Assigned(FOnColorPicked) then + FOnColorPicked(self, FColorPos, FColor); +end; + +procedure TPickerButton.HandleLMouseDown(X, Y: integer; ShiftState: TShiftState); +begin + inherited HandleLMouseDown(X, Y, ShiftState); + MouseCursor := mcCross; + FColorPicking := True; + CaptureMouse; +end; + +procedure TPickerButton.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleLMouseUp(x, y, shiftstate); + ReleaseMouse; + FColorPicking := False; + MouseCursor := mcDefault; + DoColorPicked; +end; + +procedure TPickerButton.HandleMouseMove(x, y: integer; btnstate: word; + shiftstate: TShiftState); +begin + //inherited HandleMouseMove(x, y, btnstate, shiftstate); + if not FColorPicking then + Exit; + FColorPos.x := x; + FColorPos.y := y; + if FContinuousResults then + DoColorPicked; +end; + +constructor TPickerButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FColorPicking := False; + FContinuousResults := False; +end; + { TfpgColorSelectDialog } +procedure TfpgColorSelectDialog.OnTabChange(Sender: TObject; tab:TfpgTabSheet); +begin + if pcColorSelect.ActivePageIndex = 0 then + RGBChanged(sender) + else + NamedColorChanged(sender) ; +end; + +procedure TfpgColorSelectDialog.btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor); +begin + ColorWheel.SetSelectedColor(AColor); +end; + +procedure TfpgColorSelectDialog.chkContinuousChanged(Sender: TObject); +begin + btnPicker.ContinuousResults := chkContinuous.Checked; +end; + function TfpgColorSelectDialog.GetSelectedColor: TfpgColor; begin if pcColorSelect.ActivePageIndex = 0 then @@ -99,33 +243,64 @@ begin // UpdateHSVComponents; if not FViaRGB then UpdateRGBComponents; - pnlColorPreview.BackgroundColor := ValueBar.SelectedColor; +end; + +procedure TfpgColorSelectDialog.NamedColorChanged(Sender: TObject); +var + tred, tgreen, tblue: Byte; +begin + tred := fpgGetRed(ColorListBox1.Color); + tgreen := fpgGetGreen(ColorListBox1.Color); + tblue := fpgGetBlue(ColorListBox1.Color); + + // keep text readable based on background color + if (tred + tgreen + tblue) / (256*3) >0.60 then + edHex.TextColor := clBlack + else + edHex.TextColor := clWhite ; + + edHex.BackgroundColor:=ColorListBox1.Color; + edHex.Text := Hex(tred,tgreen,tblue); end; procedure TfpgColorSelectDialog.RGBChanged(Sender: TObject); var - rgb: TFPColor; + rgb: fpg_base.TRGBTriple; c: TfpgColor; begin FViaRGB := True; // prevent recursive updates rgb.Red := edR.Value; rgb.Green := edG.Value; rgb.Blue := edB.Value; - c := FPColorTofpgColor(rgb); + c := RGBTripleTofpgColor(rgb); ColorWheel.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event FViaRGB := False; + // keep text readable based on background color + if ValueBar.Value > 0.75 then + edHex.TextColor := clBlack + else + edHex.TextColor := clWhite; + edHex.BackgroundColor := c; + edHex.Text := Hex(rgb.Red, rgb.Green, rgb.Blue); end; procedure TfpgColorSelectDialog.UpdateRGBComponents; var - rgb: TFPColor; + rgb: fpg_base.TRGBTriple; c: TfpgColor; begin c := ValueBar.SelectedColor; - rgb := fpgColorToFPColor(c); + rgb := fpgColorToRGBTriple(c); edR.Value := rgb.Red; edG.Value := rgb.Green; edB.Value := rgb.Blue; + // keep text readable based on background color + if ValueBar.Value > 0.75 then + edHex.TextColor := clBlack + else + edHex.TextColor := clWhite; + edHex.BackgroundColor := c; + edHex.Text := Hex(rgb.Red, rgb.Green, rgb.Blue); end; procedure TfpgColorSelectDialog.PopulatePaletteColorCombo; @@ -149,21 +324,34 @@ begin ColorListBox1.SetFocus; end; +procedure TfpgColorSelectDialog.SetupCaptions; +begin + inherited SetupCaptions; + tsColorWheel.Text := rsTabsheetColorWheel; + tsColorNames.Text := rsTabPredefined; + lblRed.Text := rsColorRed; + lblGreen.Text := rsColorGreen; + lblBlue.Text := rsColorBlue; + chkContinuous.Text := rsContinuous; + btnPicker.Hint := rsColorPickerHint; + lblHex.Text := rsHexadecimal; +end; + constructor TfpgColorSelectDialog.Create(AOwner: TComponent); begin inherited Create(AOwner); FViaRGB := false; end; - procedure TfpgColorSelectDialog.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: ColorSelectDialog} Name := 'ColorSelectDialog'; - SetPosition(340, 164, 328, 375); + SetPosition(340, 164, 328, 385); WindowTitle := 'Color Select Dialog'; Hint := ''; + IconName := ''; WindowPosition := wpOneThirdDown; pcColorSelect := TfpgPageControl.Create(self); @@ -172,9 +360,9 @@ begin Name := 'pcColorSelect'; SetPosition(4, 4, 320, 332); Anchors := [anLeft,anRight,anTop,anBottom]; - ActivePageIndex := 0; Hint := ''; TabOrder := 1; + OnChange := @OnTabChange; end; tsColorWheel := TfpgTabSheet.Create(pcColorSelect); @@ -182,6 +370,7 @@ begin begin Name := 'tsColorWheel'; SetPosition(3, 24, 314, 305); + Anchors := [anLeft,anRight,anTop,anBottom]; Text := 'Color Wheel'; end; @@ -190,7 +379,8 @@ begin begin Name := 'tsColorNames'; SetPosition(3, 24, 314, 305); - Text := 'Predefined'; + Anchors := [anLeft,anRight,anTop,anBottom]; + Text := rsTabPredefined; end; cbColorPalette := TfpgComboBox.Create(tsColorNames); @@ -199,9 +389,12 @@ begin Name := 'cbColorPalette'; SetPosition(8, 24, 299, 22); Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; FontDesc := '#List'; Hint := ''; + FocusItem := -1; TabOrder := 1; + OnChange:= @NamedColorChanged; end; ColorListBox1 := TfpgColorListBox.Create(tsColorNames); @@ -210,10 +403,11 @@ begin Name := 'ColorListBox1'; SetPosition(8, 72, 299, 224); Anchors := [anLeft,anRight,anTop,anBottom]; - Color := TfpgColor($00FFFF); + Color := TfpgColor($FF00FFFF); FontDesc := '#List'; Hint := ''; TabOrder := 2; + OnChange:= @NamedColorChanged; end; Label1 := TfpgLabel.Create(tsColorNames); @@ -282,10 +476,10 @@ begin OnChange := @RGBChanged; end; - Label3 := TfpgLabel.Create(tsColorWheel); - with Label3 do + lblRed := TfpgLabel.Create(tsColorWheel); + with lblRed do begin - Name := 'Label3'; + Name := 'lblRed'; SetPosition(8, 220, 80, 16); Alignment := taRightJustify; FontDesc := '#Label1'; @@ -293,10 +487,10 @@ begin Text := 'Red'; end; - Label4 := TfpgLabel.Create(tsColorWheel); - with Label4 do + lblGreen := TfpgLabel.Create(tsColorWheel); + with lblGreen do begin - Name := 'Label4'; + Name := 'lblGreen'; SetPosition(8, 248, 80, 16); Alignment := taRightJustify; FontDesc := '#Label1'; @@ -304,10 +498,10 @@ begin Text := 'Green'; end; - Label5 := TfpgLabel.Create(tsColorWheel); - with Label5 do + lblBlue := TfpgLabel.Create(tsColorWheel); + with lblBlue do begin - Name := 'Label5'; + Name := 'lblBlue'; SetPosition(8, 276, 80, 16); Alignment := taRightJustify; FontDesc := '#Label1'; @@ -315,17 +509,61 @@ begin Text := 'Blue'; end; - pnlColorPreview := TfpgBevel.Create(tsColorWheel); - with pnlColorPreview do + btnPicker := TPickerButton.Create(tsColorWheel); + with btnPicker do + begin + Name := 'btnPicker'; + SetPosition(167, 230, 23, 23); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.colpicker'; + FShowHint := True; + TabOrder := 24; + OnColorPicked := @btnColorPicked; + end; + + chkContinuous := TfpgCheckBox.Create(tsColorWheel); + with chkContinuous do begin - Name := 'pnlColorPreview'; - SetPosition(248, 232, 52, 52); + Name := 'chkContinuous'; + SetPosition(167, 258, 130, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 25; + Text := 'Continuous'; + OnChange := @chkContinuousChanged; + end; + + lblHex := TfpgLabel.Create(self); + with lblHex do + begin + Name := 'lblHex'; + SetPosition(25, 340, 100, 15); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Hexadecimal'; + end; + + edHex := TfpgEdit.Create(self); + with edHex do + begin + Name := 'edHex'; + SetPosition(25, 356, 100, 23); + ExtraHint := ''; + FontDesc := '#Label1'; Hint := ''; + TabOrder := 3; + Text := ''; + MaxLength:= 7; end; {@VFD_BODY_END: ColorSelectDialog} {%endregion} + FColorPicking := False; // link colorwheel and valuebar ColorWheel.ValueBar := ValueBar; diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index cbce739f..2df7b414 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -32,7 +32,7 @@ uses fpg_widget, fpg_scrollbar, fpg_menu; - + type TfpgGridDrawState = set of (gdSelected, gdFocused, gdFixed); @@ -51,7 +51,7 @@ type // Column 2 is special just for testing purposes. Descendant classes will // override that special behavior anyway. - + TfpgBaseGrid = class(TfpgWidget) private FColResizing: boolean; @@ -79,6 +79,7 @@ type FScrollBarStyle: TfpgScrollStyle; FShowGrid: boolean; FShowHeader: boolean; + FAutoHeight: boolean; FTemp: integer; FVScrollBar: TfpgScrollBar; FHScrollBar: TfpgScrollBar; @@ -89,14 +90,19 @@ type FBorderStyle: TfpgEditBorderStyle; function GetFontDesc: string; function GetHeaderFontDesc: string; + function GetScrollBarWidth: Integer; function GetTotalColumnWidth: integer; function GetAdjustedBorderSizes: TRect; procedure HScrollBarMove(Sender: TObject; position: integer); procedure SetFontDesc(const AValue: string); procedure SetHeaderFontDesc(const AValue: string); + procedure SetHeaderHeight(const AValue: integer); procedure SetHeaderStyle(const AValue: TfpgGridHeaderStyle); procedure SetRowSelect(const AValue: boolean); procedure SetScrollBarStyle(const AValue: TfpgScrollStyle); + function GetScrollBarPage: integer; + procedure SetScrollBarPage(const AValue: integer); + procedure SetScrollBarWidth(const AValue: integer); procedure VScrollBarMove(Sender: TObject; position: integer); procedure SetDefaultColWidth(const AValue: integer); procedure SetDefaultRowHeight(const AValue: integer); @@ -105,10 +111,12 @@ type procedure CheckFocusChange; procedure SetShowGrid(const AValue: boolean); procedure SetShowHeader(const AValue: boolean); + procedure SetAutoHeight(const AValue: boolean); function VisibleLines: Integer; procedure SetFirstRow(const AValue: Integer); procedure SetAlternativeBGColor(const AValue: TfpgColor); procedure SetBorderStyle(AValue: TfpgEditBorderStyle); + function AdjustHeight: Integer; protected property UpdateCount: integer read FUpdateCount; procedure UpdateScrollBars; virtual; @@ -157,8 +165,11 @@ type property RowCount: Integer read GetRowCount; property ShowHeader: boolean read FShowHeader write SetShowHeader default True; property ShowGrid: boolean read FShowGrid write SetShowGrid default True; + property AutoHeight: boolean read FAutoHeight write SetAutoHeight default False; property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth; - property HeaderHeight: integer read FHeaderHeight; + property ScrollBarPage: Integer read GetScrollBarPage write SetScrollBarPage; + property ScrollBarWidth: Integer read GetScrollBarWidth write SetScrollBarWidth; + property HeaderHeight: integer read FHeaderHeight write SetHeaderHeight; property TotalColumnWidth: integer read GetTotalColumnWidth; // property ColResizing: boolean read FColResizing write FColResizing; property ColumnWidth[ACol: Integer]: integer read GetColumnWidth write SetColumnWidth; @@ -224,6 +235,11 @@ begin Result := FHeaderFont.FontDesc; end; +function TfpgBaseGrid.GetScrollBarWidth: Integer; +begin + Result := FVScrollBar.Width; +end; + function TfpgBaseGrid.GetTotalColumnWidth: integer; var i: integer; @@ -277,6 +293,13 @@ begin RePaint; end; +procedure TfpgBaseGrid.SetHeaderHeight(const AValue: integer); +begin + if AValue >= FHeaderFont.Height + 2 then + FHeaderHeight := AValue; + Repaint; +end; + procedure TfpgBaseGrid.SetHeaderStyle(const AValue: TfpgGridHeaderStyle); begin if FHeaderStyle = AValue then @@ -300,6 +323,28 @@ begin FScrollBarStyle := AValue; end; +function TfpgBaseGrid.GetScrollBarPage: integer; +begin + Result:= FVScrollBar.PageSize; +end; + +procedure TfpgBaseGrid.SetScrollBarPage(const AValue: integer); +begin + if AValue= FVScrollBar.PageSize then + Exit; //==> + FVScrollBar.PageSize:= AValue; +end; + +procedure TfpgBaseGrid.SetScrollBarWidth(const AValue: integer); +begin + if FVScrollBar.Width = AValue then + Exit; //==> + FVScrollBar.Width := AValue; + FHScrollBar.Height:= AValue; + if FAutoHeight then + Height := AdjustHeight; +end; + procedure TfpgBaseGrid.VScrollBarMove(Sender: TObject; position: integer); begin if FFirstRow <> position then @@ -550,6 +595,15 @@ begin RePaint; end; +procedure TfpgBaseGrid.SetAutoHeight(const AValue: boolean); +begin + if FAutoHeight= AValue then + Exit; //==> + FAutoHeight := AValue; + if FAutoHeight then + Height := AdjustHeight; +end; + // Return the fully visible lines only. Partial lines not counted function TfpgBaseGrid.VisibleLines: Integer; var @@ -612,6 +666,28 @@ begin Repaint; end; +function TfpgBaseGrid.AdjustHeight: Integer; +var + r: TRect; +begin + if FAutoHeight then + begin + r := GetAdjustedBorderSizes; + if FShowHeader then + if (FScrollBarStyle = ssHorizontal) or (FScrollBarStyle = ssAutoBoth) then + Result := Succ(((Height - r.Bottom * 2 - HeaderHeight - FHScrollBar.Height) div DefaultRowHeight) * DefaultRowHeight + HeaderHeight + FHScrollBar.Height + r.Bottom * 2) + else + Result := Succ(((Height - r.Bottom * 2 - HeaderHeight) div DefaultRowHeight) * DefaultRowHeight + HeaderHeight + r.Bottom * 2) + else + if (FScrollBarStyle = ssHorizontal) or (FScrollBarStyle = ssAutoBoth) then + Result := Succ(((Height - r.Bottom * 2 - FHScrollBar.Height) div DefaultRowHeight) * DefaultRowHeight + FHScrollBar.Height + r.Bottom * 2) + else + Result := Succ(((Height - r.Bottom * 2) div DefaultRowHeight) * DefaultRowHeight + r.Bottom * 2); + if Align = alBottom then + Top := Top + Height - result; + end; +end; + procedure TfpgBaseGrid.UpdateScrollBars; var HWidth: integer; @@ -637,7 +713,7 @@ var UpdateWindowPosition; end; end; - + procedure getVisWidth; begin if showV then @@ -660,6 +736,22 @@ var Vfits := vl >= RowCount; end; + function ColMax: integer; + var + i: integer; + w: integer; + begin + w := 0; + Result := 0; + for i := 0 to ColumnCount-1 do + begin + w := w + ColumnWidth[i]; + if w > Width then + inc(Result); + end; + inc(Result); + end; + begin // if we don't want any scrollbars, hide them and exit if FScrollBarStyle = ssNone then @@ -681,7 +773,7 @@ begin showH := False; getVisWidth; getVisLines; - + // determine whether to show scrollbars for different configurations case FScrollBarStyle of ssHorizontal: @@ -725,6 +817,25 @@ begin getVisLines; end; end; + ssHorizVisible: + begin + hideScrollbar (FVScrollBar); + showH := true; + getVisLines; + end; + ssVertiVisible: + begin + hideScrollbar (FHScrollBar); + showV := true; + getVisWidth; + end; + ssBothVisible: + begin + showV := true; + showH := true; + getVisLines; + getVisWidth; + end; end; // set the scrollbar width/height space @@ -772,16 +883,15 @@ begin if FXOffset>hmax then FXOffset:=hmax; FHScrollBar.Position := FXOffset; - FHScrollBar.SliderSize := HWidth / TotalColumnWidth; FHScrollBar.PageSize := 5; end else begin - FHScrollBar.Max := ColumnCount-1; + FHScrollBar.Max := ColMax; FHScrollBar.Position := FFirstCol; - FHScrollBar.SliderSize := 1 / ColumnCount; FHScrollBar.PageSize := 1; end; + FHScrollBar.SliderSize := HWidth / TotalColumnWidth; FHScrollBar.RepaintSlider; FHScrollBar.Top := Height - FHScrollBar.Height - borders.Bottom; FHScrollBar.Left := borders.Left; @@ -991,7 +1101,7 @@ begin Canvas.SetClipRect(clipr); Canvas.SetColor(FBackgroundColor); - + // clearing after the last column if r.Left <= clipr.Right then begin @@ -1142,7 +1252,7 @@ begin end; consumed := True; end; - + keyHome: begin if FRowSelect then @@ -1168,7 +1278,7 @@ begin end; consumed := True; end; - + keyEnd: begin if FRowSelect then @@ -1194,7 +1304,7 @@ begin consumed := True; end; end; { case } - + if consumed then CheckFocusChange; @@ -1275,7 +1385,7 @@ var borders: TRect; begin inherited HandleMouseMove(x, y, btnstate, shiftstate); - + if (ColumnCount = 0) or (RowCount = 0) then Exit; //==> @@ -1460,7 +1570,7 @@ begin begin // Selecting a Cell via mouse MouseToCell(x, y, FFocusCol, FFocusRow); end; { if/else } - + if not CanSelectCell(FFocusRow, FFocusCol) then begin // restore previous values @@ -1504,6 +1614,7 @@ procedure TfpgBaseGrid.FollowFocus; var n: Integer; w: TfpgCoord; + lmin, lmax: TfpgCoord; begin if (RowCount > 0) and (FFocusRow < 0) then FFocusRow := 0; @@ -1546,6 +1657,19 @@ begin end; end; { for } end; { if/else } + + // If smoothscroll, convert FFirstCol to X Offset value + if go_SmoothScroll in FOptions then + begin + w := 0; + for n := 0 to FFocusCol-1 do + w := w + ColumnWidth[n]; + lmin := FXOffset; + lmax := FXOffset + VisibleWidth; + if (w > lmax) or (w < lmin) then + FXOffset := w; + end; + CheckFocusChange; UpdateScrollBars; end; @@ -1583,7 +1707,7 @@ begin FFont := fpgGetFont('#Grid'); FHeaderFont := fpgGetFont('#GridHeader'); - + FTemp := 50; // Just to prove that ColumnWidth does adjust. FDefaultColWidth := 64; FDefaultRowHeight := FFont.Height + 2; @@ -1594,7 +1718,7 @@ begin MinHeight := HeaderHeight + DefaultRowHeight + borders.Top + borders.Bottom; MinWidth := DefaultColWidth + borders.Left + borders.Right; - + FVScrollBar := TfpgScrollBar.Create(self); FVScrollBar.Orientation := orVertical; FVScrollBar.Visible := False; diff --git a/src/gui/fpg_checkbox.pas b/src/gui/fpg_checkbox.pas index 2b4b11d8..a2946c3c 100644 --- a/src/gui/fpg_checkbox.pas +++ b/src/gui/fpg_checkbox.pas @@ -50,6 +50,7 @@ type procedure SetText(const AValue: string); procedure DoOnChange; protected + procedure HandleCheckChanged; virtual; procedure HandlePaint; override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; @@ -93,6 +94,11 @@ type property OnChange; property OnEnter; property OnExit; + property OnMouseDown; + property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnShowHint; end; @@ -121,6 +127,7 @@ begin if FChecked = AValue then Exit; //==> FChecked := AValue; + HandleCheckChanged; RePaint; if not (csDesigning in ComponentState) then DoOnChange; @@ -173,6 +180,11 @@ begin FOnChange(self); end; +procedure TfpgBaseCheckBox.HandleCheckChanged; +begin + // nothing here for us +end; + procedure TfpgBaseCheckBox.HandlePaint; var r: TfpgRect; diff --git a/src/gui/fpg_colormapping.pas b/src/gui/fpg_colormapping.pas index b915bd93..a22b949e 100644 --- a/src/gui/fpg_colormapping.pas +++ b/src/gui/fpg_colormapping.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -45,9 +45,9 @@ var r, g, b: longint; hi, lo: longint; d: longint; - rgb: TFPColor; + rgb: TRGBTriple; begin - rgb := fpgColorToFPColor(C); + rgb := fpgColorToRGBTriple(C); r := rgb.Red; g := rgb.Green; b := rgb.Blue; @@ -78,7 +78,7 @@ end; function HSVToRGB(const H: longint; const S, V: double): TfpgColor; var r, g, b: longint; - rgb: TFPColor; + rgb: TRGBTriple; begin if (h < 0) or (h > 1535) or (S < 0) or (S > 1) or (V < 0) or (V > 1) then begin @@ -130,7 +130,7 @@ begin rgb.Red := r; rgb.Green := g; rgb.Blue := b; - Result := FPColorTofpgColor(rgb); + Result := RGBTripleTofpgColor(rgb); end; diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index bb26ada6..d67b1b62 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -176,6 +176,11 @@ type property OnDropDown; property OnEnter; property OnExit; + property OnMouseDown; + property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnShowHint; end; diff --git a/src/gui/fpg_customgrid.pas b/src/gui/fpg_customgrid.pas index 98040374..923bed91 100644 --- a/src/gui/fpg_customgrid.pas +++ b/src/gui/fpg_customgrid.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 781c0745..42f4752c 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -579,6 +579,8 @@ end; constructor TfpgBaseDialog.Create(AOwner: TComponent); begin + // WindowType must be set before inherited or our parent property will be set + WindowType:=wtModalForm; inherited Create(AOwner); Width := 500; Height := 400; @@ -737,13 +739,31 @@ var result := c; end; + function LookAhead: char; + var + i: integer; + lc: char; + begin + i := cp+1; + if i > length(desc) then + lc := #0 + else + lc := desc[i]; + result := lc; + end; + procedure NextToken; begin token := ''; - while (c <> #0) and (c in [' ','a'..'z','A'..'Z','_','0'..'9']) do + while (c <> #0) and (c in [' ', 'a'..'z', 'A'..'Z', '_', '@', '0'..'9']) do begin token := token + c; NextC; + if (c = '-') and (LookAhead in [' ', 'a'..'z', 'A'..'Z', '_']) then + begin + token := token + c; + NextC; + end; end; end; diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas index 0ed17bfd..6bc3cc7c 100644 --- a/src/gui/fpg_edit.pas +++ b/src/gui/fpg_edit.pas @@ -189,8 +189,11 @@ type property OnExit; property OnKeyChar; property OnKeyPress; - property OnMouseEnter; + property OnMouseDown; property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnPaint; property OnShowHint; end; diff --git a/src/gui/fpg_editbtn.pas b/src/gui/fpg_editbtn.pas index 65417efd..d63aaee3 100644 --- a/src/gui/fpg_editbtn.pas +++ b/src/gui/fpg_editbtn.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -83,6 +83,11 @@ type property ReadOnly; property TabOrder; property OnButtonClick; + property OnMouseDown; + property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnShowHint; property OnFilenameSet: TFilenameSetEvent read FOnFilenameSet write FOnFilenameSet; end; @@ -91,11 +96,11 @@ type TfpgDirectoryEdit = class(TfpgBaseEditButton) private FRootDirectory: TfpgString; - function GetDirectory: TfpgString; - procedure SetDirectory(const AValue: TfpgString); + function GetDirectory: TfpgString; + procedure SetDirectory(const AValue: TfpgString); protected - procedure HandlePaint; override; - procedure InternalButtonClick(Sender: TObject); override; + procedure HandlePaint; override; + procedure InternalButtonClick(Sender: TObject); override; public constructor Create(AOwner: TComponent); override; published @@ -107,16 +112,21 @@ type property ReadOnly; property TabOrder; property OnButtonClick; + property OnMouseDown; + property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnShowHint; end; TfpgFontEdit = class(TfpgBaseEditButton) protected - function GetFontDesc: TfpgString; virtual; - procedure SetFontDesc(const AValue: TfpgString); virtual; - procedure HandlePaint; override; - procedure InternalButtonClick(Sender: TObject); override; + function GetFontDesc: TfpgString; virtual; + procedure SetFontDesc(const AValue: TfpgString); virtual; + procedure HandlePaint; override; + procedure InternalButtonClick(Sender: TObject); override; public constructor Create(AOwner: TComponent); override; published @@ -183,7 +193,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Text <> '' then begin Canvas.TextColor := clText3; @@ -354,7 +364,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Filename <> '' then begin Canvas.TextColor := clText3; @@ -439,7 +449,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Directory <> '' then begin Canvas.TextColor := clText3; @@ -502,7 +512,7 @@ begin fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); Canvas.TextColor := clShadow1; - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); Canvas.DrawText(0, 0, Width - Height, Height, ClassName, [txtHCenter, txtVCenter]); img := fpgImages.GetImage('stdimg.font'); // don't free the img instance - we only got a reference if img <> nil then diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas index 5b011b4d..12773d9b 100644 --- a/src/gui/fpg_editcombo.pas +++ b/src/gui/fpg_editcombo.pas @@ -367,7 +367,7 @@ begin begin if Items[i]= TDropDownWindow(FDropDown).ListBox.Items[TDropDownWindow(FDropDown).ListBox.FocusItem] then begin - FocusItem := i; + FNewItem := False; FSelectedItem:= i; FText:= Items[i]; Break; @@ -734,17 +734,17 @@ var // paint selection rectangle procedure DrawSelection; var - lcolor: TfpgColor; + lcolor,ltxtcolor: TfpgColor; begin if Focused then begin lcolor := clSelection; - Canvas.SetTextColor(clSelectionText); + ltxtcolor := clSelectionText; end else begin lcolor := clInactiveSel; - Canvas.SetTextColor(clText1); + ltxtcolor := clText1; end; len := FSelOffset; @@ -759,16 +759,16 @@ var // XOR on Anti-aliased text doesn't look to good. Lets try standard // Blue & White like what was doen in TfpgEdit. -{ Canvas.SetColor(lcolor); + Canvas.SetColor(lcolor); Canvas.FillRectangle(-FDrawOffset + FMargin + tw, 3, tw2 - tw, Font.Height); r.SetRect(-FDrawOffset + FMargin + tw, 3, tw2 - tw, Font.Height); Canvas.AddClipRect(r); - Canvas.SetTextColor(clWhite); - fpgStyle.DrawString(Canvas, -FDrawOffset + FMargin, 3, Text, Enabled); + Canvas.SetTextColor(ltxtcolor); + fpgStyle.DrawString(Canvas, -FDrawOffset + FMargin + tw, 3, UTF8Copy(Items[FSelectedItem], Succ(st), Pred(len)), Enabled); Canvas.ClearClipRect; -} - Canvas.XORFillRectangle(fpgColorToRGB(lcolor) xor $FFFFFF, - -FDrawOffset + FMargin + tw, 3, tw2 - tw, Font.Height); + + //Canvas.XORFillRectangle(fpgColorToRGB(lcolor) xor $FFFFFF, + // -FDrawOffset + FMargin + tw, 3, tw2 - tw, Font.Height); end; begin diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas index 7d5fe042..3f1f2558 100644 --- a/src/gui/fpg_form.pas +++ b/src/gui/fpg_form.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2011 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -44,6 +44,7 @@ type TfpgBaseForm = class(TfpgWidget) private FFullScreen: boolean; + FIconName: TfpgString; FOnActivate: TNotifyEvent; FOnClose: TFormCloseEvent; FOnCloseQuery: TFormCloseQueryEvent; @@ -76,6 +77,7 @@ type procedure DoKeyShortcut(const AOrigin: TfpgWidget; const keycode: word; const shiftstate: TShiftState; var consumed: boolean; const IsChildOfOrigin: boolean = False); override; { -- properties -- } property DNDEnabled: boolean read FDNDEnabled write SetDNDEnabled default False; + property IconName: string read FIconName write FIconName; property Sizeable: boolean read FSizeable write FSizeable; property ModalResult: TfpgModalResult read FModalResult write FModalResult; property FullScreen: boolean read FFullScreen write FFullScreen default False; @@ -115,6 +117,7 @@ type property FullScreen; property Height; property Hint; + property IconName; property Left; property MaxHeight; property MaxWidth; @@ -342,6 +345,8 @@ function TfpgBaseForm.ShowModal: TfpgModalResult; var lCloseAction: TCloseAction; begin + if HasHandle and (FWindowType <> wtModalForm) then + HandleHide; FWindowType := wtModalForm; fpgApplication.PushModalForm(self); ModalResult := mrNone; diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 3f8b52fb..1f7e0f54 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -136,6 +136,7 @@ type published property Align; property AlternateBGColor; + property AutoHeight; property BackgroundColor; property BorderStyle; // property ColResizing; @@ -158,6 +159,8 @@ type property RowCount; property RowSelect; property ScrollBarStyle; + property ScrollBarPage; + property ScrollBarWidth; property ShowGrid; property ShowHeader; property ShowHint; diff --git a/src/gui/fpg_listbox.pas b/src/gui/fpg_listbox.pas index 11baed01..d876a222 100644 --- a/src/gui/fpg_listbox.pas +++ b/src/gui/fpg_listbox.pas @@ -168,6 +168,11 @@ type property OnEnter; property OnExit; property OnKeyPress; + property OnMouseDown; + property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnScroll; property OnSelect; property OnShowHint; diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index 0278c952..cf06e5bf 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -41,9 +41,12 @@ type TfpgLVColumnClickEvent = procedure(Listview: TfpgListView; Column: TfpgLVColumn; Button: Integer) of object; + { TfpgLVColumn } + TfpgLVColumn = class(TComponent) private FAlignment: TAlignment; + FAutoExpand: Boolean; FCaptionAlignment: TAlignment; FDown: Boolean; FAutoSize: Boolean; @@ -56,7 +59,9 @@ type FVisible: Boolean; FWidth: Integer; Ref: Integer; + function GetWidth: Integer; procedure SetAlignment(const AValue: TAlignment); + procedure SetAutoExpand(AValue: Boolean); procedure SetAutoSize(const AValue: Boolean); procedure SetCaption(const AValue: String); procedure SetCaptionAlignment(const AValue: TAlignment); @@ -72,7 +77,8 @@ type property CaptionAlignment: TAlignment read FCaptionAlignment write SetCaptionAlignment; property Alignment: TAlignment read FAlignment write SetAlignment; property AutoSize: Boolean read FAutoSize write SetAutoSize; - property Width: Integer read FWidth write SetWidth; + property AutoExpand: Boolean read FAutoExpand write SetAutoExpand; + property Width: Integer read GetWidth write SetWidth; property Height: Integer read FHeight write SetHeight; property Visible: Boolean read FVisible write SetVisible; property ColumnIndex: Integer read FColumnIndex write SetColumnIndex; @@ -81,12 +87,16 @@ type end; + { TfpgLVColumns } + TfpgLVColumns = class(TPersistent) private FListView: TfpgListView; FColumns: TObjectList; function GetColumn(AIndex: Integer): TfpgLVColumn; procedure SetColumn(AIndex: Integer; const AValue: TfpgLVColumn); + procedure SetColumnFillRow(AValue: TfpgLVColumn); + function GetTotalColumsWidth(AIgnoreColumn: TfpgLVColumn): Integer; public constructor Create(AListView: TfpgListView); destructor Destroy; override; @@ -108,6 +118,7 @@ type ColumnIndex: Integer; Area: TfpgRect; var PaintPart: TfpgLVItemPaintPart) of object; TfpgLVPaintItemEvent = procedure(ListView: TfpgListView; Canvas: TfpgCanvas; Item: TfpgLVItem; ItemIndex: Integer; Area:TfpgRect; var PaintPart: TfpgLVItemPaintPart) of object; + TfpgLVItemActivateEvent = procedure(ListView: TfpgListView; Item: TfpgLVItem) of object; TfpgLVItemSelectEvent = procedure(ListView: TfpgListView; Item: TfpgLVItem; ItemIndex: Integer; Selected: Boolean) of object; @@ -210,6 +221,8 @@ type TfpgListView = class(TfpgWidget, IfpgLVItemViewer) private FImages: array[TfpgLVItemStates] of TfpgImageList; + FOnItemActivate: TfpgLVItemActivateEvent; + FShowFocusRect: Boolean; FSubitemImages: array[TfpgLVItemStates] of TfpgImageList; FItemIndex: Integer; FMultiSelect: Boolean; @@ -241,6 +254,7 @@ type procedure SetMultiSelect(const AValue: Boolean); procedure SetOnColumnClick(const AValue: TfpgLVColumnClickEvent); procedure SetScrollBarWidth(const AValue: integer); + procedure SetShowFocusRect(AValue: Boolean); procedure SetShowHeaders(const AValue: Boolean); procedure SetShiftIsPressed(const AValue: Boolean); function SubItemGetImages(AIndex: integer): TfpgImageList; @@ -266,6 +280,7 @@ type function ItemIndexFromY(Y: Integer): Integer; function HeaderHeight: Integer; procedure DoRepaint; + procedure DoItemActivate(AItem: TfpgLVItem); procedure DoColumnClick(Column: TfpgLVColumn; Button: Integer); procedure HandleHeaderMouseMove(x, y: Integer; btnstate: word; Shiftstate: TShiftState); property ShiftIsPressed: Boolean read FShiftIsPressed write SetShiftIsPressed; @@ -276,6 +291,7 @@ type procedure HandleRMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; + procedure HandleDoubleClick(x, y: integer; button: word; shiftstate: TShiftState); override; procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleKeyRelease(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; @@ -317,10 +333,12 @@ type property SubItemImagesHotTrack: TfpgImageList index Ord(lisHotTrack) read SubItemGetImages write SubItemSetImages; property ShowHeaders: Boolean read FShowHeaders write SetShowHeaders; + property ShowFocusRect: Boolean read FShowFocusRect write SetShowFocusRect; property ShowHint; property TabOrder; property VScrollBar: TfpgScrollBar read FVScrollBar; property OnColumnClick: TfpgLVColumnClickEvent read FOnColumnClick write SetOnColumnClick; + property OnItemActivate: TfpgLVItemActivateEvent read FOnItemActivate write FOnItemActivate; property OnPaintColumn: TfpgLVPaintColumnEvent read FOnPaintColumn write FOnPaintColumn; property OnPaintItem: TfpgLVPaintItemEvent read FOnPaintItem write FOnPaintItem; property OnSelectionChanged: TfpgLVItemSelectEvent read FOnSelectionChanged write FOnSelectionChanged; @@ -749,6 +767,13 @@ begin FHScrollBar.Height:= FScrollBarWidth; end; +procedure TfpgListView.SetShowFocusRect(AValue: Boolean); +begin + if FShowFocusRect=AValue then Exit; + FShowFocusRect:=AValue; + Invalidate; +end; + procedure TfpgListView.SetShiftIsPressed(const AValue: Boolean); begin if AValue = FShiftIsPressed then @@ -1014,6 +1039,12 @@ begin RePaint; end; +procedure TfpgListView.DoItemActivate(AItem: TfpgLVItem); +begin + if Assigned(FOnItemActivate) then + FOnItemActivate(Self, AItem); +end; + procedure TfpgListView.DoColumnClick(Column: TfpgLVColumn; Button: Integer); begin if not Column.Clickable then @@ -1271,6 +1302,17 @@ begin DoRepaint; end; +procedure TfpgListView.HandleDoubleClick(x, y: integer; button: word; + shiftstate: TShiftState); +var + Item: TfpgLVItem; +begin + inherited HandleDoubleClick(x, y, button, shiftstate); + Item := ItemGetFromPoint(x,y); + if Assigned(Item) then + DoItemActivate(Item); +end; + procedure TfpgListView.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); var @@ -1390,6 +1432,14 @@ begin CheckSelectionFocus; CheckMultiSelect end; + keyEnter: + begin + if shiftstate = [] then + begin + if FItemIndex <> -1 then + DoItemActivate(Items.Item[FItemIndex]); + end; + end else consumed := False; inherited HandleKeyPress(keycode, shiftstate, consumed); @@ -1596,7 +1646,7 @@ begin if Assigned(FOnPaintItem) then FOnPaintItem(Self, Canvas, Item, I, ItemRect, PaintPart); - if lvppFocused in PaintPart then + if (lvppFocused in PaintPart) and (FShowFocusRect) then begin if lisSelected in ItemState then Canvas.Color := TfpgColor(not clSelection) @@ -1781,6 +1831,7 @@ begin FHeight := 80; Focusable := True; FShowHeaders := True; + FShowFocusRect := True; FVScrollBar := TfpgScrollBar.Create(Self); FVScrollBar.Orientation := orVertical; @@ -1885,6 +1936,27 @@ begin FColumns.Items[AIndex] := AValue; end; +procedure TfpgLVColumns.SetColumnFillRow(AValue: TfpgLVColumn); +var + P: Pointer; + C: TfpgLVColumn absolute P; +begin + for P in FColumns do + if C <> AValue then + C.AutoExpand:=False; +end; + +function TfpgLVColumns.GetTotalColumsWidth(AIgnoreColumn: TfpgLVColumn): Integer; +var + P: Pointer; + C: TfpgLVColumn absolute P; +begin + Result := 0; + for P in FColumns do + if (C <> AIgnoreColumn) and (C.Visible) then + Inc(Result, C.FWidth); +end; + constructor TfpgLVColumns.Create(AListView: TfpgListView); begin FListView := AListView; @@ -1988,6 +2060,23 @@ begin FColumns.FListView.DoRepaint; end; +function TfpgLVColumn.GetWidth: Integer; +begin + Result := 0; + if AutoExpand then + Result := FColumns.FListView.Width - FColumns.GetTotalColumsWidth(Self); + if Result < FWidth then + Result := FWidth; +end; + +procedure TfpgLVColumn.SetAutoExpand(AValue: Boolean); +begin + if FAutoExpand=AValue then Exit; + FAutoExpand:=AValue; + if AValue then + FColumns.SetColumnFillRow(Self); +end; + procedure TfpgLVColumn.SetWidth(const AValue: Integer); begin if FWidth=AValue then exit; diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 374c8d47..d02e6ec4 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -153,8 +153,11 @@ type property OnExit; property OnKeyChar; property OnKeyPress; - property OnMouseEnter; + property OnMouseDown; property OnMouseExit; + property OnMouseEnter; + property OnMouseMove; + property OnMouseUp; property OnPaint; property OnShowHint; end; @@ -308,12 +311,12 @@ var begin VHeight := Height - 4; HWidth := Width - 4; - + if FVScrollBar.Visible then Dec(HWidth, FVScrollBar.Width); if FHScrollBar.Visible then Dec(VHeight, FHScrollBar.Height); - + FHScrollBar.Top := Height -FHScrollBar.Height - 2; FHScrollBar.Left := 2; FHScrollBar.Width := HWidth; @@ -1048,7 +1051,7 @@ begin if not Focused then fpgCaret.UnSetCaret(Canvas); - + // The little square in the bottom right corner if FHScrollBar.Visible and FVScrollBar.Visible then begin @@ -1348,7 +1351,7 @@ begin RePaint else inherited; - + if hasChanged then if Assigned(FOnChange) then FOnChange(self); @@ -1675,7 +1678,8 @@ end; procedure TfpgMemo.EndUpdate; begin - Dec(FUpdateCount); + if FUpdateCount > 0 then + Dec(FUpdateCount); if FUpdateCount <= 0 then begin Invalidate; diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas index 3f634c02..4779fe40 100644 --- a/src/gui/fpg_menu.pas +++ b/src/gui/fpg_menu.pas @@ -108,9 +108,6 @@ type function MenuFocused: boolean; function SearchItemByAccel(s: string): integer; protected - FMenuFont: TfpgFont; - FMenuAccelFont: TfpgFont; - FMenuDisabledFont: TfpgFont; FSymbolWidth: integer; FItems: TList; FFocusItem: integer; @@ -1100,7 +1097,7 @@ begin if mi.HotKeyDef <> '' then begin s := mi.HotKeyDef; - fpgStyle.DrawString(Canvas, rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled); + fpgStyle.DrawString(Canvas, rect.Right-fpgStyle.MenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled); end; // process menu item submenu arrow image @@ -1182,7 +1179,7 @@ begin if mi.Separator then Result := 5 else - Result := FMenuFont.Height + 2; + Result := fpgStyle.MenuFont.Height + 2; end; function TfpgPopupMenu.MenuFocused: boolean; @@ -1263,14 +1260,14 @@ begin mi := VisibleItem(n); x := ItemHeight(mi); inc(h, x); - x := FMenuFont.TextWidth(mi.Text); + x := fpgStyle.MenuFont.TextWidth(mi.Text); if tw < x then tw := x; if mi.SubMenu <> nil then - x := FMenuFont.Height + x := fpgStyle.MenuFont.Height else - x := FMenuFont.TextWidth(mi.HotKeyDef); + x := fpgStyle.MenuFont.TextWidth(mi.HotKeyDef); if hkw < x then hkw := x; end; @@ -1342,16 +1339,13 @@ end; constructor TfpgPopupMenu.Create(AOwner: TComponent); begin + FWindowType:=wtPopup; inherited Create(AOwner); FMargin := 3; FTextMargin := 3; FItems := TList.Create; - // fonts - FMenuFont := fpgStyle.MenuFont; - FMenuAccelFont := fpgStyle.MenuAccelFont; - FMenuDisabledFont := fpgStyle.MenuDisabledFont; - FSymbolWidth := FMenuFont.Height+2; + FSymbolWidth := fpgStyle.MenuFont.Height+2; FBeforeShow := nil; FFocusItem := -1; diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 1ec78952..fbe20006 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -36,7 +36,7 @@ uses type TScrollNotifyEvent = procedure(Sender: TObject; position: integer) of object; - TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssBothVisible); + TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssHorizVisible, ssVertiVisible, ssBothVisible); TfpgScrollBarPart = (sbpNone, sbpUpBack, sbpPageUpBack, sbpSlider, sbpDownForward, sbpPageDownForward); diff --git a/src/gui/fpg_stringgridbuilder.pas b/src/gui/fpg_stringgridbuilder.pas new file mode 100644 index 00000000..fd3fe3b8 --- /dev/null +++ b/src/gui/fpg_stringgridbuilder.pas @@ -0,0 +1,178 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2014 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 defines a helper class that can populate a StringGrid + from a CSV file. In future this could be expaned to other file + types or even data structures. +} +unit fpg_StringGridBuilder; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, + SysUtils, + fpg_base, + fpg_grid; + +type + TStringGridBuilder = class(TObject) + private + FData: TStringList; + FGrid: TfpgStringGrid; + FCSVFile: TfpgString; + FHasHeader: boolean; + protected + procedure InternalSetupColumns; virtual; + procedure InternalSetupData; virtual; + procedure InternalRepaintRow(const AData: TfpgString; const ARow: integer); virtual; + public + constructor Create; + constructor CreateCustom(const AGrid: TfpgStringGrid; const ACSVFile: TfpgString; const AWithHeader: boolean = True); virtual; + destructor Destroy; override; + procedure Run; + property Grid: TfpgStringGrid read FGrid; + end; + +implementation + +uses + fpg_main, + fpg_utils, + fpg_CSVParser; + +{ TStringGridBuilder } + +procedure TStringGridBuilder.InternalSetupColumns; +var + x: integer; + fields: TStringList; +begin + fields := TStringList.Create; + try + gCsvParser.ExtractFields(FData[0], fields); + // setup correct column count + FGrid.ColumnCount := fields.Count; + // initialize columns + if FHasHeader then + begin + for x := 0 to fields.Count-1 do + begin + FGrid.ColumnTitle[x] := fields[x]; +// FGrid.ColumnWidth[x] := StrToInt(FColumns.ValueFromIndex[x]); + end; + end; + finally + fields.Free; + end; +end; + +procedure TStringGridBuilder.InternalSetupData; +var + y: integer; +begin + FGrid.BeginUpdate; + FGrid.MouseCursor := mcHourGlass; + try + try + // set correct row count. Columns have already been handled. + if FHasHeader then + begin + FGrid.RowCount := FData.Count-1; + for y := 1 to FData.Count-1 do // rows + begin + // writeln(' Row: ', y, ' Data: ', FData.Strings[y-1]); + InternalRepaintRow(FData.Strings[y], y-1); + end; + end + else + begin + FGrid.RowCount := FData.Count; + for y := 0 to FData.Count-1 do // rows + begin + // writeln(' Row: ', y, ' Data: ', FData.Strings[y-1]); + InternalRepaintRow(FData.Strings[y], y); + end; + end; + except + fpgApplication.HandleException(self); + end; + finally + if FGrid.RowCount > 0 then + FGrid.FocusRow := 0; + FGrid.EndUpdate; + FGrid.MouseCursor := mcDefault; + end; +end; + +procedure TStringGridBuilder.InternalRepaintRow(const AData: TfpgString; const ARow: integer); +var + x: integer; + fields: TStrings; + value: string; +begin + fields := TStringList.Create; + try + gCsvParser.ExtractFields(AData, fields); + for x := 0 to FGrid.ColumnCount-1 do + begin + if x < fields.Count then + value := fields.Strings[x] + else + value := ''; + FGrid.Cells[x, ARow] := value + end; + finally + fields.Free; + end; +end; + +constructor TStringGridBuilder.Create; +begin + FData := TStringList.Create; +end; + +constructor TStringGridBuilder.CreateCustom(const AGrid: TfpgStringGrid; const ACSVFile: TfpgString; const AWithHeader: boolean); +begin + Create; + FGrid := AGrid; + FCSVFile := ACSVFile; + FGrid.Clear; + FHasHeader := AWithHeader; + FGrid.ShowHeader := AWithHeader; +end; + +destructor TStringGridBuilder.Destroy; +begin + FGrid := nil; + FData.Free; + inherited Destroy; +end; + +procedure TStringGridBuilder.Run; +begin + if FCSVFile = '' then + raise Exception.Create('TStringGridBuilder: CSV filename is empty!'); + if not fpgFileExists(FCSVFile) then + raise Exception.CreateFmt('TStringGridBuilder: The CSV file <%s> does not exist.', [FCSVFile]); + FData.LoadFromFile(fpgToOSEncoding(FCSVFile)); + InternalSetupColumns; + InternalSetupData; +end; + + +end. + diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas index 29addb12..8846a7e1 100644 --- a/src/gui/fpg_tab.pas +++ b/src/gui/fpg_tab.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2012 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -86,7 +86,6 @@ type TfpgPageControl = class(TfpgWidget) private - FFont: TfpgFont; FActivePage: TfpgTabSheet; FMargin: integer; FFixedTabWidth: integer; @@ -521,7 +520,7 @@ begin if FFixedTabHeight > 0 then result := FFixedTabHeight else - result := FFont.Height + 10; { TODO: correct this } + result := fpgStyle.DefaultFont.Height + 10; { TODO: correct this } end; function TfpgPageControl.ButtonWidth(AText: string): integer; @@ -529,7 +528,7 @@ begin if FFixedTabWidth > 0 then result := FFixedTabWidth else - result := FFont.TextWidth(AText) + 10; + result := fpgStyle.DefaultFont.TextWidth(AText) + 10; end; procedure TfpgPageControl.SetFixedTabWidth(const AValue: integer); @@ -566,14 +565,14 @@ begin i := 1; if FFixedTabWidth > 0 then begin - while FFont.TextWidth(s1) < (FFixedTabWidth-10) do + while fpgStyle.DefaultFont.TextWidth(s1) < (FFixedTabWidth-10) do begin if Length(s1) = Length(s) then Break; s1 := UTF8Copy(s, 1, i); inc(i); end; - if FFont.TextWidth(s1) > (FFixedTabWidth-10) then + if fpgStyle.DefaultFont.TextWidth(s1) > (FFixedTabWidth-10) then UTF8Delete(s1, UTF8Length(s1), 1); if Length(s1) > 0 then s1 := Trim(s1); @@ -948,7 +947,7 @@ begin r3 := DrawTab(r2, h = ActivePage); // paint text on non-active tabs if h <> ActivePage then - Canvas.DrawText(lp + (ButtonWidth(h.Text) div 2) - FFont.TextWidth(GetTabText(h.Text)) div 2, + Canvas.DrawText(lp + (ButtonWidth(h.Text) div 2) - fpgStyle.DefaultFont.TextWidth(GetTabText(h.Text)) div 2, Height-TabH+toffset, GetTabText(h.Text), lTxtFlags); r2.Left := r2.Left + r2.Width; @@ -992,7 +991,7 @@ begin r3 := DrawTab(r2, h = ActivePage); // paint text on non-active tabs if h <> ActivePage then - Canvas.DrawText(lp + (ButtonWidth(h.Text) div 2) - FFont.TextWidth(GetTabText(h.Text)) div 2, + Canvas.DrawText(lp + (ButtonWidth(h.Text) div 2) - fpgStyle.DefaultFont.TextWidth(GetTabText(h.Text)) div 2, FMargin+toffset, GetTabText(h.Text), lTxtFlags); r2.Left := r2.Left + r2.Width; lp := lp + ButtonWidth(h.Text); @@ -1223,7 +1222,6 @@ end; constructor TfpgPageControl.Create(AOwner: TComponent); begin inherited Create(AOwner); - FFont := fpgStyle.DefaultFont; FPages := TList.Create; Width := 150; Height := 100; @@ -1291,10 +1289,7 @@ var begin Result := nil; h := TfpgTabSheet(FPages.First); - lp := FMargin; - if MaxButtonWidthSum > (Width-(FMargin*2)) then - h := FFirstTabButton; case TabPosition of tpTop: @@ -1324,6 +1319,8 @@ begin if TabPosition in [tpTop, tpBottom] then begin + if MaxButtonWidthSum > (Width-(FMargin*2)) then + h := FFirstTabButton; if (y > p1) and (y < p2) then begin while h <> nil do @@ -1346,11 +1343,13 @@ begin if TabPosition in [tpLeft, tpRight] then begin + bh := ButtonHeight; // initialize button height + if MaxButtonHeightSum > (Height-(FMargin*2)) then + h := FFirstTabButton; 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 diff --git a/src/gui/fpg_toggle.pas b/src/gui/fpg_toggle.pas new file mode 100644 index 00000000..9cdfe3af --- /dev/null +++ b/src/gui/fpg_toggle.pas @@ -0,0 +1,281 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2015 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. + + Original author: Andrew Haines + + Description: + Defines a ToggleBox control. A Checkbox like control that has an + animated bar that slides side to side when toggled. +} +unit fpg_toggle; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, + SysUtils, + fpg_base, + fpg_main, + fpg_stylemanager, + fpg_checkbox; + +type + + TfpgToggle = class(TfpgCheckBox) + private + FCheckedTextColor: TfpgColor; + FToggleWidth: TfpgCoord; + FToggleButtonWidth: TfpgCoord; + FAnimateTimer: TfpgTimer; + FCheckedCaption: TfpgString; + FCheckedColor: TfpgColor; + FSliderPosition: TfpgCoord; + FPaintedSliderPosition: TfpgCoord; + FUnCheckedCaption: TfpgString; + FUnCheckedColor: TfpgColor; + FUnCheckedTextColor: TfpgColor; + FUseAnimation: Boolean; + procedure SetCheckedCaption(AValue: TfpgString); + procedure SetCheckedColor(AValue: TfpgColor); + procedure SetCheckedTextColor(AValue: TfpgColor); + procedure SetToggleWidth(AValue: TfpgCoord); + procedure SetUnCheckedCaption(AValue: TfpgString); + procedure SetUnCheckedColor(AValue: TfpgColor); + procedure AnimateTimer(Sender: TObject); + procedure SetUnCheckedTextColor(AValue: TfpgColor); + function ToggleLeft: TfpgCoord; inline; + protected + procedure HandlePaint; override; + procedure HandleCheckChanged; override; + procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property UseAnimation: Boolean read FUseAnimation write FUseAnimation; + property ToggleWidth: TfpgCoord read FToggleWidth write SetToggleWidth default 45; + property CheckedCaption : TfpgString read FCheckedCaption write SetCheckedCaption; + property CheckedColor: TfpgColor read FCheckedColor write SetCheckedColor default clLime; + property CheckedTextColor: TfpgColor read FCheckedTextColor write SetCheckedTextColor default clHilite2; + property UnCheckedCaption: TfpgString read FUnCheckedCaption write SetUnCheckedCaption; + property UnCheckedColor: TfpgColor read FUnCheckedColor write SetUnCheckedColor default clWindowBackground; + property UnCheckedTextColor: TfpgColor read FUnCheckedTextColor write SetUnCheckedTextColor default clText1; + end; + +implementation + +{ TfpgToggle } + +procedure TfpgToggle.SetCheckedColor(AValue: TfpgColor); +begin + if FCheckedColor=AValue then Exit; + FCheckedColor:=AValue; + Invalidate; +end; + +procedure TfpgToggle.SetCheckedTextColor(AValue: TfpgColor); +begin + if FCheckedTextColor=AValue then Exit; + FCheckedTextColor:=AValue; + Invalidate; +end; + +procedure TfpgToggle.SetToggleWidth(AValue: TfpgCoord); +begin + if FToggleWidth=AValue then Exit; + FToggleWidth:=AValue; + FToggleButtonWidth:=AValue - 10; + Invalidate; +end; + +procedure TfpgToggle.SetCheckedCaption(AValue: TfpgString); +begin + if FCheckedCaption=AValue then Exit; + FCheckedCaption:=AValue; + Invalidate; +end; + +procedure TfpgToggle.SetUnCheckedCaption(AValue: TfpgString); +begin + if FUnCheckedCaption=AValue then Exit; + FUnCheckedCaption:=AValue; + Invalidate; +end; + +procedure TfpgToggle.SetUnCheckedColor(AValue: TfpgColor); +begin + if FUnCheckedColor=AValue then Exit; + FUnCheckedColor:=AValue; + Invalidate; +end; + +procedure TfpgToggle.AnimateTimer(Sender: TObject); +begin + if csDestroying in ComponentState then + Exit; + if not Checked then + begin // not checked + Dec(FSliderPosition, 1); + if FSliderPosition < 1 then + FSliderPosition:=0; + end + else // checked + begin + Inc(FSliderPosition); + if FSliderPosition >= FToggleWidth - FToggleButtonWidth -2then + FSliderPosition := FToggleWidth - FToggleButtonWidth -2; + end; + Invalidate; +end; + +procedure TfpgToggle.SetUnCheckedTextColor(AValue: TfpgColor); +begin + if FUnCheckedTextColor=AValue then Exit; + FUnCheckedTextColor:=AValue; + Invalidate; +end; + +function TfpgToggle.ToggleLeft: TfpgCoord; +begin + if BoxLayout = tbLeftBox then + Result := 1 + else + Result := Width - FToggleWidth; +end; + +procedure TfpgToggle.HandlePaint; +var + ToggleText: TfpgString; + TextEnabled: TfpgTextFlags; + BvlWdth: TfpgCoord; + ButtonRect: TfpgRect; +begin + Canvas.Clear(BackgroundColor); + + // Text + Canvas.SetFont(Font); + if Enabled then + TextEnabled := [] + else + TextEnabled := [txtDisabled]; + + BvlWdth := fpgStyleManager.Style.GetBevelWidth; + + if BoxLayout = tbRightBox then + Canvas.DrawText(fpgRect(0,0,FWidth-FToggleWidth, FHeight), Text, [txtLeft, txtVCenter] + TextEnabled) { internally this still calls fpgStyle.DrawString(), so theming will be applied } + else + Canvas.DrawText(fpgRect(ToggleWidth,0,FWidth-ToggleWidth, FHeight), Text, [txtRight, txtVCenter] + TextEnabled); { internally this still calls fpgStyle.DrawString(), so theming will be applied } + + // Toggle Stuff + + // Toggle area bevel + fpgStyleManager.Style.DrawBevel(Canvas,ToggleLeft,0,FToggleWidth, Height, False); + + // Toggle Button + ButtonRect := fpgRect(ToggleLeft+FSliderPosition+BvlWdth,BvlWdth,FToggleButtonWidth, Height -(BvlWdth*2)); + fpgStyleManager.Style.DrawBevel(Canvas,ButtonRect.Left, ButtonRect.Top, ButtonRect.Width, ButtonRect.Height, True); + + + // unchecked text + if FSliderPosition < (FToggleWidth - FToggleButtonWidth) div 2 then + begin + ToggleText := FUnCheckedCaption; + Canvas.SetTextColor(FUnCheckedTextColor); + end + // checked text + else + begin + ToggleText := FCheckedCaption; + Canvas.SetTextColor(FCheckedTextColor); + end; + + // Toggle Text (inside 2 bevels) + Canvas.DrawText(fpgRect(ToggleLeft+FSliderPosition+BvlWdth*2,BvlWdth*2,FToggleButtonWidth-BvlWdth*4, Height-BvlWdth*4),ToggleText, [txtVCenter, txtHCenter] + TextEnabled); + + // Paint on either side of the button part of the toggle + if FSliderPosition > 0 then + begin + Canvas.SetColor(CheckedColor); + Canvas.FillRectangle(fpgRect(ToggleLeft+1,1, FSliderPosition, FHeight - BvlWdth*2)); + end; + + if FSliderPosition < FToggleWidth - FToggleButtonWidth -2 then + begin + Canvas.SetColor(UnCheckedColor); + Canvas.FillRectangle(fpgRect(ToggleLeft + FSliderPosition + FToggleButtonWidth+BvlWdth, BvlWdth, FToggleWidth - FToggleButtonWidth - FSliderPosition -(BvlWdth*2), FHeight - BvlWdth*2)); + end; + + // lastly draw focus + if FFocusable and FFocused then + begin + InflateRect(ButtonRect, -1,-1); + fpgStyleManager.Style.DrawFocusRect(Canvas, ButtonRect); + end; + + + if FPaintedSliderPosition = FSliderPosition then + FAnimateTimer.Enabled:=False; + + FPaintedSliderPosition := FSliderPosition; +end; + +procedure TfpgToggle.HandleCheckChanged; +begin + if FUseAnimation then + FAnimateTimer.Enabled := True + else + begin + if Checked then + FSliderPosition := FToggleWidth - FToggleButtonWidth -2 + else + FSliderPosition := 0; + end; + FPaintedSliderPosition := -1; +end; + +procedure TfpgToggle.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); +begin + if ((BoxLayout = tbRightBox) and (x > Width - FToggleWidth)) + or ((BoxLayout = tbLeftBox) and (x <= FToggleWidth)) + then + inherited HandleLMouseUp(x, y, shiftstate); +end; + +constructor TfpgToggle.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Text := 'ToggleBox'; + ToggleWidth := 45; + BoxLayout := tbRightBox; + FUseAnimation := True; + FUnCheckedCaption := 'OFF'; + FCheckedCaption := 'ON'; + FUnCheckedColor := FBackgroundColor; + FCheckedColor := clLime; + FUnCheckedTextColor := clText1; + FCheckedTextColor := clHilite2; + FAnimateTimer := TfpgTimer.Create(12); + FAnimateTimer.Enabled := False; + FAnimateTimer.OnTimer := @AnimateTimer; +end; + +destructor TfpgToggle.Destroy; +begin + FAnimateTimer.Free; + inherited Destroy; +end; + +end. + diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index 7da5205c..6c929b5e 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2011 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -267,8 +267,10 @@ type property TreeLineColor: TfpgColor read FTreeLineColor write SetTreeLineColor default clShadow1; property TreeLineStyle: TfpgLineStyle read FTreeLineStyle write SetTreeLineStyle default lsDot; property OnChange: TNotifyEvent read FOnChange write FOnChange; - property OnExpand: TfpgTreeExpandEvent read FOnExpand write FOnExpand; property OnDoubleClick; + property OnExpand: TfpgTreeExpandEvent read FOnExpand write FOnExpand; + property OnKeyChar; + property OnKeyPress; property OnShowHint; property OnStateImageClicked: TfpgStateImageClickedEvent read FOnStateImageClicked write FOnStateImageClicked; end; diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc index 6a96d046..063c7972 100644 --- a/src/gui/selectdirdialog.inc +++ b/src/gui/selectdirdialog.inc @@ -135,7 +135,6 @@ begin begin try SortList := TStringList.Create; - SortList.Sorted := True; repeat // check if special file if (FileInfo.Name = '.') or (FileInfo.Name = '..') or (FileInfo.Name = '') then @@ -153,10 +152,12 @@ begin hidden files then do not add it to the list. } //if ((faHidden and FileInfo.Attr) > 0) and not FShowHidden then //continue; - SortList.Add(FileInfo.Name); end; until fpgFindNext(FileInfo) <> 0; + + SortList.Sort; + for i := 0 to SortList.Count - 1 do begin NewNode := Node.AppendText(SortList[i]); diff --git a/src/reportengine/u_command.pas b/src/reportengine/u_command.pas index 8ef6e406..c6746d0d 100644 --- a/src/reportengine/u_command.pas +++ b/src/reportengine/u_command.pas @@ -16,7 +16,7 @@ the objects in memory to produce either the preview or pdf files. The PDF Reporting Engine was originally written by - Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> + Jean-Marc Levecque <jmarc.levecque@jmlesite.web4me.fr> } unit U_Command; diff --git a/src/reportengine/u_pdf.pas b/src/reportengine/u_pdf.pas index 9f31bada..f6222cf2 100644 --- a/src/reportengine/u_pdf.pas +++ b/src/reportengine/u_pdf.pas @@ -16,7 +16,7 @@ produces the PDF file. The PDF Reporting Engine was originally written by - Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> + Jean-Marc Levecque <jmarc.levecque@jmlesite.web4me.fr> } unit U_Pdf; diff --git a/src/reportengine/u_report.pas b/src/reportengine/u_report.pas index 6fd2ac0b..0a6a8a3e 100644 --- a/src/reportengine/u_report.pas +++ b/src/reportengine/u_report.pas @@ -16,7 +16,7 @@ the user program. The PDF Reporting Engine was originally written by - Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> + Jean-Marc Levecque <jmarc.levecque@jmlesite.web4me.fr> } unit U_Report; @@ -353,7 +353,7 @@ type property NumPage: integer read FNmPage write FNmPage; property NumPageSection: integer read FNmPageSect write FNmPageSect; property PaperHeight: integer read GetPaperHeight; - property PagerWidth: integer read GetPaperWidth; + property PaperWidth: integer read GetPaperWidth; property DefaultFile: string read FDefaultFile write FDefaultFile; property CurrentColor: integer read FCurrentColor write FCurrentColor; property SectionTitle: string read GetSectionTitle write SetSectionTitle; diff --git a/uidesigner/anchors.inc b/uidesigner/anchors.inc index 0c9b3738..a53b557e 100644 --- a/uidesigner/anchors.inc +++ b/uidesigner/anchors.inc @@ -206,3 +206,55 @@ Const 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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 + vfd_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/uidesigner/icons.inc b/uidesigner/icons.inc index 0e75a91f..f58ab0a0 100644 --- a/uidesigner/icons.inc +++ b/uidesigner/icons.inc @@ -3720,3 +3720,116 @@ const 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,255,255, 255, 0, 0); + +const + stdimg_vfd_toggle: array[0..1849] of byte = ( + 66, 77, 58, 7, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0, + 0, 24, 0, 0, 0, 24, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 192, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 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,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,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,146,119, + 119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146, + 119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119, + 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,255, 0, + 255,255, 0,255,146,119,119,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,200,208,212,200,208,212,200,208,212,200,208,212,146, + 119,119,255, 0,255,255, 0,255,146,119,119,200,208,212, 0,230, 0, + 0,230, 0, 0,230, 0, 0,230, 0,255,255,255,132,132,132,132,132, + 132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132, + 132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132, + 200,208,212,146,119,119,255, 0,255,255, 0,255,146,119,119,200,208, + 212, 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 0,255,255,255,200, + 208,212,159,159,159, 0, 0, 0, 0, 0, 0,159,159,159,200,208,212, + 0, 0, 0,200,208,212,145,145,145, 0, 0, 0,200,208,212,200,208, + 212,132,132,132,200,208,212,146,119,119,255, 0,255,255, 0,255,146, + 119,119,200,208,212, 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 0, + 255,255,255,200,208,212, 0, 0, 0,200,208,212,200,208,212, 0, 0, + 0,200,208,212, 0, 0, 0,132,132,132, 0, 0, 0, 0, 0, 0,200, + 208,212,200,208,212,132,132,132,200,208,212,146,119,119,255, 0,255, + 255, 0,255,146,119,119,200,208,212, 0,230, 0, 0,230, 0, 0,230, + 0, 0,230, 0,255,255,255,200,208,212, 0, 0, 0,200,208,212,200, + 208,212, 0, 0, 0,200,208,212, 0, 0, 0, 0, 0, 0,132,132,132, + 0, 0, 0,200,208,212,200,208,212,132,132,132,200,208,212,146,119, + 119,255, 0,255,255, 0,255,146,119,119,200,208,212, 0,230, 0, 0, + 230, 0, 0,230, 0, 0,230, 0,255,255,255,200,208,212,159,159,159, + 0, 0, 0, 0, 0, 0,159,159,159,200,208,212, 0, 0, 0,145,145, + 145,200,208,212, 0, 0, 0,200,208,212,200,208,212,132,132,132,200, + 208,212,146,119,119,255, 0,255,255, 0,255,146,119,119,200,208,212, + 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 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,200,208,212,146,119,119,255, 0,255,255, 0,255,146,119, + 119,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,200,208, + 212,200,208,212,200,208,212,200,208,212,146,119,119,255, 0,255,255, + 0,255,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119, + 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119, + 119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146, + 119,119,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,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,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/uidesigner/images/toggle.bmp b/uidesigner/images/toggle.bmp Binary files differnew file mode 100644 index 00000000..304d0973 --- /dev/null +++ b/uidesigner/images/toggle.bmp diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index 31b9431d..29962b93 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -63,6 +63,7 @@ type procedure miMRUClick(Sender: TObject; const FileName: string); procedure SetupCaptions; procedure BuildThemePreviewMenu; + procedure ToggleDesignerGrid(Sender: TObject); public {@VFD_HEAD_BEGIN: frmMain} MainMenu: TfpgMenuBar; @@ -77,6 +78,7 @@ type miOpenRecentMenu: TfpgPopupMenu; helpmenu: TfpgPopupMenu; previewmenu: TfpgPopupMenu; + btnGrid: TfpgButton; {@VFD_HEAD_END: frmMain} mru: TfpgMRU; constructor Create(AOwner: TComponent); override; @@ -218,7 +220,6 @@ begin WindowTitle := 'Product Information...'; Hint := ''; WindowPosition := wpScreenCenter; - Sizeable := False; OnShow := @FormShow; lblAppName := TfpgLabel.Create(self); @@ -467,6 +468,25 @@ begin SetPosition(324, 36, 120, 20); end; + btnGrid := TfpgButton.Create(self); + with btnGrid do + begin + Name := 'btnGrid'; + SetPosition(103, 28, 25, 24); + Text := ''; + AllowAllUp := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := 'Toggle designer grid'; + ImageMargin := -1; + ImageName := 'vfd.grid'; + ImageSpacing := 0; + TabOrder := 13; + Focusable := False; + AllowDown := True; + OnClick := @ToggleDesignerGrid; + end; + {@VFD_BODY_END: frmMain} {%endregion} @@ -980,9 +1000,18 @@ begin sl.Free; end; +procedure TfrmMain.ToggleDesignerGrid(Sender: TObject); +begin + maindsgn.ShowGrid := btnGrid.Down; +end; + constructor TfrmMain.Create(AOwner: TComponent); begin inherited Create(AOwner); + fpgImages.AddMaskedBMP( + 'vfd.grid', @vfd_grid, + sizeof(vfd_grid), 0, 0); + OnShow := @FormShow; end; diff --git a/uidesigner/uidesigner.lpi b/uidesigner/uidesigner.lpi index be5b651a..fb0afe9c 100644 --- a/uidesigner/uidesigner.lpi +++ b/uidesigner/uidesigner.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="uidesigner.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="uidesigner"/> </Unit0> <Unit1> <Filename Value="vfdmain.pas"/> @@ -46,7 +45,6 @@ <Unit2> <Filename Value="vfdresizer.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="vfdresizer"/> </Unit2> <Unit3> <Filename Value="vfdforms.pas"/> @@ -81,7 +79,6 @@ <Unit9> <Filename Value="vfdeditors.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="vfdeditors"/> </Unit9> <Unit10> <Filename Value="vfdformparser.pas"/> @@ -96,12 +93,10 @@ <Unit12> <Filename Value="vfdutils.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="vfdutils"/> </Unit12> <Unit13> <Filename Value="vfdpropeditgrid.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="vfdpropeditgrid"/> </Unit13> <Unit14> <Filename Value="anchors.inc"/> @@ -134,8 +129,5 @@ <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> - <Other> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> </CONFIG> diff --git a/uidesigner/uidesigner.lpr b/uidesigner/uidesigner.lpr index 90da9d39..17d54a24 100644 --- a/uidesigner/uidesigner.lpr +++ b/uidesigner/uidesigner.lpr @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Library - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -23,9 +23,24 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, SysUtils, fpg_base, fpg_main, vfdmain, vfdresizer, vfdforms, - vfdfile, newformdesigner, vfdwidgets, vfdformparser, vfdeditors, - vfdwidgetclass, vfdutils, vfdprops, vfddesigner, vfdpropeditgrid, + Classes, + SysUtils, + fpg_base, + fpg_main, + fpg_utils, + vfdmain, + vfdresizer, + vfdforms, + vfdfile, + newformdesigner, + vfdwidgets, + vfdformparser, + vfdeditors, + vfdwidgetclass, + vfdutils, + vfdprops, + vfddesigner, + vfdpropeditgrid, vfd_constants; @@ -43,7 +58,7 @@ begin { If a file is passed in as a parameter, then load it } maindsgn.EditedFileName := ParamStr(1); - if FileExists(maindsgn.EditedFileName) then + if fpgFileExists(maindsgn.EditedFileName) then maindsgn.OnLoadFile(maindsgn); fpgApplication.Run; diff --git a/uidesigner/uidesigner.prj b/uidesigner/uidesigner.prj index 2523d8ce..26cfb3fd 100644 --- a/uidesigner/uidesigner.prj +++ b/uidesigner/uidesigner.prj @@ -15,9 +15,48 @@ order12=0 order13=0 order14=0 order15=0 +order16=0 [projectoptions] -projectdir=/home/graemeg/programming/fpgui/uidesigner -projectfilename=/home/graemeg/programming/fpgui/uidesigner/uidesigner.prj +projectdir=/data/devel/fpgui/uidesigner +projectfilename=/data/devel/fpgui/uidesigner/uidesigner.prj +findinfiledialog=37 + [findinfileadialogfo.subdirs] + value=1 + [findinfileadialogfo.inopenfiles] + value=0 + [findinfileadialogfo.wholeword] + value=0 + [findinfileadialogfo.casesensitive] + value=0 + [findinfileadialogfo.indirectories] + value=1 + [findinfileadialogfo.mask] + value="*.pas" "*.pp" "*.inc" + history=1 + "*.pas" "*.pp" "*.inc" + [findinfileadialogfo.dir] + filenames=1 + /data/devel/fpgui/src/ + filehistory=1 + /data/devel/fpgui/src/ + filefilterindex=0 + filefilter="*.pas" "*.pp" "*.inc" + filecolwidth=174 + x=0 + y=0 + cx=0 + cy=0 + [findinfileadialogfo.findtext] + value=MenuFont + history=2 + MenuFont + + [findinfileadialogfo] + stackedunder= + x=268 + y=415 + cx=339 + cy=251 finddialog=8 [finddialogfo.selectedonly] value=0 @@ -45,98 +84,98 @@ replacedialog=15 cy=171 options=99 [projectoptionsfo.twidgetgrid3] - propcolwidthref=666 - sortdescent0=0 - sortdescent1=0 - sortdescent2=0 - width3=102 - sortdescent3=0 - width4=310 - sortdescent4=0 - width5=204 - sortdescent5=0 + propcolwidthref=653 + sortdescend0=0 + sortdescend1=0 + sortdescend2=0 + sortdescend3=0 + width4=190 + sortdescend4=0 + width5=185 + sortdescend5=0 + width6=227 + sortdescend6=0 [projectoptionsfo.twidgetgrid4] propcolwidthref=477 width0=96 - sortdescent0=0 - width1=13 - sortdescent1=0 + sortdescend0=0 + sortdescend1=0 width2=73 - sortdescent2=0 + sortdescend2=0 width3=229 - sortdescent3=0 + sortdescend3=0 width4=238 - sortdescent4=0 + sortdescend4=0 sorted=0 col=0 row=0 - rowheight=17 + rowheight=16 [projectoptionsfo.newfile] firsttab=0 index=0 [projectoptionsfo.fontaliasgrid] propcolwidthref=336 width0=98 - sortdescent0=0 + sortdescend0=0 width1=325 - sortdescent1=0 + sortdescend1=0 width2=30 - sortdescent2=0 + sortdescend2=0 width3=50 - sortdescent3=0 + sortdescend3=0 width4=50 - sortdescent4=0 + sortdescend4=0 width5=50 - sortdescent5=0 + sortdescend5=0 width6=70 - sortdescent6=0 + sortdescend6=0 [projectoptionsfo.macrosplitter] x=0 - y=143 + y=144 xprop=1 yprop=0.32808988764045 [projectoptionsfo.macrogrid] propcolwidthref=460 - sortdescent0=0 - sortdescent1=0 - sortdescent2=0 - sortdescent3=0 - sortdescent4=0 - sortdescent5=0 + sortdescend0=0 + sortdescend1=0 + sortdescend2=0 + sortdescend3=0 + sortdescend4=0 + sortdescend5=0 width6=146 - sortdescent6=0 + sortdescend6=0 width7=448 - sortdescent7=0 + sortdescend7=0 [projectoptionsfo.makegroupbox] firsttab=0 index=2 [projectoptionsfo.exceptionsgrid] - propcolwidthref=637 + propcolwidthref=694 width0=47 - sortdescent0=0 - width1=631 - sortdescent1=0 + sortdescend0=0 + width1=688 + sortdescend1=0 [projectoptionsfo.ttabwidget1] firsttab=0 - index=1 + index=0 [projectoptionsfo.grid] propcolwidthref=438 width0=219 - sortdescent0=0 + sortdescend0=0 width1=431 - sortdescent1=0 + sortdescend1=0 [projectoptionsfo.filefiltergrid] propcolwidthref=545 width0=112 - sortdescent0=0 + sortdescend0=0 width1=538 - sortdescent1=0 + sortdescend1=0 [projectoptionsfo.ttabwidget2] firsttab=0 index=0 [projectoptionsfo.tabwidget] firsttab=0 - index=3 + index=9 [projectoptionsfo] stackedunder= x=263 @@ -162,7 +201,12 @@ programparameters=18 y=243 cx=328 cy=348 -settings=8 +settings=13 + [settingsfo.tsplitter2] + x=223 + y=16 + xprop=0.57879656160458 + yprop=1 [settingsfo] x=88 y=108 @@ -171,35 +215,96 @@ settings=8 wsize=0 active=1 visible=1 +mainfile=${PROJECTNAME}.lpr +targetfile=units/${TARGET}/${PROJECTNAME}${EXEEXT} +messageoutputfile= +makecommand=${COMPILER} +makedir= +unitdirs=7 + ${FPGUI}/lib/${TARGET} + ${FPGUI}/src/reportengine + ${FPGUI}/src/corelib/render/software + ${FPGUI}/src + ${FPGUI}/src/corelib/${FPG_GFX} + ${FPGUI}/src/gui + ${FPGUI}/src/corelib +unitpref=-Fu +incpref=-Fi +libpref=-Fl +objpref=-Fo +targpref=-o +befcommand=0 +aftcommand=0 +makeoptions=6 + -l -Mobjfpc -Sh + -gl -O- + -B + -O2 -XX -Xs -CX + -vewinh + -FEunits/${TARGET}/ +codetemplatedirs=1 + ${TEMPLATEDIR} +toolmenus=3 + fpGUI &DocView + UI Designer + Image Converter +toolfiles=3 + ${FPGUI}/docview/src/units/${TARGET}/docview${EXEEXT} + ${FPGUI}/uidesigner/units/${TARGET}/uidesigner${EXEEXT} + ${FPGUI}/tools/imageconvert/imgcnv${EXEEXT} +toolparams=3 + fpgui+rtl+fcl -k ${cursword} + ${CURSOURCEFILE} + +fontnames=0 +scriptbeforecopy= +scriptaftercopy= +newprojectfiles=4 + ${TEMPLATEDIR}/fpgui_single_unit/project.pas + ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt + ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt + ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt +newprojectfilesdest=4 + ${%PROJECTNAME%}.pas + ${%PROJECTDIR%}units/i386-linux/placeholder.txt + ${%PROJECTDIR%}units/i386-win32/placeholder.txt + ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt +newfinames=3 + Program + Unit + Textfile +newfifilters=3 + "*.pas" "*.pp" + "*.pas" "*.pp" + +newfiexts=3 + pas + pas + +newfisources=3 + ${TEMPLATEDIR}default/program.pas + ${TEMPLATEDIR}default/unit.pas + +newfonames=2 + Mainform + Simple Form +newfonamebases=2 + + +newfosources=2 + ${TEMPLATEDIR}fpgui/mainform.pas + ${TEMPLATEDIR}fpgui/simpleform.pas +newfoforms=2 + + +forcezorder=0 +stripmessageesc=0 copymessages=0 closemessages=0 checkmethods=1 -showgrid=1 -snaptogrid=1 -moveonfirstclick=1 -gridsizex=8 -gridsizey=8 -autoindent=1 -blockindent=2 -rightmarginon=1 -rightmarginchars=80 -scrollheight=0 -tabstops=2 -spacetabs=1 -tabindent=0 -editfontname=DeJaVu Sans Mono -editfontheight=13 -editfontwidth=0 -editfontextraspace=0 -editfontcolor=-1879048183 -editbkcolor=-1879048186 -statementcolor=14745599 -editfontantialiased=1 -editmarkbrackets=1 -backupfilecount=0 -encoding=0 -codetemplatedirs=1 - ${TEMPLATEDIR} +colorerror=-1610612712 +colorwarning=-1610612717 +colornote=-1610612716 usercolors=30 0 0 @@ -262,24 +367,185 @@ usercolorcomment=30 +formatmacronames=0 +formatmacrovalues=0 +settingsfile=uidesigner_clean.prj +settingseditor=1 +settingsdebugger=1 +settingsstorage=1 +settingsprojecttree=0 +settingsautoload=0 +settingsautosave=0 +modulenames=0 +moduletypes=0 +modulefiles=0 +befcommandon=0 +makeoptionson=6 + 39 + 3 + 6 + 4 + 39 + 39 +aftcommandon=0 +unitdirson=7 + 65568 + 65543 + 196615 + 131079 + 196615 + 65543 + 65543 +macroon=0 +macronames=0 +macrovalues=0 +macrogroup=0 +groupcomments=6 + + + + + + +toolsave=3 + 0 + 0 + 0 +toolhide=3 + 0 + 0 + 0 +toolparse=3 + 0 + 0 + 0 +toolmessages=3 + 0 + 0 + 0 +fontalias=0 +fontancestors=0 +fontheights=0 +fontwidths=0 +fontoptions=0 +fontxscales=0 +expandprojectfilemacros=4 + 1 + -1 + -1 + -1 +loadprojectfile=4 + 1 + 0 + 0 + 0 +newinheritedforms=2 + 0 + 0 +uid=0 +sourcefilemasks=5 + "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" + "*.c" "*.cc" "*.h" + "*.mfm" + "*.ipf" + "*.sql" +syntaxdeffiles=5 + ${SYNTAXDEFDIR}pascal_dark.sdef + ${SYNTAXDEFDIR}cpp.sdef + ${SYNTAXDEFDIR}objecttext.sdef + ${SYNTAXDEFDIR}ipf2.sdef + ${SYNTAXDEFDIR}sql.sdef +filemasknames=5 + Source + Forms + Text + IPF help + All Files +filemasks=5 + "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" + *.mfm + *.txt + *.ipf + * +showgrid=1 +snaptogrid=1 +moveonfirstclick=1 +noformdesignerdocking=0 +gridsizex=8 +gridsizey=8 +autoindent=1 +blockindent=2 +linenumberson=0 +rightmarginon=1 +rightmarginchars=80 +scrollheight=0 +tabstops=2 +spacetabs=1 +showtabs=0 +tabindent=0 +editfontname=Raize +editfontheight=16 +editfontwidth=0 +editfontextraspace=0 +editfontcolor=-1879048183 +editbkcolor=-1879048186 +statementcolor=14745599 +editfontantialiased=1 +editmarkbrackets=1 +backupfilecount=0 +encoding=0 +codetemplatedirs=1 + ${TEMPLATEDIR} +debugcommand=${DEBUGGER} +debugoptions= +debugtarget= +runcommand= +xtermcommand=xterm -S${PTSN}/${PTSH} +remoteconnection= +uploadcommand= +gdbprocessor=i386 +gdbservercommand= +gdbservercommandattach= +beforeconnect= +afterconnect= +beforeload= +afterload= +beforerun= +sourcedirs=7 + ${FPGUI}/src/reportengine/ + ${FPGUI}/src/corelib/render/software/ + ${FPGUI}/src/ + ${FPGUI}/src/corelib/${FPG_GFX}/ + ${FPGUI}/src/gui/ + ${FPGUI}/src/corelib/ + ./ +defines=0 +progparameters= +progworkingdirectory= +envvarnames=0 +envvarvalues=0 +defineson=0 stoponexception=0 valuehints=1 activateonbreak=1 +raiseonbreak=1 showconsole=1 externalconsole=0 +settty=1 gdbdownload=0 downloadalways=0 startupbkpt=0 startupbkpton=0 gdbsimulator=0 +gdbserverstartonce=0 gdbserverwait=0 nogdbserverexit=0 +gdbservertty=0 exceptclassnames=1 EconvertError exceptignore=1 0 -settingsfile= -settingseditor=0 +nodebugbeginend=0 sigsettings=27 1,1,T,F 3,3,T,F @@ -308,197 +574,7 @@ sigsettings=27 28,28,T,F 29,29,T,F 30,30,T,F -modulenames=0 -moduletypes=0 -modulefiles=0 -mainfile=${PROJECTNAME}.lpr -targetfile=units/${TargetCPU}-${TargetOS}/${PROJECTNAME}${EXEEXT} -messageoutputfile= -makecommand=${COMPILER} -makedir= -debugcommand=${DEBUGGER} -debugoptions= -debugtarget= -runcommand= -remoteconnection= -uploadcommand= -gdbprocessor=i386 -gdbservercommand= -gdbservercommandattach= -beforeload= -afterload= -beforerun= defaultmake=4 -befcommand=0 -befcommandon=0 -aftcommand=0 -aftcommandon=0 -makeoptions=6 - -l -Mobjfpc -Sh - -gl -O- - -B - -O2 -XX -Xs -CX - -vewinh - -FEunits/${TargetCPU}-${TargetOS}/ -makeoptionson=6 - 63 - 31 - 34 - 32 - 63 - 63 -macroon=6 - 1 - 3 - 6 - 4 - 63 - 63 -macronames=6 - TargetCPU - TargetOS - TargetCPU - TargetOS - FPGUI_DIR - HelpPath -macrovalues=6 - x86_64 - linux - i386 - win32 - /home/graemeg/programming/fpgui - /opt/FPC_Docs/inf/ -macrogroup=0 -groupcomments=6 - Linux 64-bit - Linux 32-bit - Windows 32-bit - - - -sourcedirs=5 - ${FPGUI_DIR}/src/gui/ - ${FPGUI_DIR}/src/corelib/gdi/X/ - ${FPGUI_DIR}/src/corelib/x11/ - ${FPGUI_DIR}/src/corelib/ - ./ -defines=0 -defineson=0 -unitdirs=6 - ${FPGUI_DIR}/lib/${TargetCPU}-${TargetOS}/ - ${FPGUI_DIR}/ - ${FPGUI_DIR}/src/corelib/gdi/ - ${FPGUI_DIR}/src/corelib/x11/ - ${FPGUI_DIR}/src/gui/ - ${FPGUI_DIR}/src/corelib/ -unitdirson=6 - 65539 - 131100 - 196616 - 196612 - 65564 - 65564 -unitpref=-Fu -incpref=-Fi -libpref=-Fl -objpref=-Fo -targpref=-o -sourcefilemasks=5 - "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" - "*.c" "*.cc" "*.h" - "*.mfm" - "*.ipf" - "*.sql" -syntaxdeffiles=5 - ${SYNTAXDEFDIR}pascal_dark.sdef - ${SYNTAXDEFDIR}cpp.sdef - ${SYNTAXDEFDIR}objecttext.sdef - ${SYNTAXDEFDIR}ipf2.sdef - ${SYNTAXDEFDIR}sql.sdef -filemasknames=5 - Source - Forms - Text - IPF help - All Files -filemasks=5 - "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" - *.mfm - *.txt - *.ipf - * -toolsave=1 - 0 -toolhide=1 - 0 -toolparse=1 - 0 -toolmenus=1 - fpGUI &DocView -toolfiles=1 - /home/graemeg/bin/docview -toolparams=1 - FPCHELP -k ${cursword} -fontalias=0 -fontancestors=0 -fontnames=0 -fontheights=0 -fontwidths=0 -fontoptions=0 -fontxscales=0 -scriptbeforecopy= -scriptaftercopy= -newprojectfiles=4 - ${TEMPLATEDIR}/fpgui_single_unit/project.pas - ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt - ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt - ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt -newprojectfilesdest=4 - ${%PROJECTNAME%}.pas - ${%PROJECTDIR%}units/i386-linux/placeholder.txt - ${%PROJECTDIR%}units/i386-win32/placeholder.txt - ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt -expandprojectfilemacros=4 - 1 - -1 - -1 - -1 -loadprojectfile=4 - 1 - 0 - 0 - 0 -newfinames=3 - Program - Unit - Textfile -newfinfilters=3 - "*.pas" "*.pp" - "*.pas" "*.pp" - -newfiexts=3 - pas - pas - -newfisources=3 - ${TEMPLATEDIR}default/program.pas - ${TEMPLATEDIR}default/unit.pas - -newfonames=2 - Mainform - Simple Form -newfonamebases=2 - - -newinheritedforms=2 - 0 - 0 -newfosources=2 - ${TEMPLATEDIR}fpgui/mainform.pas - ${TEMPLATEDIR}fpgui/simpleform.pas -newfoforms=2 - - [breakpoints] on=0 path=0 @@ -511,126 +587,171 @@ panels=1 panel1 units= ( - modulefilenames=0 - modulenames=0 - moduleclassnames=0 - a=0,4149,0,Pascal Units - c=16 - ( - file=/home/graemeg/programming/fpgui/uidesigner/anchors.inc - kind=1 - a=0,4100,0,anchors.inc - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/icons.inc - kind=1 - a=0,4100,0,icons.inc - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas - kind=1 - a=0,4100,0,newformdesigner.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/uidesigner.lpr - kind=1 - a=0,4100,0,uidesigner.lpr - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfddesigner.pas - kind=1 - a=0,4100,0,vfddesigner.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdeditors.pas - kind=1 - a=0,4100,0,vfdeditors.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdfile.pas - kind=1 - a=0,4100,0,vfdfile.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdformparser.pas - kind=1 - a=0,4100,0,vfdformparser.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdforms.pas - kind=1 - a=0,4100,0,vfdforms.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdmain.pas - kind=1 - a=0,4100,0,vfdmain.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdpropeditgrid.pas - kind=1 - a=0,4100,0,vfdpropeditgrid.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdprops.pas - kind=1 - a=0,4100,0,vfdprops.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdresizer.pas - kind=1 - a=0,4100,0,vfdresizer.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdutils.pas - kind=1 - a=0,4100,0,vfdutils.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdwidgetclass.pas - kind=1 - a=0,4100,0,vfdwidgetclass.pas - ) - ( - file=/home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas - kind=1 - a=0,4100,0,vfdwidgets.pas - ) + a=0,4133,6,Pascal Units ) cmodules= ( - a=0,4132,0,C Modules + a=0,4132,6,C Modules ) files= ( - a=0,4149,0,Text Files - c=1 - ( - file=/home/graemeg/programming/fpgui/uidesigner/extrafpc.cfg - kind=1 - a=0,4100,0,extrafpc.cfg - ) + a=0,4133,6,Text Files ) [componentstore] -storedir=/opt/msegui/apps/ide/compstore/ +storedir=/data/devel/msegui/apps/ide/compstore/ filename= +[components] +[selecteditpage] +colwidth=100 +x=160 +y=124 +cx=704 +cy=473 +[progparams] +progparamhistory=0 +envvarons=0 +[edit] +hintwidth=462 +hintheight=214 +finddtext=fpg_dialog +findhistory=9 + fpg_dialog + fpgSetNamedFont( + res= + 30005 + NewView + images + Sort + sort + uses +findoptions=1 +editpos=14 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 6,27 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 + 0,-1073741823 +bookmarks0=0 +bookmarks1=0 +bookmarks2=0 +bookmarks3=0 +bookmarks4=0 +bookmarks5=0 +bookmarks6=0 +bookmarks7=0 +bookmarks8=0 +bookmarks9=0 +bookmarks10=1 + 568,1 +bookmarks11=0 +bookmarks12=0 +bookmarks13=0 +sourcefiles=14 + /home/graemeg/programming/fpgui/uidesigner/vfdforms.pas + /home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas + /home/graemeg/programming/fpgui/uidesigner/vfdmain.pas + /home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas + /data/devel/fpgui/uidesigner/vfddesigner.pas + /data/devel/fpgui/src/gui/fpg_dialogs.pas + /data/devel/fpgui/src/corelib/fpg_base.pas + /data/devel/fpgui/src/corelib/fpg_main.pas + /data/devel/fpgui/src/gui/fpg_menu.pas + /data/devel/fpgui/uidesigner/uidesigner.lpr + /data/devel/fpgui/src/gui/messagedialog.inc + /data/devel/fpgui/src/corelib/fpg_stdimages.pas + /data/devel/fpgui/src/corelib/stdimages.inc + /data/devel/fpgui/src/corelib/fpg_imgfmt_png.pas +relpaths=14 + vfdforms.pas + vfdwidgets.pas + vfdmain.pas + newformdesigner.pas + vfddesigner.pas + ../src/gui/fpg_dialogs.pas + ../src/corelib/fpg_base.pas + ../src/corelib/fpg_main.pas + ../src/gui/fpg_menu.pas + uidesigner.lpr + ../src/gui/messagedialog.inc + ../src/corelib/fpg_stdimages.pas + ../src/corelib/stdimages.inc + ../src/corelib/fpg_imgfmt_png.pas +ismoduletexts=14 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +modules=0 +moduleoptions=0 +visiblemodules=0 +nomenumodules=0 +[sourcefo.tabwidget] +order=14 + 0 + 1 + 2 + 3 + 4 + 6 + 7 + 11 + 12 + 5 + 13 + 10 + 8 + 9 +tabsize=152 +firsttab=0 +index=13 [layout] -windowlayout=539 +windowlayout=543 + [mainfo.openform] + filenames=1 + /data/devel/msegui/apps/ide/componentpaletteform.mfm + filehistory=1 + /data/devel/msegui/apps/ide/componentpaletteform.mfm + filefilterindex=0 + filefilter=*.mfm + filecolwidth=174 + x=0 + y=0 + cx=0 + cy=0 [mainfo.projectfiledia] filenames=1 - /home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/sqleditor.prj - lastdir=/home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/ + /data/devel/fpgui/uidesigner/uidesigner_clean.prj + lastdir=/data/devel/fpgui/uidesigner/ filehistory=10 - /home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/sqleditor.prj - /home/graemeg/programming/fpgui/uidesigner/uidesigner.prj - /home/graemeg/programming/MasterMaths/m2_system/Source/tutoradmin/tutoradmin.prj - /opt/git/fpgui_opengl.git/examples/corelib/helloworld/helloworld.prj - /home/graemeg/programming/tests/gridspeed/fpgui/test.prj - /home/graemeg/programming/tests/gridspeed/fpgui/columns/test.prj - /home/graemeg/programming/fpgui/docview/src/docview.prj - /home/graemeg/programming/MasterMaths/m2_system/Source/tutoradmin/tutoradmin_clean.prj - /home/graemeg/programming/tests/dndtest4/project1.prj - /home/graemeg/programming/tests/gridspeed/msegui/test.prj + /data/devel/fpgui/uidesigner/uidesigner_clean.prj + /data/devel/fpgui/uidesigner/uidesigner.prj + /data/devel/opensource/mseuniverse/tools/msegit/msegit.prj + /data/devel/QTS/csvimporter/src/csvimporter.prj + /data/devel/MasterMaths/m2_system/Source/tools/script_runner/sqleditor_clean.prj + /data/devel/MasterMaths/m2_system/Source/tutoradmin/tutoradmin.prj + /data/devel/msegui/apps/facedemo/facedemo.prj + /data/devel/opensoft/bugcollector/src/bugcollector.prj + /data/devel/msegui/apps/ide/mseide_gg.prj + /data/devel/msegui/apps/ide/mseide.prj filefilterindex=0 filefilter=*.prj filecolwidth=174 @@ -641,6 +762,9 @@ windowlayout=539 [mainfo.openfile] filenames=0 filehistory=10 + /data/devel/fpgui/src/gui/messagedialog.inc + /data/devel/fpgui/src/gui/fpg_style.pas + /data/devel/fpgui/src/gui/colordialog.inc /home/graemeg/programming/fpgui/docview/docs/docview.ipf /home/graemeg/kylix3/examples/delphi/threads/SortThds.pas /home/graemeg/kylix3/source/clx/QComCtrls.pas @@ -648,9 +772,6 @@ windowlayout=539 /home/graemeg/programming/fpgui/src/gui/fpg_tree.pas /home/graemeg/programming/fpgui/uidesigner/tests/test_widget_order.pas /opt/msegui_svn/apps/ide/sourcepage.pas - /home/graemeg/programming/fpgui/uidesigner/extrafpc.cfg - /home/graemeg/programming/fpgui/uidesigner/uidesigner.lpr - /home/mse/proj/msegui/testcase/jean-pierre/Demo/main.pas filefilterindex=4 filefilter="*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" filecolwidth=174 @@ -663,7 +784,7 @@ windowlayout=539 useroptions=15488 [mainfo] splitdir=0 - useroptions=33554559 + useroptions=33554555 stackedunder= parent= mdistate=0 @@ -671,15 +792,12 @@ windowlayout=539 ny=0 ncx=0 ncy=0 - x=27 - y=52 - cx=1086 - cy=809 + x=384 + y=49 + cx=1266 + cy=1250 rcx=0 rcy=0 - children=2 - container,0,17,1076,792 - ,0,0,1076,17 wsize=0 active=1 visible=1 @@ -710,10 +828,10 @@ windowlayout=539 ny=0 ncx=0 ncy=0 - x=37 - y=270 - cx=349 - cy=276 + x=0 + y=0 + cx=0 + cy=0 rcx=0 rcy=0 wsize=0 @@ -722,7 +840,7 @@ windowlayout=539 [memoryfo] splitdir=0 useroptions=16507 - stackedunder=threadsfo + stackedunder=cpui386fo parent= mdistate=0 nx=0 @@ -768,15 +886,15 @@ windowlayout=539 [findinfilefo] splitdir=0 useroptions=16491 - stackedunder=componentstorefo + stackedunder=mainfo parent= mdistate=0 nx=0 ny=0 ncx=0 ncy=0 - x=239 - y=115 + x=1700 + y=107 cx=678 cy=414 rcx=0 @@ -785,7 +903,7 @@ windowlayout=539 splitdir=0 useroptions=49259 parent=mainfo.panel1.container - visible=1 + visible=0 mdistate=0 nx=0 ny=0 @@ -794,32 +912,32 @@ windowlayout=539 x=0 y=0 cx=205 - cy=604 - rcx=0 - rcy=0 + cy=987 + rcx=1246 + rcy=987 [projecttreefo.grid] propcolwidthref=35 width0=170 - sortdescent0=0 + sortdescend0=0 width1=29 - sortdescent1=0 + sortdescend1=0 sorted=0 col=0 - row=9 - rowheight=17 + row=1 + rowheight=16 [stackfo] splitdir=0 - useroptions=16489 + useroptions=24681 parent= mdistate=0 nx=0 ny=0 ncx=0 ncy=0 - x=407 - y=349 - cx=254 - cy=180 + x=0 + y=0 + cx=0 + cy=0 rcx=0 rcy=0 wsize=0 @@ -845,28 +963,27 @@ windowlayout=539 visible=0 [watchpointsfo.grid] propcolwidthref=352 - width0=16 - sortdescent0=0 + sortdescend0=0 values1=0 values1_ci=-1 width1=33 - sortdescent1=0 + sortdescend1=0 values2=0 width2=158 - sortdescent2=0 + sortdescend2=0 width4=34 - sortdescent4=0 + sortdescend4=0 values5=0 values5_ci=-1 width5=38 - sortdescent5=0 + sortdescend5=0 values6=0 width6=184 - sortdescent6=0 + sortdescend6=0 [breakpointsfo] splitdir=0 useroptions=16491 - stackedunder=watchpointsfo + stackedunder=componentpalettefo parent= mdistate=0 nx=0 @@ -906,13 +1023,13 @@ windowlayout=539 [objectinspectorfo.grid] propcolwidthref=306 width0=73 - sortdescent0=0 + sortdescend0=0 width1=227 - sortdescent1=0 + sortdescend1=0 [symbolfo] splitdir=0 - useroptions=16511 - stackedunder=findinfilefo + useroptions=16507 + stackedunder=breakpointsfo parent= mdistate=0 nx=0 @@ -925,8 +1042,6 @@ windowlayout=539 cy=137 rcx=0 rcy=0 - children=1 - container,0,0,351,137 wsize=0 active=0 visible=0 @@ -934,9 +1049,9 @@ windowlayout=539 propcolwidthref=222 values0=0 width0=111 - sortdescent0=0 + sortdescend0=0 width1=135 - sortdescent1=0 + sortdescend1=0 [symbolfo.symbol] [watchfo] splitdir=0 @@ -952,33 +1067,31 @@ windowlayout=539 y=0 cx=247 cy=44 - rcx=1235 - rcy=782 + rcx=1256 + rcy=1214 [watchfo.grid] propcolwidthref=123 values0=2 -1 -1 values0_ci=-1 - width0=13 - sortdescent0=0 + sortdescend0=0 values1=2 po2^ test width1=66 - sortdescent1=0 + sortdescend1=0 values3=2 0 0 values3_ci=-1 - width3=12 - sortdescent3=0 + sortdescend3=0 values4=2 0 0 values4_ci=-1 width4=13 - sortdescent4=0 + sortdescend4=0 [watchfo.watchon] [watchfo.expression] [watchfo.watcheson] @@ -994,14 +1107,14 @@ windowlayout=539 ncx=0 ncy=0 x=0 - y=641 - cx=1076 - cy=130 + y=1025 + cx=1256 + cy=189 rcx=0 rcy=0 [componentstorefo] splitdir=0 - useroptions=24675 + useroptions=24699 stackedunder=memoryfo parent= mdistate=0 @@ -1021,12 +1134,12 @@ windowlayout=539 [componentstorefo.grid] propcolwidthref=435 width0=111 - sortdescent0=0 - sortdescent1=0 + sortdescend0=0 + sortdescend1=0 width2=160 - sortdescent2=0 + sortdescend2=0 width3=185 - sortdescent3=0 + sortdescend3=0 [componentstorefo.storefiledialog] filenames=1 /home/mse/test/msegui/apps/ide/compstore/ @@ -1065,7 +1178,7 @@ windowlayout=539 [componentpalettefo] splitdir=0 useroptions=24683 - stackedunder=disassfo + stackedunder=componentstorefo parent= mdistate=0 nx=0 @@ -1095,8 +1208,8 @@ windowlayout=539 ncy=0 x=0 y=0 - cx=1076 - cy=31 + cx=1256 + cy=32 rcx=0 rcy=0 [sourcefo] @@ -1109,10 +1222,10 @@ windowlayout=539 ny=0 ncx=0 ncy=0 - x=208 + x=0 y=0 - cx=868 - cy=604 + cx=1256 + cy=987 rcx=0 rcy=0 [actionsmo.watchesonact] @@ -1130,16 +1243,16 @@ windowlayout=539 ncx=0 ncy=0 x=0 - y=34 - cx=1076 - cy=604 + y=35 + cx=1256 + cy=987 rcx=0 rcy=0 [cpui386fo] irqoff=0 splitdir=0 useroptions=16491 - stackedunder=mainfo + stackedunder=findinfilefo parent= mdistate=0 nx=0 @@ -1155,65 +1268,7 @@ windowlayout=539 wsize=0 active=0 visible=0 -[edit] -hintwidth=462 -hintheight=214 -finddtext=res= -findhistory=7 - res= - 30005 - NewView - images - Sort - sort - uses +[targetconsole] +finddtext= +findhistory=0 findoptions=1 -editpos=5 - 0,-1073741823 - 0,-1073741823 - 0,-1073741823 - 0,-1073741823 - 23,73 -bookmarks0=0 -bookmarks1=0 -bookmarks2=0 -bookmarks3=0 -bookmarks4=0 -sourcefiles=5 - /home/graemeg/programming/fpgui/uidesigner/vfdforms.pas - /home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas - /home/graemeg/programming/fpgui/uidesigner/vfdmain.pas - /home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas - /home/graemeg/programming/fpgui/uidesigner/vfddesigner.pas -relpaths=5 - vfdforms.pas - vfdwidgets.pas - vfdmain.pas - newformdesigner.pas - vfddesigner.pas -ismoduletexts=5 - 0 - 0 - 0 - 0 - 0 -modules=0 -visiblemodules=0 -[sourcefo.tabwidget] -tabsize=152 -firsttab=0 -index=4 -[components] -[selecteditpage] -colwidth=100 -x=160 -y=124 -cx=704 -cy=473 -[progparams] -parameters= -progparamhistory=0 -workingdirectory= -envvarons=0 -envvarnames=0 -envvarvalues=0 diff --git a/uidesigner/uidesigner.project b/uidesigner/uidesigner.project new file mode 100644 index 00000000..3ec67e19 --- /dev/null +++ b/uidesigner/uidesigner.project @@ -0,0 +1,36 @@ +[ProjectOptions] +ProjectDir=/home/graemeg/devel/fpgui/uidesigner/ +ProjectName=uidesigner.project +MainUnit=uidesigner.lpr +TargetFile=uidesigner${EXEEXT} +DefaultMake=0 +UnitOutputDir=units/${TARGET}/ +MakeOptionsCount=4 +MakeOptionEnabled1=1,1,1,1,1,1 +MakeOptionEnabled2=1,1,1,1,1,0 +MakeOptionEnabled3=0,1,0,0,0,1 +MakeOptionEnabled4=0,0,0,0,0,1 +MacroCount=3 +Macro1=TargetCPU=i386 +Macro2=TargetOS=win32 +Macro3=tiOPF_fpGUI_Dir=/home/graemeg/devel/tiopf/ +UnitDirsCount=6 +UnitDirEnabled1=1,1,1,1,0,0,0,1,0,0 +UnitDirEnabled2=1,1,1,1,0,0,1,1,0,0 +UnitDirEnabled3=1,1,1,0,0,0,1,1,0,0 +UnitDirEnabled4=0,0,0,1,0,0,1,1,0,0 +UnitDirEnabled5=1,1,1,1,0,0,1,0,0,0 +UnitDirEnabled6=1,1,1,1,0,0,1,0,0,0 +MakeOption1=-l -Mobjfpc -Sch +MakeOption2=-gl -O- +MakeOption3=-B +MakeOption4=-O2 -XX -Xs -CX +UnitDir1=${FPGUIDIR}/src/ +UnitDir2=${FPGUIDIR}/src/corelib/ +UnitDir3=${FPGUIDIR}/src/corelib/x11/ +UnitDir4=${FPGUIDIR}/src/corelib/gdi/ +UnitDir5=${FPGUIDIR}/src/gui/ +UnitDir6=${FPGUIDIR}/src/gui/db/ + +[Units] +UnitCount=0 diff --git a/uidesigner/uidesigner_clean.prj b/uidesigner/uidesigner_clean.prj new file mode 100644 index 00000000..bb71809f --- /dev/null +++ b/uidesigner/uidesigner_clean.prj @@ -0,0 +1,361 @@ +[projectoptions] +mainfile=${PROJECTNAME}.lpr +targetfile=units/${TARGET}/${PROJECTNAME}${EXEEXT} +messageoutputfile= +makecommand=${COMPILER} +makedir= +unitdirs=7 + ${FPGUI}/lib/${TARGET} + ${FPGUI}/src/reportengine + ${FPGUI}/src/corelib/render/software + ${FPGUI}/src + ${FPGUI}/src/corelib/${FPG_GFX} + ${FPGUI}/src/gui + ${FPGUI}/src/corelib +unitpref=-Fu +incpref=-Fi +libpref=-Fl +objpref=-Fo +targpref=-o +befcommand=0 +aftcommand=0 +makeoptions=6 + -l -Mobjfpc -Sh + -gl -O- + -B + -O2 -XX -Xs -CX + -vewinh + -FEunits/${TARGET}/ +codetemplatedirs=1 + ${TEMPLATEDIR} +toolmenus=3 + fpGUI &DocView + UI Designer + Image Converter +toolfiles=3 + ${FPGUI}/docview/src/units/${TARGET}/docview${EXEEXT} + ${FPGUI}/uidesigner/units/${TARGET}/uidesigner${EXEEXT} + ${FPGUI}/tools/imageconvert/imgcnv${EXEEXT} +toolparams=3 + fpgui+rtl+fcl -k ${cursword} + ${CURSOURCEFILE} + +fontnames=0 +scriptbeforecopy= +scriptaftercopy= +newprojectfiles=4 + ${TEMPLATEDIR}/fpgui_single_unit/project.pas + ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt + ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt + ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt +newprojectfilesdest=4 + ${%PROJECTNAME%}.pas + ${%PROJECTDIR%}units/i386-linux/placeholder.txt + ${%PROJECTDIR%}units/i386-win32/placeholder.txt + ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt +newfinames=3 + Program + Unit + Textfile +newfifilters=3 + "*.pas" "*.pp" + "*.pas" "*.pp" + +newfiexts=3 + pas + pas + +newfisources=3 + ${TEMPLATEDIR}default/program.pas + ${TEMPLATEDIR}default/unit.pas + +newfonames=2 + Mainform + Simple Form +newfonamebases=2 + + +newfosources=2 + ${TEMPLATEDIR}fpgui/mainform.pas + ${TEMPLATEDIR}fpgui/simpleform.pas +newfoforms=2 + + +forcezorder=0 +stripmessageesc=0 +copymessages=0 +closemessages=0 +checkmethods=1 +colorerror=-1610612712 +colorwarning=-1610612717 +colornote=-1610612716 +usercolors=30 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +usercolorcomment=30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +formatmacronames=0 +formatmacrovalues=0 +settingsfile=uidesigner_clean.prj +settingseditor=1 +settingsdebugger=1 +settingsstorage=1 +settingsprojecttree=0 +settingsautoload=0 +settingsautosave=0 +modulenames=0 +moduletypes=0 +modulefiles=0 +befcommandon=0 +makeoptionson=6 + 39 + 3 + 6 + 4 + 39 + 39 +aftcommandon=0 +unitdirson=7 + 65568 + 65543 + 196615 + 131079 + 196615 + 65543 + 65543 +macroon=0 +macronames=0 +macrovalues=0 +macrogroup=0 +groupcomments=6 + + + + + + +toolsave=3 + 0 + 0 + 0 +toolhide=3 + 0 + 0 + 0 +toolparse=3 + 0 + 0 + 0 +toolmessages=3 + 0 + 0 + 0 +fontalias=0 +fontancestors=0 +fontheights=0 +fontwidths=0 +fontoptions=0 +fontxscales=0 +expandprojectfilemacros=4 + 1 + -1 + -1 + -1 +loadprojectfile=4 + 1 + 0 + 0 + 0 +newinheritedforms=2 + 0 + 0 +uid=0 +sourcefilemasks=5 + "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" + "*.c" "*.cc" "*.h" + "*.mfm" + "*.ipf" + "*.sql" +syntaxdeffiles=5 + ${SYNTAXDEFDIR}pascal_dark.sdef + ${SYNTAXDEFDIR}cpp.sdef + ${SYNTAXDEFDIR}objecttext.sdef + ${SYNTAXDEFDIR}ipf2.sdef + ${SYNTAXDEFDIR}sql.sdef +filemasknames=5 + Source + Forms + Text + IPF help + All Files +filemasks=5 + "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" + *.mfm + *.txt + *.ipf + * +showgrid=1 +snaptogrid=1 +moveonfirstclick=1 +noformdesignerdocking=0 +gridsizex=8 +gridsizey=8 +autoindent=1 +blockindent=2 +linenumberson=0 +rightmarginon=1 +rightmarginchars=80 +scrollheight=0 +tabstops=2 +spacetabs=1 +showtabs=0 +tabindent=0 +editfontname=Raize +editfontheight=16 +editfontwidth=0 +editfontextraspace=0 +editfontcolor=-1879048183 +editbkcolor=-1879048186 +statementcolor=14745599 +editfontantialiased=1 +editmarkbrackets=1 +backupfilecount=0 +encoding=0 +codetemplatedirs=1 + ${TEMPLATEDIR} +debugcommand=${DEBUGGER} +debugoptions= +debugtarget= +runcommand= +xtermcommand=xterm -S${PTSN}/${PTSH} +remoteconnection= +uploadcommand= +gdbprocessor=i386 +gdbservercommand= +gdbservercommandattach= +beforeconnect= +afterconnect= +beforeload= +afterload= +beforerun= +sourcedirs=7 + ${FPGUI}/src/reportengine/ + ${FPGUI}/src/corelib/render/software/ + ${FPGUI}/src/ + ${FPGUI}/src/corelib/${FPG_GFX}/ + ${FPGUI}/src/gui/ + ${FPGUI}/src/corelib/ + ./ +defines=0 +progparameters= +progworkingdirectory= +envvarnames=0 +envvarvalues=0 +defineson=0 +stoponexception=0 +valuehints=1 +activateonbreak=1 +raiseonbreak=1 +showconsole=1 +externalconsole=0 +settty=1 +gdbdownload=0 +downloadalways=0 +startupbkpt=0 +startupbkpton=0 +gdbsimulator=0 +gdbserverstartonce=0 +gdbserverwait=0 +nogdbserverexit=0 +gdbservertty=0 +exceptclassnames=1 + EconvertError +exceptignore=1 + 0 +nodebugbeginend=0 +sigsettings=27 + 1,1,T,F + 3,3,T,F + 4,4,T,F + 6,6,T,F + 7,7,T,F + 8,8,T,F + 9,9,T,F + 10,10,T,F + 11,11,T,F + 12,12,T,F + 13,13,T,F + 15,15,T,F + 16,16,T,F + 17,17,F,F + 18,18,T,F + 19,19,T,F + 20,20,T,F + 21,21,T,F + 22,22,T,F + 23,23,T,F + 24,24,T,F + 25,25,T,F + 26,26,T,F + 27,27,T,F + 28,28,T,F + 29,29,T,F + 30,30,T,F +defaultmake=4 diff --git a/uidesigner/units/i386-freebsd/.gitignore b/uidesigner/units/i386-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/uidesigner/units/i386-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/uidesigner/units/i386-linux/.gitignore b/uidesigner/units/i386-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/uidesigner/units/i386-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/uidesigner/units/i386-win32/.gitignore b/uidesigner/units/i386-win32/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/uidesigner/units/i386-win32/.gitignore @@ -0,0 +1 @@ +* diff --git a/uidesigner/units/x86_64-freebsd/.gitignore b/uidesigner/units/x86_64-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/uidesigner/units/x86_64-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/uidesigner/units/x86_64-linux/.gitignore b/uidesigner/units/x86_64-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/uidesigner/units/x86_64-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas index 70757ba4..a3b60597 100644 --- a/uidesigner/vfddesigner.pas +++ b/uidesigner/vfddesigner.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -59,8 +59,15 @@ type TDesignedForm = class(TfpgForm) + private + FShowGrid: boolean; + procedure SetShowGrid(AValue: boolean); + protected + procedure HandlePaint; override; public + constructor Create(AOwner: TComponent); override; procedure AfterCreate; override; + property ShowGrid: boolean read FShowGrid write SetShowGrid; end; @@ -74,11 +81,12 @@ type FSelected: boolean; resizer: array[1..8] of TwgResizer; other: TStringList; + MarkForDeletion: Boolean; constructor Create(AFormDesigner: TFormDesigner; wg: TfpgWidget; wgc: TVFDWidgetClass); destructor Destroy; override; + procedure UpdateResizerPositions; property Selected: boolean read FSelected write SetSelected; property Widget: TfpgWidget read FWidget; - procedure UpdateResizerPositions; property FormDesigner: TFormDesigner read FFormDesigner; end; @@ -88,7 +96,7 @@ type FOneClickMove: boolean; protected FWidgets: TList; - FForm: TfpgForm; + FForm: TDesignedForm; FFormOther: string; FDragging: boolean; FDragPosX, @@ -134,7 +142,7 @@ type function GetWidgetSourceImpl(wd: TWidgetDesigner; ident: string): string; // The widgets can be selected and dragged within one click property OneClickMove: boolean read FOneClickMove write FOneClickMove; - property Form: TfpgForm read FForm; + property Form: TDesignedForm read FForm; property FormOther: string read FFormOther write FFormOther; end; @@ -198,6 +206,7 @@ begin FSelected := False; wg.MouseCursor := mcDefault; other := TStringList.Create; + MarkForDeletion := False; end; destructor TWidgetDesigner.Destroy; @@ -623,20 +632,44 @@ procedure TFormDesigner.DeleteWidgets; var n: integer; cd: TWidgetDesigner; + + procedure DeleteChildWidget(ADesignWidget: TWidgetDesigner); + var + i: integer; + begin + if not Assigned(ADesignWidget.Widget) then // safety check + Exit; + if ADesignWidget.Widget.IsContainer and (ADesignWidget.Widget.ComponentCount > 0) then + begin + for i := ADesignWidget.Widget.ComponentCount - 1 downto 0 do + DeleteChildWidget(WidgetDesigner(TfpgWidget(ADesignWidget.Widget.Components[i]))); + end; + ADesignWidget.MarkForDeletion := True; + end; + begin n := 0; + // Pass 1: Mark widgets and children than need deletion while n < FWidgets.Count do begin cd := TWidgetDesigner(FWidgets.Items[n]); if cd.Selected then + DeleteChildWidget(cd); + Inc(n); + end; + + // Pass 2: free TWidgetDesigner instances that have no more Widget instances + for n := FWidgets.Count-1 downto 0 do + begin + cd := TWidgetDesigner(FWidgets.Items[n]); + if cd.MarkForDeletion then begin cd.Widget.Free; cd.Free; FWidgets.Delete(n); - end - else - Inc(n); + end; end; + UpdatePropWin; end; @@ -676,7 +709,7 @@ var begin frm := TWidgetOrderForm.Create(nil); frm.WindowTitle := cEditOrder[AMode]; - frm.Title := cEditOrder[AMode]; + frm.Title := maindsgn.selectedform.Form.Name; frm.Treeview1.RootNode.Clear; lFocused := nil; @@ -1178,6 +1211,14 @@ begin s := s + Ind(1) + 'Hint := ' + QuotedStr(t) + ';' + LineEnding; end; + // IconName property - This is ugly, Form's properties are not handled well!! + PropInfo := GetPropInfo(FForm.ClassType, 'IconName'); + t := GetStrProp(FForm, 'IconName'); + if IsStoredProp(FForm, PropInfo) then + begin + s := s + Ind(1) + 'IconName := ' + QuotedStr(t) + ';' + LineEnding; + end; + // ShowHint property - This is ugly, Form's properties are not handled well!! PropInfo := GetPropInfo(FForm.ClassType, 'ShowHint'); i := GetOrdProp(FForm, 'ShowHint'); @@ -1466,6 +1507,51 @@ end; { TDesignedForm } +procedure TDesignedForm.SetShowGrid(AValue: boolean); +begin + if FShowGrid = AValue then + Exit; + FShowGrid := AValue; + Invalidate; +end; + +procedure TDesignedForm.HandlePaint; +var + i: integer; +begin + inherited HandlePaint; + if FShowGrid then + begin + Canvas.Clear(TfpgColor($ff3e85cd)); + // horizontal lines + for i := 0 to Height-1 do + begin + if i mod 50 = 0 then + Canvas.SetColor(TfpgColor($ff5492d0)) + else + Canvas.SetColor(TfpgColor($ff488bcf)); + if i mod 10 = 0 then + Canvas.DrawLine(0, i, Width-1, i); + end; + // vertical lines + for i := 0 to Width-1 do + begin + if i mod 50 = 0 then + Canvas.SetColor(TfpgColor($ff5492d0)) + else + Canvas.SetColor(TfpgColor($ff488bcf)); + if i mod 10 = 0 then + Canvas.DrawLine(i, 0, i, Height-1); + end; + end; +end; + +constructor TDesignedForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FShowGrid := False; +end; + procedure TDesignedForm.AfterCreate; begin inherited AfterCreate; diff --git a/uidesigner/vfdforms.pas b/uidesigner/vfdforms.pas index 9d9b42bd..d7558bac 100644 --- a/uidesigner/vfdforms.pas +++ b/uidesigner/vfdforms.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -128,7 +128,6 @@ type public {@VFD_HEAD_BEGIN: frmVFDSetup} lb1: TfpgLabel; - chlGrid: TfpgComboBox; btnOK: TfpgButton; btnCancel: TfpgButton; lblRecentFiles: TfpgLabel; @@ -144,6 +143,7 @@ type chkCodeRegions: TfpgCheckBox; cbIndentationType: TfpgComboBox; lblIndentType: TfpgLabel; + edtGridX: TfpgEditInteger; {@VFD_HEAD_END: frmVFDSetup} procedure AfterCreate; override; procedure BeforeDestruction; override; @@ -292,8 +292,6 @@ end; procedure TWidgetOrderForm.SetupCaptions; begin inherited SetupCaptions; - WindowTitle := rsDlgWidgetOrder; - lblTitle.Text := fpgAddColon(rsFormTitle); btnOK.Text := rsOK; btnCancel.Text := rsCancel; btnUp.Text := rsUp; @@ -330,7 +328,7 @@ begin SetPosition(4, 4, 248, 16); FontDesc := '#Label1'; Hint := ''; - Text := 'Form %s:'; + Text := 'Form: %s'; end; btnOK := TfpgButton.Create(self); @@ -491,7 +489,7 @@ end; procedure TfrmVFDSetup.LoadSettings; begin FINIVersion := gINI.ReadInteger('Designer', 'Version', 0); - chlGrid.FocusItem := gINI.ReadInteger('Options', 'GridResolution', 2); + edtGridX.Value := gINI.ReadInteger('Options', 'GridResolution', 4); tbMRUFileCount.Position := gINI.ReadInteger('Options', 'MRUFileCount', 4); chkFullPath.Checked := gINI.ReadBool('Options', 'ShowFullPath', True); edtDefaultExt.Text := gINI.ReadString('Options', 'DefaultFileExt', '.pas'); @@ -504,7 +502,7 @@ end; procedure TfrmVFDSetup.SaveSettings; begin gINI.WriteInteger('Designer', 'Version', cDesignerINIVersion); - gINI.WriteInteger('Options', 'GridResolution', chlGrid.FocusItem); + gINI.WriteInteger('Options', 'GridResolution', edtGridX.Value); gINI.WriteInteger('Options', 'MRUFileCount', tbMRUFileCount.Position); gINI.WriteBool('Options', 'ShowFullPath', chkFullPath.Checked); gINI.WriteString('Options', 'DefaultFileExt', edtDefaultExt.Text); @@ -542,21 +540,6 @@ begin Text := 'Grid resolution:'; end; - chlGrid := TfpgComboBox.Create(self); - with chlGrid do - begin - Name := 'chlGrid'; - SetPosition(144, 28, 88, 24); - ExtraHint := ''; - FontDesc := '#List'; - Hint := ''; - Items.Add('1'); - Items.Add('4'); - Items.Add('8'); - FocusItem := -1; - TabOrder := 1; - end; - btnOK := TfpgButton.Create(self); with btnOK do begin @@ -729,6 +712,19 @@ begin Text := 'Indent Type for generated code:'; end; + edtGridX := TfpgEditInteger.Create(self); + with edtGridX do + begin + Name := 'edtGridX'; + SetPosition(119, 28, 48, 24); + FontDesc := '#Edit1'; + Hint := ''; + MaxValue := 10; + MinValue := 1; + TabOrder := 18; + Value := 4; + end; + {@VFD_BODY_END: frmVFDSetup} LoadSettings; diff --git a/uidesigner/vfdmain.pas b/uidesigner/vfdmain.pas index 5dcb90d4..d94fee05 100644 --- a/uidesigner/vfdmain.pas +++ b/uidesigner/vfdmain.pas @@ -38,8 +38,10 @@ type TMainDesigner = class(TObject) private + FShowGrid: boolean; procedure SetEditedFileName(const Value: string); procedure LoadDefaults; + procedure SetShowGrid(AValue: boolean); protected FDesigners: TList; FFile: TVFDFile; @@ -71,6 +73,7 @@ type procedure OnExit(Sender: TObject); procedure OnOptionsClick(Sender: TObject); property EditedFileName: string read FEditedFileName write SetEditedFileName; + property ShowGrid: boolean read FShowGrid write SetShowGrid; end; @@ -165,7 +168,13 @@ begin CreateParseForm(bl.FormName, bl.Data, bl2.Data); // pair was found end; end; - + + for n := 0 to FDesigners.Count - 1 do + begin + selectedform := nil; + TFormDesigner(FDesigners[n]).Form.ShowGrid := FShowGrid; + end; + frmMain.mru.AddItem(fname); end; @@ -310,6 +319,7 @@ begin if nfrm.edName.Text <> '' then fd.Form.Name := nfrm.edName.Text; fd.Form.WindowTitle := fd.Form.Name; + fd.Form.ShowGrid := FShowGrid; fd.OneClickMove := OneClickMove; FDesigners.Add(fd); SelectedForm := fd; @@ -466,16 +476,23 @@ end; procedure TMainDesigner.LoadDefaults; begin - case gINI.ReadInteger('Options', 'GridResolution', 1) of - 0: GridResolution := 2; - 1: GridResolution := 4; - 2: GridResolution := 8; - end; + GridResolution := gINI.ReadInteger('Options', 'GridResolution', 4); DefaultPasExt := gINI.ReadString('Options', 'DefaultFileExt', '.pas'); UndoOnPropExit := gINI.ReadBool('Options', 'UndoOnExit', DefUndoOnPropExit); OneClickMove := gINI.ReadBool('Options', 'OneClickMove', True); fpgApplication.HintPause := 1000; end; +procedure TMainDesigner.SetShowGrid(AValue: boolean); +var + i: integer; +begin + if FShowGrid = AValue then + Exit; + FShowGrid := AValue; + for i := 0 to FDesigners.Count-1 do + TFormDesigner(FDesigners[i]).Form.ShowGrid := AValue; +end; + end. diff --git a/uidesigner/vfdresizer.pas b/uidesigner/vfdresizer.pas index 657746b6..a01af27b 100644 --- a/uidesigner/vfdresizer.pas +++ b/uidesigner/vfdresizer.pas @@ -43,7 +43,7 @@ type constructor Create(ACompDesigner: TObject; adirection: integer); reintroduce; procedure Show; end; - + implementation @@ -65,18 +65,14 @@ begin FDragging := True; FDragPosX := x; FDragPosy := y; - {$IFDEF MSWINDOWS} CaptureMouse; - {$ENDIF} end; procedure TwgResizer.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); begin inherited HandleLMouseUp(x, y, shiftstate); FDragging := False; - {$IFDEF MSWINDOWS} ReleaseMouse; - {$ENDIF} end; procedure TwgResizer.HandleMouseMove(x, y: integer; btnstate: word; @@ -91,7 +87,7 @@ begin if (not FDragging) or ((btnstate and MOUSE_LEFT) = 0) then Exit; - + dx := x - FDragPosX; dy := y - FDragPosY; diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas index 2238e4e5..f0a9d62e 100644 --- a/uidesigner/vfdwidgets.pas +++ b/uidesigner/vfdwidgets.pas @@ -67,6 +67,7 @@ uses fpg_ColorWheel, fpg_splitter, fpg_hyperlink, + fpg_toggle, vfdpropeditgrid, vfdmain; @@ -325,6 +326,12 @@ begin fpgImages.AddBMP( 'vfd.scrollframe', @stdimg_vfd_scrollframe, sizeof(stdimg_vfd_scrollframe)); + + fpgImages.AddMaskedBMP( + 'vfd.toggle', @stdimg_vfd_toggle, + sizeof(stdimg_vfd_toggle), + 0, 0); + end; procedure AddWidgetPosProps(wgc: TVFDWidgetClass); @@ -344,6 +351,7 @@ begin wc := TVFDWidgetClass.Create(TfpgForm); wc.NameBase := 'frm'; wc.AddProperty('WindowTitle', TPropertyString, ''); + wc.AddProperty('IconName', TPropertyString, 'Image name to change window icon'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Sizeable', TPropertyBoolean, 'Can the form be resized at runtime'); @@ -792,6 +800,8 @@ begin wc.AddProperty('Enabled', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('MaxValue', TPropertyInteger, ''); + wc.AddProperty('MinValue', TPropertyInteger, ''); wc.AddProperty('NegativeColor', TPropertyColor, 'Color used for negative values'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ReadOnly', TPropertyBoolean, ''); @@ -813,6 +823,8 @@ begin wc.AddProperty('FixedDecimals', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('MaxValue', TPropertyFloat, ''); + wc.AddProperty('MinValue', TPropertyFloat, ''); wc.AddProperty('NegativeColor', TPropertyColor, 'Color used for negative values'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ReadOnly', TPropertyBoolean, ''); @@ -985,6 +997,30 @@ begin wc.WidgetIconName := 'vfd.hyperlink'; RegisterVFDWidget(wc); + // ToggleBox + wc := TVFDWidgetClass.Create(TfpgToggle); + wc.NameBase := 'Toggle'; + wc.AddProperty('Align', TPropertyEnum, ''); + wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); + wc.AddProperty('CheckedCaption', TPropertyString, 'Initial text'); + wc.AddProperty('CheckedColor', TPropertyColor, ''); + wc.AddProperty('CheckedTextColor', TPropertyColor, ''); + 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.AddProperty('ToggleWidth', TPropertyInteger, 'Width of toggle button'); + wc.AddProperty('UnCheckedCaption', TPropertyString, 'Initial text'); + wc.AddProperty('UnCheckedColor', TPropertyColor, ''); + wc.AddProperty('UnCheckedTextColor', TPropertyColor, ''); + wc.AddProperty('UseAnimation', TPropertyBoolean, ''); + wc.WidgetIconName := 'vfd.toggle'; + RegisterVFDWidget(wc); + // Other - do not delete!!! this should be the last... wc := TVFDWidgetClass.Create(TOtherWidget); wc.NameBase := 'Custom'; |