diff options
author | Andrew Haines <andrewd207@aol.com> | 2010-08-15 09:22:59 -0400 |
---|---|---|
committer | Andrew Haines <andrewd207@aol.com> | 2010-08-15 09:22:59 -0400 |
commit | 917a2daf4ff769ad27631e6c71a7b919c47e4ecb (patch) | |
tree | c524983404bd70c97c17395995f962cdf41899cc | |
parent | 77245bbf79e8568ba143cd7654e8aba352253a81 (diff) | |
parent | 59df247d7a5ff46cc8ac697526510b2ff6cbe5d2 (diff) | |
download | fpGUI-917a2daf4ff769ad27631e6c71a7b919c47e4ecb.tar.xz |
Merge branch 'master' of ssh://fpgui.git.sourceforge.net/gitroot/fpgui/fpgui
434 files changed, 52105 insertions, 12180 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt index cc2c694c..29c349d2 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -19,12 +19,13 @@ Contributors Felipe Monteiro de Carvalho Andrew Haines Giuliano Colla -Jean-Marc Levecque - various & French translation -Antonio Sanguigni - various & Italian translation -Vladimir Zhirov - various & Russian translation -Alexsander Rosa - Portuguese translation -Horacio Jamilis - Spanish translation +Jean-Marc Levecque +Antonio Sanguigni +Vladimir Zhirov +Alexsander Rosa +Horacio Jamilis Michael van Canneyt +JP Anghel ______________.o0O0o.______________ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0bb239e2..bef016ce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,109 @@ Release notes for fpGUI ======================= +v0.7 (2010-08-02) + - Quite a few more minor bug fixes since v0.7-rc2. + - Some memory leaks in TfpgListView + - Added an example Debug Server in examples/apps/debugserver + - This can be used with FPC's dbugintf unit so you can send + debug messages. Handy for debugging CGI apps on your server. + - A new unit fpg_imgutils was added. It contains some handy + utility functions for images. + - Implemented disabled images support for all controls that can + display images. + - Added a new TfpgMemo Mediator for use with tiOPF based + applications. + - Improved quick date selection in TfpgComboCalendar. Users can + now click the Year or Month to quickly select a different value + without the need for scrolling through every month. + - Many more improvements to the "prototype" text editor component + located in prototypes/textedit/. Soon this will become a + standard component in fpGUI. + - Minor improvements to DocView's toolbar. + - DocView now has a 'File | Open Special' option, which can open + environment variables pointing to a location where INF files are. + - Grids now have a smooth scrolling option for horizontal scrolling. + - A new Input Query dialog was added. + - Some demos where improved. eg: SplashScreen demo. + - JPEG image format support was added. Soon all image formats + supported by FPImage will be included. Unfortunately it did not + make it into this release. + - Added a fpGUI project template for when you use fpGUI with MSEide. + - A new Color Selection dialog was added to fpGUI. + - fpGUI's UI Designer has a few more components on the component palette. + eg: TfpgFilenameEdit, TfpgDirectoryEdit, TfpgFontEdit, etc... + - Some more minor changes to allow compiling fpGUI under MacOSX with X11. + + +v0.7.rc2 (2010-04-08) + - Localization of Character Map dialog. + - Insert from Character Map added to TfpgEdit default popup menu. + - ModalResults is now a enum type. Improved integration with UI + Designer. + - Memo: problems with deleting selected text is now fixed. + - Improved WinCE support, including reading BMP files. + - Fixed compilation of all example projects. + - Extended available properties that can be edited via the Object + Inspector of the UI Designer. + - Fixed issues where dialogs are closed via the window border X + button and not the available buttons in the dialog. Developer + can define behaviour of X close button. + - Improved TabSheet handling in UI Designer. + - Various improvements to TfpgPageControl and TfpgTabSheet. This + includes new tab positions: Bottom, Left, Right and None. + - SelectDirectory dialog was not working under Windows. + - Setting selected directory in SelectDirectory dialog now works. + - New mouse cursor demo. + - Improved the ability to customize the HintWindow. HintWindow + demo was extended to show how this can be done. + - Improved Visible property handling especially with child + components. Now only the parent Visible property is changed. + - tiOPF: correctly disable event handlers in edit mediators. + - Added a script which generates a fpGUI version number based on + Git repository information. Later this will be converted to + a object pascal console application. + + +v0.7.rc1 (2010-03-04) + - FPC 2.4.0 compatible. + - Fully tested on 32-bit and 64-bit platforms. Tested on Linux, + Windows and the *BSD family. + - Mobile device support is back. Tested on ARM Linux and Windows + Mobile devices. + - fpGUI UI Designer has improved a lot and extended it's component + palette and Object Inspector. + - Various bug fixes, memory leaks and other enhancements have been + applied. + - Units have a more uniform naming style. + - Classes have a more uniform structure/hierarchy with base classes. + - Help support has been added to the core framework + - fpGUI now has it's own help file viewer called DocView. + Docview includes the following features: + - document annotation + - bookmarks + - browse history + - exporting articles to plain text or IPF format. + - full text search (including weighting of results to see how + relevant the results are) + - Font and Color customization + - Concatenation of help files at run-time so a library of help + files can be viewed simultaneously. + - Easy integration via the "external tools" feature of IDE's like + Lazarus or MSEide. This allows for context sensitive help. + - History of most recently viewed help files. + - Help file format used is the INF format (IBM's format used it + OS/2), which is very compact, incredibly fast and supports full + text search. + - A lot of new components have been added, including enhancements + to existing components. + - Various new dialogs have been added, which include Color Wheel, + Character Map, Database Login etc. + - Improved integration with tiOPF project via the Model-GUI-Mediator + design pattern. + - Graphical FPCUnit unit test runner. + - Lots of new language translations for the core fpGUI library. + - A lot of new example projects demoing various GUI components. + v0.6 (2008-02-17) revision 534 - Added a new INI Utils unit which introduces ReadOnly ini support diff --git a/VERSION-GEN b/VERSION-GEN new file mode 100755 index 00000000..3945d05f --- /dev/null +++ b/VERSION-GEN @@ -0,0 +1,47 @@ +#!/bin/sh + +if test -f AUTHORS.txt +then + VF=src/VERSION_FILE.inc +else + VF=../../VERSION_FILE.inc +fi +DEF_VER=v0.6 + +LF=' +' + +# First see if there is a version file (included in release tarballs), +# then try git-describe, then default. +if test -f version +then + VN=$(cat version) || VN="$DEF_VER" +elif test -d .git -o -f .git && + VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && + case "$VN" in + *$LF*) (exit 1) ;; + v[0-9]*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" ;; + esac +then + VN=$(echo "$VN" | sed -e 's/-/./g'); +else + VN="$DEF_VER" +fi + +VN=$(expr "$VN" : v*'\(.*\)') + +if test -r $VF +then + VC=$(sed -e 's/^FPGUI_VERSION = //' <$VF) +else + VC=unset +fi +test "$VN" = "$VC" || { + echo >&2 "FPGUI_VERSION = '$VN';" + echo "FPGUI_VERSION = '$VN';" >$VF +} + + diff --git a/src/readme.txt b/docs/INSTALL.txt index 6c97dc41..d3aefbf5 100644 --- a/src/readme.txt +++ b/docs/INSTALL.txt @@ -1,29 +1,39 @@ + fpGUI Toolkit + + INSTALLATION NOTES + + + 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 to compile. I'll assume you have the 'fpc' executable setup in your PATH so it -can be run from any location on your computer. I'll also assume you global +can be run from any location on your computer. I'll also assume your global fpc.cfg file has been setup correctly so the FPC compiler can find the RTL and FCL units. -Under Linux run: build.sh +Under Linux run: + cd <fpgui>/src + build.sh -Under Windows run: build.bat +Under Windows run: + cd <fpgui>\src + build.bat -The extrafpc.cfg file located in this 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 CoreLib and GUI directories. +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 ../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 @@ -61,7 +71,7 @@ find all the fpGUI compiled units and source for you. 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 so doesn't read the standard fpc.cfg file. @@ -72,7 +82,7 @@ so doesn't read the standard fpc.cfg file. * Now enter the following directories replacing the relevant parts with your actual paths. The example below is valid on my system only. I was using FPC 2.2.0 under Linux and the X11 corelib backend. - + /opt/fpc_2.2.0/lib/fpc/2.2.0/units/i386-linux/* /opt/fpc_2.2.0/lib/fpc/2.2.0/units/i386-linux/rtl /home/graemeg/programming/fpGUI/src/corelib @@ -82,30 +92,30 @@ so doesn't read the standard fpc.cfg file. * Now select the 'Include files' tab and enter the following paths. 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/x11 - + * Now changes to 'Miscellaneous' tab, PPU output directory. Type in the edit box: units - + NOTE: This will place all the compiled *.ppu and *.o files into a 'units' directory inside you current directory. So make sure you create it before you try to compile for the first time. FPC doesn't create directories for you! - + * Now you are ready to open your projects main program unit (F3) and compiling it by pressing (F9). - - + + 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. You only need to specify that config file and the project unit to compile -it. +it. fpc @extrafpc.cfg <project unit> @@ -113,12 +123,49 @@ Example: fpc @extrafpc.cfg docedit.lpr + MacOSX instructions and known issues + ==================================== + +NOTE: + MacOSX is still an unsupported platform, but some 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). + +An example workflow to work with any fpgui app is: +a) launch X11 (Applications -> Utilities) +b) start the X11 console xterm (Cmd+N or from the X11 menu) +c) type the path to your fpgui application ( example: cd +./Documents/fpgui/examples/apps if you put fpgui in your Documents +folder) +d) type ./appname to start the application "appname" + + * Apparently starting fpGUI apps from an icon on the desktop requires that you + double click the icon twice. This issue seems to be common with other X11 + apps under OSX as well. eg: Gimp, any GTK2 app etc.. Alternatively, start it + from a X11 console, then it runs first time. + + * This issue is more about FPC then fpGUI specific, but it's handy to know. In + many standard Xcode + X11 installation, the linker could not find the X11 + libraries. So changing the fpc.cfg by adding + -Fl/usr/X11/lib + in the search library path solved the problem. Mac usually doesn't let you + choose the path during installation, so probably other Snow Leopard users + will have to double check the correct X11 library path. + + * 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. When using Lazarus IDE to + compile fpGUI projects, the IDE normally creates the missing unit output + path for you. + -Regards, - - Graeme - + =================[ END ]=================== - =========================================== diff --git a/docs/README.txt b/docs/README.txt new file mode 100644 index 00000000..e08a5212 --- /dev/null +++ b/docs/README.txt @@ -0,0 +1,53 @@ + +fpGUI information +================= + This version of fpGUI is based on a implementation where every + widget has a window handle. In other words every widget is actually + an embedded window inside a top-level window (aka Form). + + If you wanted to look at the old design of fpGUI - the one based on + a single handle per Form - then create a local branch based on the + tag 'single_handle_fpgui', or the slightly newer branch called + 'v0.4_fixes'. + + Release v0.5 and later is the new design (multi-handle implementation). + It was a complete rewrite of the code. + + + +To install FPC under Debian/Ubuntu +================================== + Select the fpc.deb metapackage, which depends on a number of sub-packages + containing the compiler, the units and so on. The 'libc' unit provided by + FPC is included in the fp-units-i386.deb package, which is however marked + as "deprecated" by the Ubuntu package manager and is therefore *not* + installed by default using fpc.deb. + + The following command will set up FPC under Ubuntu in order to be used with + fpGUI: + + sudo apt-get install fpc fp-units-i386 + + + +How to compile fpGUI +==================== + Please see the INSTALL.txt file for detailed instructions. + + + +System requirements under Linux +=============================== +To be able to compile and link fpGUI based applications you need to install +the following library dependencies. The packages will pull in all the other +required packages too. + + $ sudo apt-get install libX11-dev + $ sudo apt-get install libXft-dev + + + +Regards, + - Graeme Geldenhuys - + + ============================================
\ No newline at end of file diff --git a/docs/build_gui.sh b/docs/build_gui.sh deleted file mode 100755 index 81f3e91d..00000000 --- a/docs/build_gui.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# fpc/bin must be in your PATH -fpdoc --package=GUI \ - --format=html \ - --output=html/gui/ \ - --content=html/gui.cnt \ - --charset=UTF-8 \ - --footer-date='yyyy-mm-dd' \ - --html-search=/fpgui/docs/search.html \ - --import=html/corelib.cnt,../corelib/ \ - --descr=xml/gui/fpg_dialogs.xml --input='-Fi../src/gui ../src/gui/fpg_dialogs.pas' \ - --descr=xml/gui/fpg_hyperlink.xml --input='-Fi../src/gui ../src/gui/fpg_hyperlink.pas' \ - --descr=xml/gui/fpg_colormapping.xml --input='-Fi../src/gui ../src/gui/fpg_colormapping.pas' \ - --descr=xml/gui/fpg_colorwheel.xml --input='-Fi../src/gui ../src/gui/fpg_colorwheel.pas' - - -# --descr=xml/gui/fpg_.xml --input='-Fi../src/gui ../src/gui/fpg_.pas' \ - diff --git a/docs/build_corelib.sh b/docs/build_html.sh index dfdf8eaa..f4eb9f31 100755 --- a/docs/build_corelib.sh +++ b/docs/build_html.sh @@ -1,33 +1,44 @@ #!/bin/sh # fpc/bin must be in your PATH -# --html-search=../search.html \ -fpdoc --package=CoreLib \ + +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/corelib/ \ + --output=html/ \ --charset=UTF-8 \ --footer-date='yyyy-mm-dd' \ - --content=html/corelib.cnt \ - --html-search=/fpgui/docs/search.html \ - --import=html/gui.cnt,../gui/ \ --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 ../src/corelib/fpg_main.pas' --descr=xml/corelib/fpg_main.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_cmdlineparams.pas' --descr=xml/corelib/fpg_cmdlineparams.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_stdimages.pas' --descr=xml/corelib/fpg_stdimages.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_stringutils.pas' --descr=xml/corelib/fpg_stringutils.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_widget.pas' --descr=xml/corelib/fpg_widget.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_utils.pas' --descr=xml/corelib/fpg_utils.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_popupwindow.pas' --descr=xml/corelib/fpg_popupwindow.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_imagelist.pas' --descr=xml/corelib/fpg_imagelist.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_pofiles.pas' --descr=xml/corelib/fpg_pofiles.xml \ --input='-Fi../src/corelib ../src/corelib/fpg_translations.pas' --descr=xml/corelib/fpg_translations.xml \ - --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.xml - + --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.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_.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 new file mode 100755 index 00000000..57fe2814 --- /dev/null +++ b/docs/build_ipf.sh @@ -0,0 +1,42 @@ +#!/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 \ + --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_cmdlineparams.pas' --descr=xml/corelib/fpg_cmdlineparams.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_stdimages.pas' --descr=xml/corelib/fpg_stdimages.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_stringutils.pas' --descr=xml/corelib/fpg_stringutils.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_popupwindow.pas' --descr=xml/corelib/fpg_popupwindow.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_imagelist.pas' --descr=xml/corelib/fpg_imagelist.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_pofiles.pas' --descr=xml/corelib/fpg_pofiles.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_translations.pas' --descr=xml/corelib/fpg_translations.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.xml \ + --input='-Fi../src/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_.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 new file mode 100755 index 00000000..967f1d21 --- /dev/null +++ b/docs/build_rtf.sh @@ -0,0 +1,42 @@ +#!/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_cmdlineparams.pas' --descr=xml/corelib/fpg_cmdlineparams.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_stdimages.pas' --descr=xml/corelib/fpg_stdimages.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_stringutils.pas' --descr=xml/corelib/fpg_stringutils.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_popupwindow.pas' --descr=xml/corelib/fpg_popupwindow.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_wuline.pas' --descr=xml/corelib/fpg_wuline.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_imagelist.pas' --descr=xml/corelib/fpg_imagelist.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_constants.pas' --descr=xml/corelib/fpg_constants.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_pofiles.pas' --descr=xml/corelib/fpg_pofiles.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_translations.pas' --descr=xml/corelib/fpg_translations.xml \ + --input='-Fi../src/corelib ../src/corelib/fpg_stringhashlist.pas' --descr=xml/corelib/fpg_stringhashlist.xml \ + --input='-Fi../src/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_.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/class_inheritance.txt b/docs/class_inheritance.txt index 38968f41..56f64b64 100644 --- a/docs/class_inheritance.txt +++ b/docs/class_inheritance.txt @@ -1,78 +1,84 @@ + fpGUI Toolkit + CLASS INHERITANCE LAYOUT + + The derivation and inheritance of classes are different than one -might be used to. It will be explained by the following -example. +might be used to. It will be explained by the following example. Due to the graphics painting library being different on certain platforms we had to do some trickery to the inheritance so the same classname could be used in descendant classes for widgets -etc in fpGUI. - -Here is the inheritance for the X11 backend for TFCanvas: +in fpGUI. We also did not want to introduce IFDEF's in our code, +if we did not absolutely needed too. - TObject - | - TFCustomCanvas - | - TDefCanvas ---> TX11Canvas - | - TFCanvas +Here is the inheritance for the X11 backend for TfpgCanvas: + TObject + | + TfpgCanvasBase + | + TfpgCanvasImpl ---> TfpgX11Canvas + | + TfpgCanvas -Here is the inheritance for the GDI backend for TFCanvas: +Here is the inheritance for the GDI backend for TfpgCanvas: - TObject - | - TFCustomCanvas - | - TDefCanvas ---> TGDICanvas - | - TFCanvas + TObject + | + TfpgCanvasBase + | + TfpgCanvasImpl ---> TfpgGDICanvas + | + TfpgCanvas -TDefCanvas acts like a alias for the actual backend used. Every -painting library has a gfxinterface.pas unit that defines this +TfpgCanvasImpl acts like an alias for the actual backend used. Every +painting library has a fpg_interface.pas unit that defines this alias. - X11: gfx/x11/gfxinterface.pas - GDI: gfx/gdi/gfxinterface.pas + X11: corelib/x11/fpg_interface.pas + GDI: corelib/gdi/fpg_interface.pas -TFCanvas is common to all painting backends. +TfpgCanvas is common to all painting backends. - TFCanvas: gfx/fpgfx.pas + TfpgCanvas: corelib/fpg_main.pas -TFCustomCanvas is also common to all painting backends and acts +TfpgCanvasBase is also common to all painting backends and acts like a abstract class defining the class interface that needs to be implemented. - TFCustomCanvas: gfx/gfxbase.pas + TfpgCanvasBase: corelib/fpg_base.pas Each backend needs to implement the class interface defined by -TFCustomCanvas. Obviously they are specific to each backend -so lives in that backends directory. +TfpgCanvasBase. Obviously they are specific to each backend +so the unit implementing that interface, lives in that backend +specific directory. - TX11Canvas: gfx/x11/gfx_x11.pas - TGDICanvas: gfx/gdi/gfx_gdi.pas + TfpgX11Canvas: corelib/x11/fpg_x11.pas + TfpgGDICanvas: corelib/gdi/fpg_gdi.pas -Each backend has it's own fpgfxpackage.lpk Lazarus Package. Due -to the fpgfxpackage including the common units and the backend -specific units, it completes the class hierachy and ties -all the units together. +Each backend has its own fpgui_toolkit.lpk Lazarus Package. Due +to the fpgui_toolkit including the common units and the backend +specific units, it completes the class hierachy and ties all the +units together into one framework. Other classes that follow this same process (inheritance) are -listed below. Their actual definitions are in the -gfxinterface.pas unit in each backend directory. - - TDefFont - TDefScreen - TDefApplication - TDefWindow - TDefBitmap +listed below. Their actual definitions are in the fpg_interface.pas +unit inside each backend directory. + + TfpgFontResourceImpl + TfpgImageImpl + TfpgCanvasImpl + TfpgWindowImpl + TfpgApplicationImpl + TfpgClipboardImpl + TfpgFileListImpl ---------------oO0Oo----------------- diff --git a/docs/fpGUI_tech_ref.tex b/docs/fpGUI_tech_ref.tex index a57a1006..b62c959b 100644 --- a/docs/fpGUI_tech_ref.tex +++ b/docs/fpGUI_tech_ref.tex @@ -1,5 +1,14 @@ \documentclass[a4paper,11pt]{report} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Edited: 2010-02-23 +% NOTE: +% THIS DOCUMENT IS OUTDATED. IT WAS BASED ON THE fpGUI v0.4 DESIGN. +% +% This file remains in the repository for historic purposes only. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Define the title \author{Graeme Geldenhuys} \title{fpGUI - A technical reference} diff --git a/docs/html/_tipue_results.html b/docs/html/_tipue_results.html deleted file mode 100644 index 0584f1dc..00000000 --- a/docs/html/_tipue_results.html +++ /dev/null @@ -1,53 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> - -<html> -<head> -<title>Search Results</title> - -<link rel="StyleSheet" type="text/css" href="fpdoc.css"> - -<!-- The following lines are required and must be in the <head> section of your HTML document --> - -<script language="JavaScript1.3" type="text/javascript" src="tip_data.js"></script> -<script language="JavaScript1.3" type="text/javascript" src="tip_search.js"></script> - -<!-- End of required <head> section --> - -<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> - - -</head> -<body> - -<div> - -<!-- The following JavaScript uses the tip_Num variable to return the number of matches found --> - -<script language="JavaScript1.3" type="text/javascript"> -if (tip_Num == 0) { - document.write('No matches found'); -} -if (tip_Num == 1) { - document.write('1 match found'); -} -if (tip_Num > 1) { - document.write(tip_Num, ' matches found'); -} -</script> - -<hr> - -<!-- The following line returns the results --> - -<script language="JavaScript1.3" type="text/javascript">tip_out()</script> - -<hr> - -<p> -Return to <a href="index.html">main index page.</a> -<p> -<a href="http://www.tipue.com" target="_parent"><img src="tipue_b1.png" title="Tipue" alt="Tipue" border=0 width=138 height=32></a> -</div> - -</body> -</html> diff --git a/docs/html/corelib.cnt b/docs/html/corelib.cnt deleted file mode 100644 index 3cecf74b..00000000 --- a/docs/html/corelib.cnt +++ /dev/null @@ -1,2592 +0,0 @@ -# FPDoc Content File -:link tree -#CoreLib index.html - fpg_base fpg_base/index.html - MOUSE_LEFT fpg_base/mouse_left.html - MOUSE_RIGHT fpg_base/mouse_right.html - MOUSE_MIDDLE fpg_base/mouse_middle.html - FPGM_PAINT fpg_base/fpgm_paint.html - FPGM_ACTIVATE fpg_base/fpgm_activate.html - FPGM_DEACTIVATE fpg_base/fpgm_deactivate.html - FPGM_KEYPRESS fpg_base/fpgm_keypress.html - FPGM_KEYRELEASE fpg_base/fpgm_keyrelease.html - FPGM_KEYCHAR fpg_base/fpgm_keychar.html - FPGM_MOUSEDOWN fpg_base/fpgm_mousedown.html - FPGM_MOUSEUP fpg_base/fpgm_mouseup.html - FPGM_MOUSEMOVE fpg_base/fpgm_mousemove.html - FPGM_DOUBLECLICK fpg_base/fpgm_doubleclick.html - FPGM_MOUSEENTER fpg_base/fpgm_mouseenter.html - FPGM_MOUSEEXIT fpg_base/fpgm_mouseexit.html - FPGM_CLOSE fpg_base/fpgm_close.html - FPGM_SCROLL fpg_base/fpgm_scroll.html - FPGM_RESIZE fpg_base/fpgm_resize.html - FPGM_MOVE fpg_base/fpgm_move.html - FPGM_POPUPCLOSE fpg_base/fpgm_popupclose.html - FPGM_HINTTIMER fpg_base/fpgm_hinttimer.html - FPGM_USER fpg_base/fpgm_user.html - FPGM_KILLME fpg_base/fpgm_killme.html - keyNul fpg_base/keynul.html - keyBackSpace fpg_base/keybackspace.html - keyTab fpg_base/keytab.html - keyLinefeed fpg_base/keylinefeed.html - keyReturn fpg_base/keyreturn.html - keyEnter fpg_base/keyenter.html - keyEscape fpg_base/keyescape.html - keyDelete fpg_base/keydelete.html - keySpace fpg_base/keyspace.html - keyVoid fpg_base/keyvoid.html - keyBreak fpg_base/keybreak.html - keyScrollForw fpg_base/keyscrollforw.html - keyScrollBack fpg_base/keyscrollback.html - keyBoot fpg_base/keyboot.html - keyCompose fpg_base/keycompose.html - keySAK fpg_base/keysak.html - keyUndo fpg_base/keyundo.html - keyRedo fpg_base/keyredo.html - keyMenu fpg_base/keymenu.html - keyCancel fpg_base/keycancel.html - keyPrintScreen fpg_base/keyprintscreen.html - keyExecute fpg_base/keyexecute.html - keyFind fpg_base/keyfind.html - keyBegin fpg_base/keybegin.html - keyClear fpg_base/keyclear.html - keyInsert fpg_base/keyinsert.html - keySelect fpg_base/keyselect.html - keyMacro fpg_base/keymacro.html - keyHelp fpg_base/keyhelp.html - keyDo fpg_base/keydo.html - keyPause fpg_base/keypause.html - keyStop fpg_base/keystop.html - keySysRq fpg_base/keysysrq.html - keyModeSwitch fpg_base/keymodeswitch.html - keyUp fpg_base/keyup.html - keyDown fpg_base/keydown.html - keyLeft fpg_base/keyleft.html - keyRight fpg_base/keyright.html - keyPrior fpg_base/keyprior.html - keyPageUp fpg_base/keypageup.html - keyNext fpg_base/keynext.html - keyPageDown fpg_base/keypagedown.html - keyHome fpg_base/keyhome.html - keyEnd fpg_base/keyend.html - keyF0 fpg_base/keyf0.html - keyF1 fpg_base/keyf1.html - keyF2 fpg_base/keyf2.html - keyF3 fpg_base/keyf3.html - keyF4 fpg_base/keyf4.html - keyF5 fpg_base/keyf5.html - keyF6 fpg_base/keyf6.html - keyF7 fpg_base/keyf7.html - keyF8 fpg_base/keyf8.html - keyF9 fpg_base/keyf9.html - keyF10 fpg_base/keyf10.html - keyF11 fpg_base/keyf11.html - keyF12 fpg_base/keyf12.html - keyF13 fpg_base/keyf13.html - keyF14 fpg_base/keyf14.html - keyF15 fpg_base/keyf15.html - keyF16 fpg_base/keyf16.html - keyF17 fpg_base/keyf17.html - keyF18 fpg_base/keyf18.html - keyF19 fpg_base/keyf19.html - keyF20 fpg_base/keyf20.html - keyF21 fpg_base/keyf21.html - keyF22 fpg_base/keyf22.html - keyF23 fpg_base/keyf23.html - keyF24 fpg_base/keyf24.html - keyF25 fpg_base/keyf25.html - keyF26 fpg_base/keyf26.html - keyF27 fpg_base/keyf27.html - keyF28 fpg_base/keyf28.html - keyF29 fpg_base/keyf29.html - keyF30 fpg_base/keyf30.html - keyF31 fpg_base/keyf31.html - keyF32 fpg_base/keyf32.html - keyF33 fpg_base/keyf33.html - keyF34 fpg_base/keyf34.html - keyF35 fpg_base/keyf35.html - keyF36 fpg_base/keyf36.html - keyF37 fpg_base/keyf37.html - keyF38 fpg_base/keyf38.html - keyF39 fpg_base/keyf39.html - keyF40 fpg_base/keyf40.html - keyF41 fpg_base/keyf41.html - keyF42 fpg_base/keyf42.html - keyF43 fpg_base/keyf43.html - keyF44 fpg_base/keyf44.html - keyF45 fpg_base/keyf45.html - keyF46 fpg_base/keyf46.html - keyF47 fpg_base/keyf47.html - keyF48 fpg_base/keyf48.html - keyF49 fpg_base/keyf49.html - keyF50 fpg_base/keyf50.html - keyF51 fpg_base/keyf51.html - keyF52 fpg_base/keyf52.html - keyF53 fpg_base/keyf53.html - keyF54 fpg_base/keyf54.html - keyF55 fpg_base/keyf55.html - keyF56 fpg_base/keyf56.html - keyF57 fpg_base/keyf57.html - keyF58 fpg_base/keyf58.html - keyF59 fpg_base/keyf59.html - keyF60 fpg_base/keyf60.html - keyF61 fpg_base/keyf61.html - keyF62 fpg_base/keyf62.html - keyF63 fpg_base/keyf63.html - keyF64 fpg_base/keyf64.html - keyP0 fpg_base/keyp0.html - keyP1 fpg_base/keyp1.html - keyP2 fpg_base/keyp2.html - keyP3 fpg_base/keyp3.html - keyP4 fpg_base/keyp4.html - keyP5 fpg_base/keyp5.html - keyP6 fpg_base/keyp6.html - keyP7 fpg_base/keyp7.html - keyP8 fpg_base/keyp8.html - keyP9 fpg_base/keyp9.html - keyPA fpg_base/keypa.html - keyPB fpg_base/keypb.html - keyPC fpg_base/keypc.html - keyPD fpg_base/keypd.html - keyPE fpg_base/keype.html - keyPF fpg_base/keypf.html - keyPPlus fpg_base/keypplus.html - keyPMinus fpg_base/keypminus.html - keyPSlash fpg_base/keypslash.html - keyPAsterisk fpg_base/keypasterisk.html - keyPStar fpg_base/keypstar.html - keyPEqual fpg_base/keypequal.html - keyPSeparator fpg_base/keypseparator.html - keyPDecimal fpg_base/keypdecimal.html - keyPParenLeft fpg_base/keypparenleft.html - keyPParenRight fpg_base/keypparenright.html - keyPSpace fpg_base/keypspace.html - keyPEnter fpg_base/keypenter.html - keyPTab fpg_base/keyptab.html - keyPPlusMinus fpg_base/keypplusminus.html - keyPBegin fpg_base/keypbegin.html - keyPF1 fpg_base/keypf1.html - keyPF2 fpg_base/keypf2.html - keyPF3 fpg_base/keypf3.html - keyPF4 fpg_base/keypf4.html - keyPF5 fpg_base/keypf5.html - keyPF6 fpg_base/keypf6.html - keyPF7 fpg_base/keypf7.html - keyPF8 fpg_base/keypf8.html - keyPF9 fpg_base/keypf9.html - keyShift fpg_base/keyshift.html - keyCtrl fpg_base/keyctrl.html - keyAlt fpg_base/keyalt.html - keyMeta fpg_base/keymeta.html - keySuper fpg_base/keysuper.html - keyHyper fpg_base/keyhyper.html - keyAltGr fpg_base/keyaltgr.html - keyCaps fpg_base/keycaps.html - keyNum fpg_base/keynum.html - keyScroll fpg_base/keyscroll.html - keyShiftL fpg_base/keyshiftl.html - keyShiftR fpg_base/keyshiftr.html - keyCtrlL fpg_base/keyctrll.html - keyCtrlR fpg_base/keyctrlr.html - keyAltL fpg_base/keyaltl.html - keyAltR fpg_base/keyaltr.html - keyMetaL fpg_base/keymetal.html - keyMetaR fpg_base/keymetar.html - keySuperL fpg_base/keysuperl.html - keySuperR fpg_base/keysuperr.html - keyHyperL fpg_base/keyhyperl.html - keyHyperR fpg_base/keyhyperr.html - keyShiftLock fpg_base/keyshiftlock.html - keyCtrlLock fpg_base/keyctrllock.html - keyAltLock fpg_base/keyaltlock.html - keyMetaLock fpg_base/keymetalock.html - keySuperLock fpg_base/keysuperlock.html - keyHyperLock fpg_base/keyhyperlock.html - keyAltGrLock fpg_base/keyaltgrlock.html - keyCapsLock fpg_base/keycapslock.html - keyNumLock fpg_base/keynumlock.html - keyScrollLock fpg_base/keyscrolllock.html - keyDeadRing fpg_base/keydeadring.html - keyDeadCaron fpg_base/keydeadcaron.html - keyDeadOgonek fpg_base/keydeadogonek.html - keyDeadIota fpg_base/keydeadiota.html - keyDeadDoubleAcute fpg_base/keydeaddoubleacute.html - keyDeadBreve fpg_base/keydeadbreve.html - keyDeadAboveDot fpg_base/keydeadabovedot.html - keyDeadBelowDot fpg_base/keydeadbelowdot.html - keyDeadVoicedSound fpg_base/keydeadvoicedsound.html - keyDeadSemiVoicedSound fpg_base/keydeadsemivoicedsound.html - keyDeadAcute fpg_base/keydeadacute.html - keyDeadCedilla fpg_base/keydeadcedilla.html - keyDeadCircumflex fpg_base/keydeadcircumflex.html - keyDeadDiaeresis fpg_base/keydeaddiaeresis.html - keyDeadGrave fpg_base/keydeadgrave.html - keyDeadTilde fpg_base/keydeadtilde.html - keyDeadMacron fpg_base/keydeadmacron.html - keyNIL fpg_base/keynil.html - keyEcuSign fpg_base/keyecusign.html - keyColonSign fpg_base/keycolonsign.html - keyCruzeiroSign fpg_base/keycruzeirosign.html - keyFFrancSign fpg_base/keyffrancsign.html - keyLiraSign fpg_base/keylirasign.html - keyMillSign fpg_base/keymillsign.html - keyNairaSign fpg_base/keynairasign.html - keyPesetaSign fpg_base/keypesetasign.html - keyRupeeSign fpg_base/keyrupeesign.html - keyWonSign fpg_base/keywonsign.html - keyNewSheqelSign fpg_base/keynewsheqelsign.html - keyDongSign fpg_base/keydongsign.html - keyEuroSign fpg_base/keyeurosign.html - mrNone fpg_base/mrnone.html - mrOk fpg_base/mrok.html - mrCancel fpg_base/mrcancel.html - mrYes fpg_base/mryes.html - mrNo fpg_base/mrno.html - mrAbort fpg_base/mrabort.html - mrRetry fpg_base/mrretry.html - mrIgnore fpg_base/mrignore.html - mrAll fpg_base/mrall.html - mrNoToAll fpg_base/mrnotoall.html - mrYesToAll fpg_base/mryestoall.html - UserNamedColorStart fpg_base/usernamedcolorstart.html - clAqua fpg_base/claqua.html - clBlack fpg_base/clblack.html - clBlue fpg_base/clblue.html - clCream fpg_base/clcream.html - clDkGray fpg_base/cldkgray.html - clFuchsia fpg_base/clfuchsia.html - clGray fpg_base/clgray.html - clGreen fpg_base/clgreen.html - clLime fpg_base/cllime.html - clLtGray fpg_base/clltgray.html - clMaroon fpg_base/clmaroon.html - clNavy fpg_base/clnavy.html - clOlive fpg_base/clolive.html - clPurple fpg_base/clpurple.html - clRed fpg_base/clred.html - clSilver fpg_base/clsilver.html - clTeal fpg_base/clteal.html - clWhite fpg_base/clwhite.html - clYellow fpg_base/clyellow.html - clNone fpg_base/clnone.html - clDefault fpg_base/cldefault.html - clMoneyGreen fpg_base/clmoneygreen.html - clSkyBlue fpg_base/clskyblue.html - clMedGray fpg_base/clmedgray.html - cl_BaseNamedColor fpg_base/cl_basenamedcolor.html - clWindowBackground fpg_base/clwindowbackground.html - clBoxColor fpg_base/clboxcolor.html - clButtonFace fpg_base/clbuttonface.html - clShadow1 fpg_base/clshadow1.html - clShadow2 fpg_base/clshadow2.html - clHilite1 fpg_base/clhilite1.html - clHilite2 fpg_base/clhilite2.html - clText1 fpg_base/cltext1.html - clText2 fpg_base/cltext2.html - clText3 fpg_base/cltext3.html - clText4 fpg_base/cltext4.html - clSelection fpg_base/clselection.html - clSelectionText fpg_base/clselectiontext.html - clInactiveSel fpg_base/clinactivesel.html - clInactiveSelText fpg_base/clinactiveseltext.html - clScrollBar fpg_base/clscrollbar.html - clListBox fpg_base/cllistbox.html - clGridLines fpg_base/clgridlines.html - clGridHeader fpg_base/clgridheader.html - clWidgetFrame fpg_base/clwidgetframe.html - clInactiveWgFrame fpg_base/clinactivewgframe.html - clTextCursor fpg_base/cltextcursor.html - clChoiceListBox fpg_base/clchoicelistbox.html - clUnset fpg_base/clunset.html - clMenuText fpg_base/clmenutext.html - clMenuDisabled fpg_base/clmenudisabled.html - clHintWindow fpg_base/clhintwindow.html - clAliceBlue fpg_base/claliceblue.html - clAntiqueWhite fpg_base/clantiquewhite.html - clAquamarine fpg_base/claquamarine.html - clAzure fpg_base/clazure.html - clBeige fpg_base/clbeige.html - clBisque fpg_base/clbisque.html - clBlanchedAlmond fpg_base/clblanchedalmond.html - clBlueViolet fpg_base/clblueviolet.html - clBrown fpg_base/clbrown.html - clBurlyWood fpg_base/clburlywood.html - clCadetBlue fpg_base/clcadetblue.html - clChartreuse fpg_base/clchartreuse.html - clChocolate fpg_base/clchocolate.html - clCoral fpg_base/clcoral.html - clCornflowerBlue fpg_base/clcornflowerblue.html - clCornsilk fpg_base/clcornsilk.html - clCrimson fpg_base/clcrimson.html - clCyan fpg_base/clcyan.html - clDarkBlue fpg_base/cldarkblue.html - clDarkCyan fpg_base/cldarkcyan.html - clDarkGoldenrod fpg_base/cldarkgoldenrod.html - clDarkGray fpg_base/cldarkgray.html - clDarkGreen fpg_base/cldarkgreen.html - clDarkKhaki fpg_base/cldarkkhaki.html - clDarkMagenta fpg_base/cldarkmagenta.html - clDarkOliveGreen fpg_base/cldarkolivegreen.html - clDarkOrange fpg_base/cldarkorange.html - clDarkOrchid fpg_base/cldarkorchid.html - clDarkRed fpg_base/cldarkred.html - clDarkSalmon fpg_base/cldarksalmon.html - clDarkSeaGreen fpg_base/cldarkseagreen.html - clDarkSlateBlue fpg_base/cldarkslateblue.html - clDarkSlateGray fpg_base/cldarkslategray.html - clDarkTurquoise fpg_base/cldarkturquoise.html - clDarkViolet fpg_base/cldarkviolet.html - clDeepPink fpg_base/cldeeppink.html - clDeepSkyBlue fpg_base/cldeepskyblue.html - clDimGray fpg_base/cldimgray.html - clDodgerBlue fpg_base/cldodgerblue.html - clFireBrick fpg_base/clfirebrick.html - clFloralWhite fpg_base/clfloralwhite.html - clForestGreen fpg_base/clforestgreen.html - clGainsboro fpg_base/clgainsboro.html - clGhostWhite fpg_base/clghostwhite.html - clGold fpg_base/clgold.html - clGoldenrod fpg_base/clgoldenrod.html - clGreenYellow fpg_base/clgreenyellow.html - clHoneydew fpg_base/clhoneydew.html - clHotPink fpg_base/clhotpink.html - clIndianRed fpg_base/clindianred.html - clIndigo fpg_base/clindigo.html - clIvory fpg_base/clivory.html - clKhaki fpg_base/clkhaki.html - clLavender fpg_base/cllavender.html - clLavenderBlush fpg_base/cllavenderblush.html - clLawnGreen fpg_base/cllawngreen.html - clLemonChiffon fpg_base/cllemonchiffon.html - clLightBlue fpg_base/cllightblue.html - clLightCoral fpg_base/cllightcoral.html - clLightCyan fpg_base/cllightcyan.html - clLightGoldenrodYellow fpg_base/cllightgoldenrodyellow.html - clLightGreen fpg_base/cllightgreen.html - clLightGray fpg_base/cllightgray.html - clLightPink fpg_base/cllightpink.html - clLightSalmon fpg_base/cllightsalmon.html - clLightSeaGreen fpg_base/cllightseagreen.html - clLightSkyBlue fpg_base/cllightskyblue.html - clLightSlateGray fpg_base/cllightslategray.html - clLightSteelBlue fpg_base/cllightsteelblue.html - clLightYellow fpg_base/cllightyellow.html - clLimeGreen fpg_base/cllimegreen.html - clLinen fpg_base/cllinen.html - clMagenta fpg_base/clmagenta.html - clMediumAquamarine fpg_base/clmediumaquamarine.html - clMediumBlue fpg_base/clmediumblue.html - clMediumOrchid fpg_base/clmediumorchid.html - clMediumPurple fpg_base/clmediumpurple.html - clMediumSeaGreen fpg_base/clmediumseagreen.html - clMediumSlateBlue fpg_base/clmediumslateblue.html - clMediumSpringGreen fpg_base/clmediumspringgreen.html - clMediumTurquoise fpg_base/clmediumturquoise.html - clMediumVioletRed fpg_base/clmediumvioletred.html - clMidnightBlue fpg_base/clmidnightblue.html - clMintCream fpg_base/clmintcream.html - clMistyRose fpg_base/clmistyrose.html - clMoccasin fpg_base/clmoccasin.html - clNavajoWhite fpg_base/clnavajowhite.html - clOldLace fpg_base/cloldlace.html - clOliveDrab fpg_base/clolivedrab.html - clOrange fpg_base/clorange.html - clOrangeRed fpg_base/clorangered.html - clOrchid fpg_base/clorchid.html - clPaleGoldenrod fpg_base/clpalegoldenrod.html - clPaleGreen fpg_base/clpalegreen.html - clPaleTurquoise fpg_base/clpaleturquoise.html - clPaleVioletRed fpg_base/clpalevioletred.html - clPaleBlue fpg_base/clpaleblue.html - clPapayaWhip fpg_base/clpapayawhip.html - clPeachPuff fpg_base/clpeachpuff.html - clPeru fpg_base/clperu.html - clPink fpg_base/clpink.html - clPlum fpg_base/clplum.html - clPowderBlue fpg_base/clpowderblue.html - clRosyBrown fpg_base/clrosybrown.html - clRoyalBlue fpg_base/clroyalblue.html - clSaddleBrown fpg_base/clsaddlebrown.html - clSalmon fpg_base/clsalmon.html - clSandyBrown fpg_base/clsandybrown.html - clSeaGreen fpg_base/clseagreen.html - clSeashell fpg_base/clseashell.html - clSienna fpg_base/clsienna.html - clSkyBlue2 fpg_base/clskyblue2.html - clSlateBlue fpg_base/clslateblue.html - clSlateGray fpg_base/clslategray.html - clSnow fpg_base/clsnow.html - clSpringGreen fpg_base/clspringgreen.html - clSteelBlue fpg_base/clsteelblue.html - clTan fpg_base/cltan.html - clThistle fpg_base/clthistle.html - clTomato fpg_base/cltomato.html - clTurquoise fpg_base/clturquoise.html - clViolet fpg_base/clviolet.html - clWheat fpg_base/clwheat.html - clWhiteSmoke fpg_base/clwhitesmoke.html - clYellowGreen fpg_base/clyellowgreen.html - TfpgCoord fpg_base/tfpgcoord.html - TfpgColor fpg_base/tfpgcolor.html - TfpgString fpg_base/tfpgstring.html - TfpgChar fpg_base/tfpgchar.html - TfpgModalResult fpg_base/tfpgmodalresult.html - PPoint fpg_base/ppoint.html - TRGBTriple fpg_base/trgbtriple.html - TWindowType fpg_base/twindowtype.html - TWindowAttribute fpg_base/twindowattribute.html - TWindowAttributes fpg_base/twindowattributes.html - TMouseCursor fpg_base/tmousecursor.html - TGradientDirection fpg_base/tgradientdirection.html - TClipboardKeyType fpg_base/tclipboardkeytype.html - TfpgMsgParmMouse fpg_base/tfpgmsgparmmouse.html - TfpgMsgParmKeyboard fpg_base/tfpgmsgparmkeyboard.html - TfpgMsgParmUser fpg_base/tfpgmsgparmuser.html - TfpgMessageParams fpg_base/tfpgmessageparams.html - TfpgMessageRec fpg_base/tfpgmessagerec.html - PfpgMessageRec fpg_base/pfpgmessagerec.html - TfpgLineStyle fpg_base/tfpglinestyle.html - TFileEntryType fpg_base/tfileentrytype.html - TFileListSortOrder fpg_base/tfilelistsortorder.html - TFileModeString fpg_base/tfilemodestring.html - TfpgRect fpg_base/tfpgrect.html - Top fpg_base/tfpgrect.top.html - Left fpg_base/tfpgrect.left.html - Width fpg_base/tfpgrect.width.html - Height fpg_base/tfpgrect.height.html - SetRect fpg_base/tfpgrect.setrect.html - Bottom fpg_base/tfpgrect.bottom.html - Right fpg_base/tfpgrect.right.html - SetBottom fpg_base/tfpgrect.setbottom.html - SetRight fpg_base/tfpgrect.setright.html - TfpgImageBase fpg_base/tfpgimagebase.html - FWidth fpg_base/tfpgimagebase.fwidth.html - FHeight fpg_base/tfpgimagebase.fheight.html - FColorDepth fpg_base/tfpgimagebase.fcolordepth.html - FMasked fpg_base/tfpgimagebase.fmasked.html - FImageData fpg_base/tfpgimagebase.fimagedata.html - FImageDataSize fpg_base/tfpgimagebase.fimagedatasize.html - FMaskData fpg_base/tfpgimagebase.fmaskdata.html - FMaskDataSize fpg_base/tfpgimagebase.fmaskdatasize.html - DoFreeImage fpg_base/tfpgimagebase.dofreeimage.html - DoInitImage fpg_base/tfpgimagebase.doinitimage.html - DoInitImageMask fpg_base/tfpgimagebase.doinitimagemask.html - Create fpg_base/tfpgimagebase.create.html - Destroy fpg_base/tfpgimagebase.destroy.html - Invert fpg_base/tfpgimagebase.invert.html - FreeImage fpg_base/tfpgimagebase.freeimage.html - AllocateImage fpg_base/tfpgimagebase.allocateimage.html - AllocateMask fpg_base/tfpgimagebase.allocatemask.html - CreateMaskFromSample fpg_base/tfpgimagebase.createmaskfromsample.html - UpdateImage fpg_base/tfpgimagebase.updateimage.html - ImageData fpg_base/tfpgimagebase.imagedata.html - ImageDataSize fpg_base/tfpgimagebase.imagedatasize.html - MaskData fpg_base/tfpgimagebase.maskdata.html - MaskDataSize fpg_base/tfpgimagebase.maskdatasize.html - Width fpg_base/tfpgimagebase.width.html - Height fpg_base/tfpgimagebase.height.html - ColorDepth fpg_base/tfpgimagebase.colordepth.html - Masked fpg_base/tfpgimagebase.masked.html - Colors fpg_base/tfpgimagebase.colors.html - TfpgFontResourceBase fpg_base/tfpgfontresourcebase.html - GetAscent fpg_base/tfpgfontresourcebase.getascent.html - GetDescent fpg_base/tfpgfontresourcebase.getdescent.html - GetHeight fpg_base/tfpgfontresourcebase.getheight.html - GetTextWidth fpg_base/tfpgfontresourcebase.gettextwidth.html - TfpgFontBase fpg_base/tfpgfontbase.html - FFontDesc fpg_base/tfpgfontbase.ffontdesc.html - FFontRes fpg_base/tfpgfontbase.ffontres.html - TextWidth fpg_base/tfpgfontbase.textwidth.html - Ascent fpg_base/tfpgfontbase.ascent.html - Descent fpg_base/tfpgfontbase.descent.html - Height fpg_base/tfpgfontbase.height.html - FontDesc fpg_base/tfpgfontbase.fontdesc.html - FontRes fpg_base/tfpgfontbase.fontres.html - Handle fpg_base/tfpgfontbase.handle.html - TfpgCustomInterpolation fpg_base/tfpgcustominterpolation.html - Initialize fpg_base/tfpgcustominterpolation.initialize.html - Execute fpg_base/tfpgcustominterpolation.execute.html - Canvas fpg_base/tfpgcustominterpolation.canvas.html - Image fpg_base/tfpgcustominterpolation.image.html - TfpgBaseInterpolation fpg_base/tfpgbaseinterpolation.html - Execute fpg_base/tfpgbaseinterpolation.execute.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - Destroy fpg_base/tfpgbaseinterpolation.destroy.html - TfpgMitchelInterpolation fpg_base/tfpgmitchelinterpolation.html - Filter fpg_base/tfpgmitchelinterpolation.filter.html - MaxSupport fpg_base/tfpgmitchelinterpolation.maxsupport.html - TfpgCanvasBase fpg_base/tfpgcanvasbase.html - FBufferedDraw fpg_base/tfpgcanvasbase.fbuffereddraw.html - FBeginDrawCount fpg_base/tfpgcanvasbase.fbegindrawcount.html - FWindow fpg_base/tfpgcanvasbase.fwindow.html - FColor fpg_base/tfpgcanvasbase.fcolor.html - FTextColor fpg_base/tfpgcanvasbase.ftextcolor.html - FLineWidth fpg_base/tfpgcanvasbase.flinewidth.html - FLineStyle fpg_base/tfpgcanvasbase.flinestyle.html - FFont fpg_base/tfpgcanvasbase.ffont.html - FPersistentResources fpg_base/tfpgcanvasbase.fpersistentresources.html - DoSetFontRes fpg_base/tfpgcanvasbase.dosetfontres.html - DoSetTextColor fpg_base/tfpgcanvasbase.dosettextcolor.html - DoSetColor fpg_base/tfpgcanvasbase.dosetcolor.html - DoSetLineStyle fpg_base/tfpgcanvasbase.dosetlinestyle.html - DoGetWinRect fpg_base/tfpgcanvasbase.dogetwinrect.html - DoFillRectangle fpg_base/tfpgcanvasbase.dofillrectangle.html - DoXORFillRectangle fpg_base/tfpgcanvasbase.doxorfillrectangle.html - DoFillTriangle fpg_base/tfpgcanvasbase.dofilltriangle.html - DoDrawRectangle fpg_base/tfpgcanvasbase.dodrawrectangle.html - DoDrawLine fpg_base/tfpgcanvasbase.dodrawline.html - DoDrawImagePart fpg_base/tfpgcanvasbase.dodrawimagepart.html - DoDrawString fpg_base/tfpgcanvasbase.dodrawstring.html - DoSetClipRect fpg_base/tfpgcanvasbase.dosetcliprect.html - DoGetClipRect fpg_base/tfpgcanvasbase.dogetcliprect.html - DoAddClipRect fpg_base/tfpgcanvasbase.doaddcliprect.html - DoClearClipRect fpg_base/tfpgcanvasbase.doclearcliprect.html - DoBeginDraw fpg_base/tfpgcanvasbase.dobegindraw.html - DoPutBufferToScreen fpg_base/tfpgcanvasbase.doputbuffertoscreen.html - DoEndDraw fpg_base/tfpgcanvasbase.doenddraw.html - GetPixel fpg_base/tfpgcanvasbase.getpixel.html - SetPixel fpg_base/tfpgcanvasbase.setpixel.html - DoDrawArc fpg_base/tfpgcanvasbase.dodrawarc.html - DoFillArc fpg_base/tfpgcanvasbase.dofillarc.html - DoDrawPolygon fpg_base/tfpgcanvasbase.dodrawpolygon.html - Create fpg_base/tfpgcanvasbase.create.html - Destroy fpg_base/tfpgcanvasbase.destroy.html - DrawRectangle fpg_base/tfpgcanvasbase.drawrectangle.html - DrawLine fpg_base/tfpgcanvasbase.drawline.html - DrawLineClipped fpg_base/tfpgcanvasbase.drawlineclipped.html - ClipLine fpg_base/tfpgcanvasbase.clipline.html - DrawImage fpg_base/tfpgcanvasbase.drawimage.html - DrawImagePart fpg_base/tfpgcanvasbase.drawimagepart.html - DrawArc fpg_base/tfpgcanvasbase.drawarc.html - DrawPolygon fpg_base/tfpgcanvasbase.drawpolygon.html - StretchDraw fpg_base/tfpgcanvasbase.stretchdraw.html - CopyRect fpg_base/tfpgcanvasbase.copyrect.html - DrawString fpg_base/tfpgcanvasbase.drawstring.html - FillRectangle fpg_base/tfpgcanvasbase.fillrectangle.html - FillTriangle fpg_base/tfpgcanvasbase.filltriangle.html - FillArc fpg_base/tfpgcanvasbase.fillarc.html - GradientFill fpg_base/tfpgcanvasbase.gradientfill.html - XORFillRectangle fpg_base/tfpgcanvasbase.xorfillrectangle.html - SetClipRect fpg_base/tfpgcanvasbase.setcliprect.html - GetClipRect fpg_base/tfpgcanvasbase.getcliprect.html - AddClipRect fpg_base/tfpgcanvasbase.addcliprect.html - ClearClipRect fpg_base/tfpgcanvasbase.clearcliprect.html - Clear fpg_base/tfpgcanvasbase.clear.html - GetWinRect fpg_base/tfpgcanvasbase.getwinrect.html - SetColor fpg_base/tfpgcanvasbase.setcolor.html - SetTextColor fpg_base/tfpgcanvasbase.settextcolor.html - SetLineStyle fpg_base/tfpgcanvasbase.setlinestyle.html - SetFont fpg_base/tfpgcanvasbase.setfont.html - BeginDraw fpg_base/tfpgcanvasbase.begindraw.html - EndDraw fpg_base/tfpgcanvasbase.enddraw.html - FreeResources fpg_base/tfpgcanvasbase.freeresources.html - Color fpg_base/tfpgcanvasbase.color.html - TextColor fpg_base/tfpgcanvasbase.textcolor.html - Font fpg_base/tfpgcanvasbase.font.html - Pixels fpg_base/tfpgcanvasbase.pixels.html - InterpolationFilter fpg_base/tfpgcanvasbase.interpolationfilter.html - FastDoubleBuffer fpg_base/tfpgcanvasbase.fastdoublebuffer.html - LineStyle fpg_base/tfpgcanvasbase.linestyle.html - LineWidth fpg_base/tfpgcanvasbase.linewidth.html - TfpgComponent fpg_base/tfpgcomponent.html - TagPointer fpg_base/tfpgcomponent.tagpointer.html - TfpgWindowBase fpg_base/tfpgwindowbase.html - FMouseCursor fpg_base/tfpgwindowbase.fmousecursor.html - FWindowType fpg_base/tfpgwindowbase.fwindowtype.html - FWindowAttributes fpg_base/tfpgwindowbase.fwindowattributes.html - FTop fpg_base/tfpgwindowbase.ftop.html - FLeft fpg_base/tfpgwindowbase.fleft.html - FWidth fpg_base/tfpgwindowbase.fwidth.html - FHeight fpg_base/tfpgwindowbase.fheight.html - FPrevTop fpg_base/tfpgwindowbase.fprevtop.html - FPrevLeft fpg_base/tfpgwindowbase.fprevleft.html - FPrevWidth fpg_base/tfpgwindowbase.fprevwidth.html - FPrevHeight fpg_base/tfpgwindowbase.fprevheight.html - FMinWidth fpg_base/tfpgwindowbase.fminwidth.html - FMinHeight fpg_base/tfpgwindowbase.fminheight.html - FMaxHeight fpg_base/tfpgwindowbase.fmaxheight.html - FMaxWidth fpg_base/tfpgwindowbase.fmaxwidth.html - FCanvas fpg_base/tfpgwindowbase.fcanvas.html - FSizeIsDirty fpg_base/tfpgwindowbase.fsizeisdirty.html - FPosIsDirty fpg_base/tfpgwindowbase.fposisdirty.html - HandleIsValid fpg_base/tfpgwindowbase.handleisvalid.html - DoUpdateWindowPosition fpg_base/tfpgwindowbase.doupdatewindowposition.html - DoAllocateWindowHandle fpg_base/tfpgwindowbase.doallocatewindowhandle.html - DoReleaseWindowHandle fpg_base/tfpgwindowbase.doreleasewindowhandle.html - DoRemoveWindowLookup fpg_base/tfpgwindowbase.doremovewindowlookup.html - DoSetWindowVisible fpg_base/tfpgwindowbase.dosetwindowvisible.html - DoMoveWindow fpg_base/tfpgwindowbase.domovewindow.html - DoWindowToScreen fpg_base/tfpgwindowbase.dowindowtoscreen.html - DoSetWindowTitle fpg_base/tfpgwindowbase.dosetwindowtitle.html - DoSetMouseCursor fpg_base/tfpgwindowbase.dosetmousecursor.html - SetParent fpg_base/tfpgwindowbase.setparent.html - GetParent fpg_base/tfpgwindowbase.getparent.html - GetCanvas fpg_base/tfpgwindowbase.getcanvas.html - AllocateWindowHandle fpg_base/tfpgwindowbase.allocatewindowhandle.html - ReleaseWindowHandle fpg_base/tfpgwindowbase.releasewindowhandle.html - SetWindowTitle fpg_base/tfpgwindowbase.setwindowtitle.html - SetTop fpg_base/tfpgwindowbase.settop.html - SetLeft fpg_base/tfpgwindowbase.setleft.html - SetHeight fpg_base/tfpgwindowbase.setheight.html - SetWidth fpg_base/tfpgwindowbase.setwidth.html - HandleMove fpg_base/tfpgwindowbase.handlemove.html - HandleResize fpg_base/tfpgwindowbase.handleresize.html - Create fpg_base/tfpgwindowbase.create.html - AfterConstruction fpg_base/tfpgwindowbase.afterconstruction.html - AdjustWindowStyle fpg_base/tfpgwindowbase.adjustwindowstyle.html - SetWindowParameters fpg_base/tfpgwindowbase.setwindowparameters.html - Right fpg_base/tfpgwindowbase.right.html - Bottom fpg_base/tfpgwindowbase.bottom.html - UpdateWindowPosition fpg_base/tfpgwindowbase.updatewindowposition.html - MoveWindow fpg_base/tfpgwindowbase.movewindow.html - WindowToScreen fpg_base/tfpgwindowbase.windowtoscreen.html - HasParent fpg_base/tfpgwindowbase.hasparent.html - ActivateWindow fpg_base/tfpgwindowbase.activatewindow.html - CaptureMouse fpg_base/tfpgwindowbase.capturemouse.html - ReleaseMouse fpg_base/tfpgwindowbase.releasemouse.html - SetFullscreen fpg_base/tfpgwindowbase.setfullscreen.html - HasHandle fpg_base/tfpgwindowbase.hashandle.html - WindowType fpg_base/tfpgwindowbase.windowtype.html - WindowAttributes fpg_base/tfpgwindowbase.windowattributes.html - Left fpg_base/tfpgwindowbase.left.html - Top fpg_base/tfpgwindowbase.top.html - Width fpg_base/tfpgwindowbase.width.html - Height fpg_base/tfpgwindowbase.height.html - MinWidth fpg_base/tfpgwindowbase.minwidth.html - MinHeight fpg_base/tfpgwindowbase.minheight.html - MaxWidth fpg_base/tfpgwindowbase.maxwidth.html - MaxHeight fpg_base/tfpgwindowbase.maxheight.html - Canvas fpg_base/tfpgwindowbase.canvas.html - Parent fpg_base/tfpgwindowbase.parent.html - MouseCursor fpg_base/tfpgwindowbase.mousecursor.html - TfpgApplicationBase fpg_base/tfpgapplicationbase.html - FOnIdle fpg_base/tfpgapplicationbase.fonidle.html - FIsInitialized fpg_base/tfpgapplicationbase.fisinitialized.html - FModalFormStack fpg_base/tfpgapplicationbase.fmodalformstack.html - DoGetFontFaceList fpg_base/tfpgapplicationbase.dogetfontfacelist.html - Create fpg_base/tfpgapplicationbase.create.html - Destroy fpg_base/tfpgapplicationbase.destroy.html - GetFontFaceList fpg_base/tfpgapplicationbase.getfontfacelist.html - PushModalForm fpg_base/tfpgapplicationbase.pushmodalform.html - PopModalForm fpg_base/tfpgapplicationbase.popmodalform.html - PrevModalForm fpg_base/tfpgapplicationbase.prevmodalform.html - RemoveWindowFromModalStack fpg_base/tfpgapplicationbase.removewindowfrommodalstack.html - CreateForm fpg_base/tfpgapplicationbase.createform.html - GetScreenWidth fpg_base/tfpgapplicationbase.getscreenwidth.html - GetScreenHeight fpg_base/tfpgapplicationbase.getscreenheight.html - Screen_dpi_x fpg_base/tfpgapplicationbase.screen_dpi_x.html - Screen_dpi_y fpg_base/tfpgapplicationbase.screen_dpi_y.html - Screen_dpi fpg_base/tfpgapplicationbase.screen_dpi.html - Terminate fpg_base/tfpgapplicationbase.terminate.html - Lock fpg_base/tfpgapplicationbase.lock.html - Unlock fpg_base/tfpgapplicationbase.unlock.html - FormCount fpg_base/tfpgapplicationbase.formcount.html - Forms fpg_base/tfpgapplicationbase.forms.html - IsInitialized fpg_base/tfpgapplicationbase.isinitialized.html - TopModalForm fpg_base/tfpgapplicationbase.topmodalform.html - MainForm fpg_base/tfpgapplicationbase.mainform.html - Terminated fpg_base/tfpgapplicationbase.terminated.html - OnIdle fpg_base/tfpgapplicationbase.onidle.html - TfpgClipboardBase fpg_base/tfpgclipboardbase.html - FClipboardWndHandle fpg_base/tfpgclipboardbase.fclipboardwndhandle.html - DoGetText fpg_base/tfpgclipboardbase.dogettext.html - DoSetText fpg_base/tfpgclipboardbase.dosettext.html - InitClipboard fpg_base/tfpgclipboardbase.initclipboard.html - Create fpg_base/tfpgclipboardbase.create.html - Text fpg_base/tfpgclipboardbase.text.html - TFileEntry fpg_base/tfileentry.html - Create fpg_base/tfileentry.create.html - Name fpg_base/tfileentry.name.html - Extension fpg_base/tfileentry.extension.html - Size fpg_base/tfileentry.size.html - EntryType fpg_base/tfileentry.entrytype.html - IsLink fpg_base/tfileentry.islink.html - LinkTarget fpg_base/tfileentry.linktarget.html - IsExecutable fpg_base/tfileentry.isexecutable.html - ModTime fpg_base/tfileentry.modtime.html - Mode fpg_base/tfileentry.mode.html - Owner fpg_base/tfileentry.owner.html - Group fpg_base/tfileentry.group.html - Attributes fpg_base/tfileentry.attributes.html - TfpgFileListBase fpg_base/tfpgfilelistbase.html - FSpecialDirs fpg_base/tfpgfilelistbase.fspecialdirs.html - FHasFileMode fpg_base/tfpgfilelistbase.fhasfilemode.html - InitializeEntry fpg_base/tfpgfilelistbase.initializeentry.html - PopulateSpecialDirs fpg_base/tfpgfilelistbase.populatespecialdirs.html - Create fpg_base/tfpgfilelistbase.create.html - Destroy fpg_base/tfpgfilelistbase.destroy.html - Count fpg_base/tfpgfilelistbase.count.html - CurrentSpecialDir fpg_base/tfpgfilelistbase.currentspecialdir.html - ReadDirectory fpg_base/tfpgfilelistbase.readdirectory.html - Clear fpg_base/tfpgfilelistbase.clear.html - Sort fpg_base/tfpgfilelistbase.sort.html - DirectoryName fpg_base/tfpgfilelistbase.directoryname.html - Entry fpg_base/tfpgfilelistbase.entry.html - FileMask fpg_base/tfpgfilelistbase.filemask.html - HasFileMode fpg_base/tfpgfilelistbase.hasfilemode.html - ShowHidden fpg_base/tfpgfilelistbase.showhidden.html - SpecialDirs fpg_base/tfpgfilelistbase.specialdirs.html - KeycodeToText fpg_base/keycodetotext.html - CheckClipboardKey fpg_base/checkclipboardkey.html - fpgColorToRGBTriple fpg_base/fpgcolortorgbtriple.html - RGBTripleTofpgColor fpg_base/rgbtripletofpgcolor.html - fpgGetRed fpg_base/fpggetred.html - fpgGetGreen fpg_base/fpggetgreen.html - fpgGetBlue fpg_base/fpggetblue.html - fpgGetAlpha fpg_base/fpggetalpha.html - fpgGetAvgColor fpg_base/fpggetavgcolor.html - PtInRect fpg_base/ptinrect.html - SortRect fpg_base/sortrect.html - FPG_DEFAULT_FONT_DESC fpg_base/fpg_default_font_desc.html - fpg_x11 fpg_x11/index.html - IconBitmapWidth fpg_x11/iconbitmapwidth.html - IconBitmapHeight fpg_x11/iconbitmapheight.html - IconBitmapBits fpg_x11/iconbitmapbits.html - MWM_HINTS_FUNCTIONS fpg_x11/mwm_hints_functions.html - MWM_HINTS_DECORATIONS fpg_x11/mwm_hints_decorations.html - MWM_HINTS_INPUT_MODE fpg_x11/mwm_hints_input_mode.html - MWM_HINTS_STATUS fpg_x11/mwm_hints_status.html - MWM_FUNC_ALL fpg_x11/mwm_func_all.html - MWM_FUNC_RESIZE fpg_x11/mwm_func_resize.html - MWM_FUNC_MOVE fpg_x11/mwm_func_move.html - MWM_FUNC_MINIMIZE fpg_x11/mwm_func_minimize.html - MWM_FUNC_MAXIMIZE fpg_x11/mwm_func_maximize.html - MWM_FUNC_CLOSE fpg_x11/mwm_func_close.html - MWM_DECOR_ALL fpg_x11/mwm_decor_all.html - MWM_DECOR_BORDER fpg_x11/mwm_decor_border.html - MWM_DECOR_RESIZEH fpg_x11/mwm_decor_resizeh.html - MWM_DECOR_TITLE fpg_x11/mwm_decor_title.html - MWM_DECOR_MENU fpg_x11/mwm_decor_menu.html - MWM_DECOR_MINIMIZE fpg_x11/mwm_decor_minimize.html - MWM_DECOR_MAXIMIZE fpg_x11/mwm_decor_maximize.html - MWM_INPUT_MODELESS fpg_x11/mwm_input_modeless.html - MWM_INPUT_PRIMARY_APPLICATION_MODAL fpg_x11/mwm_input_primary_application_modal.html - MWM_INPUT_SYSTEM_MODAL fpg_x11/mwm_input_system_modal.html - MWM_INPUT_FULL_APPLICATION_MODAL fpg_x11/mwm_input_full_application_modal.html - PROP_MWM_HINTS_ELEMENTS fpg_x11/prop_mwm_hints_elements.html - TfpgGContext fpg_x11/tfpggcontext.html - PInt fpg_x11/pint.html - TXIC fpg_x11/txic.html - PXIC fpg_x11/pxic.html - TXIM fpg_x11/txim.html - PXIM fpg_x11/pxim.html - TXdbeSwapInfo fpg_x11/txdbeswapinfo.html - PXdbeSwapInfo fpg_x11/pxdbeswapinfo.html - TMWMHints fpg_x11/tmwmhints.html - TXWindowStateFlag fpg_x11/txwindowstateflag.html - TXWindowStateFlags fpg_x11/txwindowstateflags.html - TX11EventFilter fpg_x11/tx11eventfilter.html - TfpgFontResourceImpl fpg_x11/tfpgfontresourceimpl.html - Handle fpg_x11/tfpgfontresourceimpl.handle.html - Create fpg_x11/tfpgfontresourceimpl.create.html - Destroy fpg_x11/tfpgfontresourceimpl.destroy.html - HandleIsValid fpg_x11/tfpgfontresourceimpl.handleisvalid.html - GetAscent fpg_base/tfpgfontresourcebase.getascent.html - GetDescent fpg_base/tfpgfontresourcebase.getdescent.html - GetHeight fpg_base/tfpgfontresourcebase.getheight.html - GetTextWidth fpg_base/tfpgfontresourcebase.gettextwidth.html - TfpgImageImpl fpg_x11/tfpgimageimpl.html - DoFreeImage fpg_base/tfpgimagebase.dofreeimage.html - DoInitImage fpg_base/tfpgimagebase.doinitimage.html - DoInitImageMask fpg_base/tfpgimagebase.doinitimagemask.html - Create fpg_base/tfpgimagebase.create.html - TfpgCanvasImpl fpg_x11/tfpgcanvasimpl.html - DoSetFontRes fpg_base/tfpgcanvasbase.dosetfontres.html - DoSetTextColor fpg_base/tfpgcanvasbase.dosettextcolor.html - DoSetColor fpg_base/tfpgcanvasbase.dosetcolor.html - DoSetLineStyle fpg_base/tfpgcanvasbase.dosetlinestyle.html - DoGetWinRect fpg_base/tfpgcanvasbase.dogetwinrect.html - DoFillRectangle fpg_base/tfpgcanvasbase.dofillrectangle.html - DoXORFillRectangle fpg_base/tfpgcanvasbase.doxorfillrectangle.html - DoFillTriangle fpg_base/tfpgcanvasbase.dofilltriangle.html - DoDrawRectangle fpg_base/tfpgcanvasbase.dodrawrectangle.html - DoDrawLine fpg_base/tfpgcanvasbase.dodrawline.html - DoDrawImagePart fpg_base/tfpgcanvasbase.dodrawimagepart.html - DoDrawString fpg_base/tfpgcanvasbase.dodrawstring.html - DoSetClipRect fpg_base/tfpgcanvasbase.dosetcliprect.html - DoGetClipRect fpg_base/tfpgcanvasbase.dogetcliprect.html - DoAddClipRect fpg_base/tfpgcanvasbase.doaddcliprect.html - DoClearClipRect fpg_base/tfpgcanvasbase.doclearcliprect.html - DoBeginDraw fpg_base/tfpgcanvasbase.dobegindraw.html - DoPutBufferToScreen fpg_base/tfpgcanvasbase.doputbuffertoscreen.html - DoEndDraw fpg_base/tfpgcanvasbase.doenddraw.html - GetPixel fpg_base/tfpgcanvasbase.getpixel.html - SetPixel fpg_base/tfpgcanvasbase.setpixel.html - DoDrawArc fpg_base/tfpgcanvasbase.dodrawarc.html - DoFillArc fpg_base/tfpgcanvasbase.dofillarc.html - DoDrawPolygon fpg_x11/tfpgcanvasimpl.dodrawpolygon.html - DCHandle fpg_x11/tfpgcanvasimpl.dchandle.html - Create fpg_base/tfpgcanvasbase.create.html - Destroy fpg_base/tfpgcanvasbase.destroy.html - TfpgWindowImpl fpg_x11/tfpgwindowimpl.html - FWinFlags fpg_x11/tfpgwindowimpl.fwinflags.html - FWinHandle fpg_x11/tfpgwindowimpl.fwinhandle.html - FBackupWinHandle fpg_x11/tfpgwindowimpl.fbackupwinhandle.html - FModalForWin fpg_x11/tfpgwindowimpl.fmodalforwin.html - DoAllocateWindowHandle fpg_base/tfpgwindowbase.doallocatewindowhandle.html - DoReleaseWindowHandle fpg_base/tfpgwindowbase.doreleasewindowhandle.html - DoRemoveWindowLookup fpg_x11/tfpgwindowimpl.doremovewindowlookup.html - DoSetWindowVisible fpg_base/tfpgwindowbase.dosetwindowvisible.html - HandleIsValid fpg_base/tfpgwindowbase.handleisvalid.html - DoSetWindowTitle fpg_base/tfpgwindowbase.dosetwindowtitle.html - DoMoveWindow fpg_base/tfpgwindowbase.domovewindow.html - DoWindowToScreen fpg_base/tfpgwindowbase.dowindowtoscreen.html - DoUpdateWindowPosition fpg_base/tfpgwindowbase.doupdatewindowposition.html - DoSetMouseCursor fpg_base/tfpgwindowbase.dosetmousecursor.html - WinHandle fpg_x11/tfpgwindowimpl.winhandle.html - Create fpg_base/tfpgwindowbase.create.html - ActivateWindow fpg_x11/tfpgwindowimpl.activatewindow.html - CaptureMouse fpg_base/tfpgwindowbase.capturemouse.html - ReleaseMouse fpg_base/tfpgwindowbase.releasemouse.html - SetFullscreen fpg_x11/tfpgwindowimpl.setfullscreen.html - TfpgApplicationImpl fpg_x11/tfpgapplicationimpl.html - FDisplay fpg_x11/tfpgapplicationimpl.fdisplay.html - DisplayDepth fpg_x11/tfpgapplicationimpl.displaydepth.html - DefaultBackground fpg_x11/tfpgapplicationimpl.defaultbackground.html - DefaultForeground fpg_x11/tfpgapplicationimpl.defaultforeground.html - DefaultScreen fpg_x11/tfpgapplicationimpl.defaultscreen.html - DefaultVisual fpg_x11/tfpgapplicationimpl.defaultvisual.html - DefaultColorMap fpg_x11/tfpgapplicationimpl.defaultcolormap.html - FRootWindow fpg_x11/tfpgapplicationimpl.frootwindow.html - xia_clipboard fpg_x11/tfpgapplicationimpl.xia_clipboard.html - xia_motif_wm_hints fpg_x11/tfpgapplicationimpl.xia_motif_wm_hints.html - xia_wm_protocols fpg_x11/tfpgapplicationimpl.xia_wm_protocols.html - xia_wm_delete_window fpg_x11/tfpgapplicationimpl.xia_wm_delete_window.html - netlayer fpg_x11/tfpgapplicationimpl.netlayer.html - xia_targets fpg_x11/tfpgapplicationimpl.xia_targets.html - InputMethod fpg_x11/tfpgapplicationimpl.inputmethod.html - InputContext fpg_x11/tfpgapplicationimpl.inputcontext.html - FLastKeySym fpg_x11/tfpgapplicationimpl.flastkeysym.html - DoGetFontFaceList fpg_base/tfpgapplicationbase.dogetfontfacelist.html - Create fpg_base/tfpgapplicationbase.create.html - Destroy fpg_x11/tfpgapplicationimpl.destroy.html - DoMessagesPending fpg_x11/tfpgapplicationimpl.domessagespending.html - DoWaitWindowMessage fpg_x11/tfpgapplicationimpl.dowaitwindowmessage.html - DoFlush fpg_x11/tfpgapplicationimpl.doflush.html - GetScreenWidth fpg_x11/tfpgapplicationimpl.getscreenwidth.html - GetScreenHeight fpg_x11/tfpgapplicationimpl.getscreenheight.html - Screen_dpi_x fpg_x11/tfpgapplicationimpl.screen_dpi_x.html - Screen_dpi_y fpg_x11/tfpgapplicationimpl.screen_dpi_y.html - Screen_dpi fpg_x11/tfpgapplicationimpl.screen_dpi.html - Display fpg_x11/tfpgapplicationimpl.display.html - RootWindow fpg_x11/tfpgapplicationimpl.rootwindow.html - EventFilter fpg_x11/tfpgapplicationimpl.eventfilter.html - TfpgClipboardImpl fpg_x11/tfpgclipboardimpl.html - FClipboardText fpg_x11/tfpgclipboardimpl.fclipboardtext.html - DoGetText fpg_x11/tfpgclipboardimpl.dogettext.html - DoSetText fpg_x11/tfpgclipboardimpl.dosettext.html - InitClipboard fpg_x11/tfpgclipboardimpl.initclipboard.html - TfpgFileListImpl fpg_x11/tfpgfilelistimpl.html - EncodeModeString fpg_x11/tfpgfilelistimpl.encodemodestring.html - Create fpg_x11/tfpgfilelistimpl.create.html - InitializeEntry fpg_x11/tfpgfilelistimpl.initializeentry.html - PopulateSpecialDirs fpg_x11/tfpgfilelistimpl.populatespecialdirs.html - fpgColorToX fpg_x11/fpgcolortox.html - fpg_gdi fpg_gdi/index.html - WM_MOUSEWHEEL fpg_gdi/wm_mousewheel.html - VER_PLATFORM_WIN32_CE fpg_gdi/ver_platform_win32_ce.html - CLEARTYPE_QUALITY fpg_gdi/cleartype_quality.html - TfpgFontResourceImpl fpg_gdi/tfpgfontresourceimpl.html - OpenFontByDesc fpg_gdi/tfpgfontresourceimpl.openfontbydesc.html - Handle fpg_gdi/tfpgfontresourceimpl.handle.html - Create fpg_gdi/tfpgfontresourceimpl.create.html - Destroy fpg_gdi/tfpgfontresourceimpl.destroy.html - HandleIsValid fpg_gdi/tfpgfontresourceimpl.handleisvalid.html - GetAscent fpg_base/tfpgfontresourcebase.getascent.html - GetDescent fpg_base/tfpgfontresourcebase.getdescent.html - GetHeight fpg_base/tfpgfontresourcebase.getheight.html - GetTextWidth fpg_base/tfpgfontresourcebase.gettextwidth.html - TfpgFontImpl fpg_gdi/tfpgfontimpl.html - TfpgImageImpl fpg_gdi/tfpgimageimpl.html - DoFreeImage fpg_base/tfpgimagebase.dofreeimage.html - DoInitImage fpg_base/tfpgimagebase.doinitimage.html - DoInitImageMask fpg_base/tfpgimagebase.doinitimagemask.html - Create fpg_base/tfpgimagebase.create.html - TfpgCanvasImpl fpg_gdi/tfpgcanvasimpl.html - DoSetFontRes fpg_base/tfpgcanvasbase.dosetfontres.html - DoSetTextColor fpg_base/tfpgcanvasbase.dosettextcolor.html - DoSetColor fpg_base/tfpgcanvasbase.dosetcolor.html - DoSetLineStyle fpg_base/tfpgcanvasbase.dosetlinestyle.html - DoGetWinRect fpg_base/tfpgcanvasbase.dogetwinrect.html - DoFillRectangle fpg_base/tfpgcanvasbase.dofillrectangle.html - DoXORFillRectangle fpg_base/tfpgcanvasbase.doxorfillrectangle.html - DoFillTriangle fpg_base/tfpgcanvasbase.dofilltriangle.html - DoDrawRectangle fpg_base/tfpgcanvasbase.dodrawrectangle.html - DoDrawLine fpg_base/tfpgcanvasbase.dodrawline.html - DoDrawImagePart fpg_base/tfpgcanvasbase.dodrawimagepart.html - DoDrawString fpg_base/tfpgcanvasbase.dodrawstring.html - DoSetClipRect fpg_base/tfpgcanvasbase.dosetcliprect.html - DoGetClipRect fpg_base/tfpgcanvasbase.dogetcliprect.html - DoAddClipRect fpg_base/tfpgcanvasbase.doaddcliprect.html - DoClearClipRect fpg_base/tfpgcanvasbase.doclearcliprect.html - DoBeginDraw fpg_base/tfpgcanvasbase.dobegindraw.html - DoPutBufferToScreen fpg_base/tfpgcanvasbase.doputbuffertoscreen.html - DoEndDraw fpg_base/tfpgcanvasbase.doenddraw.html - GetPixel fpg_base/tfpgcanvasbase.getpixel.html - SetPixel fpg_base/tfpgcanvasbase.setpixel.html - DoDrawArc fpg_base/tfpgcanvasbase.dodrawarc.html - DoFillArc fpg_base/tfpgcanvasbase.dofillarc.html - DoDrawPolygon fpg_gdi/tfpgcanvasimpl.dodrawpolygon.html - DCHandle fpg_gdi/tfpgcanvasimpl.dchandle.html - Create fpg_base/tfpgcanvasbase.create.html - Destroy fpg_base/tfpgcanvasbase.destroy.html - TfpgWindowImpl fpg_gdi/tfpgwindowimpl.html - FWinHandle fpg_gdi/tfpgwindowimpl.fwinhandle.html - FModalForWin fpg_gdi/tfpgwindowimpl.fmodalforwin.html - FWinStyle fpg_gdi/tfpgwindowimpl.fwinstyle.html - FWinStyleEx fpg_gdi/tfpgwindowimpl.fwinstyleex.html - FParentWinHandle fpg_gdi/tfpgwindowimpl.fparentwinhandle.html - DoAllocateWindowHandle fpg_base/tfpgwindowbase.doallocatewindowhandle.html - DoReleaseWindowHandle fpg_base/tfpgwindowbase.doreleasewindowhandle.html - DoRemoveWindowLookup fpg_gdi/tfpgwindowimpl.doremovewindowlookup.html - DoSetWindowVisible fpg_base/tfpgwindowbase.dosetwindowvisible.html - HandleIsValid fpg_base/tfpgwindowbase.handleisvalid.html - DoUpdateWindowPosition fpg_base/tfpgwindowbase.doupdatewindowposition.html - DoMoveWindow fpg_base/tfpgwindowbase.domovewindow.html - DoWindowToScreen fpg_base/tfpgwindowbase.dowindowtoscreen.html - DoSetWindowTitle fpg_base/tfpgwindowbase.dosetwindowtitle.html - DoSetMouseCursor fpg_base/tfpgwindowbase.dosetmousecursor.html - WinHandle fpg_gdi/tfpgwindowimpl.winhandle.html - Create fpg_base/tfpgwindowbase.create.html - ActivateWindow fpg_gdi/tfpgwindowimpl.activatewindow.html - CaptureMouse fpg_base/tfpgwindowbase.capturemouse.html - ReleaseMouse fpg_base/tfpgwindowbase.releasemouse.html - SetFullscreen fpg_gdi/tfpgwindowimpl.setfullscreen.html - TfpgApplicationImpl fpg_gdi/tfpgapplicationimpl.html - FDisplay fpg_gdi/tfpgapplicationimpl.fdisplay.html - WindowClass fpg_gdi/tfpgapplicationimpl.windowclass.html - WidgetClass fpg_gdi/tfpgapplicationimpl.widgetclass.html - hcr_default fpg_gdi/tfpgapplicationimpl.hcr_default.html - hcr_dir_ew fpg_gdi/tfpgapplicationimpl.hcr_dir_ew.html - hcr_dir_ns fpg_gdi/tfpgapplicationimpl.hcr_dir_ns.html - hcr_edit fpg_gdi/tfpgapplicationimpl.hcr_edit.html - hcr_dir_nwse fpg_gdi/tfpgapplicationimpl.hcr_dir_nwse.html - hcr_dir_nesw fpg_gdi/tfpgapplicationimpl.hcr_dir_nesw.html - hcr_move fpg_gdi/tfpgapplicationimpl.hcr_move.html - hcr_crosshair fpg_gdi/tfpgapplicationimpl.hcr_crosshair.html - hcr_wait fpg_gdi/tfpgapplicationimpl.hcr_wait.html - hcr_hand fpg_gdi/tfpgapplicationimpl.hcr_hand.html - FFocusedWindow fpg_gdi/tfpgapplicationimpl.ffocusedwindow.html - FHiddenWindow fpg_gdi/tfpgapplicationimpl.fhiddenwindow.html - HiddenWndClass fpg_gdi/tfpgapplicationimpl.hiddenwndclass.html - ActivationHook fpg_gdi/tfpgapplicationimpl.activationhook.html - GetHiddenWindow fpg_gdi/tfpgapplicationimpl.gethiddenwindow.html - DoGetFontFaceList fpg_base/tfpgapplicationbase.dogetfontfacelist.html - Create fpg_base/tfpgapplicationbase.create.html - Destroy fpg_gdi/tfpgapplicationimpl.destroy.html - DoMessagesPending fpg_gdi/tfpgapplicationimpl.domessagespending.html - DoWaitWindowMessage fpg_gdi/tfpgapplicationimpl.dowaitwindowmessage.html - DoFlush fpg_gdi/tfpgapplicationimpl.doflush.html - GetScreenWidth fpg_gdi/tfpgapplicationimpl.getscreenwidth.html - GetScreenHeight fpg_gdi/tfpgapplicationimpl.getscreenheight.html - Screen_dpi_x fpg_gdi/tfpgapplicationimpl.screen_dpi_x.html - Screen_dpi_y fpg_gdi/tfpgapplicationimpl.screen_dpi_y.html - Screen_dpi fpg_gdi/tfpgapplicationimpl.screen_dpi.html - Display fpg_gdi/tfpgapplicationimpl.display.html - TfpgClipboardImpl fpg_gdi/tfpgclipboardimpl.html - FClipboardText fpg_gdi/tfpgclipboardimpl.fclipboardtext.html - DoGetText fpg_gdi/tfpgclipboardimpl.dogettext.html - DoSetText fpg_gdi/tfpgclipboardimpl.dosettext.html - InitClipboard fpg_gdi/tfpgclipboardimpl.initclipboard.html - TfpgFileListImpl fpg_gdi/tfpgfilelistimpl.html - EncodeAttributesString fpg_gdi/tfpgfilelistimpl.encodeattributesstring.html - Create fpg_gdi/tfpgfilelistimpl.create.html - InitializeEntry fpg_gdi/tfpgfilelistimpl.initializeentry.html - PopulateSpecialDirs fpg_gdi/tfpgfilelistimpl.populatespecialdirs.html - UnicodeEnabledOS fpg_gdi/unicodeenabledos.html - WinVersion fpg_gdi/winversion.html - FontSmoothingType fpg_gdi/fontsmoothingtype.html - fpg_main fpg_main/index.html - AllAnchors fpg_main/allanchors.html - TextFlagsDflt fpg_main/textflagsdflt.html - cMessageQueueSize fpg_main/cmessagequeuesize.html - fpGUIVersion fpg_main/fpguiversion.html - fpGUIName fpg_main/fpguiname.html - txtWordDelims fpg_main/txtworddelims.html - TOrientation fpg_main/torientation.html - TAlign fpg_main/talign.html - TLayout fpg_main/tlayout.html - TBoxLayout fpg_main/tboxlayout.html - TAnchor fpg_main/tanchor.html - TAnchors fpg_main/tanchors.html - TFButtonFlags fpg_main/tfbuttonflags.html - TFTextFlags fpg_main/tftextflags.html - TMouseButton fpg_main/tmousebutton.html - TArrowDirection fpg_main/tarrowdirection.html - TIntKeyPressEvent fpg_main/tintkeypressevent.html - TIntMouseEvent fpg_main/tintmouseevent.html - TKeyEvent fpg_main/tkeyevent.html - TKeyCharEvent fpg_main/tkeycharevent.html - TKeyPressEvent fpg_main/tkeypressevent.html - TMouseButtonEvent fpg_main/tmousebuttonevent.html - TMouseMoveEvent fpg_main/tmousemoveevent.html - TMouseWheelEvent fpg_main/tmousewheelevent.html - TPaintEvent fpg_main/tpaintevent.html - TExceptionEvent fpg_main/texceptionevent.html - TSizeParams fpg_main/tsizeparams.html - TfpgFontResource fpg_main/tfpgfontresource.html - FFontDesc fpg_main/tfpgfontresource.ffontdesc.html - FRefCount fpg_main/tfpgfontresource.frefcount.html - Create fpg_main/tfpgfontresource.create.html - IncRefCount fpg_main/tfpgfontresource.increfcount.html - DecRefCount fpg_main/tfpgfontresource.decrefcount.html - FontDesc fpg_main/tfpgfontresource.fontdesc.html - TfpgFont fpg_main/tfpgfont.html - Create fpg_main/tfpgfont.create.html - Destroy fpg_main/tfpgfont.destroy.html - TfpgWindow fpg_main/tfpgwindow.html - SetParent fpg_main/tfpgwindow.setparent.html - GetParent fpg_main/tfpgwindow.getparent.html - GetCanvas fpg_main/tfpgwindow.getcanvas.html - Create fpg_main/tfpgwindow.create.html - Destroy fpg_main/tfpgwindow.destroy.html - Parent fpg_main/tfpgwindow.parent.html - Canvas fpg_main/tfpgwindow.canvas.html - WinHandle fpg_main/tfpgwindow.winhandle.html - TfpgImage fpg_main/tfpgimage.html - ImageFromRect fpg_main/tfpgimage.imagefromrect.html - TfpgImages fpg_main/tfpgimages.html - Create fpg_main/tfpgimages.create.html - Destroy fpg_main/tfpgimages.destroy.html - AddImage fpg_main/tfpgimages.addimage.html - DeleteImage fpg_main/tfpgimages.deleteimage.html - GetImage fpg_main/tfpgimages.getimage.html - AddBMP fpg_main/tfpgimages.addbmp.html - AddMaskedBMP fpg_main/tfpgimages.addmaskedbmp.html - ListImages fpg_main/tfpgimages.listimages.html - TfpgCanvas fpg_main/tfpgcanvas.html - Create fpg_main/tfpgcanvas.create.html - Destroy fpg_main/tfpgcanvas.destroy.html - DrawButtonFace fpg_main/tfpgcanvas.drawbuttonface.html - DrawControlFrame fpg_main/tfpgcanvas.drawcontrolframe.html - DrawDirectionArrow fpg_main/tfpgcanvas.drawdirectionarrow.html - DrawFocusRect fpg_main/tfpgcanvas.drawfocusrect.html - DrawText fpg_main/tfpgcanvas.drawtext.html - TfpgStyle fpg_main/tfpgstyle.html - DefaultFont fpg_main/tfpgstyle.defaultfont.html - MenuFont fpg_main/tfpgstyle.menufont.html - MenuAccelFont fpg_main/tfpgstyle.menuaccelfont.html - MenuDisabledFont fpg_main/tfpgstyle.menudisabledfont.html - Create fpg_main/tfpgstyle.create.html - Destroy fpg_main/tfpgstyle.destroy.html - DrawButtonFace fpg_main/tfpgstyle.drawbuttonface.html - DrawControlFrame fpg_main/tfpgstyle.drawcontrolframe.html - DrawDirectionArrow fpg_main/tfpgstyle.drawdirectionarrow.html - DrawString fpg_main/tfpgstyle.drawstring.html - DrawFocusRect fpg_main/tfpgstyle.drawfocusrect.html - TMsgHookItem fpg_main/tmsghookitem.html - Dest fpg_main/tmsghookitem.dest.html - Listener fpg_main/tmsghookitem.listener.html - MsgCode fpg_main/tmsghookitem.msgcode.html - TfpgApplication fpg_main/tfpgapplication.html - FDisplayParams fpg_main/tfpgapplication.fdisplayparams.html - FScreenWidth fpg_main/tfpgapplication.fscreenwidth.html - FScreenHeight fpg_main/tfpgapplication.fscreenheight.html - FDefaultFont fpg_main/tfpgapplication.fdefaultfont.html - FFontResList fpg_main/tfpgapplication.ffontreslist.html - FMessageHookList fpg_main/tfpgapplication.fmessagehooklist.html - FreeFontRes fpg_main/tfpgapplication.freefontres.html - InternalInit fpg_main/tfpgapplication.internalinit.html - RunMessageLoop fpg_main/tfpgapplication.runmessageloop.html - WaitWindowMessage fpg_main/tfpgapplication.waitwindowmessage.html - Create fpg_main/tfpgapplication.create.html - Destroy fpg_main/tfpgapplication.destroy.html - GetFont fpg_main/tfpgapplication.getfont.html - ActivateHint fpg_main/tfpgapplication.activatehint.html - Flush fpg_main/tfpgapplication.flush.html - HandleException fpg_main/tfpgapplication.handleexception.html - HideHint fpg_main/tfpgapplication.hidehint.html - Initialize fpg_main/tfpgapplication.initialize.html - ProcessMessages fpg_main/tfpgapplication.processmessages.html - Run fpg_main/tfpgapplication.run.html - SetMessageHook fpg_main/tfpgapplication.setmessagehook.html - ShowException fpg_main/tfpgapplication.showexception.html - UnsetMessageHook fpg_main/tfpgapplication.unsetmessagehook.html - DefaultFont fpg_main/tfpgapplication.defaultfont.html - HintPause fpg_main/tfpgapplication.hintpause.html - HintWindow fpg_main/tfpgapplication.hintwindow.html - ScreenWidth fpg_main/tfpgapplication.screenwidth.html - ScreenHeight fpg_main/tfpgapplication.screenheight.html - ShowHint fpg_main/tfpgapplication.showhint.html - StopOnException fpg_main/tfpgapplication.stoponexception.html - OnException fpg_main/tfpgapplication.onexception.html - TfpgTimer fpg_main/tfpgtimer.html - Create fpg_main/tfpgtimer.create.html - Destroy fpg_main/tfpgtimer.destroy.html - CheckAlarm fpg_main/tfpgtimer.checkalarm.html - Reset fpg_main/tfpgtimer.reset.html - Enabled fpg_main/tfpgtimer.enabled.html - NextAlarm fpg_main/tfpgtimer.nextalarm.html - Interval fpg_main/tfpgtimer.interval.html - OnTimer fpg_main/tfpgtimer.ontimer.html - TfpgCaret fpg_main/tfpgcaret.html - Create fpg_main/tfpgcaret.create.html - Destroy fpg_main/tfpgcaret.destroy.html - SetCaret fpg_main/tfpgcaret.setcaret.html - UnSetCaret fpg_main/tfpgcaret.unsetcaret.html - InvertCaret fpg_main/tfpgcaret.invertcaret.html - Width fpg_main/tfpgcaret.width.html - Height fpg_main/tfpgcaret.height.html - TfpgClipboard fpg_main/tfpgclipboard.html - TfpgFileList fpg_main/tfpgfilelist.html - fpgApplication fpg_main/fpgapplication.html - fpgClipboard fpg_main/fpgclipboard.html - fpgGetFont fpg_main/fpggetfont.html - fpgWaitWindowMessage fpg_main/fpgwaitwindowmessage.html - fpgPostMessage fpg_main/fpgpostmessage.html - fpgSendMessage fpg_main/fpgsendmessage.html - fpgDeliverMessage fpg_main/fpgdelivermessage.html - fpgDeliverMessages fpg_main/fpgdelivermessages.html - fpgGetFirstMessage fpg_main/fpggetfirstmessage.html - fpgDeleteFirstMessage fpg_main/fpgdeletefirstmessage.html - fpgColorToRGB fpg_main/fpgcolortorgb.html - fpgGetNamedColor fpg_main/fpggetnamedcolor.html - fpgSetNamedColor fpg_main/fpgsetnamedcolor.html - fpgGetNamedFontDesc fpg_main/fpggetnamedfontdesc.html - fpgSetNamedFont fpg_main/fpgsetnamedfont.html - fpgGetNamedFontList fpg_main/fpggetnamedfontlist.html - fpgInitTimers fpg_main/fpginittimers.html - fpgCheckTimers fpg_main/fpgchecktimers.html - fpgClosestTimer fpg_main/fpgclosesttimer.html - fpgGetTickCount fpg_main/fpggettickcount.html - InflateRect fpg_main/inflaterect.html - OffsetRect fpg_main/offsetrect.html - CenterPoint fpg_main/centerpoint.html - fpgRect fpg_main/fpgrect.html - fpgRectToRect fpg_main/fpgrecttorect.html - PrintRect fpg_main/printrect.html - PrintCoord fpg_main/printcoord.html - PrintCallTrace fpg_main/printcalltrace.html - PrintCallTraceDbgLn fpg_main/printcalltracedbgln.html - DumpStack fpg_main/dumpstack.html - DebugLn fpg_main/debugln.html - fpgStyle fpg_main/fpgstyle.html - fpgCaret fpg_main/fpgcaret.html - fpgImages fpg_main/fpgimages.html - fpg_cmdlineparams fpg_cmdlineparams/index.html - ctiCommandLineParamPrefix fpg_cmdlineparams/cticommandlineparamprefix.html - TGfxCommandLineParams fpg_cmdlineparams/tgfxcommandlineparams.html - Create fpg_cmdlineparams/tgfxcommandlineparams.create.html - Destroy fpg_cmdlineparams/tgfxcommandlineparams.destroy.html - IsParam fpg_cmdlineparams/tgfxcommandlineparams.isparam.html - GetParam fpg_cmdlineparams/tgfxcommandlineparams.getparam.html - Params fpg_cmdlineparams/tgfxcommandlineparams.params.html - AsString fpg_cmdlineparams/tgfxcommandlineparams.asstring.html - gCommandLineParams fpg_cmdlineparams/gcommandlineparams.html - fpg_extinterpolation fpg_extinterpolation/index.html - TBlackmanInterpolation fpg_extinterpolation/tblackmaninterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBlackmanSincInterpolation fpg_extinterpolation/tblackmansincinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBlackmanBesselInterpolation fpg_extinterpolation/tblackmanbesselinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TGaussianInterpolation fpg_extinterpolation/tgaussianinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBoxInterpolation fpg_extinterpolation/tboxinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - THermiteInterpolation fpg_extinterpolation/thermiteinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TLanczosInterpolation fpg_extinterpolation/tlanczosinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TQuadraticInterpolation fpg_extinterpolation/tquadraticinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TCubicInterpolation fpg_extinterpolation/tcubicinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TCatromInterpolation fpg_extinterpolation/tcatrominterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBilinearInterpolation fpg_extinterpolation/tbilinearinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - THanningInterpolation fpg_extinterpolation/thanninginterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - THammingInterpolation fpg_extinterpolation/thamminginterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBSplineInterpolation fpg_extinterpolation/tbsplineinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - TBellInterpolation fpg_extinterpolation/tbellinterpolation.html - Filter fpg_base/tfpgbaseinterpolation.filter.html - MaxSupport fpg_base/tfpgbaseinterpolation.maxsupport.html - fpg_imgfmt_bmp fpg_imgfmt_bmp/index.html - ReadImage_BMP fpg_imgfmt_bmp/readimage_bmp.html - LoadImage_BMP fpg_imgfmt_bmp/loadimage_bmp.html - CreateImage_BMP fpg_imgfmt_bmp/createimage_bmp.html - fpg_stdimages fpg_stdimages/index.html - fpgCreateStandardImages fpg_stdimages/fpgcreatestandardimages.html - fpg_stringutils fpg_stringutils/index.html - UTF8CharacterLength fpg_stringutils/utf8characterlength.html - UTF8CharStart fpg_stringutils/utf8charstart.html - UTF8Copy fpg_stringutils/utf8copy.html - UTF8CStringToUTF8String fpg_stringutils/utf8cstringtoutf8string.html - UTF8Length fpg_stringutils/utf8length.html - UTF8Pos fpg_stringutils/utf8pos.html - UTF8Delete fpg_stringutils/utf8delete.html - UTF8Insert fpg_stringutils/utf8insert.html - UTF8CharAtByte fpg_stringutils/utf8charatbyte.html - Copy8 fpg_stringutils/copy8.html - Length8 fpg_stringutils/length8.html - Pos8 fpg_stringutils/pos8.html - Delete8 fpg_stringutils/delete8.html - Insert8 fpg_stringutils/insert8.html - fpgCharAt fpg_stringutils/fpgcharat.html - fpg_widget fpg_widget/index.html - TFocusSearchDirection fpg_widget/tfocussearchdirection.html - TfpgWidget fpg_widget/tfpgwidget.html - MsgPaint fpg_widget/tfpgwidget.msgpaint.html - MsgResize fpg_widget/tfpgwidget.msgresize.html - MsgMove fpg_widget/tfpgwidget.msgmove.html - MsgKeyChar fpg_widget/tfpgwidget.msgkeychar.html - MsgKeyPress fpg_widget/tfpgwidget.msgkeypress.html - MsgKeyRelease fpg_widget/tfpgwidget.msgkeyrelease.html - MsgMouseDown fpg_widget/tfpgwidget.msgmousedown.html - MsgMouseUp fpg_widget/tfpgwidget.msgmouseup.html - MsgMouseMove fpg_widget/tfpgwidget.msgmousemove.html - MsgDoubleClick fpg_widget/tfpgwidget.msgdoubleclick.html - MsgMouseEnter fpg_widget/tfpgwidget.msgmouseenter.html - MsgMouseExit fpg_widget/tfpgwidget.msgmouseexit.html - MsgMouseScroll fpg_widget/tfpgwidget.msgmousescroll.html - FFormDesigner fpg_widget/tfpgwidget.fformdesigner.html - FVisible fpg_widget/tfpgwidget.fvisible.html - FEnabled fpg_widget/tfpgwidget.fenabled.html - FFocusable fpg_widget/tfpgwidget.ffocusable.html - FFocused fpg_widget/tfpgwidget.ffocused.html - FTabOrder fpg_widget/tfpgwidget.ftaborder.html - FAnchors fpg_widget/tfpgwidget.fanchors.html - FActiveWidget fpg_widget/tfpgwidget.factivewidget.html - FAlign fpg_widget/tfpgwidget.falign.html - FHint fpg_widget/tfpgwidget.fhint.html - FShowHint fpg_widget/tfpgwidget.fshowhint.html - FParentShowHint fpg_widget/tfpgwidget.fparentshowhint.html - FBackgroundColor fpg_widget/tfpgwidget.fbackgroundcolor.html - FTextColor fpg_widget/tfpgwidget.ftextcolor.html - FIsContainer fpg_widget/tfpgwidget.fiscontainer.html - SetBackgroundColor fpg_widget/tfpgwidget.setbackgroundcolor.html - SetTextColor fpg_widget/tfpgwidget.settextcolor.html - GetParent fpg_widget/tfpgwidget.getparent.html - SetParent fpg_widget/tfpgwidget.setparent.html - SetEnabled fpg_widget/tfpgwidget.setenabled.html - SetVisible fpg_widget/tfpgwidget.setvisible.html - SetShowHint fpg_widget/tfpgwidget.setshowhint.html - SetParentShowHint fpg_widget/tfpgwidget.setparentshowhint.html - DoUpdateWindowPosition fpg_widget/tfpgwidget.doupdatewindowposition.html - DoAlign fpg_widget/tfpgwidget.doalign.html - DoResize fpg_widget/tfpgwidget.doresize.html - HandlePaint fpg_widget/tfpgwidget.handlepaint.html - HandleKeyChar fpg_widget/tfpgwidget.handlekeychar.html - HandleKeyPress fpg_widget/tfpgwidget.handlekeypress.html - HandleKeyRelease fpg_widget/tfpgwidget.handlekeyrelease.html - HandleSetFocus fpg_widget/tfpgwidget.handlesetfocus.html - HandleKillFocus fpg_widget/tfpgwidget.handlekillfocus.html - HandleLMouseDown fpg_widget/tfpgwidget.handlelmousedown.html - HandleRMouseDown fpg_widget/tfpgwidget.handlermousedown.html - HandleLMouseUp fpg_widget/tfpgwidget.handlelmouseup.html - HandleRMouseUp fpg_widget/tfpgwidget.handlermouseup.html - HandleMouseMove fpg_widget/tfpgwidget.handlemousemove.html - HandleDoubleClick fpg_widget/tfpgwidget.handledoubleclick.html - HandleMouseEnter fpg_widget/tfpgwidget.handlemouseenter.html - HandleMouseExit fpg_widget/tfpgwidget.handlemouseexit.html - HandleMouseScroll fpg_widget/tfpgwidget.handlemousescroll.html - FindFocusWidget fpg_widget/tfpgwidget.findfocuswidget.html - HandleAlignments fpg_widget/tfpgwidget.handlealignments.html - HandleShow fpg_widget/tfpgwidget.handleshow.html - InternalHandleShow fpg_widget/tfpgwidget.internalhandleshow.html - HandleHide fpg_widget/tfpgwidget.handlehide.html - MoveAndResize fpg_widget/tfpgwidget.moveandresize.html - RePaint fpg_widget/tfpgwidget.repaint.html - OnClick fpg_widget/tfpgwidget.onclick.html - OnDoubleClick fpg_widget/tfpgwidget.ondoubleclick.html - OnEnter fpg_widget/tfpgwidget.onenter.html - OnExit fpg_widget/tfpgwidget.onexit.html - OnKeyPress fpg_widget/tfpgwidget.onkeypress.html - OnMouseDown fpg_widget/tfpgwidget.onmousedown.html - OnMouseEnter fpg_widget/tfpgwidget.onmouseenter.html - OnMouseExit fpg_widget/tfpgwidget.onmouseexit.html - OnMouseMove fpg_widget/tfpgwidget.onmousemove.html - OnMouseUp fpg_widget/tfpgwidget.onmouseup.html - OnPaint fpg_widget/tfpgwidget.onpaint.html - OnResize fpg_widget/tfpgwidget.onresize.html - Create fpg_widget/tfpgwidget.create.html - Destroy fpg_widget/tfpgwidget.destroy.html - GetClientRect fpg_widget/tfpgwidget.getclientrect.html - GetBoundsRect fpg_widget/tfpgwidget.getboundsrect.html - Realign fpg_widget/tfpgwidget.realign.html - SetFocus fpg_widget/tfpgwidget.setfocus.html - KillFocus fpg_widget/tfpgwidget.killfocus.html - MoveAndResizeBy fpg_widget/tfpgwidget.moveandresizeby.html - SetPosition fpg_widget/tfpgwidget.setposition.html - Invalidate fpg_widget/tfpgwidget.invalidate.html - FormDesigner fpg_widget/tfpgwidget.formdesigner.html - Parent fpg_widget/tfpgwidget.parent.html - ActiveWidget fpg_widget/tfpgwidget.activewidget.html - IsContainer fpg_widget/tfpgwidget.iscontainer.html - Visible fpg_widget/tfpgwidget.visible.html - Enabled fpg_widget/tfpgwidget.enabled.html - TabOrder fpg_widget/tfpgwidget.taborder.html - Focusable fpg_widget/tfpgwidget.focusable.html - Focused fpg_widget/tfpgwidget.focused.html - Anchors fpg_widget/tfpgwidget.anchors.html - Align fpg_widget/tfpgwidget.align.html - Hint fpg_widget/tfpgwidget.hint.html - ShowHint fpg_widget/tfpgwidget.showhint.html - ParentShowHint fpg_widget/tfpgwidget.parentshowhint.html - BackgroundColor fpg_widget/tfpgwidget.backgroundcolor.html - TextColor fpg_widget/tfpgwidget.textcolor.html - FindKeyboardFocus fpg_widget/findkeyboardfocus.html - FocusRootWidget fpg_widget/focusrootwidget.html - fpg_utils fpg_utils/index.html - fpgToOSEncoding fpg_utils/fpgtoosencoding.html - fpgFromOSEncoding fpg_utils/fpgfromosencoding.html - fpgOpenURL fpg_utils/fpgopenurl.html - fpgAddTrailingValue fpg_utils/fpgaddtrailingvalue.html - fpgAppendPathDelim fpg_utils/fpgappendpathdelim.html - fpgHasSubDirs fpg_utils/fpghassubdirs.html - fpgAllFilesMask fpg_utils/fpgallfilesmask.html - fpgConvertLineEndings fpg_utils/fpgconvertlineendings.html - fpgFindFirst fpg_utils/fpgfindfirst.html - fpgFindNext fpg_utils/fpgfindnext.html - fpgGetCurrentDir fpg_utils/fpggetcurrentdir.html - fpgSetCurrentDir fpg_utils/fpgsetcurrentdir.html - fpgExpandFileName fpg_utils/fpgexpandfilename.html - fpgFileExists fpg_utils/fpgfileexists.html - fpgDirectoryExists fpg_utils/fpgdirectoryexists.html - fpgExtractFileDir fpg_utils/fpgextractfiledir.html - fpg_popupwindow fpg_popupwindow/index.html - TfpgPopupWindow fpg_popupwindow/tfpgpopupwindow.html - MsgClose fpg_popupwindow/tfpgpopupwindow.msgclose.html - AdjustWindowStyle fpg_popupwindow/tfpgpopupwindow.adjustwindowstyle.html - HandleClose fpg_popupwindow/tfpgpopupwindow.handleclose.html - ProcessPopupFrame fpg_popupwindow/tfpgpopupwindow.processpopupframe.html - DoPaintPopupFrame fpg_popupwindow/tfpgpopupwindow.dopaintpopupframe.html - DoOnClose fpg_popupwindow/tfpgpopupwindow.doonclose.html - Create fpg_popupwindow/tfpgpopupwindow.create.html - ShowAt fpg_popupwindow/tfpgpopupwindow.showat.html - Close fpg_popupwindow/tfpgpopupwindow.close.html - DontCloseWidget fpg_popupwindow/tfpgpopupwindow.dontclosewidget.html - PopupFrame fpg_popupwindow/tfpgpopupwindow.popupframe.html - OnClose fpg_popupwindow/tfpgpopupwindow.onclose.html - ClosePopups fpg_popupwindow/closepopups.html - PopupListFirst fpg_popupwindow/popuplistfirst.html - PopupListFind fpg_popupwindow/popuplistfind.html - PopupDontCloseWidget fpg_popupwindow/popupdontclosewidget.html - fpg_wuline fpg_wuline/index.html - WuLine fpg_wuline/wuline.html - DrawWuCircle fpg_wuline/drawwucircle.html - fpg_imagelist fpg_imagelist/index.html - EItemExists fpg_imagelist/eitemexists.html - TfpgImageItem fpg_imagelist/tfpgimageitem.html - Create fpg_imagelist/tfpgimageitem.create.html - Destroy fpg_imagelist/tfpgimageitem.destroy.html - Index fpg_imagelist/tfpgimageitem.index.html - Image fpg_imagelist/tfpgimageitem.image.html - ImageList fpg_imagelist/tfpgimageitem.imagelist.html - LoadFromFile fpg_imagelist/tfpgimageitem.loadfromfile.html - TfpgImageList fpg_imagelist/tfpgimagelist.html - Create fpg_imagelist/tfpgimagelist.create.html - Destroy fpg_imagelist/tfpgimagelist.destroy.html - AddItemFromFile fpg_imagelist/tfpgimagelist.additemfromfile.html - AddImage fpg_imagelist/tfpgimagelist.addimage.html - RemoveIndex fpg_imagelist/tfpgimagelist.removeindex.html - GetMaxItem fpg_imagelist/tfpgimagelist.getmaxitem.html - Item fpg_imagelist/tfpgimagelist.item.html - fpg_constants fpg_constants/index.html - rserrnotassigned fpg_constants/index-1.html#rserrnotassigned - rsnewitemdetected fpg_constants/index-1.html#rsnewitemdetected - rsabort fpg_constants/index-1.html#rsabort - rsabout fpg_constants/index-1.html#rsabout - rsall fpg_constants/index-1.html#rsall - rsallfiles fpg_constants/index-1.html#rsallfiles - rscollectionallfonts fpg_constants/index-1.html#rscollectionallfonts - rsantialiasing fpg_constants/index-1.html#rsantialiasing - rsshortapr fpg_constants/index-1.html#rsshortapr - rslongapr fpg_constants/index-1.html#rslongapr - rsfileattributes fpg_constants/index-1.html#rsfileattributes - rsshortaug fpg_constants/index-1.html#rsshortaug - rslongaug fpg_constants/index-1.html#rslongaug - rsbold fpg_constants/index-1.html#rsbold - rscancel fpg_constants/index-1.html#rscancel - rscannotcreatedir fpg_constants/index-1.html#rscannotcreatedir - rschange fpg_constants/index-1.html#rschange - rsclose fpg_constants/index-1.html#rsclose - rscollection fpg_constants/index-1.html#rscollection - rsconfirm fpg_constants/index-1.html#rsconfirm - rsconfirmation fpg_constants/index-1.html#rsconfirmation - rscopy fpg_constants/index-1.html#rscopy - rserrcouldnotopendir fpg_constants/index-1.html#rserrcouldnotopendir - rscreate fpg_constants/index-1.html#rscreate - rscreatedirectory fpg_constants/index-1.html#rscreatedirectory - rscriticalerror fpg_constants/index-1.html#rscriticalerror - rscut fpg_constants/index-1.html#rscut - rsdatabase fpg_constants/index-1.html#rsdatabase - rsshortdec fpg_constants/index-1.html#rsshortdec - rslongdec fpg_constants/index-1.html#rslongdec - rsdelete fpg_constants/index-1.html#rsdelete - rsdirectories fpg_constants/index-1.html#rsdirectories - rsdrive fpg_constants/index-1.html#rsdrive - rsedit fpg_constants/index-1.html#rsedit - rslanguage fpg_constants/index-1.html#rslanguage - rsenternewdirectory fpg_constants/index-1.html#rsenternewdirectory - rserror fpg_constants/index-1.html#rserror - rsexampletext fpg_constants/index-1.html#rsexampletext - rsexit fpg_constants/index-1.html#rsexit - rserrfailedtocreatedir fpg_constants/index-1.html#rserrfailedtocreatedir - rsfalse fpg_constants/index-1.html#rsfalse - rscollectionfavourites fpg_constants/index-1.html#rscollectionfavourites - rsshortfeb fpg_constants/index-1.html#rsshortfeb - rslongfeb fpg_constants/index-1.html#rslongfeb - rsfileselection fpg_constants/index-1.html#rsfileselection - rsfilename fpg_constants/index-1.html#rsfilename - rsfiles fpg_constants/index-1.html#rsfiles - rsfind fpg_constants/index-1.html#rsfind - rscollectionfixedwidth fpg_constants/index-1.html#rscollectionfixedwidth - rscollectionfontaliases fpg_constants/index-1.html#rscollectionfontaliases - rsshortfri fpg_constants/index-1.html#rsshortfri - rslongfri fpg_constants/index-1.html#rslongfri - rsfilegroup fpg_constants/index-1.html#rsfilegroup - rshelp fpg_constants/index-1.html#rshelp - rsignore fpg_constants/index-1.html#rsignore - rsinformation fpg_constants/index-1.html#rsinformation - rsinsert fpg_constants/index-1.html#rsinsert - rsitalic fpg_constants/index-1.html#rsitalic - rserritemofwrongtype fpg_constants/index-1.html#rserritemofwrongtype - rsshortjan fpg_constants/index-1.html#rsshortjan - rslongjan fpg_constants/index-1.html#rslongjan - rsshortjul fpg_constants/index-1.html#rsshortjul - rslongjul fpg_constants/index-1.html#rslongjul - rsshortjun fpg_constants/index-1.html#rsshortjun - rslongjun fpg_constants/index-1.html#rslongjun - rserrlistmustbeempty fpg_constants/index-1.html#rserrlistmustbeempty - rsshortmar fpg_constants/index-1.html#rsshortmar - rslongmar fpg_constants/index-1.html#rslongmar - rsshortmay fpg_constants/index-1.html#rsshortmay - rsLongMay fpg_constants/index-1.html#rslongmay - rsmessage fpg_constants/index-1.html#rsmessage - rsfilemodifiedtime fpg_constants/index-1.html#rsfilemodifiedtime - rsshortmon fpg_constants/index-1.html#rsshortmon - rslongmon fpg_constants/index-1.html#rslongmon - rsname fpg_constants/index-1.html#rsname - rsno fpg_constants/index-1.html#rsno - rsnotoall fpg_constants/index-1.html#rsnotoall - rsshortnov fpg_constants/index-1.html#rsshortnov - rslongnov fpg_constants/index-1.html#rslongnov - rsok fpg_constants/index-1.html#rsok - rsshortoct fpg_constants/index-1.html#rsshortoct - rslongoct fpg_constants/index-1.html#rslongoct - rsopen fpg_constants/index-1.html#rsopen - rsopenafile fpg_constants/index-1.html#rsopenafile - rsfileowner fpg_constants/index-1.html#rsfileowner - rspassword fpg_constants/index-1.html#rspassword - rspaste fpg_constants/index-1.html#rspaste - rscollectionrecentlyused fpg_constants/index-1.html#rscollectionrecentlyused - rsreplace fpg_constants/index-1.html#rsreplace - rsretry fpg_constants/index-1.html#rsretry - rsfilerights fpg_constants/index-1.html#rsfilerights - rscollectionsans fpg_constants/index-1.html#rscollectionsans - rsshortsat fpg_constants/index-1.html#rsshortsat - rslongsat fpg_constants/index-1.html#rslongsat - rssave fpg_constants/index-1.html#rssave - rssaveafile fpg_constants/index-1.html#rssaveafile - rssearch fpg_constants/index-1.html#rssearch - rsselect fpg_constants/index-1.html#rsselect - rsselectafont fpg_constants/index-1.html#rsselectafont - rsshortsep fpg_constants/index-1.html#rsshortsep - rslongsep fpg_constants/index-1.html#rslongsep - rscollectionserif fpg_constants/index-1.html#rscollectionserif - rsshowhidden fpg_constants/index-1.html#rsshowhidden - rssize fpg_constants/index-1.html#rssize - rsstyle fpg_constants/index-1.html#rsstyle - rsshortsun fpg_constants/index-1.html#rsshortsun - rslongsun fpg_constants/index-1.html#rslongsun - rsshortthu fpg_constants/index-1.html#rsshortthu - rslongthu fpg_constants/index-1.html#rslongthu - rstoday fpg_constants/index-1.html#rstoday - rstrue fpg_constants/index-1.html#rstrue - rsshorttue fpg_constants/index-1.html#rsshorttue - rslongtue fpg_constants/index-1.html#rslongtue - rsfiletype fpg_constants/index-1.html#rsfiletype - rstypeface fpg_constants/index-1.html#rstypeface - rsunderscore fpg_constants/index-1.html#rsunderscore - rsusername fpg_constants/index-1.html#rsusername - rswarning fpg_constants/index-1.html#rswarning - rsshortwed fpg_constants/index-1.html#rsshortwed - rslongwed fpg_constants/index-1.html#rslongwed - rsaddnewitem fpg_constants/index-1.html#rsaddnewitem - rsyes fpg_constants/index-1.html#rsyes - rsyestoall fpg_constants/index-1.html#rsyestoall - DOUBLECLICK_MS fpg_constants/doubleclick_ms.html - DOUBLECLICK_DISTANCE fpg_constants/doubleclick_distance.html - ONE_MILISEC fpg_constants/one_milisec.html - DEFAULT_HINT_PAUSE fpg_constants/default_hint_pause.html - fpgAddColon fpg_constants/fpgaddcolon.html - fpg_pofiles fpg_pofiles/index.html - TPOFileItem fpg_pofiles/tpofileitem.html - Identifier fpg_pofiles/tpofileitem.identifier.html - Original fpg_pofiles/tpofileitem.original.html - Translation fpg_pofiles/tpofileitem.translation.html - Create fpg_pofiles/tpofileitem.create.html - TPOFile fpg_pofiles/tpofile.html - FItems fpg_pofiles/tpofile.fitems.html - FIdentifierToItem fpg_pofiles/tpofile.fidentifiertoitem.html - FOriginalToItem fpg_pofiles/tpofile.foriginaltoitem.html - Create fpg_pofiles/tpofile.create.html - Destroy fpg_pofiles/tpofile.destroy.html - ReadPOText fpg_pofiles/tpofile.readpotext.html - Add fpg_pofiles/tpofile.add.html - Translate fpg_pofiles/tpofile.translate.html - AppendFile fpg_pofiles/tpofile.appendfile.html - EPOFileError fpg_pofiles/epofileerror.html - TranslateUnitResourceStrings fpg_pofiles/translateunitresourcestrings.html - UTF8ToSystemCharSet fpg_pofiles/utf8tosystemcharset.html - SystemCharSetIsUTF8 fpg_pofiles/systemcharsetisutf8.html - fpg_translations fpg_translations/index.html - PTranslation fpg_translations/ptranslation.html - TTranslation fpg_translations/ttranslation.html - ID fpg_translations/ttranslation.id.html - TTranslationList fpg_translations/ttranslationlist.html - Destroy fpg_translations/ttranslationlist.destroy.html - IndexOf fpg_translations/ttranslationlist.indexof.html - Add fpg_translations/ttranslationlist.add.html - Clear fpg_translations/ttranslationlist.clear.html - Count fpg_translations/ttranslationlist.count.html - Items fpg_translations/ttranslationlist.items.html - TranslateResourceStrings fpg_translations/translateresourcestrings.html - fpg_stringhashlist fpg_stringhashlist/index.html - PStringHashItem fpg_stringhashlist/pstringhashitem.html - TStringHashItem fpg_stringhashlist/tstringhashitem.html - PStringHashItemList fpg_stringhashlist/pstringhashitemlist.html - TStringHashList fpg_stringhashlist/tstringhashlist.html - HashOf fpg_stringhashlist/tstringhashlist.hashof.html - Insert fpg_stringhashlist/tstringhashlist.insert.html - Create fpg_stringhashlist/tstringhashlist.create.html - Destroy fpg_stringhashlist/tstringhashlist.destroy.html - Add fpg_stringhashlist/tstringhashlist.add.html - Clear fpg_stringhashlist/tstringhashlist.clear.html - Find fpg_stringhashlist/tstringhashlist.find.html - Remove fpg_stringhashlist/tstringhashlist.remove.html - CaseSensitive fpg_stringhashlist/tstringhashlist.casesensitive.html - Count fpg_stringhashlist/tstringhashlist.count.html - Data fpg_stringhashlist/tstringhashlist.data.html - List fpg_stringhashlist/tstringhashlist.list.html - -:classes -#CoreLib.fpg_base.TfpgRect 0VTop -0VLeft -0VWidth -0VHeight -0MSetRect -0MBottom -0MRight -0MSetBottom -0MSetRight -#CoreLib.fpg_base.TfpgImageBase TObject -1MGetColor -1MSetColor -2VFWidth -2VFHeight -2VFColorDepth -2VFMasked -2VFImageData -2VFImageDataSize -2VFMaskData -2VFMaskDataSize -2MDoFreeImage -2MDoInitImage -2MDoInitImageMask -3MCreate -3MDestroy -3MInvert -3MFreeImage -3MAllocateImage -3MAllocateMask -3MCreateMaskFromSample -3MUpdateImage -3PImageData r -3PImageDataSize r -3PMaskData r -3PMaskDataSize r -3PWidth r -3PHeight r -3PColorDepth r -3PMasked r -3PColors rw -#CoreLib.fpg_base.TfpgFontResourceBase TObject -3MGetAscent -3MGetDescent -3MGetHeight -3MGetTextWidth -#CoreLib.fpg_base.TfpgFontBase TObject -2VFFontDesc -2VFFontRes -3MTextWidth -3MAscent -3MDescent -3MHeight -3PFontDesc r -3PFontRes r -3PHandle r -#CoreLib.fpg_base.TfpgCustomInterpolation TObject -1VFCanvas -1VFImage -2MInitialize -2MExecute -3PCanvas r -3PImage r -#CoreLib.fpg_base.TfpgBaseInterpolation #CoreLib.fpg_base.TfpgCustomInterpolation -1Vxfactor -1Vyfactor -1Vxsupport -1Vysupport -1Vtempimage -1MHorizontal -1MVertical -2MExecute -2MFilter -2MMaxSupport -3MDestroy -#CoreLib.fpg_base.TfpgMitchelInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_base.TfpgCanvasBase TObject -1VFFastDoubleBuffer -1VFInterpolation -1MSetInterpolation -2VFBufferedDraw -2VFBeginDrawCount -2VFWindow -2VFColor -2VFTextColor -2VFLineWidth -2VFLineStyle -2VFFont -2VFPersistentResources -2MDoSetFontRes -2MDoSetTextColor -2MDoSetColor -2MDoSetLineStyle -2MDoGetWinRect -2MDoFillRectangle -2MDoXORFillRectangle -2MDoFillTriangle -2MDoDrawRectangle -2MDoDrawLine -2MDoDrawImagePart -2MDoDrawString -2MDoSetClipRect -2MDoGetClipRect -2MDoAddClipRect -2MDoClearClipRect -2MDoBeginDraw -2MDoPutBufferToScreen -2MDoEndDraw -2MGetPixel -2MSetPixel -2MDoDrawArc -2MDoFillArc -2MDoDrawPolygon -3MCreate -3MDestroy -3MDrawRectangle -3MDrawLine -3MDrawLineClipped -3MClipLine -3MDrawImage -3MDrawImagePart -3MDrawArc -3MDrawPolygon -3MStretchDraw -3MCopyRect -3MDrawString -3MFillRectangle -3MFillTriangle -3MFillArc -3MGradientFill -3MXORFillRectangle -3MSetClipRect -3MGetClipRect -3MAddClipRect -3MClearClipRect -3MClear -3MGetWinRect -3MSetColor -3MSetTextColor -3MSetLineStyle -3MSetFont -3MBeginDraw -3MEndDraw -3MFreeResources -3PColor rw -3PTextColor rw -3PFont rw -3PPixels rw -3PInterpolationFilter rw -3PFastDoubleBuffer rw -3PLineStyle r -3PLineWidth r -#CoreLib.fpg_base.TfpgComponent TComponent -1VFTagPointer -3PTagPointer rw -#CoreLib.fpg_base.TfpgWindowBase #CoreLib.fpg_base.TfpgComponent -1VFParent -1MSetMouseCursor -1MConstraintWidth -1MConstraintHeight -2VFMouseCursor -2VFWindowType -2VFWindowAttributes -2VFTop -2VFLeft -2VFWidth -2VFHeight -2VFPrevTop -2VFPrevLeft -2VFPrevWidth -2VFPrevHeight -2VFMinWidth -2VFMinHeight -2VFMaxHeight -2VFMaxWidth -2VFCanvas -2VFSizeIsDirty -2VFPosIsDirty -2MHandleIsValid -2MDoUpdateWindowPosition -2MDoAllocateWindowHandle -2MDoReleaseWindowHandle -2MDoRemoveWindowLookup -2MDoSetWindowVisible -2MDoMoveWindow -2MDoWindowToScreen -2MDoSetWindowTitle -2MDoSetMouseCursor -2MSetParent -2MGetParent -2MGetCanvas -2MAllocateWindowHandle -2MReleaseWindowHandle -2MSetWindowTitle -2MSetTop -2MSetLeft -2MSetHeight -2MSetWidth -2MHandleMove -2MHandleResize -3MCreate -3MAfterConstruction -3MAdjustWindowStyle -3MSetWindowParameters -3MRight -3MBottom -3MUpdateWindowPosition -3MMoveWindow -3MWindowToScreen -3MHasParent -3MActivateWindow -3MCaptureMouse -3MReleaseMouse -3MSetFullscreen -3PHasHandle r -3PWindowType rw -3PWindowAttributes rw -3PLeft rw -3PTop rw -3PWidth rw -3PHeight rw -3PMinWidth rw -3PMinHeight rw -3PMaxWidth rw -3PMaxHeight rw -3PCanvas r -3PParent rw -3PMouseCursor rw -#CoreLib.fpg_base.TfpgApplicationBase TComponent -1VFMainForm -1VFTerminated -1VFCritSect -1MGetForm -1MGetFormCount -1MGetTopModalForm -2VFOnIdle -2VFIsInitialized -2VFModalFormStack -2MDoGetFontFaceList -3MCreate -3MDestroy -3MGetFontFaceList -3MPushModalForm -3MPopModalForm -3MPrevModalForm -3MRemoveWindowFromModalStack -3MCreateForm -3MGetScreenWidth -3MGetScreenHeight -3MScreen_dpi_x -3MScreen_dpi_y -3MScreen_dpi -3MTerminate -3MLock -3MUnlock -3PFormCount r -3PForms r -3PIsInitialized r -3PTopModalForm r -3PMainForm rw -3PTerminated rw -3POnIdle rw -#CoreLib.fpg_base.TfpgClipboardBase TObject -2VFClipboardWndHandle -2MDoGetText -2MDoSetText -2MInitClipboard -3MCreate -3PText rw -#CoreLib.fpg_base.TFileEntry TObject -1VFEntryType -1VFExtension -1VFName -1VFModTime -1VFSize -1VFIsLink -1VFLinkTarget -1VFIsExecutable -1VFModeString -1VFOwner -1VFGroup -1VFAttrString -3MCreate -3PName rw -3PExtension rw -3PSize rw -3PEntryType rw -3PIsLink rw -3PLinkTarget rw -3PIsExecutable rw -3PModTime rw -3PMode rw -3POwner rw -3PGroup rw -3PAttributes rw -#CoreLib.fpg_base.TfpgFileListBase TObject -1VFEntries -1VFDirectoryName -1VFFileMask -1VFShowHidden -1VFCurrentSpecialDir -1MAddEntry -1MGetEntry -1MHasAttrib -2VFSpecialDirs -2VFHasFileMode -2MInitializeEntry -2MPopulateSpecialDirs -3MCreate -3MDestroy -3MCount -3MCurrentSpecialDir -3MReadDirectory -3MClear -3MSort -3PDirectoryName r -3PEntry r -3PFileMask rw -3PHasFileMode r -3PShowHidden rw -3PSpecialDirs r -#CoreLib.fpg_x11.TfpgFontResourceImpl #CoreLib.fpg_base.TfpgFontResourceBase -1VFFontData -1MDoGetTextWidthClassic -1MDoGetTextWidthWorkaround -2PHandle r -3MCreate -3MDestroy -3MHandleIsValid -3MGetAscent -3MGetDescent -3MGetHeight -3MGetTextWidth -#CoreLib.fpg_x11.TfpgImageImpl #CoreLib.fpg_base.TfpgImageBase -1VFXimg -1VFXimgmask -1MXImage -1MXImageMask -2MDoFreeImage -2MDoInitImage -2MDoInitImageMask -3MCreate -#CoreLib.fpg_x11.TfpgCanvasImpl #CoreLib.fpg_base.TfpgCanvasBase -1VFDrawing -1VFDrawWindow -1VFBufferPixmap -1VFDrawHandle -1VFgc -1VFCurFontRes -1VFClipRect -1VFClipRectSet -1VFXftDraw -1VFColorTextXft -1VFClipRegion -1VFPixHeight -1VFPixWidth -1VFBufferFreeTimer -1MBufferFreeTimer -1MTryFreePixmap -2MDoSetFontRes -2MDoSetTextColor -2MDoSetColor -2MDoSetLineStyle -2MDoGetWinRect -2MDoFillRectangle -2MDoXORFillRectangle -2MDoFillTriangle -2MDoDrawRectangle -2MDoDrawLine -2MDoDrawImagePart -2MDoDrawString -2MDoSetClipRect -2MDoGetClipRect -2MDoAddClipRect -2MDoClearClipRect -2MDoBeginDraw -2MDoPutBufferToScreen -2MDoEndDraw -2MGetPixel -2MSetPixel -2MDoDrawArc -2MDoFillArc -2MDoDrawPolygon -2PDCHandle r -3MCreate -3MDestroy -#CoreLib.fpg_x11.TfpgWindowImpl #CoreLib.fpg_base.TfpgWindowBase -2VFWinFlags -2VFWinHandle -2VFBackupWinHandle -2VFModalForWin -2MDoAllocateWindowHandle -2MDoReleaseWindowHandle -2MDoRemoveWindowLookup -2MDoSetWindowVisible -2MHandleIsValid -2MDoSetWindowTitle -2MDoMoveWindow -2MDoWindowToScreen -2MDoUpdateWindowPosition -2MDoSetMouseCursor -2PWinHandle r -3MCreate -3MActivateWindow -3MCaptureMouse -3MReleaseMouse -3MSetFullscreen -#CoreLib.fpg_x11.TfpgApplicationImpl #CoreLib.fpg_base.TfpgApplicationBase -1VFComposeBuffer -1VFComposeStatus -1VFEventFilter -1MConvertShiftState -1MKeySymToKeycode -1MStartComposing -2VFDisplay -2VDisplayDepth -2VDefaultBackground -2VDefaultForeground -2VDefaultScreen -2VDefaultVisual -2VDefaultColorMap -2VFRootWindow -2Vxia_clipboard -2Vxia_motif_wm_hints -2Vxia_wm_protocols -2Vxia_wm_delete_window -2Vnetlayer -2Vxia_targets -2VInputMethod -2VInputContext -2VFLastKeySym -2MDoGetFontFaceList -3MCreate -3MDestroy -3MDoMessagesPending -3MDoWaitWindowMessage -3MDoFlush -3MGetScreenWidth -3MGetScreenHeight -3MScreen_dpi_x -3MScreen_dpi_y -3MScreen_dpi -3PDisplay r -3PRootWindow r -3PEventFilter rw -#CoreLib.fpg_x11.TfpgClipboardImpl #CoreLib.fpg_base.TfpgClipboardBase -1VFWaitingForSelection -2VFClipboardText -2MDoGetText -2MDoSetText -2MInitClipboard -#CoreLib.fpg_x11.TfpgFileListImpl #CoreLib.fpg_base.TfpgFileListBase -0MEncodeModeString -0MCreate -0MInitializeEntry -0MPopulateSpecialDirs -#CoreLib.fpg_gdi.TfpgFontResourceImpl #CoreLib.fpg_base.TfpgFontResourceBase -1VFFontData -1VFMetrics -2MOpenFontByDesc -2PHandle r -3MCreate -3MDestroy -3MHandleIsValid -3MGetAscent -3MGetDescent -3MGetHeight -3MGetTextWidth -#CoreLib.fpg_gdi.TfpgFontImpl #CoreLib.fpg_base.TfpgFontBase -#CoreLib.fpg_gdi.TfpgImageImpl #CoreLib.fpg_base.TfpgImageBase -1VFBMPHandle -1VFMaskHandle -1VFIsTwoColor -1PBMPHandle r -1PMaskHandle r -2MDoFreeImage -2MDoInitImage -2MDoInitImageMask -3MCreate -#CoreLib.fpg_gdi.TfpgCanvasImpl #CoreLib.fpg_base.TfpgCanvasBase -1VFDrawing -1VFBufferBitmap -1VFDrawWindow -1VFgc -1VFBufgc -1VFWinGC -1VFBackgroundColor -1VFCurFontRes -1VFClipRect -1VFClipRectSet -1VFWindowsColor -1VFBrush -1VFPen -1VFClipRegion -1VFIntLineStyle -1VFBufWidth -1VFBufHeight -1MTryFreeBackBuffer -2MDoSetFontRes -2MDoSetTextColor -2MDoSetColor -2MDoSetLineStyle -2MDoGetWinRect -2MDoFillRectangle -2MDoXORFillRectangle -2MDoFillTriangle -2MDoDrawRectangle -2MDoDrawLine -2MDoDrawImagePart -2MDoDrawString -2MDoSetClipRect -2MDoGetClipRect -2MDoAddClipRect -2MDoClearClipRect -2MDoBeginDraw -2MDoPutBufferToScreen -2MDoEndDraw -2MGetPixel -2MSetPixel -2MDoDrawArc -2MDoFillArc -2MDoDrawPolygon -2PDCHandle r -3MCreate -3MDestroy -#CoreLib.fpg_gdi.TfpgWindowImpl #CoreLib.fpg_base.TfpgWindowBase -1VFMouseInWindow -1VFNonFullscreenRect -1VFNonFullscreenStyle -1VFFullscreenIsSet -1VFSkipResizeMessage -1MDoMouseEnterLeaveCheck -1MWindowSetFullscreen -2VFWinHandle -2VFModalForWin -2VFWinStyle -2VFWinStyleEx -2VFParentWinHandle -2MDoAllocateWindowHandle -2MDoReleaseWindowHandle -2MDoRemoveWindowLookup -2MDoSetWindowVisible -2MHandleIsValid -2MDoUpdateWindowPosition -2MDoMoveWindow -2MDoWindowToScreen -2MDoSetWindowTitle -2MDoSetMouseCursor -2PWinHandle r -3MCreate -3MActivateWindow -3MCaptureMouse -3MReleaseMouse -3MSetFullscreen -#CoreLib.fpg_gdi.TfpgApplicationImpl #CoreLib.fpg_base.TfpgApplicationBase -2VFDisplay -2VWindowClass -2VWidgetClass -2Vhcr_default -2Vhcr_dir_ew -2Vhcr_dir_ns -2Vhcr_edit -2Vhcr_dir_nwse -2Vhcr_dir_nesw -2Vhcr_move -2Vhcr_crosshair -2Vhcr_wait -2Vhcr_hand -2VFFocusedWindow -2VFHiddenWindow -2VHiddenWndClass -2VActivationHook -2MGetHiddenWindow -2MDoGetFontFaceList -3MCreate -3MDestroy -3MDoMessagesPending -3MDoWaitWindowMessage -3MDoFlush -3MGetScreenWidth -3MGetScreenHeight -3MScreen_dpi_x -3MScreen_dpi_y -3MScreen_dpi -3PDisplay r -#CoreLib.fpg_gdi.TfpgClipboardImpl #CoreLib.fpg_base.TfpgClipboardBase -2VFClipboardText -2MDoGetText -2MDoSetText -2MInitClipboard -#CoreLib.fpg_gdi.TfpgFileListImpl #CoreLib.fpg_base.TfpgFileListBase -0MEncodeAttributesString -0MCreate -0MInitializeEntry -0MPopulateSpecialDirs -#CoreLib.fpg_main.TfpgFontResource #CoreLib.fpg_x11.TfpgFontResourceImpl -2VFFontDesc -2VFRefCount -3MCreate -3MIncRefCount -3MDecRefCount -3PFontDesc r -#CoreLib.fpg_main.TfpgFont #CoreLib.fpg_base.TfpgFontBase -3MCreate -3MDestroy -#CoreLib.fpg_main.TfpgWindow #CoreLib.fpg_x11.TfpgWindowImpl -2MSetParent -2MGetParent -2MGetCanvas -3MCreate -3MDestroy -3PParent rw -3PCanvas r -3PWinHandle -#CoreLib.fpg_main.TfpgImage #CoreLib.fpg_x11.TfpgImageImpl -3MImageFromRect -#CoreLib.fpg_main.TfpgImages .TObject -1VFImages -3MCreate -3MDestroy -3MAddImage -3MDeleteImage -3MGetImage -3MAddBMP -3MAddMaskedBMP -3MListImages -#CoreLib.fpg_main.TfpgCanvas #CoreLib.fpg_x11.TfpgCanvasImpl -1MAddLineBreaks -3MCreate -3MDestroy -3MDrawButtonFace -3MDrawControlFrame -3MDrawDirectionArrow -3MDrawFocusRect -3MDrawText -#CoreLib.fpg_main.TfpgStyle .TObject -3VDefaultFont -3VMenuFont -3VMenuAccelFont -3VMenuDisabledFont -3MCreate -3MDestroy -3MDrawButtonFace -3MDrawControlFrame -3MDrawDirectionArrow -3MDrawString -3MDrawFocusRect -#CoreLib.fpg_main.TMsgHookItem .TObject -0VDest -0VListener -0VMsgCode -#CoreLib.fpg_main.TfpgApplication #CoreLib.fpg_x11.TfpgApplicationImpl -1VFHintPause -1VFShowHint -1VFOnException -1VFStopOnException -1VFHintWindow -1VFHintTimer -1VFHintWidget -1VFHintPos -1MSetHintPause -1MSetupLocalizationStrings -1MInternalMsgClose -1MInternalMsgHintTimer -1MCreateHintWindow -1MHintTimerFired -1MSetShowHint -2VFDisplayParams -2VFScreenWidth -2VFScreenHeight -2VFDefaultFont -2VFFontResList -2VFMessageHookList -2MFreeFontRes -2MInternalInit -2MRunMessageLoop -2MWaitWindowMessage -3MCreate -3MDestroy -3MGetFont -3MActivateHint -3MFlush -3MHandleException -3MHideHint -3MInitialize -3MProcessMessages -3MRun -3MSetMessageHook -3MShowException -3MUnsetMessageHook -3PDefaultFont r -3PHintPause rw -3PHintWindow r -3PScreenWidth r -3PScreenHeight r -3PShowHint rw -3PStopOnException rw -3POnException rw -#CoreLib.fpg_main.TfpgTimer TObject -1VFEnabled -1VFNextAlarm -1VFInterval -1VFOnTimer -1MSetEnabled -1MSetInterval -3MCreate -3MDestroy -3MCheckAlarm -3MReset -3PEnabled rw -3PNextAlarm r -3PInterval rw -3POnTimer rw -#CoreLib.fpg_main.TfpgCaret TObject -1VFEnabled -1VFVisible -1VFInterval -1VFCanvas -1VFTop -1VFLeft -1VFWidth -1VFHeight -1VFTimer -1MOnTimerTime -3MCreate -3MDestroy -3MSetCaret -3MUnSetCaret -3MInvertCaret -3PWidth r -3PHeight r -#CoreLib.fpg_main.TfpgClipboard #CoreLib.fpg_x11.TfpgClipboardImpl -#CoreLib.fpg_main.TfpgFileList #CoreLib.fpg_x11.TfpgFileListImpl -#CoreLib.fpg_cmdlineparams.TGfxCommandLineParams TObject -1VFsParams -1VFslParams -1MReadParams -1MWordExtract -1MWordCount -1MWordPosition -1MExtractChar -1MCharInStr -1MStripLeadingDelims -1MStripTrailingDelims -1MNumToken -1MToken -1MStrTran -3MCreate -3MDestroy -3MIsParam -3MGetParam -3PParams r -3PAsString r -#CoreLib.fpg_extinterpolation.TBlackmanInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBlackmanSincInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBlackmanBesselInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TGaussianInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBoxInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.THermiteInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TLanczosInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TQuadraticInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TCubicInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TCatromInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBilinearInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.THanningInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.THammingInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBSplineInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_extinterpolation.TBellInterpolation #CoreLib.fpg_base.TfpgBaseInterpolation -2MFilter -2MMaxSupport -#CoreLib.fpg_widget.TfpgWidget #CoreLib.fpg_main.TfpgWindow -1VFAlignRect -1VFOnClick -1VFOnDoubleClick -1VFOnEnter -1VFOnExit -1VFOnMouseDown -1VFOnMouseEnter -1VFOnMouseExit -1VFOnMouseMove -1VFOnMouseUp -1VFOnPaint -1VFOnKeyPress -1VFOnResize -1VFOnScreen -1MSetActiveWidget -1MIsShowHintStored -2MMsgPaint -2MMsgResize -2MMsgMove -2MMsgKeyChar -2MMsgKeyPress -2MMsgKeyRelease -2MMsgMouseDown -2MMsgMouseUp -2MMsgMouseMove -2MMsgDoubleClick -2MMsgMouseEnter -2MMsgMouseExit -2MMsgMouseScroll -2VFFormDesigner -2VFVisible -2VFEnabled -2VFFocusable -2VFFocused -2VFTabOrder -2VFAnchors -2VFActiveWidget -2VFAlign -2VFHint -2VFShowHint -2VFParentShowHint -2VFBackgroundColor -2VFTextColor -2VFIsContainer -2MSetBackgroundColor -2MSetTextColor -2MGetParent -2MSetParent -2MSetEnabled -2MSetVisible -2MSetShowHint -2MSetParentShowHint -2MDoUpdateWindowPosition -2MDoAlign -2MDoResize -2MHandlePaint -2MHandleKeyChar -2MHandleKeyPress -2MHandleKeyRelease -2MHandleSetFocus -2MHandleKillFocus -2MHandleLMouseDown -2MHandleRMouseDown -2MHandleLMouseUp -2MHandleRMouseUp -2MHandleMouseMove -2MHandleDoubleClick -2MHandleMouseEnter -2MHandleMouseExit -2MHandleMouseScroll -2MFindFocusWidget -2MHandleAlignments -2MHandleShow -2MInternalHandleShow -2MHandleHide -2MMoveAndResize -2MRePaint -2POnClick rw -2POnDoubleClick rw -2POnEnter rw -2POnExit rw -2POnKeyPress rw -2POnMouseDown rw -2POnMouseEnter rw -2POnMouseExit rw -2POnMouseMove rw -2POnMouseUp rw -2POnPaint rw -2POnResize rw -3MCreate -3MDestroy -3MGetClientRect -3MGetBoundsRect -3MRealign -3MSetFocus -3MKillFocus -3MMoveAndResizeBy -3MSetPosition -3MInvalidate -3PFormDesigner rw -3PParent rw -3PActiveWidget rw -3PIsContainer r -3PVisible rw -3PEnabled rw -3PTabOrder rw -3PFocusable rw -3PFocused rw -3PAnchors rw -3PAlign rw -3PHint rw -3PShowHint rws -3PParentShowHint rw -3PBackgroundColor rw -3PTextColor rw -#CoreLib.fpg_popupwindow.TfpgPopupWindow #CoreLib.fpg_widget.TfpgWidget -1VFDontCloseWidget -1VFOnClose -1VFPopupFrame -1MSetPopupFrame -2MMsgClose -2MAdjustWindowStyle -2MHandleClose -2MProcessPopupFrame -2MDoPaintPopupFrame -2MDoOnClose -3MCreate -3MShowAt -3MClose -3PDontCloseWidget rw -3PPopupFrame rw -3POnClose rw -#CoreLib.fpg_imagelist.EItemExists Exception -#CoreLib.fpg_imagelist.TfpgImageItem TObject -1VFImage -1VFIndex -1VFImageList -1MSetImageList -1MSetIndex -1MSetImage -3MCreate -3MDestroy -3PIndex rw -3PImage rw -3PImageList rw -3MLoadFromFile -#CoreLib.fpg_imagelist.TfpgImageList TObject -1VFList -1MGetFListIndex -1MGetItem -1MSetItem -3MCreate -3MDestroy -3MAddItemFromFile -3MAddImage -3MRemoveIndex -3MGetMaxItem -3PItem rw -#CoreLib.fpg_pofiles.TPOFileItem TObject -3VIdentifier -3VOriginal -3VTranslation -3MCreate -#CoreLib.fpg_pofiles.TPOFile TObject -2VFItems -2VFIdentifierToItem -2VFOriginalToItem -3MCreate -3MDestroy -3MReadPOText -3MAdd -3MTranslate -3MAppendFile -#CoreLib.fpg_pofiles.EPOFileError Exception -#CoreLib.fpg_translations.TTranslation TObject -1VFID -3PID r -#CoreLib.fpg_translations.TTranslationList TObject -1VFCount -1VFItems -1MGetItems -3MDestroy -3MIndexOf -3MAdd -3MClear -3PCount r -3PItems r -#CoreLib.fpg_stringhashlist.TStringHashList TObject -1VFList -1VFCount -1VfCaseSensitive -1MCompareString -1MCompareValue -1MGetData -1MSetCaseSensitive -1MDelete -1MSetData -2MHashOf -2MInsert -3MCreate -3MDestroy -3MAdd -3MClear -3MFind -3MRemove -3PCaseSensitive rw -3PCount r -3PData rw -3PList r diff --git a/docs/html/corelib/fpdoc.css b/docs/html/corelib/fpdoc.css deleted file mode 100644 index 5314232d..00000000 --- a/docs/html/corelib/fpdoc.css +++ /dev/null @@ -1,129 +0,0 @@ -/* - $Id$ - - Default style sheet for FPDoc reference documentation - by Sebastian Guenther, sg@freepascal.org - - 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 -} - -/* 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 -} diff --git a/docs/html/gui.cnt b/docs/html/gui.cnt deleted file mode 100644 index be02edee..00000000 --- a/docs/html/gui.cnt +++ /dev/null @@ -1,462 +0,0 @@ -# FPDoc Content File -:link tree -#GUI index.html - fpg_dialogs fpg_dialogs/index.html - mbYesNoCancel fpg_dialogs/mbyesnocancel.html - mbYesNo fpg_dialogs/mbyesno.html - mbOKCancel fpg_dialogs/mbokcancel.html - mbAbortRetryIgnore fpg_dialogs/mbabortretryignore.html - sfdOpen fpg_dialogs/sfdopen.html - sfdSave fpg_dialogs/sfdsave.html - cMsgDlgBtnText fpg_dialogs/cmsgdlgbtntext.html - stdimg_fpgui_logo fpg_dialogs/stdimg_fpgui_logo.html - TfpgMsgDlgType fpg_dialogs/tfpgmsgdlgtype.html - TfpgMsgDlgBtn fpg_dialogs/tfpgmsgdlgbtn.html - TfpgMsgDlgButtons fpg_dialogs/tfpgmsgdlgbuttons.html - TfpgMessageBox fpg_dialogs/tfpgmessagebox.html - HandleKeyPress fpg_dialogs/tfpgmessagebox.handlekeypress.html - HandlePaint fpg_dialogs/tfpgmessagebox.handlepaint.html - HandleShow fpg_dialogs/tfpgmessagebox.handleshow.html - Create fpg_dialogs/tfpgmessagebox.create.html - Destroy fpg_dialogs/tfpgmessagebox.destroy.html - SetMessage fpg_dialogs/tfpgmessagebox.setmessage.html - CentreText fpg_dialogs/tfpgmessagebox.centretext.html - TfpgBaseDialog fpg_dialogs/tfpgbasedialog.html - FSpacing fpg_dialogs/tfpgbasedialog.fspacing.html - FDefaultButtonWidth fpg_dialogs/tfpgbasedialog.fdefaultbuttonwidth.html - btnOK fpg_dialogs/tfpgbasedialog.btnok.html - btnCancel fpg_dialogs/tfpgbasedialog.btncancel.html - btnOKClick fpg_dialogs/tfpgbasedialog.btnokclick.html - btnCancelClick fpg_dialogs/tfpgbasedialog.btncancelclick.html - HandleKeyPress fpg_dialogs/tfpgbasedialog.handlekeypress.html - SetupCaptions fpg_dialogs/tfpgbasedialog.setupcaptions.html - Create fpg_dialogs/tfpgbasedialog.create.html - TfpgFontSelectDialog fpg_dialogs/tfpgfontselectdialog.html - GetFontDesc fpg_dialogs/tfpgfontselectdialog.getfontdesc.html - SetFontDesc fpg_dialogs/tfpgfontselectdialog.setfontdesc.html - SetupCaptions fpg_dialogs/tfpgfontselectdialog.setupcaptions.html - Create fpg_dialogs/tfpgfontselectdialog.create.html - SetSampleText fpg_dialogs/tfpgfontselectdialog.setsampletext.html - TfpgFileDialog fpg_dialogs/tfpgfiledialog.html - HandleKeyPress fpg_dialogs/tfpgfiledialog.handlekeypress.html - btnOKClick fpg_dialogs/tfpgfiledialog.btnokclick.html - SetCurrentDirectory fpg_dialogs/tfpgfiledialog.setcurrentdirectory.html - FileName fpg_dialogs/tfpgfiledialog.filename.html - Create fpg_dialogs/tfpgfiledialog.create.html - Destroy fpg_dialogs/tfpgfiledialog.destroy.html - RunOpenFile fpg_dialogs/tfpgfiledialog.runopenfile.html - RunSaveFile fpg_dialogs/tfpgfiledialog.runsavefile.html - Filter fpg_dialogs/tfpgfiledialog.filter.html - FontDesc fpg_dialogs/tfpgfiledialog.fontdesc.html - ShowHidden fpg_dialogs/tfpgfiledialog.showhidden.html - TfpgMessageDialog fpg_dialogs/tfpgmessagedialog.html - SetWindowTitle fpg_dialogs/tfpgmessagedialog.setwindowtitle.html - HandlePaint fpg_dialogs/tfpgmessagedialog.handlepaint.html - HandleShow fpg_dialogs/tfpgmessagedialog.handleshow.html - HandleKeyPress fpg_dialogs/tfpgmessagedialog.handlekeypress.html - PrepareLayout fpg_dialogs/tfpgmessagedialog.preparelayout.html - lblName1 fpg_dialogs/tfpgmessagedialog.lblname1.html - pnlIcon fpg_dialogs/tfpgmessagedialog.pnlicon.html - Create fpg_dialogs/tfpgmessagedialog.create.html - Destroy fpg_dialogs/tfpgmessagedialog.destroy.html - AfterCreate fpg_dialogs/tfpgmessagedialog.aftercreate.html - About fpg_dialogs/tfpgmessagedialog.about.html - AboutFPGui fpg_dialogs/tfpgmessagedialog.aboutfpgui.html - Critical fpg_dialogs/tfpgmessagedialog.critical.html - Information fpg_dialogs/tfpgmessagedialog.information.html - Question fpg_dialogs/tfpgmessagedialog.question.html - Warning fpg_dialogs/tfpgmessagedialog.warning.html - InformativeText fpg_dialogs/tfpgmessagedialog.informativetext.html - Text fpg_dialogs/tfpgmessagedialog.text.html - Buttons fpg_dialogs/tfpgmessagedialog.buttons.html - DefaultButton fpg_dialogs/tfpgmessagedialog.defaultbutton.html - DialogType fpg_dialogs/tfpgmessagedialog.dialogtype.html - TfpgNewDirDialog fpg_dialogs/tfpgnewdirdialog.html - Create fpg_dialogs/tfpgnewdirdialog.create.html - Directory fpg_dialogs/tfpgnewdirdialog.directory.html - TfpgPromptUserDialog fpg_dialogs/tfpgpromptuserdialog.html - Create fpg_dialogs/tfpgpromptuserdialog.create.html - Authenticate fpg_dialogs/tfpgpromptuserdialog.authenticate.html - Wiggle fpg_dialogs/tfpgpromptuserdialog.wiggle.html - UserID fpg_dialogs/tfpgpromptuserdialog.userid.html - Password fpg_dialogs/tfpgpromptuserdialog.password.html - TfpgPromptUserDbDialog fpg_dialogs/tfpgpromptuserdbdialog.html - aStringList fpg_dialogs/tfpgpromptuserdbdialog.astringlist.html - cbDatabases fpg_dialogs/tfpgpromptuserdbdialog.cbdatabases.html - PopulateComboDb fpg_dialogs/tfpgpromptuserdbdialog.populatecombodb.html - Create fpg_dialogs/tfpgpromptuserdbdialog.create.html - Destroy fpg_dialogs/tfpgpromptuserdbdialog.destroy.html - TfpgSelectDirDialog fpg_dialogs/tfpgselectdirdialog.html - Create fpg_dialogs/tfpgselectdirdialog.create.html - AfterCreate fpg_dialogs/tfpgselectdirdialog.aftercreate.html - SelectedDir fpg_dialogs/tfpgselectdirdialog.selecteddir.html - RootDirectory fpg_dialogs/tfpgselectdirdialog.rootdirectory.html - TCharMapForm fpg_dialogs/tcharmapform.html - AfterCreate fpg_dialogs/tcharmapform.aftercreate.html - NewText fpg_dialogs/tcharmapform.newtext.html - fpgShowCharMap fpg_dialogs/fpgshowcharmap.html - ShowMessage fpg_dialogs/showmessage.html - SelectFontDialog fpg_dialogs/selectfontdialog.html - SelectFileDialog fpg_dialogs/selectfiledialog.html - SelectDirDialog fpg_dialogs/selectdirdialog.html - fpg_hyperlink fpg_hyperlink/index.html - TfpgHyperlink fpg_hyperlink/tfpghyperlink.html - HandleMouseEnter fpg_hyperlink/tfpghyperlink.handlemouseenter.html - HandleMouseExit fpg_hyperlink/tfpghyperlink.handlemouseexit.html - HandleLMouseDown fpg_hyperlink/tfpghyperlink.handlelmousedown.html - Create fpg_hyperlink/tfpghyperlink.create.html - GoHyperLink fpg_hyperlink/tfpghyperlink.gohyperlink.html - Autosize fpg_hyperlink/tfpghyperlink.autosize.html - FontDesc fpg_hyperlink/tfpghyperlink.fontdesc.html - HotTrackColor fpg_hyperlink/tfpghyperlink.hottrackcolor.html - HotTrackFont fpg_hyperlink/tfpghyperlink.hottrackfont.html - Text fpg_hyperlink/tfpghyperlink.text.html - TextColor fpg_hyperlink/tfpghyperlink.textcolor.html - URL fpg_hyperlink/tfpghyperlink.url.html - OnClick fpg_hyperlink/tfpghyperlink.onclick.html - fpg_ColorMapping fpg_colormapping/index.html - RGBToHSV fpg_colormapping/rgbtohsv.html - HSVToRGB fpg_colormapping/hsvtorgb.html - fpg_ColorWheel fpg_colorwheel/index.html - TfpgColorWheel fpg_colorwheel/tfpgcolorwheel.html - FValueBar fpg_colorwheel/tfpgcolorwheel.fvaluebar.html - FHue fpg_colorwheel/tfpgcolorwheel.fhue.html - FSaturation fpg_colorwheel/tfpgcolorwheel.fsaturation.html - FMarginWidth fpg_colorwheel/tfpgcolorwheel.fmarginwidth.html - FCursorSize fpg_colorwheel/tfpgcolorwheel.fcursorsize.html - FWhiteAreaPercent fpg_colorwheel/tfpgcolorwheel.fwhiteareapercent.html - FOnChange fpg_colorwheel/tfpgcolorwheel.fonchange.html - FImage fpg_colorwheel/tfpgcolorwheel.fimage.html - HSFromPoint fpg_colorwheel/tfpgcolorwheel.hsfrompoint.html - DrawCursor fpg_colorwheel/tfpgcolorwheel.drawcursor.html - SetMarginWidth fpg_colorwheel/tfpgcolorwheel.setmarginwidth.html - SetCursorSize fpg_colorwheel/tfpgcolorwheel.setcursorsize.html - SetValueBar fpg_colorwheel/tfpgcolorwheel.setvaluebar.html - SetWhiteAreaPercent fpg_colorwheel/tfpgcolorwheel.setwhiteareapercent.html - Notification fpg_colorwheel/tfpgcolorwheel.notification.html - DrawWidth fpg_colorwheel/tfpgcolorwheel.drawwidth.html - DrawHeight fpg_colorwheel/tfpgcolorwheel.drawheight.html - Change fpg_colorwheel/tfpgcolorwheel.change.html - HandlePaint fpg_colorwheel/tfpgcolorwheel.handlepaint.html - HandleLMouseDown fpg_colorwheel/tfpgcolorwheel.handlelmousedown.html - HandleMouseMove fpg_colorwheel/tfpgcolorwheel.handlemousemove.html - HandleLMouseUp fpg_colorwheel/tfpgcolorwheel.handlelmouseup.html - Create fpg_colorwheel/tfpgcolorwheel.create.html - Destroy fpg_colorwheel/tfpgcolorwheel.destroy.html - Hue fpg_colorwheel/tfpgcolorwheel.hue.html - Saturation fpg_colorwheel/tfpgcolorwheel.saturation.html - SetSelectedColor fpg_colorwheel/tfpgcolorwheel.setselectedcolor.html - BackgroundColor fpg_colorwheel/tfpgcolorwheel.backgroundcolor.html - ValueBar fpg_colorwheel/tfpgcolorwheel.valuebar.html - MarginWidth fpg_colorwheel/tfpgcolorwheel.marginwidth.html - CursorSize fpg_colorwheel/tfpgcolorwheel.cursorsize.html - WhiteAreaPercent fpg_colorwheel/tfpgcolorwheel.whiteareapercent.html - OnChange fpg_colorwheel/tfpgcolorwheel.onchange.html - TfpgValueBar fpg_colorwheel/tfpgvaluebar.html - FColorWheel fpg_colorwheel/tfpgvaluebar.fcolorwheel.html - FHue fpg_colorwheel/tfpgvaluebar.fhue.html - FSaturation fpg_colorwheel/tfpgvaluebar.fsaturation.html - FValue fpg_colorwheel/tfpgvaluebar.fvalue.html - FMarginWidth fpg_colorwheel/tfpgvaluebar.fmarginwidth.html - FCursorHeight fpg_colorwheel/tfpgvaluebar.fcursorheight.html - FOnChange fpg_colorwheel/tfpgvaluebar.fonchange.html - DrawCursor fpg_colorwheel/tfpgvaluebar.drawcursor.html - SetMarginWidth fpg_colorwheel/tfpgvaluebar.setmarginwidth.html - SetValue fpg_colorwheel/tfpgvaluebar.setvalue.html - SetCursorHeight fpg_colorwheel/tfpgvaluebar.setcursorheight.html - GetSelectedColor fpg_colorwheel/tfpgvaluebar.getselectedcolor.html - Change fpg_colorwheel/tfpgvaluebar.change.html - DrawWidth fpg_colorwheel/tfpgvaluebar.drawwidth.html - DrawHeight fpg_colorwheel/tfpgvaluebar.drawheight.html - ValueFromY fpg_colorwheel/tfpgvaluebar.valuefromy.html - DrawLine fpg_colorwheel/tfpgvaluebar.drawline.html - HandlePaint fpg_colorwheel/tfpgvaluebar.handlepaint.html - HandleLMouseDown fpg_colorwheel/tfpgvaluebar.handlelmousedown.html - HandleMouseMove fpg_colorwheel/tfpgvaluebar.handlemousemove.html - HandleLMouseUp fpg_colorwheel/tfpgvaluebar.handlelmouseup.html - Create fpg_colorwheel/tfpgvaluebar.create.html - SetHS fpg_colorwheel/tfpgvaluebar.seths.html - BackgroundColor fpg_colorwheel/tfpgvaluebar.backgroundcolor.html - Value fpg_colorwheel/tfpgvaluebar.value.html - SelectedColor fpg_colorwheel/tfpgvaluebar.selectedcolor.html - MarginWidth fpg_colorwheel/tfpgvaluebar.marginwidth.html - CursorHeight fpg_colorwheel/tfpgvaluebar.cursorheight.html - OnChange fpg_colorwheel/tfpgvaluebar.onchange.html - -:classes -#GUI.fpg_dialogs.TfpgMessageBox TfpgForm -1VFLines -1VFFont -1VFTextY -1VFLineHeight -1VFMaxLineWidth -1VFButton -1VFCentreText -2MHandleKeyPress -2MHandlePaint -2MHandleShow -3MCreate -3MDestroy -3MSetMessage -3PCentreText rw -#GUI.fpg_dialogs.TfpgBaseDialog TfpgForm -2VFSpacing -2VFDefaultButtonWidth -2VbtnOK -2VbtnCancel -2MbtnOKClick -2MbtnCancelClick -2MHandleKeyPress -2MSetupCaptions -3MCreate -#GUI.fpg_dialogs.TfpgFontSelectDialog #GUI.fpg_dialogs.TfpgBaseDialog -1VFSampleText -1VFMode -1VlblLabel1 -1VlblTypeface -1VlblSize -1VlblLabel4 -1VlblLabel5 -1VlbCollection -1VlbFaces -1VlbSize -1VcbBold -1VcbItalic -1VcbUnderline -1VcbAntiAlias -1VmemSample -1MOnCollectionChanged -1MOnParamChange -1MOnSameTextChanged -1MCreateFontList -1MCreateFontAliasList -1MSetupUI -2MGetFontDesc -2MSetFontDesc -2MSetupCaptions -3MCreate -3MSetSampleText -#GUI.fpg_dialogs.TfpgFileDialog #GUI.fpg_dialogs.TfpgBaseDialog -1VchlDir -1Vgrid -1VbtnUpDir -1VbtnDirNew -1VbtnShowHidden -1VpnlFileInfo -1VedFilename -1VchlFilter -1Vlb1 -1Vlb2 -1VFOpenMode -1VFFilterList -1VFFilter -1MSetFilter -1MGetFontDesc -1MGetShowHidden -1MSetFontDesc -1MSetShowHidden -1MListChanged -1MGridDblClicked -1MInitializeComponents -1MProcessFilterString -1MGetFileFilter -1MFilterChange -1MDirChange -1MUpDirClick -1MbtnDirNewClicked -1MedFilenameChanged -1MUpdateButtonState -1MHighlightFile -2MHandleKeyPress -2MbtnOKClick -2MSetCurrentDirectory -3VFileName -3MCreate -3MDestroy -3MRunOpenFile -3MRunSaveFile -3PFilter rw -3PFontDesc rw -3PShowHidden rw -#GUI.fpg_dialogs.TfpgMessageDialog TfpgForm -1VFInformativeText -1VFText -1VFButtons -1VFDefaultButton -1VFDialogType -1VFButtonList -1VFMaxLineWidth -1VFFont -1VFTextY -1VFLineHeight -1MGetInformativeText -1MSetButtons -1MSetDefaultButton -1MSetInformativeText -1MSetText -1MpnlIconPaint -1MPrepareIcon -1MPrepareText -1MPrepareButtons -2MSetWindowTitle -2MHandlePaint -2MHandleShow -2MHandleKeyPress -2MPrepareLayout -3VlblName1 -3VpnlIcon -3MCreate -3MDestroy -3MAfterCreate -3MAbout -3MAboutFPGui -3MCritical -3MInformation -3MQuestion -3MWarning -3PInformativeText rw -3PText rw -3PButtons rw -3PDefaultButton rw -3PDialogType r -#GUI.fpg_dialogs.TfpgNewDirDialog #GUI.fpg_dialogs.TfpgBaseDialog -1VlblTitle -1VedDirectory -1MGetDirectory -3MCreate -3PDirectory r -#GUI.fpg_dialogs.TfpgPromptUserDialog #GUI.fpg_dialogs.TfpgBaseDialog -1VlblTitle -1VlblTitlePw -1VedUserID -1VedPassword -1MGetUserID -1MGetUserPassword -3MCreate -3MAuthenticate -3MWiggle -3PUserID r -3PPassword r -#GUI.fpg_dialogs.TfpgPromptUserDbDialog #GUI.fpg_dialogs.TfpgPromptUserDialog -1VlblDatabases -2VaStringList -2VcbDatabases -2MPopulateComboDb -3MCreate -3MDestroy -#GUI.fpg_dialogs.TfpgSelectDirDialog #GUI.fpg_dialogs.TfpgBaseDialog -1Vtv -1VFRootDir -1VFShowHidden -1MGetAbsolutePath -1MInitializeTreeview -1MSetRootDir -1MAddDirectories -1MNodeExpanded -3MCreate -3MAfterCreate -3MSelectedDir -3PRootDirectory rw -#GUI.fpg_dialogs.TCharMapForm TfpgForm -1VStringGrid1 -1VButton1 -1VlblCharInfo -1VedText -1VlblText -1VpnlChar -1MFormShow -1MStringGrid1FocusChange -1MStringGrid1DrawCell -1MStringGrid1CanSelectCell -1MStringGrid1DoubleClick -1MFillCharMap -1MButton1Clicked -1MGetNewText -3MAfterCreate -3PNewText r -#GUI.fpg_hyperlink.TfpgHyperlink TfpgCustomLabel -1VfHotTrackColor -1VfOldColor -1VfOldFont -1VfHTFont -1VfUrl -1MSetHotTrackColor -1MSetHotTrackFont -1MSetURL -2MHandleMouseEnter -2MHandleMouseExit -2MHandleLMouseDown -3MCreate -3MGoHyperLink -4PAutosize -4PFontDesc -4PHotTrackColor rw -4PHotTrackFont rw -4PText -4PTextColor -4PURL rw -4POnClick -#GUI.fpg_ColorWheel.TfpgColorWheel #CoreLib.fpg_widget.TfpgWidget -2VFValueBar -2VFHue -2VFSaturation -2VFMarginWidth -2VFCursorSize -2VFWhiteAreaPercent -2VFOnChange -2VFImage -2MHSFromPoint -2MDrawCursor -2MSetMarginWidth -2MSetCursorSize -2MSetValueBar -2MSetWhiteAreaPercent -2MNotification -2MDrawWidth -2MDrawHeight -2MChange -2MHandlePaint -2MHandleLMouseDown -2MHandleMouseMove -2MHandleLMouseUp -3MCreate -3MDestroy -3PHue r -3PSaturation r -3MSetSelectedColor -4PBackgroundColor -4PValueBar rw -4PMarginWidth rw -4PCursorSize rw -4PWhiteAreaPercent rw -4POnChange rw -#GUI.fpg_ColorWheel.TfpgValueBar #CoreLib.fpg_widget.TfpgWidget -2VFColorWheel -2VFHue -2VFSaturation -2VFValue -2VFMarginWidth -2VFCursorHeight -2VFOnChange -2MDrawCursor -2MSetMarginWidth -2MSetValue -2MSetCursorHeight -2MGetSelectedColor -2MChange -2MDrawWidth -2MDrawHeight -2MValueFromY -2MDrawLine -2MHandlePaint -2MHandleLMouseDown -2MHandleMouseMove -2MHandleLMouseUp -3MCreate -3MSetHS -4PBackgroundColor -4PValue rw -4PSelectedColor r -4PMarginWidth rw -4PCursorHeight rw -4POnChange rw diff --git a/docs/html/gui/fpdoc.css b/docs/html/gui/fpdoc.css deleted file mode 100644 index 5314232d..00000000 --- a/docs/html/gui/fpdoc.css +++ /dev/null @@ -1,129 +0,0 @@ -/* - $Id$ - - Default style sheet for FPDoc reference documentation - by Sebastian Guenther, sg@freepascal.org - - 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 -} - -/* 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 -} diff --git a/docs/html/index.html b/docs/html/index.html deleted file mode 100644 index 9d1678b9..00000000 --- a/docs/html/index.html +++ /dev/null @@ -1,40 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html> -<head> - <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> - <title>fpGUI Class Documentation</title> - <link rel="stylesheet" href="fpdoc.css" type="text/css"> -</head> -<body> - -<table class="bar" width="100%" border="0" cellpadding="4" cellspacing="0"> - <tr> - <td align="right"><span class="bartitle">fpGUI Class Documentation</span></td> - </tr> -</table> - -<h1>Available fpGUI packages</h1> -<p></p> -<!-- <h2>Units</h2> --> -<table cellpadding="0" cellspacing="0"> - <tr> - <td valign="top"><p><tt><span class="code"><a href="corelib/index.html">Corelib</a></span></tt></p></td> - <td><p> </p></td> - <td><p class="cmt">Graphics library (back-end) used in fpGUI to do all the drawing.</p></td> - </tr> - <tr> - <td valign="top" width="150"><p><tt><span class="code"><a href="gui/index.html">GUI</a></span></tt></p></td> - <td><p> </p></td> - <td><p class="cmt">All widget set related units.</p></td> - </tr> -<!-- - <tr> - <td valign="top"><p><tt><span class="code"><a href="img/index.html">IMG</a>IMG</span></tt></p></td> - <td><p> </p></td> - <td><p class="cmt">Image handling units. An extension to the GFX package.</p></td> - </tr> ---> -</table> - -</body> -</html> diff --git a/docs/html/search.html b/docs/html/search.html deleted file mode 100644 index d5cd8c0e..00000000 --- a/docs/html/search.html +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> -<html> -<head> -<link rel="StyleSheet" type="text/css" href="fpdoc.css"> -<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> -<title>Search the HTML documentation</title> -<script language="JavaScript1.3" type="text/javascript" src="tip_form.js"></script> -</head> - -<body class="navigationframe"> - -<h2>Search the documentation</h2> -<table class="navigation wide_list"> - <tr><td><form name="tip_Form" onsubmit="search_form(tip_Form);return false"> - <input type="text" id="search_text" name="d"> - <input type="submit" id="search_submit_button" value="Search"> - </form> - </td></tr> -</table> - -</body> -</html> diff --git a/docs/html/tip_form.js b/docs/html/tip_form.js deleted file mode 100644 index 567690ce..00000000 --- a/docs/html/tip_form.js +++ /dev/null @@ -1,19 +0,0 @@ -// Tipue 1.63 (modified for pasdoc) - - -// ---------- script properties ---------- - - -var results_location = "_tipue_results.html"; - - -// ---------- end of script properties ---------- - - -function search_form(tip_Form) { - if (tip_Form.d.value.length > 0) { - document.cookie = 'tid=' + escape(tip_Form.d.value) + '; path=/'; - document.cookie = 'tin=0; path=/'; - parent.content.location.href = results_location; - } -} diff --git a/docs/html/tip_search.js b/docs/html/tip_search.js deleted file mode 100644 index 7b6f30f5..00000000 --- a/docs/html/tip_search.js +++ /dev/null @@ -1,357 +0,0 @@ -// Tipue 1.63 (modified for pasdoc) - - -// ---------- script properties ---------- - - -var results_location = "_tipue_results.html"; -var return_results = 10; -var include_num = 1; -var bold_query = 0; -var include_url = 0; - - -// ---------- end of script properties ---------- - - -var cookies = document.cookie; -var tp = cookies.indexOf('tid='); -var pn = cookies.indexOf('tin='); - -var lnf = 'Your search did not match any documents.<p>Make sure all keywords are spelled correctly.<br>Try different or more general keywords.'; -var lp = 'Previous '; -var ln = 'Next '; - -if (tp != -1) { - var st = tp + 4; - var en = cookies.indexOf(';', st); - if (en == -1) { - en = cookies.length; - } - var dit = cookies.substring(st, en); - dit = unescape(dit); -} -if (pn != -1) { - var st = pn + 4; - var en = cookies.indexOf(';', st); - if (en == -1) { - en = cookies.length; - } - var tn = cookies.substring(st, en); -} - -var od = dit; -var nr = return_results; -tn = parseInt(tn); -var nb = tn + nr; -var nc = 0; -var nd = 0; -var tr = new Array(); -var rt = new Array(); -var co = 0; -var tm = 0; - -if (dit.charAt(0) == '"' && dit.charAt(dit.length - 1) == '"') { - tm = 1; -} -var rn = dit.search(/ or /i); -if (rn >= 0) { - tm = 2; -} -rn = dit.search(/-/i); -if (rn >= 0 && tm != 1) { - rn = dit.search(/ /i); - if (rn != 0) { - dit = dit.replace(/-/gi, ' -'); - } -} -rn = dit.search(/ not /i); -if (rn >= 0 && tm != 1) { - dit = dit.replace(/ not /gi, ' -'); -} -rn = dit.search(/\+/i); -if (rn >= 0) { - rn = dit.search(/ /i); - if (rn != 0) { - dit = dit.replace(/\+/gi, ' +'); - } -} - -if (tm == 0) { - var woin = new Array(); - dit = dit.replace(/ and /gi, ' '); - var wt = dit.split(' '); - for (var a = 0; a < wt.length; a++) { - woin[a] = 0; - if (wt[a].charAt(0) == '-') { - woin[a] = 1; - } - } - for (var a = 0; a < wt.length; a++) { - wt[a] = wt[a].replace(/^\-|^\+/gi, ''); - } - a = 0; - for (var c = 0; c < s.length; c++) { - var es = s[c].split('^'); - var rk = 100; - if (es[5] == null) { - es[5] = '0'; - } - if (parseInt(es[5]) > 10) { - es[5] = '10'; - } - var pa = 0; - var nh = 0; - for (var i = 0; i < woin.length; i++) { - if (woin[i] == 0) { - nh++; - var nt = 0; - var pat = new RegExp(wt[i], 'i'); - rn = es[0].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - nt = 1; - } - rn = es[2].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - nt = 1; - } - rn = es[3].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - nt = 1; - } - if (nt == 1) { - pa++; - } - } - if (woin[i] == 1) { - var pat = new RegExp(wt[i], 'i'); - rn = es[0].search(pat); - if (rn >= 0) { - pa = 0; - } - rn = es[2].search(pat); - if (rn >= 0) { - pa = 0; - } - rn = es[3].search(pat); - if (rn >= 0) { - pa = 0; - } - } - } - if (pa == nh) { - tr[a] = rk + '^' + s[c]; - a++; - } - } - tr.sort(); - co = a; -} - -if (tm == 1) { - dit = dit.replace(/"/gi, ''); - var a = 0; - var pat = new RegExp(dit, 'i'); - for (var c = 0; c < s.length; c++) { - var es = s[c].split('^'); - var rk = 100; - if (es[5] == null) { - es[5] = '0'; - } - if (parseInt(es[5]) > 10) { - es[5] = '10'; - } - rn = es[0].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - } - rn = es[2].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - } - rn = es[3].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - } - if (rk < 100) { - tr[a] = rk + '^' + s[c]; - a++; - } - } - tr.sort(); - co = a; -} - -if (tm == 2) { - dit = dit.replace(/ or /gi, ' '); - var wt = dit.split(' '); - var a = 0; - for (var i = 0; i < wt.length; i++) { - var pat = new RegExp(wt[i], 'i'); - for (var c = 0; c < s.length; c++) { - var es = s[c].split('^'); - var rk = 100; - if (es[5] == null) { - es[5] = '0'; - } - if (parseInt(es[5]) > 10) { - es[5] = '10'; - } - var pa = 0; - var rn = es[0].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - if (rn >= 0) { - for (var e = 0; e < rt.length; e++) { - if (s[c] == rt[e]) { - pa = 1; - } - } - } - } - rn = es[2].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - if (rn >= 0) { - for (var e = 0; e < rt.length; e++) { - if (s[c] == rt[e]) { - pa = 1; - } - } - } - } - var rn = es[3].search(pat); - if (rn >= 0) { - rk = rk - 11; - rk = rk - parseInt(es[5]); - if (rn >= 0) { - for (var e = 0; e < rt.length; e++) { - if (s[c] == rt[e]) { - pa = 1; - } - } - } - } - if (rk < 100 && pa == 0) { - rt[a] = s[c]; - tr[a] = rk + '^' + s[c]; - a++; - co++; - } - } - } - tr.sort(); -} - -function write_cookie(nw) { - document.cookie = 'tid=' + escape(od) + '; path=/'; - document.cookie = 'tin=' + nw + '; path=/'; -} - - -// ---------- External references ---------- - - -var tip_Num = co; - -function tip_query() { - if (od != 'undefined' && od != null) document.tip_Form.d.value = od; -} - -function tip_num() { - document.write(co); -} - -function tip_out() { - if (co == 0) { - document.write(lnf); - return; - } - if (tn + nr > co) { - nd = co; - } else { - nd = tn + nr; - } - for (var a = tn; a < nd; a++) { - var os = tr[a].split('^'); - if (os[5] == null) { - os[5] = '0'; - } - if (bold_query == 1 && tm == 0) { - for (var i = 0; i < wt.length; i++) { - var lw = wt[i].length; - var tw = new RegExp(wt[i], 'i'); - rn = os[3].search(tw); - if (rn >= 0) { - var o1 = os[3].slice(0, rn); - var o2 = os[3].slice(rn, rn + lw); - var o3 = os[3].slice(rn + lw); - os[3] = o1 + '<b>' + o2 + '</b>' + o3; - } - } - } - if (bold_query == 1 && tm == 1) { - var lw = dit.length; - var tw = new RegExp(dit, 'i'); - rn = os[3].search(tw); - if (rn >= 0) { - var o1 = os[3].slice(0, rn); - var o2 = os[3].slice(rn, rn + lw); - var o3 = os[3].slice(rn + lw); - os[3] = o1 + '<b>' + o2 + '</b>' + o3; - } - } - if (include_num == 1) { - document.write(a + 1, '. '); - } - if (os[5] == '0') { - document.write('<a href="', os[2], '">', os[1], '</a>'); - } - if (os[5] == '1') { - document.write('<a href="', os[2], '" target="_blank">', os[1], '</a>'); - } - if (os[5] != '0' && os[5] != '1') { - document.write('<a href="', os[2], '" target="', os[5], '">', os[1], '</a>'); - } - if (os[3].length > 1) { - document.write('<br>', os[3]); - } - if (include_url == 1) { - if (os[5] == '0') { - document.write('<br><a href="', os[2], '">', os[2], '</a><p>'); - } - if (os[5] == '1') { - document.write('<br><a href="', os[2], '" target="_blank">', os[2], '</a><p>'); - } - if (os[5] != '0' && os[5] != '1') { - document.write('<br><a href="', os[2], '" target="', os[5], '">', os[2], '</a><p>'); - } - } else { - document.write('<p>'); - } - } - if (co > nr) { - nc = co - nb; - if (nc > nr) { - nc = nr; - } - document.write('<p>'); - } - if (tn > 1) { - document.write('<a href="', results_location, '" onclick="write_cookie(', tn - nr, ')">', lp, nr, '</a> '); - } - if (nc > 0) { - document.write('<a href="', results_location, '" onclick="write_cookie(', tn + nr, ')">', ln, nc, '</a>'); - } -} diff --git a/docs/html/tipue_b1.png b/docs/html/tipue_b1.png Binary files differdeleted file mode 100644 index 9d85c433..00000000 --- a/docs/html/tipue_b1.png +++ /dev/null diff --git a/docs/manifest.xml b/docs/manifest.xml new file mode 100644 index 00000000..d89f8ec5 --- /dev/null +++ b/docs/manifest.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<packages> +<package name="fpgui"> + <version major="0" minor="6" micro="3" build="0"/> + <filename>fpgui-0.6.3-0.zip</filename> + <author>Graeme Geldenhuys</author> + <license>Modified LGPL</license> + <email>graemeg@gmail.com</email> + <description>fpGUI Toolkit - a custom written GUI toolkit for Free Pascal.</description> + <dependencies> + <dependency> + <package packagename="rtl"/> + </dependency> + </dependencies> +</package> +</packages> diff --git a/docs/readme.txt b/docs/readme.txt deleted file mode 100644 index 9fb00bb3..00000000 --- a/docs/readme.txt +++ /dev/null @@ -1,42 +0,0 @@ - -fpGUI information -================= - This version of fpGUI is based on a implementation where every - widget has a window handle. In other words every widget is actually - an embedded window in the Form (yet another window). - - Revision 127 was the last revision which still had the old design - one - handle per Form. - It has been tagged in SubVersion as /tags/single_handle_fpgui - - From revision 227, the new design (multi-handle implementation) has - become the new default implementation of fpGUI. It was a complete - rewrite of the code. - - - -To install FPC under Debian/Ubuntu -================================== - Select the fpc.deb metapackage, which depends on a number of sub-packages - containing the compiler, the units and so on. The 'libc' unit provided by - FPC is included in the fp-units-i386.deb package, which is however marked - as "deprecated" by the Ubuntu package manager and is therefore *not* - installed by default using fpc.deb. - - The following command will set up FPC under Ubuntu in order to be used with - fpGUI: - - sudo apt-get install fpc fp-units-i386 - - - -How to compile fpGUI -==================== - Please see the readme.txt file in the "src" directory. - - - ------ - Graeme Geldenhuys - - diff --git a/docs/tipue/tipue_data.lpr b/docs/tipue/tipue_data.lpr deleted file mode 100644 index 2910f24c..00000000 --- a/docs/tipue/tipue_data.lpr +++ /dev/null @@ -1,203 +0,0 @@ -program tipue_data; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Classes, SysUtils; - -type - TContentParser = class(TObject) - private - FList: TStringList; - index: integer; - procedure ParseCntFile(AFilename: string); - procedure WriteDataFile; - function ExtractDescription(AFilename: string): string; - public - constructor Create; - destructor Destroy; override; - procedure Run; - end; - - -function tiNumToken(const AValue, AToken : string): integer; -var - i, iCount : integer; - lsValue : string; -begin - Result := 0; - if AValue = '' then - Exit; //==> - - iCount := 0; - lsValue := AValue; - i := pos(AToken, lsValue); - while i <> 0 do begin - delete(lsValue, i, length(AToken)); - inc(iCount); - i := pos(AToken, lsValue); - end; - Result := iCount + 1; -end; - -function tiToken(const AValue, AToken: string; const APos: integer): string; -var - i, iCount, iNumToken: integer; - lsValue: string; -begin - result := ''; - - iNumToken := tiNumToken(AValue, AToken); - if APos = 1 then begin - if pos(AToken, AValue) = 0 then result := AValue - else result := copy(AValue, 1, pos(AToken, AValue)-1); - end - else if (iNumToken < APos-1) or (APos<1) then begin - result := ''; - end - else begin - - { Remove leading blocks } - iCount := 1; - lsValue := AValue; - i := pos(AToken, lsValue); - while (i<>0) and (iCount<APos) do begin - delete(lsValue, 1, i + length(AToken) - 1); - inc(iCount); - i := pos(AToken, lsValue); - end; - - if (i=0) and (iCount=APos) then result := lsValue - else if (i=0) and (iCount<>APos) then - result := '' - else - result := copy(lsValue, 1, i-1); - end; -end; - -function tiGetTickCount: Cardinal; -begin - Result := Cardinal(Trunc(Now * 24 * 60 * 60 * 1000)); -end; - - -{ TContentParser } - -procedure TContentParser.ParseCntFile(AFilename: string); -const - cLine = 's[%d] = "%s^%s^%s^%s^0"'; -var - sl: TStringList; - l: integer; - s: string; - prefix: string; - desc: string; -begin - s := '#'; - sl := TStringList.Create; - try - sl.LoadFromFile(AFilename); - l := sl.IndexOf(':link tree'); - while (s <> '') or (s <> ':classes') do - begin -// writeln(' prosessing.... ', s); - if (s = '') or (s =':classes') then - break - else if s[1] = '#' then - begin - delete(s, 1, 1); - prefix := lowercase(tiToken(s, ' ', 1)) + PathDelim; - end - else - begin - desc := ExtractDescription(prefix + tiToken(trim(s), ' ', 2)); - FList.Add(Format(cLine, [ - index, // Array element number - tiToken(trim(s), ' ', 1), // Title - prefix + tiToken(trim(s), ' ', 2), // URL - desc, // Display Description - desc // Searchable Description - ])); - inc(index); - end; - - if l+1 < sl.Count then - begin - inc(l); - s := trim(sl[l]); - end - else - break; - end; { while } - finally - sl.Free; - end; -end; - -procedure TContentParser.WriteDataFile; -begin - FList.Insert(0, 'var s = new Array()'); - FList.Insert(1, ''); - FList.SaveToFile('tip_data.js'); -end; - -function TContentParser.ExtractDescription(AFilename: string): string; -var - sl: TStringList; - idx: integer; - s: string; -begin - sl := TStringList.Create; - try - sl.LoadFromFile('./' + AFilename); - idx := sl.IndexOf('<h2>Declaration</h2>') -1; - if idx >= 0 then - begin - s := Copy(sl[idx], 4, Length(sl[idx]) -8); - Result := s; - end - else - Result := ''; - except - Result := ''; - end; - sl.Free; -end; - -constructor TContentParser.Create; -begin - FList := TStringList.Create; - index := 0; -end; - -destructor TContentParser.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -procedure TContentParser.Run; -begin - ParseCntFile('./corelib.cnt'); - ParseCntFile('./gui.cnt'); - WriteDataFile; -end; - - -var - p: TContentParser; - start: TDateTime; -begin - p := TContentParser.Create; - try - start := Now; - p.Run; - writeln('Data processed in ', FormatDateTime('ss.zzz', Now - start), ' seconds.'); - finally - p.Free; - end; -end. - diff --git a/docs/xml/corelib/fpg_base.xml b/docs/xml/corelib/fpg_base.xml index 3a2600b8..be47e910 100644 --- a/docs/xml/corelib/fpg_base.xml +++ b/docs/xml/corelib/fpg_base.xml @@ -1,5445 +1,5547 @@ -<?xml version="1.0"?> -<fpdoc-descriptions> - <package name="CoreLib"> - <!-- - ==================================================================== - gfxbase - ==================================================================== ---> - <module name="fpg_base"> - <short>The base unit and starting point of fpGUI</short> - <descr> - <p>This unit contains all the abstract classes for the CoreLib code -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 -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 -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 -operating system. -</p> - <p>The <var>gfxbase</var> unit also contains definitions of many useful color -constants. It defines the standard predefined Delphi colors (like clRed, -clMagenta etc.), the 140 websafe 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/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TRGBTriple.Red"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TRGBTriple.Green"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TRGBTriple.Blue"> - <short/> - <descr/> - <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 -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> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowType.wtModalForm"> - <short>This windows is the same as <link id="TWindowType.wtWindow">wtWindow</link>, -but grabs the input focus until it has closed.</short> - </element> - <!-- enumeration value Visibility: default --> - <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.</short> - </element> - <!-- enumeration type Visibility: default --> - <element name="TWindowAttribute"> - <short>An enum types defining extra attributes of a window.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowAttribute.waSizeable"> - <short>If this attribute is set, the window will be resizeable by the user.</short> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowAttribute.waAutoPos"> - <short>If this attribute is set, the underlying window manager will decide where -the window will be placed on the screen it it becomes visible for the first time.</short> - </element> - <!-- enumeration value Visibility: default --> - <element name="TWindowAttribute.waScreenCenterPos"> - <short>If this attribute is set, the window will be centred on the screen when -it is shown for the first time.</short> - </element> - <!-- set type Visibility: default --> - <element name="TWindowAttributes"> - <short>A set of TWindowAttribute types.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration type Visibility: default --> - <element name="TMouseCursor"> - <short>Enum types of the available mouse cursor shapes.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcDefault"> - <short>Normally the default arrow cursor.</short> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcArrow"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcCross"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcIBeam"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeEW"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeNS"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeNWSE"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeNESW"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeSWNE"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcSizeSENW"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcMove"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TMouseCursor.mcHourGlass"> - <short>Normally a hourglass or watch representing a busy state.</short> - </element> - <!-- enumeration type Visibility: default --> - <element name="TGradientDirection"> - <short>Enum types defining how a gradient must be painted</short> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TGradientDirection.gdVertical"> - <short>Defines that the gradient must be painted vertically.</short> - </element> - <!-- enumeration value Visibility: default --> - <element name="TGradientDirection.gdHorizontal"> - <short>Defines that the gradient must be painted horizontally.</short> - </element> - <!-- enumeration type Visibility: default --> - <element name="TClipboardKeyType"> - <short>Represents the clipboard function being triggered by some keyboard key combination.</short> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TClipboardKeyType.ckNone"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TClipboardKeyType.ckCopy"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TClipboardKeyType.ckPaste"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TClipboardKeyType.ckCut"> - <short/> - </element> - <!-- constant Visibility: default --> - <element name="MOUSE_LEFT"> - <short>Constant representing the left mouse button.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="MOUSE_RIGHT"> - <short>Constant representing the right mouse button.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="MOUSE_MIDDLE"> - <short>Constant representing the middle mouse button.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_PAINT"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_ACTIVATE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_DEACTIVATE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_KEYPRESS"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_KEYRELEASE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_KEYCHAR"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOUSEDOWN"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOUSEUP"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOUSEMOVE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_DOUBLECLICK"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOUSEENTER"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOUSEEXIT"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_CLOSE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_SCROLL"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_RESIZE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_MOVE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_POPUPCLOSE"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPGM_KILLME"> - <short>Platform independent messages used by fpGUI.</short> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNul"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyBackSpace"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyTab"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyLinefeed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyReturn"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyEnter"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyEscape"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDelete"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySpace"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyVoid"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyBreak"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyScrollForw"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyScrollBack"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyBoot"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCompose"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySAK"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyUndo"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyRedo"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMenu"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCancel"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPrintScreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyExecute"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyFind"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyBegin"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyClear"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyInsert"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySelect"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMacro"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHelp"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDo"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPause"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyStop"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySysRq"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyModeSwitch"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyUp"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyLeft"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyRight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPrior"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPageUp"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNext"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPageDown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHome"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyEnd"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF0"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF3"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF4"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF5"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF6"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF7"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF8"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF9"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF10"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF11"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF12"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF13"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF14"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF15"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF16"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF17"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF18"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF19"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF20"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF21"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF22"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF23"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF24"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF25"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF26"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF27"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF28"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF29"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF30"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF31"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF32"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF33"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF34"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF35"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF36"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF37"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF38"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF39"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF40"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF41"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF42"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF43"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF44"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF45"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF46"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF47"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF48"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF49"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF50"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF51"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF52"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF53"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF54"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF55"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF56"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF57"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF58"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF59"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF60"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF61"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF62"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF63"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyF64"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP0"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP3"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP4"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP5"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP6"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP7"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP8"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyP9"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPA"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPB"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPC"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPD"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPE"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPPlus"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPMinus"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPSlash"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPAsterisk"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPStar"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPEqual"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPSeparator"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPDecimal"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPParenLeft"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPParenRight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPSpace"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPEnter"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPTab"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPPlusMinus"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPBegin"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF3"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF4"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF5"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF6"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF7"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF8"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPF9"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyShift"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCtrl"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAlt"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMeta"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySuper"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHyper"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAltGr"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCaps"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNum"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyScroll"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyShiftL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyShiftR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCtrlL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCtrlR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAltL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAltR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMetaL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMetaR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySuperL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySuperR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHyperL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHyperR"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyShiftLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCtrlLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAltLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMetaLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keySuperLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyHyperLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyAltGrLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCapsLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNumLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyScrollLock"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadRing"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadCaron"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadOgonek"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadIota"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadDoubleAcute"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadBreve"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadAboveDot"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadBelowDot"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadVoicedSound"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadSemiVoicedSound"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadAcute"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadCedilla"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadCircumflex"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadDiaeresis"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadGrave"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadTilde"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDeadMacron"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNIL"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyEcuSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyColonSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyCruzeiroSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyFFrancSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyLiraSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyMillSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNairaSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyPesetaSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyRupeeSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyWonSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyNewSheqelSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyDongSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="keyEuroSign"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="FPG_DEFAULT_FONT_DESC"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="UserNamedColorStart"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clAqua"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBlack"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCream"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDkGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clFuchsia"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLime"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLtGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMaroon"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clNavy"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOlive"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPurple"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSilver"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clTeal"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clWhite"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clYellow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clNone"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDefault"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMoneyGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSkyBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMedGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clWindowBackground"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBoxColor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clButtonFace"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clShadow1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clShadow2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clHilite1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clHilite2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clText1"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clText2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clText3"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clText4"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSelection"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSelectionText"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clInactiveSel"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clInactiveSelText"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clScrollBar"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clListBox"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGridLines"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGridHeader"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clWidgetFrame"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clInactiveWgFrame"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clTextCursor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clChoiceListBox"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clUnset"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMenuText"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMenuDisabled"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clAliceBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clAntiqueWhite"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clAquamarine"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clAzure"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBeige"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBisque"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBlanchedAlmond"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBlueViolet"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBrown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clBurlyWood"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCadetBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clChartreuse"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clChocolate"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCoral"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCornflowerBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCornsilk"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCrimson"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clCyan"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkCyan"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkGoldenrod"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkKhaki"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkMagenta"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkOliveGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkOrange"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkOrchid"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkSalmon"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkSeaGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkSlateBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkSlateGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkTurquoise"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDarkViolet"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDeepPink"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDeepSkyBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDimGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clDodgerBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clFireBrick"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clFloralWhite"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clForestGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGainsboro"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGhostWhite"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGold"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGoldenrod"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clGreenYellow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clHoneydew"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clHotPink"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clIndianRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clIndigo"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clIvory"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clKhaki"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLavender"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLavenderBlush"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLawnGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLemonChiffon"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightCoral"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightCyan"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightGoldenrodYellow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightGrey"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightPink"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightSalmon"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightSeaGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightSkyBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightSlateGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightSteelBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLightYellow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLimeGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clLinen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMagenta"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumAquamarine"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumOrchid"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumPurple"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumSeaGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumSlateBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumSpringGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumTurquoise"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMediumVioletRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMidnightBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMintCream"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMistyRose"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clMoccasin"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clNavajoWhite"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOldLace"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOliveDrab"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOrange"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOrangeRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clOrchid"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPaleGoldenrod"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPaleGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPaleTurquoise"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPaleVioletRed"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPaleBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPapayaWhip"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPeachPuff"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPeru"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPink"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPlum"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clPowderBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clRosyBrown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clRoyalBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSaddleBrown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSalmon"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSandyBrown"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSeaGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSeashell"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSienna"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSkyBlue2"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSlateBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSlateGray"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSnow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSpringGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clSteelBlue"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clTan"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clThistle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clTomato"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clTurquoise"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clViolet"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clWheat"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clWhiteSmoke"> - <short/> - <descr/> - <seealso/> - </element> - <!-- constant Visibility: default --> - <element name="clYellowGreen"> - <short/> - <descr/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgRect"> - <short>A rectangle structure used throughout fpGUI.</short> - <descr>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. -</descr> - <errors/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgRect.Top"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgRect.Left"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgRect.Width"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgRect.Height"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: default --> - <element name="TfpgRect.SetRect"> - <short>A convenience function to quickly set a rectangle structure.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetRect.aleft"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetRect.atop"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetRect.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetRect.aheight"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="TfpgRect.Bottom"> - <short>Calculates and returns the bottom position of the rectangle.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgRect.Bottom.Result"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="TfpgRect.Right"> - <short>Calculates and returns the Right most position of the rectangle.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgRect.Right.Result"> - <short/> - </element> - <!-- procedure Visibility: default --> - <element name="TfpgRect.SetBottom"> - <short>Sets the bottom value and recalculates the Height value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetBottom.Value"> - <short/> - </element> - <!-- procedure Visibility: default --> - <element name="TfpgRect.SetRight"> - <short>Sets the Right value and recalculates the Width value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgRect.SetRight.Value"> - <short/> - </element> - <!-- record type Visibility: default --> - <element name="TfpgMsgParmMouse"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmMouse.x"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmMouse.y"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmMouse.Buttons"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmMouse.shiftstate"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmMouse.delta"> - <short/> - <descr/> - <seealso/> - </element> - <!-- record type Visibility: default --> - <element name="TfpgMsgParmKeyboard"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmKeyboard.keycode"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmKeyboard.keychar"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMsgParmKeyboard.shiftstate"> - <short/> - <descr/> - <seealso/> - </element> - <!-- record type Visibility: default --> - <element name="TfpgMessageParams"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageParams.mouse"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageParams.keyboard"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageParams.rect"> - <short/> - <descr/> - <seealso/> - </element> - <!-- record type Visibility: default --> - <element name="TfpgMessageRec"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageRec.MsgCode"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageRec.Sender"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageRec.Dest"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: default --> - <element name="TfpgMessageRec.Params"> - <short/> - <descr/> - <seealso/> - </element> - <!-- pointer type Visibility: default --> - <element name="PfpgMessageRec"> - <short/> - <descr/> - <seealso/> - </element> - <!-- enumeration type Visibility: default --> - <element name="TfpgLineStyle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TfpgLineStyle.lsSolid"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TfpgLineStyle.lsDash"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TfpgLineStyle.lsDot"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TfpgLineStyle.lsDashDot"> - <short/> - </element> - <!-- enumeration value Visibility: default --> - <element name="TfpgLineStyle.lsDashDotDot"> - <short/> - </element> - <!-- object Visibility: default --> - <element name="TfpgWindowBase"> - <short>Abstract class use for representing a Window or Widget</short> - <descr>fpGUI is a <i>Windowed</i> toolkit. By that we mean that every component -or widget has a window handle. Widgets are essentially embedded windows without -titlebars or borders inside a main parent window. -</descr> - <errors/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgCanvasBase"> - <short>Abstract class used to represent a Canvas for painting</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgImageBase"> - <short>Abstract class used to represent a Image</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function Visibility: private --> - <element name="TfpgImageBase.GetColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgImageBase.GetColor.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.GetColor.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.GetColor.y"> - <short/> - </element> - <!-- procedure Visibility: private --> - <element name="TfpgImageBase.SetColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.SetColor.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.SetColor.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.SetColor.AValue"> - <short/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FHeight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FColorDepth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FMasked"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FImageData"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FImageDataSize"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FMaskData"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgImageBase.FMaskDataSize"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgImageBase.DoFreeImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgImageBase.DoInitImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImage.acolordepth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImage.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImage.aheight"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImage.aimgdata"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgImageBase.DoInitImageMask"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImageMask.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImageMask.aheight"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.DoInitImageMask.aimgdata"> - <short/> - </element> - <!-- constructor Visibility: public --> - <element name="TfpgImageBase.Create"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- destructor Visibility: public --> - <element name="TfpgImageBase.Destroy"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.Invert"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.FreeImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.AllocateImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.AllocateImage.acolordepth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.AllocateImage.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.AllocateImage.aheight"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.AllocateMask"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.CreateMaskFromSample"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.CreateMaskFromSample.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.CreateMaskFromSample.y"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgImageBase.UpdateImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.ImageData"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.ImageDataSize"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.MaskData"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.MaskDataSize"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.Width"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.Height"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.ColorDepth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.Masked"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgImageBase.Colors"> - <short/> - <descr/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.Colors.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgImageBase.Colors.y"> - <short/> - </element> - <!-- object Visibility: default --> - <element name="TfpgFontResourceBase"> - <short>Encapsulates the resources of a font</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontResourceBase.GetAscent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontResourceBase.GetAscent.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontResourceBase.GetDescent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontResourceBase.GetDescent.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontResourceBase.GetHeight"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontResourceBase.GetHeight.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontResourceBase.GetTextWidth"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontResourceBase.GetTextWidth.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgFontResourceBase.GetTextWidth.txt"> - <short/> - </element> - <!-- object Visibility: default --> - <element name="TfpgFontBase"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgFontBase.FFontDesc"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgFontBase.FFontRes"> - <short/> - <descr/> - <seealso/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontBase.TextWidth"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontBase.TextWidth.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgFontBase.TextWidth.txt"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontBase.Ascent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontBase.Ascent.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontBase.Descent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontBase.Descent.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgFontBase.Height"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgFontBase.Height.Result"> - <short/> - </element> - <!-- property Visibility: public --> - <element name="TfpgFontBase.FontDesc"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgFontBase.FontRes"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgFontBase.Handle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgCustomInterpolation"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgCustomInterpolation.FCanvas"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgCustomInterpolation.FImage"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCustomInterpolation.Initialize"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Initialize.AImage"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Initialize.ACanvas"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCustomInterpolation.Execute"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Execute.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Execute.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Execute.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCustomInterpolation.Execute.h"> - <short/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCustomInterpolation.Canvas"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCustomInterpolation.Image"> - <short/> - <descr/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgBaseInterpolation"> - <short>A abstract class representing a base Interpolation filter.</short> - <descr>This is used as the base class to implement Interpolation filters like -Gaussian, Sinc etc... These decendant filters are used in the -<link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> function. -</descr> - <errors/> - <seealso> - <link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> - </seealso> - </element> - <!-- variable Visibility: private --> - <element name="TfpgBaseInterpolation.xfactor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgBaseInterpolation.yfactor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgBaseInterpolation.xsupport"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgBaseInterpolation.ysupport"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgBaseInterpolation.tempimage"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: private --> - <element name="TfpgBaseInterpolation.Horizontal"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Horizontal.width"> - <short/> - </element> - <!-- procedure Visibility: private --> - <element name="TfpgBaseInterpolation.Vertical"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Vertical.dx"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Vertical.dy"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Vertical.width"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Vertical.height"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgBaseInterpolation.Execute"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Execute.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Execute.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Execute.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Execute.h"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgBaseInterpolation.Filter"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgBaseInterpolation.Filter.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgBaseInterpolation.Filter.x"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgBaseInterpolation.MaxSupport"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgBaseInterpolation.MaxSupport.Result"> - <short/> - </element> - <!-- destructor Visibility: public --> - <element name="TfpgBaseInterpolation.Destroy"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgMitchelInterpolation"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgMitchelInterpolation.Filter"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgMitchelInterpolation.Filter.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgMitchelInterpolation.Filter.x"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgMitchelInterpolation.MaxSupport"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgMitchelInterpolation.MaxSupport.Result"> - <short/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgCanvasBase.FFastDoubleBuffer"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgCanvasBase.FInterpolation"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: private --> - <element name="TfpgCanvasBase.SetInterpolation"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetInterpolation.AValue"> - <short/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FBufferedDraw"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FBeginDrawCount"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FWindow"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FColor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FTextColor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FLineWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FLineStyle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FFont"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgCanvasBase.FPersistentResources"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoSetFontRes"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetFontRes.fntres"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoSetTextColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetTextColor.cl"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoSetColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetColor.cl"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoSetLineStyle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetLineStyle.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetLineStyle.astyle"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoGetWinRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoGetWinRect.r"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoFillRectangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillRectangle.h"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoXORFillRectangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoXORFillRectangle.col"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoXORFillRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoXORFillRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoXORFillRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoXORFillRectangle.h"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoFillTriangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.x1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.y1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.x2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.y2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.x3"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillTriangle.y3"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoDrawRectangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawRectangle.h"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoDrawLine"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawLine.x1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawLine.y1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawLine.x2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawLine.y2"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoDrawImagePart"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.img"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.xi"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.yi"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawImagePart.h"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoDrawString"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawString.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawString.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawString.txt"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoSetClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoSetClipRect.ARect"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgCanvasBase.DoGetClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgCanvasBase.DoGetClipRect.Result"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoAddClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoAddClipRect.ARect"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoClearClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoBeginDraw"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoBeginDraw.awin"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoBeginDraw.buffered"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoPutBufferToScreen"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoPutBufferToScreen.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoPutBufferToScreen.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoPutBufferToScreen.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoPutBufferToScreen.h"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoEndDraw"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgCanvasBase.GetPixel"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgCanvasBase.GetPixel.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GetPixel.X"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GetPixel.Y"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.SetPixel"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetPixel.X"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetPixel.Y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetPixel.AValue"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoDrawArc"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.a1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoDrawArc.a2"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgCanvasBase.DoFillArc"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.a1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DoFillArc.a2"> - <short/> - </element> - <!-- constructor Visibility: public --> - <element name="TfpgCanvasBase.Create"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- destructor Visibility: public --> - <element name="TfpgCanvasBase.Destroy"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawRectangle"> - <short>Draws a rectangle.</short> - <descr> - <printshort id="TfpgCanvasBase.DrawRectangle"/> You can specify the size of the rectangle via X, Y, Width and Height parameters or via a TfpgRect parameter.</descr> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawRectangle.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawRectangle.r"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawLine"> - <short>Draws a line</short> - <descr> - <printshort id="TfpgCanvasbase.DrawLine"/>. This method draws a line from (x1,y1) to (x2,y2), but does not draw the last pixel. All supported backends follow the Microsoft API and doesn't draw the last pixel. This optimises consecutive lines being drawn without overlapping pixels.</descr> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawLine.x1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawLine.y1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawLine.x2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawLine.y2"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawImage"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImage.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImage.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImage.img"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawImagePart"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.img"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.xi"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.yi"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawImagePart.h"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawArc"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.a1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawArc.a2"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.StretchDraw"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.StretchDraw.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.StretchDraw.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.StretchDraw.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.StretchDraw.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.StretchDraw.ASource"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.CopyRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.CopyRect.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.CopyRect.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.CopyRect.ACanvas"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.CopyRect.SourceRect"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.DrawString"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawString.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawString.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.DrawString.txt"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.FillRectangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillRectangle.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillRectangle.r"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.FillTriangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.x1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.y1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.x2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.y2"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.x3"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillTriangle.y3"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.FillArc"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.a1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.FillArc.a2"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.GradientFill"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GradientFill.ARect"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GradientFill.AStart"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GradientFill.AStop"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GradientFill.ADirection"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.XORFillRectangle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.col"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.XORFillRectangle.r"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.SetClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetClipRect.ARect"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgCanvasBase.GetClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgCanvasBase.GetClipRect.Result"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.AddClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.AddClipRect.ARect"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.ClearClipRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.Clear"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.Clear.AColor"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.GetWinRect"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.GetWinRect.r"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.SetColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetColor.AColor"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.SetTextColor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetTextColor.AColor"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.SetLineStyle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetLineStyle.AWidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetLineStyle.AStyle"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.SetFont"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.SetFont.AFont"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.BeginDraw"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.BeginDraw.ABuffered"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.EndDraw"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.EndDraw.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.EndDraw.y"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.EndDraw.w"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.EndDraw.h"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.EndDraw.ARect"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgCanvasBase.FreeResources"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.Color"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.TextColor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.Font"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.Pixels"> - <short/> - <descr/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.Pixels.X"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgCanvasBase.Pixels.Y"> - <short/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.InterpolationFilter"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.FastDoubleBuffer"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.LineStyle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgCanvasBase.LineWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgWindowBase.FParent"> - <short/> - <descr/> - <seealso/> - </element> - <!-- procedure Visibility: private --> - <element name="TfpgWindowBase.SetMouseCursor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.SetMouseCursor.AValue"> - <short/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FMouseCursor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FWindowType"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FWindowAttributes"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FTop"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FLeft"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FHeight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FMinWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FMinHeight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgWindowBase.FCanvas"> - <short/> - <descr/> - <seealso/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgWindowBase.HandleIsValid"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.HandleIsValid.Result"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoUpdateWindowPosition"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoUpdateWindowPosition.aleft"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoUpdateWindowPosition.atop"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoUpdateWindowPosition.awidth"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoUpdateWindowPosition.aheight"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoAllocateWindowHandle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoAllocateWindowHandle.AParent"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoReleaseWindowHandle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoSetWindowVisible"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoSetWindowVisible.AValue"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoMoveWindow"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoMoveWindow.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoMoveWindow.y"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgWindowBase.DoWindowToScreen"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.DoWindowToScreen.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoWindowToScreen.ASource"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoWindowToScreen.AScreenPos"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoSetWindowTitle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.DoSetWindowTitle.ATitle"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.DoSetMouseCursor"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.SetParent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.SetParent.AValue"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgWindowBase.GetParent"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.GetParent.Result"> - <short/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgWindowBase.GetCanvas"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.GetCanvas.Result"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.AllocateWindowHandle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.ReleaseWindowHandle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.SetWindowTitle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.SetWindowTitle.ATitle"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.SetHeight"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.SetHeight.AValue"> - <short/> - </element> - <!-- procedure Visibility: protected --> - <element name="TfpgWindowBase.SetWidth"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.SetWidth.AValue"> - <short/> - </element> - <!-- constructor Visibility: public --> - <element name="TfpgWindowBase.Create"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.Create.AOwner"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.AfterConstruction"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.AdjustWindowStyle"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.SetWindowParameters"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function Visibility: public --> - <element name="TfpgWindowBase.Right"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.Right.Result"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgWindowBase.Bottom"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.Bottom.Result"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.UpdateWindowPosition"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.MoveWindow"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.MoveWindow.x"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.MoveWindow.y"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgWindowBase.WindowToScreen"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgWindowBase.WindowToScreen.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.WindowToScreen.ASource"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgWindowBase.WindowToScreen.AScreenPos"> - <short/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.CaptureMouse"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- procedure Visibility: public --> - <element name="TfpgWindowBase.ReleaseMouse"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.HasHandle"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.WindowType"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.WindowAttributes"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Left"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Top"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Width"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Height"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.MinWidth"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.MinHeight"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Canvas"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.Parent"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgWindowBase.MouseCursor"> - <short/> - <descr/> - <seealso/> - </element> - <!-- object Visibility: default --> - <element name="TfpgApplicationBase"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgApplicationBase.FMainForm"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgApplicationBase.FTerminated"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: private --> - <element name="TfpgApplicationBase.FTopModalForm"> - <short/> - <descr/> - <seealso/> - </element> - <!-- variable Visibility: protected --> - <element name="TfpgApplicationBase.FIsInitialized"> - <short/> - <descr/> - <seealso/> - </element> - <!-- function Visibility: protected --> - <element name="TfpgApplicationBase.DoGetFontFaceList"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgApplicationBase.DoGetFontFaceList.Result"> - <short/> - </element> - <!-- constructor Visibility: public --> - <element name="TfpgApplicationBase.Create"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="TfpgApplicationBase.Create.AParams"> - <short/> - </element> - <!-- function Visibility: public --> - <element name="TfpgApplicationBase.GetFontFaceList"> - <short/> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="TfpgApplicationBase.GetFontFaceList.Result"> - <short/> - </element> - <!-- property Visibility: public --> - <element name="TfpgApplicationBase.IsInitialized"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgApplicationBase.TopModalForm"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgApplicationBase.MainForm"> - <short/> - <descr/> - <seealso/> - </element> - <!-- property Visibility: public --> - <element name="TfpgApplicationBase.Terminated"> - <short/> - <descr/> - <seealso/> - </element> - <!-- function Visibility: default --> - <element name="KeycodeToText"> - <short>Returns the text representation of a keycode.</short> - <descr>This is mainly used for debugging, but could also be used for Menu Item keyboard -shortcuts etc. -</descr> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="KeycodeToText.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="KeycodeToText.AKey"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="KeycodeToText.AShiftState"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="CheckClipboardKey"> - <short>Detects if the pressed keys represent a Clipboard key shortcut</short> - <descr>Detects if the pressed keys represent a Clipboard key shortcut. If it does, it -returns the correct enum type detected. -</descr> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="CheckClipboardKey.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="CheckClipboardKey.AKey"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="CheckClipboardKey.AShiftstate"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgColorToRGBTriple"> - <short>Converts the TfpgColor to TRGBTriple type</short> - <descr>This function converts the given TfpgColor into a TRGBTriple type. -</descr> - <errors/> - <seealso> - <link id="TRGBTriple"/> - </seealso> - </element> - <!-- function result Visibility: default --> - <element name="fpgColorToRGBTriple.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgColorToRGBTriple.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="RGBTripleTofpgColor"> - <short>Converts the TRGBTriple to TfpgColor type</short> - <descr>This function converts the given TRGBTriple into a TfpgColor type. -</descr> - <errors/> - <seealso> - <link id="TRGBTriple"/> - </seealso> - </element> - <!-- function result Visibility: default --> - <element name="RGBTripleTofpgColor.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="RGBTripleTofpgColor.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgGetRed"> - <short>Returns the Red portion of a color value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="fpgGetRed.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetRed.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgGetGreen"> - <short>Returns the Green portion of a color value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="fpgGetGreen.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetGreen.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgGetBlue"> - <short>Returns the Blue portion of a color value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="fpgGetBlue.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetBlue.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgGetAlpha"> - <short>Returns the Alpha portion of a color value.</short> - <descr/> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="fpgGetAlpha.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetAlpha.AColor"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="fpgGetAvgColor"> - <short>Calculates the average color using the two supplied</short> - <descr>This function calculates and returns the average color by using AColor1 -and AColor2. The Alpha value also gets taken into account. -</descr> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="fpgGetAvgColor.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetAvgColor.AColor1"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="fpgGetAvgColor.AColor2"> - <short/> - </element> - <!-- function Visibility: default --> - <element name="PtInRect"> - <short>Returns true if APoint is inside ARect rectangle</short> - <descr>This function is used to detect if the point APoint is inside the given -rectangle ARect. If it is, the function returns True, otherwise False. -</descr> - <errors/> - <seealso/> - </element> - <!-- function result Visibility: default --> - <element name="PtInRect.Result"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="PtInRect.ARect"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="PtInRect.APoint"> - <short/> - </element> - <!-- procedure Visibility: default --> - <element name="SortRect"> - <short>Fixes the Top, Bottom and Left, Right to always represent a valid rectangle</short> - <descr>This function fixes a rectangle so that the Left point is always smaller than the -Right. And the Top is always smaller than the Bottom. -</descr> - <errors/> - <seealso/> - </element> - <!-- argument Visibility: default --> - <element name="SortRect.ARect"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="SortRect.left"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="SortRect.top"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="SortRect.right"> - <short/> - </element> - <!-- argument Visibility: default --> - <element name="SortRect.bottom"> - <short/> - </element> - <element name="TfpgCanvasBase.DrawLineClipped"> - <short>Draws a line inside a clip rectangle</short> - <descr> - <p> - <printshort id="TfpgCanvasBase.DrawLineClipped"/>. This procedure clips a line to the AClipRect boundaries and - then calls the DrawLine procedure with the clipped coordinates. If the line - lies completely outside of the clip boundary, then the Line routine is not - called. This procedure uses the well known Cohen-Sutherland line clipping - algorithm to clip each coordinate. -</p> - <p>Use this if you did not what to change the Canvas.ClipRegion for some reason. - 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> - </element> - </module> - <!-- gfxbase --> - </package> -</fpdoc-descriptions> +<?xml version="1.0"?>
+<fpdoc-descriptions>
+ <package name="fpGUI">
+ <!--
+ ====================================================================
+ gfxbase
+ ====================================================================
+-->
+ <module name="fpg_base">
+ <short>The base unit and starting point of fpGUI</short>
+ <descr>
+ <p>This unit contains all the abstract classes for the CoreLib code
+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
+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
+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
+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>This is now marked as "deprecated". Please use TFPColor instead.</descr>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TRGBTriple.Red">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TRGBTriple.Green">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TRGBTriple.Blue">
+ <short/>
+ <descr/>
+ <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
+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 <link id="TWindowType.wtWindow">wtWindow</link>, but grabs focus.</short>
+ <descr>This windows is the same as <link id="TWindowType.wtWindow">wtWindow</link>, but grabs the input focus until it has closed. This window normally doesn't appear in the taskbar.</descr>
+ </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>
+ <!-- enumeration type Visibility: default -->
+ <element name="TWindowAttribute">
+ <short>An enum types defining extra attributes of a window.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TWindowAttribute.waSizeable">
+ <short>If this attribute is set, the window will be resizeable by the user.</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TWindowAttribute.waAutoPos">
+ <short>If this attribute is set, the underlying window manager will decide where
+the window will be placed on the screen it it becomes visible for the first time.</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TWindowAttribute.waScreenCenterPos">
+ <short>If this attribute is set, the window will be centred on the screen when
+it is shown for the first time.</short>
+ </element>
+ <!-- set type Visibility: default -->
+ <element name="TWindowAttributes">
+ <short>A set of TWindowAttribute types.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration type Visibility: default -->
+ <element name="TMouseCursor">
+ <short>Enum types of the available mouse cursor shapes.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcDefault">
+ <short>Normally the default arrow cursor.</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcArrow">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcCross">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcIBeam">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeEW">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeNS">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeNWSE">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeNESW">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeSWNE">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcSizeSENW">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcMove">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TMouseCursor.mcHourGlass">
+ <short>Normally a hourglass or watch representing a busy state.</short>
+ </element>
+ <!-- enumeration type Visibility: default -->
+ <element name="TGradientDirection">
+ <short>Enum types defining how a gradient must be painted</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TGradientDirection.gdVertical">
+ <short>Defines that the gradient must be painted vertically.</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TGradientDirection.gdHorizontal">
+ <short>Defines that the gradient must be painted horizontally.</short>
+ </element>
+ <!-- enumeration type Visibility: default -->
+ <element name="TFileEntryType">
+ <short>Represents the type of entry found on the filesystem.</short>
+ <descr/>
+ <seealso>
+ <link id="TFileEntry"/>
+ </seealso>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TFileEntryType.etFile">
+ <short>Denotes a File type</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TFileEntryType.etDir">
+ <short>Denotes a Directory type</short>
+ </element>
+ <!-- enumeration type Visibility: default -->
+ <element name="TClipboardKeyType">
+ <short>Represents the clipboard function being triggered by some keyboard key combination.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TClipboardKeyType.ckNone">
+ <short>No clipboard action detected</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TClipboardKeyType.ckCopy">
+ <short>Copy to clipboard action detected</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TClipboardKeyType.ckPaste">
+ <short>Paste to clipboard action detected</short>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TClipboardKeyType.ckCut">
+ <short>Cut to clipboard action detected</short>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="MOUSE_LEFT">
+ <short>Constant representing the left mouse button.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="MOUSE_RIGHT">
+ <short>Constant representing the right mouse button.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="MOUSE_MIDDLE">
+ <short>Constant representing the middle mouse button.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_PAINT">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_ACTIVATE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_DEACTIVATE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_KEYPRESS">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_KEYRELEASE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_KEYCHAR">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOUSEDOWN">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOUSEUP">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOUSEMOVE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_DOUBLECLICK">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOUSEENTER">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOUSEEXIT">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_CLOSE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_SCROLL">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_RESIZE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_MOVE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_POPUPCLOSE">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPGM_KILLME">
+ <short>Platform independent messages used by fpGUI.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNul">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyBackSpace">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyTab">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyLinefeed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyReturn">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyEnter">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyEscape">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDelete">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySpace">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyVoid">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyBreak">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyScrollForw">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyScrollBack">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyBoot">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCompose">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySAK">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyUndo">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyRedo">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMenu">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCancel">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPrintScreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyExecute">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyFind">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyBegin">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyClear">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyInsert">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySelect">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMacro">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHelp">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDo">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPause">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyStop">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySysRq">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyModeSwitch">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyUp">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyLeft">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyRight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPrior">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPageUp">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNext">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPageDown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHome">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyEnd">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF0">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF3">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF4">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF5">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF6">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF7">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF8">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF9">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF10">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF11">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF12">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF13">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF14">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF15">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF16">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF17">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF18">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF19">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF20">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF21">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF22">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF23">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF24">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF25">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF26">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF27">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF28">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF29">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF30">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF31">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF32">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF33">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF34">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF35">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF36">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF37">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF38">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF39">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF40">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF41">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF42">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF43">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF44">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF45">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF46">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF47">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF48">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF49">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF50">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF51">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF52">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF53">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF54">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF55">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF56">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF57">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF58">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF59">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF60">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF61">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF62">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF63">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyF64">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP0">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP3">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP4">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP5">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP6">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP7">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP8">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyP9">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPA">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPB">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPC">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPD">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPE">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPPlus">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPMinus">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPSlash">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPAsterisk">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPStar">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPEqual">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPSeparator">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPDecimal">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPParenLeft">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPParenRight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPSpace">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPEnter">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPTab">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPPlusMinus">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPBegin">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF3">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF4">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF5">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF6">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF7">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF8">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPF9">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyShift">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCtrl">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAlt">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMeta">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySuper">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHyper">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAltGr">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCaps">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNum">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyScroll">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyShiftL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyShiftR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCtrlL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCtrlR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAltL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAltR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMetaL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMetaR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySuperL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySuperR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHyperL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHyperR">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyShiftLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCtrlLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAltLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMetaLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keySuperLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyHyperLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyAltGrLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCapsLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNumLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyScrollLock">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadRing">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadCaron">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadOgonek">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadIota">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadDoubleAcute">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadBreve">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadAboveDot">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadBelowDot">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadVoicedSound">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadSemiVoicedSound">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadAcute">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadCedilla">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadCircumflex">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadDiaeresis">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadGrave">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadTilde">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDeadMacron">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNIL">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyEcuSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyColonSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyCruzeiroSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyFFrancSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyLiraSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyMillSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNairaSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyPesetaSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyRupeeSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyWonSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyNewSheqelSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyDongSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="keyEuroSign">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="FPG_DEFAULT_FONT_DESC">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="UserNamedColorStart">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clAqua">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBlack">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCream">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDkGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clFuchsia">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLime">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLtGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMaroon">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clNavy">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOlive">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPurple">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSilver">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clTeal">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clWhite">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clYellow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clNone">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDefault">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMoneyGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSkyBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMedGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clWindowBackground">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBoxColor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clButtonFace">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clShadow1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clShadow2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clHilite1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clHilite2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clText1">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clText2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clText3">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clText4">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSelection">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSelectionText">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clInactiveSel">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clInactiveSelText">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clScrollBar">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clListBox">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGridLines">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGridHeader">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clWidgetFrame">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clInactiveWgFrame">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clTextCursor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clChoiceListBox">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clUnset">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMenuText">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMenuDisabled">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clAliceBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clAntiqueWhite">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clAquamarine">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clAzure">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBeige">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBisque">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBlanchedAlmond">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBlueViolet">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBrown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clBurlyWood">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCadetBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clChartreuse">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clChocolate">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCoral">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCornflowerBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCornsilk">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCrimson">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clCyan">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkCyan">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkGoldenrod">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkKhaki">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkMagenta">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkOliveGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkOrange">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkOrchid">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkSalmon">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkSeaGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkSlateBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkSlateGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkTurquoise">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDarkViolet">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDeepPink">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDeepSkyBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDimGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clDodgerBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clFireBrick">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clFloralWhite">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clForestGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGainsboro">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGhostWhite">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGold">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGoldenrod">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clGreenYellow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clHoneydew">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clHotPink">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clIndianRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clIndigo">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clIvory">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clKhaki">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLavender">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLavenderBlush">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLawnGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLemonChiffon">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightCoral">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightCyan">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightGoldenrodYellow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightGrey">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightPink">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightSalmon">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightSeaGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightSkyBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightSlateGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightSteelBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLightYellow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLimeGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clLinen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMagenta">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumAquamarine">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumOrchid">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumPurple">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumSeaGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumSlateBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumSpringGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumTurquoise">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMediumVioletRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMidnightBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMintCream">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMistyRose">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clMoccasin">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clNavajoWhite">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOldLace">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOliveDrab">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOrange">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOrangeRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clOrchid">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPaleGoldenrod">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPaleGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPaleTurquoise">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPaleVioletRed">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPaleBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPapayaWhip">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPeachPuff">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPeru">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPink">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPlum">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clPowderBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clRosyBrown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clRoyalBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSaddleBrown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSalmon">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSandyBrown">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSeaGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSeashell">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSienna">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSkyBlue2">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSlateBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSlateGray">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSnow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSpringGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clSteelBlue">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clTan">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clThistle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clTomato">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clTurquoise">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clViolet">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clWheat">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clWhiteSmoke">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- constant Visibility: default -->
+ <element name="clYellowGreen">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgRect">
+ <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
+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).
+</p>
+ <pre>.
+ 0 1
+ +---+---+---
+0 | x | |
+ +---+---+---
+1 | | |
+ +---+---+---
+2 | | |
+ +---+---+---
+ | | |
+</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>
+ <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>
+ <pre>.
+ 0 1
+ +---+---+---
+0 | x | x |
+ +---+---+---
+1 | x | x |
+ +---+---+---
+2 | | |
+ +---+---+---
+ | | |
+</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
+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.
+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
+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
+Spreadsheet program etc.
+</p>
+ <pre>.
+ 0 1 2
+0 +---+---+---
+ | x | |
+1 +---+---+---
+ | | |
+2 +---+---+---
+ | | |
+3 +---+---+---
+ | | |
+</pre>
+ </descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgRect.Top">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgRect.Left">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgRect.Width">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgRect.Height">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: default -->
+ <element name="TfpgRect.SetRect">
+ <short>A convenience function to quickly set a rectangle structure.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetRect.aleft">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetRect.atop">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetRect.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetRect.aheight">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="TfpgRect.Bottom">
+ <short>Calculates and returns the bottom position of the rectangle.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgRect.Bottom.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="TfpgRect.Right">
+ <short>Calculates and returns the Right most position of the rectangle.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgRect.Right.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: default -->
+ <element name="TfpgRect.SetBottom">
+ <short>Sets the bottom value and recalculates the Height value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetBottom.Value">
+ <short/>
+ </element>
+ <!-- procedure Visibility: default -->
+ <element name="TfpgRect.SetRight">
+ <short>Sets the Right value and recalculates the Width value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgRect.SetRight.Value">
+ <short/>
+ </element>
+ <!-- record type Visibility: default -->
+ <element name="TfpgMsgParmMouse">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmMouse.x">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmMouse.y">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmMouse.Buttons">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmMouse.shiftstate">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmMouse.delta">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- record type Visibility: default -->
+ <element name="TfpgMsgParmKeyboard">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmKeyboard.keycode">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmKeyboard.keychar">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMsgParmKeyboard.shiftstate">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- record type Visibility: default -->
+ <element name="TfpgMessageParams">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageParams.mouse">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageParams.keyboard">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageParams.rect">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- record type Visibility: default -->
+ <element name="TfpgMessageRec">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageRec.MsgCode">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageRec.Sender">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageRec.Dest">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: default -->
+ <element name="TfpgMessageRec.Params">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- pointer type Visibility: default -->
+ <element name="PfpgMessageRec">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration type Visibility: default -->
+ <element name="TfpgLineStyle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TfpgLineStyle.lsSolid">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TfpgLineStyle.lsDash">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TfpgLineStyle.lsDot">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TfpgLineStyle.lsDashDot">
+ <short/>
+ </element>
+ <!-- enumeration value Visibility: default -->
+ <element name="TfpgLineStyle.lsDashDotDot">
+ <short/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgWindowBase">
+ <short>Abstract class use for representing a Window or Widget</short>
+ <descr>fpGUI is a <i>Windowed</i> toolkit. By that we mean that every component
+or widget has a window handle. Widgets are essentially embedded windows without
+titlebars or borders inside a main parent window.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgCanvasBase">
+ <short>Abstract class used to represent a Canvas for painting</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgImageBase">
+ <short>Abstract class used to represent a Image</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: private -->
+ <element name="TfpgImageBase.GetColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgImageBase.GetColor.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.GetColor.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.GetColor.y">
+ <short/>
+ </element>
+ <!-- procedure Visibility: private -->
+ <element name="TfpgImageBase.SetColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.SetColor.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.SetColor.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.SetColor.AValue">
+ <short/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FHeight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FColorDepth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FMasked">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FImageData">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FImageDataSize">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FMaskData">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgImageBase.FMaskDataSize">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgImageBase.DoFreeImage">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgImageBase.DoInitImage">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImage.acolordepth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImage.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImage.aheight">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImage.aimgdata">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgImageBase.DoInitImageMask">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImageMask.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImageMask.aheight">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.DoInitImageMask.aimgdata">
+ <short/>
+ </element>
+ <!-- constructor Visibility: public -->
+ <element name="TfpgImageBase.Create">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- destructor Visibility: public -->
+ <element name="TfpgImageBase.Destroy">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.Invert">
+ <short>Inverts the Image</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.FreeImage">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.AllocateImage">
+ <short>Allocates OS resources for the Image</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.AllocateImage.acolordepth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.AllocateImage.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.AllocateImage.aheight">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.AllocateMask">
+ <short>Allocates OS resources for the Image Mask</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.CreateMaskFromSample">
+ <short>Creates a mask based on the sample point presented by X and Y parameters</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.CreateMaskFromSample.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.CreateMaskFromSample.y">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgImageBase.UpdateImage">
+ <short>Updates the internal image resources and OS resources from image data</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.ImageData">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.ImageDataSize">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.MaskData">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.MaskDataSize">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.Width">
+ <short>Width of the image</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.Height">
+ <short>Height of the image</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.ColorDepth">
+ <short>Color depth of the image. Currently 24/32-bit is all that is supported.</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.Masked">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgImageBase.Colors">
+ <short>Array property to access a specific color of the image based on X and Y co-ordinates</short>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.Colors.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgImageBase.Colors.y">
+ <short/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgFontResourceBase">
+ <short>Encapsulates the resources of a font</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontResourceBase.GetAscent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontResourceBase.GetAscent.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontResourceBase.GetDescent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontResourceBase.GetDescent.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontResourceBase.GetHeight">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontResourceBase.GetHeight.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontResourceBase.GetTextWidth">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontResourceBase.GetTextWidth.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgFontResourceBase.GetTextWidth.txt">
+ <short/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgFontBase">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgFontBase.FFontDesc">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgFontBase.FFontRes">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontBase.TextWidth">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontBase.TextWidth.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgFontBase.TextWidth.txt">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontBase.Ascent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontBase.Ascent.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontBase.Descent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontBase.Descent.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgFontBase.Height">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgFontBase.Height.Result">
+ <short/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgFontBase.FontDesc">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgFontBase.FontRes">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgFontBase.Handle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgCustomInterpolation">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgCustomInterpolation.FCanvas">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgCustomInterpolation.FImage">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCustomInterpolation.Initialize">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Initialize.AImage">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Initialize.ACanvas">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCustomInterpolation.Execute">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Execute.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Execute.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Execute.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCustomInterpolation.Execute.h">
+ <short/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCustomInterpolation.Canvas">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCustomInterpolation.Image">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgBaseInterpolation">
+ <short>A abstract class representing a base Interpolation filter.</short>
+ <descr>This is used as the base class to implement Interpolation filters like
+Gaussian, Sinc etc... These decendant filters are used in the
+<link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> function.
+</descr>
+ <errors/>
+ <seealso>
+ <link id="TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link>
+ </seealso>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgBaseInterpolation.xfactor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgBaseInterpolation.yfactor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgBaseInterpolation.xsupport">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgBaseInterpolation.ysupport">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgBaseInterpolation.tempimage">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: private -->
+ <element name="TfpgBaseInterpolation.Horizontal">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Horizontal.width">
+ <short/>
+ </element>
+ <!-- procedure Visibility: private -->
+ <element name="TfpgBaseInterpolation.Vertical">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Vertical.dx">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Vertical.dy">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Vertical.width">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Vertical.height">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgBaseInterpolation.Execute">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Execute.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Execute.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Execute.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Execute.h">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgBaseInterpolation.Filter">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgBaseInterpolation.Filter.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgBaseInterpolation.Filter.x">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgBaseInterpolation.MaxSupport">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgBaseInterpolation.MaxSupport.Result">
+ <short/>
+ </element>
+ <!-- destructor Visibility: public -->
+ <element name="TfpgBaseInterpolation.Destroy">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgMitchelInterpolation">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgMitchelInterpolation.Filter">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgMitchelInterpolation.Filter.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgMitchelInterpolation.Filter.x">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgMitchelInterpolation.MaxSupport">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgMitchelInterpolation.MaxSupport.Result">
+ <short/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgCanvasBase.FFastDoubleBuffer">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgCanvasBase.FInterpolation">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: private -->
+ <element name="TfpgCanvasBase.SetInterpolation">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetInterpolation.AValue">
+ <short/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FBufferedDraw">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FBeginDrawCount">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FWindow">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FColor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FTextColor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FLineWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FLineStyle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FFont">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgCanvasBase.FPersistentResources">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoSetFontRes">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetFontRes.fntres">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoSetTextColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetTextColor.cl">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoSetColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetColor.cl">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoSetLineStyle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetLineStyle.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetLineStyle.astyle">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoGetWinRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoGetWinRect.r">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoFillRectangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillRectangle.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle.col">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoXORFillRectangle.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoFillTriangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.x1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.y1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.x2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.y2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.x3">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillTriangle.y3">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoDrawRectangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawRectangle.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoDrawLine">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawLine.x1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawLine.y1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawLine.x2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawLine.y2">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoDrawImagePart">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.img">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.xi">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.yi">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawImagePart.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoDrawString">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawString.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawString.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawString.txt">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoSetClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoSetClipRect.ARect">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgCanvasBase.DoGetClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgCanvasBase.DoGetClipRect.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoAddClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoAddClipRect.ARect">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoClearClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoBeginDraw">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoBeginDraw.awin">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoBeginDraw.buffered">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoPutBufferToScreen">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoPutBufferToScreen.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoPutBufferToScreen.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoPutBufferToScreen.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoPutBufferToScreen.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoEndDraw">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgCanvasBase.GetPixel">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgCanvasBase.GetPixel.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GetPixel.X">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GetPixel.Y">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.SetPixel">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetPixel.X">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetPixel.Y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetPixel.AValue">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoDrawArc">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.a1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoDrawArc.a2">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgCanvasBase.DoFillArc">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.a1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DoFillArc.a2">
+ <short/>
+ </element>
+ <!-- constructor Visibility: public -->
+ <element name="TfpgCanvasBase.Create">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- destructor Visibility: public -->
+ <element name="TfpgCanvasBase.Destroy">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawRectangle">
+ <short>Draws a rectangle.</short>
+ <descr>
+ <printshort id="TfpgCanvasBase.DrawRectangle"/> You can specify the size of the rectangle via X, Y, Width and Height parameters or via a TfpgRect parameter.</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawRectangle.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawRectangle.r">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawLine">
+ <short>Draws a line</short>
+ <descr>
+ <printshort id="TfpgCanvasbase.DrawLine"/>. This method draws a line from (x1,y1) to (x2,y2), but does not draw the last pixel. All supported backends follow the Microsoft API and doesn't draw the last pixel. This optimises consecutive lines being drawn without overlapping pixels.</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawLine.x1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawLine.y1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawLine.x2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawLine.y2">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawImage">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImage.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImage.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImage.img">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawImagePart">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.img">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.xi">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.yi">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawImagePart.h">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawArc">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.a1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawArc.a2">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.StretchDraw">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.StretchDraw.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.StretchDraw.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.StretchDraw.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.StretchDraw.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.StretchDraw.ASource">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.CopyRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.CopyRect.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.CopyRect.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.CopyRect.ACanvas">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.CopyRect.SourceRect">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.DrawString">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawString.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawString.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.DrawString.txt">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.FillRectangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillRectangle.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillRectangle.r">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.FillTriangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.x1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.y1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.x2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.y2">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.x3">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillTriangle.y3">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.FillArc">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.a1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.FillArc.a2">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.GradientFill">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GradientFill.ARect">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GradientFill.AStart">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GradientFill.AStop">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GradientFill.ADirection">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.XORFillRectangle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.col">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.XORFillRectangle.r">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.SetClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetClipRect.ARect">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgCanvasBase.GetClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgCanvasBase.GetClipRect.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.AddClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.AddClipRect.ARect">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.ClearClipRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.Clear">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.Clear.AColor">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.GetWinRect">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.GetWinRect.r">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.SetColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetColor.AColor">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.SetTextColor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetTextColor.AColor">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.SetLineStyle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetLineStyle.AWidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetLineStyle.AStyle">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.SetFont">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.SetFont.AFont">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.BeginDraw">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.BeginDraw.ABuffered">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.EndDraw">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.EndDraw.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.EndDraw.y">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.EndDraw.w">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.EndDraw.h">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.EndDraw.ARect">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgCanvasBase.FreeResources">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.Color">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.TextColor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.Font">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.Pixels">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.Pixels.X">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgCanvasBase.Pixels.Y">
+ <short/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.InterpolationFilter">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.FastDoubleBuffer">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.LineStyle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgCanvasBase.LineWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgWindowBase.FParent">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: private -->
+ <element name="TfpgWindowBase.SetMouseCursor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.SetMouseCursor.AValue">
+ <short/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FMouseCursor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FWindowType">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FWindowAttributes">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FTop">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FLeft">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FHeight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FMinWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FMinHeight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgWindowBase.FCanvas">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgWindowBase.HandleIsValid">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.HandleIsValid.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoUpdateWindowPosition">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoUpdateWindowPosition.aleft">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoUpdateWindowPosition.atop">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoUpdateWindowPosition.awidth">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoUpdateWindowPosition.aheight">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoAllocateWindowHandle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoAllocateWindowHandle.AParent">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoReleaseWindowHandle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoSetWindowVisible">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoSetWindowVisible.AValue">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoMoveWindow">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoMoveWindow.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoMoveWindow.y">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgWindowBase.DoWindowToScreen">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.DoWindowToScreen.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoWindowToScreen.ASource">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoWindowToScreen.AScreenPos">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoSetWindowTitle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.DoSetWindowTitle.ATitle">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.DoSetMouseCursor">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.SetParent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.SetParent.AValue">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgWindowBase.GetParent">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.GetParent.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgWindowBase.GetCanvas">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.GetCanvas.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.AllocateWindowHandle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.ReleaseWindowHandle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.SetWindowTitle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.SetWindowTitle.ATitle">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.SetHeight">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.SetHeight.AValue">
+ <short/>
+ </element>
+ <!-- procedure Visibility: protected -->
+ <element name="TfpgWindowBase.SetWidth">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.SetWidth.AValue">
+ <short/>
+ </element>
+ <!-- constructor Visibility: public -->
+ <element name="TfpgWindowBase.Create">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.Create.AOwner">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.AfterConstruction">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.AdjustWindowStyle">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.SetWindowParameters">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgWindowBase.Right">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.Right.Result">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgWindowBase.Bottom">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.Bottom.Result">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.UpdateWindowPosition">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.MoveWindow">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.MoveWindow.x">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.MoveWindow.y">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgWindowBase.WindowToScreen">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgWindowBase.WindowToScreen.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.WindowToScreen.ASource">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgWindowBase.WindowToScreen.AScreenPos">
+ <short/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.CaptureMouse">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- procedure Visibility: public -->
+ <element name="TfpgWindowBase.ReleaseMouse">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.HasHandle">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.WindowType">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.WindowAttributes">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Left">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Top">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Width">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Height">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.MinWidth">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.MinHeight">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Canvas">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.Parent">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgWindowBase.MouseCursor">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- object Visibility: default -->
+ <element name="TfpgApplicationBase">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgApplicationBase.FMainForm">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgApplicationBase.FTerminated">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: private -->
+ <element name="TfpgApplicationBase.FTopModalForm">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- variable Visibility: protected -->
+ <element name="TfpgApplicationBase.FIsInitialized">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: protected -->
+ <element name="TfpgApplicationBase.DoGetFontFaceList">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgApplicationBase.DoGetFontFaceList.Result">
+ <short/>
+ </element>
+ <!-- constructor Visibility: public -->
+ <element name="TfpgApplicationBase.Create">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="TfpgApplicationBase.Create.AParams">
+ <short/>
+ </element>
+ <!-- function Visibility: public -->
+ <element name="TfpgApplicationBase.GetFontFaceList">
+ <short/>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="TfpgApplicationBase.GetFontFaceList.Result">
+ <short/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgApplicationBase.IsInitialized">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgApplicationBase.TopModalForm">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgApplicationBase.MainForm">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- property Visibility: public -->
+ <element name="TfpgApplicationBase.Terminated">
+ <short/>
+ <descr/>
+ <seealso/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="KeycodeToText">
+ <short>Returns the text representation of a keycode.</short>
+ <descr>This is mainly used for debugging, but could also be used for Menu Item keyboard
+shortcuts etc.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="KeycodeToText.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="KeycodeToText.AKey">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="KeycodeToText.AShiftState">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="CheckClipboardKey">
+ <short>Detects if the pressed keys represent a Clipboard key shortcut</short>
+ <descr>Detects if the pressed keys represent a Clipboard key shortcut. If it does, it
+returns the correct enum type detected.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="CheckClipboardKey.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="CheckClipboardKey.AKey">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="CheckClipboardKey.AShiftstate">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgColorToRGBTriple">
+ <short>Converts the TfpgColor to TRGBTriple type</short>
+ <descr>This function converts the given TfpgColor into a TRGBTriple type.
+</descr>
+ <errors/>
+ <seealso>
+ <link id="TRGBTriple"/>
+ </seealso>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgColorToRGBTriple.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgColorToRGBTriple.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="RGBTripleTofpgColor">
+ <short>Converts the TRGBTriple to TfpgColor type</short>
+ <descr>This function converts the given TRGBTriple into a TfpgColor type.
+</descr>
+ <errors/>
+ <seealso>
+ <link id="TRGBTriple"/>
+ </seealso>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="RGBTripleTofpgColor.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="RGBTripleTofpgColor.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgGetRed">
+ <short>Returns the Red portion of a color value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgGetRed.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetRed.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgGetGreen">
+ <short>Returns the Green portion of a color value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgGetGreen.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetGreen.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgGetBlue">
+ <short>Returns the Blue portion of a color value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgGetBlue.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetBlue.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgGetAlpha">
+ <short>Returns the Alpha portion of a color value.</short>
+ <descr/>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgGetAlpha.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetAlpha.AColor">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="fpgGetAvgColor">
+ <short>Calculates the average color using the two supplied</short>
+ <descr>This function calculates and returns the average color by using AColor1
+and AColor2. The Alpha value also gets taken into account.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="fpgGetAvgColor.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetAvgColor.AColor1">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="fpgGetAvgColor.AColor2">
+ <short/>
+ </element>
+ <!-- function Visibility: default -->
+ <element name="PtInRect">
+ <short>Returns true if APoint is inside ARect rectangle</short>
+ <descr>This function is used to detect if the point APoint is inside the given
+rectangle ARect. If it is, the function returns True, otherwise False.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- function result Visibility: default -->
+ <element name="PtInRect.Result">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="PtInRect.ARect">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="PtInRect.APoint">
+ <short/>
+ </element>
+ <!-- procedure Visibility: default -->
+ <element name="SortRect">
+ <short>Fixes the Top, Bottom and Left, Right to always represent a valid rectangle</short>
+ <descr>This function fixes a rectangle so that the Left point is always smaller than the
+Right. And the Top is always smaller than the Bottom.
+</descr>
+ <errors/>
+ <seealso/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="SortRect.ARect">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="SortRect.left">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="SortRect.top">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="SortRect.right">
+ <short/>
+ </element>
+ <!-- argument Visibility: default -->
+ <element name="SortRect.bottom">
+ <short/>
+ </element>
+ <element name="TfpgCanvasBase.DrawLineClipped">
+ <short>Draws a line inside a clip rectangle</short>
+ <descr>
+ <p>
+ <printshort id="TfpgCanvasBase.DrawLineClipped"/>. This procedure clips a line to the AClipRect boundaries and
+ then calls the DrawLine procedure with the clipped coordinates. If the line
+ lies completely outside of the clip boundary, then the Line routine is not
+ called. This procedure uses the well known Cohen-Sutherland line clipping
+ algorithm to clip each coordinate.
+</p>
+ <p>Use this if you did not what to change the Canvas.ClipRegion for some reason.
+ 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>
+ </element>
+ <element name="TFileEntry">
+ <short>A simple data object representing a file</short>
+ <descr>
+ <printshort id="TFileEntry"/>. Some properties are OS dependant.</descr>
+ </element>
+ <element name="TFileEntry.Name">
+ <short>Name of a file</short>
+ </element>
+ <element name="TFileEntry.Extension">
+ <short>The extension of a file</short>
+ </element>
+ <element name="TFileEntry.Size">
+ <short>Size of a file in bytes</short>
+ </element>
+ <element name="TFileEntry.IsLink">
+ <short>Is this item a symbolic link (on unix-type OSes)</short>
+ </element>
+ <element name="TFileEntry.LinkTarget">
+ <short>If it is a symbolic link, LinkTarget is what it points too</short>
+ </element>
+ <element name="TFileEntry.ModTime">
+ <short>Last modified timestamp</short>
+ </element>
+ <element name="TFPColor">
+ <short>A record structure holding the RGBA values of a color.</short>
+ <descr>This is the same declaration as the one found in FPImage (include with Free Pascal Compiler). In future when FPImage is integrated with fpGUI, I will remove this declaration.</descr>
+ </element>
+ </module>
+ <!-- fpg_base -->
+ </package>
+</fpdoc-descriptions>
\ No newline at end of file diff --git a/docs/xml/corelib/fpg_cmdlineparams.xml b/docs/xml/corelib/fpg_cmdlineparams.xml index 9661a7eb..f75fbbc2 100644 --- a/docs/xml/corelib/fpg_cmdlineparams.xml +++ b/docs/xml/corelib/fpg_cmdlineparams.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_cmdlineparams"> <short></short> diff --git a/docs/xml/corelib/fpg_constants.xml b/docs/xml/corelib/fpg_constants.xml index ccd98914..e02dd9c7 100644 --- a/docs/xml/corelib/fpg_constants.xml +++ b/docs/xml/corelib/fpg_constants.xml @@ -1,13 +1,31 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_constants"> -<short></short> -<descr> +<short>All constants used in fpGUI are defined here</short> +<descr><p><printshort id="fpg_constants"/>. All the text constants defined here, +are also the ones that get translated to multiple languages. Currently fpGUI +and translations for: Afrikaans, German, English (default), Spanish, French, +Italian, Portuguese (Brazil) and Russian.</p> +<p>To change the default (compiled in) language used by fpGUI, simply enabled +one of the language DEFINES in the interface section of the fpg_constants unit. +</p> </descr> - -</module> - -</package> + <element name="fpgAddColon"> + <short>A utility function to add a colon at the correct location in a string</short> + <descr> + <printshort id="fpgAddColon"/>. This is so that when fpGUI supports LTR and RTL languages, the colon will be added at the correct place.</descr> + </element> + <element name="DEFAULT_HINT_PAUSE"> + <short>Default pause in milliseconds before a hint is displayed</short> + </element> + <element name="DOUBLECLICK_MS"> + <short>Time maximum time in milliseconds between left-clicks for a double click to be triggered</short> + </element> + <element name="DOUBLECLICK_DISTANCE"> + <short>Maximum distance a mouse pointer can move between two left-clicks and still trigger a double click event</short> + </element> + </module> + </package> </fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_extinterpolation.xml b/docs/xml/corelib/fpg_extinterpolation.xml index 2fcd0785..af129a1f 100644 --- a/docs/xml/corelib/fpg_extinterpolation.xml +++ b/docs/xml/corelib/fpg_extinterpolation.xml @@ -1,22 +1,16 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> - -<module name="fpg_extinterpolation"> -<short>Extra interpolation filter declarations.</short> -<descr> -<p> -Some more interpolation filters for -<link id="fpg_base.TfpgCanvasBase.StretchDraw">TfpgCanvas.StretchDraw</link>:<br/> + <package name="fpGUI"> + <module name="fpg_extinterpolation"> + <short>Extra interpolation filter declarations.</short> + <descr> + <p>Some more interpolation filters for <link id="fpg_base.TfpgCanvasBase.StretchDraw">TfpgCanvasBase.StretchDraw</link>:<br/> Bessel, Gaussian and Sinc are infinite impulse response (IIR), the others are finite impulse response (FIR). The implementation of Bessel and Sinc are windowed with Blackman filter.</p> -<p> -This unit was ported from fcl-image which is part of FPC. A few + <p>This unit was ported from fcl-image which is part of FPC. A few more filters have also been added.</p> -</descr> - -</module> - -</package> + </descr> + </module> + </package> </fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_imagelist.xml b/docs/xml/corelib/fpg_imagelist.xml index dfba96fc..603d4c07 100644 --- a/docs/xml/corelib/fpg_imagelist.xml +++ b/docs/xml/corelib/fpg_imagelist.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_imagelist"> <short></short> diff --git a/docs/xml/corelib/fpg_imgfmt_bmp.xml b/docs/xml/corelib/fpg_imgfmt_bmp.xml index ed3cce90..9bee3087 100644 --- a/docs/xml/corelib/fpg_imgfmt_bmp.xml +++ b/docs/xml/corelib/fpg_imgfmt_bmp.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_imgfmt_bmp"> <short>BMP image reader implementation</short> diff --git a/docs/xml/corelib/fpg_main.xml b/docs/xml/corelib/fpg_main.xml index 73728f15..574931ed 100644 --- a/docs/xml/corelib/fpg_main.xml +++ b/docs/xml/corelib/fpg_main.xml @@ -1,19 +1,22 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="CoreLib"> - + <package name="fpGUI"> <module name="fpg_main"> - <short/> - <descr/> - + <short>The main unit that ties everything together from CoreLib</short> + <descr> + <p> + <printshort id="fpg_main"/>. This unit contain the higher level classes that the end-user will use to build applications. +</p> + <p>This unit also contains the global objects instances used to start an application, or helper functions used through a a fpGUI based application. eg: <link id="fpgApplication"/>, <link id="fpgClipboard"/>.</p> + </descr> <!-- procedure Visibility: default --> <element name="fpgPostMessage"> <short>Posts a message to the event queue</short> <descr>fpgPostMessage posts a message to the event queue, but doesn't wait for it to compelete. It returns immediately.</descr> <errors/> <seealso> - <link id="fpgSendMessage"/> - </seealso> + <link id="fpgSendMessage"/> + </seealso> </element> <!-- procedure Visibility: default --> <element name="fpgSendMessage"> @@ -21,10 +24,54 @@ <descr>fpgSendMessage sends a message to the event queue and waits for it to complete before it returns.</descr> <errors/> <seealso> - <link id="fpgPostMessage"/> - </seealso> + <link id="fpgPostMessage"/> + </seealso> + </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. +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> + <element name="fpgGetNamedColor"> + <short>Returns a "named" TfpgColor based on a RGB color</short> + </element> + <element name="fpgSetNamedColor"> + <short>Define a new "named" color</short> + </element> + <element name="fpgGetNamedFontList"> + <short>Return a TStringList of "named" fonts</short> + </element> + <element name="fpgSetNamedFont"> + <short>Defined a new "named" font</short> + <descr> + <printshort id="fpgSetNamedFont"/>. Because fpGUI is a cross-platform toolkit, the same fonts might not be available on all systems. For this reason fpGUI supports "named" or "alias names" for fonts. You can specify a font description, and then give that font description a name. Then any component that has a FontDesc property you can pass the full font description, or the "named" font name. An example of a named font is '#Edit1' which is the default font used for <link id="fpg_edit.TfpgEdit">TfpgEdit</link>.</descr> + </element> + <element name="TfpgCanvas"> + <short>This is the drawing Canvas of each widget</short> + <descr><printshort id="TfpgCanvas"/>.</descr> + </element> + <element name="TfpgCanvas.DrawText"> + <short>Output Text onto the Canvas</short> + <descr> + <printshort id="TfpgCanvas.DrawText"/>.</descr> + </element> + <element name="TfpgCanvas.StretchDraw" link="#fpgui.fpg_base.TfpgCanvasBase.StretchDraw"> + </element> + <element name="PrintRect"> + <short>Prints rectangle information to console</short> + <descr><printshort id="PrintRect"/>. This is a helper function for debugging purposes.</descr> + <seealso> + <link id="#fpgui.fpg_base.TfpgRect">TfpgRect</link> + </seealso> + </element> + <element name="TfpgStyle"> + <short>This supplies very basic theming support for now</short> + <descr><p><printshort id="TfpgStyle"/>. At a later date the theming support in +fpGUI will be totally reworked to supply built-in and image based theming.</p><p>See the +document named <var>theming_spec.txt</var> in the "docs" folder for details of what is +planned.</p></descr> </element> - </module> <!-- fpg_main --> </package> diff --git a/docs/xml/corelib/fpg_pofiles.xml b/docs/xml/corelib/fpg_pofiles.xml index 7aa3a50c..f4f2f836 100644 --- a/docs/xml/corelib/fpg_pofiles.xml +++ b/docs/xml/corelib/fpg_pofiles.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_pofiles"> <short></short> diff --git a/docs/xml/corelib/fpg_popupwindow.xml b/docs/xml/corelib/fpg_popupwindow.xml index c89dfbb4..d420fd6c 100644 --- a/docs/xml/corelib/fpg_popupwindow.xml +++ b/docs/xml/corelib/fpg_popupwindow.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_popupwindow"> <short></short> diff --git a/docs/xml/corelib/fpg_stdimages.xml b/docs/xml/corelib/fpg_stdimages.xml index c767ee6d..ab799178 100644 --- a/docs/xml/corelib/fpg_stdimages.xml +++ b/docs/xml/corelib/fpg_stdimages.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_stdimages"> <short></short> diff --git a/docs/xml/corelib/fpg_stringhashlist.xml b/docs/xml/corelib/fpg_stringhashlist.xml index 2c3d1b01..3ca5cfec 100644 --- a/docs/xml/corelib/fpg_stringhashlist.xml +++ b/docs/xml/corelib/fpg_stringhashlist.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_stringhashlist"> <short></short> diff --git a/docs/xml/corelib/fpg_stringutils.xml b/docs/xml/corelib/fpg_stringutils.xml index 2070f288..9a99d335 100644 --- a/docs/xml/corelib/fpg_stringutils.xml +++ b/docs/xml/corelib/fpg_stringutils.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_stringutils"> <short></short> diff --git a/docs/xml/corelib/fpg_translations.xml b/docs/xml/corelib/fpg_translations.xml index 647fae53..31d817b4 100644 --- a/docs/xml/corelib/fpg_translations.xml +++ b/docs/xml/corelib/fpg_translations.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_translations"> <short></short> diff --git a/docs/xml/corelib/fpg_utils.xml b/docs/xml/corelib/fpg_utils.xml index 225fffe1..2b4f74fe 100644 --- a/docs/xml/corelib/fpg_utils.xml +++ b/docs/xml/corelib/fpg_utils.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_utils"> <short>Utility functions.</short> diff --git a/docs/xml/corelib/fpg_widget.xml b/docs/xml/corelib/fpg_widget.xml index 733de946..cb0ed0f5 100644 --- a/docs/xml/corelib/fpg_widget.xml +++ b/docs/xml/corelib/fpg_widget.xml @@ -1,7 +1,6 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="CoreLib"> - + <package name="fpGUI"> <module name="fpg_widget"> <short/> <descr/> @@ -10,6 +9,32 @@ <short>Sets the position and size of the component.</short> <descr>Sets the position and size of the component. It also fires the Resize message. If you are setting up a component like a button on a form, you don't really want the resize event to fire for the button, before the form is displayed (visible). In that case, rather use the components Top, Left, Width and Height properties.</descr> </element> + <element name="TfpgWidget.FormDesigner"> + <short>If assigned, then this widget is being editing in the Form Designer</short> + </element> + <element name="TfpgWidget.Parent"> + <short>An alias for Owner.</short> + <descr>Unlike Delphi or Lazarus, fpGUI treats Owner and Parent as the same thing. Owner or Parent manages the life of children, and the parent/child hierarchy defines the visual aspect as well.</descr> + </element> + <element name="TfpgWidget.IsContainer"> + <short>Can this component managed child components.</short> + <descr>This is mainly used in fpGUI UI Designer, to know if you can drop on widget inside another widget.</descr> + </element> + <element name="TfpgWidget.Focusable"> + <short>This determines if the widget is allowed to received keyboard focus.</short> + </element> + <element name="TfpgWidget.Anchors"> + <short>Allows the component to resize or reposition based on its Parent.</short> + <descr> + <p>By default Anchors are set to Top Left.</p> + <p> + <b>NOTE</b> + </p> + <p>Anchoring only takes affect <i>after</i> the component is visible on the screen (when the component has a window handle assigned). So if you create a Button in the constructor and set its Anchor property to Bottom/Right, and then set the size of the Form, the Button will <i>not</i> be repositioned. +</p> + <p>This is by design. fpGUI allows you to setup a window layout without triggering unnecesary events as you set property values for each widget. Only when csLoading is not in ComponentState, then anchoring events will be triggered. This allows the developer or the fpGUI UI Designer to setup a window layout undisturbed.</p> + </descr> + </element> </module> </package> </fpdoc-descriptions> diff --git a/docs/xml/corelib/fpg_wuline.xml b/docs/xml/corelib/fpg_wuline.xml index 6b283b3d..d5a56b33 100644 --- a/docs/xml/corelib/fpg_wuline.xml +++ b/docs/xml/corelib/fpg_wuline.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <module name="fpg_wuline"> -<short></short> -<descr> +<short>Xioalin Wu's anti-aliased line drawing algorithm implementation</short> +<descr><printshort id="fpg_wuline"/>. For more details see the following Wikipedia page: +http://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm </descr> </module> diff --git a/docs/xml/corelib/gdi/fpg_gdi.xml b/docs/xml/corelib/gdi/fpg_gdi.xml index 1e81eb7c..6fe8bdee 100644 --- a/docs/xml/corelib/gdi/fpg_gdi.xml +++ b/docs/xml/corelib/gdi/fpg_gdi.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <!-- ==================================================================== diff --git a/docs/xml/corelib/x11/fpg_x11.xml b/docs/xml/corelib/x11/fpg_x11.xml index c435d3f3..27dc6e47 100644 --- a/docs/xml/corelib/x11/fpg_x11.xml +++ b/docs/xml/corelib/x11/fpg_x11.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="CoreLib"> +<package name="fpGUI"> <!-- ==================================================================== diff --git a/docs/xml/gui/fpg_button.xml b/docs/xml/gui/fpg_button.xml new file mode 100644 index 00000000..137231ce --- /dev/null +++ b/docs/xml/gui/fpg_button.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<fpdoc-descriptions> + <package name="fpGUI"> + <module name="fpg_button"> + <short>This unit defines the push button classes.</short> + <element name="TImageLayout"> + <short>Enum type defining the position of images inside a Button</short> + </element> + <element name="TImageLayout.ilImageLeft"> + <short>Image to the left of the button text.</short> + </element> + <element name="TImageLayout.ilImageTop"> + <short>Image above the button text.</short> + </element> + <element name="TImageLayout.ilImageRight"> + <short>Image to the right of the button text.</short> + </element> + <element name="TImageLayout.ilImageBottom"> + <short>Image below the button text.</short> + </element> + <element name="TfpgBaseButton"> + <short>Base class the represents a push button control</short> + </element> + <element name="TfpgBaseButton.ImageLayout"> + <short>Defines where on the button the image will be displayed</short> + </element> + <element name="TfpgBaseButton.ImageSpacing"> + <short>The spacing between the Image and the Text</short> + <descr>The <var>ImageSpacing</var> value is in pixels. The value range +is from -1 to any positive value. -1 has a special meaning and is also the +default value. When ImageSpacing equals -1, then the spacing between the button +image and the button text is automatically calculated so that the button text +is centred in the available horizontal space of the button.</descr> + </element> + <element name="TfpgBaseButton.ImageName"> + <short>The registered name of a image to display on the button</short> + <descr> + <printshort id="TfpgBaseButton.ImageName"/>. This is the name used when +a image resource was registered with the global <link id="fpg_main.fpgImages">fpgImages</link> instance.</descr> + </element> + + <element name="TfpgButton"> + <short>Concrete button class used in user interfaces</short> + <descr><printshort id="TfpgButton"/>. This class is a descendant of <link id="fpg_button.TfpgBaseButton">TfpgBaseButton</link> and +simply publishes various properties for runtime type information.</descr> + <seealso> + <link id="fpg_button.TfpgBaseButton">TfpgBaseButton</link> + </seealso> + </element> + <element name="TfpgButton.ImageName" link="TfpgBaseButton.ImageName"/> + <element name="TfpgButton.ImageSpacing" link="TfpgBaseButton.ImageSpacing"/> + <element name="TfpgButton.ImageLayout" link="TfpgBaseButton.ImageLayout"/> + + </module> + </package> +</fpdoc-descriptions> diff --git a/docs/xml/gui/fpg_colormapping.xml b/docs/xml/gui/fpg_colormapping.xml index 8a348362..0a88ca1e 100644 --- a/docs/xml/gui/fpg_colormapping.xml +++ b/docs/xml/gui/fpg_colormapping.xml @@ -1,30 +1,29 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="GUI"> + <package name="fpGUI"> <module name="fpg_colormapping"> <short>This unit contains some color conversion/mapping functions.</short> <descr/> <element name="RGBToHSV"> <short>Map RGB colorspace to HSV colorspace.</short> - <descr>This function converts a RGB (Red, Green, Blue) colorspace value to HSV (Hue, Saturation, Value) colorspace. The parameters have specific value ranges. Please see the parameter documentation for more details.</descr> + <descr><p>This function converts a RGB (Red, Green, Blue) colorspace value to +HSV (Hue, Saturation, Value) colorspace. The parameters have specific value ranges as +listed below.</p> +<dl> +<dt>Hue</dt> +<dd>The Hue range is from 0 - 1535. In that range, the primary colors are mapped to the following values. Red = 0. Green = 512 and Blue = 1024.</dd> +<dt>Saturation</dt> +<dd>The Saturation value range is from 0.0 - 1.0. Grey (no color) = 0. Maximum color = 1.0.</dd> +<dt>Value</dt> +<dd>The Value value range is from 0.0 to 1.0. Black being 0 and maximum brightness being 1.0.</dd> +</dl> + </descr> </element> <element name="HSVToRGB"> <short>Map HSV colorspace to RGB colorspace.</short> - </element> - <element name="RGBToHSV.Hue"> - <short>Returned Hue value</short> - <descr>The Hue range is from 0 - 1535. In that range, the primary colors are mapped to the following values. Red = 0. Green = 512 and Blue = 1024.</descr> - </element> - <element name="RGBToHSV.Saturation"> - <short>Returned Saturation value.</short> - <descr>The Saturation value range is from 0.0 - 1.0. Grey (no color) = 0. Maximum color = 1.0.</descr> - </element> - <element name="RGBToHSV.Value"> - <short>Returned Value value.</short> - <descr>The Value value range is from 0.0 to 1.0. Black being 0 and maximum brightness being 1.0.</descr> - </element> - <element name="HSVToRGB.H"> - <short>Hue value</short> + <seealso> + <link id="RGBToHSV"/> + </seealso> </element> </module> </package> diff --git a/docs/xml/gui/fpg_colorwheel.xml b/docs/xml/gui/fpg_colorwheel.xml index 6340555b..0ec24bdf 100644 --- a/docs/xml/gui/fpg_colorwheel.xml +++ b/docs/xml/gui/fpg_colorwheel.xml @@ -1,23 +1,23 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="GUI"> + <package name="fpGUI"> <module name="fpg_colorwheel"> - <short>The unit contains a ColorWheel and ValueBar component.</short> - <descr> + <short>The unit contains a ColorWheel and ValueBar component</short> + <descr><p><printshort id="fpg_colorwheel"/>.</p> <p> <b>Using the components:</b> </p> - <p>Normally, you use both a color wheel and a value bar.
+ <p>Normally, you use both a color wheel and a value bar. </p> <ol> <li>Put a color wheel on your form.</li> <li>Put a value bar on your form beside the wheel.</li> - <li>Set the ColorWheel's ValueBar property to the ValueBar component
- you just put on the form.</li> + <li>Set the ColorWheel's ValueBar property to the ValueBar component +you just put on the form.</li> </ol> - <p>The two components are now linked together. When a selection is
-made in the color wheel the value bar will update to show the range
-for that selection.
+ <p>The two components are now linked together. When a selection is +made in the color wheel the value bar will update to show the range +for that selection. </p> <p> <b>Note:</b> you won't see the colors in the UI Designer. Colors will @@ -25,12 +25,12 @@ only be displayed at runtime.</p> <p> <b>Reading and setting the color:</b> </p> - <p>To set the color being displayed, use the SetSelectedColor method
- of the color wheel.</p> - <p>To read the color selected, read the SelectedColor property
- of the ValueBar.</p> - <p>If you want to know when the user picks a color, you
- can use the OnChange event in the ValueBar.</p> + <p>To set the color being displayed, use the SetSelectedColor method +of the color wheel.</p> + <p>To read the color selected, read the SelectedColor property +of the ValueBar.</p> + <p>If you want to know when the user picks a color, you +can use the OnChange event in the ValueBar.</p> </descr> <element name="TfpgColorWheel"> <short>A colorwheel component.</short> diff --git a/docs/xml/gui/fpg_dialogs.xml b/docs/xml/gui/fpg_dialogs.xml index 62b43bbb..40b17cde 100644 --- a/docs/xml/gui/fpg_dialogs.xml +++ b/docs/xml/gui/fpg_dialogs.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <fpdoc-descriptions> -<package name="GUI"> +<package name="fpGUI"> <module name="fpg_dialogs"> <short>Various dialogs used by fpGUI based applications.</short> @@ -85,20 +85,15 @@ When the dialog is opened the file specified is pre selected. <!-- property Visibility: public --> <element name="TfpgFileDialog.Filter"> <short>File mask filters available in the dialog.</short> -<descr> -<p> -The filter consists out of two parts separated by a | sign. If more than +<descr><p>The filter consists out of two parts separated by a | sign. If more than one filter needs to be specified each filter is also separated by a | sign. The format for a single filter is: <description>|<filemask> The format for multiple filters are: <description>|<filemask>|<description>|<filemask>|<description>|<filemask> </p> -<p> - Example:<br/> - <ul> - <li><p>'All Files (*)|*'</p></li> - <li><p>'All Files (*)|*|Object Pascal (*.pas)|*.pas'</p></li> - </ul> -</p> +<p>Example:</p> +<code>'All Files (*)|*' +'All Files (*)|*|Object Pascal (*.pas)|*.pas' +</code> <p> A filemask can also contain more than one mask separated by a ; sign.<br/> eg: 'Object Pascal|*.pas;*.lpi;*.pp' diff --git a/docs/xml/gui/fpg_hyperlink.xml b/docs/xml/gui/fpg_hyperlink.xml index fd99f0ea..f9239fa5 100644 --- a/docs/xml/gui/fpg_hyperlink.xml +++ b/docs/xml/gui/fpg_hyperlink.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <fpdoc-descriptions> - <package name="GUI"> + <package name="fpGUI"> <module name="fpg_hyperlink"> <short>A label component that can launch a web browser</short> <descr>This component acts like a link found in a web page. You can assign a diff --git a/docview/.gitignore b/docview/.gitignore new file mode 100644 index 00000000..c15616d1 --- /dev/null +++ b/docview/.gitignore @@ -0,0 +1,4 @@ +*.[oa] +*.ppu +*.lps +units
\ No newline at end of file diff --git a/docview/TODO.txt b/docview/TODO.txt new file mode 100644 index 00000000..aa4e62ac --- /dev/null +++ b/docview/TODO.txt @@ -0,0 +1,65 @@ + + DocView todo list. + +Legend +====== +[ ] - not started yet +[o] - started but not complete +[x] - completed task. + + +Todo list +========= +[ ] - Access Violation when the application terminates. +[ ] - Ever growing list of fonts used while loading new topics. +[o] - Settings / Customization dialog is needed. +[ ] - Change mouse cursor when over hyperlinks in RichTextView +[o] - Implement a ipfdump program. Already started work on this and is called + docdump in the src directory. +[ ] - Implement a IPF Compiler in Object Pascal +[ ] - Text is not selectable in RichTextView. I imagine people want to + copy & paste examples. Although "Save current Topic" already exists. +[ ] - Communication between application and docview. Both directions. Possible + solutions is Pipes or IPC unit. +[ ] - Create help file for DocView listing all supported features etc.. +[ ] - Searching for two words as-is does not seem to work. + eg: 'file descriptor' exists is fppoll help, but trying to search for + those two words doesn't find anything. +[ ] - Sometimes searching for a word doesn't find help even though it exists. + eg: 'descriptor' doesn't find the help in fppoll topic, even though the + work is clearly in the topic contents. +[ ] - Options or Configuration dialog to set various things. +[ ] - Implement popup window for "notes" hyperlinks. +[ ] - RichTextView component issue. Incompatible with original OS/2 VIEW. When + resetting a font style (eg: italics to normal), it should not affect a + previously set font color, unless a new font color is explicitly set. +[ ] - External links are not supported yet. +[ ] - Implement Image support in INF or HLP files. + +[x] - Display topic by ID via command line parameters +[x] - 'Could not load topic slots' message when trying to view some topics. +[x] - Extend compiler or INF file format for larged Word Index list. Currently + LCL documentation needs to be split in two, to compile. (this was an issue + with the Open Watcom WIPFC - limit is now set to 65000 entries) +[x] - Clicking in index list should set the text in the index search edit box. +[x] - MRU menu item doesn't seem to remember all opened documents. +[x] - Text wrapping in RichTextView is not 100% correct +[x] - Hyperlinks on scrolled content doesn't work. +[x] - Implement History tab and tracking - including Back & Next buttons. +[x] - Open Recent Files doesn't always get populated, or gets cleared for some + reason. +[x] - Fixes suggish scrolling. I think it's a recursive position event on the + vertical scrollbar causing the problem. + + +fpdoc IPF todo list +=================== +[ ] - Class declaration in overview page is missing. Like HTML output. +[ ] - Class inheritance tree must be shown in overview page. Like HTML output. +[ ] - +[ ] - +[ ] - + + + + diff --git a/docview/components/richtext/ACLStringUtility.pas b/docview/components/richtext/ACLStringUtility.pas new file mode 100644 index 00000000..5ddcb2b7 --- /dev/null +++ b/docview/components/richtext/ACLStringUtility.pas @@ -0,0 +1,1769 @@ +Unit ACLStringUtility; + +{$mode objfpc}{$H+} + +Interface + +Uses + Classes; + +const + CharTAB = chr(9); + CharCR = chr(13); + CharLF = chr(10); + CharSingleQuote = ''''; + CharDoubleQuote = '"'; + + EndLine = CharCR + CharLF; + + StrTAB = CharTAB; + StrCR = CharCR; + StrLF = CharLF; + StrCRLF = StrCR + StrLF; + StrSingleQuote = CharSingleQuote; + StrDoubleQuote = CharDoubleQuote; + +type + TSetOfChars = set of char; + + TCharMatchFunction = function( const a: char ): boolean; + + + TSerializableStringList = class(TObject) + private + stringList: TStrings; + public + constructor Create; + destructor Destroy; override; + function getCount : LongInt; + function get(const anIndex : LongInt) : String; + function getSerializedString : String; + procedure add(const aString : String); + procedure readValuesFromSerializedString(const aSerializedString : String); + end; + + +// Returns true if c is a digit 0..9 +Function IsDigit( const c: char ): boolean; + +// Returns true if c is not a digit +Function IsNonDigit( const c: char ): boolean; + +// Returns true if c is an alphabetic character a..z A..Z +Function IsAlpha( const c: char ): boolean; + +// Returns true if s is only spaces (or empty) +Function IsSpaces( const s: string ): boolean; + +// ---------------------- Numeric conversions --------------------------------------- + +// Converts a hex string to a longint +// May be upper or lower case +// Does not allow a sign +// Is not forgiving as StrToInt: all characters +// must be valid hex chars. +function HexToInt( s: string ): longint; + +// Given a string with a number on the end, increments that +// number by one. +// If there is no number it adds a one. +// If the number is left zero padded then the result is similarly +// padded +Function IncrementNumberedString( StartString: string ): string; + +// ---------------------- Pascal String Utilities --------------------------------------- + +Function CaseInsensitivePos( const a: string; + const b: string ): longint; + +// Looks for occurrences of QuoteChar and inserts a duplicate +Function InsertDuplicateChars( const S: string; + const QuoteChar: char ): string; + +// Returns index of SubString in S, case-insensitve +Function FindSubstring( const SubString: string; + const S: string ): integer; + +// Returns characters at the front of S that match according +// to a given function... for example, IsDigit, IsNonDigit, IsAlpha +Function MatchLeadingChars( + const S: string; + MatchFunction: TCharMatchFunction ): string; + +// Same as MatchLeadingChars, but removes the matching chars from S +Function ExtractLeadingChars( + Var S: string; + MatchFunction: TCharMatchFunction ): string; + +// Case insensitive compare +Function StringsSame( const a, b: string ): boolean; + +// Quoting + +// Note: these functions do not check for existing quotes within +// the string, they only add or delete characters at the end. + +// Returns S in single quotes +Function StrQuote( const s: string ): string; + +// Returns S without single quotes +Function StrUnQuote( const s: string ): string; + +// Returns S in double quotes, +// with any double quotes in S duplicated +Function StrFullDoubleQuote( const s: string ): string; + +// Returns S without double quotes +Function StrUnDoubleQuote( const s: string ): string; +// Returns aString enclosed in single quotes +Function StrInSingleQuotes(const aString : String) : String; +// Returns aString enclosed in double quotes +Function StrInDoubleQuotes(const aString : String) : String; + + +// + +// Substitutes given character - placing all occurences of AFind char. +Function SubstituteChar( const S: string; const Find: Char; const Replace: Char ): string; + +// Returns the count rightmost chars of S +Function StrRight( const S:string; const count:integer ):string; + +// Returns the remainder of S starting at start +Function StrRightFrom( const S:string; const start:integer ):string; + +// Returns the count leftmost chars of S +Function StrLeft( const S:string; const count:integer ):string; + +// Returns S minus count characters from the right +Function StrLeftWithout( const S:string; const count:integer ):string; + +// Returns S with leftCount chars removed from the left and +// rightCount chars removed from the right. +Function StrRemoveEnds( const S:string; const leftCount:integer; const rightCount:integer ):string; + +// Produces a string from n padded on the left with 0's +// to width chars +Function StrLeft0Pad( const n: integer; const width: integer ): string; + +// Returns true if s starts with start (case insensitive) +Function StrStarts( const start: string; const s: string ): boolean; + +// Returns true if s ends with endstr (case insensitive) +Function StrEnds( const endStr: string; const s: string ): boolean; + +// Returns first word from S +Function StrFirstWord( const S: String ): string; + +// prefixes all occurences of one of the chars in aReceiver with +// anEscape char if the escapeChar itself is found, then it is doubled +Function StrEscapeAllCharsBy(Const aReceiver: String; const aSetOfChars: TSetOfChars; const anEscapeChar: char): String; + +// Trims punctuation characters from start and end of s +// such as braces, periods, commas. +procedure TrimPunctuation( var s: string ); + +// Returns true if S contains a URL. MAY MODIFY CONTENTS OF S +function CheckAndEncodeURL( var s: string ): boolean; + +// ------------ Seperated value utilities --------------------- + +// Returns the next item starting at Index. Spaces are the separator, +// unless the item is quoted with QuoteChar, in which case it looks for +// a closing quote. Occurrences of the QuoteChar in the item itself, +// can be escaped with a duplicate, e.g. "He said ""bok""" +Procedure GetNextQuotedValue( + const S: string; + var Index: longint; + var Value: string; + const QuoteChar: char ); + +procedure GetNextValue( + const S: String; + var Index: longint; + var Value: string; + const Seperator: char ); + +// Extract all fields in a String delimited by whitespace (blank or tab). +// use double quotes if you need blanks in the strings +Procedure StrExtractStringsQuoted(Var aResult: TStrings; const aReceiver: String); + +// Extract all fields in a String given a set of delimiter characters and +// an optional escape character usable to escape field delimits. +// Example: +// StrExtractStrings('1x2x3\x4', 'x', '\') -> +// returns 4 strings: '1', '', '2' and '3x4' +procedure StrExtractStrings(var aResult : TStrings; const aReceiver: String; const aSetOfChars: TSetOfChars; const anEscapeChar: char); + +// Removes and returns the first value in a separated +// value list (removes quotes if found) +Function ExtractNextValue( + var S: string; + const Separator: string ): string; + +Function ExtractNextValueNoTrim( + var S: string; + const Separator: string ): string; + + +// Parses a line of the form +// key = value into it's components +Procedure ParseConfigLine( const S: string; + var KeyName: string; + var KeyValue: string ); + +// Removes spaces around the separator in the given string +Procedure RemoveSeparatorSpaces( var S: string; const Separator:string ); + +{$ifdef os2} +// ------------ Ansi String utilities ------------------------ + +// Right & left trim that works with AnsiStrings. +Function AnsiTrim( const S: AnsiString ): AnsiString; + +Procedure AnsiParseConfigLine( const S: Ansistring; + var keyName: Ansistring; + var keyValue: Ansistring ); + +Function AnsiExtractNextValue( var CSVString: AnsiString; + const Separator: AnsiString ): AnsiString; + +{$endif} + +// ------------- Lists of strings, and strings as lists ----------- + +// Adds NewValue to S as a separated list +Procedure AddToListString( Var S: string; + const NewValue: string; + const Separator: string ); + +Function ListToString( List: TStrings; + const Separator: string ): string; + +procedure StringToList( S: String; + List: TStrings; + const Separator: string ); + +// Reverse the given list. It must be set to not sorted +Procedure ReverseList( TheList: TStrings ); + +// Sort the given list into reverse alphabetical order +//Procedure ReverseSortList( TheList: TStringList ); + +// Find the given string in the given list, using +// case insensitive searching (and trimming) +// returns -1 if not found +Function FindStringInList( const TheString: string; + TheList:TStrings ):longint; + +Procedure MergeStringLists( Dest: TStringList; + AdditionalList: TStringList ); + +// ---------------------- PCHAR Utilities --------------------------------------- + +function StrNPas( const ps: PChar; const Length: integer ): String; + +// Returns a - b +Function PCharDiff( const a: PChar; const b: Pchar ): longword; + +// trims spaces and carriage returns of the end of Text +procedure TrimWhitespace( Text: PChar ); + + +function TrimChars( const s: string; + chars: TSetOfChars ): string; + +// Concatenates a pascal string onto a PCHar string +// Resizes if needed +procedure StrPCat( Var Dest: PChar; + const StringToAdd: string ); + +// Trim endlines (#10 or #13) off the end of +// the given string. +Procedure TrimEndLines( const S: PChar ); + +// Allocates enough memory for a copy of s as a PChar +// and copies s to it. +Function StrDupPas( const s: string ): PChar; + +// Returns a copy of the first n chars of s +Function StrNDup( const s: PChar; const n: integer ): PChar; + +// Returns a copy of the first line starting at lineStart +Function CopyFirstLine( const lineStart: PChar ): PChar; + +// Returns next line p points to +Function NextLine( const p: PChar): PChar; + +// Concatentate AddText to Text. Reallocate and expand +// Text if necessary. This is a size-safe StrCat +Procedure AddAndResize( Var Text: PChar; + const AddText: PChar ); + +// Copy Source to Dest. Reallocate and expand +// Dest if necessary. This is a size-safe StrCopy +Procedure StrCopyAndResize( Var Dest: PChar; + const Source: PChar ); + +// Return "True" or "False" +Function BoolToStr( const b: boolean ): string; + +// Return true if param matches the form +// /Flag:value +// dash (-) can be used instead of slash (/) +// colon can be omitted +function MatchValueParam( const Param: string; + const Flag: string; + var Value: string ): boolean; + +// Return true if param matches the form +// /Flag +// dash (-) can be used instead of slash (/) +function MatchFlagParam( const Param: string; const Flag: string ): boolean; + +// returns true if the String starts with the provided one +// this is case INsensitive +function StrStartsWithIgnoringCase(const aReceiver: String; const aStartString: String): Boolean; + +// returns true if the String ends with the provided one +// this is case INsensitive +function StrEndsWithIgnoringCase(const aReceiver: String; const anEndString: String): Boolean; + +function StrIsEmptyOrSpaces(const AText: string): boolean; + +implementation + +Uses + SysUtils + ,nvUtilities + ; + +// ---------------------- Pascal String Utilities --------------------------------------- + +Procedure SkipChar( const S: string; + Var index: longint; + const C: Char ); +begin + while Index <= Length( S ) do + begin + if S[ Index ] <> C then + break; + inc( Index ); + end; +end; + + +Procedure GetNextQuotedValue( + const S: string; + var Index: longint; + var Value: string; + const QuoteChar: char ); +begin + Value := ''; + SkipChar( S, Index, ' ' ); + if Index > Length( S ) then + exit; + + if S[ Index ] <> QuoteChar then + begin + // not quoted, go to next space + while Index <= Length( S ) do + begin + if S[ Index ] = ' ' then + break; + Value := Value + S[ Index ]; + inc( Index ); + end; + // skip following spaces + SkipChar( S, Index, ' ' ); + exit; + end; + + // quoted string + inc( Index ); // skip opening quote + + while Index <= Length( S ) do + begin + if S[ Index ] = QuoteChar then + begin + inc( index ); // skip closing quote + if Index > Length( S ) then + break; // done + if S[ Index ] <> QuoteChar then + break; // done + + // escaped quote e.g "" so we do want it. + end; + Value := Value + S[ Index ]; + inc( Index ); + end; + + SkipChar( S, Index, ' ' ); + +end; + +Function InsertDuplicateChars( const S: string; + const QuoteChar: char ): string; +var + i: integer; +begin + Result := ''; + for i := 1 to Length( S ) do + begin + Result := Result + S[ i ]; + if S[ i ] = QuoteChar then + Result := Result + QuoteChar; // insert duplicate + end; +end; + +Function FindSubstring( const SubString: string; + const S: string ): integer; +begin + Result := Pos( Uppercase( SubString ), + Uppercase( S ) ); +end; + +Function MatchLeadingChars( + const S: string; + MatchFunction: TCharMatchFunction ): string; +var + i: integer; + TheChar: char; +begin + Result:= ''; + i := 1; + while i <= Length( S ) do + begin + TheChar:= S[ i ]; + if not MatchFunction( TheChar ) then + // found a non matching char. Stop looking + break; + Result:= Result + TheChar; + inc( i ); + end; +end; + +Function ExtractLeadingChars( + Var S: string; + MatchFunction: TCharMatchFunction ): string; +begin + Result := MatchLeadingChars( s, MatchFunction ); + if Length( Result ) > 0 then + // remove matching section from string + Delete( S, 1, Length( Result ) ); +end; + +// Hex conversion: sheer extravagance. Conversion from +// a hex digit char to int is done by creating a lookup table +// in advance. +var + MapHexDigitToInt: array[ Chr( 0 ) .. Chr( 255 ) ] of longint; + +procedure InitHexDigitMap; +var + c: char; + IntValue: longint; +begin + for c := Chr( 0 ) to Chr( 255 ) do + begin + IntValue := -1; + if ( c >= '0' ) + and ( c <= '9' ) then + IntValue := Ord( c ) - Ord( '0' ); + + if ( Upcase( c ) >= 'A' ) + and ( Upcase( c ) <= 'F' ) then + IntValue := 10 + Ord( Upcase( c ) ) - Ord( 'A' ); + + MapHexDigitToInt[ c ] := IntValue; + end; +end; + +function HexDigitToInt( c: char ): longint; +begin + Result := MapHexDigitToInt[ c ]; + if Result = -1 then + raise EConvertError.Create( 'Invalid hex char: ' + c ); +end; + +function HexToInt( s: string ): longint; +var + i: integer; +begin + if Length( s ) = 0 then + raise EConvertError.Create( 'No chars in hex string' ); + Result := 0; + for i:= 1 to Length( s ) do + begin + Result := Result shl 4; + inc( Result, HexDigitToInt( s[ i ] ) ); + end; +end; + +Function StringsSame( const a, b: string ): boolean; +begin + Result:= CompareText( a, b ) = 0; +end; + +// Returns S in single quotes +Function StrQuote( const s: string ): string; +begin + Result := StrSingleQuote + s + StrSingleQuote; +end; + +// Returns S without double quotes +Function StrUnQuote( const s: string ): string; +begin + Result := S; + if S = '' then + exit; + + if Result[ 1 ] = StrSingleQuote then + Delete( Result, 1, 1 ); + + if Result = '' then + exit; + + if Result[ Length( Result ) ] = StrSingleQuote then + Delete( Result, Length( Result ), 1 ); +end; + +Function StrFullDoubleQuote( const s: string ): string; +begin + Result := StrDoubleQuote + + InsertDuplicateChars( s, '"' ) + + StrDoubleQuote; +end; + +// Returns S without double quotes +Function StrUnDoubleQuote( const s: string ): string; +begin + Result := S; + if S = '' then + exit; + + if Result[ 1 ] = StrDoubleQuote then + Delete( Result, 1, 1 ); + + if Result = '' then + exit; + + if Result[ Length( Result ) ] = StrDoubleQuote then + Delete( Result, Length( Result ), 1 ); +end; + +Function StrInSingleQuotes(const aString : String) : String; +begin + Result := StrSingleQuote + aString + StrSingleQuote; +end; + +Function StrInDoubleQuotes(const aString : String) : String; +begin + Result := StrDoubleQuote + aString + StrDoubleQuote; +end; + +Function SubstituteChar( const S: string; const Find: Char; const Replace: Char ): string; +Var + i: longint; +Begin + Result:= S; + for i:=1 to length( S ) do + if Result[ i ] = Find then + Result[ i ]:= Replace; +End; + +Function StrRight( const S:string; const count:integer ):string; +Begin + if count>=length(s) then + begin + Result:=S; + end + else + begin + Result:=copy( S, length( s )-count+1, count ); + end; +end; + +Function StrLeft( const S:string; const count:integer ):string; +Begin + if count>=length(s) then + Result:=S + else + Result:=copy( S, 1, count ); +end; + +// Returns S minus count characters from the right +Function StrLeftWithout( const S:string; const count:integer ):string; +Begin + Result:= copy( S, 1, length( S )-count ); +End; + +Function StrRemoveEnds( const S:string; const leftCount:integer; const rightCount:integer ):string; +Begin + Result:= S; + Delete( Result, 1, leftCount ); + Delete( Result, length( S )-rightCount, rightCount ); +End; + +Function StrRightFrom( const S:string; const start:integer ):string; +Begin + Result:= copy( S, start, length( S )-start+1 ); +end; + +Procedure ParseConfigLine( const S: string; + var keyName: string; + var keyValue: string ); +Var + line: String; + EqualsPos: longint; +Begin + KeyName:= ''; + KeyValue:= ''; + + line:= trim( S ); + EqualsPos:= Pos( '=', line ); + + if ( EqualsPos>0 ) then + begin + KeyName:= line; + Delete( KeyName, EqualsPos, length( KeyName )-EqualsPos+1 ); + KeyName:= Trim( KeyName ); + + KeyValue:= line; + Delete( KeyValue, 1, EqualsPos ); + KeyValue:= Trim( KeyValue ); + end; +end; + +Function ExtractNextValueNoTrim( var S: string; + const Separator: string ): string; +Var + SeparatorPos: integer; +Begin + SeparatorPos := Pos( Separator, S ); + if SeparatorPos > 0 then + begin + Result := Copy( S, 1, SeparatorPos-1 ); + Delete( S, 1, SeparatorPos + length( Separator ) - 1 ); + end + else + begin + Result := S; + S := ''; + end; +end; + +Function ExtractNextValue( var S: string; + const Separator: string ): string; +begin + Result := ExtractNextValueNoTrim( S, Separator ); + Result := trim( Result ); + + // Remove quotes if present + if Result <> '' then + if Result[ 1 ] = StrDoubleQuote then + Delete( Result, 1, 1 ); + + if Result <> '' then + if Result[ length( Result ) ] = StrDoubleQuote then + Delete( Result, length( Result ), 1 ); +end; + +procedure GetNextValue( const S: String; + Var Index: longint; + Var Value: String; + const Seperator: Char ); +var + NextSeperatorPosition: longint; + StringLen: longint; +begin + Value := ''; + StringLen := Length( S ); + if Index > StringLen then + exit; + NextSeperatorPosition := Index; + while NextSeperatorPosition < StringLen do + begin + if S[ NextSeperatorPosition ] = Seperator then + break; + inc( NextSeperatorPosition ); + end; + + if NextSeperatorPosition < StringLen then + begin + Value := Copy( S, + Index, + NextSeperatorPosition - Index ); + Index := NextSeperatorPosition + 1; + end + else + begin + Value := Copy( S, + Index, + StringLen - Index + 1 ); + Index := StringLen + 1; + end; + TrimRight( Value ); +end; + +Procedure StrExtractStringsQuoted(Var aResult: TStrings; const aReceiver: String); +Var + tmpState : (WHITESPACE, INSIDE, START_QUOTE, INSIDE_QUOTED, INSIDE_QUOTED_START_QUOTE); + tmpCurrentParsePosition : Integer; + tmpCurrentChar : Char; + tmpPart : String; + +Begin + if (length(aReceiver) < 1) then exit; + + tmpState := WHITESPACE; + tmpPart := ''; + + tmpCurrentParsePosition := 1; + + for tmpCurrentParsePosition:=1 to length(aReceiver) do + begin + tmpCurrentChar := aReceiver[tmpCurrentParsePosition]; + + Case tmpCurrentChar of + ' ', StrTAB : + begin + + Case tmpState of + + WHITESPACE : + begin + // nothing + end; + + INSIDE : + begin + aResult.add(tmpPart); + tmpPart := ''; + tmpState := WHITESPACE; + end; + + INSIDE_QUOTED : + begin + tmpPart := tmpPart + tmpCurrentChar; + end; + + START_QUOTE : + begin + tmpPart := tmpPart + tmpCurrentChar; + tmpState := INSIDE_QUOTED; + end; + + INSIDE_QUOTED_START_QUOTE : + begin + aResult.add(tmpPart); + tmpPart := ''; + tmpState := WHITESPACE; + end; + end; + end; + + StrDoubleQuote : + begin + + Case tmpState of + + WHITESPACE : + begin + tmpState := START_QUOTE; + end; + + INSIDE : + begin + aResult.add(tmpPart); + tmpPart := ''; + tmpState := START_QUOTE; + end; + + INSIDE_QUOTED : + begin + tmpState := INSIDE_QUOTED_START_QUOTE; + end; + + START_QUOTE : + begin + tmpState := INSIDE_QUOTED_START_QUOTE; + end; + + INSIDE_QUOTED_START_QUOTE : + begin + tmpPart := tmpPart + tmpCurrentChar; + tmpState := INSIDE_QUOTED; + end; + end; + end; + + else + begin + Case tmpState of + + WHITESPACE : + begin + tmpPart := tmpPart + tmpCurrentChar; + tmpState := INSIDE; + end; + + INSIDE, INSIDE_QUOTED : + begin + tmpPart := tmpPart + tmpCurrentChar; + end; + + START_QUOTE : + begin + tmpPart := tmpPart + tmpCurrentChar; + tmpState := INSIDE_QUOTED; + end; + + INSIDE_QUOTED_START_QUOTE : + begin + aResult.add(tmpPart); + tmpPart := tmpCurrentChar; + tmpState := INSIDE; + end; + end; + end; + + end; + end; + + Case tmpState of + WHITESPACE, START_QUOTE : {nothing to do}; + + INSIDE, INSIDE_QUOTED, INSIDE_QUOTED_START_QUOTE : + begin + aResult.add(tmpPart); + end; + end; +end; + +Procedure PrivateStrExtractStrings( Var aResult: TStrings; + const aReceiver: String; + const aSetOfChars: TSetOfChars; + const anEscapeChar: char; + const anIgnoreEmptyFlag : boolean); +Var + i : Integer; + tmpChar,tmpNextChar : Char; + tmpPart: String; +Begin + if (length(aReceiver) < 1) then exit; + + tmpPart := ''; + + i := 1; + while i <= length(aReceiver) do + begin + tmpChar := aReceiver[i]; + if i < length(aReceiver) then + tmpNextChar := aReceiver[i+1] + else + tmpNextChar := #0; + + if (tmpChar = anEscapeChar) and (tmpNextChar = anEscapeChar) then + begin + tmpPart := tmpPart + anEscapeChar; + i := i + 2; + end + else + if (tmpChar = anEscapeChar) and (tmpNextChar in aSetOfChars) then + begin + tmpPart := tmpPart + tmpNextChar; + i := i + 2; + end + else + begin + if (tmpChar in aSetOfChars) then + begin + if (NOT anIgnoreEmptyFlag) OR ('' <> tmpPart) then + aResult.add(tmpPart); + tmpPart := ''; + i := i + 1; + end + else + begin + tmpPart := tmpPart + tmpChar; + i := i + 1; + end; + end; { if/else } + end; + + if (NOT anIgnoreEmptyFlag) OR ('' <> tmpPart) then + begin + aResult.add(tmpPart); + end; +end; + +procedure StrExtractStrings(Var aResult: TStrings; Const aReceiver: String; const aSetOfChars: TSetOfChars; const anEscapeChar: char); +begin + PrivateStrExtractStrings(aResult, aReceiver, aSetOfChars, anEscapeChar, false); +end; + + +Function IsDigit( const c: char ): boolean; +Begin + Result:=( c>='0' ) and ( c<='9' ); +End; + +Function IsNonDigit( const c: char ): boolean; +Begin + Result:=( c<'0' ) or ( c>'9' ); +End; + +Function IsAlpha( const c: char ): boolean; +var + UppercaseC: char; +Begin + UppercaseC := UpCase( c ); + Result := ( UppercaseC >= 'A' ) and ( UppercaseC <= 'Z' ); +end; + +{$ifdef os2} +// Returns true if s is only spaces (or empty) +Function IsSpaces( const s: string ): boolean; +Begin + Asm + MOV ESI,s // get address of s into ESI + MOV CL,[ESI] // get length of s + MOVZX ECX, CL // widen CL + INC ECX + +!IsSpacesLoop: + INC ESI // move to next char + DEC ECX + JE !IsSpacesTrue + + MOV AL,[ESI] // load character + CMP AL,32 // is it a space? + JE !IsSpacesLoop // yes, go to next + + // no, return false + MOV EAX, 0 + JMP !IsSpacesDone + +!IsSpacesTrue: + MOV EAX, 1 + +!IsSpacesDone: + LEAVE + RETN32 4 + End; + +End; +{$else} +// Returns true if s is only spaces (or empty) +Function IsSpaces( const s: string ): boolean; +var + i: longint; +Begin + for i := 1 to length( s ) do + begin + if s[ i ] <> ' ' then + begin + result := false; + exit; + end; + end; + result := true; +end; +{$endif} + +Function StrLeft0Pad( const n: integer; const width: integer ): string; +Begin + Result:= IntToStr( n ); + while length( Result )<width do + Result:= '0' +Result; +End; + +// Returns true if s starts with start +Function StrStarts( const start: string; const s: string ): boolean; +Var + i: integer; +Begin + Result:= false; + if length( start ) > length( s ) then + exit; + for i:= 1 to length( start ) do + if UpCase( s[ i ] ) <> UpCase( start[ i ] ) then + exit; + Result:= true; +End; + +// Returns true if s ends with endstr (case insensitive) +Function StrEnds( const endStr: string; const s: string ): boolean; +Var + i, j: integer; +Begin + Result:= false; + if Length( s ) < length( endStr ) then + exit; + j:= Length( s ); + for i:= length( endstr ) downto 1 do + begin + if UpCase( s[ j ] ) <> UpCase( endStr[ i ] ) then + exit; + dec( j ); + end; + Result:= true; +End; + +Procedure RemoveSeparatorSpaces( var S: string; + const Separator:string ); +Var + SeparatorPos:integer; + NewString: string; +Begin + NewString := ''; + while S <> '' do + begin + SeparatorPos := pos( Separator, S ); + if SeparatorPos > 0 then + begin + NewString := NewString + + trim( copy( S, 1, SeparatorPos - 1 ) ) + + Separator; + Delete( S, 1, SeparatorPos ); + end + else + begin + NewString := NewString + trim( S ); + S := ''; + end; + end; + S := NewString; +End; + +Procedure AddToListString( Var S: string; + const NewValue: string; + const Separator: string ); +Begin + if trim( S )<>'' then + S:=S+Separator; + S:=S+NewValue; +End; + +Function ListToString( List: TStrings; + const Separator: string ): string; +Var + i: longint; +Begin + Result:= ''; + for i:= 0 to List.Count - 1 do + AddToListString( Result, List[ i ], Separator ); +End; + +procedure StringToList( S: String; + List: TStrings; + const Separator: string ); +var + Item: string; +begin + List.Clear; + while S <> '' do + begin + Item:= ExtractNextValue( S, Separator ); + List.Add( Item ); + end; +end; + +Function StrFirstWord( const S: String ): string; +Var + SpacePos: longint; + temp: string; +Begin + temp:= trimleft( S ); + SpacePos:= pos( ' ', temp ); + if SpacePos>0 then + Result:= Copy( temp, 1, SpacePos-1 ) + else + Result:= temp; +End; + +Function StrEscapeAllCharsBy(Const aReceiver: String; const aSetOfChars: TSetOfChars; const anEscapeChar: char): String; +Var + i : Integer; + tmpChar : Char; +Begin + Result := ''; + + for i := 1 To length(aReceiver) do + begin + tmpChar := aReceiver[i]; + + if (tmpChar = anEscapeChar) or (tmpChar IN aSetOfChars) then + result := result + anEscapeChar + tmpChar + else + result := result + tmpChar; + end; +end; + +const + StartPunctuationChars: set of char = + [ '(', '[', '{', '<', '''', '"' ]; + + EndPunctuationChars: set of char = + [ ')', ']', '}', '>', '''', '"', '.', ',', ':', ';', '!', '?' ]; + +procedure TrimPunctuation( var s: string ); +var + ChangesMade: boolean; + c: Char; +begin + while Length(s) > 0 do + begin + ChangesMade := false; + c := s[1]; + if c in StartPunctuationChars then + begin + ChangesMade := true; + Delete(s, 1, 1); + end; + + if Length(s) = 0 then + exit; + + c := s[Length(s)]; + if c in EndPunctuationChars then + begin + ChangesMade := true; + Delete(s, Length(s), 1); + end; + + if not ChangesMade then + exit; // done + end; +end; + +function IsDomainName( const s: string; StartingAt: longint ): boolean; +var + DotPos: longint; + t: string; +begin + Result := false; + t := Copy(s, StartingAt+1, Length(s)); + + // must be a dot in the domain... + DotPos := pos('.', t); + if DotPos = 0 then + // nope + exit; + + // must be some text between start and dot, + // and between dot and end + // ie. a.b not .b or a. + + if DotPos = Length(t) then + // no b; + exit; + + Result := true; +end; + +function IsEmailAddress( const s: string ): boolean; +var + AtPos: longint; + SecondAtPos: longint; +begin + result := false; + // must be a @... + AtPos := pos('@', s); + if AtPos = 0 then + // no @ + exit; + if AtPos = 1 then + // can't be the first char though + exit; + + // there is? There must be only one though... + SecondAtPos := LastDelimiter('@', s); + if (SecondAtPos <> AtPos) then + // there's a second @ + exit; + + Result := IsDomainName( s, AtPos + 1 ); +end; + +function CheckAndEncodeURL( var s: string ): boolean; + // simple userfriendly routine + function StartsWith(const s:string; const text: string): boolean; + begin + Result := pos(text, s) = 1; + end; + +begin + + if StartsWith(s, 'www.') then + begin + if not IsDomainName( s, 4 ) then + exit; + Insert('http://', s, 1); + Result := true; + exit; + end; + + if StartsWith(s, 'ftp.') then + begin + if not IsDomainName( s, 4 ) then + exit; + Insert('ftp://', s, 1); + Result := true; + exit; + end; + + if StartsWith(s, 'http://' ) + or StartsWith(s, 'https://' ) + or StartsWith(s, 'ftp://' ) + or StartsWith(s, 'mailto:' ) + or StartsWith(s, 'news:' ) then + begin + Result := true; + exit; + end; + + if IsEmailAddress( s ) then + begin + Insert('mailto:', s, 1); + Result := true; + exit; + end; + + Result := false; +end; + +Function IncrementNumberedString( StartString: string ): string; +Var + Number: string; + NewNumber: string; + i: integer; +begin + // Extract any digits at the end of the string + i:= length( StartString ); + Number:= ''; + while i>0 do + begin + if isDigit( StartString[i] ) then + begin + Number:= StartString[i] + Number; + i:= i - 1; + end + else + break; + end; + + if Number<>'' then + begin + // Found a numeric bit to play with + // Copy the first part + Result:= StrLeftWithout( StartString, length( Number ) ); + NewNumber:= StrLeft0Pad( StrToInt( Number ) + 1, + length( Number ) ); + Result:= Result + NewNumber; + end + else + // No build number, add a 1 + Result:= StartString + '1'; +end; + +{$ifdef OS2} + +Function AnsiTrim( const S: AnsiString ): AnsiString; +Var + i: longint; +Begin + i:= 1; + while i<length( S) do + begin + if S[ i ]<>' ' then + break; + inc( i ); + end; + Result:= S; + if i>1 then + AnsiDelete( Result, 1, i-1 ); + i:= length( Result ); + while i>=1 do + begin + if S[ i ]<>' ' then + break; + dec( i ); + end; + AnsiSetLength( Result, i ); +End; + +Procedure AnsiParseConfigLine( const S: Ansistring; + var keyName: Ansistring; + var keyValue: Ansistring ); +Var + line: AnsiString; + EqualsPos: longint; +Begin + KeyName:= ''; + KeyValue:= ''; + + line:= AnsiTrim( S ); + EqualsPos:= AnsiPos( '=', line ); + + if ( EqualsPos>0 ) then + begin + KeyName:= AnsiCopy( line, 1, EqualsPos-1 ); + KeyName:= AnsiTrim( KeyName ); + + KeyValue:= AnsiCopy( line, EqualsPos+1, length( line )-EqualsPos ); + KeyValue:= AnsiTrim( KeyValue ); + end; +end; + +Function AnsiExtractNextValue( var CSVString: AnsiString; + const Separator: AnsiString ): AnsiString; +Var + SeparatorPos: integer; +Begin + SeparatorPos:= AnsiPos( Separator, CSVString ); + if SeparatorPos>0 then + begin + Result:= AnsiCopy( CSVString, 1, SeparatorPos-1 ); + AnsiDelete( CSVString, 1, SeparatorPos + length( Separator ) - 1 ); + end + else + begin + Result:= CSVString; + CSVString:= ''; + end; + Result:= AnsiTrim( Result ); + // Remove qyotes if present + if ( Result[1] = chr(34) ) + and ( Result[ length(Result) ] = chr(34) ) then + begin + AnsiDelete( Result, 1, 1 ); + AnsiDelete( Result, length( Result ), 1 ); + Result:= AnsiTrim( Result ); + end; +end; +{$Endif} + +Procedure ReverseList( TheList:TStrings ); +Var + TempList: TStringList; + i: integer; +Begin + TempList:= TStringList.Create; + for i:=TheList.count-1 downto 0 do + begin + TempList.AddObject( TheList.Strings[i], + TheList.Objects[i] ); + end; + TheList.Assign( TempList ); + TempList.Destroy; +end; + +Function FindStringInList( const TheString: string; + TheList:TStrings ): longint; +Var + i: longint; +Begin + for i:=0 to TheList.count-1 do + begin + if StringsSame( TheString, TheList[ i ] ) then + begin + // found + Result:=i; + exit; + end; + end; + Result:=-1; +End; + +Procedure MergeStringLists( Dest: TStringList; + AdditionalList: TStringList ); +var + i: integer; + s: string; +begin + for i:= 0 to AdditionalList.Count - 1 do + begin + s:= AdditionalList[ i ]; + if FindStringInList( s, Dest ) = -1 then + Dest.AddObject( s, AdditionalList.Objects[ i ] ); + end; +end; + +// ---------------------- PCHAR Utilities --------------------------------------- + +function StrNPas( const Ps: PChar; const Length: integer ): String; +var + i: integer; +begin + Result:= ''; + i:= 0; + while ( Ps[ i ] <> #0 ) and ( i < Length ) do + begin + Result:= Result + Ps[ i ]; + inc( i ); + end; +end; + +Function PCharDiff( const a: PChar; const b: Pchar ): longword; +begin + Result:= longword( a ) - longword( b ); +end; + +Procedure CheckPCharSize( Var Text: PChar; + const NeededSize: longword ); +var + temp: PChar; + NewBufferSize: longword; +begin + if ( NeededSize + 1 ) // + 1 to allow for null terminator + > StrBufSize( Text ) then + begin + // allocate new buffer, double the size... + NewBufferSize:= StrBufSize( Text ) * 2; + // or if that's not enough... + if NewBufferSize < ( NeededSize + 1 ) then + // double what we are going to need + NewBufferSize:= NeededSize * 2; + temp:= StrAlloc( NewBufferSize ); + + // copy string to new buffer + StrCopy( temp, Text ); + StrDispose( Text ); + Text:= temp; + end; +end; + +Procedure AddAndResize( Var Text: PChar; const AddText: PChar ); +var + s: string; + s1, s2: string; +begin + //CheckPCharSize( Text, + // strlen( Text ) + // + strlen( AddText ) ); + //StrCat( Text, AddText ); + s1 := Text; + s2 := AddText; + s := s1 + s2; + StrDispose(Text); + Text := StrAlloc(length(s) + 1); + StrPCopy(Text, s); +end; + +Procedure StrCopyAndResize( Var Dest: PChar; + const Source: PChar ); +begin + CheckPCharSize( Dest, StrLen( Source ) ); + StrCopy( Dest, Source ); +end; + +// trims spaces and carriage returns of the end of Text +procedure TrimWhitespace( Text: PChar ); +var + P: PChar; + IsWhitespace: boolean; + TheChar: Char; +begin + P:= Text + StrLen( Text ); + while P > Text do + begin + dec( P ); + TheChar:= P^; + IsWhitespace:= TheChar in [ ' ', #13, #10, #9 ]; + if not IsWhiteSpace then + // done + break; + P[ 0 ]:= #0; // Do no use P^ := + end; +end; + +function TrimChars( const s: string; + chars: TSetOfChars ): string; +var + i: longint; + j: longint; +begin + i := 1; + while i < Length( s ) do + if s[ i ] in chars then + inc( i ) + else + break; + + j := Length( s ); + while j > i do + if s[ j ] in chars then + dec( j ) + else + break; + + result := Copy( s, i, j - i + 1 ); +end; + +procedure StrPCat( Var Dest: PChar; + const StringToAdd: string ); +var + Index: longint; + DestP: PChar; +begin + CheckPCharSize( Dest, + StrLen( Dest ) + + longword( Length( StringToAdd ) ) ); + DestP:= Dest + StrLen( Dest ); + for Index:= 1 to Length( StringToAdd ) do + begin + DestP[ 0 ]:= StringToAdd[ Index ]; // do not use DestP^ := + inc( DestP ); + end; + DestP[ 0 ]:= #0; // Do not use DestP^ := #0; Under Sibyl at least, this writes *** 2 NULL BYTES!!! *** +end; + +Procedure TrimEndLines( const S: PChar ); +var + StringIndex: integer; +begin + StringIndex:= strlen( S ); + while StringIndex > 0 do + begin + dec( StringIndex ); + if S[ StringIndex ] in [ #10, #13 ] then + begin + S[ StringIndex ]:= #0 + end + else + break; + end; +end; + +Function StrDupPas( const s: string ): PChar; +Begin + Result:=StrAlloc( length( s )+1 ); + StrPCopy( Result, S ); +// Result^:=s; +End; + +// Returns a copy of the first n chars of s +Function StrNDup( const s: PChar; const n: integer ): PChar; +Begin + Result:= StrAlloc( n+1 ); + Result[ n ]:= '6'; + StrLCopy( Result, s, n ); +End; + +// Returns a copy of the first line starting at lineStart +Function CopyFirstLine( const lineStart: PChar ): PChar; +Var + lineEnd: PChar; + lineLength: integer; +Begin + // look for an end of line + lineEnd:= strpos( lineStart, EndLine ); + if lineEnd <> nil then + begin + // found, line length is difference between line end position and start of line + lineLength:= longword( lineEnd )-longword( lineStart ); // ugly but how else can it be done? + Result:= StrNDup( lineStart, lineLength ); + exit; + end; + + // no eol found, return copy of remainder of string + Result:= StrNew( lineStart ); +end; + +// Returns next line p points to +Function NextLine( const p: PChar): PChar; +Var + lineEnd: PChar; +Begin + // look for an end of line + lineEnd:=strpos( p, EndLine ); + if lineEnd<>nil then + begin + // Advance the linestart over the eol + Result:=lineEnd+length( EndLine ); + exit; + end; + + // no eol found, return pointer to null term + Result:=p+strlen( p ); +end; + +Function CaseInsensitivePos( const a: string; const b: string ): longint; +begin + Result := Pos( UpperCase( a ), Uppercase( b ) ); +end; + + +Function BoolToStr( const b: boolean ): string; +begin + if b then + Result := 'True' + else + Result := 'False'; +end; + +// Return true if param matches the form +// /Flag:value +// dash (-) can be used instead of slash (/) +// colon can be omitted +function MatchValueParam( const Param: string; + const Flag: string; + var Value: string ): boolean; +begin + Result := false; + + if Param = '' then + exit; + + if ( Param[ 1 ] <> '/' ) + and ( Param[ 1 ] <> '-' ) then + exit; + + if not StringsSame( Copy( Param, 2, Length( Flag ) ), + Flag ) then + exit; + + Result := true; + + Value := StrRightFrom( Param, 2 + Length( Flag ) ); + if Value <> '' then + if Value[ 1 ] = ':' then + Delete( Value, 1, 1 ); +end; + +// Return true if param matches the form +// /Flag +// dash (-) can be used instead of slash (/) +function MatchFlagParam( const Param: string; + const Flag: string ): boolean; +begin + Result := false; + + if Param = '' then + exit; + + if ( Param[ 1 ] <> '/' ) + and ( Param[ 1 ] <> '-' ) then + exit; + + Result := StringsSame( StrRightFrom( Param, 2 ), + Flag ); +end; + +function StrStartsWithIgnoringCase(const aReceiver: String; const aStartString: String): Boolean; +var + tmpStringPos : integer; + tmpStartStringLength : integer; +begin + tmpStartStringLength := Length(aStartString); + + if Length(aReceiver) < tmpStartStringLength then + begin + result := false; + exit; + end; + + for tmpStringPos := 1 to tmpStartStringLength do + begin + if UpCase(aReceiver[tmpStringPos]) <> UpCase(aStartString[tmpStringPos]) then + begin + result := false; + exit; + end; + end; + + result := true; +end; + +Function StrEndsWithIgnoringCase(const aReceiver: String; const anEndString: String): Boolean; +Var + tmpStringPos : Longint; + tmpMatchPos : Longint; +Begin + tmpStringPos := length(aReceiver); + tmpMatchPos := length(anEndString); + + if tmpMatchPos > tmpStringPos then + begin + result := false; + exit; + end; + + while tmpMatchPos > 0 do + begin + if upcase(aReceiver[tmpStringPos]) <> upcase(anEndString[tmpMatchPos]) then + begin + result := false; + exit; + end; + dec(tmpMatchPos); + dec(tmpStringPos); + end; + + result := true; +end; + +function StrIsEmptyOrSpaces(const AText: string): boolean; +begin + Result := Trim(AText) = ''; +end; + +{ TSerializableStringList } + +constructor TSerializableStringList.Create; +begin + LogEvent(LogObjConstDest, 'TSerializableStringList createdestroy'); + inherited Create; + stringList := TStringList.Create; +end; + +destructor TSerializableStringList.Destroy; +begin + LogEvent(LogObjConstDest, 'TSerializableStringList destroy'); + stringList.Free; + inherited Destroy; +end; + +function TSerializableStringList.getCount: LongInt; +begin + Result := stringlist.Count; +end; + +function TSerializableStringList.get(const anIndex: LongInt): String; +begin + Result := stringList[anIndex]; +end; + +function TSerializableStringList.getSerializedString: String; +var + i: Integer; +begin + Result := ''; + for i := 0 to stringList.count-1 do + begin + if (i > 0) then result := result + '&'; + Result := Result + StrEscapeAllCharsBy(stringList[i], ['&'], '\'); + end; +end; + +procedure TSerializableStringList.add(const aString: String); +begin + stringList.add(aString); +end; + +procedure TSerializableStringList.readValuesFromSerializedString(const aSerializedString: String); +begin + if length(aSerializedString) < 1 then + exit; + LogEvent(LogObjConstDest, 'readValuesFromSerializedString'); + stringList.Clear; + LogEvent(LogObjConstDest, 'readValuesFromSerializedString clear done'); + StrExtractStrings(stringList, aSerializedString, ['&'], '\'); +end; + +initialization + InitHexDigitMap; + +End. diff --git a/docview/components/richtext/CanvasFontManager.pas b/docview/components/richtext/CanvasFontManager.pas new file mode 100644 index 00000000..7996c16d --- /dev/null +++ b/docview/components/richtext/CanvasFontManager.pas @@ -0,0 +1,1130 @@ +Unit CanvasFontManager; + +{$mode objfpc}{$H+} + +Interface + +Uses + Classes + ,fpg_base + ,fpg_main + ,fpg_widget + ; + +Const + // This defines the fraction of a pixel that + // font character widths will be given in + FontWidthPrecisionFactor = 1; // 256 seems to be specific to OS/2 API + DefaultTopicFont = 'Sans'; + DefaultTopicFontSize = '10'; + DefaultTopicFixedFont = 'Courier New'; + DefaultTopicFixedFontSize = '10'; + + +Type + {Standard Font types} + TFontType=(ftBitmap,ftOutline); + + {Standard Font Attributes} + TFontAttributes=Set Of(faItalic,faUnderScore,faOutline,faStrikeOut,faBold); + + {Standard Font pitches} + TFontPitch=(fpFixed,fpProportional); + + {Standard Font character Set} + TFontCharSet=(fcsSBCS,fcsDBCS,fcsMBCS); {Single,Double,mixed Byte} + + + // a user-oriented specification of a font; not an actual structure in the INF file + TFontSpec = record + FaceName: string[ 64 ]; + PointSize: integer; // if 0 then use x/y size + XSize: integer; + YSize: integer; + Attributes: TFontAttributes; // set of faBold, faItalic etc + end; + + // NOTE: Char widths are in 1/FontWidthPrecisionFactor units + TCharWidthArray = array[ #0..#255 ] of longint; + TPCharWidthArray = ^TCharWidthArray; + + // Used internally for storing full info on font + TLogicalFont = class(TObject) + public + FaceName: string; // user-selected name + UseFaceName: string; // after substitutions. + + // Selected bits of FONTMETRICS + fsSelection: word; //USHORT; + + FontType: TFontType; + FixedWidth: boolean; + PointSize: integer; + ID: integer; + Attributes: TFontAttributes; + + // this can be nil if not already fetched + pCharWidthArray: TPCharWidthArray; + lMaxbaselineExt: longint; //LONG; + lAveCharWidth: longint; //LONG; + lMaxCharInc: longint; //LONG; + lMaxDescender: longint; //LONG; + public + constructor Create; + destructor Destroy; override; + end; + + + TFontFace = class(TObject) + public + Name: string; + FixedWidth: boolean; + FontType: TFontType; + Sizes: TList; // relevant for bitmap fonts only - contains TLogicalFont objects + constructor Create; + destructor Destroy; override; + end; + + + TCanvasFontManager = class(TObject) + private + FWidget: TfpgWidget; + protected + FCanvas: TfpgCanvas; + FLogicalFonts: TList; + FCurrentFontSpec: TFontSpec; + FDefaultFontSpec: TFontSpec; + FCurrentFont: TLogicalFont; + FAllowBitmapFonts: boolean; + function CreateFont( const FontSpec: TFontSpec ): TLogicalFont; + function GetFont( const FontSpec: TFontSpec ): TLogicalFont; + procedure RegisterFont( Font: TLogicalFont ); + procedure SelectFont( Font: TLogicalFont; Scale: longint ); + // Retrieve character widths for current font + procedure LoadMetrics; + // load metrics if needed + procedure EnsureMetricsLoaded; + public + constructor Create(Canvas: TfpgCanvas; AllowBitmapFonts: boolean; AWidget: TfpgWidget); reintroduce; + destructor Destroy; override; + // Set the font for the associated canvas. + procedure SetFont( const FontSpec: TFontSpec ); + // Retrieve the width of the given char, in the current font + function CharWidth( const C: Char ): longint; + function AverageCharWidth: longint; + function MaximumCharWidth: longint; + function IsFixed: boolean; + function CharHeight: longint; + function CharDescender: longint; + procedure DrawString(var Point: TPoint; const Length: longint; const S: PChar); + property Canvas: TfpgCanvas read FCanvas; + property Widget: TfpgWidget read FWidget; + property DefaultFontSpec: TFontSpec read FDefaultFontSpec write FDefaultFontSpec; + end; + + +// Convert a Sibyl font to a FontSpec (Color is left the same) +procedure FPGuiFontToFontSpec( Font: TfpgFont; Var FontSpec: TFontSpec ); + + // Thoughts on how it works.... + + // SelectFont looks for an existing logical font that + // matches the request. If found selects that logical font + // onto the canvas. + + // If not found it creates a logical font and selects that onto + // the canvas. + + // For bitmap fonts the logical font definition includes pointsize + // For outline fonts the defn is only face+attr; in this case + // selectfont also ses the 'CharBox' according to the point size. + +implementation + +uses + SysUtils + ,ACLStringUtility + ,nvUtilities + ,fpg_stringutils + ; + + +var + FontFaces: TList = nil; // of TFontface + DefaultOutlineFixedFace: TFontFace; + DefaultOutlineProportionalFace: TFontFace; + +// TFontFace +//------------------------------------------------------------------------ + +constructor TFontface.Create; +begin + Sizes := TList.Create; + FontType := ftOutline; // in fpGUI we treat all fonts as scalable (preference) +end; + +destructor TFontface.Destroy; +begin + Sizes.Free; +end; + +// TLogicalFont +//------------------------------------------------------------------------ + +constructor TLogicalFont.Create; +begin + FontType := ftOutline; + PointSize := 10; + Attributes := []; + FixedWidth := False; + UseFaceName := ''; + FaceName := ''; +end; + +// frees allocated memory, if any. +// Note - does not delete the Gpi Logical Font +destructor TLogicalFont.Destroy; +begin + if pCharWidthArray <> nil then + FreeMem( pCharWidthArray, + sizeof( TCharWidthArray ) ); + + inherited Destroy; +end; + + +// Convert a fpGUI Toolkit font to a FontSpec +//------------------------------------------------------------------------ +procedure FPGuiFontToFontSpec( Font: TfpgFont; Var FontSpec: TFontSpec ); +var + s: string; + facename: string; + cp: integer; + c: char; + token: string; + prop, propval: string; + desc: string; + + function NextC: char; + begin + Inc(cp); + if cp > length(desc) then + c := #0 + else + c := desc[cp]; + Result := c; + end; + + procedure NextToken; + begin + token := ''; + while (c <> #0) and (c in [' ', 'a'..'z', 'A'..'Z', '_', '0'..'9']) do + begin + token := token + c; + NextC; + end; + end; + +begin + cp := 0; + desc := Font.FontDesc; + // find fontface + NextC; + NextToken; + FontSpec.FaceName := token; + FontSpec.Attributes := []; + FontSpec.XSize := Font.TextWidth('v'); + FontSpec.YSize := Font.Height; + + // find font size + if c = '-' then + begin + NextC; + NextToken; + FontSpec.PointSize := StrToIntDef(token, 10); + end; + + // find font attributes + while c = ':' do + begin + NextC; + NextToken; + prop := UpperCase(token); + propval := ''; + + if c = '=' then + begin + NextC; + NextToken; + propval := UpperCase(token); + end; + // convert fontdesc attributes to fontspec attributes + if prop = 'BOLD' then + include(FontSpec.Attributes, faBold) + else if prop = 'ITALIC' then + include(FontSpec.Attributes, faItalic) + else if prop = 'UNDERLINE' then + include(FontSpec.Attributes, faUnderScore) + end; +end; + +// Find a font face with the given name +//------------------------------------------------------------------------ +function FindFaceName( const name: string ): TFontFace; +Var + FaceIndex: LongInt; + Face: TFontFace; +begin + for FaceIndex := 0 to FontFaces.Count - 1 do + begin + Face := TFontFace(FontFaces[ FaceIndex ]); + + if pos(UpperCase(name), UpperCase(Face.Name)) > 0 then + begin + Result := Face; + exit; + end; + end; + Result := nil; +end; + +// Return the first font face of type = Outline (scalable) +//------------------------------------------------------------------------ +function GetFirstOutlineFace( FixedWidth: boolean ): TFontFace; +Var + FaceIndex: LongInt; + Face: TFontFace; +begin + for FaceIndex := 0 to FontFaces.Count - 1 do + begin + Face := TFontFace(FontFaces[ FaceIndex ]); + + if ( Face.FixedWidth = FixedWidth ) + and ( Face.FontType = ftOutline ) then + begin + Result := Face; + exit; + end; + end; + Result := nil; +end; + +// Find the bitmap font which best matches the given pointsize. +//------------------------------------------------------------------------ +function GetClosestBitmapFixedFont( const PointSize: longint ): TLogicalFont; +Var + FaceIndex: Longint; + FontIndex: longint; + Face: TFontFace; + Font: TLogicalFont; +begin + Result := nil; + for FaceIndex := 0 to FontFaces.Count - 1 do + begin + Face := TFontFace(FontFaces[ FaceIndex ]); + + if Face.FontType = ftBitmap then + begin + for FontIndex := 0 to Face.Sizes.Count - 1 do + begin + Font := TLogicalFont(Face.Sizes[ FontIndex ]); + if Font.FixedWidth then + begin + if ( Result = nil ) + or ( Abs( Font.PointSize - PointSize ) + < Abs( Result.PointSize - PointSize ) ) then + Result := Font; + end; + end; + end; + end; +end; + +// Pick some nice default fonts. +//------------------------------------------------------------------------ +procedure GetDefaultFonts; +begin + // courier new is common and reasonably nice + DefaultOutlineFixedFace := FindFaceName( 'Courier New' ); + if DefaultOutlineFixedFace = nil then + begin + DefaultOutlineFixedFace := GetFirstOutlineFace( true ); // first fixed outline face + end; + + DefaultOutlineProportionalFace := FindFaceName( DefaultTopicFont ); + if DefaultOutlineProportionalFace = nil then + begin + DefaultOutlineProportionalFace := GetFirstOutlineFace( false ); // first prop outline face + end; +end; + +// Fetch the global list of font faces and sizes +//------------------------------------------------------------------------ +procedure GetFontList; +Var + Count: LongInt; + T: LongInt; + Font: TLogicalFont; + Face: TFontFace; + FamilyName: string; + fl: TStringList; + f: TfpgFont; +begin + fl := nil; + FontFaces := TList.Create; + fl := fpgApplication.GetFontFaceList; + + // Get font count + Count := fl.Count; + If Count > 0 Then + Begin + For T := 0 To Count - 1 Do + Begin + Font := TLogicalFont.Create; + Font.FaceName := fl[T]; + f := fpgGetFont(Font.FaceName + '-10'); + if (pos('COURIER', UpperCase(Font.FaceName)) > 0) or (pos('MONO', UpperCase(Font.FaceName)) > 0) then + Font.FixedWidth := True; + Font.lAveCharWidth := f.TextWidth('g'); + Font.lMaxbaselineExt := f.Height; + //Font.fsSelection := pfm^[ T ].fsSelection; + //Font.lMaxbaselineExt := pfm^[ T ].lMaxbaselineExt; + //Font.lAveCharWidth := pfm^[ T ].lAveCharWidth; + //Font.lMaxCharInc := pfm^[ T ].lMaxCharInc; + Font.ID := -1; // and always shall be so... + f.Free; + + Face := FindFaceName( Font.FaceName ); + if Face = nil then + begin + // new face found + Face := TFontFace.Create; + Face.Name := Font.FaceName; // point to the actual face name string! + Face.FixedWidth := Font.FixedWidth; + Face.FontType := Font.FontType; + FontFaces.Add( Face ); + end; + Face.Sizes.Add( Font ); + End; + End; + + // pick some for defaults + GetDefaultFonts; +end; + +// Add .subscript to font name for attributes +//------------------------------------------------------------------------ +Function ModifyFontName( const FontName: string; + const Attrs: TFontAttributes ): String; +Begin + Result := FontName; + If faItalic in Attrs Then + Result := Result + '.Italic'; + If faBold in Attrs Then + Result := Result + '.Bold'; + If faOutline in Attrs Then + Result := Result + '.Outline'; + If faStrikeOut in Attrs Then + Result := Result + '.Strikeout'; + If faUnderScore in Attrs Then + Result := Result + '.Underscore'; +End; + +// Create a font without attributes +//------------------------------------------------------------------------ +function CreateFontBasic( const FaceName: string; const PointSize: integer ): TLogicalFont; +var + PPString: string; +begin + Result := TLogicalFont.Create; + if FindFaceName( FaceName ) = nil then + Exit; //==> + Result.PointSize := PointSize; // will use later if the result was an outline font... + Result.FaceName := FaceName; + + // OK now we have found the font face... + PPString := IntToStr( PointSize) + '.' + FaceName; + + PPString := ModifyFontName( PPString, [] ); +end; + +// Provide outline substitutes for some common bitmap fonts +// From Mozilla/2 source. +//------------------------------------------------------------------------ +function SubstituteBitmapFontToOutline( const FaceName: string ): string; +begin + if StringsSame( FaceName, 'Helv' ) then + result := DefaultTopicFont + else if StringsSame( FaceName, 'Helvetica' ) then + result := DefaultTopicFont + else if StringsSame( FaceName, 'Tms Rmn' ) then + result := 'Times New Roman' + else if StringsSame( FaceName, 'System Proportional' ) then + result := DefaultTopicFont + else if StringsSame( FaceName, 'System Monospaced' ) then + result := DefaultTopicFixedFont + else if StringsSame( FaceName, 'System VIO' ) then + result := DefaultTopicFixedFont + else + result := FaceName; // no substitution +end; + +// Ask OS/2 dummy font window to convert a font spec +// into a FONTMETRICS. +//------------------------------------------------------------------------ +//procedure AskOS2FontDetails( const FaceName: string; +// const PointSize: longint; +// const Attributes: TFontAttributes; +// var FontInfo: FONTMETRICS ); +//var +// PPString: string; +// PresSpace: HPS; +//begin +// // Hack from Sibyl code - we don't know WTF the algorithm is +// // for selecting between outline/bitmap and doing substitutions +// // so send it to a dummy window and find out the resulting details +// PPString := IntToStr( PointSize ) +// + '.' +// + FaceName; +// +// PPString := ModifyFontName( PPString, Attributes ); +// +// FontWindow.SetPPFontNameSize( PPString ); +// +// PresSpace := WinGetPS( FontWindow.Handle ); +// GpiQueryFontMetrics( PresSpace, +// SizeOf( FontInfo ), +// FontInfo ); +// WinReleasePS( PresSpace ); +//end; + +// Look for the best match for the given face, size and attributes. +// If FixedWidth is set then makes sure that the result is fixed +// (if there is any fixed font on the system at all!) +// This uses the OS/2 GPI and therefore makes some substitutions, +// such as Helv 8 (bitmap) for Helvetica 8 (outline) +//------------------------------------------------------------------------ +procedure FindBestFontMatch( const FaceName: string; + const PointSize: longint; + const Attributes: TFontAttributes; + const FixedWidth: boolean; + var FontInfo: string ); +var + BestBitmapFontMatch: TLogicalFont; + fl: TStringList; + i: integer; +begin + { TODO -oGraeme -cfonts : This hack is very quick and dirty. Needs to be refined a lot } + fl := fpgApplication.GetFontFaceList; + for i := 0 to fl.Count-1 do + begin + if Pos(FaceName, fl[i]) > 0 then + FontInfo := fl[i] + '-' + IntToStr(PointSize); + end; + + if Fontinfo = '' then + // nothing found so use default font of fpGUI + FontInfo := fpgApplication.DefaultFont.FontDesc; +end; + +//------------------------------------------------------------------------ +// Font manager +//------------------------------------------------------------------------ + +// constructor +//------------------------------------------------------------------------ +constructor TCanvasFontManager.Create(Canvas: TfpgCanvas; AllowBitmapFonts: boolean; + AWidget: TfpgWidget); +begin + inherited Create; + if FontFaces = nil then + GetFontList; + FCanvas := Canvas; + FWidget := AWidget; + FLogicalFonts := TList.Create; + + // get system default font spec + // as default default ;) + FPGuiFontToFontSpec( fpgApplication.DefaultFont, FDefaultFontSpec ); + if FDefaultFontSpec.FaceName = '' then + raise Exception.Create('For some reason we could not create a FDefaultFontSpec instance'); + + // FCurrentFontSpec.FaceName := 'Arial'; + FCurrentFontSpec.FaceName := FDefaultFontSpec.FaceName; + FCurrentFont := nil; + FAllowBitmapFonts := AllowBitmapFonts; +end; + +// Destructor +//------------------------------------------------------------------------ +destructor TCanvasFontManager.Destroy; +var + i: integer; + lFont: TLogicalFont; + lface: TFontFace; +begin + // select default font so none of our logical fonts are in use + FCanvas.Font := fpgApplication.DefaultFont; + + // delete each logical font and our record of it + for i := 0 to FLogicalFonts.Count - 1 do + begin + lFont := TLogicalFont(FLogicalFonts[ i ]); + lFont.Free; + end; + FLogicalFonts.Clear; + FLogicalFonts.Free; + + // TCanvasFontManager asked for FontFaces to be created, so lets take responsibility to destroy it. + for i := 0 to FontFaces.Count-1 do + begin + lface := TFontFace(Fontfaces[i]); + lface.Free; + end; + FontFaces.Clear; + FontFaces.Free; + inherited Destroy; +end; + +// Create a logical font for the given spec +//------------------------------------------------------------------------ +function TCanvasFontManager.CreateFont( const FontSpec: TFontSpec ): TLogicalFont; +var + UseFaceName: string; + Face: TFontFace; + RemoveBoldFromSelection: boolean; + RemoveItalicFromSelection: boolean; + UseAttributes: TFontAttributes; + MatchAttributes: TFontAttributes; + BaseFont: TLogicalFont; + BaseFontIsBitmapFont: Boolean; + FontInfo: string; + FixedWidth: boolean; +begin +ProfileEvent('>>>> TCanvasFontManager.CreateFont >>>>'); + Face := nil; + RemoveBoldFromSelection := false; + RemoveItalicFromSelection := false; + + UseAttributes := FontSpec.Attributes; + + // see if the originally specified font is a fixed width one. + FixedWidth := false; + Face := FindFaceName( FontSpec.FaceName ); + if Face <> nil then + FixedWidth := Face.FixedWidth; + + Face := nil; + + if not FAllowBitmapFonts then + UseFaceName := SubstituteBitmapFontToOutline( FontSpec.FaceName ) + else + UseFaceName := FontSpec.FaceName; +ProfileEvent('UseFaceName=' + UseFaceName); + + if FontSpec.Attributes <> [] then + begin +profileevent('FontSpec.Attributes are not blank'); + BaseFontIsBitmapFont := false; + if FAllowBitmapFonts then + begin + // First see if the base font (without attributes) + // would be a bitmap font... + BaseFont := CreateFontBasic( UseFaceName, FontSpec.PointSize ); + if BaseFont <> nil then + begin + BaseFontIsBitmapFont := BaseFont.FontType = ftBitmap; + BaseFont.Destroy; + end; + end; + + If not BaseFontIsBitmapFont Then + begin +profileevent('we seem to be looking for a outline font'); + // Result is an outline font so look for specific bold/italic fonts + if ( faBold in FontSpec.Attributes ) + and ( faItalic in FontSpec.Attributes ) then + begin + Face := FindFaceName( UseFaceName + ' BOLD ITALIC' ); + if Face <> nil then + begin + Exclude( UseAttributes, faBold ); + Exclude( UseAttributes, faItalic ); + RemoveBoldFromSelection := true; + RemoveItalicFromSelection := true; + end; + end; + + if Face = nil then + if faBold in FontSpec.Attributes then + begin + Face := FindFaceName( UseFaceName + ' BOLD' ); + if Face <> nil then + begin + Exclude( UseAttributes, faBold ); + RemoveBoldFromSelection := true; + end; + end; + + if Face = nil then + if faItalic in FontSpec.Attributes then + begin + Face := FindFaceName( UseFaceName + ' ITALIC' ); + if Face <> nil then + begin + Exclude( UseAttributes, faItalic ); + RemoveItalicFromSelection := true; + end; + end; + end; + end; + + if Face <> nil then + // found a styled face, does it match fixed width? + if Face.FixedWidth <> FixedWidth then + // no so we don't want to use it. + Face := nil; + + if Face = nil then + // didn't find a styled face (or no styles set) + // so find unmodified, we will use simulation bits + Face := FindFaceName( UseFaceName ); + + // Oh shit! + if Face = nil then + // didn't find a styled face (or no styles set) + // so find unmodified, we will use simulation bits + Face := FindFaceName( 'Sans' ); // something very generic + + if not FAllowBitmapFonts then + if Assigned(Face) and (Face.FontType = ftBitmap) then + // we aren't allowed bitmaps, but that's what this + // face is. So use the default outline face of the + // appropriate width type + if FixedWidth then + Face := DefaultOutlineFixedFace + else + Face := DefaultOutlineProportionalFace; + + if Face = nil then + begin +profileevent('Could not find the specified font name. Bummer! + early exit'); + // Could not find the specified font name. Bummer. + Result := nil; + exit; + end; + +profileevent('******* Now create the TLogicalFont instance'); + // OK now we have found the font face... + Result := TLogicalFont.Create; + Result.PointSize := FontSpec.PointSize; // will use later if the result was an outline font... + Result.FaceName := FontSpec.FaceName; + Result.UseFaceName := Face.Name; + Result.Attributes := FontSpec.Attributes; + Result.fsSelection := 0; + Result.FixedWidth := Face.FixedWidth; + + if FAllowBitmapFonts then + begin + if BaseFontIsBitmapFont then + MatchAttributes := [] + else + MatchAttributes := UseAttributes; + FindBestFontMatch( Face.Name, + FontSpec.PointSize, + MatchAttributes, + FixedWidth, + FontInfo ); + + Result.UseFaceName := FontInfo; + end + else + begin + // no bitmap fonts please. + Result.FontType := ftOutline + end; + + // store the baseline and average char width. + // For bitmap fonts, these tell GPI which font we really want + // For outline fonts, we are just storing them for later ref. + //Result.lMaxbaseLineExt := FontInfo.lMaxbaselineExt; + //Result.lAveCharWidth := FontInfo.lAveCharWidth; + //Result.lMaxCharInc := FontInfo.lMaxCharInc; + Result.lMaxBaseLineExt := FontSpec.YSize; + Result.lAveCharWidth := FontSpec.XSize; + Result.lMaxCharInc := FontSpec.XSize; + + // Set style flags + with Result do + begin + //If faBold in UseAttributes Then + // fsSelection := fsSelection or FM_SEL_BOLD; + //If faItalic in UseAttributes Then + // fsSelection := fsSelection or FM_SEL_ITALIC; + //If faUnderScore in UseAttributes Then + // fsSelection := fsSelection or FM_SEl_UNDERSCORE; + //If faStrikeOut in UseAttributes Then + // fsSelection := fsSelection or FM_SEl_STRIKEOUT; + //If faOutline in UseAttributes Then + // fsSelection := fsSelection or FM_SEl_OUTlINE; + end; + +profileevent(' Result.FaceName=' + Result.FaceName); +profileevent(' Result.PointSize=' + IntToStr(Result.PointSize)); +profileevent(' Result.UseFaceName=' + Result.UseFaceName); + + Result.pCharWidthArray := Nil; + ProfileEvent('<<<< TCanvasFontManager.CreateFont'); +end; + +// Register the given logical font with GPI and store for later use +//------------------------------------------------------------------------ +procedure TCanvasFontManager.RegisterFont( Font: TLogicalFont ); +var +// fa: FATTRS; + rc: longint; +begin + FLogicalFonts.Add( Font ); + Font.ID := FLogicalFonts.Count + 1; // add 1 to stay out of Sibyl's way + + //// Initialise GPI font attributes + //FillChar( fa, SizeOf( FATTRS ), 0 ); + //fa.usRecordLength := SizeOf( FATTRS ); + // + //// Copy facename and 'simulation' attributes from what we obtained + //// earlier + //fa.szFaceName := Font.pUseFaceName^; + //fa.fsSelection := Font.fsSelection; + // + //fa.lMatch := 0; // please Mr GPI be helpful and do clever stuff for us, we are ignorant + // + //fa.idRegistry := 0; // IBM magic number + //fa.usCodePage := 0; // use current codepage + // + //If Font.FontType = ftOutline then + // // Outline font wanted + // fa.fsFontUse := FATTR_FONTUSE_OUTLINE Or FATTR_FONTUSE_TRANSFORMABLE + //else + // // bitmap font + // fa.fsFontUse := 0; + // + //// don't need mixing with graphics (for now) + //fa.fsFontUse := fa.fsFontUse or FATTR_FONTUSE_NOMIX; + // + //// copy char cell width/height from the (valid) one we + //// found earlier in GetFont (will be zero for outline) + //fa.lMaxbaseLineExt := Font.lMaxbaselineExt; + //fa.lAveCharWidth := Font.lAveCharWidth; + // + //fa.fsType := 0; + // + //// create logical font + //rc := GpiCreateLogFont( FCanvas.Handle, + // nil, + // Font.ID, + // fa ); +end; + +// Select the given (existing) logical font +//------------------------------------------------------------------------ +procedure TCanvasFontManager.SelectFont( Font: TLogicalFont; + Scale: longint ); +var + f: TfpgFont; + s: string; +begin + // Select the logical font + s := Font.FaceName + '-' + IntToStr(Font.PointSize); + if faBold in Font.Attributes then + s := s + ':bold'; + if faItalic in Font.Attributes then + s := s + ':italic'; + if faUnderScore in Font.Attributes then + s := s + ':underline'; + + f := fpgGetFont(s); + FCanvas.Font := f; +end; + +// Get a font to match the given spec, creating or re-using an +// existing font as needed. +//------------------------------------------------------------------------ +function TCanvasFontManager.GetFont( const FontSpec: TFontSpec ): TLogicalFont; +var + AFont: TLogicalFont; + FontIndex: integer; + sub: string; +begin +ProfileEvent('DEBUG: TCanvasFontManager.GetFont >>>'); +ProfileEvent('Received FontSpec: Facename=' + FontSpec.FaceName); +ProfileEvent(' PointSize=' + IntToStr(FontSpec.PointSize)); +ProfileEvent('FLogicalFonts.Count=' + intToStr(FLogicalFonts.Count)); +try + for FontIndex := 0 to FLogicalFonts.Count - 1 do + begin + AFont := TLogicalFont(FLogicalFonts[ FontIndex ]); + if AFont.PointSize = FontSpec.PointSize then + begin + if ( AFont.PointSize > 0 ) + or ( ( AFont.lAveCharWidth = FontSpec.XSize ) + and ( AFont.lMaxbaselineExt = FontSpec.YSize ) ) then + begin + if AFont.Attributes = FontSpec.Attributes then + begin + // search name last since it's the slowest thing +//ProfileEvent(' AFont.UseFaceName=' + AFont.UseFaceName); +//ProfileEvent(' FontSpec.FaceName=' + FontSpec.FaceName); + if AFont.FaceName = FontSpec.FaceName then + begin + // Found a logical font already created + Result := AFont; + // done + exit; + end + else + begin + // Still nothing! Lets try known substitute font names + sub := SubstituteBitmapFontToOutline(FontSpec.FaceName); +ProfileEvent(' substitute font=' + sub); + if AFont.FaceName = sub then + begin + // Found a logical font already created + Result := AFont; + // done + profileevent('TCanvasFontManager.GetFont <<<<< exit early we found a font'); + exit; + end; + end; + end; + end; + end; + end; +except + { TODO -oGraeme -cknow bug : An Access Violation error occurs often here! No idea why? } + on E: Exception do + ProfileEvent('Unexpected error occured. Error: ' + E.Message); +end; + + ProfileEvent('Now we need to create a new logical font'); + // Need to create new logical font + Result := CreateFont( FontSpec ); + if Result <> nil then + begin + RegisterFont( Result ); + end; +ProfileEvent('DEBUG: TCanvasFontManager.GetFont <<<'); +end; + +// Set the current font for the canvas to match the given +// spec, creating or re-using fonts as needed. +//------------------------------------------------------------------------ +procedure TCanvasFontManager.SetFont( const FontSpec: TFontSpec ); +var + Font: TLogicalFont; + lDefaultFontSpec: TFontSpec; +begin +ProfileEvent('DEBUG: TCanvasFontManager.SetFont >>>>'); + // we don't need this any more, because we check FCurrentFont <> Font further down + // We also make sure we always set Canvas.Font - this fixes large display of Grids or Sample Code in Courier New font + //if (FCurrentFontSpec.FaceName = FontSpec.FaceName) and + // (FCurrentFontSpec.PointSize = FontSpec.PointSize) and + // (FCurrentFontSpec.Attributes = FontSpec.Attributes) then + // //same font + //begin + // exit; + //end; + + Font := GetFont( FontSpec ); + + if Font = nil then + begin + // ack! Pfffbt! Couldn't find the font. + + // Try to get the default font + //writeln('---------- here goes nothing -------------'); + Font := GetFont( FDefaultFontSpec ); + if Font = nil then + begin + writeln('******* We should never get here!!!! Defaut font should always exist.'); + writeln('FDefaultFontSpec:'); + writeln(' FaceName=', FDefaultFontSpec.FaceName); + writeln(' Size=', FDefaultFontSpec.PointSize); + FPGuiFontToFontSpec( fpgApplication.DefaultFont, lDefaultFontSpec ); + Font := GetFont( lDefaultFontSpec ); + if Font = nil then + // WTF! We can't even get the default system font + raise Exception.Create( 'Could not access default font ' + + 'in place of ' + + FontSpec.FaceName + + ' ' + + IntToStr( FontSpec.PointSize ) ); + end; + + end; + + SelectFont( Font, 1 ); + FCurrentFontSpec := FontSpec; + if FCurrentFont <> Font then + FCurrentFont.Free; + FCurrentFont := Font; +ProfileEvent('DEBUG: TCanvasFontManager.SetFont <<<<'); +end; + +// Get the widths of all characters for current font +// and other dimensions +//------------------------------------------------------------------------ +procedure TCanvasFontManager.LoadMetrics; +var + TheChar: Char; +begin + // Retrieve all character widths + if FCurrentFont.FontType = ftOutline then + begin + SelectFont( FCurrentFont, FontWidthPrecisionFactor ); + end; + + // allocate memory for storing the char widths + GetMem( FCurrentFont.pCharWidthArray, sizeof( TCharWidthArray ) ); + + for TheChar := #0 to #255 do + begin + FCurrentFont.pCharWidthArray^[ TheChar ] := Abs( FCurrentFont.pCharWidthArray^[ TheChar ] ); + end; + + if FCurrentFont.FontType = ftOutline then + begin + SelectFont( FCurrentFont, 1 ); + end + else + begin + // For bitmap fonts, multiply by 256 manually + for TheChar := #0 to #255 do + begin + FCurrentFont.pCharWidthArray^[ TheChar ] := FCurrentFont.pCharWidthArray^[ TheChar ]; + end; + end; +end; + +procedure TCanvasFontManager.EnsureMetricsLoaded; +begin + if FCurrentFont = nil then + raise( Exception.Create( 'No font selected before getting font metrics' ) ); + + if FCurrentFont.pCharWidthArray = Nil then + LoadMetrics; +end; + +function TCanvasFontManager.CharWidth( const C: Char ): longint; +var + f: TfpgFont; +begin +// EnsureMetricsLoaded; +// Result := FCurrentFont.pCharWidthArray^[ C ]; + + { TODO -ograeme : This needs improvement: what about font attributes, and performance. } + f := fpgGetFont(FCurrentFont.FaceName + '-' + IntToStr(FCurrentFont.PointSize)); + Result := f.TextWidth(C); + f.Free; +end; + +function TCanvasFontManager.AverageCharWidth: longint; +begin + EnsureMetricsLoaded; + Result := FCurrentFont.lAveCharWidth; +end; + +function TCanvasFontManager.MaximumCharWidth: longint; +begin + EnsureMetricsLoaded; + Result := FCurrentFont.lMaxCharInc; +end; + +function TCanvasFontManager.CharHeight: longint; +begin + EnsureMetricsLoaded; + Result := FCurrentFont.lMaxBaseLineExt; +end; + +function TCanvasFontManager.CharDescender: longint; +begin + EnsureMetricsLoaded; + Result := FCurrentFont.lMaxDescender; +end; + +function TCanvasFontManager.IsFixed: boolean; +begin + Result := FCurrentFont.FixedWidth; +end; + +procedure TCanvasFontManager.DrawString(var Point: TPoint; const Length: longint; const S: PChar); +var + t: string; + + // Seaches <AValue> and replaces <ADel> with <AIns>. Case sensitive. + function tiStrTran(AValue, ADel, AIns : string): string; + var + i : integer; + sToChange : string; + begin + result := ''; + sToChange := AValue; + i := UTF8Pos(ADel, sToChange); + while i <> 0 do + begin + result := result + UTF8Copy(sToChange, 1, i-1) + AIns; + UTF8Delete(sToChange, 1, i+UTF8length(ADel)-1); + i := UTF8Pos(ADel, sToChange); + end; + result := result + sToChange; + end; + +begin + t := s; + +// Hack Alert #2: replace strange table chars with something we can actually see + //t := SubstituteChar(t, Chr(218), Char('+') ); // top-left corner + //t := SubstituteChar(t, Chr(196), Char('-') ); // horz row deviders + //t := SubstituteChar(t, Chr(194), Char('-') ); // centre top T connection + //t := SubstituteChar(t, Chr(191), Char('+') ); // top-right corner + //t := SubstituteChar(t, Chr(192), Char('+') ); // bot-left corner + //t := SubstituteChar(t, Chr(193), Char('-') ); // centre bottom inverted T + //t := SubstituteChar(t, Chr(197), Char('+') ); + //t := SubstituteChar(t, Chr(179), Char('|') ); // + //t := SubstituteChar(t, Chr(195), Char('|') ); + //t := SubstituteChar(t, Chr(180), Char('|') ); + //t := SubstituteChar(t, Chr(217), Char('+') ); // bot-right corner + + // it's cheaper to first check for the char than actually running full tiStrTran + // CodePage 437 (kind-of) to Unicode mapping + t := tiStrTran(t, Char(16), '>' ); + t := tiStrTran(t, Char(17), '<' ); + t := tiStrTran(t, Char($1f), 'â–¼' ); +// if pos(t, Char(179)) > 0 then + t := tiStrTran(t, Char(179), '│' ); +// if pos(t, Char(180)) > 0 then + t := tiStrTran(t, Char(180), '┤' ); +// if pos(t, Char(191)) > 0 then + t := tiStrTran(t, Char(191), 'â”' ); +// if pos(t, Char(192)) > 0 then + t := tiStrTran(t, Char(192), 'â””' ); +// if pos(t, Char(193)) > 0 then + t := tiStrTran(t, Char(193), 'â”´' ); +// if pos(t, Char(194)) > 0 then + t := tiStrTran(t, Char(194), '┬' ); +// if pos(t, Char(195)) > 0 then + t := tiStrTran(t, Char(195), '├' ); +// if pos(t, Char(196)) > 0 then + t := tiStrTran(t, Char(196), '─' ); +// if pos(t, Char(197)) > 0 then + t := tiStrTran(t, Char(197), '┼' ); +// if pos(t, Char(217)) > 0 then + t := tiStrTran(t, Char(217), '┘' ); +// if pos(t, Char(218)) > 0 then + t := tiStrTran(t, Char(218), '┌' ); + + FCanvas.DrawString(Point.X, Point.Y, t); + Point.x := Point.X + Canvas.Font.TextWidth(t); +end; + + +end. diff --git a/docview/components/richtext/RichTextDisplayUnit.pas b/docview/components/richtext/RichTextDisplayUnit.pas new file mode 100644 index 00000000..6009e7e2 --- /dev/null +++ b/docview/components/richtext/RichTextDisplayUnit.pas @@ -0,0 +1,415 @@ +Unit RichTextDisplayUnit; + +{$mode objfpc}{$H+} + +Interface + +uses + Classes + ,CanvasFontManager + ,RichTextStyleUnit + ,RichTextLayoutUnit + ; + +// Selection start and end should both be nil if no selection is to be applied +Procedure DrawRichTextLayout( var FontManager: TCanvasFontManager; + Layout: TRichTextLayout; + const SelectionStart: PChar; + const SelectionEnd: PChar; + const StartLine: longint; + const EndLine: longint; + const StartPoint: TPoint ); + +// Print as much of the given layout as will fit on the page, +// starting at StartY and StartLine +// EndY is set to the final Y output position used + 1. +// EndLine is set to the last line printed + 1 +Procedure PrintRichTextLayout( var FontManager: TCanvasFontManager; + var Layout: TRichTextLayout; + const StartLine: longint; + var EndLine: longint; + const StartY: longint; + var EndY: longint ); + +Implementation + +uses + SysUtils +// ACLString, ACLUtility, + ,RichTextDocumentUnit + ,fpg_base + ,fpg_main + ,nvUtilities + ; + +// For the given point in the text, update selected if the point +// is at start or end of selection +// Returns true if changed +function SelectionChange( P: PChar; + SelectionStart: PChar; + SelectionEnd: PChar; + var NextSelected: boolean ): boolean; +begin + Result := false; + if P = SelectionStart then + begin + Result := true; + if SelectionStart < SelectionEnd then + // reached start of selection + NextSelected := true + else + // reached end + NextSelected := false; + end + else if P = SelectionEnd then + begin + Result := true; + if SelectionStart < SelectionEnd then + // reached end of selection + NextSelected := false + else + // reached start + NextSelected := true; + end; +end; + +function InvertRGB( Arg: TfpgColor ): TfpgColor; +begin + Result := fpgColorToRGB( Arg ); // in case it's a system color e.g. button face + Result := Result xor $ffffff; // now invert the RGB components +end; + +// Draw a string at the given location with given color/selected state +procedure DrawRichTextString( var FontManager: TCanvasFontManager; Layout: TRichTextLayout; + var X: longint; Y: longint; S: PChar; Len: longint; Selected: Boolean; + PenColor: TfpgColor; BackColor: TfpgColor ); +var + Point: TPoint; +begin +ProfileEvent('DEBUG: DrawRichTextString >>>'); + if Len = 0 then + exit; + + Point.X := X; + Point.Y := Y; + + if Selected then + begin + FontManager.Canvas.Color := InvertRGB( BackColor ); + FontManager.Canvas.TextColor := InvertRGB(PenColor); + end + else + begin + FontManager.Canvas.Color := BackColor; + FontManager.Canvas.TextColor := PenColor; + end; + if FontManager.Canvas.Color <> Layout.FRichTextSettings.DefaultBackgroundColor then + FontManager.Canvas.FillRectangle(x, y, + FontManager.Canvas.Font.TextWidth(s), + FontManager.Canvas.Font.Height); + FontManager.DrawString( Point, Len, S ); + X := Point.X; +ProfileEvent('DEBUG: DrawRichTextString <<<'); +end; + +var + // global, so that we don't reallocate every drawline + StringToDraw: String = ''; + +// Draw the specified line at the specified +// (physical) location +Procedure DrawRichTextLine( var FontManager: TCanvasFontManager; + Layout: TRichTextLayout; SelectionStart: PChar; SelectionEnd: PChar; + Line: TLayoutLine; Start: TPoint ); +var + X, Y: longint; + Element: TTextElement; + StartedDrawing: boolean; + Style: TTextDrawStyle; + P: PChar; + NextP: PChar; + EndP: PChar; + BitmapIndex: longint; + Bitmap: TfpgImage; + BitmapRect: TRect; + TextBlockStart: PChar; + Selected: boolean; + NextSelected: boolean; + NewMarginX: longint; + + procedure DrawTextBlock; + begin + DrawRichTextString( FontManager, Layout, + X, // value gets adjusted by the time it returns + Y, // value gets adjusted by the time it returns + PChar(StringToDraw), + Length(StringToDraw), + Selected, + Style.Color, + Style.BackgroundColor); + StringToDraw := ''; + end; + + +begin +ProfileEvent('DEBUG: DrawRichTextLine >>>'); + P := Line.Text; + EndP := Line.Text + Line.Length; + + if P = EndP then + begin + // Empty line + exit; + end; + + Selected := false; + if SelectionStart <= Line.Text then + // selection start is above. + Selected := true; + if SelectionEnd <= Line.Text then + // selection end is above. + Selected := not Selected; + + StringToDraw := ''; + + Style := Line.Style; + FontManager.SetFont( Style.Font ); + StartedDrawing := false; + + TextBlockStart := P; + + Y := Start.Y; // + Line.MaxDescender; // co-ordinates are from top/left, so do we need descender? [Graeme] + + while P < EndP do + begin + Element := ExtractNextTextElement( P, NextP ); + + if SelectionChange( P, + SelectionStart, + SelectionEnd, + NextSelected ) then + begin + DrawTextBlock; + TextBlockStart := P; + Selected := NextSelected; + end; + + case Element.ElementType of + teWordBreak, + teText, + teImage: + begin + if not StartedDrawing then + begin + // we haven't yet started drawing: + // so work out alignment + X := Start.X + Layout.GetStartX( Style, Line ); + StartedDrawing := true; + end; + + // Now do the drawing + if Element.ElementType = teImage then + begin + ProfileEvent('DEBUG: DrawRichTextLine - skipping image drawing (not implemented yet)'); + DrawTextBlock; + TextBlockStart := NextP; + + try + BitmapIndex := StrToInt( Element.Tag.Arguments ); + except + BitmapIndex := -1; + end; + if Layout.IsValidBitmapIndex( BitmapIndex ) then + begin + Bitmap := Layout.Images.Item[BitmapIndex].Image; + + BitmapRect.Left := X div FontWidthPrecisionFactor; + BitmapRect.Top := Start.Y; + BitmapRect.Right := Trunc(BitmapRect.Left + + Bitmap.Width + * Layout.HorizontalImageScale); + BitmapRect.Bottom := Trunc(BitmapRect.Top + + Bitmap.Height + * Layout.VerticalImageScale); + + FontManager.Canvas.StretchDraw(BitmapRect.Left, BitMapRect.Top, + BitmapRect.Right-BitMapRect.Left, BitMapRect.Bottom-BitMapRect.Top, Bitmap); + + inc( X, trunc( Bitmap.Width + * FontWidthPrecisionFactor + * Layout.HorizontalImageScale ) ); + end; + end + else + begin + // character (or word break) + // build up the successive characters... + StringToDraw := StringToDraw + Element.Character; + end; + end; + + teStyle: + begin + DrawTextBlock; + TextBlockStart := NextP; + + if ( Element.Tag.TagType = ttItalicOff ) + and ( faItalic in Style.Font.Attributes ) + and ( not FontManager.IsFixed ) + then + // end of italic; add a space + inc( X, FontManager.CharWidth( ' ' ) ); + + Layout.PerformStyleTag( Element.Tag, Style, X ); + NewMarginX := ( Start.X + Style.LeftMargin ); + if NewMarginX > X then + begin + //skip across... + X := NewMarginX; + end; + end; + end; + P := NextP; + end; + + DrawTextBlock; +ProfileEvent('DEBUG: DrawRichTextLine <<<'); +end; + +Procedure DrawRichTextLayout( var FontManager: TCanvasFontManager; + Layout: TRichTextLayout; + const SelectionStart: PChar; + const SelectionEnd: PChar; + const StartLine: longint; + const EndLine: longint; + const StartPoint: TPoint ); +Var + Line: TLayoutLine; + LineIndex: longint; + Y: longint; + BottomOfLine: longint; +begin +ProfileEvent('DEBUG: DrawRichTextLayout >>>'); + assert( StartLine >= 0 ); + assert( StartLine <= Layout.FNumLines ); + assert( EndLine >= 0 ); + assert( EndLine <= Layout.FNumLines ); + assert( StartLine <= EndLine ); + + if Layout.FNumLines = 0 then + // no text to draw + exit; + + Y := StartPoint.Y + Layout.FRichTextSettings.Margins.Top; + LineIndex := 0; + + // debug only to show Margins. + //FontManager.Canvas.Color:= clRed; + //FontManager.Canvas.DrawLine(0, y, 300, y); + + repeat + Line := Layout.FLines^[ LineIndex ]; + BottomOfLine := Y; + + if // the line is in the range to be drawn + ( LineIndex >= StartLine ) + and ( LineIndex <= EndLine ) + + // and the line is within the cliprect + and ( BottomOfLine < FontManager.Canvas.GetClipRect.Bottom ) // -> so we can see partial lines at bottom scroll into the screen + and ( Y >= FontManager.Canvas.GetClipRect.Top - Line.Height) then // -> so we can see partial lines at top scroll off the screen + begin + // draw it. First decided whether selection is started or not. + DrawRichTextLine( FontManager, + Layout, + SelectionStart, + SelectionEnd, + Line, + Point(StartPoint.X, Y) ); + + end; + inc( Y, Line.Height ); + + { TODO 99 -oGraeme -cMUST FIX : Must remove this hard-coded value. It's just a test!!! } + // 4 is the Border Width of 2px times 2 borders. + if Y > (FontManager.Widget.Height-4) then + // past bottom of output canvas + break; + + inc( LineIndex ); + + if LineIndex >= Layout.FNumLines then + // end of text + break; + + until false; +ProfileEvent('DEBUG: DrawRichTextLayout <<<'); +End; + +Procedure PrintRichTextLayout( var FontManager: TCanvasFontManager; + var Layout: TRichTextLayout; + const StartLine: longint; + var EndLine: longint; + const StartY: longint; + var EndY: longint ); +Var + Selected: boolean; + Line: TLayoutLine; + LineIndex: longint; + + Y: longint; + + BottomOfLine: longint; + + LinesPrinted: longint; +begin + assert( StartLine >= 0 ); + assert( StartLine <= Layout.FNumLines ); + + if Layout.FNumLines = 0 then + // no text to draw + exit; + + Y := StartY - Layout.FRichTextSettings.Margins.Top; + Selected := false; // it's not going to change. + LinesPrinted := 0; + LineIndex := StartLine; + + repeat + Line := TLayoutLine(Layout.FLines[ LineIndex ]); + BottomOfLine := Y - Line.Height + 1; // bottom pixel row is top - height + 1 + + if BottomOfLine < Layout.FRichTextSettings.Margins.Bottom then + // past bottom of page (less margin) + if LinesPrinted > 0 then + // stop, as long as we've printed at least 1 line + break; + + // draw it + DrawRichTextLine( FontManager, + Layout, + nil, + nil, + Line, + Point( 0, + BottomOfLine ) ); + + dec( Y, Line.Height ); + + inc( LinesPrinted ); + + inc( LineIndex ); + + if LineIndex >= Layout.FNumLines then + // end of text + break; + + until false; + + EndY := Y; + EndLine := LineIndex; +end; + + +end. + diff --git a/docview/components/richtext/RichTextDocumentUnit.pas b/docview/components/richtext/RichTextDocumentUnit.pas new file mode 100644 index 00000000..dd2f9a96 --- /dev/null +++ b/docview/components/richtext/RichTextDocumentUnit.pas @@ -0,0 +1,787 @@ +Unit RichTextDocumentUnit; + +{$mode objfpc}{$H+} +// Declarations of tags, and parsing functions + +Interface + +uses + Classes + ,fpg_base + ; + +type + COUNTRYCODE = string[2]; + + TTagType = ( ttInvalid, + ttBold, ttBoldOff, + ttItalic, ttItalicOff, + ttUnderline, ttUnderlineOff, + ttFixedWidthOn, ttFixedWidthOff, + ttHeading1, ttHeading2, ttHeading3, ttHeadingOff, + ttColor, ttColorOff, + ttBackgroundColor, ttBackgroundColorOff, + ttRed, ttBlue, ttGreen, ttBlack, + ttWrap, + ttAlign, + ttBeginLink, ttEndLink, + ttSetLeftMargin, ttSetRightMargin, + ttImage, + ttFont, ttFontOff, + ttEnd ); + + TStandardColor = record + Name: string[ 32 ]; + Color: TfpgColor; + end; + + TTag = record + TagType: TTagType; + Arguments: string; + end; + + TTextElementType = ( teText, // a character + teWordBreak, + teLineBreak, // end of para + teTextEnd, + teImage, + teStyle ); + + TTextElement = record + ElementType: TTextElementType; + Character: Char; + Tag: TTag; + end; + + TTextAlignment = ( taLeft, + taRight, + taCenter ); + +const + TagStr: array[ ttInvalid .. ttEnd ] of string = + ( + '', // + 'b', + '/b', + 'i', + '/i', + 'u', + '/u', + 'tt', + '/tt', + 'h1', + 'h2', + 'h3', + '/h', + 'color', + '/color', + 'backcolor', + '/backcolor', + 'red', + 'blue', + 'green', + 'black', + 'wrap', + 'align', + 'link', + '/link', + 'leftmargin', + 'rightmargin', + 'image', + 'font', + '/font', + '' + ); + + +// Returns tag pointed to by TextPointer and +// moves TextPointer to the first char after the tag. +Function ExtractTag( Var TextPointer: PChar ): TTag; + +// Returns tag ending at TextPointer +// (Expects textpointer is currently pointing at the >) +// and moves TextPointer to the first char of the tag +Function ExtractPreviousTag( const TextStart: PChar; Var TextPointer: PChar ): TTag; +function ExtractNextTextElement( TextPointer: PChar; Var NextElement: PChar ): TTextElement; +function ExtractPreviousTextElement( const TextStart: PChar; TextPointer: PChar; Var NextElement: PChar ): TTextElement; + +// Parse a color name or value (#hexval). Returns true if valid +function GetTagColor( const ColorParam: string; var Color: TfpgColor ): boolean; + +function GetTagTextAlignment( const AlignParam: string; + const Default: TTextAlignment ): TTextAlignment; + +function GetTagTextWrap( const WrapParam: string ): boolean; + +// Search within a rich text document for the given text +// if found, returns true, pMatch is set to the first match, +// and MatchLength returns the length of the match +// (which may be greater than the length of Text due to +// to skipping tags) +// if not found, returns false, pMatch is set to nil +function RichTextFindString( pRichText: PChar; + const Text: string; + var pMatch: PChar; + var MatchLength: longint ): boolean; + +// Returns the start of the previous word, +// or the current word if pStart is in the middle of the word +function RichTextWordLeft( pRichText: PChar; + pStart: PChar ): PChar; + +// Returns the start of the next word. +function RichTextWordRight( pStart: PChar ): PChar; + +// If pStart is in the middle of a word, then +// returns true and sets the start and length of the word +function RichTextWordAt( pRichText: PChar; + pStart: PChar; + Var pWordStart: PChar; + Var WordLength: longint ): boolean; + +// Copies plaintext of richtext starting at StartP +// to the given buffer. Returns number of characters copied. +// Buffer may be nil +// If BufferLength is negative, it is effectively ignored +function CopyPlainTextToBuffer( StartP: PChar; + EndP: PChar; + Buffer: PChar; + BufferLength: longint ): longint; + +Implementation + +uses +// BseDOS, // for NLS/case mapping + SysUtils + ,ACLStringUtility + ; + +const + StandardColors: array[ 0..7 ] of TStandardColor = + ( + ( Name : 'white' ; Color: clWhite ), + ( Name : 'black' ; Color: clBlack ), + ( Name : 'red' ; Color: clRed ), + ( Name : 'blue' ; Color: clBlue ), + ( Name : 'green' ; Color: clLime ), + ( Name : 'purple'; Color: clFuchsia ), + ( Name : 'yellow'; Color: clYellow ), + ( Name : 'cyan' ; Color: clAqua ) + ); + +Procedure ParseTag( const Text: string; + Var Tag: TTag ); +var + TagType: TTagType; + TagTypeText: string; + SpacePos: longint; +begin + SpacePos := Pos( ' ', Text ); + if SpacePos <> 0 then + begin + Tag.Arguments := trim( Copy( Text, SpacePos + 1, 255 ) ); + TagTypeText := LowerCase( Copy( Text, 1, SpacePos - 1 ) ); + end + else + begin + Tag.Arguments := ''; // to save time copying when not needed + TagTypeText := LowerCase( Text ); + end; + + for TagType := ttBold to ttEnd do + begin + if TagStr[ TagType ] = TagTypeText then + begin + Tag.TagType := TagType; + exit; + end; + end; + + // not found + Tag.TagType := ttInvalid; +end; + +var + TagText: string; + TagArgText: string; + +Function ExtractTag( Var TextPointer: PChar ): TTag; +var + CurrentChar: Char; + TagTooLong: boolean; + InQuote: boolean; +begin +// assert( TextPointer[ 0 ] = '<' ); + TagText := ''; + TagTooLong := false; + InQuote := false; + + repeat + CurrentChar := TextPointer^; + + if ( CurrentChar = '>' ) + and ( not InQuote ) then + begin + // found tag end. + if TagTooLong then + Result.TagType := ttInvalid + else + ParseTag( TagText, Result ); + inc( TextPointer ); + exit; + end; + + if CurrentChar = #0 then + begin + // if we reach here we have reached the end of text + // during a tag. invalid tag. + Result.TagType := ttInvalid; + exit; + end; + + if CurrentChar = CharDoubleQuote then + begin + if not InQuote then + begin + InQuote := true + end + else + begin + // Could be escaped quote "" +// if (TextPointer + 1 )^ = DoubleQuote then + if ( TextPointer + 1 ) ^ = CharDoubleQuote then + begin + // yes it is + inc( TextPointer ); // skip second one + end + else + begin + // no, not an escaped quote + InQuote := false; + end; + end; + + end; + + if not TagTooLong then + if Length( TagText ) < 200 then + TagText := TagText + CurrentChar + else + TagTooLong := true; // but keep going until the end + + inc( TextPointer ); + until false; + +end; + +// Expects textpointer is currently pointing at the > +Function ExtractPreviousTag( const TextStart: PChar; + Var TextPointer: PChar ): TTag; +var + CurrentChar: Char; + TagTooLong: boolean; + InQuote: boolean; +begin + TagText := ''; + TagTooLong := false; + InQuote := false; + + repeat + dec( TextPointer ); + if TextPointer < TextStart then + begin + // if we reach here we have reached the end of text + // during a tag. invalid tag. + Result.TagType := ttInvalid; + exit; + end; + CurrentChar := TextPointer^; + + if ( CurrentChar = '<' ) + and ( not InQuote ) then + begin + // found tag end. + if TagTooLong then + Result.TagType := ttInvalid + else + ParseTag( TagText, Result ); + exit; + end; + + if CurrentChar = CharDoubleQuote then + begin + if not InQuote then + begin + InQuote := true + end + else + begin + // Could be escaped quote "" + if TextPointer <= TextStart then + begin + // start of text... somethin weird + InQuote := false; + end + else if ( TextPointer - 1 ) ^ = CharDoubleQuote then + begin + // yes it is + dec( TextPointer ); // skip second one + end + else + begin + // no, not an escaped quote + InQuote := false; + end; + end; + + end; + + if not TagTooLong then + if Length( TagText ) < 200 then + TagText := CurrentChar + TagText + else + TagTooLong := true; // but keep going until the end + + until false; + +end; + +function ExtractNextTextElement( TextPointer: PChar; Var NextElement: PChar ): TTextElement; +var + TheChar: Char; + NextChar: char; +begin + with Result do + begin + TheChar := TextPointer^; + Character := TheChar; + inc( TextPointer ); + + case TheChar of + ' ': // ---- Space (word break) found ---- + ElementType := teWordBreak; + + #10, #13: // ---- End of line found ---- + begin + ElementType := teLineBreak; + if TheChar = #13 then + begin + TheChar := TextPointer^; + if TheChar = #10 then + // skip CR following LF + inc( TextPointer ); + end; + end; + + #0: // ---- end of text found ---- + ElementType := teTextEnd; + + '<': // ---- tag found? ---- + begin + NextChar := TextPointer^; + if NextChar = '<' then + begin + // no. just a literal < + ElementType := teText; + inc( TextPointer ); + end + else + begin + Tag := ExtractTag( TextPointer ); + if Tag.TagType = ttImage then + ElementType := teImage + else + ElementType := teStyle; + end; + + end; + + '>': // check - should be double + begin + ElementType := teText; + NextChar := TextPointer^; + if NextChar = '>' then + inc( TextPointer ); + end; + + else + ElementType := teText; + end; + end; // with + NextElement := TextPointer; +end; + +function ExtractPreviousTextElement( const TextStart: PChar; + TextPointer: PChar; + Var NextElement: PChar ): TTextElement; +var + TheChar: Char; + PreviousChar: Char; + FoundTag: boolean; +begin + with Result do + begin + dec( TextPointer ); + TheChar := TextPointer^; + Character := TheChar; + if TextPointer < TextStart then + begin + ElementType := teTextEnd; + exit; + end; + + case TheChar of + ' ': // ---- Space (word break) found ---- + ElementType := teWordBreak; + + #10, #13: // ---- End of line found ---- + begin + ElementType := teLineBreak; + if TheChar = #10 then + begin + dec( TextPointer ); + TheChar := TextPointer^; + if TheChar = #13 then + begin + // skip CR preceeding LF + end + else + inc( TextPointer ); + end; + end; + + '>': // ---- tag found ---- + begin + FoundTag := true; + if TextPointer > TextStart then + begin + PreviousChar := ( TextPointer - 1 )^; + if PreviousChar = '>' then + begin + // no. just a literal > + FoundTag := false; + ElementType := teText; + dec( TextPointer ); + end + end; + + if FoundTag then + begin + Tag := ExtractPreviousTag( TextStart, TextPointer ); + if Tag.TagType = ttImage then + ElementType := teImage + else + ElementType := teStyle; + end; + end; + + '<': // should be double + begin + ElementType := teText; + if TextPointer > TextStart then + begin + PreviousChar := TextPointer^; + if PreviousChar = '<' then + dec( TextPointer ); + end; + end + else + ElementType := teText; + end; + end; // with + NextElement := TextPointer; +end; + +function GetTagColor( const ColorParam: string; + var Color: TfpgColor ): boolean; +var + ColorIndex: longint; +begin + Result := false; + if ColorParam <> '' then + begin + if ColorParam[ 1 ] = '#' then + begin + try + Color := HexToInt( StrRightFrom( ColorParam, 2 ) ); + Result := true; + except + end; + end + else + begin + for ColorIndex := 0 to High( StandardColors ) do + begin + if StringsSame( ColorParam, StandardColors[ ColorIndex ].Name ) then + begin + Color := StandardColors[ ColorIndex ].Color; + Result := true; + break; + end; + end; + end; + end; +end; + +function GetTagTextAlignment( const AlignParam: string; + const Default: TTextAlignment ): TTextAlignment; +begin + if StringsSame( AlignParam, 'left' ) then + Result := taLeft + else if StringsSame( AlignParam, 'center' ) then + Result := taCenter + else if StringsSame( AlignParam, 'right' ) then + Result := taRight + else + Result := Default; +end; + +function GetTagTextWrap( const WrapParam: string ): boolean; +begin + Result := StringsSame( WrapParam, 'yes' ); +end; + +function RichTextFindString( pRichText: PChar; + const Text: string; + var pMatch: PChar; + var MatchLength: longint ): boolean; +var + P: PChar; + NextP: PChar; + Element: TTextElement; + pMatchStart: pchar; + pMatchStartNext: pchar; + MatchIndex: longint; + C: Char; +begin + if Length( Text ) = 0 then + begin + // null string always matches + Result := true; + pMatch := pRichText; + MatchLength := 0; + exit; + end; + + P := pRichText; + MatchIndex := 1; + + // Now search, case insensitively + while true do + begin + Element := ExtractNextTextElement( P, NextP ); + + case Element.ElementType of + teTextEnd: + // end of text + break; + + teImage, + teLineBreak: + // breaks a potential match + MatchIndex := 1; + + teStyle: + ; // ignore, matches can continue + + else + begin + if Uppercase(Element.Character) = UpperCase(Text[Matchindex]) then + begin + // found a match + if MatchIndex = 1 then + begin + pMatchStart := P; // store start of match + pMatchStartNext := NextP; + end; + + inc( MatchIndex ); + if MatchIndex > Length( Text ) then + begin + // found a complete match + Result := true; + pMatch := pMatchStart; + MatchLength := PCharDiff( P, pMatchStart ) + + 1; // include this char + exit; + end; + end + else + begin + // not a match + if MatchIndex > 1 then + begin + // go back to start of match, + 1 + NextP := pMatchStartNext; + MatchIndex := 1; + end; + end; + end; + end; + + P := NextP; + end; + + // no match found + Result := false; + pMatch := nil; + MatchLength := 0; +end; + +function RichTextWordLeft( pRichText: PChar; + pStart: PChar ): PChar; +Var + P: PChar; + NextP: PChar; + Element: TTextElement; +begin + P := pStart; + + // skip whitespace/tags... + Element := ExtractPreviousTextElement( pRichText, P, NextP ); + P := NextP; + while Element.ElementType in [ teWordBreak, teLineBreak, teImage, teStyle ] do + begin + Element := ExtractPreviousTextElement( pRichText, P, NextP ); + P := NextP; + end; + if Element.ElementType = teTextEnd then + begin + Result := P; + // out of text + exit; + end; + + // back to start of word, skip text/tags + while true do + begin + Element := ExtractPreviousTextElement( pRichText, P, NextP ); + if not ( Element.ElementType in [ teText, teStyle ] ) then + break; + P := NextP; + end; + Result := P; +end; + +function RichTextWordRight( pStart: PChar ): PChar; +Var + P: PChar; + NextP: PChar; + Element: TTextElement; +begin + P := pStart; + + // skip text/tags... + Element := ExtractNextTextElement( P, NextP ); + while Element.ElementType in [ teStyle, teText ] do + begin + P := NextP; + Element := ExtractNextTextElement( P, NextP ); + end; + if Element.ElementType <> teTextEnd then + begin + // skip whitespace + Element := ExtractNextTextElement( P, NextP ); + while Element.ElementType in [ teWordBreak, teLineBreak, teImage, teStyle ] do + begin + P := NextP; + Element := ExtractNextTextElement( P, NextP ); + end; + end; + + Result := P; +end; + +function RichTextWordAt( pRichText: PChar; + pStart: PChar; + Var pWordStart: PChar; + Var WordLength: longint ): boolean; +Var + P: PChar; + NextP: PChar; + Element: TTextElement; + pWordEnd: PChar; +begin + P := pStart; + Element := ExtractNextTextElement( P, NextP ); + if not ( Element.ElementType in [ teStyle, teText ] ) then + begin + // not in a word. + result := false; + pWordStart := nil; + WordLength := 0; + exit; + end; + // find end of the word + while Element.ElementType in [ teStyle, teText ] do + begin + P := NextP; + Element := ExtractNextTextElement( P, NextP ); + end; + pWordEnd := P; + + P := pStart; + Element := ExtractPreviousTextElement( pRichText, P, NextP ); + while Element.ElementType in [ teStyle, teText ] do + begin + P := NextP; + Element := ExtractPreviousTextElement( pRichText, P, NextP ); + end; + pWordStart := P; + WordLength := PCharDiff( pWordEnd, pWordStart ); + Result := true; +end; + +function CopyPlainTextToBuffer( StartP: PChar; + EndP: PChar; + Buffer: PChar; + BufferLength: longint ): longint; +var + Q: PChar; + EndQ: Pchar; + P: PChar; + NextP: PChar; + Element: TTextElement; +begin + P := StartP; + Q := Buffer; + EndQ := Buffer + BufferLength; + + while P < EndP do + begin + Element := ExtractNextTextElement( P, NextP ); + case Element.ElementType of + teText, teWordBreak: + begin + // copy char + if Buffer <> nil then + Q[ 0 ] := Element.Character; + inc( Q ); + end; + + teLineBreak: + begin + if Buffer <> nil then + Q[ 0 ] := #13; + inc( Q ); + if Q = EndQ then + // end of buffer + break; + + if Buffer <> nil then + Q[ 0 ] := #10; + inc( Q ); + end; + end; + + if Q = EndQ then + // end of buffer + break; + + P := NextP; + end; + result := PCharDiff( Q, Buffer ); +end; + +Initialization +End. diff --git a/docview/components/richtext/RichTextLayoutUnit.pas b/docview/components/richtext/RichTextLayoutUnit.pas new file mode 100644 index 00000000..4c6cf427 --- /dev/null +++ b/docview/components/richtext/RichTextLayoutUnit.pas @@ -0,0 +1,1017 @@ +Unit RichTextLayoutUnit; + +{$mode objfpc}{$H+} + +// Dynamically created layout class. +// Represents a laid out rich text document + +Interface + +Uses + Classes, + CanvasFontManager, + RichTextDocumentUnit, RichTextStyleUnit, + fpg_imagelist; + +Type + TLayoutLine = record + Text: PChar; + Length: longint; + Height: longint; + Width: longint; + MaxDescender: longint; + MaxTextHeight: longint; // maximum height of text, doesn't include images + LinkIndex: longint; // link index at start of line, if any + Style: TTextDrawStyle; + Wrapped: boolean; + end; + + + TLinesArray = array[ 0..0 ] of TLayoutLine; + + + TTextPosition = + ( + tpAboveTextArea, + tpAboveText, + tpWithinText, + tpBelowText, + tpBelowTextArea + ); + + + // forward declaration + TRichTextLayout = class; + + +// TLinkEvent = procedure( Sender: TRichTextLayout; Link: string ) of object; + + + TRichTextLayout = class(TObject) + Protected + FFontManager: TCanvasFontManager; + FText: PChar; + FImages: TfpgImageList; + FAllocatedNumLines: Longint; + FLayoutWidth: longint; // The target width for the layout. Used for centreing/right align + FWidth: longint; // The actual width of the text. May be wider due to unaligned + // parts or bitmaps or width so small individual characters don't fit. + FHeight: longint; + FLinks: TStringList; + FHorizontalImageScale: double; + FVerticalImageScale: double; + public + // Internal layout data + FLines: ^TLinesArray; + FNumLines: longint; + FRichTextSettings: TRichTextSettings; + // Drawing functions + Procedure PerformStyleTag( Const Tag: TTag; + Var Style: TTextDrawStyle; + const X: longint ); + function GetElementWidth( Element: TTextElement ): longint; + // Queries + Function GetStartX( Style: TTextDrawStyle; + Line: TLayoutLine ): longint; + Procedure GetXFromOffset( const Offset: longint; + const LineIndex: longint; + Var X: longint ); + Procedure GetOffsetFromX( const XToFind: longint; + const LineIndex: longint; + Var Offset: longint; + Var Link: string ); + function FindPoint( XToFind, YToFind: longint; + Var LineIndex: longint; + Var Offset: longint; + Var Link: string ): TTextPosition; + function GetLineFromCharIndex( Index: longint ): longint; + function GetOffsetFromCharIndex( Index: longint; + Line: longint ): longint; + function GetLinePosition( Line: longint ): longint; + function GetLineFromPosition( YToFind: longint; + Var LineIndex: longint; + Var Remainder: longint ): TTextPosition; + // Layout functions + Procedure AddLineStart( Const Line: TLayoutLine ); + Procedure CheckFontHeights( Var Line: TLayoutLine ); + Procedure Layout; + function IsValidBitmapIndex( Index: longint ): boolean; + // property handlers + Function GetCharIndex( P: PChar ): longint; + Function GetTextEnd: longint; + Public + constructor Create(Text: PChar; Images: TfpgImageList; RichTextSettings: TRichTextSettings; FontManager: TCanvasFontManager; AWidth: longint); + destructor Destroy; Override; + function LinkFromIndex( const CharIndexToFind: longint): string; + property TextEnd: longint read GetTextEnd; + property Images: TfpgImageList read FImages; + property Width: longint read FWidth; + property Height: longint read FHeight; + property HorizontalImageScale: double read FHorizontalImageScale; + property VerticalImageScale: double read FVerticalImageScale; + End; + + +Implementation + + +Uses + SysUtils +// PMWin, BseDos, Dos, ClipBrd, Printers, +// ACLUtility, + ,ACLStringUtility +// ACLString, +// ControlScrolling; + ,nvUtilities + ,fpg_main + ; + +Function TRichTextLayout.GetTextEnd: longint; +begin + Result := StrLen( FText ); +end; + +// Create a layout of the specified rich text. +constructor TRichTextLayout.Create(Text: PChar; Images: TfpgImageList; + RichTextSettings: TRichTextSettings; FontManager: TCanvasFontManager; + AWidth: longint); +var + DefaultFontSpec: TFontSpec; +Begin +ProfileEvent('DEBUG: TRichTextLayout.Create >>>>'); + inherited Create; + FRichTextSettings := RichTextSettings; + FImages := Images; + FText := Text; + FAllocatedNumLines := 10; +ProfileEvent('DEBUG: TRichTextLayout.Create 1 of 4'); + GetMem( FLines, FAllocatedNumLines * sizeof( TLayoutLine ) ); + FNumLines := 0; + FLinks := TStringList.Create; + FLinks.Duplicates := dupIgnore; + FFontManager := FontManager; + FLayoutWidth := AWidth; +ProfileEvent('DEBUG: TRichTextLayout.Create 2'); + FHorizontalImageScale := 1; + FVerticalImageScale := 1; + //FHorizontalImageScale := FFontManager.Canvas.HorizontalResolution + // / Screen.Canvas.HorizontalResolution; + //FVerticalImageScale := FFontManager.Canvas.VerticalResolution + // / Screen.Canvas.VerticalResolution; + + // use normal font for default font when specified fonts can't be found + FPGuiFontToFontSpec( RichTextSettings.NormalFont, DefaultFontSpec ); +ProfileEvent('DEBUG: TRichTextLayout.Create 3'); + FFontManager.DefaultFontSpec := DefaultFontSpec; +ProfileEvent('DEBUG: TRichTextLayout.Create 4'); + Layout; +ProfileEvent('DEBUG: TRichTextLayout.Create <<<<'); +End; + +Destructor TRichTextLayout.Destroy; +Begin + FreeMem( Flines, FAllocatedNumLines * sizeof( TLayoutLine ) ); + FLines := nil; + FLinks.Free; + Inherited Destroy; +End; + +Procedure TRichTextLayout.AddLineStart( Const Line: TLayoutLine ); +var + NewAllocation: longint; +begin + if FNumLines >= FAllocatedNumLines then + begin + // reallocate the array twice the size + NewAllocation := FAllocatedNumLines * 2; + FLines := ReAllocMem( FLines, +// FAllocatedNumLines * sizeof( TLayoutLine ), + NewAllocation * sizeof( TLayoutLine ) ); + FAllocatedNumLines := NewAllocation; + end; + FLines^[ FNumLines ] := Line; + inc( FNumLines ); + ProfileEvent(' DEBUG: TRichTextLayout.AddLineStart: FNumLines =' + intToStr(FNumLines)); +end; + +Procedure TRichTextLayout.PerformStyleTag( Const Tag: TTag; + Var Style: TTextDrawStyle; + const X: longint ); +begin +ProfileEvent('DEBUG: TRichTextLayout.PerformStyleTag >>>'); + ApplyStyleTag( Tag, + Style, + FFontManager, + FRichTextSettings, + X ); +ProfileEvent('DEBUG: TRichTextLayout.PerformStyleTag <<<'); +end; + +// Check the current font specifications and see if the +// give line needs updating for max height/descender +Procedure TRichTextLayout.CheckFontHeights( Var Line: TLayoutLine ); +var + FontHeight: longint; + Descender: longint; +begin + FontHeight := FFontManager.CharHeight; + Descender := FFontManager.CharDescender; + + if FontHeight > Line.Height then + Line.Height := FontHeight; + + if FontHeight > Line.MaxTextHeight then + Line.MaxTextHeight := FontHeight; + + if Descender > Line.MaxDescender then + Line.MaxDescender := Descender; +end; + +function TRichTextLayout.IsValidBitmapIndex( Index: longint ): boolean; +begin + if FImages = nil then + Result := false + else if FImages.Count = 0 then + Result := false + else + Result := Between( Index, 0, FImages.Count - 1 ); +end; + +// Main procedure: reads through the whole text currently stored +// and breaks up into lines - each represented as a TLayoutLine in +// the array FLines[ 0.. FNumLines ] +Procedure TRichTextLayout.Layout; +Var + CurrentLine: TLayoutLine; + CurrentLinkIndex: longint; + WrapX: longint; // X to wrap at + WordX: longint; // width of word so far + P: PChar; + NextP: PChar; + NextP2: PChar; + WordStart: PChar; + WordStarted: boolean; // if false, just skipping spaces.. + WordStartX: longint; // X position of word start + LineWordsCompleted: longint; // how many words draw so far this line + CurrentElement: TTextElement; + NextElement: TTextElement; + CurrentCharWidth: longint; + Style: TTextDrawStyle; + DisplayedCharsSinceFontChange: boolean; + BitmapIndex: longint; + Bitmap: TfpgImage; + BitmapHeight: longint; + OnBreak: boolean; + DoWrap: boolean; + + // Nested procedure + Procedure DoLine( EndPoint: PChar; NextLine: PChar; EndX: longint ); + begin + // check if the max font + // height needs updating for the last string of the line + CheckFontHeights( CurrentLine ); + inc( FHeight, CurrentLine.Height ); + CurrentLine.Length := PCharDiff( EndPoint, CurrentLine.Text ); + CurrentLine.Width := EndX; + if CurrentLine.Width > FWidth then + FWidth := CurrentLine.Width; + assert( CurrentLine.Height > 0 ); // we must have set the line height! + AddLineStart( CurrentLine ); + CurrentLine.Text := NextLine; + CurrentLine.Style := Style; + CurrentLine.Height := 0; + CurrentLine.MaxDescender := 0; + CurrentLine.MaxTextHeight := 0; + CurrentLine.Width := 0; + CurrentLine.LinkIndex := CurrentLinkIndex; + CurrentLine.Wrapped := false; + assert( CurrentLinkIndex >= -1 ); + assert( CurrentLinkIndex < FLinks.Count ); + WordStartX := Style.LeftMargin; + // next line + // reset words completed count + LineWordsCompleted := 0; + WordStarted := false; + end; + +begin +ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); + FNumLines := 0; + FWidth := FRichTextSettings.Margins.Left; + FHeight := FRichTextSettings.Margins.Top; + Style := GetDefaultStyle( FRichTextSettings ); + ApplyStyle( Style, FFontManager ); + CurrentLinkIndex := -1; + P := FText; // P is the current search position + CurrentLine.Text := P; + CurrentLine.Style := Style; + CurrentLine.Height := 0; + CurrentLine.MaxDescender := 0; + CurrentLine.MaxTextHeight := 0; + CurrentLine.Width := 0; + CurrentLine.LinkIndex := -1; + CurrentLine.Wrapped := false; + WordStartX := Style.LeftMargin; + WordX := 0; + WrapX := FLayoutWidth - FRichTextSettings.Margins.Right; + LineWordsCompleted := 0; + WordStarted := false; + DisplayedCharsSinceFontChange := false; + + repeat + CurrentElement := ExtractNextTextElement( P, NextP ); + assert( NextP > P ); + OnBreak := false; + case CurrentElement.ElementType of + teWordBreak: + begin + CurrentCharWidth := FFontManager.CharWidth( ' ' ); + OnBreak := true; + end; + + teLineBreak: + begin + DoLine( P, NextP, WordStartX + WordX ); + + // remember start of line + WordStart := NextP; + WordX := 0; + + P := NextP; + + continue; + end; + + teTextEnd: + begin + DoLine( P, NextP, WordStartX + WordX ); + + // end of text, done + break; + end; + + teImage: + begin + BitmapHeight := 0; + try + BitmapIndex := StrToInt( CurrentElement.Tag.Arguments ); + except + BitmapIndex := -1; + end; + Bitmap := nil; + if IsValidBitmapIndex( BitmapIndex ) then + begin + Bitmap := FImages.Item[BitmapIndex].Image; + CurrentCharWidth := Trunc(Bitmap.Width * FHorizontalImageScale); + WordStarted := true; + BitmapHeight := Trunc(Bitmap.Height * FVerticalImageScale); + end; + + end; + + teText: + begin + // Normal (non-leading-space) character + CurrentCharWidth := FFontManager.CharWidth( CurrentElement.Character ); + WordStarted := true; + end; + + teStyle: + begin + case CurrentElement.Tag.TagType of + ttBeginLink: + begin + CurrentLinkIndex := FLinks.Add( CurrentElement.Tag.Arguments ); + P := NextP; + continue; + end; + + ttEndLink: + begin + CurrentLinkIndex := -1; + P := NextP; + continue; + end; + + ttSetLeftMargin: // SPECIAL CASE... could affect display immediately + begin + PerformStyleTag( CurrentElement.Tag, Style, WordstartX + WordX ); + if Style.LeftMargin < WordStartX then + begin + // we're already past the margin being set + if pos( 'breakifpast', CurrentElement.Tag.Arguments ) > 0 then + begin + // this argument means, do a line break + // if the margin is already past + // Seems unusual for most purposes, but needed for IPF rendering. + DoLine( P, NextP, WordStartX + WordX ); + + // remember start of line + WordStart := NextP; + WordX := 0; + + P := NextP; + + continue; + end; + + // so ignore it for now. + P := NextP; + continue; + end; + + // skip across to the new margin + CurrentCharWidth := Style.LeftMargin - WordStartX - WordX; + // BUT! Don't treat it as a space, because you would not + // expect wrapping to take place in a margin change... + // at least not for IPF :) + + end; { teSetLeftMargin } + + else + begin + // before processing the tag see if font height needs updating + if DisplayedCharsSinceFontChange then + CheckFontHeights( CurrentLine ); + + if ( CurrentElement.Tag.TagType = ttItalicOff ) + and ( faItalic in Style.Font.Attributes ) then + begin + if not FFontManager.IsFixed then + begin + // end of italic; add a space + inc( WordX, FFontManager.CharWidth( ' ' ) ); + end; + end; + + PerformStyleTag( CurrentElement.Tag, + Style, + WordX ); + + DisplayedCharsSinceFontChange := false; + P := NextP; + continue; // continue loop + end; + end; + + end + + end; + + if OnBreak then + begin + // we just processed a space + if WordStarted then + begin + DisplayedCharsSinceFontChange := true; + // remember that we have now completed a word on this line + inc( LineWordsCompleted ); + WordStarted := false; + + // Add the word width, and the space width, + // to get the start of the next word + inc( WordStartX, WordX + CurrentCharWidth ); + WordX := 0; + + // remember the start of the next word + WordStart := NextP; + + P := NextP; + + continue; + end; + // else - starting spaces - fall through like normal char + end; + + // if we're still going here we have a normal char + // (or leading spaces) + if not Style.Wrap then + begin + // No alignment + // We don't care about how wide it gets + inc( WordX, CurrentCharWidth ); + DisplayedCharsSinceFontChange := true; + + if CurrentElement.ElementType = teImage then + if Bitmap <> nil then + if BitmapHeight > CurrentLine.Height then + CurrentLine.Height := BitmapHeight; + + P := NextP; + continue; + end; + + DoWrap := false; + + // Calculate position of end of character + // see if char would exceed width + if (WordStartX + WordX + CurrentCharWidth) >= WrapX then + begin + // reached right hand side before finding end of word + if LineWordsCompleted > 0 then + // always wrap after at least one word displayed + DoWrap := true + else if not FRichTextSettings.AtLeastOneWordBeforeWrap then + // only wrap during the first word, if the "at least 1 word" flag is not set. + DoWrap := true; + end; + + if DoWrap then + begin + if LineWordsCompleted = 0 then + begin + // the first word did not fit on the line. so draw + // as much as will fit + if WordX = 0 then + begin + // even the first char doesn't fit, + // but draw it anyway (otherwise, infinite loop) + NextElement := ExtractNextTextElement( NextP, NextP2 ); + if NextElement.ElementType <> teLineBreak then + // there is still more on the line... + CurrentLine.Wrapped := true + else + // the line ends after this one char or image, we can skip the line end + NextP := NextP2; + + if CurrentElement.ElementType = teImage then + begin + // the only thing on the line is the image. so check height + if Bitmap <> nil then + if BitmapHeight > CurrentLine.Height then + CurrentLine.Height := BitmapHeight; + end; + + DoLine( NextP, NextP, WordStartX + WordX + CurrentCharWidth ); + WordStart := NextP; + WordX := 0; + end + else + begin + CurrentLine.Wrapped := true; + // at least 1 char fits + // so draw up to, but not including this char + DoLine( P, + P, + WordStartX + WordX ); + WordStart := P; + WordX := CurrentCharWidth; + end; + end + else + begin + // Normal wrap; at least one word fitted on the line + CurrentLine.Wrapped := true; + + // take the width of the last space of the + // previous word off the line width + DoLine( WordStart, // current line ends at start of this word + WordStart, // next line starts at start of this word + WordStartX - FFontManager.CharWidth( ' ' ) ); + if CurrentElement.ElementType = teImage then + if Bitmap <> nil then + if BitmapHeight > CurrentLine.Height then + CurrentLine.Height := BitmapHeight; + + // do NOT reset WordX to zero; as we are continuing + // from partway thru the word on the next line. + inc( WordX, CurrentCharWidth ); + end; + WordStarted := true; // by definition, for wrapping + end + else + begin + // Character fits. + inc( WordX, CurrentCharWidth ); + DisplayedCharsSinceFontChange := true; + if CurrentElement.ElementType = teImage then + if Bitmap <> nil then + if BitmapHeight > CurrentLine.Height then + CurrentLine.Height := BitmapHeight; + end; + + P := NextP; + until false; // loop is exited by finding end of text + + inc( FHeight, FRichTextSettings.Margins.Bottom ); +ProfileEvent('DEBUG: TRichTextLayout.Layout <<<<'); +End; + +Function TRichTextLayout.GetStartX( Style: TTextDrawStyle; + Line: TLayoutLine ): longint; +var + SpaceOnLine: longint; +begin + case Style.Alignment of + taLeft: + Result := Style.LeftMargin * FontWidthPrecisionFactor; + + taRight: + Result := Style.LeftMargin * FontWidthPrecisionFactor + + FLayoutWidth + - Style.RightMargin * FontWidthPrecisionFactor + - Line.Width; + + taCenter: + begin + // |<------layout width------------------>| + // | | + // |<-lm->[aaaaaaaaaaaaaaa]<-space-><-rm->| + // |<-----line width------> | + // space = layoutw-rm-linew + SpaceOnLine := FLayoutWidth + - Style.RightMargin * FontWidthPrecisionFactor + - Line.Width; // Note: line width includes left margin + Result := Style.LeftMargin * FontWidthPrecisionFactor + + SpaceOnLine div 2; + end; + end; +end; + +Procedure TRichTextLayout.GetOffsetFromX( const XToFind: longint; + const LineIndex: longint; + Var Offset: longint; + Var Link: string ); +Var + X: longint; + P: PChar; + NextP: PChar; + EndP: PChar; + Element: TTextElement; + CurrentLink: string; + Line: TLayoutLine; + Style: TTextDrawStyle; + NewMarginX: longint; + StartedDrawing: boolean; +begin + Line := TLayoutLine(FLines[ LineIndex ]); + P := Line.Text; + EndP := Line.Text + Line.Length; + + Style := Line.Style; + FFontManager.SetFont( Style.Font ); + + StartedDrawing := false; + + Link := ''; + if Line.LinkIndex <> -1 then + CurrentLink := FLinks[ Line.LinkIndex ] + else + CurrentLink := ''; + + while P < EndP do + begin + Element := ExtractNextTextElement( P, NextP ); + + case Element.ElementType of + teWordBreak, + teText, + teImage: + begin + if not StartedDrawing then + begin + // we haven't yet started drawing: + // so work out alignment + X := GetStartX( Style, Line ); + + if X div FontWidthPrecisionFactor + > XToFind then + begin + // found before the start of the line + // don't set link + Offset := 0; + exit; + end; + + StartedDrawing := true; + + end; + + // Now find out how wide the thing is + inc( X, GetElementWidth( Element ) ); + + if X div FontWidthPrecisionFactor + > XToFind then + begin + // found + Offset := PCharDiff( P, Line.Text ); + Link := CurrentLink; + exit; + end; + + end; + + teStyle: + case Element.Tag.TagType of + ttBeginLink: + CurrentLink := Element.Tag.Arguments; + ttEndLink: + CurrentLink := ''; + else + begin + if ( Element.Tag.TagType = ttItalicOff ) + and ( faItalic in Style.Font.Attributes ) + and ( not FFontManager.IsFixed ) then + // end of italic; add a space + inc( X, FFontManager.CharWidth( ' ' ) ); + + PerformStyleTag( Element.Tag, + Style, + X ); + NewMarginX := Style.LeftMargin * FontWidthPrecisionFactor; + if NewMarginX > X then + begin + //skip across... + X := NewMarginX; + end; + end; + end; + end; + + P := NextP; + end; + Offset := Line.Length; +end; + +Procedure TRichTextLayout.GetXFromOffset( const Offset: longint; + const LineIndex: longint; + Var X: longint ); +Var + P: PChar; + NextP: PChar; + EndP: PChar; + Element: TTextElement; + StartedDrawing: boolean; + Line: TLayoutLine; + Style: TTextDrawStyle; + NewMarginX: longint; +begin + Line := TLayoutLine(FLines[ LineIndex ]); + P := Line.Text; + EndP := Line.Text + Line.Length; + + Style := Line.Style; + FFontManager.SetFont( Style.Font ); + + StartedDrawing := false; + + while P < EndP do + begin + Element := ExtractNextTextElement( P, NextP ); + + case Element.ElementType of + teWordBreak, + teText, + teImage: + begin + if not StartedDrawing then + begin + // we haven't yet started drawing: + // so work out alignment + X := GetStartX( Style, Line ); + StartedDrawing := true; + end; + + if GetCharIndex( P ) - GetCharIndex( Line.Text ) >= Offset then + begin + X := X div FontWidthPrecisionFactor; + // found + exit; + end; + + // Now find out how wide the thing is + inc( X, GetElementWidth( Element ) ); + + end; + + teStyle: + begin + if ( Element.Tag.TagType = ttItalicOff ) + and ( faItalic in Style.Font.Attributes ) + and ( not FFontManager.IsFixed ) then + // end of italic; add a space + inc( X, FFontManager.CharWidth( ' ' ) ); + + PerformStyleTag( Element.Tag, + Style, + X ); + + NewMarginX := Style.LeftMargin * FontWidthPrecisionFactor; + if NewMarginX > X then + begin + //skip across... + X := NewMarginX; + end; + end; + end; + + P := NextP; + end; + // went thru the whole line without finding the point, + if not StartedDrawing then + X := GetStartX( Style, Line ); + + X := X div FontWidthPrecisionFactor; +end; + +function TRichTextLayout.GetLineFromPosition( YToFind: longint; + Var LineIndex: longint; + Var Remainder: longint ): TTextPosition; +var + Y: longint; + LineHeight: longint; +begin + LineIndex := 0; + Remainder := 0; + + Y := FRichTextSettings.Margins.Top; + + if YToFind < Y then + begin + Result := tpAboveText; + exit; + end; + + while LineIndex < FNumLines do + begin + LineHeight := TLayoutLine(FLines[ LineIndex ]).Height; + if ( YToFind >= Y ) + and ( YToFind < Y + LineHeight ) then + begin + // YToFind is within the line + Result := tpWithinText; + Remainder := YToFind - Y; + exit; + end; + + inc( Y, TLayoutLine(FLines[ LineIndex ]).Height ); + inc( LineIndex ); + end; + + LineIndex := FNumLines - 1; + Remainder := TLayoutLine(FLines[ LineIndex ]).Height; + + Result := tpBelowText; +end; + +function TRichTextLayout.FindPoint( XToFind, YToFind: longint; + Var LineIndex: longint; + Var Offset: longint; + Var Link: string ): TTextPosition; +var + Remainder: longint; +begin + Link := ''; + Result := GetLineFromPosition( YToFind, + LineIndex, + Remainder ); + case Result of + tpAboveText: + begin + Offset := 0; + exit; + end; + + tpBelowText: + begin + Offset := TLayoutLine(FLines[ LineIndex ]).Length; + exit; + end; + end; + + // found the line + GetOffsetFromX( XToFind, + LineIndex, + Offset, + Link ); +end; + +function TRichTextLayout.GetLineFromCharIndex( Index: longint ): longint; +var + LineCharIndex: longint; + LineLength: longint; +begin + Result := 0; + if Index <= 0 then + exit; + + while Result < FNumLines do + begin + LineCharIndex := GetCharIndex( TLayoutLine(FLines[ Result ]).Text ); + LineLength := TLayoutLine(FLines[ Result ]).Length; + if LineCharIndex + LineLength + > Index then + begin + // found + exit; + end; + inc( Result ); + end; + Result := FNumLines - 1; +end; + +function TRichTextLayout.GetOffsetFromCharIndex( Index: longint; + Line: longint ): longint; +begin + Result := Index - GetCharIndex( TLayoutLine( FLines[ Line ] ).Text ); +end; + +function TRichTextLayout.GetElementWidth( Element: TTextElement ): longint; +var + Bitmap: TfpgImage; + BitmapIndex: longint; +begin + // Now find out how wide the thing is + case Element.ElementType of + teImage: + begin + try + BitmapIndex := StrToInt( Element.Tag.Arguments ); + except + BitmapIndex := -1; + end; + if IsValidBitmapIndex( BitmapIndex ) then + begin + Bitmap := FImages.Item[BitmapIndex].Image; + Result := Trunc(Bitmap.Width + * FontWidthPrecisionFactor + * FHorizontalImageScale); + end; + end; + + teText, teWordBreak: + Result := FFontManager.CharWidth( Element.Character ); + + else + Assert( False ); // should never be trying to find the width of a style, etc + + end; +end; + +Function TRichTextLayout.GetCharIndex( P: PChar ): longint; +begin + Result := PCharDiff( P, FText ); +end; + +function TRichTextLayout.GetLinePosition( Line: longint ): longint; +begin + Result := FRichTextSettings.Margins.Top; + dec( line ); + while line >= 0 do + begin + inc( Result, + TLayoutLine(Flines[ Line ]).Height ); + dec( line ); + end; +end; + +function TRichTextLayout.LinkFromIndex( const CharIndexToFind: longint): string; +Var + P: PChar; + NextP: PChar; + EndP: PChar; + Element: TTextElement; + LineIndex: longint; + Line: TLayoutLine; +begin + if FNumLines = 0 then + begin + Result := ''; + exit; + end; + + LineIndex := GetLineFromCharIndex( CharIndexToFind ); + + Line := TLayoutLine(FLines[ LineIndex ]); + P := Line.Text; + EndP := Line.Text + Line.Length; + + if Line.LinkIndex <> -1 then + Result := FLinks[ Line.LinkIndex ] + else + Result := ''; + + while P < EndP do + begin + if GetCharIndex( P ) >= CharIndexToFind then + exit; + + Element := ExtractNextTextElement( P, NextP ); + + case Element.ElementType of + teStyle: + case Element.Tag.TagType of + ttBeginLink: + Result := Element.Tag.Arguments; + ttEndLink: + Result := ''; + end; + end; + + P := NextP; + end; +end; + +Initialization +End. + diff --git a/docview/components/richtext/RichTextPrintUnit.pas b/docview/components/richtext/RichTextPrintUnit.pas new file mode 100644 index 00000000..01746c68 --- /dev/null +++ b/docview/components/richtext/RichTextPrintUnit.pas @@ -0,0 +1,75 @@ +Unit RichTextPrintUnit;
+
+Interface
+
+uses
+ Graphics,
+ RichTextStyleUnit;
+
+// Prints the specified rich text, starting at page position PageY.
+// Starts new pages as needed; when done, PageY is the final position used
+// on the final page.
+Procedure PrintRichText( Text: PChar;
+ Images: TImageList;
+ Settings: TRichTextSettings;
+ var PageY: longint );
+
+Implementation
+
+uses
+ Classes,
+ Printers,
+ CanvasFontManager,
+ RichTextLayoutUnit, RichTextDisplayUnit, Forms
+ ;
+
+Procedure PrintRichText( Text: PChar;
+ Images: TImageList;
+ Settings: TRichTextSettings;
+ var PageY: longint );
+var
+ Layout: TRichTextLayout;
+ FontManager: TCanvasFontManager;
+ LineIndex: longint;
+ Y: longint;
+ FinishLine: longint;
+ FinishY: longint;
+Begin
+ FontManager := TCanvasFontManager.Create( Printer.Canvas,
+ false // don't allow bitmap fonts
+ );
+
+ Layout := TRichTextLayout.Create( Text,
+ Images,
+ Settings,
+ FontManager,
+ Printer.PageWidth );
+
+ LineIndex := 0;
+ Y := PageY;
+ repeat
+ PrintRichTextLayout( FontManager,
+ Layout,
+ LineIndex,
+ FinishLine,
+ Y,
+ FinishY );
+ LineIndex := FinishLine;
+ Y := FinishY;
+
+ if LineIndex < Layout.FNumLines then
+ begin
+ // didn't all fit on page, so new page
+ Printer.NewPage;
+ Y := Printer.PageHeight - 1;
+ end;
+
+ until LineIndex >= Layout.FNumLines;
+
+ Layout.Destroy;
+ FontManager.Destroy;
+ PageY := Y;
+end;
+
+Initialization
+End.
diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas new file mode 100644 index 00000000..64612b0e --- /dev/null +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -0,0 +1,641 @@ +Unit RichTextStyleUnit; + +{$mode objfpc}{$H+} + +Interface + +uses + Classes, fpg_base, fpg_main, CanvasFontManager, RichTextDocumentUnit; + +type + TTextDrawStyle = record + Font: TFontSpec; + Color: TfpgColor; + BackgroundColor: TfpgColor; + Alignment: TTextAlignment; + Wrap: boolean; + LeftMargin: longint; + RightMargin: longint; + end; + + TMarginSizeStyle = ( msAverageCharWidth, msMaximumCharWidth, msSpecifiedChar ); + + TRichTextSettings = class( TfpgComponent ) + protected + FHeading1Font: TfpgFont; + FHeading2Font: TfpgFont; + FHeading3Font: TfpgFont; + FFixedFont: TfpgFont; + FNormalFont: TfpgFont; + FDefaultBackgroundColor: TfpgColor; + FDefaultColor: TfpgColor; + FDefaultAlignment: TTextAlignment; + FDefaultWrap: boolean; + FAtLeastOneWordBeforeWrap: boolean; + FMarginSizeStyle: TMarginSizeStyle; + FMarginChar: longint; + FOnChange: TNotifyEvent; + FMargins: TRect; + FUpdateCount: longint; + FChangesPending: boolean; + Procedure Change; + Procedure SetNormalFont( NewFont: TfpgFont ); + Procedure SetFixedFont( NewFont: TfpgFont ); + Procedure SetHeading1Font( NewFont: TfpgFont ); + Procedure SetHeading2Font( NewFont: TfpgFont ); + Procedure SetHeading3Font( NewFont: TfpgFont ); + Procedure SetDefaultColor( NewColor: TfpgColor ); + Procedure SetDefaultBackgroundColor( NewColor: TfpgColor ); + Procedure SetDefaultAlignment( Alignment: TTextAlignment ); + Procedure SetDefaultWrap( Wrap: boolean ); + Procedure SetAtLeastOneWordBeforeWrap( NewValue: boolean ); + Procedure SetMarginSizeStyle( NewValue: TMarginSizeStyle ); + Procedure SetMarginChar( NewValue: longint ); + Procedure SetMargins( const NewMargins: TRect ); + function GetMargin_Left: longint; + Procedure SetMargin_Left( NewValue: longint ); + function GetMargin_Bottom: longint; + Procedure SetMargin_Bottom( NewValue: longint ); + function GetMargin_Right: longint; + Procedure SetMargin_Right( NewValue: longint ); + function GetMargin_Top: longint; + Procedure SetMargin_Top( NewValue: longint ); + Procedure SetupComponent; + Procedure AssignFont( Var Font: TfpgFont; + NewFont: TfpgFont ); + + // Hide properties... + property Name; + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + + procedure BeginUpdate; + procedure EndUpdate; + + // Stream in/out + //Procedure ReadSCUResource( Const ResName: TResourceName; + // Var Data; + // DataLen: LongInt ); override; + //Function WriteSCUResource( Stream: TResourceStream ): boolean; override; + + property Margins: TRect read FMargins write SetMargins; + + property Heading1Font: TfpgFont read FHeading1Font write SetHeading1Font; + property Heading2Font: TfpgFont read FHeading2Font write SetHeading2Font; + property Heading3Font: TfpgFont read FHeading3Font write SetHeading3Font; + property FixedFont: TfpgFont read FFixedFont write SetFixedFont; + property NormalFont: TfpgFont read FNormalFont write SetNormalFont; + + published + + property DefaultBackgroundColor: TfpgColor read FDefaultBackgroundColor write SetDefaultBackgroundColor; + property DefaultColor: TfpgColor read FDefaultColor write SetDefaultColor; + + property DefaultAlignment: TTextAlignment read FDefaultAlignment write SetDefaultAlignment; + property DefaultWrap: boolean read FDefaultWrap write SetDefaultWrap default True; + property AtLeastOneWordBeforeWrap: boolean read FAtLeastOneWordBeforeWrap write SetAtLeastOneWordBeforeWrap; + + property MarginSizeStyle: TMarginSizeStyle read FMarginSizeStyle write SeTMarginSizeStyle; + property MarginChar: longint read FMarginChar write SetMarginChar; + + // margins are exposed as individual properties here + // since the Sibyl IDE cannot cope with editing a record property + // within a class property (as in RichTextView) + property Margin_Left: longint read GetMargin_Left write SetMargin_Left; + property Margin_Bottom: longint read GetMargin_Bottom write SetMargin_Bottom; + property Margin_Right: longint read GetMargin_Right write SetMargin_Right; + property Margin_Top: longint read GetMargin_Top write SetMargin_Top; + end; + +// pRichTextSettings = ^TRichTextSettings; + Procedure ApplyStyle( var Style: TTextDrawStyle; + FontManager: TCanvasFontManager ); + + Procedure ApplyStyleTag( const Tag: TTag; + Var Style: TTextDrawStyle; + FontManager: TCanvasFontManager; + const Settings: TRichTextSettings; + const X: longint ); + + function GetDefaultStyle( const Settings: TRichTextSettings ): TTextDrawStyle; + +//Exports +// TRichTextSettings,'User',''; + +Implementation + +uses + SysUtils, + ACLStringUtility + ,nvUtilities +// , ACLProfile + ; + +Procedure ApplyStyle( var Style: TTextDrawStyle; FontManager: TCanvasFontManager ); +begin +ProfileEvent('DEBUG: ApplyStyle >>>'); + assert(FontManager <> nil, 'FontManager should not have been nil'); + FontManager.SetFont( Style.Font ); + FontManager.Canvas.TextColor := Style.Color; +ProfileEvent('DEBUG: ApplyStyle <<<'); +end; + +Procedure ApplyStyleTag( Const Tag: TTag; + var Style: TTextDrawStyle; + FontManager: TCanvasFontManager; + const Settings: TRichTextSettings; + const X: longint ); +var + MarginParam1: string; + MarginParam2: string; + NewMargin: longint; + FontFaceName: string; + FontSizeString: string; + NewStyle: TTextDrawStyle; + ParseIndex: longint; + XSizeStr: string; + YSizeStr: string; + tmpFontParts : TStrings; + + MarginSize: longint; + ParsePoint: longint; +begin +ProfileEvent('DEBUG: ApplyStyleTag >>>'); + case Tag.TagType of + ttBold: + Include( Style.Font.Attributes, faBold ); + ttBoldOff: + Exclude( Style.Font.Attributes, faBold ); + ttItalic: + Include( Style.Font.Attributes, faItalic ); + ttItalicOff: + Exclude( Style.Font.Attributes, faItalic ); + ttUnderline: + Include( Style.Font.Attributes, faUnderscore ); + ttUnderlineOff: + Exclude( Style.Font.Attributes, faUnderscore ); + + ttFixedWidthOn: + FPGuiFontToFontSpec( Settings.FFixedFont, Style.Font ); + ttFixedWidthOff: + FPGuiFontToFontSpec( Settings.FNormalFont, Style.Font ); + + ttHeading1: + FPGuiFontToFontSpec( Settings.FHeading1Font, Style.Font ); + ttHeading2: + FPGuiFontToFontSpec( Settings.FHeading2Font, Style.Font ); + ttHeading3: + FPGuiFontToFontSpec( Settings.FHeading3Font, Style.Font ); + ttHeadingOff: + FPGuiFontToFontSpec( Settings.FNormalFont, Style.Font ); + + ttFont: + begin + tmpFontParts := TStringList.Create; + StrExtractStringsQuoted(tmpFontParts, Tag.Arguments); + FontFaceName := tmpFontParts[0]; + FontSizeString := tmpFontParts[1]; + tmpFontParts.Destroy; + + NewStyle := Style; + try + NewStyle.Font.FaceName := FontFaceName; + + if Pos( 'x', FontSizeString ) > 0 then + begin + tmpFontParts := TStringList.Create; + StrExtractStrings(tmpFontParts, FontSizeString, ['x'], #0); + XSizeStr := tmpFontParts[0]; + YSizeStr := tmpFontParts[1]; + tmpFontParts.Destroy; + + NewStyle.Font.XSize := StrToInt( XSizeStr ); + NewStyle.Font.YSize := StrToInt( YSizeStr ); + NewStyle.Font.PointSize := 0; + end + else + begin + NewStyle.Font.PointSize := StrToInt( FontSizeString ); + end; + + if ( NewStyle.Font.FaceName <> '' ) + and ( NewStyle.Font.PointSize >= 1 ) then + begin + Style := NewStyle; + end; + + except + end; + end; + + ttFontOff: + // restore default + FPGuiFontToFontSpec( Settings.FNormalFont, Style.Font ); + + ttColor: + GetTagColor( Tag.Arguments, Style.Color ); + ttColorOff: + Style.Color := Settings.FDefaultColor; + ttBackgroundColor: + GetTagColor( Tag.Arguments, Style.BackgroundColor ); + ttBackgroundColorOff: + Style.BackgroundColor := Settings.FDefaultBackgroundColor; + + ttRed: + Style.Color := clRed; + ttBlue: + Style.Color := clBlue; + ttGreen: + Style.Color := clGreen; + ttBlack: + Style.Color := clBlack; + + ttAlign: + Style.Alignment := GetTagTextAlignment( Tag.Arguments, + Settings.FDefaultAlignment ); + + ttWrap: + Style.Wrap := GetTagTextWrap( Tag.Arguments ); + + ttSetLeftMargin, + ttSetRightMargin: + begin + tmpFontParts := TStringList.Create; + StrExtractStrings(tmpFontParts, Tag.Arguments, [' '], #0); + MarginParam1 := tmpFontParts[0]; + + ParsePoint := 1; + if ( Tag.TagType = ttSetLeftMargin ) + and ( MarginParam1 = 'here' ) then + begin + Style.LeftMargin := X {div FontWidthPrecisionFactor}; + end + else + begin + try + MarginSize := StrToInt( MarginParam1 ); + if tmpFontParts.Count > 1 then // do we have a second parameter + MarginParam2 := tmpFontParts[1] + else + MarginParam2 := ''; + if MarginParam2 = 'pixels' then + NewMargin := MarginSize + + else if MarginParam2 = 'deffont' then + NewMargin := MarginSize * Settings.NormalFont.TextWidth('w') // .Width + + else + begin + case Settings.MarginSizeStyle of + msAverageCharWidth: + NewMargin := MarginSize * FontManager.AverageCharWidth; + msMaximumCharWidth: + NewMargin := MarginSize * FontManager.MaximumCharWidth; + msSpecifiedChar: + NewMargin := MarginSize + * FontManager.CharWidth( Chr( Settings.MarginChar ) ) + div FontWidthPrecisionFactor; + end; + end; + except + NewMargin := 0; + end; + + if Tag.TagType = ttSetLeftMargin then + Style.LeftMargin := Settings.Margins.Left + + NewMargin + else + Style.RightMargin := Settings.Margins.Right + + NewMargin; + end; + tmpFontParts.Free; + end; { teSet[left|right]margin } + + end; { case Tag.TagType } + + ApplyStyle( Style, FontManager ); +ProfileEvent('DEBUG: ApplyStyleTag <<<'); +end; + +function GetDefaultStyle( const Settings: TRichTextSettings ): TTextDrawStyle; +begin + FillChar(Result, SizeOf(TTextDrawStyle), 0); + FPGuiFontToFontSpec( Settings.FNormalFont, Result.Font ); + Result.Alignment := Settings.FDefaultAlignment; + Result.Wrap := Settings.FDefaultWrap; + Result.Color := Settings.FDefaultColor; + Result.BackgroundColor := Settings.FDefaultBackgroundColor; + Result.LeftMargin := Settings.Margins.Left; + Result.RightMargin := Settings.Margins.Right; +end; + + +Procedure TRichTextSettings.SetupComponent; +begin + Name := 'RichTextSettings'; + + FNormalFont := fpgGetFont('Arial-10'); + FFixedFont := fpgGetFont('Courier New-10'); + FHeading1Font := fpgGetFont('Arial-20'); + FHeading2Font := fpgGetFont('Arial-14'); + FHeading3Font := fpgGetFont('Arial-10:bold'); + + FDefaultColor := clBlack; + FDefaultBackgroundColor := clWhite; + + FDefaultAlignment := taLeft; + FDefaultWrap := true; + FAtLeastOneWordBeforeWrap := false; + + FMarginSizeStyle := msMaximumCharWidth; + FMarginChar := Ord( ' ' ); + + FMargins.Left := 0; + FMargins.Right := 0; + FMargins.Top := 0; + FMargins.Bottom := 0; + + FUpdateCount := 0; + FChangesPending := false; +end; + +constructor TRichTextSettings.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + SetupComponent; +end; + +destructor TRichTextSettings.Destroy; +begin + FNormalFont.Free; + FFixedFont.Free; + FHeading1Font.Free; + FHeading2Font.Free; + FHeading3Font.Free; + Inherited Destroy; +end; + +// Font read/write from SCU. I have NO IDEA why I have to do this manually. But +// this way works and everything else I tried doesn't +//Procedure TRichTextSettings.ReadSCUResource( Const ResName: TResourceName; +// Var Data; +// DataLen: LongInt ); +//Begin +// If ResName = 'Heading1Font' Then +// Begin +// If DataLen <> 0 Then +// FHeading1Font := ReadSCUFont( Data, DataLen ); +// End +// Else If ResName = 'Heading2Font' Then +// Begin +// If DataLen <> 0 Then +// FHeading2Font := ReadSCUFont( Data, DataLen ); +// End +// Else If ResName = 'Heading3Font' Then +// Begin +// If DataLen <> 0 Then +// FHeading3Font := ReadSCUFont( Data, DataLen ); +// End +// Else If ResName = 'FixedFont' Then +// Begin +// If DataLen <> 0 Then +// FFixedFont := ReadSCUFont( Data, DataLen ); +// End +// Else if ResName = 'NormalFont' then +// Begin +// If DataLen <> 0 Then +// FNormalFont := ReadSCUFont( Data, DataLen ); +// End +// Else +// Inherited ReadSCUResource( ResName, Data, DataLen ); +//End; + +//Function TRichTextSettings.WriteSCUResource( Stream: TResourceStream ): boolean; +//begin +// Result := Inherited WriteSCUResource( Stream ); +// If Not Result Then +// Exit; +// +// If FHeading1Font <> Nil then +// Result := FHeading1Font.WriteSCUResourceName( Stream, 'Heading1Font' ); +// If FHeading2Font <> Nil then +// Result := FHeading2Font.WriteSCUResourceName( Stream, 'Heading2Font' ); +// If FHeading3Font <> Nil then +// Result := FHeading3Font.WriteSCUResourceName( Stream, 'Heading3Font' ); +// If FFixedFont <> Nil then +// Result := FFixedFont.WriteSCUResourceName( Stream, 'FixedFont' ); +// If FNormalFont <> Nil then +// Result := FNormalFont.WriteSCUResourceName( Stream, 'NormalFont' ); +// +//end; + +Procedure TRichTextSettings.Change; +begin + if FUpdateCount > 0 then + begin + FChangesPending := true; + exit; + end; + + if FOnChange <> nil then + FOnChange( self ); +end; + +Procedure TRichTextSettings.SetDefaultAlignment( Alignment: TTextAlignment ); +begin + if Alignment = FDefaultAlignment then + exit; // no change + + FDefaultAlignment := Alignment; + Change; +end; + +Procedure TRichTextSettings.SetDefaultWrap( Wrap: boolean ); +begin + if Wrap = FDefaultWrap then + exit; // no change + + FDefaultWrap := Wrap; + Change; +end; + +Procedure TRichTextSettings.SetAtLeastOneWordBeforeWrap( NewValue: boolean ); +begin + if NewValue = FAtLeastOneWordBeforeWrap then + exit; // no change + + FAtLeastOneWordBeforeWrap := NewValue; + Change; +end; + +Procedure TRichTextSettings.SetMarginChar( NewValue: longint ); +begin + if NewValue = FMarginChar then + exit; // no change + + FMarginChar := NewValue; + + if FMarginSizeStyle <> msSpecifiedChar then + // doesn't matter, will be ignored + exit; + Change; +end; + +Procedure TRichTextSettings.SetMarginSizeStyle( NewValue: TMarginSizeStyle ); +begin + if NewValue = FMarginSizeStyle then + exit; // no change + + FMarginSizeStyle := NewValue; + Change; +end; + +Function FontSame( FontA: TfpgFont; FontB: TfpgFont ): boolean; +begin + if ( FontA = nil ) + or ( FontB = nil ) then + begin + Result := FontA = FontB; + exit; + end; + + Result := FontA.FontDesc = FontB.FontDesc; +end; + +Procedure TRichTextSettings.AssignFont( Var Font: TfpgFont; + NewFont: TfpgFont ); +begin + If NewFont = Nil Then + NewFont := fpgApplication.DefaultFont; + + if FontSame( NewFont, Font ) then + exit; // no change + + Font.Free; + Font := NewFont; +// Font.Free; + + Change; +End; + +Procedure TRichTextSettings.SetHeading1Font( NewFont: TfpgFont ); +begin +// ProfileEvent( 'TRichTextSettings.SetHeading1Font' ); + AssignFont( FHeading1Font, NewFont ); + +// if FHeading1FOnt = nil then +// ProfileEvent( ' Set to nil' ); + +end; + +Procedure TRichTextSettings.SetHeading2Font( NewFont: TfpgFont ); +begin + AssignFont( FHeading2Font, NewFont ); +End; + +Procedure TRichTextSettings.SetHeading3Font( NewFont: TfpgFont ); +begin + AssignFont( FHeading3Font, NewFont ); +End; + +Procedure TRichTextSettings.SetFixedFont( NewFont: TfpgFont ); +begin + AssignFont( FFixedFont, NewFont ); +end; + +Procedure TRichTextSettings.SetNormalFont( NewFont: TfpgFont ); +begin + AssignFont( FNormalFont, NewFont ); +end; + +Procedure TRichTextSettings.SetMargins( const NewMargins: TRect ); +begin + if NewMargins = FMargins then + exit; // no change + FMargins := NewMargins; + Change; +end; + +function TRichTextSettings.GetMargin_Left: longint; +begin + Result := FMargins.Left; +end; + +Procedure TRichTextSettings.SetMargin_Left( NewValue: longint ); +begin + FMargins.Left := NewValue; +end; + +function TRichTextSettings.GetMargin_Bottom: longint; +begin + Result := FMargins.Bottom; +end; + +Procedure TRichTextSettings.SetMargin_Bottom( NewValue: longint ); +begin + FMargins.Bottom := NewValue; +end; + +function TRichTextSettings.GetMargin_Right: longint; +begin + Result := FMargins.Right; +end; + +Procedure TRichTextSettings.SetMargin_Right( NewValue: longint ); +begin + FMargins.Right := NewValue; +end; + +function TRichTextSettings.GetMargin_Top: longint; +begin + Result := FMargins.Top; +end; + +Procedure TRichTextSettings.SetMargin_Top( NewValue: longint ); +begin + FMargins.Top := NewValue; +end; + +Procedure TRichTextSettings.SetDefaultColor( NewColor: TfpgColor ); +begin + if NewColor = FDefaultColor then + exit; + FDefaultColor := NewColor; + Change; +end; + +Procedure TRichTextSettings.SetDefaultBackgroundColor( NewColor: TfpgColor ); +begin + if NewColor = FDefaultBackgroundColor then + exit; + FDefaultBackgroundColor := NewColor; + Change; +end; + +procedure TRichTextSettings.BeginUpdate; +begin + inc( FUpdateCount ); +end; + +procedure TRichTextSettings.EndUpdate; +begin + if FUpdateCount = 0 then + exit; + + dec( FUpdateCount ); + if FUpdateCount = 0 then + begin + if FChangesPending then + begin + Change; + FChangesPending := false; + end; + end; +end; + +Initialization + RegisterClasses( [ TRichTextSettings ] ); +End. diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas new file mode 100644 index 00000000..ec1af338 --- /dev/null +++ b/docview/components/richtext/RichTextView.pas @@ -0,0 +1,2862 @@ +Unit RichTextView; + +{$mode objfpc}{$H+} + +Interface + +Uses + Classes, + fpg_base, + fpg_main, + fpg_widget, + fpg_scrollbar, + fpg_menu, + fpg_imagelist, + RichTextStyleUnit, + RichTextLayoutUnit, +// RichTextDocumentUnit, + CanvasFontManager; + +{ +Remaining keyboard support +- cursor down to go to end of line (this is tricky) + I don't understand what I mean here! +- If scrolllock is on, then scroll the screen, not move cursor. + Really? So few things obey it... +} + +const + // for dragtext support, primarily. + RT_QUERYTEXT = FPGM_USER + 500; + // Param1: pointer to buffer (may be nil) + // Param2: buffer size (-1 to ignore) + // Returns: number of bytes copied + + RT_QUERYSELTEXT = FPGM_USER + 501; + // Param1: pointer to buffer (may be nil) + // Param2: buffer size (-1 to ignore) + // Returns: number of bytes copied + +Type + TFindOrigin = ( foFromStart, foFromCurrent ); + + TScrollingDirection = ( sdUp, sdDown ); + +Type + + TRichTextView = class; + + // reimplement class + TLinkEvent = procedure( Sender: TRichTextView; Link: string ) of object; + + + TRichTextView = Class( TfpgWidget ) + private + FPopupMenu: TfpgPopupMenu; + procedure FVScrollbarScroll(Sender: TObject; position: integer); + procedure FHScrollbarScroll(Sender: TObject; position: integer); + procedure ShowDefaultPopupMenu(const x, y: integer; const shiftstate: TShiftState); virtual; + Procedure CreateDefaultMenu; + Procedure SelectAllMIClick( Sender: TObject ); + Procedure CopyMIClick( Sender: TObject ); + Procedure RefreshMIClick( Sender: TObject ); + Procedure WordWrapMIClick( Sender: TObject ); + Procedure SmoothScrollMIClick( Sender: TObject ); + Procedure DebugMIClick( Sender: TObject ); + Procedure DefaultMenuPopup( Sender: TObject ); + protected + FFontManager: TCanvasFontManager; + FRichTextSettings: TRichTextSettings; + + // Properties +// FBorderStyle:TfpgBorderStyle; + FScrollbarWidth: longint; + FSmoothScroll: boolean; + FUseDefaultMenu: boolean; + FDebug: boolean; + + FOnOverLink: TLinkEvent; + FOnNotOverLink: TLinkEvent; + FOnClickLink: TLinkEvent; + + FDefaultMenu: TfpgPopupMenu; + FSelectAllMI: TfpgMenuItem; + FCopyMI: TfpgMenuItem; + FRefreshMI: TfpgMenuItem; + FWordWrapMI: TfpgMenuItem; + FSmoothScrollMI: TfpgMenuItem; + FDebugMI: TfpgMenuItem; + + // Internal layout data + FNeedVScroll, FNeedHScroll: boolean; + + FLayoutRequired: boolean; + FLayout: TRichTextLayout; + + // Child controls + FHScrollbar: TfpgScrollbar; + FVScrollbar: TfpgScrollbar; + + // Text + FText: PChar; + + FTopCharIndex: longint; // only applies until following flag set. + FVerticalPositionInitialised: boolean; + + FCursorRow: longint; + FCursorOffset: longint; + FSelectionStart: longint; + FSelectionEnd: longint; + FImages: TfpgImageList; + + // Selection scrolling + //FScrollTimer: TfpgTimer; + FOldMousePoint: TPoint; + FScrollingDirection: TScrollingDirection; + + // Scroll information + // we use these rather than the scrollbar positions direct, + // since those are not updated during tracking + FXScroll: longint; + FYScroll: longint; + + FLastXScroll: longint; + FLastYScroll: longint; + + // Link + FLastLinkOver: string; + FClickedLink: string; + + procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); override; + Procedure CreateWnd; + procedure HandleResize(AWidth, AHeight: TfpgCoord); override; + procedure UpdateScrollBarCoords; + procedure HandlePaint; override; + procedure HandleHide; override; + procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; + procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; + procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override; + procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; + procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; + + //procedure ScanEvent( Var KeyCode: TKeyCode; + // RepeatCount: Byte ); override; + + //Procedure MouseDown( Button: TMouseButton; + // ShiftState: TShiftState; + // X, Y: Longint ); override; + //Procedure MouseUp( Button: TMouseButton; + // ShiftState: TShiftState; + // X, Y: Longint ); override; + + //Procedure MouseDblClick( Button: TMouseButton; + // ShiftState: TShiftState; + // X, Y: Longint ); override; + + //Procedure MouseMove( ShiftState: TShiftState; + // X, Y: Longint ); override; + + //Procedure Scroll( Sender: TScrollbar; + // ScrollCode: TScrollCode; + // Var ScrollPos: Longint ); override; + + //Procedure KillFocus; override; + //Procedure SetFocus; override; + + // Messages for DragText + Procedure RTQueryText( Var Msg: TfpgMessageRec ); message RT_QUERYTEXT; + Procedure RTQuerySelText( Var Msg: TfpgMessageRec ); message RT_QUERYSELTEXT; + + procedure Layout; + + function FindPoint( XToFind: longint; + YToFind: longint; + Var LineIndex: longint; + Var Offset: longint; + Var Link: string ): TTextPosition; + + // Scroll functions + + // Scroll display to given positions (does NOT + // update scrollbars as this may be called during + // scrolling) + Procedure DoVerticalScroll( NewY: longint ); + Procedure DoHorizontalScroll( NewX: longint ); + + // Set scrollbar position, and update display + Procedure SetVerticalPosition( NewY: longint ); + Procedure SetHorizontalPosition( NewX: longint ); + + procedure OnScrollTimer( Sender: TObject ); + Function GetLineDownPosition: longint; + Function GetLineUpPosition: longint; + Function GetSmallDownScrollPosition: longint; + Function GetSmallUpScrollPosition: longint; + Function GetSmallRightScrollPosition: longint; + Function GetSmallLeftScrollPosition: longint; + + // Calculates line down position given the last line and displayed pixels + Function GetLineDownPositionFrom( LastLine: longint; PixelsDisplayed: longint ): longint; + Function GetLineUpPositionFrom( FirstVisibleLine: longint; Offset: longint ): longint; + + // Drawing functions + Procedure DrawBorder; + Procedure Draw( StartLine, EndLine: longint ); + + // Rectangle (GetClientRect) minus scrollbars (if they are enabled) + Function GetDrawRect: TfpgRect; + // Rectangle minus scrollbars (GetDrawRect), minus extra 2px border all round + function GetTextAreaRect: TfpgRect; + function GetTextAreaHeight: longint; + function GetTextAreaWidth: longint; + + // Queries + procedure GetFirstVisibleLine( Var LineIndex: longint; Var Offset: longint ); + procedure GetBottomLine( Var LineIndex: longint; Var PixelsDisplayed: longint ); + + // Layout functions + Procedure SetupScrollbars; + Procedure SetupCursor; + procedure RemoveCursor; + + function GetTextEnd: longint; + + // property handlers +// procedure SetBorder( BorderStyle: TBorderStyle ); + Procedure SetDebug( Debug: boolean ); + Procedure SetScrollBarWidth( NewValue: longint ); + + Procedure OnRichTextSettingsChanged( Sender: TObject ); + + function GetCursorIndex: longint; + + Function GetTopCharIndex: longint; + Procedure SetTopCharIndex( NewValue: longint ); + Function GetTopCharIndexPosition( NewValue: longint ): longint; + + // Update the cursor row/column for the selction start/end + procedure RefreshCursorPosition; + + procedure SetCursorIndex( Index: longint; + PreserveSelection: boolean ); + procedure SetCursorPosition( Offset: longint; + Row: longint; + PreserveSelection: boolean ); + + procedure MakeRowVisible( Row: longint ); + procedure MakeRowAndColumnVisible( Row: longint; + Column: longint ); + + // These two methods set selection start and end, + // and redraw the screen, but do not set up cursor. + Procedure SetSelectionStartInternal( SelectionStart: longint ); + Procedure SetSelectionEndInternal( SelectionEnd: longint ); + + // Property handlers. These are for programmatic access + // where a complete setup of selection is needed + Procedure SetSelectionStart( SelectionStart: longint ); + Procedure SetSelectionEnd( SelectionEnd: longint ); + + Procedure SetImages( AImages: TfpgImageList ); + Procedure Notification( AComponent: TComponent; + Operation: TOperation ); override; + Public + constructor Create(AOwner: TComponent); override; + destructor Destroy; Override; + // rect (of component) minus frame borders - normally 2 pixels all round + function GetClientRect: TfpgRect; override; + procedure AddText( Text: PChar; ADelay: boolean = False ); + procedure AddParagraph( Text: PChar ); + procedure AddSelectedParagraph( Text: PChar ); + procedure Clear(const ADestroying: boolean = False); + procedure InsertText( CharIndexToInsertAt: longword; TextToInsert: PChar ); + property Text: PChar read FText; + property TextEnd: longint read GetTextEnd; + property SelectionStart: longint read FSelectionStart write SetSelectionStart; + property SelectionEnd: longint read FSelectionEnd write SetSelectionEnd; + property CursorIndex: longint read GetCursorIndex; + + // Copy all text to buffer + // Buffer can be nil to simply get size. + // If BufferLength is negative, it is ignored + Function CopyTextToBuffer( Buffer: PChar; BufferLength: longint ): longint; + + // Clipboard + Procedure CopySelectionToClipboard; + + // returns number of chars (that would be) copied. + // Buffer can be nil to simply get size. + // If BufferLength is negative, it is ignored + Function CopySelectionToBuffer( Buffer: PChar; + BufferLength: longint ): longint; + + Function GetSelectionAsString: string; // returns up to 255 chars obviously + + // Selection queries + Function SelectionLength: longint; // Note: includes formatting + Function SelectionSet: boolean; // returns true if there is a selection + + // Selection actions + Procedure ClearSelection; + Procedure SelectAll; + + property CursorRow: longint read FCursorRow; + + // Navigation + procedure GoToTop; + procedure GotoBottom; + Procedure UpLine; + Procedure DownLine; + Procedure UpPage; + Procedure DownPage; + + Procedure SmallScrollUp; + Procedure SmallScrollDown; + Procedure SmallScrollLeft; + Procedure SmallScrollRight; + + Procedure MakeCharVisible( CharIndex: longint ); + Property TopCharIndex: longint read GetTopCharIndex write SetTopCharIndex; + + Procedure CursorLeft( PreserveSelection: boolean ); + Procedure CursorRight( PreserveSelection: boolean ); + Procedure CursorDown( PreserveSelection: boolean ); + Procedure CursorUp( PreserveSelection: boolean ); + Procedure CursorPageDown( PreserveSelection: boolean ); + Procedure CursorPageUp( PreserveSelection: boolean ); + + Procedure CursorToLineStart( PreserveSelection: boolean ); + Procedure CursorToLineEnd( PreserveSelection: boolean ); + + Procedure CursorWordLeft( PreserveSelection: boolean ); + Procedure CursorWordRight( PreserveSelection: boolean ); + + function HighlightNextLink: boolean; + function HighlightPreviousLink: boolean; + + // Search for the given text + // if found, returns true, MatchIndex is set to the first match, + // and MatchLength returns the length of the match + // (which may be greater than the length of Text due to + // to skipping tags) + // if not found, returns false, pMatch is set to -1 + function FindString( Origin: TFindOrigin; + const AText: string; + var MatchIndex: longint; + var MatchLength: longint ): boolean; + + // Searches for text and selects it found + // returns true if found, false if not + function Find( Origin: TFindOrigin; + const AText: string ): boolean; + + function LinkFromIndex( const CharIndexToFind: longint): string; + + Published + property Align; + property BackgroundColor default clBoxColor; + //property ParentColor; + //property ParentFont; + //property ParentPenColor; + property ParentShowHint; + property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; + property ShowHint; + Property TabOrder; + Property Focusable; + property Visible; + property RichTextSettings: TRichTextSettings read FRichTextSettings; + property ScrollBarWidth: longint read FScrollBarWidth write SetScrollBarWidth default 15; + property SmoothScroll: boolean read FSmoothScroll write FSmoothScroll; + property UseDefaultMenu: boolean read FUseDefaultMenu write FUseDefaultMenu default True; + property Debug: boolean read FDebug write SetDebug default False; + property Images: TfpgImageList read FImages write SetImages; + + // ------- EVENTS ---------- + + // Called with the name of the link when the mouse first moves over it + property OnOverLink: TLinkEvent read FOnOverLink write FOnOverLink; + + // Called with the name of the link when the mouse leaves it + property OnNotOverLink: TLinkEvent read FOnNotOverLink write FOnNotOverLink; + + // Called when the link is clicked. + property OnClickLink: TLinkEvent read FOnClickLink write FOnClickLink; + + Property OnClick; + Property OnDoubleClick; + //property OnDragOver; + //property OnDragDrop; + //property OnEndDrag; + Property OnEnter; + Property OnExit; + //Property OnFontChange; + //Property OnMouseClick; + //Property OnMouseDblClick; + //Property OnSetupShow; + + //Property OnScan; + Protected + //Property Font; + + End; + + +implementation + +uses + SysUtils + ,ACLStringUtility + ,nvUtilities +// ControlScrolling, ControlsUtility, + ,RichTextDocumentUnit + ,RichTextDisplayUnit + ; + +Procedure TRichTextView.SetSelectionStart( SelectionStart: longint ); +begin + RemoveCursor; + SetSelectionStartInternal( SelectionStart ); + RefreshCursorPosition; + SetupCursor; +end; + +Procedure TRichTextView.SetSelectionEnd( SelectionEnd: longint ); +begin + RemoveCursor; + SetSelectionEndInternal( SelectionEnd ); + RefreshCursorPosition; + SetupCursor; +end; + +Procedure TRichTextView.SetSelectionStartInternal( SelectionStart: longint ); +begin + if SelectionStart = FSelectionStart then + exit; + + if SelectionSet then + if SelectionStart = -1 then + // small side effect here - also sets selectionend to -1 + ClearSelection; + + FSelectionStart := SelectionStart; + if FSelectionEnd = -1 then + // still no selection + exit; + RePaint; +end; + +Procedure TRichTextView.SetSelectionEndInternal( SelectionEnd: longint ); +var + StartRedrawLine: longint; + EndRedrawLine: longint; + OldClip: TfpgRect; +begin + if SelectionEnd = FSelectionEnd then + exit; + + if FSelectionStart = -1 then + begin + FSelectionEnd := SelectionEnd; + // still not a valid selection, no need to redraw + exit; + end; + + if SelectionEnd = FSelectionStart then + SelectionEnd := -1; + + if ( FSelectionEnd = -1 ) then + begin + // there is currently no selection, + // and we are setting one: need to draw it all + StartRedrawLine := FLayout.GetLineFromCharIndex( FSelectionStart ); + EndRedrawLine := FLayout.GetLineFromCharIndex( SelectionEnd ); + end + else + begin + // there is already a selection + if SelectionEnd = -1 then + begin + // and we're clearing it + StartRedrawLine := FLayout.GetLineFromCharIndex( FSelectionStart ); + EndRedrawLine := FLayout.GetLineFromCharIndex( FSelectionEnd ); + end + else + begin + // and we're setting a new one, so draw from the old end to the new + StartRedrawLine := FLayout.GetLineFromCharIndex( FSelectionEnd ); + EndRedrawLine := FLayout.GetLineFromCharIndex( SelectionEnd ); + end; + end; + + FSelectionEnd := SelectionEnd; + + OldClip := Canvas.GetClipRect; + Canvas.SetClipRect(GetTextAreaRect); + + // (re)draw selection + { TODO -ograeme : Draw must not be called here } +// Draw( StartRedrawLine, EndRedrawLine ); + Canvas.SetClipRect(OldClip); +end; + +Procedure TRichTextView.ClearSelection; +var + OldClip: TfpgRect; + StartLine: longint; + EndLine: longint; +begin + + if SelectionSet then + begin + OldClip := Canvas.GetClipRect; + Canvas.SetClipRect(GetTextAreaRect); + + StartLine := FLayout.GetLineFromCharIndex( FSelectionStart ); + EndLine := FLayout.GetLineFromCharIndex( FSelectionEnd ); + + FSelectionEnd := -1; + FSelectionStart := -1; + + // clear display of selection + { TODO -oGraeme : Draw must not be called here } +// Draw( StartLine, EndLine ); + + Canvas.SetClipRect(OldClip); + end; + + FSelectionEnd := -1; + FSelectionStart := -1; +end; + +Function TRichTextView.GetTextEnd: longint; +begin + Result := StrLen( FText ); +end; + +Procedure TRichTextView.CreateDefaultMenu; +begin + FDefaultMenu := TfpgPopupMenu.Create(nil); + FDefaultMenu.OnShow := @DefaultMenuPopup; + + FSelectAllMI := FDefaultMenu.AddMenuItem('Select &All', '', @SelectAllMIClick); + FCopyMI := FDefaultMenu.AddMenuItem('&Copy', '', @CopyMIClick); + FDefaultMenu.AddMenuItem('-', '', nil); + FRefreshMI := FDefaultMenu.AddMenuItem('&Refresh', '', @RefreshMIClick); + FDefaultMenu.AddMenuItem('-', '', nil); + FSmoothScrollMI := FDefaultMenu.AddMenuItem('&Smooth Scrolling', '', @SmoothScrollMIClick); + FWordWrapMI := FDefaultMenu.AddMenuItem('&Word Wrap', '', @WordWrapMIClick); + FDebugMI := FDefaultMenu.AddMenuItem('&Debug', '', @DebugMIClick); +end; + +Procedure TRichTextView.SelectAllMIClick( Sender: TObject ); +begin + SelectAll; +end; + +Procedure TRichTextView.CopyMIClick( Sender: TObject ); +begin + CopySelectionToClipBoard; +end; + +Procedure TRichTextView.RefreshMIClick( Sender: TObject ); +begin + RePaint; +end; + +Procedure TRichTextView.WordWrapMIClick( Sender: TObject ); +begin + FRichTextSettings.DefaultWrap := not FRichTextSettings.DefaultWrap; +end; + +Procedure TRichTextView.SmoothScrollMIClick( Sender: TObject ); +begin + SmoothScroll := not SmoothScroll; +end; + +Procedure TRichTextView.DebugMIClick( Sender: TObject ); +begin + Debug := not Debug; +// writeln('VScrollbar.Position=', FVScrollbar.Position, ' min/max=', FVScrollbar.Min, '/', FVScrollbar.Max); +// writeln('FNeedHScroll=', FNeedHScroll, ' FNeedVScroll=', FNeedVScroll); + RePaint; +end; + +Procedure TRichTextView.DefaultMenuPopup( Sender: TObject ); +begin + FWordWrapMI.Checked := FRichTextSettings.DefaultWrap; + FSmoothScrollMI.Checked := SmoothScroll; + FDebugMI.Checked := Debug; +end; + +constructor TRichTextView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Name := 'RichTextView'; + FWidth := 150; + FHeight := 70; + FFocusable := True; + + FNeedVScroll := False; + FNeedHScroll := False; + FSmoothScroll := True; + FScrollbarWidth := 15; + FUseDefaultMenu := True; + FDebug := False; + FLayoutRequired := True; + + FTextColor := Parent.TextColor; + FBackgroundColor := clBoxColor; + + FRichTextSettings := TRichTextSettings.Create( self ); + FRichTextSettings.Margins := Rect( 5, 5, 5, 5 ); + FRichTextSettings.OnChange := @OnRichTextSettingsChanged; + + FImages := nil; + + if not InDesigner then + begin + FFontManager := nil; + + FText := StrAlloc( 100 ); + FText[ 0 ] := #0; + + FTopCharIndex := 0; + FVerticalPositionInitialised := false; + end; +end; + +procedure TRichTextView.HandlePaint; +Var + CornerRect: TfpgRect; + TextRect: TfpgRect; + DrawRect: TfpgRect; + x: integer; + + // Just for fun! :-) + procedure DesignerPainting(const AText: string; AColor: TfpgColor; AFontDesc: TfpgString = ''); + var + oldf: TfpgString; + begin + oldf := ''; + if AFontDesc <> '' then + begin + oldf := Canvas.Font.FontDesc; // save original font + Canvas.Font := fpgGetFont(AFontDesc); // set new font + end; + Canvas.TextColor := AColor; // set new color + Canvas.DrawString(x, 10, AText); + x := x + Canvas.Font.TextWidth(AText); // calc x offset for next text + if oldf <> '' then + Canvas.Font := fpgGetFont(oldf); // restore original font + end; + +begin + ProfileEvent('TRichTextView.HandlePaint >>>'); + Canvas.ClearClipRect; + DrawBorder; +ProfileEvent('DEBUG: TRichTextView.HandlePaint 1'); + DrawRect := GetDrawRect; + Canvas.Color := BackgroundColor; + Canvas.FillRectangle(DrawRect); + +ProfileEvent('DEBUG: TRichTextView.HandlePaint 2'); + TextRect := GetTextAreaRect; + Canvas.SetClipRect(TextRect); + +ProfileEvent('DEBUG: TRichTextView.HandlePaint 3'); + if InDesigner then + begin + Canvas.TextColor := clInactiveWgFrame; + x := 10; + DesignerPainting('<', clInactiveWgFrame); + DesignerPainting('rich', clBlack, 'Sans-10:bold'); + DesignerPainting(' text', clRed, 'Sans-10:italic'); + DesignerPainting(' ', clInactiveWgFrame); + DesignerPainting('will', clBlue, 'Sans-10:underline'); + DesignerPainting(' appear here>', clInactiveWgFrame); +// Canvas.DrawString(10, 10, '<rich text will appear here>'); + Canvas.ClearClipRect; + Exit; //==> + end; + + if Length(FText) = 0 then + exit; // no need to paint anything further. + +ProfileEvent('DEBUG: TRichTextView.HandlePaint 4'); + Assert(FLayout <> nil, 'FLayout may not be nil at this point!'); + if not Debug then + Draw( 0, FLayout.FNumLines ) + else + Canvas.DrawText(8, 8, GetTextAreaWidth, GetTextAreaHeight{1000}, FText, [txtLeft, txtTop, txtWrap]); +ProfileEvent('DEBUG: TRichTextView.HandlePaint 5'); + Canvas.ClearClipRect; + + if FHScrollbar.Visible and FVScrollbar.Visible then + begin + // blank out corner between scrollbars + CornerRect.Left := Width - 2 - FScrollBarWidth; + CornerRect.Top := Height - 2 - FScrollBarWidth; + CornerRect.Width := FScrollBarWidth; + CornerRect.Height := FScrollBarWidth; + Canvas.Color := clButtonFace; + Canvas.FillRectangle(CornerRect); + end; +ProfileEvent('DEBUG: TRichTextView.HandlePaint <<<'); +end; + +procedure TRichTextView.HandleHide; +begin +// fpgCaret.UnSetCaret (Canvas); + inherited HandleHide; +end; + +procedure TRichTextView.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; + var consumed: boolean); +begin +ProfileEvent('HandleKeyPress'); + case keycode of + keyPageDown: + begin + consumed := True; + UpPage; + end; + keyPageUp: + begin + consumed := True; + DownPage; + end; + + end; + inherited HandleKeyPress(keycode, shiftstate, consumed); +end; + +procedure TRichTextView.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleRMouseUp(x, y, shiftstate); + if Assigned(PopupMenu) then + PopupMenu.ShowAt(self, x, y) + else + ShowDefaultPopupMenu(x, y, ShiftState); +end; + +procedure TRichTextView.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; + delta: smallint); +begin + inherited HandleMouseScroll(x, y, shiftstate, delta); + if delta < 0 then + // scroll up + SetVerticalPosition(FVScrollbar.Position - FVScrollbar.ScrollStep) + else + // scroll down + SetVerticalPosition(FVScrollbar.Position + FVScrollbar.ScrollStep); +end; + +procedure TRichTextView.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); +var + Line: longint; + Offset: longint; + Link: string; + Position: TTextPosition; + Shift: boolean; +begin + inherited HandleLMouseDown(x, y, shiftstate); + Position := FindPoint( X, Y, Line, Offset, Link ); + FClickedLink := Link; +// writeln('Pos=', Ord(Position), ' link=', Link); +end; + +procedure TRichTextView.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleLMouseUp(x, y, shiftstate); + if FClickedLink <> '' then + if Assigned( FOnClickLink ) then + FOnClickLink( Self, FClickedLink ); + FClickedLink := ''; // reset link +end; + +Destructor TRichTextView.Destroy; +Begin + FDefaultMenu.Free; + // destroy the font manager NOW + // while the canvas is still valid + // (it will be freed in TControl.DisposeWnd) + // in order to release logical fonts + if FFontManager <> nil then + FFontManager.Free; + if Assigned(FLayout) then + FreeAndNil(FLayout); + + //FScrollTimer.Free; + if not InDesigner then + begin + RemoveCursor; + StrDispose( FText ); + end; + Inherited Destroy; +End; + +//Procedure TRichTextView.KillFocus; +//begin +// RemoveCursor; +// inherited KillFocus; +//end; + +//Procedure TRichTextView.SetFocus; +//begin +// inherited SetFocus; +// SetupCursor; +//end; + +// Custom window messages for DragText support +Procedure TRichTextView.RTQueryText( Var Msg: TfpgMessageRec ); +begin + //Msg.Handled := true; + //Msg.Result := + // CopyPlainTextToBuffer( FText, + // FText + strlen( FText ), + // PChar( Msg.Param1 ), + // Msg.Param2 ); +end; + +Procedure TRichTextView.RTQuerySelText( Var Msg: TfpgMessageRec ); +begin + //Msg.Handled := true; + //Msg.Result := + // CopySelectionToBuffer( PChar( Msg.Param1 ), + // Msg.Param2 ); +end; + +Procedure TRichTextView.SetDebug( Debug: boolean ); +begin + if Debug = FDebug then + exit; + FDebug := Debug; + RePaint; +end; + +Procedure TRichTextView.SetScrollBarWidth( NewValue: longint ); +begin + if ( NewValue < 0 ) + or ( NewValue = FScrollBarWidth ) then + exit; + FScrollBarWidth := NewValue; + Layout; + RePaint; +end; + +procedure TRichTextView.FVScrollbarScroll(Sender: TObject; position: integer); +begin + SetVerticalPosition(position); +end; + +procedure TRichTextView.FHScrollbarScroll(Sender: TObject; position: integer); +begin + SetHorizontalPosition(position); +end; + +procedure TRichTextView.ShowDefaultPopupMenu(const x, y: integer; + const shiftstate: TShiftState); +begin + if not Assigned(FDefaultMenu) then + CreateDefaultMenu; + FDefaultMenu.ShowAt(x, y); +end; + +procedure TRichTextView.DoAllocateWindowHandle(AParent: TfpgWindowBase); +begin + inherited DoAllocateWindowHandle(AParent); + CreateWnd; +end; + +Procedure TRichTextView.CreateWnd; +begin +ProfileEvent('DEBUG: TRichTextView.CreateWnd >>>>'); + if InDesigner then + exit; + + { TODO -ograeme : I disabled bitmap fonts } + FFontManager := TCanvasFontManager.Create( Canvas, + False, // allow bitmap fonts + Self + ); + + FLastLinkOver := ''; + FSelectionStart := -1; + FSelectionEnd := -1; + + if FUseDefaultMenu then + begin + CreateDefaultMenu; + FPopupMenu := FDefaultMenu; + end; + + FHScrollbar := TfpgScrollBar.Create( self ); + FHScrollbar.Visible := False; + FHScrollbar.Orientation := orHorizontal; + FHScrollBar.SetPosition(2, Height-2-FScrollbarWidth, Width-4-FScrollbarWidth, FScrollbarWidth); + + FVScrollbar := TfpgScrollBar.Create( self ); + FVScrollBar.Visible := False; + FVScrollBar.Orientation := orVertical; + FVScrollbar.SetPosition(Width-2-FScrollbarWidth, 2, FScrollbarWidth, Height-4-FScrollbarWidth); + +// FScrollTimer := TfpgTimer.Create( 100 ); +// FScrollTimer.OnTimer := @OnScrollTimer; + +// FLinkCursor := GetLinkCursor; + + if FLayoutRequired then + // we haven't yet done a layout + Layout; +ProfileEvent('DEBUG: TRichTextView.CreateWnd <<<<'); +end; + +procedure TRichTextView.HandleResize(AWidth, AHeight: TfpgCoord); +begin + inherited HandleResize(AWidth, AHeight); + if InDesigner then + exit; + + if WinHandle = 0 then + exit; + + RemoveCursor; + UpdateScrollbarCoords; + + if FVerticalPositionInitialised then + begin + // Preserve current position + if FLayout.FNumLines > 0 then + FTopCharIndex := GetTopCharIndex + else + FTopCharIndex := 0; + end; + + Layout; + + // This is the point at which vertical position + // is initialised during first window show + FVScrollBar.Position := GetTopCharIndexPosition( FTopCharIndex ); + + FYScroll := FVScrollBar.Position; + FLastYScroll := FYScroll; + FVerticalPositionInitialised := true; + + SetupCursor; +end; + +procedure TRichTextView.UpdateScrollBarCoords; +var + HWidth: integer; + VHeight: integer; +begin + VHeight := Height - 4; + HWidth := Width - 4; + + if FVScrollBar.Visible then + Dec(HWidth, FScrollbarWidth); + if FHScrollBar.Visible then + Dec(VHeight, FScrollbarWidth); + + FHScrollBar.Top := Height -FHScrollBar.Height - 2; + FHScrollBar.Left := 2; + FHScrollBar.Width := HWidth; + + FVScrollBar.Top := 2; + FVScrollBar.Left := Width - FVScrollBar.Width - 2; + FVScrollBar.Height := VHeight; + + FVScrollBar.UpdateWindowPosition; + FHScrollBar.UpdateWindowPosition; +end; + + +// Main procedure: reads through the whole text currently stored +// and breaks up into lines - each represented as a TLayoutLine in +// the array FLines[ 0.. FNumLines ] +Procedure TRichTextView.Layout; +Var + DrawWidth: longint; +begin +ProfileEvent('DEBUG: TRichTextView.Layout >>>>'); + FLayoutRequired := true; + + if InDesigner then + exit; + if WinHandle = 0 then + exit; +ProfileEvent('DEBUG: TRichTextView.Layout 1 of 6'); + FSelectionEnd := -1; + FSelectionStart := -1; + RemoveCursor; + +ProfileEvent('DEBUG: TRichTextView.Layout 2'); + DrawWidth := GetTextAreaRect.Width; + + try + if Assigned(FLayout) then + begin +ProfileEvent('DEBUG: TRichTextView.Layout 3'); + FLayout.Free; + FLayout := nil; + end; + except + // this is only every a issue under 64bit. FLayout can suddenly not be referenced anymore + on E: Exception do + ProfileEvent('ERROR: Failed to free FLayout. Error Msg: ' + E.Message); +// raise Exception.Create('Failed to free FLayout. Error msg: ' + E.Message); + end; + +ProfileEvent('DEBUG: TRichTextView.Layout 4'); + FLayout := TRichTextLayout.Create( FText, + FImages, + FRichTextSettings, + FFontManager, + DrawWidth-(FScrollbarWidth{*6}) ); + +ProfileEvent('DEBUG: TRichTextView.Layout 5'); + + SetupScrollBars; +ProfileEvent('DEBUG: TRichTextView.Layout 6'); + RefreshCursorPosition; + + FLayoutRequired := false; +ProfileEvent('DEBUG: TRichTextView.Layout <<<<'); +End; + +procedure TRichTextView.GetFirstVisibleLine( Var LineIndex: longint; + Var Offset: longint ); +begin + FLayout.GetLineFromPosition( FYScroll, + LineIndex, + Offset ); +end; + +procedure TRichTextView.GetBottomLine( Var LineIndex: longint; + Var PixelsDisplayed: longint ); +begin + FLayout.GetLineFromPosition( FYScroll + GetTextAreaHeight, + LineIndex, + PixelsDisplayed ); +end; + +function TRichTextView.FindPoint( XToFind: longint; + YToFind: longint; + Var LineIndex: longint; + Var Offset: longint; + Var Link: string ): TTextPosition; +var + TextHeight: longint; +begin + LineIndex := 0; + Offset := 0; + Link := ''; + + TextHeight := GetTextAreaHeight; + +// YToFind := Height - YToFind; + + //if FBorderStyle = bsSingle then + //begin + // dec( YToFind, 2 ); + // dec( XToFind, 2 ); + //end; + + if YToFind < 3 then + begin + // above the top + Result := tpAboveTextArea; + exit; + end; + + if YToFind >= TextHeight then + begin + // below the bottom + Result := tpBelowTextArea; + LineIndex := FLayout.FNumLines; + Offset := FLayout.FLines^[ FLayout.FNumLines - 1 ].Length - 1; + exit; + end; + + Result := FLayout.FindPoint( XToFind + FXScroll, // horizontal scrolls into positive + YToFind + (-FYScroll), // vertical scrolls into negative + LineIndex, + Offset, + Link ); +end; + +Procedure TRichTextView.DrawBorder; +var + Rect: TfpgRect; +begin + Canvas.GetWinRect(Rect); + Canvas.DrawControlFrame(Rect); +end; + +Procedure TRichTextView.Draw( StartLine, EndLine: longint ); +Var + DrawRect: TfpgRect; + X: longint; + Y: longint; + SelectionStartP: PChar; + SelectionEndP: PChar; + Temp: longint; +begin +ProfileEvent('DEBUG: TRichTextView.Draw >>>'); + DrawRect := GetTextAreaRect; + if StartLine > EndLine then + begin + // swap + Temp := EndLine; + EndLine := StartLine; + StartLine := Temp; + end; + // calculate selection pointers + if SelectionSet then + begin + SelectionStartP := FText + FSelectionStart; + SelectionEndP := FText + FSelectionEnd; + end + else + begin + SelectionStartP := nil; + SelectionEndP := nil; + end; + // calculate destination point + Y := DrawRect.Top + FYScroll; + X := DrawRect.Left - FXScroll; + DrawRichTextLayout( FFontManager, + FLayout, + SelectionStartP, + SelectionEndP, + StartLine, + EndLine, + Point(X, Y) + ); +ProfileEvent('DEBUG: TRichTextView.Draw <<<'); +End; + +// This gets the area of the control that we can draw on +// (not taken up by vertical scroll bar) +Function TRichTextView.GetDrawRect: TfpgRect; +begin + Result := GetClientRect; + if InDesigner then + exit; + + if FNeedHScroll then + dec( Result.Height, FScrollbarWidth ); + + if FNeedVScroll then + dec( Result.Width, FScrollbarWidth ); +end; + +// Gets the area that we are drawing text on, which is the +// draw rect minus borders +Function TRichTextView.GetTextAreaRect: TfpgRect; +begin + Result := GetDrawRect; + InflateRect(Result, -2, -2); +end; + +function TRichTextView.GetTextAreaHeight: longint; +begin + Result := GetTextAreaRect.Height; +end; + +function TRichTextView.GetTextAreaWidth: longint; +begin + Result := GetTextAreaRect.Width; +end; + +Procedure TRichTextView.SetupScrollbars; +var + AvailableWidth: longint; + MaxDisplayWidth: longint; + AvailableHeight: longint; +begin + // Reset to defaults + FNeedVScroll := false; + FNeedHScroll := false; + + // Calculate used and available width + AvailableWidth := GetTextAreaWidth; + MaxDisplayWidth := FLayout.Width + 200; { TODO : We need to fix FLayout.Width first before we remove + 200 } + + // Horizontal scroll setup + if MaxDisplayWidth > AvailableWidth then + FNeedHScroll := true; + +// FHScrollbar.SliderSize := AvailableWidth div 2; + FHScrollbar.Min := 0; + if FNeedHScroll then + { TODO : As soon as we fix FLayout.Width, then we can enable the extra code below } + FHScrollbar.Max := (MaxDisplayWidth) // - AvailableWidth) + FScrollbarWidth + else + begin + FHScrollBar.Position := 0; + FHScrollbar.Max := 0; + end; + + // Calculate available height. + // Note: this depends on whether a h scroll bar is needed. + AvailableHeight := GetTextAreaHeight; // this includes borders and scrollbars and small margin + if FLayout.Height > AvailableHeight then + FNeedVScroll := true; + FVScrollBar.Min := 0; + if FNeedVScroll then + FVScrollBar.Max := (FLayout.Height - AvailableHeight) + FScrollbarWidth + else + begin + FVScrollBar.Position := 0; + FVScrollBar.Max := 0; + end; + + FHScrollBar.ScrollStep := 25; // pixels + FHScrollBar.PageSize := AvailableWidth - FHScrollbar.ScrollStep; // slightly less than width + FHScrollBar.SliderSize := AvailableWidth / MaxDisplayWidth; + FVScrollBar.ScrollStep := 25; // not used (line up/down calculated explicitly) + FVScrollBar.PageSize := AvailableHeight - FVScrollBar.ScrollStep; + FVScrollBar.SliderSize := AvailableHeight / FLayout.Height; + + // Physical horizontal scroll setup + FHScrollbar.Visible := FNeedHScroll; + FHScrollbar.Enabled := FNeedHScroll; + FHScrollbar.Left := 2; + FHScrollbar.Top := Height - 2 - FScrollBarWidth; + FHScrollbar.Height := FScrollbarWidth; + if FNeedVScroll then + FHScrollbar.Width := Width - 4 - FScrollBarWidth + else + FHScrollbar.Width := Width - 4; + + // Physical vertical scroll setup + FVScrollbar.Visible := FNeedVScroll; + FVScrollbar.Enabled := FNeedVScroll; + FVScrollbar.Left := Width - 2 - FScrollbarWidth; + FVScrollbar.Top := 2; + FVScrollbar.Width := FScrollbarWidth; + if FNeedHScroll then + FVScrollbar.Height := Height - 4 - FScrollbarWidth + else + FVScrollbar.Height := Height - 4; + + // Initialise scroll + FYScroll := FVScrollBar.Position; + FLastYScroll := FYScroll; + FXScroll := FHScrollBar.Position; + FLastXScroll := FXScroll; + + FVScrollbar.OnScroll := @FVScrollbarScroll; + FHScrollbar.OnScroll := @FHScrollbarScroll; +End; + +Procedure TRichTextView.SetupCursor; +var + Line: TLayoutLine; + X, Y: longint; + TextRect: TfpgRect; + DrawHeight: longint; + DrawWidth: longint; + CursorHeight: longint; + TextHeight: longint; + LineHeight: longint; + Descender: longint; + MaxDescender: longint; +begin + RemoveCursor; + if FSelectionStart = -1 then + exit; + + TextRect := GetTextAreaRect; + DrawHeight := TextRect.Top - TextRect.Bottom; + DrawWidth := TextRect.Right - TextRect.Left; + + Line := FLayout.FLines^[ CursorRow ]; + LineHeight := Line.Height; + + Y := DrawHeight + - ( FLayout.GetLinePosition( CursorRow ) + - FVScrollbar.Position ); + // Now Y is the top of the line + if Y < 0 then + // off bottom + exit; + if ( Y - LineHeight ) > DrawHeight then + // off top + exit; + + FLayout.GetXFromOffset( FCursorOffset, CursorRow, X ); + + X := X - FHScrollBar.Position; + + if X < 0 then + // offscreen to left + exit; + + if X > DrawWidth then + // offscreen to right + exit; + + TextHeight := FFontManager.CharHeight; + Descender := FFontManager.CharDescender; + MaxDescender := FLayout.FLines^[ CursorRow ].MaxDescender; + CursorHeight := TextHeight; + + dec( Y, LineHeight - 1 ); + // now Y is the BOTTOM of the line + + // move Y up to the bottom of the cursor; + // since the current text may be smaller than the highest in the line + inc( Y, MaxDescender - Descender ); + + if Y < 0 then + begin + // bottom of line will be below bottom of display. + dec( CursorHeight, 1 - Y ); + Y := 0; + end; + + if Y + CursorHeight - 1 > DrawHeight then + begin + // top of cursor will be above top of display + CursorHeight := DrawHeight - Y + 1; + end; + +// fpgCaret.SetCaret(Canvas, TextRect.Left + X, TextRect.Bottom + Y, 2, CursorHeight); +end; + +procedure TRichTextView.RemoveCursor; +begin +// fpgCaret.UnSetCaret(Canvas); +end; + +Function TRichTextView.GetLineDownPosition: longint; +var + LastLine: longint; + PixelsDisplayed: longint; +begin + GetBottomLine( LastLine, + PixelsDisplayed ); + + Result := GetLineDownPositionFrom( LastLine, PixelsDisplayed ); +end; + +Function TRichTextView.GetLineDownPositionFrom( LastLine: longint; + PixelsDisplayed: longint ): longint; +var + LineHeight: longint; +begin + if LastLine = -1 then + exit; + + LineHeight := FLayout.FLines^[ LastLine ].Height; + + if LastLine = FLayout.FNumLines - 1 then + begin + // last line + if PixelsDisplayed >= LineHeight then + begin + // and it's fully displayed, so scroll to show margin + Result := FLayout.Height - GetTextAreaHeight; + exit; + end; + end; + + // Scroll to make last line fully visible... + Result := FVScrollBar.Position + + LineHeight + - PixelsDisplayed; + if PixelsDisplayed > LineHeight div 2 then + // more than half line already displayed so + if LastLine < FLayout.FNumLines - 1 then + // AND to make next line fully visible + inc( Result, FLayout.FLines^[ LastLine + 1 ].Height ); +end; + +Function TRichTextView.GetSmallDownScrollPosition: longint; +var + LastLine: longint; + PixelsDisplayed: longint; + LineTextHeight: longint; + Diff: longint; +begin + GetBottomLine( LastLine, + PixelsDisplayed ); + + Result := GetLineDownPositionFrom( LastLine, PixelsDisplayed ); + + // Now limit the scrolling to max text height for the bottom line + Diff := Result - FVScrollBar.Position; + + LineTextHeight := FLayout.FLines^[ LastLine ].MaxTextHeight; + if Diff > LineTextHeight then + Diff := LineTextHeight; + Result := FVScrollBar.Position + Diff; +end; + +Function TRichTextView.GetSmallUpScrollPosition: longint; +var + FirstVisibleLine: longint; + Offset: longint; + LineTextHeight: longint; + Diff: longint; +begin + GetFirstVisibleLine( FirstVisibleLine, + Offset ); + Result := GetLineUpPositionFrom( FirstVisibleLine, + Offset ); + // Now limit the scrolling to max text height for the bottom line + Diff := FVScrollBar.Position - Result; + + LineTextHeight := FLayout.FLines^[ FirstVisibleLine ].MaxTextHeight; + if Diff > LineTextHeight then + Diff := LineTextHeight; + Result := FVScrollBar.Position - Diff; +end; + +Function TRichTextView.GetSmallRightScrollPosition: longint; +begin + Result := FHScrollBar.Position + FHScrollBar.ScrollStep; + if Result > FHScrollBar.Max then + Result := FHScrollBar.Max; +end; + +Function TRichTextView.GetSmallLeftScrollPosition: longint; +begin + Result := FHScrollBar.Position - FHScrollBar.ScrollStep; + if Result < 0 then + Result := 0; +end; + +Function TRichTextView.GetLineUpPosition: longint; +var + FirstVisibleLine: longint; + Offset: longint; +begin + GetFirstVisibleLine( FirstVisibleLine, Offset ); + Result := GetLineUpPositionFrom( FirstVisibleLine, Offset ); +end; + +Function TRichTextView.GetLineUpPositionFrom( FirstVisibleLine: longint; + Offset: longint ): longint; +begin + // we should never have scrolled all lines off the top!! + assert( FirstVisibleLine <> -1 ); + + if FirstVisibleLine = 0 then + begin + // first line + if Offset = 0 then + begin + // and it's already fully visible, so scroll to show margin + Result := 0; + exit; + end; + end; + + // scroll so that top line is fully visible... + Result := FVScrollBar.Position + - Offset; + + if Offset < (FLayout.FLines^[ FirstVisibleLine ].Height div 2) then + // more than half the line was already displayed so + if FirstVisibleLine > 0 then + // AND to make next line up visible + dec( Result, FLayout.FLines^[ FirstVisibleLine - 1 ].Height ); + +end; + +Function Sign( arg: longint ): longint; +begin + if arg>0 then + Result := 1 + else if arg<0 then + Result := -1 + else + Result := 0; +end; + +Function FSign( arg: double ): double; +begin + if arg>0 then + Result := 1 + else if arg<0 then + Result := -1 + else + Result := 0; +end; + +Procedure ExactDelay( MS: Cardinal ); +begin + Sleep(MS); +end; + +(* +Procedure TRichTextView.Scroll( Sender: TScrollbar; + ScrollCode: TScrollCode; + Var ScrollPos: Longint ); + +begin + case ScrollCode of +// scVertEndScroll, +// scVertPosition, + scPageUp, + scPageDown, + scVertTrack: + DoVerticalScroll( ScrollPos ); + + // Line up and down positions are calculated for each case + scLineDown: + begin + ScrollPos := GetSmallDownScrollPosition; + DoVerticalScroll( ScrollPos ); + end; + + scLineUp: + begin + ScrollPos := GetSmallUpScrollPosition; + DoVerticalScroll( ScrollPos ); + end; + + scHorzPosition, + scPageRight, + scPageLeft, + scHorzTrack, + scColumnRight, + scColumnLeft: + begin + DoHorizontalScroll( ScrollPos ); + end; + end; +end; +*) + +Procedure TRichTextView.DoVerticalScroll( NewY: longint ); +//var +// ScrollDistance: longint; +begin + FYScroll := 0 - NewY; + + if not Visible then + begin + FLastYScroll := FYScroll; + exit; + end; + +// ScrollDistance := FYScroll - FLastYScroll; + + { TODO -ograeme -cscrolling : Implement vertical scrolling here } + //ScrollControlRect( Self, + // GetTextAreaRect, + // 0, + // ScrollDistance, + // Color, + // FSmoothScroll ); + + FLastYScroll := FYScroll; + RePaint; + SetupCursor; +end; + +Procedure TRichTextView.DoHorizontalScroll( NewX: longint ); +var + ScrollDistance: longint; +begin + FXScroll := NewX; + + if not Visible then + begin + FLastXScroll := FXScroll; + exit; + end; + +// ScrollDistance := FXScroll - FLastXScroll; + + { TODO -ograemeg -cscrolling : Implement horizontal scrolling } + //ScrollControlRect( Self, + // GetTextAreaRect, + // - ScrollDistance, + // 0, + // Color, + // FSmoothScroll ); + + FLastXScroll := FXScroll; + RePaint; + SetupCursor; +end; + +Procedure TRichTextView.SetVerticalPosition( NewY: longint ); +begin + FVScrollbar.Position := NewY; + FVScrollbar.RepaintSlider; + DoVerticalScroll( FVScrollbar.Position ); +end; + +Procedure TRichTextView.SetHorizontalPosition( NewX: longint ); +begin + FHScrollbar.Position := NewX; + FHScrollbar.RepaintSlider; + DoHorizontalScroll( FHScrollbar.Position ); +end; + +Procedure TRichTextView.AddParagraph( Text: PChar ); +begin + if GetTextEnd > 0 then + begin + AddText( #13, True ); + AddText( #10, True ); + end; + AddText( Text ); +end; + +Procedure TRichTextView.AddSelectedParagraph( Text: PChar ); +begin + if GetTextEnd > 0 then + begin + AddText( #13, True); + AddText( #10, True); + end; + SelectionStart := GetTextEnd; + AddText( Text ); + SelectionEnd := GetTextEnd; + MakeCharVisible( SelectionStart ); +end; + +// ADelay = True means that we hold off on redoing the Layout and Painting. +Procedure TRichTextView.AddText( Text: PChar; ADelay: boolean ); +var + s: string; +begin + s := Text; + // Warning: Hack Alert! replace some strange Bell character found in some INF files +// s := SubstituteChar(s, Chr($07), Chr($20) ); + s := StringReplace(s, Chr($07), '•', [rfReplaceAll, rfIgnoreCase]); + +//// Hack Alert #2: replace strange table chars with something we can actually see +// s := SubstituteChar(s, Chr(218), Char('+') ); // top-left corner +// s := SubstituteChar(s, Chr(196), Char('-') ); // horz row deviders +// s := SubstituteChar(s, Chr(194), Char('-') ); // centre top T connection +// s := SubstituteChar(s, Chr(191), Char('+') ); // top-right corner +// s := SubstituteChar(s, Chr(192), Char('+') ); // bot-left corner +// s := SubstituteChar(s, Chr(193), Char('-') ); // centre bottom inverted T +// s := SubstituteChar(s, Chr(197), Char('+') ); +// s := SubstituteChar(s, Chr(179), Char('|') ); // +// s := SubstituteChar(s, Chr(195), Char('|') ); +// s := SubstituteChar(s, Chr(180), Char('|') ); +// s := SubstituteChar(s, Chr(217), Char('+') ); // bot-right corner + + + + + AddAndResize( FText, PChar(s) ); + if not ADelay then + begin + Layout; + RePaint; + end; +end; + +// Insert at current point +Procedure TRichTextView.InsertText( CharIndexToInsertAt: longword; + TextToInsert: PChar ); +var + NewText: PChar; +begin + NewText := StrAlloc( StrLen( FText ) + StrLen( TextToInsert ) + 1 ); + StrLCopy( NewText, FText, CharIndexToInsertAt ); + StrCat( NewText, TextToInsert ); + StrCat( NewText, FText + CharIndexToInsertAt ); + + Clear; + AddText( NewText ); + StrDispose( NewText ); +end; + +Procedure TRichTextView.Clear(const ADestroying: boolean = False); +begin + ClearSelection; + FText[ 0 ] := #0; + FTopCharIndex := 0; + if not ADestroying then + begin + Layout; + if FLayout.FNumLines > 1 then + raise Exception.Create('FLayout.FNumLines should have been 0 but it was ' + IntToStr(FLayout.FNumLines)); + RePaint; + end; +end; + +//procedure TRichTextView.SetBorder( BorderStyle: TBorderStyle ); +//begin +// FBorderStyle := BorderStyle; +// Refresh; +//end; + +Procedure TRichTextView.SetImages( AImages: TfpgImageList ); +begin + if AImages = FImages then + exit; // no change + + { TODO -oGraeme : TfpgImageList is not a TComponent descendant. Maybe it should be? } + //if FImages <> nil then + // // Tell the old imagelist not to inform us any more + // FImages.Notification( Self, opRemove ); + + FImages := AImages; + //if FImages <> nil then + // // request notification when other is freed + // FImages.FreeNotification( Self ); + + if GetTextEnd = 0 then + // no text - can't be any image references - no need to layout + exit; + + Layout; + RePaint; +end; + +Procedure TRichTextView.OnRichTextSettingsChanged( Sender: TObject ); +begin + if not InDesigner then + begin + Layout; + RePaint; + end; +end; + +Procedure TRichTextView.Notification( AComponent: TComponent; + Operation: TOperation ); +begin + inherited Notification( AComponent, Operation ); + { TODO -oGraeme : TfpgImageList is not a TComponent descendant. Maybe it should be? } + //if AComponent = FImages then + // if Operation = opRemove then + // FImages := nil; +end; + +(* +Procedure TRichTextView.MouseDown( Button: TMouseButton; + ShiftState: TShiftState; + X, Y: Longint ); +var + Line: longint; + Offset: longint; + Link: string; + Position: TTextPosition; + Shift: boolean; +begin + Focus; + + inherited MouseDown( Button, ShiftState, X, Y ); + + if Button <> mbLeft then + begin + if Button = mbRight then + begin + if MouseCapture then + begin + // this is a shortcut - left mouse drag to select, right mouse to copy + CopySelectionToClipboard; + end; + end; + exit; + end; + +// if FText[ 0 ] = #0 then +// exit; + + Position := FindPoint( X, Y, Line, Offset, Link ); + FClickedLink := Link; + + if Position in [ tpAboveTextArea, + tpBelowTextArea ] then + // not on the control (this probably won't happen) + exit; + + // if shift is pressed then keep the same selection start. + + Shift := ssShift in ShiftState; + RemoveCursor; + + if not Shift then + ClearSelection; + + SetCursorPosition( Offset, Line, Shift ); + MouseCapture := true; + +end; +*) + +(* +Procedure TRichTextView.MouseUp( Button: TMouseButton; + ShiftState: TShiftState; + X, Y: Longint ); +begin + if Button = mbRight then + if MouseCapture then + // don't popup menu for shortcut - left mouse drag to select, right mouse to copy + exit; + + inherited MouseUp( Button, ShiftState, X, Y ); + + if Button <> mbLeft then + exit; + + if not MouseCapture then + // not a mouse up from a link click + exit; + + if FScrollTimer.Running then + FScrollTimer.Stop; + + MouseCapture := false; + + SetupCursor; + + if FClickedLink <> '' then + if Assigned( FOnClickLink ) then + FOnClickLink( Self, FClickedLink ); + +end; +*) + +(* +Procedure TRichTextView.MouseDblClick( Button: TMouseButton; + ShiftState: TShiftState; + X, Y: Longint ); +var + Row: longint; + Offset: longint; + Link: string; + Position: TTextPosition; + P: PChar; + pWordStart: PChar; + WordLength: longint; +begin + inherited MouseDblClick( Button, ShiftState, X, Y ); + + if Button <> mbLeft then + exit; + +// if FText[ 0 ] = #0 then +// exit; + + Position := FindPoint( X, Y, Row, Offset, Link ); + + if Position in [ tpAboveTextArea, + tpBelowTextArea ] then + // not on the control (this probably won't happen) + exit; + + Assert( Row >= 0 ); + Assert( Row < FLayout.FNumLines ); + + P := FLayout.FLines[ Row ].Text + Offset; + + RemoveCursor; + + if not RichTextWordAt( FText, + P, + pWordStart, + WordLength ) then + begin + // not in a word + SetCursorPosition( Offset, Row, false ); + SetupCursor; + exit; + end; + + SetSelectionStartInternal( FLayout.GetCharIndex( pWordStart ) ); + SetSelectionEndInternal( FLayout.GetCharIndex( pWordStart ) + + WordLength ); + RefreshCursorPosition; + SetupCursor; +end; +*) + +(* +Procedure TRichTextView.MouseMove( ShiftState: TShiftState; + X, Y: Longint ); +var + Line: longint; + Offset: longint; + Link: string; + Position: TTextPosition; +begin + inherited MouseMove( ShiftState, X, Y ); + + Position := FindPoint( X, Y, Line, Offset, Link ); + + if not MouseCapture then + begin + if Link <> FLastLinkOver then + begin + if Link <> '' then + begin + if Assigned( FOnOverLink ) then + FOnOverLink( Self, Link ) + end + else + begin + if Assigned( FOnNotOverLink ) then + FOnNotOverLink( Self, FLastLinkOver ); + end; + + FLastLinkOver := Link; + end; + + if Link <> '' then + Cursor := FLinkCursor + else + Cursor := crIBeam; + exit; + end; + + // We are holding mouse down and dragging to set a selection: + + if Position in [ tpAboveTextArea, + tpBelowTextArea ] then + begin + // above top or below bottom of control + FOldMousePoint := Point( X, Y ); + + if Position = tpAboveTextArea then + FScrollingDirection := sdUp + else + FScrollingDirection := sdDown; + + if not FScrollTimer.Running then + begin + FScrollTimer.Start; + OnScrollTimer( self ); + end; + exit; + end; + + // Normal selection, cursor within text rect + if FScrollTimer.Running then + FScrollTimer.Stop; + + SetCursorPosition( Offset, + Line, + true ); + + if SelectionSet then + begin + FClickedLink := ''; // if they move while on a link we don't want to follow it. + Cursor := crIBeam; + end; + +end; +*) + +procedure TRichTextView.OnScrollTimer( Sender: TObject ); +var + Line, Offset: longint; + MousePoint: TPoint; + TextRect: TRect; +begin + exit; + //MousePoint := Screen.MousePos; + //MousePoint := ScreenToClient( MousePoint ); + //TextRect := GetTextAreaRect; + // + //if FScrollingDirection = sdDown then + // // scrolling down + // if FVScrollbar.Position = FVScrollbar.Max then + // exit + // else + // begin + // if ( TextRect.Bottom - MousePoint.Y ) < 20 then + // DownLine + // else + // DownPage; + // + // GetBottomLine( Line, Offset ); + // SetSelectionEndInternal( FLayout.GetCharIndex( FLayout.Flines[ Line ].Text ) + // + FLayout.FLines[ Line ].Length ); + // end + //else + // // scrolling up + // if FVScrollbar.Position = FVScrollbar.Min then + // exit + // else + // begin + // if ( MousePoint.Y - TextRect.Top ) < 20 then + // UpLine + // else + // UpPage; + // GetFirstVisibleLine( Line, Offset ); + // SetSelectionEndInternal( FLayout.GetCharIndex( FLayout.FLines[ Line ].Text ) ); + // end; + +end; + +Procedure TRichTextView.UpLine; +begin + SetVerticalPosition( GetLineUpPosition ); +end; + +Procedure TRichTextView.DownLine; +begin + SetVerticalPosition( GetLineDownPosition ); +end; + +Procedure TRichTextView.UpPage; +begin + SetVerticalPosition( FVScrollbar.Position + FVScrollbar.PageSize ); +end; + +Procedure TRichTextView.DownPage; +begin + SetVerticalPosition( FVScrollbar.Position - FVScrollbar.PageSize ); +end; + +Procedure TRichTextView.SmallScrollUp; +begin + SetVerticalPosition( GetSmallUpScrollPosition ); +end; + +Procedure TRichTextView.SmallScrollDown; +begin + SetVerticalPosition( GetSmallDownScrollPosition ); +end; + +Procedure TRichTextView.SmallScrollRight; +begin + SetHorizontalPosition( GetSmallRightScrollPosition ); +end; + +Procedure TRichTextView.SmallScrollLeft; +begin + SetHorizontalPosition( GetSmallLeftScrollPosition ); +end; + +function TRichTextView.GetCursorIndex: longint; +begin + if FCursorRow = -1 then + begin + Result := -1; + exit; + end; + Result := FLayout.GetCharIndex( FLayout.FLines^[ FCursorRow ].Text ) + FCursorOffset; +end; + +procedure TRichTextView.RefreshCursorPosition; +var + Index: longint; + Row: longint; +begin + if SelectionSet then + begin + Index := FSelectionEnd + end + else + begin + Index := FSelectionStart; + end; + + if Index = -1 then + begin + FCursorRow := -1; + FCursorOffset := 0; + RemoveCursor; + exit; + end; + + Row := FLayout.GetLineFromCharIndex( Index ); + SetCursorPosition( Index - FLayout.GetCharIndex( FLayout.FLines^[ Row ].Text ), + Row, + true ); +end; + +procedure TRichTextView.SetCursorIndex( Index: longint; + PreserveSelection: boolean ); +var + Row: longint; +begin + Row := FLayout.GetLineFromCharIndex( Index ); + SetCursorPosition( Index - FLayout.GetCharIndex( FLayout.FLines^[ Row ].Text ), + Row, + PreserveSelection ); + SetupCursor; +end; + +procedure TRichTextView.SetCursorPosition( Offset: longint; + Row: longint; + PreserveSelection: boolean ); +var + Index: longint; +begin + RemoveCursor; + FCursorOffset := Offset; + FCursorRow := Row; + Index := FLayout.GetCharIndex( FLayout.FLines^[ Row ].Text ) + Offset; + if PreserveSelection then + begin + SetSelectionEndInternal( Index ) + end + else + begin + SetSelectionEndInternal( -1 ); + SetSelectionStartInternal( Index ); + end; + MakeRowAndColumnVisible( FCursorRow, Offset ); +end; + +Procedure TRichTextView.CursorRight( PreserveSelection: boolean ); +Var + P: PChar; + NextP: PChar; + Element: TTextElement; + NewOffset: longint; + Line: TLayoutLine; +begin + P := FText + CursorIndex; + + Element := ExtractNextTextElement( P, NextP ); + P := NextP; + while Element.ElementType = teStyle do + begin + Element := ExtractNextTextElement( P, NextP ); + P := NextP; + end; + +// if Element.ElementType = teTextEnd then +// exit; + +// SetCursorIndex( GetCharIndex( P ), PreserveSelection ); + Line := FLayout.FLines^[ CursorRow ]; + NewOffset := PCharDiff( P, Line.Text ); + if NewOffset < Line.Length then + begin + SetCursorPosition( NewOffset, FCursorRow, PreserveSelection ) + end + else if ( NewOffset = Line.Length ) + and not Line.Wrapped then + begin + SetCursorPosition( NewOffset, FCursorRow, PreserveSelection ) + end + else + begin + if FCursorRow >= FLayout.FNumLines - 1 then + exit; + SetCursorPosition( 0, FCursorRow + 1, PreserveSelection ); + end; + SetupCursor; +end; + +Procedure TRichTextView.CursorLeft( PreserveSelection: boolean ); +Var + P: PChar; + NextP: PChar; + Element: TTextElement; + Line: TLayoutLine; + NewOffset: longint; +begin + P := FText + CursorIndex; + + Element := ExtractPreviousTextElement( FText, P, NextP ); + P := NextP; + while Element.ElementType = teStyle do + begin + Element := ExtractPreviousTextElement( FText, P, NextP ); + P := NextP; + end; + +// if Element.ElementType = teTextEnd then +// exit; + Line := FLayout.FLines^[ CursorRow ]; + NewOffset := PCharDiff( P, Line.Text ); + if NewOffset >= 0 then + begin + SetCursorPosition( NewOffset, FCursorRow, PreserveSelection ) + end + else + begin + if FCursorRow <= 0 then + exit; + Line := FLayout.FLines^[ CursorRow - 1 ]; + if Line.Wrapped then + SetCursorPosition( Line.Length - 1, FCursorRow - 1, PreserveSelection ) + else + SetCursorPosition( Line.Length, FCursorRow - 1, PreserveSelection ) + end; + SetupCursor; + +end; + +Procedure TRichTextView.CursorWordLeft( PreserveSelection: boolean ); +Var + P: PChar; +begin + P := FText + CursorIndex; + + P := RichTextWordLeft( FText, P ); + + SetCursorIndex( FLayout.GetCharIndex( P ), + PreserveSelection ); +end; + +Procedure TRichTextView.CursorWordRight( PreserveSelection: boolean ); +Var + P: PChar; +begin + P := FText + CursorIndex; + + P := RichTextWordRight( P ); + + SetCursorIndex( FLayout.GetCharIndex( P ), + PreserveSelection ); +end; + +Procedure TRichTextView.CursorToLineStart( PreserveSelection: boolean ); +Var + Line: TLayoutLine; +begin + Line := FLayout.FLines^[ FCursorRow ]; + SetCursorPosition( 0, FCursorRow, PreserveSelection ); + SetupCursor; +end; + +Procedure TRichTextView.CursorToLineEnd( PreserveSelection: boolean ); +Var + Line: TLayoutLine; +begin + Line := FLayout.FLines^[ FCursorRow ]; + SetCursorPosition( Line.Length, FCursorRow, PreserveSelection ); + SetupCursor; +end; + +Procedure TRichTextView.CursorDown( PreserveSelection: boolean ); +var + X: longint; + Link: string; + Offset: longint; +begin + if CursorRow >= FLayout.FNumLines - 1 then + exit; + + FLayout.GetXFromOffset( FCursorOffset, FCursorRow, X ); + FLayout.GetOffsetFromX( X, + FCursorRow + 1, + Offset, + Link ); + + SetCursorPosition( Offset, FCursorRow + 1, PreserveSelection ); + SetupCursor; +end; + +Procedure TRichTextView.CursorUp( PreserveSelection: boolean ); +var + X: longint; + Link: string; + Offset: longint; +begin + if CursorRow <= 0 then + exit; + + FLayout.GetXFromOffset( FCursorOffset, + FCursorRow, + X ); + FLayout.GetOffsetFromX( X, + FCursorRow - 1, + Offset, + Link ); + + SetCursorPosition( Offset, FCursorRow - 1, PreserveSelection ); + SetupCursor; + +end; + +Procedure TRichTextView.CursorPageDown( PreserveSelection: boolean ); +var + X: longint; + Link: string; + Offset: longint; + Distance: longint; + NewRow: longint; +begin + NewRow := CursorRow; + Distance := 0; + while ( Distance < GetTextAreaHeight ) do + begin + if NewRow >= FLayout.FNumLines - 1 then + break; + + Distance := Distance + FLayout.FLines^[ NewRow ].Height; + inc( NewRow ); + end; + + FLayout.GetXFromOffset( FCursorOffset, FCursorRow, X ); + FLayout.GetOffsetFromX( X, NewRow, Offset, Link ); + SetCursorPosition( Offset, NewRow, PreserveSelection ); + SetupCursor; +end; + +Procedure TRichTextView.CursorPageUp( PreserveSelection: boolean ); +var + X: longint; + Link: string; + Offset: longint; + Distance: longint; + NewRow: longint; +begin + NewRow := CursorRow; + Distance := 0; + while ( Distance < GetTextAreaHeight ) do + begin + if NewRow <= 0 then + break; + dec( NewRow ); + Distance := Distance + FLayout.FLines^[ NewRow ].Height; + end; + + FLayout.GetXFromOffset( FCursorOffset, FCursorRow, X ); + FLayout.GetOffsetFromX( X, NewRow, Offset, Link ); + SetCursorPosition( Offset, NewRow, PreserveSelection ); + SetupCursor; +end; + +Function TRichTextView.GetSelectionAsString: string; // returns up to 255 chars obviously +var + Buffer: array[ 0..255 ] of char; + Length: longint; +begin + Length := CopySelectionToBuffer( Addr( Buffer ), 255 ); + + Result := StrNPas( Buffer, Length ); +end; + +Procedure TRichTextView.CopySelectionToClipboard; +var + SelLength: Longint; + Buffer: PChar; +begin + SelLength := SelectionLength; + if SelectionLength = 0 then + exit; + + Buffer := StrAlloc( SelLength + 1 ); + + CopySelectionToBuffer( Buffer, SelLength + 1 ); + + fpgClipboard.Text := Buffer; + + StrDispose( Buffer ); +end; + +function TRichTextView.CopySelectionToBuffer( Buffer: PChar; + BufferLength: longint ): longint; +var + P, EndP: PChar; +begin + Result := 0; + if ( FSelectionStart = -1 ) + or ( FSelectionEnd = -1 ) then + exit; + + if FSelectionStart < FSelectionEnd then + begin + P := FText + FSelectionStart; + EndP := FText + FSelectionEnd; + end + else + begin + P := FText + FSelectionEnd; + EndP := FText + FSelectionStart; + end; + + Result := CopyPlainTextToBuffer( P, + EndP, + Buffer, + BufferLength ); +end; + +function TRichTextView.CopyTextToBuffer( Buffer: PChar; + BufferLength: longint ): longint; +begin + Result := CopyPlainTextToBuffer( FText, + FText + strlen( FText ), + Buffer, + BufferLength ); +end; + +Function TRichTextView.SelectionLength: longint; +begin + Result := 0; + if ( FSelectionStart = -1 ) + or ( FSelectionEnd = -1 ) then + exit; + + Result := FSelectionEnd - FSelectionStart; + if Result < 0 then + Result := FSelectionStart - FSelectionEnd; +end; + +Function TRichTextView.SelectionSet: boolean; +begin + Result := ( FSelectionStart <> -1 ) + and ( FSelectionEnd <> - 1 ) + and ( FSelectionStart <> FSelectionEnd ); +end; + +Procedure TRichTextView.SelectAll; +begin + ClearSelection; + SelectionStart := FLayout.GetCharIndex( FText ); + SelectionEnd := FLayout.GetTextEnd; +end; + +(* +procedure TRichTextView.ScanEvent( Var KeyCode: TKeyCode; + RepeatCount: Byte ); +var + CursorVisible: boolean; + Shift: boolean; + Key: TKeyCode; +begin + CursorVisible := FSelectionStart <> -1; + + Case KeyCode of + kbTab: + begin + if HighlightNextLink then + begin + KeyCode := kbNull; + exit; + end; + end; + + kbShiftTab: + begin + if HighlightPreviousLink then + begin + KeyCode := kbNull; + exit; + end; + end; + + kbEnter: + begin + + end; + end; + + Shift := KeyCode and kb_Shift > 0 ; + Key := KeyCode and ( not kb_Shift ); + + // Keys which work the same regardless of whether + // cursor is present or not + case Key of + kbCtrlC, kbCtrlIns: + CopySelectionToClipboard; + kbCtrlA: + SelectAll; + + kbAltCUp: + SmallScrollUp; + kbAltCDown: + SmallScrollDown; + kbAltCLeft: + SmallScrollLeft; + kbAltCRight: + SmallScrollRight; + end; + + // Keys which change behaviour if cursor is present + if CursorVisible then + begin + case Key of + kbCUp: + CursorUp( Shift ); + kbCDown: + CursorDown( Shift ); + + // these next two are not exactly orthogonal or required, + // but better match other text editors. + kbCtrlCUp: + if Shift then + CursorUp( Shift ) + else + SmallScrollUp; + kbCtrlCDown: + if Shift then + CursorDown( Shift ) + else + SmallScrollDown; + + kbCRight: + CursorRight( Shift ); + kbCLeft: + CursorLeft( Shift ); + + kbCtrlCLeft: + CursorWordLeft( Shift ); + kbCtrlCRight: + CursorWordRight( Shift ); + + kbCtrlHome, kbCtrlPageUp: + SetCursorIndex( 0, Shift ); + kbCtrlEnd, kbCtrlPageDown: + SetCursorIndex( GetTextEnd, Shift ); + + kbPageUp: + CursorPageUp( Shift ); + kbPageDown: + CursorPageDown( Shift ); + + kbHome: + CursorToLineStart( Shift ); + kbEnd: + CursorToLineEnd( Shift ); + end + end + else // no cursor visible + begin + case Key of + kbCUp, kbCtrlCUp: + SmallScrollUp; + kbCDown, kbCtrlCDown: + SmallScrollDown; + + kbCLeft, kbCtrlCLeft: + SmallScrollLeft; + kbCRight, kbCtrlCRight: + SmallScrollRight; + + kbPageUp: + UpPage; + kbPageDown: + DownPage; + + kbHome, kbCtrlHome, kbCtrlPageUp: + GotoTop; + kbEnd, kbCtrlEnd, kbCtrlPageDown: + GotoBottom; + end; + end; + + inherited ScanEvent( KeyCode, RepeatCount ); + +end; +*) + +function TRichTextView.HighlightNextLink: boolean; +Var + P: PChar; + NextP: PChar; + T: TTextElement; + StartP: PChar; +begin + if CursorIndex = -1 then + P := FText // no cursor yet + else + P := FText + CursorIndex; + + result := false; + + // if we're sitting on a begin-link, skip it... + T := ExtractNextTextElement( P, NextP ); + if T.ElementType = teStyle then + if T.Tag.TagType = ttBeginLink then + P := NextP; + + while true do + begin + T := ExtractNextTextElement( P, NextP ); + if T.ElementType = teTextEnd then + // no link found + exit; + + if T.ElementType = teStyle then + if T.Tag.TagType = ttBeginLink then + break; + + p := NextP; + + end; + + StartP := P; + p := NextP; // skip begin link + + while true do + begin + T := ExtractNextTextElement( P, NextP ); + if T.ElementType = teTextEnd then + break; // no explicit link end... + + if T.ElementType = teStyle then + if T.Tag.TagType = ttEndLink then + break; + + p := NextP; + end; + + SetSelectionStart( FLayout.GetCharIndex( StartP ) ); + SetSelectionEnd( FLayout.GetCharIndex( NextP ) ); + + result := true; +end; + +function TRichTextView.HighlightPreviousLink: boolean; +Var + P: PChar; + PreviousP: PChar; + T: TTextElement; + EndP: PChar; +begin + result := false; + if CursorIndex = -1 then + exit; // no cursor yet + + P := FText + CursorIndex; + + // if we're sitting on an end-of-link, skip it... + T := ExtractPreviousTextElement( FText, P, PreviousP ); + if T.ElementType = teStyle then + if T.Tag.TagType = ttEndLink then + P := PreviousP; + + while true do + begin + T := ExtractPreviousTextElement( FText, P, PreviousP ); + if T.ElementType = teTextEnd then + // no link found + exit; + + if T.ElementType = teStyle then + if T.Tag.TagType = ttEndLink then + break; + + p := PreviousP; + + end; + + EndP := P; + p := PreviousP; // skip end link + + while true do + begin + T := ExtractPreviousTextElement( FText, P, PreviousP ); + if T.ElementType = teTextEnd then + break; // no explicit link end... + + if T.ElementType = teStyle then + if T.Tag.TagType = ttBeginLink then + break; + + p := PreviousP; + end; + + SetSelectionStart( FLayout.GetCharIndex( EndP ) ); + SetSelectionEnd( FLayout.GetCharIndex( PreviousP ) ); + + result := true; +end; + +procedure TRichTextView.GoToTop; +begin + SetVerticalPosition( 0 ); +end; + +procedure TRichTextView.GotoBottom; +begin + SetVerticalPosition( FVScrollBar.Max ); +end; + +Function TRichTextView.GetTopCharIndex: longint; +var + LineIndex: longint; + Y: longint; +begin + if not FVerticalPositionInitialised then + begin + Result := FTopCharIndex; + exit; + end; + GetFirstVisibleLine( LineIndex, + Y ); + if LineIndex >= 0 then + Result := FLayout.GetCharIndex( FLayout.FLines^[ LineIndex ].Text ) + else + Result := 0; +end; + +Function TRichTextView.GetTopCharIndexPosition( NewValue: longint ): longint; +var + Line: longint; + lHeight: longint; +begin + if NewValue > GetTextEnd then + begin + Result := FVScrollBar.Max; + exit; + end; + Line := FLayout.GetLineFromCharIndex( NewValue ); + if Line = 0 then + begin + Result := 0; // include top margin + exit; + end; + + if Line < 0 then + begin + Result := FVScrollBar.Position; + exit; + end; + lHeight := FLayout.GetLinePosition( Line ); + Result := lHeight; +end; + +Procedure TRichTextView.SetTopCharIndex( NewValue: longint ); +var + NewPosition: longint; +begin + if not FVerticalPositionInitialised then + begin + if ( NewValue >= 0 ) + and ( NewValue < GetTextEnd ) then + begin + FTopCharIndex := NewValue; + end; + exit; + end; + NewPosition := GetTopCharIndexPosition( NewValue ); + SetVerticalPosition( NewPosition ); +end; + +procedure TRichTextView.MakeCharVisible( CharIndex: longint ); +var + Line: longint; +begin + Line := FLayout.GetLineFromCharIndex( CharIndex ); + + MakeRowAndColumnVisible( Line, + FLayout.GetOffsetFromCharIndex( CharIndex, Line ) ); +end; + +procedure TRichTextView.MakeRowVisible( Row: longint ); +var + TopLine: longint; + BottomLine: longint; + Offset: longint; + NewPosition: longint; +begin + GetFirstVisibleLine( TopLine, Offset ); + GetBottomLine( BottomLine, Offset ); + + if ( Row > TopLine ) + and ( Row < BottomLine ) then + // already visible + exit; + + if ( Row = BottomLine ) + and ( Offset >= FLayout.FLines^[ BottomLine ].Height - 1 ) then + // bottom row already entirely visible + exit; + + if Row <= TopLine then + begin + // need to scroll up, desird row above top line + if Row = 0 then + NewPosition := 0 // include margins + else + NewPosition := FLayout.GetLinePosition( Row ); + + if NewPosition > FVScrollbar.Position then + // no need to scroll + exit; + SetVerticalPosition( NewPosition ); + end + else + begin + // need to scroll down, desired row below bottom line + if ( BottomLine <> -1 ) + and ( Row >= BottomLine ) then + SetVerticalPosition( FLayout.GetLinePosition( Row ) + + FLayout.FLines^[ Row ].Height + - GetTextAreaHeight ); + end; +end; + +procedure TRichTextView.MakeRowAndColumnVisible( Row: longint; + Column: longint ); +var + X: Longint; +begin + MakeRowVisible( Row ); + FLayout.GetXFromOffset( Column, Row, X ); + + if X > FXScroll + GetTextAreaWidth then + // off the right + SetHorizontalPosition( X - GetTextAreaWidth + 5 ) + else if X < FXScroll then + // off to left + SetHorizontalPosition( X ); + +end; + +function TRichTextView.LinkFromIndex( const CharIndexToFind: longint): string; +begin + Result := FLayout.LinkFromIndex( CharIndexToFind ); +end; + +function TRichTextView.FindString( Origin: TFindOrigin; + const AText: string; + var MatchIndex: longint; + var MatchLength: longint ): boolean; +var + P: PChar; + pMatch: pchar; +begin + if ( Origin = foFromCurrent ) + and ( FSelectionStart <> -1 ) then + begin + // start at current cursor position + P := FText + GetCursorIndex; + end + else + begin + P := FText; + end; + + Result := RichTextFindString( P, AText, pMatch, MatchLength ); + + if Result then + // found + MatchIndex := FLayout.GetCharIndex( pMatch ) + else + MatchIndex := -1; + +end; + +function TRichTextView.Find( Origin: TFindOrigin; + const AText: string ): boolean; +var + MatchIndex: longint; + MatchLength: longint; +begin + Result := FindString( Origin, + AText, + MatchIndex, + MatchLength ); + if Result then + begin + MakeCharVisible( MatchIndex ); + FSelectionStart := MatchIndex; + SelectionEnd := MatchIndex + MatchLength; + end; +end; + +function TRichTextView.GetClientRect: TfpgRect; +begin + // Standard border of 2px on all sides + Result.SetRect(0, 0, Width, Height); + InflateRect(Result, -2, -2); +end; + + +end. + diff --git a/docview/components/richtext/RichTextView.txt b/docview/components/richtext/RichTextView.txt new file mode 100644 index 00000000..df0ed03e --- /dev/null +++ b/docview/components/richtext/RichTextView.txt @@ -0,0 +1,60 @@ +TRichTextView component
+for fpGUI Toolkit
+
+Summary
+-------
+
+This component displays 'rich' text, with various fonts, colors,
+styles and alignment.
+
+The major features are:
+ Fast, accurate drawing of text + +Features to come...
+ Selection and copy
+ Built-in default popup menu
+
+
+Using the component
+-------------------
+
+Put a component on your form. Adjust the properties as you see fit.
+At runtime, load the text into the control using AddText, AddParagraph,
+and Clear.
+
+Formatting syntax
+
+This is a HTML-like set of tags. But note that tag pairs don't have to
+match up.
+
+ <b> </b> bold on, off
+ <u> </u> underline on, off
+ <i> </i> italic on, off
+ <h1> <h2> <h3> heading 1-3, set with Heading1Font etc
+ </h> normal text
+ <tt> </tt> fixed font
+ <red> etc colors
+ <left> left alignment (word wrap)
+ <unaligned> no right margin
+ <center> centered
+ <right> right alignment
+ <justify> full justification (not implemented)
+ <defaultalign> default alignment
+ <margin x> set left margin to x pixels
+ <link linktext> </link>
+ start, end link.
+ The OnClickLink and OnOverLink events are called with linktext
+ <image x> Display image x from associated TImageList
+
+
+Example
+
+RichText.AddParagraph( '<h1>This is a big heading</h>' );
+RichText.AddParagraph( 'Here is some <b>bold</b> text' );
+
+
+Problems/limitations
+--------------------
+Yes, there probably are some. :) + + diff --git a/docview/components/richtext/fpgui_richtext.lpk b/docview/components/richtext/fpgui_richtext.lpk new file mode 100644 index 00000000..4a39379e --- /dev/null +++ b/docview/components/richtext/fpgui_richtext.lpk @@ -0,0 +1,82 @@ +<?xml version="1.0"?> +<CONFIG> + <Package Version="3"> + <Name Value="fpgui_richtext"/> + <AddToProjectUsesSection Value="False"/> + <Author Value="Graeme Geldenhuys"/> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <OtherUnitFiles Value="../../src/"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <Style Value="1"/> + <SyntaxOptions> + <CStyleOperator Value="False"/> + <AllowLabel Value="False"/> + <CPPInline Value="False"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <TargetCPU Value="i386"/> + <TargetOS Value="Linux"/> + <Optimizations> + <OptimizationLevel Value="0"/> + </Optimizations> + </CodeGeneration> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Description Value="RichTextView component"/> + <License Value="LGPL2 with static linking exception."/> + <Version Minor="1"/> + <Files Count="7"> + <Item1> + <Filename Value="RichTextDocumentUnit.pas"/> + <UnitName Value="RichTextDocumentUnit"/> + </Item1> + <Item2> + <Filename Value="ACLStringUtility.pas"/> + <UnitName Value="ACLStringUtility"/> + </Item2> + <Item3> + <Filename Value="CanvasFontManager.pas"/> + <UnitName Value="CanvasFontManager"/> + </Item3> + <Item4> + <Filename Value="RichTextStyleUnit.pas"/> + <UnitName Value="RichTextStyleUnit"/> + </Item4> + <Item5> + <Filename Value="RichTextLayoutUnit.pas"/> + <UnitName Value="RichTextLayoutUnit"/> + </Item5> + <Item6> + <Filename Value="RichTextDisplayUnit.pas"/> + <UnitName Value="RichTextDisplayUnit"/> + </Item6> + <Item7> + <Filename Value="RichTextView.pas"/> + <UnitName Value="RichTextView"/> + </Item7> + </Files> + <RequiredPkgs Count="2"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + <Item2> + <PackageName Value="FCL"/> + <MinVersion Major="1" Valid="True"/> + </Item2> + </RequiredPkgs> + <UsageOptions> + <UnitPath Value="$(PkgOutDir)/"/> + </UsageOptions> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + </PublishOptions> + </Package> +</CONFIG> diff --git a/docview/components/richtext/fpgui_richtext.pas b/docview/components/richtext/fpgui_richtext.pas new file mode 100644 index 00000000..221e749c --- /dev/null +++ b/docview/components/richtext/fpgui_richtext.pas @@ -0,0 +1,15 @@ +{ This file was automatically created by Lazarus. do not edit! + This source is only used to compile and install the package. + } + +unit fpgui_richtext; + +interface + +uses + RichTextDocumentUnit, ACLStringUtility, CanvasFontManager, + RichTextStyleUnit, RichTextLayoutUnit, RichTextDisplayUnit, RichTextView; + +implementation + +end. diff --git a/docview/docs/IPFREF_v4.INF b/docview/docs/IPFREF_v4.INF Binary files differnew file mode 100644 index 00000000..015ad458 --- /dev/null +++ b/docview/docs/IPFREF_v4.INF diff --git a/docview/docs/ascii-ibm-extended-character-set.html b/docview/docs/ascii-ibm-extended-character-set.html new file mode 100644 index 00000000..b6b61ae7 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set.html @@ -0,0 +1,421 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head> + + <title>ASCII, IBM Extended ASCII Character Set.</title> + + <meta http-equiv="pics-label" content="(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline EN v2.0" l gen true for "http://www.web-wise-wizard.com/" r (nz 1 vz 1 lz 1 oz 1 cz 1))"> + <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1"> + <meta http-equiv="Reply-to" content="http://www.web-wise-wizard.com/site-goodies/contact-us.html"> + <meta http-equiv="Content-language" content="en"> + <meta http-equiv="Content-Style-Type" content="text/css"> + <meta http-equiv="Content-Script-Type" content="text/javascript"> + + + <link rel="stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-1.css" title="skin1"> + <link rel="alternate stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-2.css" title="skin2"> + <link rel="alternate stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-3.css" title="skin3"> + <link rel="alternate stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-4.css" title="skin4"> + <link rel="alternate stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-5.css" title="skin5"> + <link rel="alternate stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-theme-6.css" title="skin6"> + <link rel="stylesheet" type="text/css" href="ascii-ibm-extended-character-set_files/www-content.css"> + + + <script type="text/javascript"> + + <!-- HIDE FROM OLD BROWSERS + + window.onerror = catchError; + var docDomain = (typeof(document.domain)=="unknown") ? "" : document.domain; + var winCount = 0; + + function catchError(errMess,pageAddr,lineNum) { + + var nameVal = "line=" + escape(lineNum); + nameVal += "&error=" + escape(errMess); + nameVal += "&page=" + escape(pageAddr); + nameVal += "&appName=" + escape(navigator.appName); + nameVal += "&appVersion=" + escape(navigator.appVersion); + nameVal += "&userAgent=" + escape(navigator.userAgent); + nameVal += "&locPath=" + escape(location.pathname); + nameVal += "&docRef=" + escape(document.referrer); + + if (docDomain.length) { + var url = "http://" + docDomain + "/cgi-bin/record-scripting-error.cgi?" + nameVal; + self.location.href = url; + } else { + winCount ++; + winName = "error" + winCount; + nameVal = unescape(nameVal); + nameVal = nameVal.replace(/&/g,"<br>"); + + errorWin = window.open('',winName,'scrollbars=yes'); + errorWin.document.writeln(nameVal); + errorWin.document.close(); + } + + // RETURN FALSE TO INVOKE THE DEFAULT ERROR HANDLER AFTERWARDS + // RETURN TRUE TO BYPASS THE DEFAULT ERROR HANDLER AFTERWARDS + return (true); + } + + // END HIDING --> + + </script> + + + <script type="text/javascript" src="ascii-ibm-extended-character-set_files/script-bin.js"></script> + + + <script type="text/javascript"> + + <!-- HIDE FROM OLD BROWSERS + +//================================================================================= + + var wwwTitleArea = new Image(500,90); + wwwTitleArea.src = "../images/www-title-area.gif"; + var internetToolbox = new Image(498,12); + internetToolbox.src = "../images/internet-toolbox.gif"; + var pixClear = new Image(1,1); + pixClear.src = "../images/pixClear.gif"; + +//================================================================================= + + // PRELOAD TITLE IMAGE + var titleUrl = "dem/ascii-ibm/title.gif"; + var titlePic = new Image ( 81,37 ); + titlePic.src = titleUrl; + + + // PRELOAD 16 ASCII BLOCK IMAGES + var asciiName = new Array; + var asciiPath = "dem/ascii-ibm/"; + var asciiExt = ".gif"; + var asciiPics; + var numPics = 16; + + + asciiName = form_ascii_names ( numPics ); + asciiPics = preload_ascii_blocks ( asciiPath, asciiName, asciiExt, numPics ); + + + function form_ascii_names ( num_pics ) + { + var ascii_names = new Array; + + for ( var pic_num=0; pic_num<num_pics; pic_num++ ) + { + var pic_str = "00" + pic_num; + pic_str = pic_str.substring ( pic_str.length-2, pic_str.length ); + ascii_names[pic_num] = "ascii_" + pic_str; + } + + return ( ascii_names ); + } + + + function preload_ascii_blocks ( ascii_path, ascii_name, ascii_ext, num_pics ) + { + ascii_pics = new Array; + + for (var pic_num=0; pic_num<num_pics; pic_num++ ) + { + ascii_pics[pic_num] = new Image (81,288); + ascii_pics[pic_num].src = ascii_path + ascii_name[pic_num] + ascii_ext; + } + + return ( ascii_pics ); + } + +//================================================================================ + + function display_pics () + { + if ( pics_all_loaded () ) + { + setTimeout ( "document_commands ()", 600 ); + + return; + } + + setTimeout ( "display_pics ()", 500 ); + } + + + function pics_all_loaded () + { + var count = 0; + + if ( titlePic.complete ) + count++; + + for ( var pic_num = 0; pic_num < numPics; pic_num++ ) + if ( asciiPics[pic_num].complete ) + count ++; + + return ( ( count == ( numPics+1 ) ) ); + } + + + function document_commands () + { + for ( var title_num=0; title_num<4; title_num++ ) + eval ( "document.title_" + title_num + ".src = titlePic.src" ); + + for ( var pic_num=0; pic_num<numPics; pic_num++ ) + eval ( "document." + asciiName[pic_num] + ".src = asciiPics[" + pic_num + "].src" ); + } + +//================================================================================= + + function checkLocal(link) { + + var docDomain = ( typeof ( document.domain ) == "unknown" ) ? "" : document.domain; + + if (!docDomain.length) { + + if (link.href.match(/http:\/\/webmaster.web-wise-wizard.com/i)) { + re = /http:\/\/webmaster.web-wise-wizard.com/i; + link.href = link.href.replace(re,"file:///D:/htdocs2/web-wise-wizard-4-wm/public_html/"); + link.href = link.href + "index.html"; + } else if (link.href.indexOf(".") < 0) { + link.href = link.href + "index.html"; + } + } + + return(true); + } + +//================================================================================= + + function fullWindow(link) { + + if (typeof(_fullWindow) == "function") { + return(!_fullWindow(link.href)); + } else { + return(true); + } + } + +//================================================================================= + + // END HIDING --> + + </script> + + <link rel="shortcut icon" href="http://www.web-wise-wizard.com/favicon.ico"> + + <style type="text/css"> + <!-- + + .asciiOuter { + float:left; + margin-right:16px; + } + + .asciiTable { + width:211px; + background-color:#FFFFFF; + border:1px solid #0000CC; + padding-bottom:0px; + } + + .asciiTable th { + background-color:#0000CC; + color:#FFFFFF; + padding:0px; + padding-top:10px; + padding-bottom:12px; + } + + .asciiTable .asciiTitle { + width:81px; + padding-top:12px; + padding-left:10px; + padding-right:10px; + } + + .asciiTable .asciiMiddle { + text-align:center; + width:9px; + } + + .asciiTable .asciiCell { + width:81px; + padding-left:10px; + padding-right:10px; + } + + --> + </style> + +</head><body> + + + + + + + <!-- START OF MAIN CONTENT CONTAINER --> + <div id="mainContainer"> + + + <!-- START OF MAIN CONTENT AREA --> + <div id="mainContent"> + + + <!-- START OF PAGE TITLE AREA --> + + <div class="alignCenter"> + <h1 class="h1">ASCII/IBM Extended Character Set</h1> + </div> + + <!-- END OF PAGE TITLE AREA --> + + + <!-- START OF PAGE CONTENT AREA --> + + <p> </p> + + <div class="asciiOuter"><table class="asciiTable" border="0" cellpadding="0" cellspacing="0"> + + <tbody><tr> + <th colspan="3">ASCII Standard Characters</th> + </tr> + + <tr> + <td class="asciiTitle"><img src="ascii-ibm-extended-character-set_files/title.gif" alt="" height="37" width="81"></td> + <td> </td> + <td class="asciiTitle"><img src="ascii-ibm-extended-character-set_files/title.gif" alt="" height="37" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-00.gif" alt="ASCII Control Characters" height="288" width="81"></td> + <td rowspan="4" class="asciiMiddle"><img src="ascii-ibm-extended-character-set_files/pixBluCC.gif" alt="" height="1153" width="1"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-04.gif" alt="ASCII format" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-01.gif" alt="Plain Text" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-05.gif" alt="" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-02.gif" alt="Text File" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-06.gif" alt="Plain Text" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-03.gif" alt="American Standard Code For Information Interchange" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-07.gif" alt="Numerical Representation" height="288" width="81"></td> + </tr> + + <tr> + <td colspan="3"> </td> + </tr> + + </tbody></table></div> + + + <div class="asciiOuter"><table class="asciiTable" border="0" cellpadding="0" cellspacing="0"> + + <tbody><tr> + <th colspan="3">IBM Extended Characters</th> + </tr> + + <tr> + <td class="asciiTitle"><img src="ascii-ibm-extended-character-set_files/title.gif" alt="" height="37" width="81"></td> + <td> </td> + <td class="asciiTitle"><img src="ascii-ibm-extended-character-set_files/title.gif" alt="" height="37" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-08.gif" alt="" height="288" width="81"></td> + <td rowspan="4" class="asciiMiddle"><img src="ascii-ibm-extended-character-set_files/pixBluCC.gif" alt="" height="1153" width="1"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-12.gif" alt="" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-09.gif" alt="IBM Extended Character Set" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-13.gif" alt="Alphanumeric Characters" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-10.gif" alt="" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-14.gif" alt="" height="288" width="81"></td> + </tr> + + <tr> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-11.gif" alt="" height="288" width="81"></td> + <td class="asciiCell"><img src="ascii-ibm-extended-character-set_files/ascii-15.gif" alt="" height="288" width="81"></td> + </tr> + + <tr> + <td colspan="3"> </td> + </tr> + + </tbody></table></div> + + + <h2 class="h2">These Tables ...</h2> + + <p class="normText">These +extended ASCII tables are a chart of all the original 7-bit, ASCII +codes in the original ASCII Standard Character Set plus the IBM +Extended Characters Set, each character value being stored in the +eighth bit. The tables display the decimal values, the hexadecimal +values and an accurate rendering of the actual characters. These +extended ASCII character sets originated in the early IBP PC DOS system +and because of this they can only be represented in bitmapped, +graphical format on a web page.</p> + + <h2 class="h2">History Of ...</h2> + + <p class="normText">Once +combined by IBM, the ASCII Standard Character Set and the IBM Extended +Character Set became the on-board 'ROM-BIOS' character set for all IBM +PC's and compatibles. It is in reality the DOS character set because +Microsoft Windows and Web browsers each use their own character sets.</p> + + <p class="normText">Like +the dinosaur, the ASCII/IBM character set ruled the world of computing +for many years until progress rendered it inadequate for modern day +needs. In it's heyday we thought it was wonderful because it provided +basic ASCII characters plus all these wonderful extended characters for +making boxes and windows in DOS, something hitherto unheard of. I was +never too sure about some of the foreign characters, perhaps an early +attempt by IBM at internationalisation.</p> + + <h2 class="h2">ASCII Meaning ...</h2> + + <p class="normText">The +acronym ASCII stands for American Standard Code For Information +Interchange. If we remember that computers only understand numbers, the +ASCII code is the numerical representation of the alpha/numeric +characters understood by humans (e.g. '1,2,3' or 'A,B,C' or 'd,e,f', +etc.). ASCII codes in the range 0...31 represent special, non-printing +characters called Control Characters (e.g. 'c/r,l/f,f/f', etc.). ASCII +was originally used with teletype machines and so many of the Control +Character descriptions can be difficult to understand.</p> + + <p class="normText">In +more practical terms you may be asked to save a file in ASCII format +and all this means that the file should be saved as a plain test file, +without any formatting or Markup instructions contained in the file. +Programs that are designed to handle plain text files are called text +editors and these include Notepad, EditPad, etc. and they should not be +confused with word processors like Microsoft Word.</p> + + + <!-- END OF PAGE CONTENT AREA --> + </div> + + <!-- END OF MAIN CONTENT AREA --> + </div> + + <!-- END OF MAIN CONTENT CONTAINER --> + </div> + + + +</body></html> diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-00.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-00.gif Binary files differnew file mode 100644 index 00000000..c52ed551 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-00.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-01.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-01.gif Binary files differnew file mode 100644 index 00000000..411c0d0b --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-01.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-02.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-02.gif Binary files differnew file mode 100644 index 00000000..6a4b778a --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-02.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-03.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-03.gif Binary files differnew file mode 100644 index 00000000..82dbdc45 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-03.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-04.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-04.gif Binary files differnew file mode 100644 index 00000000..ac1e053f --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-04.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-05.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-05.gif Binary files differnew file mode 100644 index 00000000..311dc130 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-05.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-06.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-06.gif Binary files differnew file mode 100644 index 00000000..50ddf499 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-06.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-07.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-07.gif Binary files differnew file mode 100644 index 00000000..fbf21b25 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-07.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-08.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-08.gif Binary files differnew file mode 100644 index 00000000..c3163cdf --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-08.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-09.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-09.gif Binary files differnew file mode 100644 index 00000000..21815320 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-09.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-10.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-10.gif Binary files differnew file mode 100644 index 00000000..420c3517 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-10.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-11.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-11.gif Binary files differnew file mode 100644 index 00000000..1fea8b27 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-11.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-12.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-12.gif Binary files differnew file mode 100644 index 00000000..35af36c2 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-12.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-13.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-13.gif Binary files differnew file mode 100644 index 00000000..dfd99838 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-13.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-14.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-14.gif Binary files differnew file mode 100644 index 00000000..6c915c8c --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-14.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/ascii-15.gif b/docview/docs/ascii-ibm-extended-character-set_files/ascii-15.gif Binary files differnew file mode 100644 index 00000000..95bbdce9 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/ascii-15.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/pixBluCC.gif b/docview/docs/ascii-ibm-extended-character-set_files/pixBluCC.gif Binary files differnew file mode 100644 index 00000000..60485176 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/pixBluCC.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/pixClear.gif b/docview/docs/ascii-ibm-extended-character-set_files/pixClear.gif Binary files differnew file mode 100644 index 00000000..35d42e80 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/pixClear.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/script-bin.js b/docview/docs/ascii-ibm-extended-character-set_files/script-bin.js new file mode 100644 index 00000000..f5c95601 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/script-bin.js @@ -0,0 +1,587 @@ + // fullwin1.js
+
+ // CONSTRUCTOR FUNCTION TO CREATE FULLWIN OBJECT
+ function _fullWin_object ( win_url, win_name, win_ref, win_features )
+ {
+ this.win_url = win_url;
+ this.win_name = win_name;
+ this.win_ref = win_ref;
+ this.win_features = win_features;
+ }
+
+ // DECLARE SCRIPTS ARRAY
+ var _fullWin = new Array;
+
+ function _fullWindow(winURL) {
+
+ var winName = replaceBadCharacters(winURL);
+
+ var linkID = "";
+ if (_fullWindow.arguments.length > 1 && _fullWindow.arguments[1].length > 0) {
+ linkID = _fullWindow.arguments[1];
+ winName += linkID;
+ }
+
+ // MAKE ROBUST FUNCTION - TEST ARGUMENTS FIRST
+ if (_fullWindow.arguments.length < 1) {
+ alert ( "\nPage Scripting Error!\nInvalid number of arguments passed to 'full_window' function.\n" );
+ return(false);
+ } else if ( typeof ( winName ) != "string" || winName.length < 2) {
+ alert ( "\nPage Scripting Error!\nInvalid 'targetName' string passed to 'full_window' function.\n" );
+ return (false);
+ }
+
+ var win_num = _fullWin.length;
+ var found = false;
+
+ for (var num=0; num<_fullWin.length; num++) {
+
+ if ( winURL==_fullWin[num].win_url && winName==_fullWin[num].win_name) {
+ win_num = num;
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+
+ _fullWin[win_num] = new _fullWin_object (
+ winURL,
+ winName,
+ null,
+ "" );
+ }
+
+ var fw = _fullWin[win_num];
+
+ // IF FULL WINDOW IS ALREADY OPEN
+ if (remoteWindowOpen(fw.win_ref)) {
+
+ // BRING EXISTING WINDOW TO TOP
+ fw.win_ref.focus ();
+ return(remoteWindowOpen(fw.win_ref));
+ }
+
+ fw.win_features = full_window_features ();
+
+ var win_ref = window.open(fw.win_url,fw.win_name,fw.win_features);
+
+ fw.win_ref = win_ref;
+
+ if (remoteWindowOpen(fw.win_ref)) {
+ fw.win_ref.focus ();
+ }
+
+ var retCode = remoteWindowOpen(fw.win_ref);
+// alert(retCode);
+ return(retCode);
+ }
+
+
+ function replaceBadCharacters(string) {
+
+ // CONVERT STRING TO UPPER CASE
+ string = string.toUpperCase();
+
+ // REMOVE COMMON EXTENSION FROM END OF FILENAME
+ string = string.replace(/.htm|.html$|.shtml|.asp/i,"");
+
+ // REMOVE PROTOCOL FROM BEGINNING OF URL
+// string = string.replace(/^http:\/\/www.|http:\/\//i,"");
+
+ // REMOVE ALL BAD CHARACTERS FROM REMAINING STRING
+ string = string.replace(/\/|:|\+|-|\.|_| |=|#|%|\?|\&|,/ig,"");
+
+ // REDUCE LENGTH OF STRING TO 12
+ string = string.substr(string.length-12,12);
+
+ return(string);
+ }
+
+
+ function full_window_features ()
+ {
+ var featuresList = "directories=yes";
+
+ if ( navigator.userAgent.indexOf ( "Opera" ) > -1 ) {
+ featuresList += ",top=0"; // doesn't WORK
+ featuresList += ",left=0"; // doesn't WORK
+ featuresList += ",height=" + screen.availHeight;
+ featuresList += ",width=" + screen.availWidth;
+ } else if ( navigator.userAgent.indexOf ( "Gecko" ) > -1 ) {
+ featuresList += ",top=" + screen.availTop;
+ featuresList += ",left=" + screen.availLeft;
+ featuresList += ",height=" + ( screen.availHeight - 144 );
+ featuresList += ",width=" + ( screen.availWidth - 7 );
+ } else if ( document.all ) {
+ featuresList += ",top=" + parseInt(screen.availTop,10);
+ featuresList += ",left=" + parseInt(screen.availLeft,10);
+ featuresList += ",height=" + screen.availHeight;
+ featuresList += ",width=" + screen.availWidth;
+ } else if ( document.layers ) {
+ featuresList += ",top=" + screen.availTop;
+ featuresList += ",left=" + screen.availLeft;
+ featuresList += ",height=" + ( screen.availHeight - 157 );
+ featuresList += ",width=" + ( screen.availWidth - 11 );
+ } else if ( navigator.javaEnabled () ) {
+ var toolkit = java.awt.Toolkit.getDefaultToolkit ();
+ var screen_size = toolkit.getScreenSize ();
+ featuresList += ",width=" + ( screen_size.width - 13 );
+ featuresList += ",height=" + ( screen_size.height - 194 );
+ } else if ( typeof ( screen ) == "object" ) {
+ featuresList += ",top=" + screen.availTop;
+ featuresList += ",left=" + screen.availLeft;
+ featuresList += ",height=" + screen.availHeight;
+ featuresList += ",width=" + screen.availWidth;
+ }
+
+ featuresList += ",location=1";
+ featuresList += ",menubar=1";
+ featuresList += ",scrollbars=1";
+ featuresList += ",status=1";
+ featuresList += ",toolbar=1";
+ featuresList += ",resizable=1";
+ featuresList += ",fullscreen=0";
+
+ return(featuresList);
+ }
+
+
+ // CROSS PLATFORM, BOOLEAN, ERROR FREE TEST TO CHECK IF REMOTE WINDOW IS OPEN
+ function remoteWindowOpen(window_reference) {
+
+ if (window_reference !== null && window_reference.closed === false) {
+ return(true);
+ }
+
+ return(false);
+ }
+
+//=================================================================================
+
+ function getMe() {
+
+ var prot = '\x6D' + '\x61\x69\x6C' + '\x74\x6F';
+ var addr = "\x48\x61d\x6Cey\x47\x40\x77eb\x2D\x77\x69se\x2D\x77\x69zard\x2E\x63\x6F\x6D";
+
+ var htmstr = '<div> </div><div class="mailLink">';
+ htmstr += 'E\x6D\x61il: <a href="' + prot + '\x3A' + addr + '">' + addr + '</a></div>';
+
+ document.write(htmstr);
+ }
+
+//=================================================================================
+
+// themes.js
+
+//=================================================================================
+
+ var pathName = location.pathname.replace(/\\/g,"/");
+
+ var siteIndex = false;
+ if (pathName == "/" || pathName.match(/\/www\/index.html$/i)) {
+ siteIndex = true;
+ } else if (pathName == "/~webwisew/") {
+ siteIndex = true;
+ } else if (pathName == "/webmaste/www/") {
+ siteIndex = true;
+ }
+
+ var imgObj = new Array();
+ var imgArr = new Array();
+ var imgArray = new Array (
+ "line-horz-1.gif",
+ "line-horz-2.gif",
+ "line-horz-3.gif",
+ "line-horz-4.gif",
+ "theme-back.jpg",
+ "deadlink-back.gif",
+ "hoverlink-back.gif" );
+
+
+ function preloadThemeImages(skinNo) {
+
+ if (skinNo < 1 || skinNo > 6) {
+ return;
+ }
+
+ var skinStr = "0" + skinNo;
+ var preFix = (siteIndex) ? "" : "../";
+ var imgPath = preFix + "images/skin-" + skinStr + "/";
+
+ for (var count=0; count<imgArray.length; count++) {
+ imgObj[count] = new Image();
+ imgObj[count].src = imgPath + imgArray[count];
+ }
+ }
+
+
+ var maxTheme = 6;
+ var _startTheme = _endTheme = 0;
+
+
+ function preloadOtherImages() {
+
+ var skinStr, imgPath, arrayNum = -1;
+
+ for (var skin=1; skin<7; skin++) {
+
+ if (skin == _startTheme) {
+ continue;
+ }
+
+ skinStr = "0" + skin;
+ var preFix = (siteIndex) ? "" : "../";
+ imgPath = preFix + "images/skin-" + skinStr + "/";
+ if (siteIndex) {
+ imgPath = imgPath.replace(/^..\//,"");
+ }
+
+ arrayNum ++;
+ imgArr[arrayNum] = new Array();
+ for (var count=0; count<imgArray.length; count++) {
+ imgArr[arrayNum][count] = new Image();
+ imgArr[arrayNum][count].src = imgPath + imgArray[count];
+ }
+
+ }
+ }
+
+// window.onload=preloadOtherImages
+
+//=================================================================================
+
+ var ssCookieName = "colorSelected";
+ var ssCookieDays = 10;
+ var ssCookieValue = 1;
+
+ function setInitialStyles() {
+
+ if (retroBrowser()) {
+ return;
+ }
+
+ ssCookieValue = readCookie(ssCookieName);
+ ssCookieValue = (ssCookieValue<1 || ssCookieValue>maxTheme) ? 1 : ssCookieValue;
+ _startTheme = _endTheme = ssCookieValue;
+
+ if (navigator.appName.match(/^Microsoft/i)) {
+ preloadThemeImages(ssCookieValue);
+ switchStyleSheetMicrosoft(ssCookieValue);
+ } else if (navigator.appName.match(/^Netscape/i)) {
+ preloadThemeImages(ssCookieValue);
+ switchStyleSheetGecko(ssCookieValue);
+ }
+ }
+
+
+ function changeScheme(toNum) {
+
+ if (retroBrowser()) {
+ return;
+ }
+
+ if (navigator.appName.match(/^Microsoft/i)) {
+ preloadThemeImages(toNum);
+ switchStyleSheetMicrosoft(toNum);
+ } else if (navigator.appName.match(/^Netscape/i)) {
+ preloadThemeImages(toNum);
+ switchStyleSheetGecko(toNum);
+ }
+
+ ssCookieValue = toNum;
+ createCookie(ssCookieName,ssCookieValue,ssCookieDays);
+ _endTheme = toNum;
+ }
+
+
+ function retroBrowser () {
+
+ if (document.layers) {
+ return(true);
+ } else if (navigator.userAgent.match(/Opera/ig)) {
+ return(true);
+ } else if (navigator.userAgent.match(/Safari/ig)) {
+ return(true);
+ }
+
+ return(false);
+ }
+
+
+ function switchStyleSheetMicrosoft(toNum) {
+
+ var preFix = (siteIndex) ? "" : "../";
+
+ if (document.styleSheets[0].href !== null) {
+ document.styleSheets[0].href = preFix + "css/www-theme-" + toNum + ".css";
+ }
+ }
+
+
+ function switchStyleSheetGecko(toNum) {
+
+ var linkTag, linkTitle = "skin" + toNum;
+ var linksArray = document.getElementsByTagName("link");
+
+ for(var linkNum=0; linkNum<linksArray.length; linkNum++) {
+ linkTag = linksArray[linkNum];
+ if(linkTag.getAttribute("rel").match(/^sty|^alt/i)) {
+
+ if (linkTag.getAttribute("title") == linkTitle) {
+ linkTag.disabled = false;
+ } else if (linkTag.getAttribute("title")) {
+ linkTag.disabled = true;
+ }
+ }
+ }
+ }
+
+
+ function checkRadioButton() {
+
+ var form;
+
+ if (document.getElementById) {
+ form = document.getElementById('colorSelect');
+ form.colorScheme[(ssCookieValue-1)].checked = true;
+ } else {
+ colorSelect.colorScheme[(ssCookieValue-1)].checked = true;
+ }
+ }
+
+
+ setInitialStyles();
+
+//=================================================================================
+
+ function displayThemesMenu() {
+
+ if (retroBrowser()) {
+ return;
+ }
+
+ var htmstr = '<div class="themesMenu">';
+ htmstr += '\n<div class="divHeader">CSS Switch Themes</div>';
+
+ htmstr += '\n<div><table width="177" border="0" cellpadding="0" cellspacing="1">';
+ htmstr += '\n<div><form id="colorSelect" action="#" onSubmit="return false">';
+
+ htmstr += '\n<tr class="bg1">';
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www1">-1-</label></div>';
+ htmstr += '\n<div><input id="www1" name="colorScheme" type="radio" onClick="changeScheme(1)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www2">-2-</label></div>';
+ htmstr += '\n<div><input id="www2" name="colorScheme" type="radio" onClick="changeScheme(2)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www3">-3-</label></div>';
+ htmstr += '\n<div><input id="www3" name="colorScheme" type="radio" onClick="changeScheme(3)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www4">-4-</label></div>';
+ htmstr += '\n<div><input id="www4" name="colorScheme" type="radio" onClick="changeScheme(4)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www5">-5-</label></div>';
+ htmstr += '\n<div><input id="www5" name="colorScheme" type="radio" onClick="changeScheme(5)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n<td>';
+ htmstr += '\n<div><label for="www6">-6-</label></div>';
+ htmstr += '\n<div><input id="www6" name="colorScheme" type="radio" onClick="changeScheme(6)"></div>';
+ htmstr += '\n</td>';
+
+ htmstr += '\n</tr>';
+
+ htmstr += '\n</form></div>';
+ htmstr += '\n</table></div>';
+
+ htmstr += '\n<div class="divData">';
+ htmstr += '\n<div><a href="../site-goodies/site-development-bible.html#Theme_Switching">About Theme Switching</a></div>';
+ htmstr += '\n<div><a href="../css-style-sheets/switch-style-sheets-dynamically.html">CSS Switch Styles Tutorial</a></div>';
+ htmstr += '\n</div>';
+
+ htmstr += '\n</div>';
+
+ document.write(htmstr);
+
+ if(typeof(checkRadioButton)=="function") {
+ checkRadioButton();
+ }
+ }
+
+//=================================================================================
+
+ function createCookie(name,value,days) {
+
+ var expires = "";
+
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ expires = "; expires=" + date.toGMTString();
+ }
+
+ document.cookie = name + "=" + value + expires + "; path=/";
+ }
+
+
+ function readCookie(name) {
+
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+
+ for(var i=0;i < ca.length;i++) {
+
+ var c = ca[i];
+ while (c.charAt(0)==' ') {
+ c = c.substring(1,c.length);
+ }
+
+ if (c.indexOf(nameEQ) === 0) {
+ return (c.substring(nameEQ.length,c.length));
+ }
+ }
+
+ return (null);
+ }
+
+
+ function eraseCookie(name) {
+
+ createCookie(name,"",-1);
+ }
+
+//================================================================================
+
+ var namePath = location.pathname.replace(/\\/g,"/");
+ var indexFile = false;
+ if (namePath == "/" || namePath.match(/\/www\/index.html$/i)) {
+ indexFile = true;
+ } else if (namePath == "/~webwisew/") {
+ indexFile = true;
+ }
+
+ var preFix = (indexFile) ? "" : "../";
+
+ var ExchangeLinks = new Image(392,72);
+ ExchangeLinks.src = preFix + "images/exchange-links-now.gif";
+ var SwapLinks = new Image(392,72);
+ SwapLinks.src = preFix + "images/swap-links-with-us.gif";
+
+
+ function swapLinksBanner() {
+
+ var htmstr = '<p>';
+ htmstr += '<a href="http://webmaster.web-wise-wizard.com/" onClick="return(checkLocal(this))" onMouseOver="linksMouseover()" onMouseOut="linksMouseout()">';
+ htmstr += '<img id="exchangeBanner" name="exchangeBanner" src="' + preFix + 'images/exchange-links-now.gif" width="392" height="72" class="alignCenter">';
+ htmstr += '</a>';
+ htmstr += '</p>';
+
+ document.write(htmstr);
+ }
+
+
+ function linksMouseover() {
+
+ if (document.getElementById) {
+ document.getElementById("exchangeBanner").src = SwapLinks.src;
+ } else if (document.all || document.layers) {
+ document.exchangeBanner.src = SwapLinks.src;
+ }
+ }
+
+ function linksMouseout() {
+
+ if (document.getElementById) {
+ document.getElementById("exchangeBanner").src = ExchangeLinks.src;
+ } else if (document.all || document.layers) {
+ document.exchangeBanner.src = ExchangeLinks.src;
+ }
+ }
+
+//=================================================================================
+
+ function footerLinks(doctype,css,jsTested,icra) {
+
+ var pathName = location.pathname.replace(/\\/g,"/");
+ var siteIndex = false;
+ if (pathName == "/" || pathName.match(/\/www\/index.html$/i)) {
+ siteIndex = true;
+ } else if (pathName == "/~webwisew/") {
+ siteIndex = true;
+ }
+
+ var preFix = (siteIndex) ? "" : "../";
+
+ var htmstr = '<div class="footerText">';
+ htmstr += '<a href="' + preFix + 'site-goodies/online-privacy-policy.html" onClick="this.blur()">Online Privacy Policy</a>';
+ htmstr += '</div>';
+
+ htmstr += '<div class="footerText">';
+ htmstr += '<a href="' + preFix + 'site-goodies/contact-us.html" onClick="this.blur()">Contact Us</a>';
+ htmstr += '</div>';
+
+ htmstr += '<div class="alignCenter">';
+ htmstr += '<img src="' + preFix + 'images/pixClear.gif" alt="" width="1" height="22" class="displayBlock">';
+ htmstr += '</div>';
+
+ htmstr += '<div class="footerText"> ';
+
+ if (doctype == "xhtml10") {
+ htmstr += '<a href="http://validator.w3.org/check?uri=referer">';
+ htmstr += '<img src="' + preFix + 'images/w3c-xhtml-1.0.gif"';
+ htmstr += ' alt="Valid XHTML 1.0" width="88" height="31"></a>';
+ } else if (doctype == "xhtml11") {
+ htmstr += '<a href="http://validator.w3.org/check?uri=referer">';
+ htmstr += '<img src="' + preFix + 'images/w3c-xhtml-1.1.gif"';
+ htmstr += ' alt="Valid XHTML 1.1" width="88" height="31"></a>';
+ } else {
+ htmstr += '<a href="http://validator.w3.org/check/referer">';
+ htmstr += '<img src="' + preFix + 'images/valid-html401.gif"';
+ htmstr += ' alt="Valid HTML 4.01!" width="88" height="31"></a>';
+ }
+
+ htmstr += '<a href="http://jigsaw.w3.org/css-validator/check/referer">';
+ htmstr += '<img src="' + preFix + 'images/valid-css.gif" alt="Valid CSS!" width="88" height="31"></a>';
+
+ if (jsTested =="js") {
+ htmstr += '<a href="http://www.web-wise-wizard.com/">';
+ htmstr += '<img src="' + preFix + 'images/javascript-tested.gif" alt="JavaScript Tested" width="88" height="31"></a>';
+ }
+
+ htmstr += '<a href="http://www.icra.org/sitelabel/">';
+ htmstr += '<img src="' + preFix + 'images/icra_sw.gif" alt="Internet Content Rating Association';
+ htmstr += ' - This site is ICRA labelled" width="88" height="31"></a>';
+ htmstr += pageCheckerLogo(preFix);
+ htmstr += '</div>';
+
+ document.write(htmstr);
+ }
+
+//=================================================================================
+
+ function pageCheckerLogo (preFix) {
+
+ var htmstr, docDomain = (typeof(document.domain)=="unknown") ? "" : document.domain;
+
+ if (docDomain.match(/web-wise-wizard.com$/i)) {
+ htmstr = ' <a href="http://www.prchecker.info/" onClick="return(fullWindow(this))">';
+ htmstr += '<img src="http://www.prchecker.info/PR2_img.gif" alt="Check Page Rank" border="0" width="88" height="31">';
+ htmstr += '</a>';
+ } else {
+ htmstr = ' <img src="' + preFix + 'images/page-rank-hash.gif" alt="Page Checker Hash" border="0" width="88" height="31">';
+ }
+
+ return("");
+ }
+
+//=================================================================================
+
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/title.gif b/docview/docs/ascii-ibm-extended-character-set_files/title.gif Binary files differnew file mode 100644 index 00000000..899e759b --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/title.gif diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-content.css b/docview/docs/ascii-ibm-extended-character-set_files/www-content.css new file mode 100644 index 00000000..6940a88b --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-content.css @@ -0,0 +1,800 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+/* PAGE LAYOUT STYLES */
+
+#mainContainer {
+margin-left:20px;
+margin-right:200px;
+}
+
+#mainContent {
+margin-left:0;
+margin-top:0;
+margin-right:0;
+}
+
+#rightContainer1 {
+position:absolute;
+top:171px;
+right:0;
+width:180px;
+margin-right:0;
+}
+
+#rightContainer2 {
+position:absolute;
+top:194px;
+right:0;
+width:180px;
+margin-right:0;
+}
+
+#rightContent {
+margin:0;
+border-left:3px double #858654;
+border-bottom:3px double #858654;
+}
+
+/* ======= UNIVERSAL PAGE CONTENT FORMATTING STYLES ======= */
+
+.setOuterMargins {
+ margin-left:30px;
+ margin-right:30px;
+}
+
+hr {
+ width:100%;
+ height:1px;
+ color:#858654;
+}
+
+/* ======= START OF TEXT AND LINK STYLES ======= */
+
+.redBox {
+ border:3px double #CC3333;
+ padding:7px;
+ color:#000000;
+ text-align:justify;
+ font-family:Tahoma,serif,Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-style:normal;
+ background-color:#FFFFFF;
+}
+
+/* ======= START OF TEXT AND LINK STYLES ======= */
+
+.inlineLink {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-decoration:underline;
+}
+
+a.inlineLink:active {color:#0000FF;}
+a.inlineLink:hover {color:#FFFFFF;}
+a.inlineLink:link {color:#000000;} /* Link colour when page is first loaded */
+a.inlineLink:visited {color:#009900;} /* Link colour if uses has previously used link */
+
+/*
+a:active .inlineLink {color:#0000FF;}
+a:hover .inlineLink {color:#FF0000;}
+a:link .inlineLink {color:#000000;}
+a:visited .inlineLink {color:#FFFF00;}
+*/
+
+
+.leftPicImg {
+ clear:both;
+ float:left;
+ display:block;
+ margin-top:19px;
+ margin-right:20px;
+ margin-bottom:20px;
+ border: 2px outset #D8D8D8;
+}
+
+.leftPicImg2 {
+ float:left;
+ display:inline;
+ margin-right:20px;
+ margin-bottom:10px;
+ border: 2px outset #D8D8D8;
+}
+
+.mailLink {
+}
+
+.mailLink a:active {color:#FFFFFF;}
+.mailLink a:hover {color:#FFFF99;}
+.mailLink a:link {color:#FFFFFF;}
+.mailLink a:visited {color:#FFFFFF;}
+
+em {
+ text-transform:uppercase;
+}
+
+.centerTable {
+ text-align:center;
+}
+
+.centerTable table {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:left;
+}
+
+.centerTableCa {
+ text-align:center;
+}
+
+.centerTableCa table {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:center;
+}
+
+.centerTableRa {
+ text-align:center;
+}
+
+.centerTableRa table {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:right;
+}
+
+.centerFieldset {
+ text-align:center;
+}
+
+.centerFieldset fieldset {
+ display:inline;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.centerFieldsetLa {
+ text-align:center;
+}
+
+.centerFieldsetLa fieldset {
+ display:inline;
+ margin-left:auto;
+ margin-right:auto;
+ text-align:left;
+}
+
+.leftAlignFieldset {
+ float:left;
+ margin-right:20px;
+ text-align:left;
+}
+
+.lAfieldset {
+ display:inline;
+ float:none;
+ text-align:center;
+ margin:0 auto;
+}
+
+.centerObject {
+ text-align:center;
+}
+
+.centerObject object {
+ display:inline;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.alignCenter {
+ display:block;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+
+.fancyLink0 {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-align:justify;
+ text-decoration:none;
+}
+
+.fancyLink0 a {
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-size:9pt;
+ color:#006600;
+ text-decoration:underline;
+}
+
+
+.fancyLink0 small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#006600;
+ text-decoration:underline;
+}
+
+
+.fancyLink1 {
+ text-align:justify;
+ line-height:0.96em;
+ text-decoration:none;
+}
+
+.fancyLink1 em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink1 a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink1 small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#006600;
+ text-decoration:underline;
+}
+
+
+.generalLink {
+ text-align:justify;
+ font-size:9pt;
+ font-family:arial,helvetica,sans-serif;
+ color:#990000;
+}
+
+.generalLink a {
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+img {
+ border:0px;
+}
+
+.misPointer {
+ list-style-image:url("../images/hand-red.gif");
+ line-height:180%;
+}
+
+.extPointer {
+ list-style-image:url("../images/hand-blue.gif");
+ line-height:180%;
+}
+
+.locPointer {
+ list-style-image:url("../images/hand-green.gif");
+ line-height:180%;
+}
+
+/*
+ul a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 9pt;
+ display:block;
+}
+*/
+
+.standardList {
+ display:block;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 9pt;
+}
+
+.standardList li {
+ line-height:120%;
+}
+
+.standardList a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 9pt;
+ text-decoration:underline;
+}
+
+.textLink {
+ display:inline;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ font-size:8pt;
+ cursor:pointer;
+ text-decoration:underline;
+}
+
+.listStyle {
+ margin-left:60px;
+ margin-right:60px;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+}
+
+.listStyle li {
+ text-align:justify;
+ margin-bottom:7px;
+}
+
+.noListStyle {
+ list-style-type:none;
+ margin-left:37px;
+ margin-right:60px;
+}
+
+.listStyleNone {
+ list-style-type:none;
+ margin-left:37px;
+ margin-right:60px;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+}
+
+.listStyleNone li {
+ text-align:justify;
+ margin-bottom:7px;
+}
+
+.listStyleCircle {
+ list-style-type:circle;
+ margin-left:30px;
+ margin-right:30px;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+}
+
+.listStyleCircle li {
+ text-align:left;
+ margin-bottom:7px;
+}
+
+.listStyleCircle li a {
+ font-weight:bold;
+}
+
+.listStyleSquare {
+ list-style-type:square;
+ margin-left:60px;
+ margin-right:60px;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+}
+
+.listStyleSquare li {
+ text-align:justify;
+ margin-bottom:7px;
+}
+
+.fontBold {
+ font-weight:bolder;
+}
+
+.markupButtonHi {
+ margin-top:5px;
+ width:120px;
+ background-color:#858654;
+ color:#FFFFFF;
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:9.5pt;
+ font-weight:bolder;
+ border: none;
+ border-right: 2px #787878 solid;
+ border-bottom: 2px #787878 solid;
+ border-top: 2px #DDDDDD solid;
+ border-left: 2px #DDDDDD solid;
+}
+
+.markupButtonLo {
+ margin-top:5px;
+ width:120px;
+ background-color:#BBBA93;
+ color:#006600;
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:9.5pt;
+ font-weight:bolder;
+ border: none;
+ border-right: 2px #787878 solid;
+ border-bottom: 2px #787878 solid;
+ border-top: 2px #DDDDDD solid;
+ border-left: 2px #DDDDDD solid;
+}
+
+.markupTextarea {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:9.5pt;
+ color:#006600;
+}
+
+.pseudoLink {
+ display:inline;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10.5pt;
+ font-weight:normal;
+ color:#006600;
+ text-decoration:underline;
+ cursor:pointer;
+}
+
+
+/* START OF STYLES USED BY THE MULTI-SEARCH PAGE */
+
+.loadTitle {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bold;
+}
+
+/* END OF STYLES USED BY THE MULTI-SEARCH PAGE */
+
+
+.siteMap {
+ display:block;
+ font-family:Arial,Helvetica,sans-serif;
+ margin-bottom:0;
+}
+
+.siteMap a {
+ display:block;
+ text-decoration:none;
+/* border: 2px solid #D2D2A5;*/
+ padding:5px;
+ font-size:11pt;
+}
+
+.siteMap a:hover {
+ border: 2px dotted #858654;
+}
+
+.siteMap .pagePath {
+ display:block;
+ margin-top:0px;
+}
+
+.siteMap .pageHeading {
+ display:block;
+ padding-top:2px;
+ font-weight:bolder;
+ font-size:10pt;
+ text-decoration:underline;
+}
+
+.siteMap .metaDescription {
+ display:block;
+ font-size:10pt;
+ padding-top:2px;
+ color:#990000;
+ text-align:justify;
+}
+
+.siteMap .titleTag {
+ display:block;
+ padding-top:2px;
+ font-size:10pt;
+ color:#003300;
+}
+
+.sitemapLeft {
+ margin-left:0%;
+ width:94%;
+}
+
+.sitemapIndent {
+ margin-left:6%;
+ width:94%;
+}
+
+
+.quikPick {
+ width:60%;
+ margin:auto;
+ font-family:verdana,Arial,Helvetica,sans-serif;
+ font-size:0.77em;
+ font-weight:bolder;
+ font-style:oblique;
+ background-color:#F0F0F0;
+ color:#000000;
+ padding:8px;
+ border:2px solid #777777;
+}
+
+.quikPick div {
+ margin-top:5px;
+ padding-top:5px;
+ padding-bottom:5px;
+ text-align:justify;
+ font-weight:normal;
+ font-style:normal;
+}
+
+.alignLeft {
+ text-align:left;
+}
+
+.alignCenter {
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.alignCenterInline {
+ display:inline;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.alignRight {
+ text-align:right;
+}
+
+#tabSelect {
+ cursor:pointer;
+}
+
+.paddingTop10 {
+ padding-top:10px;
+}
+
+.width20 {
+ width:20px;
+}
+
+.width75p {
+ width:75%;
+}
+
+.width33p {
+ width:33%;
+}
+
+.width40 {
+ width:40px;
+}
+
+.width50p {
+ width:50%;
+}
+
+.width60 {
+ width:60px;
+}
+
+.width98 {
+ width:98px;
+}
+
+.width300 {
+ width:300px;
+}
+
+.width340 {
+ width:340px;
+}
+
+.width100p {
+ width:100%;
+}
+
+.width742 {
+ width:742px;
+}
+
+.height20 {
+ height:20px;
+}
+
+.height30 {
+ height:30px;
+}
+
+.height51 {
+ height:51px;
+}
+
+.height144 {
+ height:144px;
+}
+
+.padding6 {
+ padding-top:6px;
+ padding-bottom:6px;
+}
+
+.hspace5 {
+ padding-left:5px;
+ padding-right:5px;
+}
+
+.hspace16 {
+ padding-left:16px;
+ padding-right:16px;
+}
+
+.hmargins30 {
+ margin-left:30px;
+ margin-right:30px
+}
+
+.marginTop0 {
+ margin-top:0px;
+}
+
+.marginTop8 {
+ margin-top:8px;
+}
+
+.marginTop11 {
+ margin-top:11px;
+}
+
+.marginLeft45 {
+ margin-left:45px;
+}
+
+.vspace5 {
+ margin-top:5px;
+ margin-bottom:5px;
+}
+
+.leftObj {
+ display:block;
+ float:left;
+ margin-top:5px;
+ margin-right:16px;
+ margin-bottom:10px;
+ border:none;
+}
+
+.limeHeightZero {
+ line-height:0px;
+}
+
+.topLeftAlignPik {
+ text-align:left;
+ float:left;
+}
+
+.topLeftAlignPik div {
+ margin-top:21px;
+}
+
+.topLeftAlignPik img {
+ display:inline;
+ margin-top:4px;
+ margin-right:20px;
+ margin-bottom:6px;
+}
+
+.leftAlignPik {
+ text-align:left;
+ float:left;
+}
+
+.leftAlignPik img {
+ display:inline;
+ margin-top:4px;
+ margin-right:20px;
+ margin-bottom:6px;
+}
+
+.leftAlignPik iframe {
+ display:inline;
+ margin-top:4px;
+ margin-right:20px;
+ margin-bottom:6px;
+}
+
+.borderInset {
+ border: 2px inset #D8D8D8;
+}
+
+.borderOutset {
+ border: 2px outset #D8D8D8;
+}
+
+.picTable {
+ display:inline;
+ margin-left:0px;
+ margin-right:30px;
+ margin-bottom:10px;
+ float:left;
+}
+
+.clearLeft {
+ clear:left;
+}
+
+.leftAlign {
+ text-align:left;
+}
+
+.displayBlock {
+ clear:both;
+ display:block;
+}
+
+.displayInline {
+ display:inline;
+}
+
+.inlineLeft {
+ display:inline;
+ text-align:left;
+}
+
+.displayLinkRank {
+ clear:both;
+ text-align:left;
+ display:block;
+ margin-top:3px;
+ margin-bottom:3px;
+}
+
+.whoisLookup {
+ text-align:center;
+ border:1px solid #000000;
+}
+
+.whoisLookup .big {
+ margin:9px;
+ font-size:13pt;
+ font-weight:bold;
+}
+
+.linkToPage {
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ color:#000000;
+}
+
+.linkToPage span {
+ display:block;
+ text-decoration:underline;
+ font-weight:bold;
+ color:#0000CC;
+}
+
+.radioCursor {cursor:pointer;}
+.radioCursor label {cursor:pointer;}
+.radioCursor input {cursor:pointer;}
+
+.tt {
+ font-family:monospace;
+ font-size:smaller;
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-1.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-1.css new file mode 100644 index 00000000..b446cfb7 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-1.css @@ -0,0 +1,786 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#F1F4FE;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#FFFFFF;
+ background-color:#565D82;
+ background-image:url('../images/skin-01/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#FFFFFF;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family: verdana,arial,helvetiva,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#003300;
+ border:3px #565D82 double;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#CDD8FF;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:"Comic Sans MS","VagRounded BT","Impress BT",cursive;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#006600;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #006600;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#FFFFFF;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#565D82;
+ background-image:url('../images/skin-01/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #FFFFFF; text-decoration: underline;}
+.footerText a:visited {color: #FFFFFF; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#565D82;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#FFFFFF;
+ background-color:#565D82;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#6A5A00;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-01/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-01/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#CDD8FF;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#6A5A00;
+ background-color:#CDD8FF;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #565D82;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #858654;
+ text-align:center;
+ color:#6A5A00;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-01/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-01/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#565D82;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#565D82;
+ color:#FFFFFF;
+}
+
+.siteTable .bg1 {
+ background-color:#F1F4FE;
+ color:#006600;
+}
+
+.siteTable .bg2 {
+ background-color:#CDD8FF;
+ color:#6A5A00;
+}
+
+.monoTable {
+ background-color:#565D82;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#565D82;
+ color:#FFFFFF;
+}
+
+.monoTable .bg1 {
+ background-color:#F1F4FE;
+ color:#006600;
+}
+
+.monoTable .bg2 {
+ background-color:#CDD8FF;
+ color:#6A5A00;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#858654;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 {
+ background-color:#F1F4FE;
+ color:#6A5A00;
+ font-weight:bold;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.normText {
+ font-family:Arial,Verdana,Geneva,Helvetica,sans-serif;
+ font-size:0.96em;
+ text-align:justify;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #006600; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #003300; text-decoration: underline;}
+.demoText a:visited {color: #003300; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.siteMap a {
+ border: 2px solid #F1F4FE;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-01/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #CC3300;
+ margin-left:15px;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#FFFFFF;
+ border:0;
+ background-color:#565D82;
+}
+
+.divDataLgt {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#6A5A00;
+ background-color:#F1F4FE;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#6A5A00;
+ background-color:#CDD8FF;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#6A5A00;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #003300;
+ background-color:#F8F8FF;
+ border:3px double #565D82;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #565D82;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#CDD8FF;
+ color:#6A5A00;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#F1F4FE;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#FFFFFF;
+ background-color:#565D82;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#565D82;
+}
+
+fieldset {
+ display:block;
+ background-color:#F1F4FE;
+ border:2px dotted #565D82;
+ margin-top:0;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+fieldset legend {
+ color: #6A5A00;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #565D82 double;
+ font-weight: bold;
+ background-color:#CDD8FF;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#CDD8FF;
+ text-align:center;
+ margin:0 auto;
+ border:#565D82 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#003300;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#CDD8FF;
+ text-align:center;
+ margin:0 auto;
+ border:#565D82 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#CDD8FF;
+ border:#565D82 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-01/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-01/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-01/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-01/line-horz-4.gif');
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#565D82;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#858654;
+}
+
+.bg1 {
+ background-color:#FFFFFF;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#006600;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #D2D2A5;
+ border-top:2px solid #D2D2A5;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #565D82;
+ background-color:#F1F4FE;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#006600;
+}
+
+.searchBox {
+ background-color:#CDD8FF;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #6A5A00;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#6A5A00;
+}
+
+.buttonHi {
+ background-color:#565D82;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#565D82;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#CDD8FF;
+ color:#6A5A00;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-01/folder-2.gif');
+}
+
+.randOuter {
+ clear:both;
+}
+
+.randList {
+ display:block;
+ width:100%;
+ text-align:right;
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+ line-height:0px;
+}
+
+.randList li {
+ display:block;
+ float:left;
+ width:68px;
+ background-color:#CDD8FF;
+ border-top:1px solid #333333;
+ border-left:1px solid #333333;
+ padding:3px;
+ margin:0px;
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-2.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-2.css new file mode 100644 index 00000000..8a4baf7b --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-2.css @@ -0,0 +1,746 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#FFFFF3;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#F8F8EE;
+ background-color:#707154;
+ background-image:url('../images/skin-02/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#F8F8EE;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family: verdana,arial,helvetiva,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#373C93;
+ border:3px #838367 double;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#F7F8D9;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:"Comic Sans MS","VagRounded BT","Impress BT",cursive;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#373C93;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #373C93;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#F8F8EE;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#707154;
+ background-image:url('../images/skin-02/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#F8F8EE;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#F8F8EE;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #F8F8EE; text-decoration: underline;}
+.footerText a:visited {color: #F8F8EE; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#707154;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#F8F8EE;
+ background-color:#707154;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #F7F8D9;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #F7F8D9;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#707154;
+ background-color:#F8F8EE;
+ background-image:url('../images/skin-02/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-02/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#F7F8D9;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#373C93;
+ background-color:#F7F8D9;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #707154;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #707154;
+ text-align:center;
+ color:#707154;
+ background-color:#F8F8EE;
+ background-image:url('../images/skin-02/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-02/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#707154;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#707154;
+ color:#F8F8EE;
+}
+
+.siteTable .bg1 {
+ background-color:#FFFFF3;
+ color:#373C93;
+}
+
+.siteTable .bg2 {
+ background-color:#F7F8D9;
+ color:#707154;
+}
+
+.monoTable {
+ background-color:#707154;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#707154;
+ color:#F8F8EE;
+}
+
+.monoTable .bg1 {
+ background-color:#FFFFF3;
+ color:#373C93;
+}
+
+.monoTable .bg2 {
+ background-color:#F7F8D9;
+ color:#707154;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#838367;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#F8F8EE;
+ border:0;
+ background-color:#707154;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#707154;
+ background-color:#F7F8D9;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#707154;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #707154;
+ background-color:#FDFDFA;
+ border:3px double #838367;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #838367;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#F7F8D9;
+ color:#000033;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#FFFFF3;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#F8F8EE;
+ background-color:#707154;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#707154;
+}
+
+fieldset {
+ display:block;
+ background-color:#FFFFF3;
+ border:2px dotted #838367;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+fieldset legend {
+ color: #373C93;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #838367 double;
+ font-weight: bold;
+ background-color:#F7F8D9;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#F7F8D9;
+ text-align:center;
+ margin:0 auto;
+ border:#838367 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#373C93;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#F7F8D9;
+ text-align:center;
+ margin:0 auto;
+ border:#838367 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#F7F8D9;
+ border:#838367 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-02/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-02/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-02/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-02/line-horz-4.gif');
+}
+
+.normText {
+ font-family:Arial,Verdana,Geneva,Helvetica,sans-serif;
+ font-size:0.96em;
+ text-align:justify;
+ color:#0C0C0C;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #373C93; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #707154; text-decoration: underline;}
+.demoText a:visited {color: #707154; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.siteMap a {
+ border: 2px solid #FFFFF3;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-02/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #CC3300;
+ margin-left:15px;
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#373C93;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#373C93;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#838367;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#838367;
+}
+
+.bg1 {
+ background-color:#F8F8EE;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#373C93;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #FFFFF3;
+ border-top:2px solid #FFFFF3;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #838367;
+ background-color:#FFFFF3;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#373C93;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#373C93;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#373C93;
+}
+
+.searchBox {
+ background-color:#F7F8D9;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #707154;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#707154;
+}
+
+.buttonHi {
+ background-color:#707154;
+ color:#F8F8EE;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#707154;
+ color:#F8F8EE;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#F7F8D9;
+ color:#707154;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-02/folder-2.gif');
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-3.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-3.css new file mode 100644 index 00000000..2509c6b9 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-3.css @@ -0,0 +1,752 @@ + /* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#FEFEFE;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#FFFFFF;
+ background-color:#333333;
+ background-image:url('../images/skin-03/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#FFFFFF;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family: verdana,arial,helvetiva,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#000000;
+ border:3px #333333 double;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#ECECEC;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#333333;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #000066;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#000000;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#333333;
+ background-image:url('../images/skin-03/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #FFFFFF; text-decoration: underline;}
+.footerText a:visited {color: #FFFFFF; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#333333;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#FFFFFF;
+ background-color:#333333;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#000000;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-03/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-03/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#ECECEC;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#000000;
+ background-color:#E8E8E8;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #333333;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #333333;
+ text-align:center;
+ color:#000000;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-03/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-03/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#333333;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#333333;
+ color:#FFFFFF;
+}
+
+.siteTable .bg1 {
+ background-color:#FEFEFE;
+ color:#006600;
+}
+
+.siteTable .bg2 {
+ background-color:#E8E8E8;
+ color:#000000;
+}
+
+.monoTable {
+ background-color:#333333;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#333333;
+ color:#FFFFFF;
+}
+
+.monoTable .bg1 {
+ background-color:#FEFEFE;
+ color:#006600;
+}
+
+.monoTable .bg2 {
+ background-color:#E8E8E8;
+ color:#000000;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#838367;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 {
+ background-color:#FFFFFF;
+ color:#006600;
+ font-weight:bold;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.normText {
+ font-family:Times,'Times New Roman',Palatino,serif;
+ font-size:0.96em;
+ text-align:justify;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #006600; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:Times,'Times New Roman',Palatino,serif;
+ font-size:0.85em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #003300; text-decoration: underline;}
+.demoText a:visited {color: #003300; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#FFFFFF;
+ border:0;
+ background-color:#333333;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#000000;
+ background-color:#E8E8E8;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#000000;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #000000;
+ background-color:#ECECEC;
+ border:3px double #333333;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #333333;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#E8E8E8;
+ color:#000033;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#FEFEFE;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#FFFFFF;
+ background-color:#333333;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#48486E;
+}
+
+fieldset {
+ display:block;
+ background-color:#FFFFFF;
+ border:2px dotted #333333;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+
+fieldset legend {
+ color: #000000;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #333333 double;
+ font-weight: bold;
+ background-color:#ECECEC;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#ECECEC;
+ text-align:center;
+ margin:0 auto;
+ border:#333333 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#000000;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#ECECEC;
+ text-align:center;
+ margin:0 auto;
+ border:#333333 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#ECECEC;
+ border:#333333 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-03/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-03/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-03/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-03/line-horz-4.gif');
+}
+
+.siteMap a {
+ border: 2px solid #FEFEFE;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-03/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #333333;
+ margin-left:15px;
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#666666;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#333333;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#333333;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#333333;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#787878;
+}
+
+.bg1 {
+ background-color:#FFFFFF;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#006600;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #E8E8E8;
+ border-top:2px solid #E8E8E8;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #787878;
+ background-color:#E8E8E8;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#006600;
+}
+
+.searchBox {
+ background-color:#E8E8E8;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#000000;
+}
+
+.buttonHi {
+ background-color:#333333;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#333333;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#E8E8E8;
+ color:#000000;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-03/folder-2.gif');
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-4.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-4.css new file mode 100644 index 00000000..a330b833 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-4.css @@ -0,0 +1,753 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#EBFFED;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#FFFFFF;
+ background-color:#066E06;
+ background-image:url('../images/skin-04/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#FFFFFF;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family:Verdana,Arial,Geneva,Helvetica,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#003300;
+ border:3px double #066E06;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#C3F4C3;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:VerdanaArial,Geneva,Helvetica,sans-serif;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#006600;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #006600;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#FFFFFF;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#066E06;
+ background-image:url('../images/skin-04/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #FFFFFF; text-decoration: underline;}
+.footerText a:visited {color: #FFFFFF; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#066E06;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#FFFFFF;
+ background-color:#066E06;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #CCFFCC;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #CCFFCC;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#006600;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-04/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-04/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#C3F4C3;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#006600;
+ background-color:#C3F4C3;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #066E06;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #066E06;
+ text-align:center;
+ color:#006600;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-04/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-04/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#066E06;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#066E06;
+ color:#FFFFFF;
+}
+
+.siteTable .bg1 {
+ background-color:#EBFFED;
+ color:#003300;
+}
+
+.siteTable .bg2 {
+ background-color:#C3F4C3;
+ color:#006600;
+}
+
+.monoTable {
+ background-color:#066E06;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#066E06;
+ color:#FFFFFF;
+}
+
+.monoTable .bg1 {
+ background-color:#EBFFED;
+ color:#003300;
+}
+
+.monoTable .bg2 {
+ background-color:#C3F4C3;
+ color:#006600;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#066E06;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 {
+ background-color:#FFFFFF;
+ color:#006600;
+ font-weight:bold;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#FFFFFF;
+ border:0;
+ background-color:#066E06;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#006600;
+ background-color:#C3F4C3;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#006600;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #003300;
+ background-color:#C3F4C3;
+ border:3px double #066E06;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #066E06;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#C3F4C3;
+ color:#000033;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#EBFFED;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#FFFFFF;
+ background-color:#066E06;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#48486E;
+}
+
+fieldset {
+ display:block;
+ background-color:#EBFFED;
+ border:2px dotted #066E06;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+fieldset legend {
+ color: #066E06;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #066E06 double;
+ font-weight: bold;
+ background-color:#C3F4C3;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#C3F4C3;
+ text-align:center;
+ margin:0 auto;
+ border:#066E06 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#003300;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#C3F4C3;
+ text-align:center;
+ margin:0 auto;
+ border:#066E06 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#C3F4C3;
+ border:#066E06 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-04/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-04/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-04/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-04/line-horz-4.gif');
+}
+
+.normText {
+ font-family:Arial,Verdana,Geneva,Helvetica,sans-serif;
+ font-size:0.96em;
+ font-weight:normal;
+ text-align:left;
+ color:#000000;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #006600; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #003300; text-decoration: underline;}
+.demoText a:visited {color: #003300; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.siteMap a {
+ border: 2px solid #EBFFED;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-04/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #CC3300;
+ margin-left:15px;
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#858654;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#858654;
+}
+
+.bg1 {
+ background-color:#FFFFFF;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#006600;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #D2D2A5;
+ border-top:2px solid #D2D2A5;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #858654;
+ background-color:#D2D2A5;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#006600;
+}
+
+.searchBox {
+ background-color:#C3F4C3;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #006600;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#006600;
+}
+
+.buttonHi {
+ background-color:#066E06;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#066E06;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#C3F4C3;
+ color:#006600;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-04/folder-2.gif');
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-5.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-5.css new file mode 100644 index 00000000..24e0e03e --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-5.css @@ -0,0 +1,752 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#ECFFFF;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#FFFFFF;
+ background-color:#3F6876;
+ background-image:url('../images/skin-05/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#FFFFFF;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family: verdana,arial,helvetiva,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#3F6876;
+ border:3px #3F6876 double;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#AEFBFB;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#333333;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #000066;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#FFFFFF;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#3F6876;
+ background-image:url('../images/skin-05/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #FFFFFF; text-decoration: underline;}
+.footerText a:visited {color: #FFFFFF; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#3F6876;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#FFFFFF;
+ background-color:#3F6876;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #FFFFFF;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#000000;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-05/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-05/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#AEFBFB;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#000000;
+ background-color:#AEFBFB;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #787878;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #787878;
+ text-align:center;
+ color:#000000;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-05/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-05/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#3F6876;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#3F6876;
+ color:#FFFFFF;
+}
+
+.siteTable .bg1 {
+ background-color:#ECFFFF;
+ color:#006600;
+}
+
+.siteTable .bg2 {
+ background-color:#AEFBFB;
+ color:#006600;
+}
+
+.monoTable {
+ background-color:#3F6876;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#3F6876;
+ color:#FFFFFF;
+}
+
+.monoTable .bg1 {
+ background-color:#ECFFFF;
+ color:#006600;
+}
+
+.monoTable .bg2 {
+ background-color:#AEFBFB;
+ color:#006600;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#3F6876;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 {
+ background-color:#FFFFFF;
+ color:#006600;
+ font-weight:bold;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.normText {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.96em;
+ text-align:left;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #006600; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:Times,'Times New Roman',Palatino,serif;
+ font-size:0.85em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #003300; text-decoration: underline;}
+.demoText a:visited {color: #003300; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#FFFFFF;
+ border:0;
+ background-color:#3F6876;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#000000;
+ background-color:#AEFBFB;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#000000;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #000000;
+ background-color:#AEFBFB;
+ border:3px double #3F6876;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #3F6876;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#AEFBFB;
+ color:#000033;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#ECFFFF;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#FFFFFF;
+ background-color:#3F6876;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#48486E;
+}
+
+fieldset {
+ display:block;
+ background-color:#ECFFFF;
+ border:2px dotted #3F6876;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+
+fieldset legend {
+ color: #000000;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #3F6876 double;
+ font-weight: bold;
+ background-color:#AEFBFB;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#AEFBFB;
+ text-align:center;
+ margin:0 auto;
+ border:#3F6876 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#3F6876;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#AEFBFB;
+ text-align:center;
+ margin:0 auto;
+ border:#3F6876 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#AEFBFB;
+ border:#3F6876 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-05/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-05/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-05/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-05/line-horz-4.gif');
+}
+
+.siteMap a {
+ border: 2px solid #ECFFFF;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-05/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #333333;
+ margin-left:15px;
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#006600;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#858654;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#787878;
+}
+
+.bg1 {
+ background-color:#FFFFFF;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#006600;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #E8E8E8;
+ border-top:2px solid #E8E8E8;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #787878;
+ background-color:#E8E8E8;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#006600;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#006600;
+}
+
+.searchBox {
+ background-color:#AEFBFB;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#000000;
+}
+
+.buttonHi {
+ background-color:#3F6876;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#3F6876;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#AEFBFB;
+ color:#000000;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-05/folder-2.gif');
+}
diff --git a/docview/docs/ascii-ibm-extended-character-set_files/www-theme-6.css b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-6.css new file mode 100644 index 00000000..1fa91ef8 --- /dev/null +++ b/docview/docs/ascii-ibm-extended-character-set_files/www-theme-6.css @@ -0,0 +1,745 @@ +/* ======= THIS DUMMY STYLE IS REQUIRED BECAUSE SOME EARLY BROWSERS CHEW UP THE FIRST STYLE ======= */
+
+.dummy {
+ font-family:verdana, arial, helvetica, sans-serif;
+}
+
+
+/* ======= UNIVERSAL PAGE FURNITURE FORMATTING STYLES ======= */
+
+body {
+ margin:0px;
+ padding:0px;
+ background-color:#FDF3F5;
+ font-size: 100% !important;
+ line-height: normal !important;
+}
+
+.headerArea {
+ height:120px;
+ margin:0px;
+ padding:0px;
+ line-height:60%;
+ text-align:center;
+ color:#FFFFFF;
+ background-color:#825963;
+ background-image:url('../images/skin-06/theme-back.jpg');
+}
+
+.headerArea a {
+ color:#FFFFFF;
+}
+
+.headerArea img {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.h1 {
+ font-family: verdana,arial,helvetiva,sans-serif;
+ font-size:15pt;
+ font-weight:normal;
+ color:#275A74;
+ border:3px #825963 double;
+ padding-top:4px;
+ padding-bottom:6px;
+ width:60%;
+ margin:0 auto;
+ background-color:#F7D4DB;
+ text-align:center;
+}
+
+.h2 {
+ margin-top:20px;
+ padding:0px;
+ font-family:"Comic Sans MS","VagRounded BT","Impress BT",cursive;
+ font-size:1.17em;
+ font-weight:normal;
+ color:#275A74;
+}
+
+
+.h3 {
+ clear:both;
+ padding-top:16px;
+ padding-bottom:8px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 10pt;
+ color: #275A74;
+}
+
+.h3 span {
+ display:inline;
+ border-top: 1px #666666 solid;
+ border-bottom: 1px #666666 solid;
+ padding:0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin:0;
+}
+
+.bestViewed {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:26px;
+ margin:0 auto;
+}
+
+.pageMessage {
+ font-family:Arial,Helvetiva,sans-serif;
+ font-size:0.6em;
+ font-weight:normal;
+ color:#333333;
+ line-height:16px;
+ margin:0 auto;
+ margin-bottom:30px;
+}
+
+.footerArea {
+ clear:both;
+ width:100%;
+ text-align:center;
+ color:#FFFFFF;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.71em;
+ padding-top:0px;
+ background-color:#825963;
+ background-image:url('../images/skin-06/theme-back.jpg');
+}
+
+.footerText {
+ padding-top:4px;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+}
+
+.footerText a {
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:1em;
+ color:#FFFFFF;
+ text-decoration:underline;
+}
+
+.footerText a:link {color: #FFFFFF; text-decoration: underline;}
+.footerText a:visited {color: #FFFFFF; text-decoration: underline;}
+.footerText a:hover {color: #FFFF00; text-decoration: underline;}
+.footerText a:focus {color: #FF0000; text-decoration: underline;}
+.footerText a:active {color: #FF0000; text-decoration: underline; background-color:#FFFF00;}
+
+
+/* ======= UNIVERSAL MAIN-MENU STYLES ======= */
+
+
+.mainMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#825963;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu li {
+ display:inline;
+}
+
+.mainMenu a {
+ float:left;
+ width:90px;
+ color:#FFFFFF;
+ background-color:#825963;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #F7D4DB;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:9pt;
+ font-weight:bold;
+}
+
+.mainMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #F7D4DB;
+ text-align:center;
+ font-size:9pt;
+ font-weight:bold;
+ color:#003333;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-06/deadlink-back.gif');
+}
+
+.mainMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-06/hoverlink-back.gif');
+}
+
+
+/* ======= UNIVERSAL BAR SUB-MENU STYLES ======= */
+
+
+.subMenu {
+ float:left;
+ width:100%;
+ padding:0;
+ margin:0;
+ background-color:#F7D4DB;
+ list-style-type:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu li {
+ display:inline;
+}
+
+.subMenu a {
+ float:left;
+ width:90px;
+ color:#003333;
+ background-color:#F7D4DB;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #825963;
+ text-align:center;
+ text-decoration:none;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+}
+
+.subMenu .deadLink {
+ float:left;
+ width:90px;
+ padding-top:3px;
+ padding-bottom:3px;
+ border-right: 1px solid #825963;
+ text-align:center;
+ color:#003333;
+ background-color:#FFFFFF;
+ background-image:url('../images/skin-06/deadlink-back.gif');
+ background-position: 0px -1px;
+}
+
+.subMenu a:hover{
+ color:#E2393D;
+ background-color:#F9F93A;
+ background-image:url('../images/skin-06/hoverlink-back.gif');
+ background-position: 0px -1px;
+}
+
+
+/* ======= SITE TABLES/BOXES STYLES ======= */
+
+.siteTable {
+ background-color:#825963;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+}
+
+.siteTable .bg0 {
+ background-color:#825963;
+ color:#FFFFFF;
+}
+
+.siteTable .bg1 {
+ background-color:#FFF0FF;
+ color:#003300;
+}
+
+.siteTable .bg2 {
+ background-color:#F7D4DB;
+ color:#003333;
+}
+
+.monoTable {
+ background-color:#825963;
+ font-family:monospace;
+ font-size:10pt;
+}
+
+.monoTable .bg0 {
+ background-color:#825963;
+ color:#FFFFFF;
+}
+
+.monoTable .bg1 {
+ background-color:#FFF0FF;
+ color:#003300;
+}
+
+.monoTable .bg2 {
+ background-color:#F7D4DB;
+ color:#003333;
+}
+
+.themesMenu {
+ display:block;
+ margin:0;
+}
+
+.themesMenu table {
+ background-color:#825963;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:0.7em;
+ text-align:center;
+}
+
+.themesMenu .bg1 td {
+ padding-top:2px;
+ padding-bottom:2px;
+ text-align:center;
+}
+
+.divHeader {
+ text-align:center;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ font-size:0.72em;
+ padding:5px;
+ color:#FFFFFF;
+ border:0;
+ background-color:#825963;
+}
+
+.divData {
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:normal;
+ font-size:0.7em;
+ padding:5px;
+ color:#003300;
+ background-color:#F7D4DB;
+}
+
+.divData a {
+ display:inline;
+ font-size:1em;
+ color:#003300;
+}
+
+.codeBox {
+ font-family:monospace,courier;
+ font-size:9pt;
+ font-weight:normal;
+ color: #003300;
+ background-color:#FFF0FF;
+ border:3px double #825963;
+ padding:7px;
+ margin-bottom:30px;
+}
+
+.dataArea {
+ padding:0;
+ border:4px double #825963;
+ text-align:left;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:10pt;
+ line-height:140%;
+}
+
+.dataArea .subArea1 {
+ padding:16px;
+ background-color:#F7D4DB;
+ color:#000033;
+}
+
+.dataArea .subArea2 {
+ padding:16px;
+ background-color:#FFF0FF;
+ color:#000066;
+}
+
+.dataArea .pseudoLink {
+ display:inline;
+ text-decoration:underline;
+ color:#000000;
+ font-size:10pt;
+ font-weight:normal;
+ cursor:pointer;
+}
+
+.dataArea .pseudoLinkReverse {
+ display:inline;
+ color:#FFFFFF;
+ background-color:#825963;
+ font-size:9.4pt;
+ font-weight:bolder;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+.dataArea hr {
+ height:1px;
+ color:#48486E;
+}
+
+fieldset {
+ display:block;
+ background-color:#FDF3F5;
+ border:2px dotted #825963;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+fieldset legend {
+ color: #275A74;
+ font-family:Geneva,Verdana,Arial,Helvetica,sans-serif;
+ font-variant: small-caps;
+ font-size:11pt;
+ margin-top:10px;
+ padding: .3ex .8ex;
+ border:3px #825963 double;
+ font-weight: bold;
+ background-color:#F7D4DB;
+}
+
+.bankHolsInner {
+ display:block;
+ background-color:#F7D4DB;
+ text-align:center;
+ margin:0 auto;
+ border:#825963 3px double;
+ padding:0.8em;
+}
+
+.bankHolsTitle {
+ font-family:Verdana,Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ font-weight:bolder;
+ color:#275A74;
+ margin-bottom:7px;
+}
+
+.hexRgbOuter {
+ float:left;
+ margin-top:7px;
+ margin-right:20px;
+}
+
+.hexRgbInner {
+ display:block;
+ background-color:#F7D4DB;
+ text-align:center;
+ margin:0 auto;
+ border:#825963 3px double;
+ margin-top:0px;;
+ padding-left:1em;
+ padding-right:1em;
+ padding-bottom:1em;
+}
+
+.multiSearchOuter {
+ text-align:center;
+}
+
+.multiSearchInner {
+ width:440px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-bottom:10px;
+ margin-left:auto;
+ margin-right:auto;
+ background-color:#F7D4DB;
+ border:#825963 3px double;
+}
+
+.multiSearchOuter table {
+ width:400px;
+ text-align:left;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.lineAcross1 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-06/line-horz-1.gif');
+}
+
+.lineAcross2 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-06/line-horz-2.gif');
+}
+
+.lineAcross3 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-06/line-horz-3.gif');
+}
+
+.lineAcross4 {
+ clear:both;
+ display:block;
+ background:url('../images/skin-06/line-horz-4.gif');
+}
+
+.normText {
+ font-family:Arial,Verdana,Geneva,Helvetica,sans-serif;
+ font-size:0.96em;
+ text-align:justify;
+}
+
+.normText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:11pt;
+ text-align:justify;
+ text-decoration:underline;
+}
+
+.normText a:link {color: #275A74; text-decoration: underline;}
+.normText a:visited {color: #009900; text-decoration: underline;}
+.normText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.normText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+
+.demoText {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ text-align:justify;
+}
+
+.demoText a {
+ font-family:Arial,Helvetica,sans-serif;
+ font-weight:bold;
+ text-decoration:underline;
+}
+
+.demoText a:link {color: #003300; text-decoration: underline;}
+.demoText a:visited {color: #003300; text-decoration: underline;}
+.demoText a:hover {color: #CC0000; text-decoration: underline;}
+.normText a:focus {color: #00CC00; text-decoration: underline;}
+.demoText a:active {color: #FF0000; text-decoration: underline; background-color:#000000;}
+
+.demoTextBold {
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:bold;
+ color: #000000;
+ text-align:justify;
+}
+
+.siteMap a {
+ border: 2px solid #FDF3F5;
+}
+
+#fixedBack {
+ background-image:url('../images/skin-06/fixed-back.gif');
+ background-attachment:fixed;
+}
+
+.redNote {
+ font-family:tahoma,arial,sans-serif;
+ font-size:10pt;
+ font-weight:bold;
+ font-style:italic;
+ color: #CC3300;
+ margin-left:15px;
+}
+
+.fancyLink {
+ width:360px;
+ text-align:justify;
+ line-height:0.96em;
+}
+
+.fancyLink a {
+ font-family:arial,helvetica,sans-serif;
+ font-weight:normal;
+ font-size:9pt;
+ color:#990000;
+ text-decoration:none;
+}
+
+.fancyLink em {
+ font-size:9pt;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-weight:bold;
+ font-style:normal;
+ text-transform:none;
+ color:#275A74;
+ text-decoration:underline;
+}
+
+.fancyLink small {
+ font-family:arial,helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:normal;
+ font-style:normal;
+ color:#275A74;
+ text-decoration:underline;
+}
+
+.fancyLink .lineDown {
+ background-color:#825963;
+}
+
+.red {
+ color:#FF0000;
+}
+
+.htmCode {
+ color:#C00000;
+ font-family:courier,monospace;
+}
+
+.cssCode {
+ color:#0033FF;
+ font-family:courier,monospace;
+}
+
+.green {
+ color:#009933;
+ font-family:courier,monospace;
+}
+
+.linksFieldset {
+ width:50%;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+}
+
+.bg0 {
+ background-color:#825963;
+}
+
+.bg1 {
+ background-color:#FFFFFF;
+}
+
+.bold {
+ font-weight:bold;
+}
+
+.boldItalic {
+ font-weight:bolder;
+ font-style:italic;
+}
+
+.italic {
+ font-style:italic;
+}
+
+.inputTitle {
+ margin-top:8px;
+ font-family:Arial,Helvetica,sans-serif;
+ font-size:8pt;
+ font-weight:bold;
+ color:#275A74;
+ text-transform:uppercase;
+}
+
+.editpadImage {
+ display:inline;
+ width:670px;
+ border-left:2px solid #FDF3F5;
+ border-top:2px solid #FDF3F5;
+ border-right:2px dashed #CC0033;
+ border-bottom:2px dashed #CC0033;
+}
+
+#xbitCounter {
+ margin-top:7px;
+ padding-top:2px;
+ padding-bottom:2px;
+ border: 1px solid #825963;
+ background-color:#FDF3F5;
+}
+
+a {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#275A74;
+}
+
+.aiTable {
+ font-family:arial,helvetica,sans-serif;
+ font-size:9pt;
+ color:#275A74;
+}
+
+.aiTable th {
+ font-size:11pt;
+ text-align:left;
+}
+
+.aiTable td {
+ text-align:justify;
+}
+
+.lineDown {
+ background-color:#275A74;
+}
+
+.searchBox {
+ background-color:#F7D4DB;
+ font-family:arial,helvetiva,sans-serif;
+ font-size:0.8em;
+ font-weight:normal;
+ color: #000000;
+ border-right: 2px #666666 solid;
+ border-bottom: 2px #666666 solid;
+ border-top: 1px #cccccc solid;
+ border-left: 1px #cccccc solid;
+}
+
+.searchBox .searchTitle {
+ font-family:'Whimsy TT',fantasy,cursive;
+ font-size:20pt;
+ font-variant:small-caps;
+ color:#000000;
+}
+
+.buttonHi {
+ background-color:#825963;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonHi {
+ width:80px;
+ background-color:#825963;
+ color:#FFFFFF;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.siteButtonLo {
+ width:80px;
+ background-color:#F7D4DB;
+ color:#003333;
+ font-weight:bolder;
+ font-size:9pt;
+ height:23px;
+}
+
+.folderView {
+ display:block;
+ background-image:url('../images/skin-06/folder-2.gif');
+}
diff --git a/docview/docs/codepage_2_unicode_mapping/CP437.TXT b/docview/docs/codepage_2_unicode_mapping/CP437.TXT new file mode 100644 index 00000000..8f74deff --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/CP437.TXT @@ -0,0 +1,274 @@ +# +# Name: cp437_DOSLatinUS to Unicode table +# Unicode version: 2.0 +# Table version: 2.00 +# Table format: Format A +# Date: 04/24/96 +# Contact: Shawn.Steele@microsoft.com +# +# General notes: none +# +# Format: Three tab-separated columns +# Column #1 is the cp437_DOSLatinUS code (in hex) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 is the Unicode name (follows a comment sign, '#') +# +# The entries are in cp437_DOSLatinUS order +# +0x00 0x0000 #NULL +0x01 0x0001 #START OF HEADING +0x02 0x0002 #START OF TEXT +0x03 0x0003 #END OF TEXT +0x04 0x0004 #END OF TRANSMISSION +0x05 0x0005 #ENQUIRY +0x06 0x0006 #ACKNOWLEDGE +0x07 0x0007 #BELL +0x08 0x0008 #BACKSPACE +0x09 0x0009 #HORIZONTAL TABULATION +0x0a 0x000a #LINE FEED +0x0b 0x000b #VERTICAL TABULATION +0x0c 0x000c #FORM FEED +0x0d 0x000d #CARRIAGE RETURN +0x0e 0x000e #SHIFT OUT +0x0f 0x000f #SHIFT IN +0x10 0x0010 #DATA LINK ESCAPE +0x11 0x0011 #DEVICE CONTROL ONE +0x12 0x0012 #DEVICE CONTROL TWO +0x13 0x0013 #DEVICE CONTROL THREE +0x14 0x0014 #DEVICE CONTROL FOUR +0x15 0x0015 #NEGATIVE ACKNOWLEDGE +0x16 0x0016 #SYNCHRONOUS IDLE +0x17 0x0017 #END OF TRANSMISSION BLOCK +0x18 0x0018 #CANCEL +0x19 0x0019 #END OF MEDIUM +0x1a 0x001a #SUBSTITUTE +0x1b 0x001b #ESCAPE +0x1c 0x001c #FILE SEPARATOR +0x1d 0x001d #GROUP SEPARATOR +0x1e 0x001e #RECORD SEPARATOR +0x1f 0x001f #UNIT SEPARATOR +0x20 0x0020 #SPACE +0x21 0x0021 #EXCLAMATION MARK +0x22 0x0022 #QUOTATION MARK +0x23 0x0023 #NUMBER SIGN +0x24 0x0024 #DOLLAR SIGN +0x25 0x0025 #PERCENT SIGN +0x26 0x0026 #AMPERSAND +0x27 0x0027 #APOSTROPHE +0x28 0x0028 #LEFT PARENTHESIS +0x29 0x0029 #RIGHT PARENTHESIS +0x2a 0x002a #ASTERISK +0x2b 0x002b #PLUS SIGN +0x2c 0x002c #COMMA +0x2d 0x002d #HYPHEN-MINUS +0x2e 0x002e #FULL STOP +0x2f 0x002f #SOLIDUS +0x30 0x0030 #DIGIT ZERO +0x31 0x0031 #DIGIT ONE +0x32 0x0032 #DIGIT TWO +0x33 0x0033 #DIGIT THREE +0x34 0x0034 #DIGIT FOUR +0x35 0x0035 #DIGIT FIVE +0x36 0x0036 #DIGIT SIX +0x37 0x0037 #DIGIT SEVEN +0x38 0x0038 #DIGIT EIGHT +0x39 0x0039 #DIGIT NINE +0x3a 0x003a #COLON +0x3b 0x003b #SEMICOLON +0x3c 0x003c #LESS-THAN SIGN +0x3d 0x003d #EQUALS SIGN +0x3e 0x003e #GREATER-THAN SIGN +0x3f 0x003f #QUESTION MARK +0x40 0x0040 #COMMERCIAL AT +0x41 0x0041 #LATIN CAPITAL LETTER A +0x42 0x0042 #LATIN CAPITAL LETTER B +0x43 0x0043 #LATIN CAPITAL LETTER C +0x44 0x0044 #LATIN CAPITAL LETTER D +0x45 0x0045 #LATIN CAPITAL LETTER E +0x46 0x0046 #LATIN CAPITAL LETTER F +0x47 0x0047 #LATIN CAPITAL LETTER G +0x48 0x0048 #LATIN CAPITAL LETTER H +0x49 0x0049 #LATIN CAPITAL LETTER I +0x4a 0x004a #LATIN CAPITAL LETTER J +0x4b 0x004b #LATIN CAPITAL LETTER K +0x4c 0x004c #LATIN CAPITAL LETTER L +0x4d 0x004d #LATIN CAPITAL LETTER M +0x4e 0x004e #LATIN CAPITAL LETTER N +0x4f 0x004f #LATIN CAPITAL LETTER O +0x50 0x0050 #LATIN CAPITAL LETTER P +0x51 0x0051 #LATIN CAPITAL LETTER Q +0x52 0x0052 #LATIN CAPITAL LETTER R +0x53 0x0053 #LATIN CAPITAL LETTER S +0x54 0x0054 #LATIN CAPITAL LETTER T +0x55 0x0055 #LATIN CAPITAL LETTER U +0x56 0x0056 #LATIN CAPITAL LETTER V +0x57 0x0057 #LATIN CAPITAL LETTER W +0x58 0x0058 #LATIN CAPITAL LETTER X +0x59 0x0059 #LATIN CAPITAL LETTER Y +0x5a 0x005a #LATIN CAPITAL LETTER Z +0x5b 0x005b #LEFT SQUARE BRACKET +0x5c 0x005c #REVERSE SOLIDUS +0x5d 0x005d #RIGHT SQUARE BRACKET +0x5e 0x005e #CIRCUMFLEX ACCENT +0x5f 0x005f #LOW LINE +0x60 0x0060 #GRAVE ACCENT +0x61 0x0061 #LATIN SMALL LETTER A +0x62 0x0062 #LATIN SMALL LETTER B +0x63 0x0063 #LATIN SMALL LETTER C +0x64 0x0064 #LATIN SMALL LETTER D +0x65 0x0065 #LATIN SMALL LETTER E +0x66 0x0066 #LATIN SMALL LETTER F +0x67 0x0067 #LATIN SMALL LETTER G +0x68 0x0068 #LATIN SMALL LETTER H +0x69 0x0069 #LATIN SMALL LETTER I +0x6a 0x006a #LATIN SMALL LETTER J +0x6b 0x006b #LATIN SMALL LETTER K +0x6c 0x006c #LATIN SMALL LETTER L +0x6d 0x006d #LATIN SMALL LETTER M +0x6e 0x006e #LATIN SMALL LETTER N +0x6f 0x006f #LATIN SMALL LETTER O +0x70 0x0070 #LATIN SMALL LETTER P +0x71 0x0071 #LATIN SMALL LETTER Q +0x72 0x0072 #LATIN SMALL LETTER R +0x73 0x0073 #LATIN SMALL LETTER S +0x74 0x0074 #LATIN SMALL LETTER T +0x75 0x0075 #LATIN SMALL LETTER U +0x76 0x0076 #LATIN SMALL LETTER V +0x77 0x0077 #LATIN SMALL LETTER W +0x78 0x0078 #LATIN SMALL LETTER X +0x79 0x0079 #LATIN SMALL LETTER Y +0x7a 0x007a #LATIN SMALL LETTER Z +0x7b 0x007b #LEFT CURLY BRACKET +0x7c 0x007c #VERTICAL LINE +0x7d 0x007d #RIGHT CURLY BRACKET +0x7e 0x007e #TILDE +0x7f 0x007f #DELETE +0x80 0x00c7 #LATIN CAPITAL LETTER C WITH CEDILLA +0x81 0x00fc #LATIN SMALL LETTER U WITH DIAERESIS +0x82 0x00e9 #LATIN SMALL LETTER E WITH ACUTE +0x83 0x00e2 #LATIN SMALL LETTER A WITH CIRCUMFLEX +0x84 0x00e4 #LATIN SMALL LETTER A WITH DIAERESIS +0x85 0x00e0 #LATIN SMALL LETTER A WITH GRAVE +0x86 0x00e5 #LATIN SMALL LETTER A WITH RING ABOVE +0x87 0x00e7 #LATIN SMALL LETTER C WITH CEDILLA +0x88 0x00ea #LATIN SMALL LETTER E WITH CIRCUMFLEX +0x89 0x00eb #LATIN SMALL LETTER E WITH DIAERESIS +0x8a 0x00e8 #LATIN SMALL LETTER E WITH GRAVE +0x8b 0x00ef #LATIN SMALL LETTER I WITH DIAERESIS +0x8c 0x00ee #LATIN SMALL LETTER I WITH CIRCUMFLEX +0x8d 0x00ec #LATIN SMALL LETTER I WITH GRAVE +0x8e 0x00c4 #LATIN CAPITAL LETTER A WITH DIAERESIS +0x8f 0x00c5 #LATIN CAPITAL LETTER A WITH RING ABOVE +0x90 0x00c9 #LATIN CAPITAL LETTER E WITH ACUTE +0x91 0x00e6 #LATIN SMALL LIGATURE AE +0x92 0x00c6 #LATIN CAPITAL LIGATURE AE +0x93 0x00f4 #LATIN SMALL LETTER O WITH CIRCUMFLEX +0x94 0x00f6 #LATIN SMALL LETTER O WITH DIAERESIS +0x95 0x00f2 #LATIN SMALL LETTER O WITH GRAVE +0x96 0x00fb #LATIN SMALL LETTER U WITH CIRCUMFLEX +0x97 0x00f9 #LATIN SMALL LETTER U WITH GRAVE +0x98 0x00ff #LATIN SMALL LETTER Y WITH DIAERESIS +0x99 0x00d6 #LATIN CAPITAL LETTER O WITH DIAERESIS +0x9a 0x00dc #LATIN CAPITAL LETTER U WITH DIAERESIS +0x9b 0x00a2 #CENT SIGN +0x9c 0x00a3 #POUND SIGN +0x9d 0x00a5 #YEN SIGN +0x9e 0x20a7 #PESETA SIGN +0x9f 0x0192 #LATIN SMALL LETTER F WITH HOOK +0xa0 0x00e1 #LATIN SMALL LETTER A WITH ACUTE +0xa1 0x00ed #LATIN SMALL LETTER I WITH ACUTE +0xa2 0x00f3 #LATIN SMALL LETTER O WITH ACUTE +0xa3 0x00fa #LATIN SMALL LETTER U WITH ACUTE +0xa4 0x00f1 #LATIN SMALL LETTER N WITH TILDE +0xa5 0x00d1 #LATIN CAPITAL LETTER N WITH TILDE +0xa6 0x00aa #FEMININE ORDINAL INDICATOR +0xa7 0x00ba #MASCULINE ORDINAL INDICATOR +0xa8 0x00bf #INVERTED QUESTION MARK +0xa9 0x2310 #REVERSED NOT SIGN +0xaa 0x00ac #NOT SIGN +0xab 0x00bd #VULGAR FRACTION ONE HALF +0xac 0x00bc #VULGAR FRACTION ONE QUARTER +0xad 0x00a1 #INVERTED EXCLAMATION MARK +0xae 0x00ab #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +0xaf 0x00bb #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +0xb0 0x2591 #LIGHT SHADE +0xb1 0x2592 #MEDIUM SHADE +0xb2 0x2593 #DARK SHADE +0xb3 0x2502 #BOX DRAWINGS LIGHT VERTICAL +0xb4 0x2524 #BOX DRAWINGS LIGHT VERTICAL AND LEFT +0xb5 0x2561 #BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +0xb6 0x2562 #BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +0xb7 0x2556 #BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +0xb8 0x2555 #BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +0xb9 0x2563 #BOX DRAWINGS DOUBLE VERTICAL AND LEFT +0xba 0x2551 #BOX DRAWINGS DOUBLE VERTICAL +0xbb 0x2557 #BOX DRAWINGS DOUBLE DOWN AND LEFT +0xbc 0x255d #BOX DRAWINGS DOUBLE UP AND LEFT +0xbd 0x255c #BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +0xbe 0x255b #BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +0xbf 0x2510 #BOX DRAWINGS LIGHT DOWN AND LEFT +0xc0 0x2514 #BOX DRAWINGS LIGHT UP AND RIGHT +0xc1 0x2534 #BOX DRAWINGS LIGHT UP AND HORIZONTAL +0xc2 0x252c #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0xc3 0x251c #BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0xc4 0x2500 #BOX DRAWINGS LIGHT HORIZONTAL +0xc5 0x253c #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0xc6 0x255e #BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +0xc7 0x255f #BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +0xc8 0x255a #BOX DRAWINGS DOUBLE UP AND RIGHT +0xc9 0x2554 #BOX DRAWINGS DOUBLE DOWN AND RIGHT +0xca 0x2569 #BOX DRAWINGS DOUBLE UP AND HORIZONTAL +0xcb 0x2566 #BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +0xcc 0x2560 #BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +0xcd 0x2550 #BOX DRAWINGS DOUBLE HORIZONTAL +0xce 0x256c #BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +0xcf 0x2567 #BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +0xd0 0x2568 #BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +0xd1 0x2564 #BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +0xd2 0x2565 #BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +0xd3 0x2559 #BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +0xd4 0x2558 #BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +0xd5 0x2552 #BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +0xd6 0x2553 #BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +0xd7 0x256b #BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +0xd8 0x256a #BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +0xd9 0x2518 #BOX DRAWINGS LIGHT UP AND LEFT +0xda 0x250c #BOX DRAWINGS LIGHT DOWN AND RIGHT +0xdb 0x2588 #FULL BLOCK +0xdc 0x2584 #LOWER HALF BLOCK +0xdd 0x258c #LEFT HALF BLOCK +0xde 0x2590 #RIGHT HALF BLOCK +0xdf 0x2580 #UPPER HALF BLOCK +0xe0 0x03b1 #GREEK SMALL LETTER ALPHA +0xe1 0x00df #LATIN SMALL LETTER SHARP S +0xe2 0x0393 #GREEK CAPITAL LETTER GAMMA +0xe3 0x03c0 #GREEK SMALL LETTER PI +0xe4 0x03a3 #GREEK CAPITAL LETTER SIGMA +0xe5 0x03c3 #GREEK SMALL LETTER SIGMA +0xe6 0x00b5 #MICRO SIGN +0xe7 0x03c4 #GREEK SMALL LETTER TAU +0xe8 0x03a6 #GREEK CAPITAL LETTER PHI +0xe9 0x0398 #GREEK CAPITAL LETTER THETA +0xea 0x03a9 #GREEK CAPITAL LETTER OMEGA +0xeb 0x03b4 #GREEK SMALL LETTER DELTA +0xec 0x221e #INFINITY +0xed 0x03c6 #GREEK SMALL LETTER PHI +0xee 0x03b5 #GREEK SMALL LETTER EPSILON +0xef 0x2229 #INTERSECTION +0xf0 0x2261 #IDENTICAL TO +0xf1 0x00b1 #PLUS-MINUS SIGN +0xf2 0x2265 #GREATER-THAN OR EQUAL TO +0xf3 0x2264 #LESS-THAN OR EQUAL TO +0xf4 0x2320 #TOP HALF INTEGRAL +0xf5 0x2321 #BOTTOM HALF INTEGRAL +0xf6 0x00f7 #DIVISION SIGN +0xf7 0x2248 #ALMOST EQUAL TO +0xf8 0x00b0 #DEGREE SIGN +0xf9 0x2219 #BULLET OPERATOR +0xfa 0x00b7 #MIDDLE DOT +0xfb 0x221a #SQUARE ROOT +0xfc 0x207f #SUPERSCRIPT LATIN SMALL LETTER N +0xfd 0x00b2 #SUPERSCRIPT TWO +0xfe 0x25a0 #BLACK SQUARE +0xff 0x00a0 #NO-BREAK SPACE +
\ No newline at end of file diff --git a/docview/docs/codepage_2_unicode_mapping/CP850.TXT b/docview/docs/codepage_2_unicode_mapping/CP850.TXT new file mode 100644 index 00000000..ef47b434 --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/CP850.TXT @@ -0,0 +1,274 @@ +# +# Name: cp850_DOSLatin1 to Unicode table +# Unicode version: 2.0 +# Table version: 2.00 +# Table format: Format A +# Date: 04/24/96 +# Contact: Shawn.Steele@microsoft.com +# +# General notes: none +# +# Format: Three tab-separated columns +# Column #1 is the cp850_DOSLatin1 code (in hex) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 is the Unicode name (follows a comment sign, '#') +# +# The entries are in cp850_DOSLatin1 order +# +0x00 0x0000 #NULL +0x01 0x0001 #START OF HEADING +0x02 0x0002 #START OF TEXT +0x03 0x0003 #END OF TEXT +0x04 0x0004 #END OF TRANSMISSION +0x05 0x0005 #ENQUIRY +0x06 0x0006 #ACKNOWLEDGE +0x07 0x0007 #BELL +0x08 0x0008 #BACKSPACE +0x09 0x0009 #HORIZONTAL TABULATION +0x0a 0x000a #LINE FEED +0x0b 0x000b #VERTICAL TABULATION +0x0c 0x000c #FORM FEED +0x0d 0x000d #CARRIAGE RETURN +0x0e 0x000e #SHIFT OUT +0x0f 0x000f #SHIFT IN +0x10 0x0010 #DATA LINK ESCAPE +0x11 0x0011 #DEVICE CONTROL ONE +0x12 0x0012 #DEVICE CONTROL TWO +0x13 0x0013 #DEVICE CONTROL THREE +0x14 0x0014 #DEVICE CONTROL FOUR +0x15 0x0015 #NEGATIVE ACKNOWLEDGE +0x16 0x0016 #SYNCHRONOUS IDLE +0x17 0x0017 #END OF TRANSMISSION BLOCK +0x18 0x0018 #CANCEL +0x19 0x0019 #END OF MEDIUM +0x1a 0x001a #SUBSTITUTE +0x1b 0x001b #ESCAPE +0x1c 0x001c #FILE SEPARATOR +0x1d 0x001d #GROUP SEPARATOR +0x1e 0x001e #RECORD SEPARATOR +0x1f 0x001f #UNIT SEPARATOR +0x20 0x0020 #SPACE +0x21 0x0021 #EXCLAMATION MARK +0x22 0x0022 #QUOTATION MARK +0x23 0x0023 #NUMBER SIGN +0x24 0x0024 #DOLLAR SIGN +0x25 0x0025 #PERCENT SIGN +0x26 0x0026 #AMPERSAND +0x27 0x0027 #APOSTROPHE +0x28 0x0028 #LEFT PARENTHESIS +0x29 0x0029 #RIGHT PARENTHESIS +0x2a 0x002a #ASTERISK +0x2b 0x002b #PLUS SIGN +0x2c 0x002c #COMMA +0x2d 0x002d #HYPHEN-MINUS +0x2e 0x002e #FULL STOP +0x2f 0x002f #SOLIDUS +0x30 0x0030 #DIGIT ZERO +0x31 0x0031 #DIGIT ONE +0x32 0x0032 #DIGIT TWO +0x33 0x0033 #DIGIT THREE +0x34 0x0034 #DIGIT FOUR +0x35 0x0035 #DIGIT FIVE +0x36 0x0036 #DIGIT SIX +0x37 0x0037 #DIGIT SEVEN +0x38 0x0038 #DIGIT EIGHT +0x39 0x0039 #DIGIT NINE +0x3a 0x003a #COLON +0x3b 0x003b #SEMICOLON +0x3c 0x003c #LESS-THAN SIGN +0x3d 0x003d #EQUALS SIGN +0x3e 0x003e #GREATER-THAN SIGN +0x3f 0x003f #QUESTION MARK +0x40 0x0040 #COMMERCIAL AT +0x41 0x0041 #LATIN CAPITAL LETTER A +0x42 0x0042 #LATIN CAPITAL LETTER B +0x43 0x0043 #LATIN CAPITAL LETTER C +0x44 0x0044 #LATIN CAPITAL LETTER D +0x45 0x0045 #LATIN CAPITAL LETTER E +0x46 0x0046 #LATIN CAPITAL LETTER F +0x47 0x0047 #LATIN CAPITAL LETTER G +0x48 0x0048 #LATIN CAPITAL LETTER H +0x49 0x0049 #LATIN CAPITAL LETTER I +0x4a 0x004a #LATIN CAPITAL LETTER J +0x4b 0x004b #LATIN CAPITAL LETTER K +0x4c 0x004c #LATIN CAPITAL LETTER L +0x4d 0x004d #LATIN CAPITAL LETTER M +0x4e 0x004e #LATIN CAPITAL LETTER N +0x4f 0x004f #LATIN CAPITAL LETTER O +0x50 0x0050 #LATIN CAPITAL LETTER P +0x51 0x0051 #LATIN CAPITAL LETTER Q +0x52 0x0052 #LATIN CAPITAL LETTER R +0x53 0x0053 #LATIN CAPITAL LETTER S +0x54 0x0054 #LATIN CAPITAL LETTER T +0x55 0x0055 #LATIN CAPITAL LETTER U +0x56 0x0056 #LATIN CAPITAL LETTER V +0x57 0x0057 #LATIN CAPITAL LETTER W +0x58 0x0058 #LATIN CAPITAL LETTER X +0x59 0x0059 #LATIN CAPITAL LETTER Y +0x5a 0x005a #LATIN CAPITAL LETTER Z +0x5b 0x005b #LEFT SQUARE BRACKET +0x5c 0x005c #REVERSE SOLIDUS +0x5d 0x005d #RIGHT SQUARE BRACKET +0x5e 0x005e #CIRCUMFLEX ACCENT +0x5f 0x005f #LOW LINE +0x60 0x0060 #GRAVE ACCENT +0x61 0x0061 #LATIN SMALL LETTER A +0x62 0x0062 #LATIN SMALL LETTER B +0x63 0x0063 #LATIN SMALL LETTER C +0x64 0x0064 #LATIN SMALL LETTER D +0x65 0x0065 #LATIN SMALL LETTER E +0x66 0x0066 #LATIN SMALL LETTER F +0x67 0x0067 #LATIN SMALL LETTER G +0x68 0x0068 #LATIN SMALL LETTER H +0x69 0x0069 #LATIN SMALL LETTER I +0x6a 0x006a #LATIN SMALL LETTER J +0x6b 0x006b #LATIN SMALL LETTER K +0x6c 0x006c #LATIN SMALL LETTER L +0x6d 0x006d #LATIN SMALL LETTER M +0x6e 0x006e #LATIN SMALL LETTER N +0x6f 0x006f #LATIN SMALL LETTER O +0x70 0x0070 #LATIN SMALL LETTER P +0x71 0x0071 #LATIN SMALL LETTER Q +0x72 0x0072 #LATIN SMALL LETTER R +0x73 0x0073 #LATIN SMALL LETTER S +0x74 0x0074 #LATIN SMALL LETTER T +0x75 0x0075 #LATIN SMALL LETTER U +0x76 0x0076 #LATIN SMALL LETTER V +0x77 0x0077 #LATIN SMALL LETTER W +0x78 0x0078 #LATIN SMALL LETTER X +0x79 0x0079 #LATIN SMALL LETTER Y +0x7a 0x007a #LATIN SMALL LETTER Z +0x7b 0x007b #LEFT CURLY BRACKET +0x7c 0x007c #VERTICAL LINE +0x7d 0x007d #RIGHT CURLY BRACKET +0x7e 0x007e #TILDE +0x7f 0x007f #DELETE +0x80 0x00c7 #LATIN CAPITAL LETTER C WITH CEDILLA +0x81 0x00fc #LATIN SMALL LETTER U WITH DIAERESIS +0x82 0x00e9 #LATIN SMALL LETTER E WITH ACUTE +0x83 0x00e2 #LATIN SMALL LETTER A WITH CIRCUMFLEX +0x84 0x00e4 #LATIN SMALL LETTER A WITH DIAERESIS +0x85 0x00e0 #LATIN SMALL LETTER A WITH GRAVE +0x86 0x00e5 #LATIN SMALL LETTER A WITH RING ABOVE +0x87 0x00e7 #LATIN SMALL LETTER C WITH CEDILLA +0x88 0x00ea #LATIN SMALL LETTER E WITH CIRCUMFLEX +0x89 0x00eb #LATIN SMALL LETTER E WITH DIAERESIS +0x8a 0x00e8 #LATIN SMALL LETTER E WITH GRAVE +0x8b 0x00ef #LATIN SMALL LETTER I WITH DIAERESIS +0x8c 0x00ee #LATIN SMALL LETTER I WITH CIRCUMFLEX +0x8d 0x00ec #LATIN SMALL LETTER I WITH GRAVE +0x8e 0x00c4 #LATIN CAPITAL LETTER A WITH DIAERESIS +0x8f 0x00c5 #LATIN CAPITAL LETTER A WITH RING ABOVE +0x90 0x00c9 #LATIN CAPITAL LETTER E WITH ACUTE +0x91 0x00e6 #LATIN SMALL LIGATURE AE +0x92 0x00c6 #LATIN CAPITAL LIGATURE AE +0x93 0x00f4 #LATIN SMALL LETTER O WITH CIRCUMFLEX +0x94 0x00f6 #LATIN SMALL LETTER O WITH DIAERESIS +0x95 0x00f2 #LATIN SMALL LETTER O WITH GRAVE +0x96 0x00fb #LATIN SMALL LETTER U WITH CIRCUMFLEX +0x97 0x00f9 #LATIN SMALL LETTER U WITH GRAVE +0x98 0x00ff #LATIN SMALL LETTER Y WITH DIAERESIS +0x99 0x00d6 #LATIN CAPITAL LETTER O WITH DIAERESIS +0x9a 0x00dc #LATIN CAPITAL LETTER U WITH DIAERESIS +0x9b 0x00f8 #LATIN SMALL LETTER O WITH STROKE +0x9c 0x00a3 #POUND SIGN +0x9d 0x00d8 #LATIN CAPITAL LETTER O WITH STROKE +0x9e 0x00d7 #MULTIPLICATION SIGN +0x9f 0x0192 #LATIN SMALL LETTER F WITH HOOK +0xa0 0x00e1 #LATIN SMALL LETTER A WITH ACUTE +0xa1 0x00ed #LATIN SMALL LETTER I WITH ACUTE +0xa2 0x00f3 #LATIN SMALL LETTER O WITH ACUTE +0xa3 0x00fa #LATIN SMALL LETTER U WITH ACUTE +0xa4 0x00f1 #LATIN SMALL LETTER N WITH TILDE +0xa5 0x00d1 #LATIN CAPITAL LETTER N WITH TILDE +0xa6 0x00aa #FEMININE ORDINAL INDICATOR +0xa7 0x00ba #MASCULINE ORDINAL INDICATOR +0xa8 0x00bf #INVERTED QUESTION MARK +0xa9 0x00ae #REGISTERED SIGN +0xaa 0x00ac #NOT SIGN +0xab 0x00bd #VULGAR FRACTION ONE HALF +0xac 0x00bc #VULGAR FRACTION ONE QUARTER +0xad 0x00a1 #INVERTED EXCLAMATION MARK +0xae 0x00ab #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +0xaf 0x00bb #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +0xb0 0x2591 #LIGHT SHADE +0xb1 0x2592 #MEDIUM SHADE +0xb2 0x2593 #DARK SHADE +0xb3 0x2502 #BOX DRAWINGS LIGHT VERTICAL +0xb4 0x2524 #BOX DRAWINGS LIGHT VERTICAL AND LEFT +0xb5 0x00c1 #LATIN CAPITAL LETTER A WITH ACUTE +0xb6 0x00c2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX +0xb7 0x00c0 #LATIN CAPITAL LETTER A WITH GRAVE +0xb8 0x00a9 #COPYRIGHT SIGN +0xb9 0x2563 #BOX DRAWINGS DOUBLE VERTICAL AND LEFT +0xba 0x2551 #BOX DRAWINGS DOUBLE VERTICAL +0xbb 0x2557 #BOX DRAWINGS DOUBLE DOWN AND LEFT +0xbc 0x255d #BOX DRAWINGS DOUBLE UP AND LEFT +0xbd 0x00a2 #CENT SIGN +0xbe 0x00a5 #YEN SIGN +0xbf 0x2510 #BOX DRAWINGS LIGHT DOWN AND LEFT +0xc0 0x2514 #BOX DRAWINGS LIGHT UP AND RIGHT +0xc1 0x2534 #BOX DRAWINGS LIGHT UP AND HORIZONTAL +0xc2 0x252c #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0xc3 0x251c #BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0xc4 0x2500 #BOX DRAWINGS LIGHT HORIZONTAL +0xc5 0x253c #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0xc6 0x00e3 #LATIN SMALL LETTER A WITH TILDE +0xc7 0x00c3 #LATIN CAPITAL LETTER A WITH TILDE +0xc8 0x255a #BOX DRAWINGS DOUBLE UP AND RIGHT +0xc9 0x2554 #BOX DRAWINGS DOUBLE DOWN AND RIGHT +0xca 0x2569 #BOX DRAWINGS DOUBLE UP AND HORIZONTAL +0xcb 0x2566 #BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +0xcc 0x2560 #BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +0xcd 0x2550 #BOX DRAWINGS DOUBLE HORIZONTAL +0xce 0x256c #BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +0xcf 0x00a4 #CURRENCY SIGN +0xd0 0x00f0 #LATIN SMALL LETTER ETH +0xd1 0x00d0 #LATIN CAPITAL LETTER ETH +0xd2 0x00ca #LATIN CAPITAL LETTER E WITH CIRCUMFLEX +0xd3 0x00cb #LATIN CAPITAL LETTER E WITH DIAERESIS +0xd4 0x00c8 #LATIN CAPITAL LETTER E WITH GRAVE +0xd5 0x0131 #LATIN SMALL LETTER DOTLESS I +0xd6 0x00cd #LATIN CAPITAL LETTER I WITH ACUTE +0xd7 0x00ce #LATIN CAPITAL LETTER I WITH CIRCUMFLEX +0xd8 0x00cf #LATIN CAPITAL LETTER I WITH DIAERESIS +0xd9 0x2518 #BOX DRAWINGS LIGHT UP AND LEFT +0xda 0x250c #BOX DRAWINGS LIGHT DOWN AND RIGHT +0xdb 0x2588 #FULL BLOCK +0xdc 0x2584 #LOWER HALF BLOCK +0xdd 0x00a6 #BROKEN BAR +0xde 0x00cc #LATIN CAPITAL LETTER I WITH GRAVE +0xdf 0x2580 #UPPER HALF BLOCK +0xe0 0x00d3 #LATIN CAPITAL LETTER O WITH ACUTE +0xe1 0x00df #LATIN SMALL LETTER SHARP S +0xe2 0x00d4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX +0xe3 0x00d2 #LATIN CAPITAL LETTER O WITH GRAVE +0xe4 0x00f5 #LATIN SMALL LETTER O WITH TILDE +0xe5 0x00d5 #LATIN CAPITAL LETTER O WITH TILDE +0xe6 0x00b5 #MICRO SIGN +0xe7 0x00fe #LATIN SMALL LETTER THORN +0xe8 0x00de #LATIN CAPITAL LETTER THORN +0xe9 0x00da #LATIN CAPITAL LETTER U WITH ACUTE +0xea 0x00db #LATIN CAPITAL LETTER U WITH CIRCUMFLEX +0xeb 0x00d9 #LATIN CAPITAL LETTER U WITH GRAVE +0xec 0x00fd #LATIN SMALL LETTER Y WITH ACUTE +0xed 0x00dd #LATIN CAPITAL LETTER Y WITH ACUTE +0xee 0x00af #MACRON +0xef 0x00b4 #ACUTE ACCENT +0xf0 0x00ad #SOFT HYPHEN +0xf1 0x00b1 #PLUS-MINUS SIGN +0xf2 0x2017 #DOUBLE LOW LINE +0xf3 0x00be #VULGAR FRACTION THREE QUARTERS +0xf4 0x00b6 #PILCROW SIGN +0xf5 0x00a7 #SECTION SIGN +0xf6 0x00f7 #DIVISION SIGN +0xf7 0x00b8 #CEDILLA +0xf8 0x00b0 #DEGREE SIGN +0xf9 0x00a8 #DIAERESIS +0xfa 0x00b7 #MIDDLE DOT +0xfb 0x00b9 #SUPERSCRIPT ONE +0xfc 0x00b3 #SUPERSCRIPT THREE +0xfd 0x00b2 #SUPERSCRIPT TWO +0xfe 0x25a0 #BLACK SQUARE +0xff 0x00a0 #NO-BREAK SPACE +
\ No newline at end of file diff --git a/docview/docs/codepage_2_unicode_mapping/CP860.TXT b/docview/docs/codepage_2_unicode_mapping/CP860.TXT new file mode 100644 index 00000000..64e93780 --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/CP860.TXT @@ -0,0 +1,275 @@ +# +# Name: cp860_DOSPortuguese to Unicode table +# Unicode version: 2.0 +# Table version: 2.00 +# Table format: Format A +# Date: 04/24/96 +# Contact: Shawn.Steele@microsoft.com +# +# General notes: none +# +# Format: Three tab-separated columns +# Column #1 is the cp860_DOSPortuguese code (in hex) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 is the Unicode name (follows a comment sign, '#') +# +# The entries are in cp860_DOSPortuguese order +# +0x00 0x0000 #NULL +0x01 0x0001 #START OF HEADING +0x02 0x0002 #START OF TEXT +0x03 0x0003 #END OF TEXT +0x04 0x0004 #END OF TRANSMISSION +0x05 0x0005 #ENQUIRY +0x06 0x0006 #ACKNOWLEDGE +0x07 0x0007 #BELL +0x08 0x0008 #BACKSPACE +0x09 0x0009 #HORIZONTAL TABULATION +0x0a 0x000a #LINE FEED +0x0b 0x000b #VERTICAL TABULATION +0x0c 0x000c #FORM FEED +0x0d 0x000d #CARRIAGE RETURN +0x0e 0x000e #SHIFT OUT +0x0f 0x000f #SHIFT IN +0x10 0x0010 #DATA LINK ESCAPE +0x11 0x0011 #DEVICE CONTROL ONE +0x12 0x0012 #DEVICE CONTROL TWO +0x13 0x0013 #DEVICE CONTROL THREE +0x14 0x0014 #DEVICE CONTROL FOUR +0x15 0x0015 #NEGATIVE ACKNOWLEDGE +0x16 0x0016 #SYNCHRONOUS IDLE +0x17 0x0017 #END OF TRANSMISSION BLOCK +0x18 0x0018 #CANCEL +0x19 0x0019 #END OF MEDIUM +0x1a 0x001a #SUBSTITUTE +0x1b 0x001b #ESCAPE +0x1c 0x001c #FILE SEPARATOR +0x1d 0x001d #GROUP SEPARATOR +0x1e 0x001e #RECORD SEPARATOR +0x1f 0x001f #UNIT SEPARATOR +0x20 0x0020 #SPACE +0x21 0x0021 #EXCLAMATION MARK +0x22 0x0022 #QUOTATION MARK +0x23 0x0023 #NUMBER SIGN +0x24 0x0024 #DOLLAR SIGN +0x25 0x0025 #PERCENT SIGN +0x26 0x0026 #AMPERSAND +0x27 0x0027 #APOSTROPHE +0x28 0x0028 #LEFT PARENTHESIS +0x29 0x0029 #RIGHT PARENTHESIS +0x2a 0x002a #ASTERISK +0x2b 0x002b #PLUS SIGN +0x2c 0x002c #COMMA +0x2d 0x002d #HYPHEN-MINUS +0x2e 0x002e #FULL STOP +0x2f 0x002f #SOLIDUS +0x30 0x0030 #DIGIT ZERO +0x31 0x0031 #DIGIT ONE +0x32 0x0032 #DIGIT TWO +0x33 0x0033 #DIGIT THREE +0x34 0x0034 #DIGIT FOUR +0x35 0x0035 #DIGIT FIVE +0x36 0x0036 #DIGIT SIX +0x37 0x0037 #DIGIT SEVEN +0x38 0x0038 #DIGIT EIGHT +0x39 0x0039 #DIGIT NINE +0x3a 0x003a #COLON +0x3b 0x003b #SEMICOLON +0x3c 0x003c #LESS-THAN SIGN +0x3d 0x003d #EQUALS SIGN +0x3e 0x003e #GREATER-THAN SIGN +0x3f 0x003f #QUESTION MARK +0x40 0x0040 #COMMERCIAL AT +0x41 0x0041 #LATIN CAPITAL LETTER A +0x42 0x0042 #LATIN CAPITAL LETTER B +0x43 0x0043 #LATIN CAPITAL LETTER C +0x44 0x0044 #LATIN CAPITAL LETTER D +0x45 0x0045 #LATIN CAPITAL LETTER E +0x46 0x0046 #LATIN CAPITAL LETTER F +0x47 0x0047 #LATIN CAPITAL LETTER G +0x48 0x0048 #LATIN CAPITAL LETTER H +0x49 0x0049 #LATIN CAPITAL LETTER I +0x4a 0x004a #LATIN CAPITAL LETTER J +0x4b 0x004b #LATIN CAPITAL LETTER K +0x4c 0x004c #LATIN CAPITAL LETTER L +0x4d 0x004d #LATIN CAPITAL LETTER M +0x4e 0x004e #LATIN CAPITAL LETTER N +0x4f 0x004f #LATIN CAPITAL LETTER O +0x50 0x0050 #LATIN CAPITAL LETTER P +0x51 0x0051 #LATIN CAPITAL LETTER Q +0x52 0x0052 #LATIN CAPITAL LETTER R +0x53 0x0053 #LATIN CAPITAL LETTER S +0x54 0x0054 #LATIN CAPITAL LETTER T +0x55 0x0055 #LATIN CAPITAL LETTER U +0x56 0x0056 #LATIN CAPITAL LETTER V +0x57 0x0057 #LATIN CAPITAL LETTER W +0x58 0x0058 #LATIN CAPITAL LETTER X +0x59 0x0059 #LATIN CAPITAL LETTER Y +0x5a 0x005a #LATIN CAPITAL LETTER Z +0x5b 0x005b #LEFT SQUARE BRACKET +0x5c 0x005c #REVERSE SOLIDUS +0x5d 0x005d #RIGHT SQUARE BRACKET +0x5e 0x005e #CIRCUMFLEX ACCENT +0x5f 0x005f #LOW LINE +0x60 0x0060 #GRAVE ACCENT +0x61 0x0061 #LATIN SMALL LETTER A +0x62 0x0062 #LATIN SMALL LETTER B +0x63 0x0063 #LATIN SMALL LETTER C +0x64 0x0064 #LATIN SMALL LETTER D +0x65 0x0065 #LATIN SMALL LETTER E +0x66 0x0066 #LATIN SMALL LETTER F +0x67 0x0067 #LATIN SMALL LETTER G +0x68 0x0068 #LATIN SMALL LETTER H +0x69 0x0069 #LATIN SMALL LETTER I +0x6a 0x006a #LATIN SMALL LETTER J +0x6b 0x006b #LATIN SMALL LETTER K +0x6c 0x006c #LATIN SMALL LETTER L +0x6d 0x006d #LATIN SMALL LETTER M +0x6e 0x006e #LATIN SMALL LETTER N +0x6f 0x006f #LATIN SMALL LETTER O +0x70 0x0070 #LATIN SMALL LETTER P +0x71 0x0071 #LATIN SMALL LETTER Q +0x72 0x0072 #LATIN SMALL LETTER R +0x73 0x0073 #LATIN SMALL LETTER S +0x74 0x0074 #LATIN SMALL LETTER T +0x75 0x0075 #LATIN SMALL LETTER U +0x76 0x0076 #LATIN SMALL LETTER V +0x77 0x0077 #LATIN SMALL LETTER W +0x78 0x0078 #LATIN SMALL LETTER X +0x79 0x0079 #LATIN SMALL LETTER Y +0x7a 0x007a #LATIN SMALL LETTER Z +0x7b 0x007b #LEFT CURLY BRACKET +0x7c 0x007c #VERTICAL LINE +0x7d 0x007d #RIGHT CURLY BRACKET +0x7e 0x007e #TILDE +0x7f 0x007f #DELETE +0x80 0x00c7 #LATIN CAPITAL LETTER C WITH CEDILLA +0x81 0x00fc #LATIN SMALL LETTER U WITH DIAERESIS +0x82 0x00e9 #LATIN SMALL LETTER E WITH ACUTE +0x83 0x00e2 #LATIN SMALL LETTER A WITH CIRCUMFLEX +0x84 0x00e3 #LATIN SMALL LETTER A WITH TILDE +0x85 0x00e0 #LATIN SMALL LETTER A WITH GRAVE +0x86 0x00c1 #LATIN CAPITAL LETTER A WITH ACUTE +0x87 0x00e7 #LATIN SMALL LETTER C WITH CEDILLA +0x88 0x00ea #LATIN SMALL LETTER E WITH CIRCUMFLEX +0x89 0x00ca #LATIN CAPITAL LETTER E WITH CIRCUMFLEX +0x8a 0x00e8 #LATIN SMALL LETTER E WITH GRAVE +0x8b 0x00cd #LATIN CAPITAL LETTER I WITH ACUTE +0x8c 0x00d4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX +0x8d 0x00ec #LATIN SMALL LETTER I WITH GRAVE +0x8e 0x00c3 #LATIN CAPITAL LETTER A WITH TILDE +0x8f 0x00c2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX +0x90 0x00c9 #LATIN CAPITAL LETTER E WITH ACUTE +0x91 0x00c0 #LATIN CAPITAL LETTER A WITH GRAVE +0x92 0x00c8 #LATIN CAPITAL LETTER E WITH GRAVE +0x93 0x00f4 #LATIN SMALL LETTER O WITH CIRCUMFLEX +0x94 0x00f5 #LATIN SMALL LETTER O WITH TILDE +0x95 0x00f2 #LATIN SMALL LETTER O WITH GRAVE +0x96 0x00da #LATIN CAPITAL LETTER U WITH ACUTE +0x97 0x00f9 #LATIN SMALL LETTER U WITH GRAVE +0x98 0x00cc #LATIN CAPITAL LETTER I WITH GRAVE +0x99 0x00d5 #LATIN CAPITAL LETTER O WITH TILDE +0x9a 0x00dc #LATIN CAPITAL LETTER U WITH DIAERESIS +0x9b 0x00a2 #CENT SIGN +0x9c 0x00a3 #POUND SIGN +0x9d 0x00d9 #LATIN CAPITAL LETTER U WITH GRAVE +0x9e 0x20a7 #PESETA SIGN +0x9f 0x00d3 #LATIN CAPITAL LETTER O WITH ACUTE +0xa0 0x00e1 #LATIN SMALL LETTER A WITH ACUTE +0xa1 0x00ed #LATIN SMALL LETTER I WITH ACUTE +0xa2 0x00f3 #LATIN SMALL LETTER O WITH ACUTE +0xa3 0x00fa #LATIN SMALL LETTER U WITH ACUTE +0xa4 0x00f1 #LATIN SMALL LETTER N WITH TILDE +0xa5 0x00d1 #LATIN CAPITAL LETTER N WITH TILDE +0xa6 0x00aa #FEMININE ORDINAL INDICATOR +0xa7 0x00ba #MASCULINE ORDINAL INDICATOR +0xa8 0x00bf #INVERTED QUESTION MARK +0xa9 0x00d2 #LATIN CAPITAL LETTER O WITH GRAVE +0xaa 0x00ac #NOT SIGN +0xab 0x00bd #VULGAR FRACTION ONE HALF +0xac 0x00bc #VULGAR FRACTION ONE QUARTER +0xad 0x00a1 #INVERTED EXCLAMATION MARK +0xae 0x00ab #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +0xaf 0x00bb #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +0xb0 0x2591 #LIGHT SHADE +0xb1 0x2592 #MEDIUM SHADE +0xb2 0x2593 #DARK SHADE +0xb3 0x2502 #BOX DRAWINGS LIGHT VERTICAL +0xb4 0x2524 #BOX DRAWINGS LIGHT VERTICAL AND LEFT +0xb5 0x2561 #BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +0xb6 0x2562 #BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +0xb7 0x2556 #BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +0xb8 0x2555 #BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +0xb9 0x2563 #BOX DRAWINGS DOUBLE VERTICAL AND LEFT +0xba 0x2551 #BOX DRAWINGS DOUBLE VERTICAL +0xbb 0x2557 #BOX DRAWINGS DOUBLE DOWN AND LEFT +0xbc 0x255d #BOX DRAWINGS DOUBLE UP AND LEFT +0xbd 0x255c #BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +0xbe 0x255b #BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +0xbf 0x2510 #BOX DRAWINGS LIGHT DOWN AND LEFT +0xc0 0x2514 #BOX DRAWINGS LIGHT UP AND RIGHT +0xc1 0x2534 #BOX DRAWINGS LIGHT UP AND HORIZONTAL +0xc2 0x252c #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0xc3 0x251c #BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0xc4 0x2500 #BOX DRAWINGS LIGHT HORIZONTAL +0xc5 0x253c #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0xc6 0x255e #BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +0xc7 0x255f #BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +0xc8 0x255a #BOX DRAWINGS DOUBLE UP AND RIGHT +0xc9 0x2554 #BOX DRAWINGS DOUBLE DOWN AND RIGHT +0xca 0x2569 #BOX DRAWINGS DOUBLE UP AND HORIZONTAL +0xcb 0x2566 #BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +0xcc 0x2560 #BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +0xcd 0x2550 #BOX DRAWINGS DOUBLE HORIZONTAL +0xce 0x256c #BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +0xcf 0x2567 #BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +0xd0 0x2568 #BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +0xd1 0x2564 #BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +0xd2 0x2565 #BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +0xd3 0x2559 #BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +0xd4 0x2558 #BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +0xd5 0x2552 #BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +0xd6 0x2553 #BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +0xd7 0x256b #BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +0xd8 0x256a #BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +0xd9 0x2518 #BOX DRAWINGS LIGHT UP AND LEFT +0xda 0x250c #BOX DRAWINGS LIGHT DOWN AND RIGHT +0xdb 0x2588 #FULL BLOCK +0xdc 0x2584 #LOWER HALF BLOCK +0xdd 0x258c #LEFT HALF BLOCK +0xde 0x2590 #RIGHT HALF BLOCK +0xdf 0x2580 #UPPER HALF BLOCK +0xe0 0x03b1 #GREEK SMALL LETTER ALPHA +0xe1 0x00df #LATIN SMALL LETTER SHARP S +0xe2 0x0393 #GREEK CAPITAL LETTER GAMMA +0xe3 0x03c0 #GREEK SMALL LETTER PI +0xe4 0x03a3 #GREEK CAPITAL LETTER SIGMA +0xe5 0x03c3 #GREEK SMALL LETTER SIGMA +0xe6 0x00b5 #MICRO SIGN +0xe7 0x03c4 #GREEK SMALL LETTER TAU +0xe8 0x03a6 #GREEK CAPITAL LETTER PHI +0xe9 0x0398 #GREEK CAPITAL LETTER THETA +0xea 0x03a9 #GREEK CAPITAL LETTER OMEGA +0xeb 0x03b4 #GREEK SMALL LETTER DELTA +0xec 0x221e #INFINITY +0xed 0x03c6 #GREEK SMALL LETTER PHI +0xee 0x03b5 #GREEK SMALL LETTER EPSILON +0xef 0x2229 #INTERSECTION +0xf0 0x2261 #IDENTICAL TO +0xf1 0x00b1 #PLUS-MINUS SIGN +0xf2 0x2265 #GREATER-THAN OR EQUAL TO +0xf3 0x2264 #LESS-THAN OR EQUAL TO +0xf4 0x2320 #TOP HALF INTEGRAL +0xf5 0x2321 #BOTTOM HALF INTEGRAL +0xf6 0x00f7 #DIVISION SIGN +0xf7 0x2248 #ALMOST EQUAL TO +0xf8 0x00b0 #DEGREE SIGN +0xf9 0x2219 #BULLET OPERATOR +0xfa 0x00b7 #MIDDLE DOT +0xfb 0x221a #SQUARE ROOT +0xfc 0x207f #SUPERSCRIPT LATIN SMALL LETTER N +0xfd 0x00b2 #SUPERSCRIPT TWO +0xfe 0x25a0 #BLACK SQUARE +0xff 0x00a0 #NO-BREAK SPACE + +
\ No newline at end of file diff --git a/docview/docs/codepage_2_unicode_mapping/CP863.TXT b/docview/docs/codepage_2_unicode_mapping/CP863.TXT new file mode 100644 index 00000000..19f3e8b5 --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/CP863.TXT @@ -0,0 +1,275 @@ +# +# Name: cp863_DOSCanadaF to Unicode table +# Unicode version: 2.0 +# Table version: 2.00 +# Table format: Format A +# Date: 04/24/96 +# Contact: Shawn.Steele@microsoft.com +# +# General notes: none +# +# Format: Three tab-separated columns +# Column #1 is the cp863_DOSCanadaF code (in hex) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 is the Unicode name (follows a comment sign, '#') +# +# The entries are in cp863_DOSCanadaF order +# +0x00 0x0000 #NULL +0x01 0x0001 #START OF HEADING +0x02 0x0002 #START OF TEXT +0x03 0x0003 #END OF TEXT +0x04 0x0004 #END OF TRANSMISSION +0x05 0x0005 #ENQUIRY +0x06 0x0006 #ACKNOWLEDGE +0x07 0x0007 #BELL +0x08 0x0008 #BACKSPACE +0x09 0x0009 #HORIZONTAL TABULATION +0x0a 0x000a #LINE FEED +0x0b 0x000b #VERTICAL TABULATION +0x0c 0x000c #FORM FEED +0x0d 0x000d #CARRIAGE RETURN +0x0e 0x000e #SHIFT OUT +0x0f 0x000f #SHIFT IN +0x10 0x0010 #DATA LINK ESCAPE +0x11 0x0011 #DEVICE CONTROL ONE +0x12 0x0012 #DEVICE CONTROL TWO +0x13 0x0013 #DEVICE CONTROL THREE +0x14 0x0014 #DEVICE CONTROL FOUR +0x15 0x0015 #NEGATIVE ACKNOWLEDGE +0x16 0x0016 #SYNCHRONOUS IDLE +0x17 0x0017 #END OF TRANSMISSION BLOCK +0x18 0x0018 #CANCEL +0x19 0x0019 #END OF MEDIUM +0x1a 0x001a #SUBSTITUTE +0x1b 0x001b #ESCAPE +0x1c 0x001c #FILE SEPARATOR +0x1d 0x001d #GROUP SEPARATOR +0x1e 0x001e #RECORD SEPARATOR +0x1f 0x001f #UNIT SEPARATOR +0x20 0x0020 #SPACE +0x21 0x0021 #EXCLAMATION MARK +0x22 0x0022 #QUOTATION MARK +0x23 0x0023 #NUMBER SIGN +0x24 0x0024 #DOLLAR SIGN +0x25 0x0025 #PERCENT SIGN +0x26 0x0026 #AMPERSAND +0x27 0x0027 #APOSTROPHE +0x28 0x0028 #LEFT PARENTHESIS +0x29 0x0029 #RIGHT PARENTHESIS +0x2a 0x002a #ASTERISK +0x2b 0x002b #PLUS SIGN +0x2c 0x002c #COMMA +0x2d 0x002d #HYPHEN-MINUS +0x2e 0x002e #FULL STOP +0x2f 0x002f #SOLIDUS +0x30 0x0030 #DIGIT ZERO +0x31 0x0031 #DIGIT ONE +0x32 0x0032 #DIGIT TWO +0x33 0x0033 #DIGIT THREE +0x34 0x0034 #DIGIT FOUR +0x35 0x0035 #DIGIT FIVE +0x36 0x0036 #DIGIT SIX +0x37 0x0037 #DIGIT SEVEN +0x38 0x0038 #DIGIT EIGHT +0x39 0x0039 #DIGIT NINE +0x3a 0x003a #COLON +0x3b 0x003b #SEMICOLON +0x3c 0x003c #LESS-THAN SIGN +0x3d 0x003d #EQUALS SIGN +0x3e 0x003e #GREATER-THAN SIGN +0x3f 0x003f #QUESTION MARK +0x40 0x0040 #COMMERCIAL AT +0x41 0x0041 #LATIN CAPITAL LETTER A +0x42 0x0042 #LATIN CAPITAL LETTER B +0x43 0x0043 #LATIN CAPITAL LETTER C +0x44 0x0044 #LATIN CAPITAL LETTER D +0x45 0x0045 #LATIN CAPITAL LETTER E +0x46 0x0046 #LATIN CAPITAL LETTER F +0x47 0x0047 #LATIN CAPITAL LETTER G +0x48 0x0048 #LATIN CAPITAL LETTER H +0x49 0x0049 #LATIN CAPITAL LETTER I +0x4a 0x004a #LATIN CAPITAL LETTER J +0x4b 0x004b #LATIN CAPITAL LETTER K +0x4c 0x004c #LATIN CAPITAL LETTER L +0x4d 0x004d #LATIN CAPITAL LETTER M +0x4e 0x004e #LATIN CAPITAL LETTER N +0x4f 0x004f #LATIN CAPITAL LETTER O +0x50 0x0050 #LATIN CAPITAL LETTER P +0x51 0x0051 #LATIN CAPITAL LETTER Q +0x52 0x0052 #LATIN CAPITAL LETTER R +0x53 0x0053 #LATIN CAPITAL LETTER S +0x54 0x0054 #LATIN CAPITAL LETTER T +0x55 0x0055 #LATIN CAPITAL LETTER U +0x56 0x0056 #LATIN CAPITAL LETTER V +0x57 0x0057 #LATIN CAPITAL LETTER W +0x58 0x0058 #LATIN CAPITAL LETTER X +0x59 0x0059 #LATIN CAPITAL LETTER Y +0x5a 0x005a #LATIN CAPITAL LETTER Z +0x5b 0x005b #LEFT SQUARE BRACKET +0x5c 0x005c #REVERSE SOLIDUS +0x5d 0x005d #RIGHT SQUARE BRACKET +0x5e 0x005e #CIRCUMFLEX ACCENT +0x5f 0x005f #LOW LINE +0x60 0x0060 #GRAVE ACCENT +0x61 0x0061 #LATIN SMALL LETTER A +0x62 0x0062 #LATIN SMALL LETTER B +0x63 0x0063 #LATIN SMALL LETTER C +0x64 0x0064 #LATIN SMALL LETTER D +0x65 0x0065 #LATIN SMALL LETTER E +0x66 0x0066 #LATIN SMALL LETTER F +0x67 0x0067 #LATIN SMALL LETTER G +0x68 0x0068 #LATIN SMALL LETTER H +0x69 0x0069 #LATIN SMALL LETTER I +0x6a 0x006a #LATIN SMALL LETTER J +0x6b 0x006b #LATIN SMALL LETTER K +0x6c 0x006c #LATIN SMALL LETTER L +0x6d 0x006d #LATIN SMALL LETTER M +0x6e 0x006e #LATIN SMALL LETTER N +0x6f 0x006f #LATIN SMALL LETTER O +0x70 0x0070 #LATIN SMALL LETTER P +0x71 0x0071 #LATIN SMALL LETTER Q +0x72 0x0072 #LATIN SMALL LETTER R +0x73 0x0073 #LATIN SMALL LETTER S +0x74 0x0074 #LATIN SMALL LETTER T +0x75 0x0075 #LATIN SMALL LETTER U +0x76 0x0076 #LATIN SMALL LETTER V +0x77 0x0077 #LATIN SMALL LETTER W +0x78 0x0078 #LATIN SMALL LETTER X +0x79 0x0079 #LATIN SMALL LETTER Y +0x7a 0x007a #LATIN SMALL LETTER Z +0x7b 0x007b #LEFT CURLY BRACKET +0x7c 0x007c #VERTICAL LINE +0x7d 0x007d #RIGHT CURLY BRACKET +0x7e 0x007e #TILDE +0x7f 0x007f #DELETE +0x80 0x00c7 #LATIN CAPITAL LETTER C WITH CEDILLA +0x81 0x00fc #LATIN SMALL LETTER U WITH DIAERESIS +0x82 0x00e9 #LATIN SMALL LETTER E WITH ACUTE +0x83 0x00e2 #LATIN SMALL LETTER A WITH CIRCUMFLEX +0x84 0x00c2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX +0x85 0x00e0 #LATIN SMALL LETTER A WITH GRAVE +0x86 0x00b6 #PILCROW SIGN +0x87 0x00e7 #LATIN SMALL LETTER C WITH CEDILLA +0x88 0x00ea #LATIN SMALL LETTER E WITH CIRCUMFLEX +0x89 0x00eb #LATIN SMALL LETTER E WITH DIAERESIS +0x8a 0x00e8 #LATIN SMALL LETTER E WITH GRAVE +0x8b 0x00ef #LATIN SMALL LETTER I WITH DIAERESIS +0x8c 0x00ee #LATIN SMALL LETTER I WITH CIRCUMFLEX +0x8d 0x2017 #DOUBLE LOW LINE +0x8e 0x00c0 #LATIN CAPITAL LETTER A WITH GRAVE +0x8f 0x00a7 #SECTION SIGN +0x90 0x00c9 #LATIN CAPITAL LETTER E WITH ACUTE +0x91 0x00c8 #LATIN CAPITAL LETTER E WITH GRAVE +0x92 0x00ca #LATIN CAPITAL LETTER E WITH CIRCUMFLEX +0x93 0x00f4 #LATIN SMALL LETTER O WITH CIRCUMFLEX +0x94 0x00cb #LATIN CAPITAL LETTER E WITH DIAERESIS +0x95 0x00cf #LATIN CAPITAL LETTER I WITH DIAERESIS +0x96 0x00fb #LATIN SMALL LETTER U WITH CIRCUMFLEX +0x97 0x00f9 #LATIN SMALL LETTER U WITH GRAVE +0x98 0x00a4 #CURRENCY SIGN +0x99 0x00d4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX +0x9a 0x00dc #LATIN CAPITAL LETTER U WITH DIAERESIS +0x9b 0x00a2 #CENT SIGN +0x9c 0x00a3 #POUND SIGN +0x9d 0x00d9 #LATIN CAPITAL LETTER U WITH GRAVE +0x9e 0x00db #LATIN CAPITAL LETTER U WITH CIRCUMFLEX +0x9f 0x0192 #LATIN SMALL LETTER F WITH HOOK +0xa0 0x00a6 #BROKEN BAR +0xa1 0x00b4 #ACUTE ACCENT +0xa2 0x00f3 #LATIN SMALL LETTER O WITH ACUTE +0xa3 0x00fa #LATIN SMALL LETTER U WITH ACUTE +0xa4 0x00a8 #DIAERESIS +0xa5 0x00b8 #CEDILLA +0xa6 0x00b3 #SUPERSCRIPT THREE +0xa7 0x00af #MACRON +0xa8 0x00ce #LATIN CAPITAL LETTER I WITH CIRCUMFLEX +0xa9 0x2310 #REVERSED NOT SIGN +0xaa 0x00ac #NOT SIGN +0xab 0x00bd #VULGAR FRACTION ONE HALF +0xac 0x00bc #VULGAR FRACTION ONE QUARTER +0xad 0x00be #VULGAR FRACTION THREE QUARTERS +0xae 0x00ab #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +0xaf 0x00bb #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +0xb0 0x2591 #LIGHT SHADE +0xb1 0x2592 #MEDIUM SHADE +0xb2 0x2593 #DARK SHADE +0xb3 0x2502 #BOX DRAWINGS LIGHT VERTICAL +0xb4 0x2524 #BOX DRAWINGS LIGHT VERTICAL AND LEFT +0xb5 0x2561 #BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +0xb6 0x2562 #BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +0xb7 0x2556 #BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +0xb8 0x2555 #BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +0xb9 0x2563 #BOX DRAWINGS DOUBLE VERTICAL AND LEFT +0xba 0x2551 #BOX DRAWINGS DOUBLE VERTICAL +0xbb 0x2557 #BOX DRAWINGS DOUBLE DOWN AND LEFT +0xbc 0x255d #BOX DRAWINGS DOUBLE UP AND LEFT +0xbd 0x255c #BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +0xbe 0x255b #BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +0xbf 0x2510 #BOX DRAWINGS LIGHT DOWN AND LEFT +0xc0 0x2514 #BOX DRAWINGS LIGHT UP AND RIGHT +0xc1 0x2534 #BOX DRAWINGS LIGHT UP AND HORIZONTAL +0xc2 0x252c #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0xc3 0x251c #BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0xc4 0x2500 #BOX DRAWINGS LIGHT HORIZONTAL +0xc5 0x253c #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0xc6 0x255e #BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +0xc7 0x255f #BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +0xc8 0x255a #BOX DRAWINGS DOUBLE UP AND RIGHT +0xc9 0x2554 #BOX DRAWINGS DOUBLE DOWN AND RIGHT +0xca 0x2569 #BOX DRAWINGS DOUBLE UP AND HORIZONTAL +0xcb 0x2566 #BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +0xcc 0x2560 #BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +0xcd 0x2550 #BOX DRAWINGS DOUBLE HORIZONTAL +0xce 0x256c #BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +0xcf 0x2567 #BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +0xd0 0x2568 #BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +0xd1 0x2564 #BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +0xd2 0x2565 #BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +0xd3 0x2559 #BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +0xd4 0x2558 #BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +0xd5 0x2552 #BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +0xd6 0x2553 #BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +0xd7 0x256b #BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +0xd8 0x256a #BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +0xd9 0x2518 #BOX DRAWINGS LIGHT UP AND LEFT +0xda 0x250c #BOX DRAWINGS LIGHT DOWN AND RIGHT +0xdb 0x2588 #FULL BLOCK +0xdc 0x2584 #LOWER HALF BLOCK +0xdd 0x258c #LEFT HALF BLOCK +0xde 0x2590 #RIGHT HALF BLOCK +0xdf 0x2580 #UPPER HALF BLOCK +0xe0 0x03b1 #GREEK SMALL LETTER ALPHA +0xe1 0x00df #LATIN SMALL LETTER SHARP S +0xe2 0x0393 #GREEK CAPITAL LETTER GAMMA +0xe3 0x03c0 #GREEK SMALL LETTER PI +0xe4 0x03a3 #GREEK CAPITAL LETTER SIGMA +0xe5 0x03c3 #GREEK SMALL LETTER SIGMA +0xe6 0x00b5 #MICRO SIGN +0xe7 0x03c4 #GREEK SMALL LETTER TAU +0xe8 0x03a6 #GREEK CAPITAL LETTER PHI +0xe9 0x0398 #GREEK CAPITAL LETTER THETA +0xea 0x03a9 #GREEK CAPITAL LETTER OMEGA +0xeb 0x03b4 #GREEK SMALL LETTER DELTA +0xec 0x221e #INFINITY +0xed 0x03c6 #GREEK SMALL LETTER PHI +0xee 0x03b5 #GREEK SMALL LETTER EPSILON +0xef 0x2229 #INTERSECTION +0xf0 0x2261 #IDENTICAL TO +0xf1 0x00b1 #PLUS-MINUS SIGN +0xf2 0x2265 #GREATER-THAN OR EQUAL TO +0xf3 0x2264 #LESS-THAN OR EQUAL TO +0xf4 0x2320 #TOP HALF INTEGRAL +0xf5 0x2321 #BOTTOM HALF INTEGRAL +0xf6 0x00f7 #DIVISION SIGN +0xf7 0x2248 #ALMOST EQUAL TO +0xf8 0x00b0 #DEGREE SIGN +0xf9 0x2219 #BULLET OPERATOR +0xfa 0x00b7 #MIDDLE DOT +0xfb 0x221a #SQUARE ROOT +0xfc 0x207f #SUPERSCRIPT LATIN SMALL LETTER N +0xfd 0x00b2 #SUPERSCRIPT TWO +0xfe 0x25a0 #BLACK SQUARE +0xff 0x00a0 #NO-BREAK SPACE + +
\ No newline at end of file diff --git a/docview/docs/codepage_2_unicode_mapping/CP865.TXT b/docview/docs/codepage_2_unicode_mapping/CP865.TXT new file mode 100644 index 00000000..41d73da2 --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/CP865.TXT @@ -0,0 +1,275 @@ +# +# Name: cp865_DOSNordic to Unicode table +# Unicode version: 2.0 +# Table version: 2.00 +# Table format: Format A +# Date: 04/24/96 +# Contact: Shawn.Steele@microsoft.com +# +# General notes: none +# +# Format: Three tab-separated columns +# Column #1 is the cp865_DOSNordic code (in hex) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 is the Unicode name (follows a comment sign, '#') +# +# The entries are in cp865_DOSNordic order +# +0x00 0x0000 #NULL +0x01 0x0001 #START OF HEADING +0x02 0x0002 #START OF TEXT +0x03 0x0003 #END OF TEXT +0x04 0x0004 #END OF TRANSMISSION +0x05 0x0005 #ENQUIRY +0x06 0x0006 #ACKNOWLEDGE +0x07 0x0007 #BELL +0x08 0x0008 #BACKSPACE +0x09 0x0009 #HORIZONTAL TABULATION +0x0a 0x000a #LINE FEED +0x0b 0x000b #VERTICAL TABULATION +0x0c 0x000c #FORM FEED +0x0d 0x000d #CARRIAGE RETURN +0x0e 0x000e #SHIFT OUT +0x0f 0x000f #SHIFT IN +0x10 0x0010 #DATA LINK ESCAPE +0x11 0x0011 #DEVICE CONTROL ONE +0x12 0x0012 #DEVICE CONTROL TWO +0x13 0x0013 #DEVICE CONTROL THREE +0x14 0x0014 #DEVICE CONTROL FOUR +0x15 0x0015 #NEGATIVE ACKNOWLEDGE +0x16 0x0016 #SYNCHRONOUS IDLE +0x17 0x0017 #END OF TRANSMISSION BLOCK +0x18 0x0018 #CANCEL +0x19 0x0019 #END OF MEDIUM +0x1a 0x001a #SUBSTITUTE +0x1b 0x001b #ESCAPE +0x1c 0x001c #FILE SEPARATOR +0x1d 0x001d #GROUP SEPARATOR +0x1e 0x001e #RECORD SEPARATOR +0x1f 0x001f #UNIT SEPARATOR +0x20 0x0020 #SPACE +0x21 0x0021 #EXCLAMATION MARK +0x22 0x0022 #QUOTATION MARK +0x23 0x0023 #NUMBER SIGN +0x24 0x0024 #DOLLAR SIGN +0x25 0x0025 #PERCENT SIGN +0x26 0x0026 #AMPERSAND +0x27 0x0027 #APOSTROPHE +0x28 0x0028 #LEFT PARENTHESIS +0x29 0x0029 #RIGHT PARENTHESIS +0x2a 0x002a #ASTERISK +0x2b 0x002b #PLUS SIGN +0x2c 0x002c #COMMA +0x2d 0x002d #HYPHEN-MINUS +0x2e 0x002e #FULL STOP +0x2f 0x002f #SOLIDUS +0x30 0x0030 #DIGIT ZERO +0x31 0x0031 #DIGIT ONE +0x32 0x0032 #DIGIT TWO +0x33 0x0033 #DIGIT THREE +0x34 0x0034 #DIGIT FOUR +0x35 0x0035 #DIGIT FIVE +0x36 0x0036 #DIGIT SIX +0x37 0x0037 #DIGIT SEVEN +0x38 0x0038 #DIGIT EIGHT +0x39 0x0039 #DIGIT NINE +0x3a 0x003a #COLON +0x3b 0x003b #SEMICOLON +0x3c 0x003c #LESS-THAN SIGN +0x3d 0x003d #EQUALS SIGN +0x3e 0x003e #GREATER-THAN SIGN +0x3f 0x003f #QUESTION MARK +0x40 0x0040 #COMMERCIAL AT +0x41 0x0041 #LATIN CAPITAL LETTER A +0x42 0x0042 #LATIN CAPITAL LETTER B +0x43 0x0043 #LATIN CAPITAL LETTER C +0x44 0x0044 #LATIN CAPITAL LETTER D +0x45 0x0045 #LATIN CAPITAL LETTER E +0x46 0x0046 #LATIN CAPITAL LETTER F +0x47 0x0047 #LATIN CAPITAL LETTER G +0x48 0x0048 #LATIN CAPITAL LETTER H +0x49 0x0049 #LATIN CAPITAL LETTER I +0x4a 0x004a #LATIN CAPITAL LETTER J +0x4b 0x004b #LATIN CAPITAL LETTER K +0x4c 0x004c #LATIN CAPITAL LETTER L +0x4d 0x004d #LATIN CAPITAL LETTER M +0x4e 0x004e #LATIN CAPITAL LETTER N +0x4f 0x004f #LATIN CAPITAL LETTER O +0x50 0x0050 #LATIN CAPITAL LETTER P +0x51 0x0051 #LATIN CAPITAL LETTER Q +0x52 0x0052 #LATIN CAPITAL LETTER R +0x53 0x0053 #LATIN CAPITAL LETTER S +0x54 0x0054 #LATIN CAPITAL LETTER T +0x55 0x0055 #LATIN CAPITAL LETTER U +0x56 0x0056 #LATIN CAPITAL LETTER V +0x57 0x0057 #LATIN CAPITAL LETTER W +0x58 0x0058 #LATIN CAPITAL LETTER X +0x59 0x0059 #LATIN CAPITAL LETTER Y +0x5a 0x005a #LATIN CAPITAL LETTER Z +0x5b 0x005b #LEFT SQUARE BRACKET +0x5c 0x005c #REVERSE SOLIDUS +0x5d 0x005d #RIGHT SQUARE BRACKET +0x5e 0x005e #CIRCUMFLEX ACCENT +0x5f 0x005f #LOW LINE +0x60 0x0060 #GRAVE ACCENT +0x61 0x0061 #LATIN SMALL LETTER A +0x62 0x0062 #LATIN SMALL LETTER B +0x63 0x0063 #LATIN SMALL LETTER C +0x64 0x0064 #LATIN SMALL LETTER D +0x65 0x0065 #LATIN SMALL LETTER E +0x66 0x0066 #LATIN SMALL LETTER F +0x67 0x0067 #LATIN SMALL LETTER G +0x68 0x0068 #LATIN SMALL LETTER H +0x69 0x0069 #LATIN SMALL LETTER I +0x6a 0x006a #LATIN SMALL LETTER J +0x6b 0x006b #LATIN SMALL LETTER K +0x6c 0x006c #LATIN SMALL LETTER L +0x6d 0x006d #LATIN SMALL LETTER M +0x6e 0x006e #LATIN SMALL LETTER N +0x6f 0x006f #LATIN SMALL LETTER O +0x70 0x0070 #LATIN SMALL LETTER P +0x71 0x0071 #LATIN SMALL LETTER Q +0x72 0x0072 #LATIN SMALL LETTER R +0x73 0x0073 #LATIN SMALL LETTER S +0x74 0x0074 #LATIN SMALL LETTER T +0x75 0x0075 #LATIN SMALL LETTER U +0x76 0x0076 #LATIN SMALL LETTER V +0x77 0x0077 #LATIN SMALL LETTER W +0x78 0x0078 #LATIN SMALL LETTER X +0x79 0x0079 #LATIN SMALL LETTER Y +0x7a 0x007a #LATIN SMALL LETTER Z +0x7b 0x007b #LEFT CURLY BRACKET +0x7c 0x007c #VERTICAL LINE +0x7d 0x007d #RIGHT CURLY BRACKET +0x7e 0x007e #TILDE +0x7f 0x007f #DELETE +0x80 0x00c7 #LATIN CAPITAL LETTER C WITH CEDILLA +0x81 0x00fc #LATIN SMALL LETTER U WITH DIAERESIS +0x82 0x00e9 #LATIN SMALL LETTER E WITH ACUTE +0x83 0x00e2 #LATIN SMALL LETTER A WITH CIRCUMFLEX +0x84 0x00e4 #LATIN SMALL LETTER A WITH DIAERESIS +0x85 0x00e0 #LATIN SMALL LETTER A WITH GRAVE +0x86 0x00e5 #LATIN SMALL LETTER A WITH RING ABOVE +0x87 0x00e7 #LATIN SMALL LETTER C WITH CEDILLA +0x88 0x00ea #LATIN SMALL LETTER E WITH CIRCUMFLEX +0x89 0x00eb #LATIN SMALL LETTER E WITH DIAERESIS +0x8a 0x00e8 #LATIN SMALL LETTER E WITH GRAVE +0x8b 0x00ef #LATIN SMALL LETTER I WITH DIAERESIS +0x8c 0x00ee #LATIN SMALL LETTER I WITH CIRCUMFLEX +0x8d 0x00ec #LATIN SMALL LETTER I WITH GRAVE +0x8e 0x00c4 #LATIN CAPITAL LETTER A WITH DIAERESIS +0x8f 0x00c5 #LATIN CAPITAL LETTER A WITH RING ABOVE +0x90 0x00c9 #LATIN CAPITAL LETTER E WITH ACUTE +0x91 0x00e6 #LATIN SMALL LIGATURE AE +0x92 0x00c6 #LATIN CAPITAL LIGATURE AE +0x93 0x00f4 #LATIN SMALL LETTER O WITH CIRCUMFLEX +0x94 0x00f6 #LATIN SMALL LETTER O WITH DIAERESIS +0x95 0x00f2 #LATIN SMALL LETTER O WITH GRAVE +0x96 0x00fb #LATIN SMALL LETTER U WITH CIRCUMFLEX +0x97 0x00f9 #LATIN SMALL LETTER U WITH GRAVE +0x98 0x00ff #LATIN SMALL LETTER Y WITH DIAERESIS +0x99 0x00d6 #LATIN CAPITAL LETTER O WITH DIAERESIS +0x9a 0x00dc #LATIN CAPITAL LETTER U WITH DIAERESIS +0x9b 0x00f8 #LATIN SMALL LETTER O WITH STROKE +0x9c 0x00a3 #POUND SIGN +0x9d 0x00d8 #LATIN CAPITAL LETTER O WITH STROKE +0x9e 0x20a7 #PESETA SIGN +0x9f 0x0192 #LATIN SMALL LETTER F WITH HOOK +0xa0 0x00e1 #LATIN SMALL LETTER A WITH ACUTE +0xa1 0x00ed #LATIN SMALL LETTER I WITH ACUTE +0xa2 0x00f3 #LATIN SMALL LETTER O WITH ACUTE +0xa3 0x00fa #LATIN SMALL LETTER U WITH ACUTE +0xa4 0x00f1 #LATIN SMALL LETTER N WITH TILDE +0xa5 0x00d1 #LATIN CAPITAL LETTER N WITH TILDE +0xa6 0x00aa #FEMININE ORDINAL INDICATOR +0xa7 0x00ba #MASCULINE ORDINAL INDICATOR +0xa8 0x00bf #INVERTED QUESTION MARK +0xa9 0x2310 #REVERSED NOT SIGN +0xaa 0x00ac #NOT SIGN +0xab 0x00bd #VULGAR FRACTION ONE HALF +0xac 0x00bc #VULGAR FRACTION ONE QUARTER +0xad 0x00a1 #INVERTED EXCLAMATION MARK +0xae 0x00ab #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +0xaf 0x00a4 #CURRENCY SIGN +0xb0 0x2591 #LIGHT SHADE +0xb1 0x2592 #MEDIUM SHADE +0xb2 0x2593 #DARK SHADE +0xb3 0x2502 #BOX DRAWINGS LIGHT VERTICAL +0xb4 0x2524 #BOX DRAWINGS LIGHT VERTICAL AND LEFT +0xb5 0x2561 #BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +0xb6 0x2562 #BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +0xb7 0x2556 #BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +0xb8 0x2555 #BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +0xb9 0x2563 #BOX DRAWINGS DOUBLE VERTICAL AND LEFT +0xba 0x2551 #BOX DRAWINGS DOUBLE VERTICAL +0xbb 0x2557 #BOX DRAWINGS DOUBLE DOWN AND LEFT +0xbc 0x255d #BOX DRAWINGS DOUBLE UP AND LEFT +0xbd 0x255c #BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +0xbe 0x255b #BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +0xbf 0x2510 #BOX DRAWINGS LIGHT DOWN AND LEFT +0xc0 0x2514 #BOX DRAWINGS LIGHT UP AND RIGHT +0xc1 0x2534 #BOX DRAWINGS LIGHT UP AND HORIZONTAL +0xc2 0x252c #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0xc3 0x251c #BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0xc4 0x2500 #BOX DRAWINGS LIGHT HORIZONTAL +0xc5 0x253c #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0xc6 0x255e #BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +0xc7 0x255f #BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +0xc8 0x255a #BOX DRAWINGS DOUBLE UP AND RIGHT +0xc9 0x2554 #BOX DRAWINGS DOUBLE DOWN AND RIGHT +0xca 0x2569 #BOX DRAWINGS DOUBLE UP AND HORIZONTAL +0xcb 0x2566 #BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +0xcc 0x2560 #BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +0xcd 0x2550 #BOX DRAWINGS DOUBLE HORIZONTAL +0xce 0x256c #BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +0xcf 0x2567 #BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +0xd0 0x2568 #BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +0xd1 0x2564 #BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +0xd2 0x2565 #BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +0xd3 0x2559 #BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +0xd4 0x2558 #BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +0xd5 0x2552 #BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +0xd6 0x2553 #BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +0xd7 0x256b #BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +0xd8 0x256a #BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +0xd9 0x2518 #BOX DRAWINGS LIGHT UP AND LEFT +0xda 0x250c #BOX DRAWINGS LIGHT DOWN AND RIGHT +0xdb 0x2588 #FULL BLOCK +0xdc 0x2584 #LOWER HALF BLOCK +0xdd 0x258c #LEFT HALF BLOCK +0xde 0x2590 #RIGHT HALF BLOCK +0xdf 0x2580 #UPPER HALF BLOCK +0xe0 0x03b1 #GREEK SMALL LETTER ALPHA +0xe1 0x00df #LATIN SMALL LETTER SHARP S +0xe2 0x0393 #GREEK CAPITAL LETTER GAMMA +0xe3 0x03c0 #GREEK SMALL LETTER PI +0xe4 0x03a3 #GREEK CAPITAL LETTER SIGMA +0xe5 0x03c3 #GREEK SMALL LETTER SIGMA +0xe6 0x00b5 #MICRO SIGN +0xe7 0x03c4 #GREEK SMALL LETTER TAU +0xe8 0x03a6 #GREEK CAPITAL LETTER PHI +0xe9 0x0398 #GREEK CAPITAL LETTER THETA +0xea 0x03a9 #GREEK CAPITAL LETTER OMEGA +0xeb 0x03b4 #GREEK SMALL LETTER DELTA +0xec 0x221e #INFINITY +0xed 0x03c6 #GREEK SMALL LETTER PHI +0xee 0x03b5 #GREEK SMALL LETTER EPSILON +0xef 0x2229 #INTERSECTION +0xf0 0x2261 #IDENTICAL TO +0xf1 0x00b1 #PLUS-MINUS SIGN +0xf2 0x2265 #GREATER-THAN OR EQUAL TO +0xf3 0x2264 #LESS-THAN OR EQUAL TO +0xf4 0x2320 #TOP HALF INTEGRAL +0xf5 0x2321 #BOTTOM HALF INTEGRAL +0xf6 0x00f7 #DIVISION SIGN +0xf7 0x2248 #ALMOST EQUAL TO +0xf8 0x00b0 #DEGREE SIGN +0xf9 0x2219 #BULLET OPERATOR +0xfa 0x00b7 #MIDDLE DOT +0xfb 0x221a #SQUARE ROOT +0xfc 0x207f #SUPERSCRIPT LATIN SMALL LETTER N +0xfd 0x00b2 #SUPERSCRIPT TWO +0xfe 0x25a0 #BLACK SQUARE +0xff 0x00a0 #NO-BREAK SPACE + +
\ No newline at end of file diff --git a/docview/docs/codepage_2_unicode_mapping/reame.txt b/docview/docs/codepage_2_unicode_mapping/reame.txt new file mode 100644 index 00000000..33b26a53 --- /dev/null +++ b/docview/docs/codepage_2_unicode_mapping/reame.txt @@ -0,0 +1,9 @@ + + +http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/ + +The URL above shows various codepage character mappings from + XXX to Unicode. + +See the .ipf file for the valid codepage options used in IPF format. + diff --git a/docview/docs/docview.ipf b/docview/docs/docview.ipf new file mode 100644 index 00000000..17bc7741 --- /dev/null +++ b/docview/docs/docview.ipf @@ -0,0 +1,822 @@ +:userdoc. +:docprof toc=123456. +:title.NewView Help +.* ************************************************************ +.* Subject: Help for NewView +.* Version: +.* Copyright: Copyright 2004 Aaron Lawrence +.* Copyright: Copyright 2006-2007 Ronald Brill +.* Author: Aaron Lawrence +.* ************************************************************ +.* +.* +.* ************************************************************ +.* Introduction +.* ************************************************************ +:h1 res=30000 id='Introduction'.Introduction +:i1 id=30001.support +:p.:artwork runin name='images\NewView.bmp'. +:hp2.Welcome to NewView&xclm.:ehp2. +:p. +:p.NewView is a program for reading OS&slash.2 &lpar.or eComStation&rpar. Help +Files&per. +:p.:link reftype=hd refid='Support'.Support and Licensing:elink. +:p.:link reftype=hd refid='Using'.Using NewView:elink. +:p.:hp1.To stop this file appearing when you start NewView without specifying a +help file&comma. see Tools &endash. Options &endash. General tab&per.:ehp1. +:p.:hp2.History:ehp2. +:p.NewView replaces the original IBM program supplied with OS&slash.2&per. +:p.It improves upon many aspects of View&comma. with a modern&comma. easy to use +interface&comma. more options&comma. and new features that View simply +didn&apos.t have&per. +:p. +.* ************************************************************ +.* Support and Licensing +.* ************************************************************ +:h2 res=1 id='Support'. +Support and Licensing +:i1 id=30002.license +:i2 refid=30001.Support and Licensing +:i2 refid=30001.Introduction +:i1 id=30003.bugs +:i1 id=30004.source code +:p.:hp2.Support and Licensing:ehp2. +:p. +:p.NewView is Copyright 1999&endash.2006 Aaron Lawrence&per. It is also licensed +under the GNU Public License&comma. which means you have the right to obtain the +source code&per. +:p.Since 2006 Ronald Brill maintains the product&per. +.br +NewView is a Netlabs project&per. +:p.See the Readme&per.txt for more technical details&per. +:p.See the Changes&per.txt file for a history of changes to NewView&per. +:p.If you find NewView helpful&comma. please email me and&slash.or make a +donation to support further development&per. It&apos.s nice to hear from +you&xclm. +:ul. +:li.Suggestions&comma. compliments or bug reports http&colon.&slash.&slash.svn&per.netlabs&per.org&slash.newview +:li.Translate NewView to your language&per. +:li.A donation to Netlabs http&colon.&slash.&slash.www&per.mensys&per.nl +:eul. +:p.:hp2.Reporting Bugs:ehp2. +:p.If you need to report a crash or other problem&comma. then be as specific as +possible about what files were being used&comma. what you were doing&comma. +etc&per. If one is available&comma. PLEASE include the newview&per.log&per. The +log file will be EITHER +.br + &endash. in the same directory as NewView itself +.br + &endash. in the folder set by LOGFILES environment variable &lpar.typically eCS +1&per.1&plus.&rpar. +.br +If it is specific to a particular help file&comma. then send them to me&comma. +unless they&apos.re large &lpar.bigger than 1MB&rpar.&per. +:p.Most of the following information is in the newview&per.log file&comma. but +it would be helpful if you could include it for verification&colon. +:ul. +:li.NewView version &lpar.Help &endash. Product Information&rpar. +:li.The filenames of the help files&per. +:li.A screenshot may be useful&comma. if the problem is an incorrect or corrupt +display&per. +:eul. +:p.:hp2.Why doesn&apos.t my help file work properly?:ehp2. +:p.Some of the less used features of the original View program are not +implemented&per. This is either because I have not got around to it&comma. or +because they are simply not worth the time&per. Examples include +metafiles&comma. index synonyms&comma. the entire application control API&comma. +and so on&per. +:p.Unfortunately&comma. it seems that at least one developer has used every one +of these features&comma. so you may find an occasional file that doesn&apos.t +load or doesn&apos.t work properly&per. +.* +.* +.* ************************************************************ +.* Using NewView +.* ************************************************************ +:h1 res=2 id='Using'. +Using NewView +:p.:hp2.Using NewView:ehp2. +:p.Once you have :link reftype=hd refid='OpeningFiles'.opened a +file:elink.&comma. you can read it in various ways&per. +:p.You can read the :link reftype=hd refid='contents'.table of +contents:elink.&comma. use the :link reftype=hd refid='Index'.alphabetical +index:elink.&comma. or :link reftype=hd refid='search'.search:elink.&per. +:p.To simply read the help file like a paper book&comma. use the &odq.Previous&cdq. +:artwork runin name='images\previous.bmp'. + and &odq.Next&cdq. +:artwork runin name='images\next.bmp'. + buttons to work your way through all the topics&per. +:p.You can also use the help file like web pages&comma. using &odq.Back&cdq. +:artwork runin name='images\back.bmp'. + and &odq.Forward&cdq. +:artwork runin name='images\forward.bmp'. + buttons to go back to wherever you were before&comma. or to retread your +steps&per. +:p.Colours and some of the behaviour of NewView can be adjusted from the Tools +&endash. Options menu&per. +:p.You can also :link reftype=hd refid='notes'.annotate:elink. or :link +reftype=hd refid='bookmarks'.bookmark:elink. topics&per. +.* +.* +.* ************************************************************ +.* Opening Help File +.* ************************************************************ +:h1 res=3 id='OpeningFiles'. +Opening Files +:i1 id=30005.open +:p.:hp2.Opening Help Files:ehp2. +:p. +:p.To open a help file&comma. you can use any of the following&colon. +:p.&endash. Double&endash.click a :link reftype=hd refid='HelpIcons'.help +icon:elink. that is already set up +:p.&endash. Type &odq.view :hp1.filename:ehp1.&cdq. from the :link reftype=hd +refid='CommandLine'.command line:elink. +:p.&endash. Click the Open button +:artwork runin name='images\open.bmp'. + from within NewView +:p.&endash. Reload a recently viewed file from the &odq.File&cdq. menu +:p.&endash. Drag and drop a Help file from the desktop +:p.Once the file is loaded&comma. you should see the :link reftype=hd +refid='contents'.table of contents:elink. and the first topic&per. +:note text='Note:'.This assumes you installed NewView as a replacement +for original View&per. If you didn&apos.t then existing help icons and the +command line may behave differently&per. +:p.:hp2.Loading Multiple Files Together:ehp2. +:p.NewView can load multiple files at once&comma. presenting them as if they +were one book&comma. and read environment variables for filenames&per. +:p.For example&comma. with the OS&slash.2 Developer&apos.s Toolkit +documentation&colon. +.br + NewView cpref +.br +loads the &odq.Control Program Guide and Reference&cdq.&per. CPREF is an environment +variable set in config&per.sys&comma. consisting of &odq.CP1&plus.CP2&plus.CP3&cdq. +which tells NewView &lpar.or View&rpar. to load the help files CP1&comma. CP2 +and CP3&per. The files are searched for in the path specified by two :link +reftype=hd refid='L_EnvironmentVariables'.environment +variables:elink.&per.&asterisk. +:p.The files are all loaded and effectively appended to each other&per. +:p.Being able to load multiple files like this can be helpful for various +reasons&per. For example&comma. 4OS&slash.2 &lpar.a CMD&per.EXE +replacement&rpar. uses it to add it&apos.s own help on top of the original CMD +help&per. You can do it yourself with any files you like&per. +:p.You can load multiple files in the Open File dialog by using Ctrl or Shift to +select multiple files&per. +:p.When you click a link to a different help file&comma. NewView loads the other +file without closing your current files&per. +:p.At any time&comma. you can find out what files are open by using File +&endash. Information&per. +:p.:hp2.Loading Additional Files:ehp2. +:p.You can tick the &odq.Keep current files open&cdq. checkbox in the Open File +dialog&comma. and NewView will open the files you have selected without closing +the currently opened files&per. +:p.:hp2.Drag and Drop:ehp2. +:p.You can drag and drop &per.INF or &per.HLP files onto NewView and they will +be opened&per. If you hold down the Shift key&comma. they will be opened without +closing the current files&per. +:p.You can drop files onto any of the main content areas&comma. such as the +Contents or Index windows&comma. or an existing topic window&per. +:note text='Note:'.Some links that go across files&comma. will only work if the correct set of +files is loaded&per. +.* ************************************************************ +.* Help Icons +.* ************************************************************ +:h2 res=17 id='HelpIcons'. +Help Icons +:p.:hp2.Help Icons:ehp2. +:p.Help Icons on the desktop are usually &odq.program objects&cdq. with the program name +set to &odq.view&per.exe&cdq. and the parameters set to the name of the help files&per. +:p.Some programs create these icons automatically at install time&per. +:p.You can create these icons yourself by using the desktop program +template&per. See desktop help for more information&per. +:p.If you create icons by dragging help files to the desktop&comma. then you +cannot give them a meaningful title&comma. because that would change the name of +the file&comma. which might prevent programs from finding the help file&per. +Therefore program objects are currently the recommended means of creating help +icons&per. +.* +.* +.* ************************************************************ +.* Navigation Panel Tabs +.* ************************************************************ +:h1 res=200 id='NavigationPanel'. +Navigation Panel Tabs +:p.:hp2.Navigation Panel Tabs:ehp2. +:p.The left hand panel contains several tabs for moving through the current help +file in different ways&per. +:p.:link reftype=hd refid='contents'.Contents:elink. +:p.:link reftype=hd refid='Index'.Index:elink. +:p.:link reftype=hd refid='search'.Search:elink. +:p.:link reftype=hd refid='notes'.Notes:elink. +:p.You can turn this panel off to get more space&comma. with the button +:artwork runin name='images\navigator.bmp'. or by selecting View +&endash. Show Left Panel from the menu&comma. or pressing Alt&plus.P&per. Do the +same to turn it on again&per. +:p.You can stop the navigation panel from appearing when a help file is opened +in Tools &endash. Options &endash. General tab&per. +:note text='Note:'.Many programs choose to show the table of contents +when they open their help file&semi. in this case&comma. the panel is +automatically shown&comma. overriding your setting&per. +.* ************************************************************ +.* Contents View +.* ************************************************************ +:h2 res=4 id='contents'. +Contents View +:i1 id=30006.Table of Contents +:p.:hp2.Table of Contents:ehp2. +:p. +:p.Most help files have a table of contents that shows you the topics in the +file&comma. in a hierarchy or &odq.tree&cdq.&per. This is usually the first view you see +when you open a file&per. +:p.You can expand or collapse branches on the tree by clicking the &plus. or +&endash. buttons&comma. or using the space bar&per. +:p.To view a topic from the contents&comma. just click on it&per. You can also +move through the contents by using the arrow keys&per. +:p.To move through :hp2.all:ehp2. topics in the contents tree&comma. in +order&comma. you can use Ctrl &plus. Up and Ctrl &plus. Down&comma. or the +&odq.Previous&cdq. +:artwork runin name='images\previous.bmp'. + and &odq.Next&cdq. +:artwork runin name='images\next.bmp'. + buttons&per. This is one way to treat the file as a normal book&comma. reading +through each page&per. +:p.You can also review the whole table of contents by using &odq.Expand All&cdq. in the +&odq.View&cdq. menu&per. This expands all the branches of the contents table so you can +quickly look through it&per. However&comma. it&apos.s usually easier to use +:link reftype=hd refid='search'.Search:elink. or :link reftype=hd +refid='Index'.Index:elink. for this purpose&per. +.* ************************************************************ +.* Index +.* ************************************************************ +:h2 res=5 id='Index'. +Index +:p.:hp2.About the Index:ehp2. +:p. +:p.The Index tab contains an alphabetical listing of topics or keywords in the +help file&per. You can quickly search through it just by typing the first few +characters of the word you want to look up&per. NewView jumps to the first match +in the index automatically&per. To view the highlighted topic&comma. press +enter&per. +:note text='Note:'. +:p.Help files may or may not include an &odq.official&cdq. index&per. The index is +manually created by the author&comma. so &lpar.for original View&rpar. it&apos.s +usefulness is strictly dependent on how much work the author put into it&per. +There may not even be one&per. +:p.However&comma. a useful index can be provided simply by listing the titles of +each topic alphabetically&comma. and this is what NewView does&per. It then +merges the original index &lpar.if any&rpar. with the list of topic titles&per. +:p.If for some reason you don&apos.t like this&comma. you can turn it off in +Tools &endash. Options &endash. Index tab&per. +.* ************************************************************ +.* Search +.* ************************************************************ +:h2 res=6 id='search'. +Search +:p.:hp2.Searching:ehp2. +:p. +:p.Searching is a quick way to find information&comma. when you don&apos.t know +where to start&per. Simply go to the Search tab&comma. type some related words +and click the Search button&per. +You&apos.ll see a listing of all topics containing that word&comma. or words +like it&comma. with the best matches at the top&per. The best match will be +displayed automatically&per. +:p.Words that matches your search are highlighted in the topic&per. +:p.:hp2.Global search:ehp2. +:p.You can also search all help files on your system using the :link reftype=hd +refid='GlobalSearch'.global search:elink. in Tools &endash. Search all Help +Files&per. +:p.:hp2.Phrase search:ehp2. +:p.If you want to search for a phrase made up of more than one word&comma. put +double quotes around it&comma. for example &odq.os&slash.2 warp&cdq.&per. +:p.:hp2.Matching features:ehp2. +:p.NewView allows you finer control of searching&per. +:p.&plus. indicates a word that :hp2.must:ehp2. be matched +:p.&endash. indicates a word that must :hp2.not:ehp2. be matched +:p.NewView always does partial word matches&per. That is&comma. if you search +for &odq.win&cdq. NewView will also find &odq.window&cdq. and &odq.showing&cdq.&per. However&comma. the +better the match is the higher the rank will be&per. +:p.:hp2.How NewView ranks results:ehp2. +:p.NewView ranks matching topics by various means&colon. +:p.&endash. a closer match to a full word +:p.&endash. number of matching words in a topic +:p.&endash. matches within the title +:p.&endash. matches within an index entry +.* ************************************************************ +.* Notes +.* ************************************************************ +:h2 res=7 id='notes'. +Notes +:p.:hp2.Adding and Using Notes:ehp2. +:p. +:p.NewView allows you to add notes &lpar.annotations&rpar. to your help +files&per. +:p.To add a note&comma. simply click where you want to make a note and click the +&odq.Note&cdq. button +:artwork runin name='images\note.bmp'. +&comma. then type your text and click OK&per. The text will be inserted into the +help topic with a different color &lpar.default is green&semi. you can change +this in Tools &endash. Options &endash. Colors&rpar.&per. +:p.To edit or delete a note&comma. click on the colored note text&semi. you can +then edit the note text&comma. or click on delete to get rid of it&per. +:p.You can also review all the notes that you&apos.ve made in the current help +file&lpar.s&rpar. by going to the Notes tab&semi. this allows you to add&comma. +edit and delete&comma. and also jump to the topics containing your notes&per. +:p. +:p.Notes are saved in a file with the extension &per.nte&comma. in the same +directory as the help file they are for&per. +:note text='Note:'.If a help file is changed &lpar.for example a program is +upgraded&rpar. then notes will no longer appear in the correct place&semi. +however&comma. you can still read them from the Notes tab&per. +.* +.* +.* ************************************************************ +.* Global Search +.* ************************************************************ +:h1 res=18 id='GlobalSearch'. +Global Search +:p.:hp2.Global search:ehp2. +:p.You can search all help files on your system&comma. by clicking the Search +All button +:artwork runin name='images\search.bmp'. +&comma. using Tools &endash. Search all Help Files in the menu&comma. or +pressing Ctrl&plus.S&per. +:p.This search works similarly to :link reftype=hd refid='search'.searching +within a file:elink.&comma. but it also tells you what help file the results +were found in&per. +:p.These searches may take some time&comma. depending on what you search +for&per. You can stop the search at any time&per. +:p.:hp2.Where NewView searches:ehp2. +:p.The default is to search for help files in the help paths&comma. which are +specified by the BOOKSHELF and HELP :link reftype=hd +refid='L_EnvironmentVariables'.environment variables:elink.&per. +:p.You can choose other places to search by choosing from the drop&endash.down +list&comma. or customise the list by clicking the Select button&per. +:p.:hp2.Search in&colon. Standard Help Paths:ehp2. +:p.This is the default and will search BOOKSHELF and HELP as specified +above&per. +:p.Clicking the select button will allow you to choose which of the directories +in the help paths will be used&per. Click each item in the list to select or +de&endash.select it&per. After you choose this&comma. the location will show as +&odq.Selected Help Paths&cdq. +:p.:hp2.Search in&colon. All Hard Drives:ehp2. +:p.This option will search all hard &lpar.non&endash.removable&rpar. drives on +your system&per. You can click &odq.Select&per.&per.&per.&cdq. to customise the +location&per. +:p.Searching drives can find more help files&comma. but might be much slower +than just the help paths&per. +:p.:hp2.Search in&colon. Selected Help Paths:ehp2. +:p.If you have already selected particular help paths to search&per.&comma. you can +click &odq.Select&per.&per.&per.&cdq. to customise again&per. +:p.:hp2.Search in&colon. Directory List:ehp2. +:p.In the &odq.Select Directories&cdq. dialog&comma. clicking the &odq.Add&per.&per.&per.&cdq. +button will allow you to add one or more directories to the search list&per. +:p.Select the drive and directory using the controls that appear&comma. then +click &odq.<. Add Directory&cdq. to add the chosen directory&per. You can do this as +many times as you like&per. Choose &odq.With sub&endash.directories&cdq. if you want +sub&endash.directories of the selected directory to be searched as well&per. In +this case&comma. &per.&per.&per. will show on the end of the directory&per. +:p.After you add a custom directory like this&comma. the location for searching +will show as &odq.Directory List&cdq.&per. +:note text='Note:'.If you add a custom directory to standard or selected help +paths&comma. then the list will become a custom list&comma. and you can no +longer re&endash.select help paths&per. To get back to the original help +paths&comma. choose &odq.Standard Help Paths&cdq. then click &odq.Select&per.&per.&per.&cdq. +again&per. +:p.:hp2.Search in&colon. Typing a location:ehp2. +:p.You can type a drive or directory into the &odq.Search in&colon.&cdq. entry +field&per. Add &odq.&per.&per.&per.&cdq. on the end of the directory if you want to +search subdirectories as well&per. +:p.Example&colon. +:p. Search in&colon. &lbracket. E&colon.&bsl.mydocs&bsl.&per.&per.&per. + &rbracket. +:p.This will search help files in E&colon.&bsl.mydocs&bsl. and any +subdirectories&per. +.* +.* +.* ************************************************************ +.* Bookmarks +.* ************************************************************ +:h1 res=8 id='bookmarks'. +Bookmarks +:p.:hp2.Bookmarks:ehp2. +:p. +:p.NewView allows you to bookmark particular topics within the current help +file&per. Simply click the bookmark button +:artwork runin name='images\bookmark.bmp'. + to add the current topic as a bookmark&per. +:p.To jump to a bookmark&comma. go to the &odq.Bookmarks&cdq. menu&comma. and click on +the bookmark you want to open&per. +:p.You can view or delete all your bookmarks by clicking on &odq.Edit&per.&per.&cdq. in +the &odq.Bookmarks&cdq. menu&per. This window can remain open while you read&comma. so +that you can quickly look through your bookmarks&per. +:p. +:note text='Note:'. +:p.NewView bookmarks remember all the topic windows that are open&comma. if +there is more than one&per. +:p.Bookmarks are saved in a file with the extension &per.bmk&comma. in the same +directory as the help file they are for&per. +.* +.* +.* ************************************************************ +.* Internet Links +.* ************************************************************ +:h1 res=100 id='InternetLinks'. +Internet Links +:p.:hp2.Internet Links:ehp2. +:p.When you click a web URL like +http&colon.&slash.&slash.www&per.google&per.com&comma. NewView launches your +default web browser&per. +:p.This web browser is specified by operating system settings&comma. not NewView +itself&per. To configure it&comma. you can open a URL object on the +desktop&comma. edit the browser path in the :hp2.Browser:ehp2. tab&comma. then +click Set Default&per. Alternatively&comma. download the utility ConfigApps from +Hobbes +:p. + http&colon.&slash.&slash.hobbes&per.nmsu&per.edu&slash.cgi&endash.bin&slash.h&endash.search?key&eq.configapps +.br +:p.Browsers may also have the ability to make themselves the default&comma. +either at install time or in preferences&per. +:p.Email&comma. Newsgroups and FTP links are also passed to the web browser&per. +At this time&comma. it isn&apos.t possible to choose a different program for +these links&per. +:p.:hp2.Note to help file authors:ehp2. +:p.The original View had no understanding of URL or email links&comma. so the +only way to implement them was a link to&comma. for example&comma. +&odq.netscape&per.exe&cdq. with the correct parameters&per. +:p.NewView translates program links to &odq.netscape&cdq.&comma. &odq.explore&cdq. or &odq.mozilla&cdq. +into links to the default browser&per. +:p.It also auto&endash.detects URLs in the forms&colon. +:p. http&colon.&slash.&slash.x https&colon.&slash.&slash.x + ftp&colon.&slash.&slash.x +:p. mailto&colon.x news&colon.x +:p.Things that look like URLs are also detected&comma. even without the protocol +prefix&colon. +:p. www&per.a&per.b &endash. browser +:p. ftp&per.a&per.b &endash. ftp +:p. a&atsign.b&per.c &endash. email +:p.where a&comma. b and c are any alphanumeric string&per. +:p.You don&apos.t need to do anything for NewView to recognise these&per. +.* +.* +.* ************************************************************ +.* Command Line +.* ************************************************************ +:h1 res=9 id='CommandLine'. +Command Line Parameters +:p.:hp2.Command Line Parameters:ehp2. +:p.When you run NewView from the command line you can supply various +parameters&per. None of them are required&per. +:p. +:p.:hp2.NewView &lbracket.options&rbracket. &lbracket.<.filename>. +&lbracket.<.search text>.&rbracket.&rbracket.:ehp2. +:p.If NewView is installed as a replacement for view&comma. then the command +starts with view instead of newview&per. +:p.:link reftype=hd refid='CommandLineExamples'.Examples:elink. +.* +:p.:hp2.<.filename>.:ehp2. +:p.The file for NewView to load&per. You can load multiple files at once by +using filename1&plus.filename2 etc&per. +.br +If a path isn&apos.t specified&comma. then the files are searched for in the +:link reftype=hd refid='L_EnvironmentVariables'.BOOKSHELF and HELP +paths:elink.&per. +.br +If you path and&slash.or filename contains special characters (like blank) then +you have to enclose the filename in double qoutes&per. +.* +:p.:hp2.<.search text>.:ehp2. +:p.Search topic titles and index entries for this text&per. This is +:hp2.not:ehp2. the same as a normal search&comma. for compatibility with +original View&per. To do a proper search use the &slash.s option &lpar.see +below&rpar.&per. For more details&comma. see :link reftype=hd +refid='CommandLineTopicSearch'.Command Line Topic Search:elink.&per. +:p.:hp2.Options:ehp2. +:p.:hp2.&slash.s:ehp2. +:p.After opening the file&comma. performs a :link reftype=hd +refid='search'.search:elink. for the given text (do a real full text search intead of +the default topic titles search)&per. The result is the same as performing the search from +the :link reftype=hd +refid='search'.serach navigation panel:elink.&per. +:p.Example&colon. +.br +:lm margin=4. +To search for copy in the whole cmdref document you can call +:xmp. + newview &slash.s cmdref copy +:exmp. +NewView is clever enought to handle multiple words (like the :link reftype=hd +refid='search'.serach navigation panel:elink.)&per. This is a OR search&per. +:xmp. + newview &slash.s cmdref net access +:exmp. +To perform a AND search enclose the search phrase in double quotes&per. +:xmp. + newview &slash.s cmdref &odq.net access&cdq. +:exmp. +:lm margin=1. +.* +:p.:hp2.&slash.g:ehp2. +:p.Performs a :link reftype=hd refid='GlobalSearch'.global search:elink. for the +given text&comma. on all the help files in your system&per. +:p.Example&colon. +.br +:lm margin=4. +To search for copy in all help files use +:xmp. + newview &slash.g copy +:exmp. +Provide the file name as first parameter if you like to open a help file +before the search starts. +:xmp. + newview &slash.g cmdref copy +:exmp. +:lm margin=1. +.* +:p.:hp2.&slash.?:ehp2. or :hp2.&slash.h:ehp2. or :hp2.&slash.help:ehp2. +:p.Show command line help +:p.See also&colon. :link reftype=hd refid='AdvancedParameters'.Advanced +Parameters:elink. +.* ************************************************************ +.* Command Line Topic Search +.* ************************************************************ +:h2 res=13 id='CommandLineTopicSearch'. +Command Line Topic Search +:p.:hp2.Command line topic search:ehp2. +:p. view <.filename>. <.topic>. +:p.The topic search parameter specified on the command line&comma. copies the +behaviour of old view&per. +:p.Text within topics is not searched&comma. only titles and index entries&per. +This makes it less useful to humans&comma. but is used by some programs to +reference help topics in a predictable way&per. +:p.You can use multiple words here&per. +:p.The search performed is&colon. +:p.&endash. topic title starts with search text +:p.&endash. index entry starts with search text +:p.&endash. topic title contains search text +:p.&endash. index entry contains search text&per. +:p.Developers should make sure that the expected document will be found if using +this technique to identify topics when starting New or Old view&per. +.* ************************************************************ +.* Advanded Parameters +.* ************************************************************ +:h2 res=14 id='AdvancedParameters'. +Advanced Parameters +:p.:hp2.Advanced Parameters:ehp2. +:p.The following command line parameters are intended mainly for software +developers&comma. but can be used for any purpose&per. +:p.:hp2.&slash.lang&colon.<.language spec>.:ehp2. +:p.Loads the specified language&per. Overrides the default chosen based on the +LANG environment variable&per. For example&comma. +:xmp. + newview cmdref &slash.lang&colon.en +:exmp. +loads English&per. See readme&per.txt for more information&per. +:p.:hp2.&slash.pos&colon.<.left>.&comma.<.bottom>.&comma.<.width>.&comma.<.height>.:ehp2. +:p.Set the main program window to the given position and size&per. All values +must be given&per. Put a :hp2.P:ehp2. after a number to specify a +percentage&per. For example&colon. +:xmp. + newview &slash.pos&colon.10P&comma.10P&comma.80P&comma.80P +:exmp. +:p.makes the window centered and 80&percent. of the screen size&per. +:p.:hp2.&slash.title&colon.<.window title>.:ehp2. +:p.Sets the title of the NewView window to the specified text&comma. overriding +whatever appears in the help file&per. The text &odq.Help &endash. &cdq. will always be +inserted in front of the specified text&comma. unless the specified text is +&odq.help&cdq.&comma. in which case the title will simply become &odq.Help&cdq.&per. This is to +make sure that help windows are always obvious as such in the window list&per. +:p.If you need to specify multiple words&comma. surround the entire option with +quotes&comma. for example&colon. +:xmp. + newview cmdref &odq.&slash.title&colon.Command Line Help&cdq. +:exmp. +.* ************************************************************ +.* Command Line Examples +.* ************************************************************ +:h2 res=15 id='CommandLineExamples'. +Command Line Examples +:p.:hp2.Command Line Examples:ehp2. +.* +:p.The following examples assume that newview is installed as a complete +replacement and therefore view is actually newview&per. +:p.:hp2.view cmdref:ehp2. +:lm margin=4. +:p.Open the file cmdref&per.inf &lpar.OS&slash.2 Command Reference&rpar. from +the help path&per. +:lm margin=1. +.* +:p.:hp2.view cmdref&plus.os2ug:ehp2. +:lm margin=4. +:p.Open two files&comma. cmdref&per.inf and os2ug&per.inf &lpar.OS&slash.2 User +Guide&rpar.&comma. in the same window&per. +.br +The table of contents from os2ug&per.inf is added to the end of the contents +from cmdref&per.inf&per. The indexes are combined alphabetically&per. +:lm margin=1. +.* +:p.:hp2.view c&colon.&bsl.os2&bsl.book&bsl.os2ug&per.inf:ehp2. +:lm margin=4. +:p.Open the file os2ug&per.inf in the c&colon.&bsl.os2&bsl.book directory&per. +:lm margin=1. +.* +:p.:hp2.view &odq.c&colon.&bsl.os2 book&bsl.os2ug&per.inf&cdq.:ehp2. +:lm margin=4. +:p.Surround path&bsl.file with double quotes if they contain special characters (like blank)&per. +:lm margin=1. +.* +:p.:hp2.view cmdref dir:ehp2. +:lm margin=4. +:p.Open the file cmdref &lpar.OS&slash.2 command reference&rpar. and look in +titles and index for the word &odq.dir&cdq.&per. Will show the help page for the DIR +command&per. +:lm margin=1. +.* +:p.:hp2.view &slash.s os2ug desktop:ehp2. +:lm margin=4. +:p.Open the file os2ug&per.inf and search for the word &odq.desktop&cdq.&per. The best +match is shown&per. +:lm margin=1. +.* +:p.:hp2.view &slash.g permissions:ehp2. +:lm margin=4. +:p.Performs a search of all help files for the word &odq.permissions&cdq.&per. +:lm margin=1. +.* +:p.:hp2.set myhelp&eq.cmdref&plus.os2ug&plus.rexx:ehp2. +.br +:hp2.view myhelp:ehp2. +:lm margin=4. +:p.The first line sets an environment variable MYHELP to contain the names of +three help files&per. The second line opens the three files&per. +:lm margin=1. +.* +.* +.* ************************************************************ +.* Keyboard Shortcuts +.* ************************************************************ +:h1 res=10 id='KeyboardShortcuts'. +Keyboard Shortcuts +:p.:hp2.Keyboard Shortcuts:ehp2. +:p.Most keyboard shortcuts are visible in the menu&comma. but a few are not&per. +The additional shortcuts are&colon. +:p.:hp2.Alt&plus.F4:ehp2. Exit +:p.:hp2.Ctrl&plus.C:ehp2. Copy selected text to clipboard +:p.:hp2.F7:ehp2. Back +:p.:hp2.F8:ehp2. Forward +:p.:hp2.Ctrl&plus.Left:ehp2. Back +:p.:hp2.F11:ehp2. Previous in contents +:p.:hp2.F12:ehp2. Next in contents +:p. +:p.:hp2.Shortcuts visible in the menu:ehp2. +:p.:hp2.Ctrl&plus.O:ehp2. Open files +:p.:hp2.Ctrl&plus.E:ehp2. Open files from help paths +:p.:hp2.Ctrl&plus.N:ehp2. Open a new window +:p.:hp2.Ctrl&plus.P:ehp2. Print topic +:p.:hp2.F3:ehp2. Exit +:p. +:p. +:p.:hp2.Ctrl&plus.A:ehp2. Select all text in topic +:p.:hp2.Ctrl&plus.Ins:ehp2. Copy selected text to clipboard +:p. +:p.:hp2.Ctrl&plus.F:ehp2. Find within current topic +:p.:hp2.Ctrl&plus.G:ehp2. Repeat last find +:p. +:p.:hp2.Ctrl&plus.S:ehp2. Open global search tool +:p. +:p.:hp2.Alt&plus.C:ehp2. Change to the contents tab +:p.:hp2.Alt&plus.I:ehp2. Change to the index tab +:p.:hp2.Alt&plus.S:ehp2. Change to the search tab +:p.:hp2.Alt&plus.N:ehp2. Change to the notes tab +:p.:hp2.Alt&plus.P:ehp2. Toggle the left panel &lpar.tabs&rpar. on and off +:p.:hp2.F5:ehp2. Expand all contents +:p.:hp2.F6:ehp2. Collapse all contents +:p. +:p.:hp2.Esc:ehp2. Back +:p.:hp2.Ctrl&plus.Right:ehp2. Forward +:p.:hp2.Ctrl&plus.Up:ehp2. Previous topic in contents +:p.:hp2.Ctrl&plus.Down:ehp2. Next topic in contents +:p. +:p.:hp2.Ctrl&plus.D:ehp2. Edit bookmarks +:p.:hp2.Ctrl&plus.B:ehp2. Bookmark current topic +:p. +:p.:hp2.Ctrl&plus.M:ehp2. Add note at cursor position +:p. +:p.:hp2.F1:ehp2. Help for NewView +.* +.* +.* ************************************************************ +.* Environment Variables +.* ************************************************************ +:h1 res=11 id='L_EnvironmentVariables'. +Environment Variables +:p.:hp2.Environment Variables:ehp2. +:p. +:p.Both the :hp2.BOOKSHELF:ehp2. and :hp2.HELP:ehp2. environment variables +define paths &lpar.lists of directories&rpar. for searching for help files&per. +NewView uses both paths without distinction&per. +:p.These paths are searched when you&colon. +:p.o specify a help file without a path on the command line +:p.o use the File &endash. Open Special&per.&per.&per. menu item +:p.o do a :link reftype=hd refid='GlobalSearch'.global search:elink. +:p.You can permanently add directories of help files to the :hp2.HELP:ehp2. or +:hp2.BOOKSHELF:ehp2. paths by modifying the CONFIG&per.SYS file&per. Add to both +paths&comma. if you also want old view to be able to find the files&per. +:p.:hp2.Other environment variables:ehp2. +:p.The :hp2.LANG:ehp2. environment variable is examined to decide the default +language that NewView will be displayed in&per. &lpar.Overridden by the +&slash.lang :link reftype=hd refid='AdvancedParameters'.command line +parameter:elink.&per.&rpar. See the newview readme&per.txt for more information +about languages&per. +:p.The directory defined in :hp2.LOGFILES:ehp2. is used for logging crashes or +other information&per. +:p.The subdirectory &odq.lang&cdq. under the directory defined by :hp2.OSDIR:ehp2. is +searched for language files at startup&per. +:p.The path :hp2.ULSPATH:ehp2. is also searched for language files&per. +.* +.* +.* ************************************************************ +.* For Authors and Developers +.* ************************************************************ +:h1 res=20 id='ForAuthors'. +For Authors and Developers +:p.:hp2.For Authors and Developers:ehp2. +:p. +:p.This section contains some notes for document authors and software +developers&per. +:p.Also see the section about URL recognition in the :link reftype=hd +refid='InternetLinks'.Internet Links :elink.topic&per. +.* ************************************************************ +.* Writing Help Files +.* ************************************************************ +:h2 res=12 id='WritingHelpFiles'. +Writing Help Files +:p.:hp2.Writing OS&slash.2 Help Files :ehp2. +:p. +:p.OS&slash.2 Help Files are produced using the IPF Compiler&per. IPF stands for +Information Presentation Facility&per. +:p.The IPF Compiler takes a text file written in a language that tells it about +things like headings&comma. links&comma. text and images&comma. and produces +either a &per.INF or &per.HLP file&per. +:p.The official way to obtain the IPF compiler &lpar.ipfc&per.exe&rpar. is from +the OS&slash.2 Developers Toolkit&per. This is included free with eComStation +&lpar.http&colon.&slash.&slash.www&per.ecomstation&per.com&rpar.&per. +:p.Since the language for IPFC is tedious &lpar.for example all punctuation must +be typed as special keywords&comma. like &.comma&per.&rpar. many people use +other tools besides the IPF compiler itself&per. +:p.I use Vyperhelp +&lpar.http&colon.&slash.&slash.www&per.vyperhelp&per.com&rpar. since it is +simple and graphical&per. It can also export to Windows Help&comma. HTML and +others&comma. though it only runs on OS&slash.2&per. Not free&per. +:p.Some other popular options are&colon. +:p.o HyperText&slash.2 IPF Preprocessor +&lpar.http&colon.&slash.&slash.www&per.clanganke&per.de&slash.os2&slash.sw&slash.htext&slash. +.br +&rpar. &endash. preprocesses a simpler starting language into the very difficult +IPF format&per. Free&per. +:p.o HyperMake +&lpar.http&colon.&slash.&slash.www&per.hypermake&per.com&rpar.&per. +Similar&comma. but can also produce Windows Help and HTML&per. +:p.o Sibyl &lpar.which NewView was created with&rpar. comes with an IPF +preprocessor&per. +:p.o IPFEditor from PCS +&lpar.http&colon.&slash.&slash.www&per.pcs&endash.soft&per.com&slash.productipfe212&per.htm +.br +&rpar.&per. Probably the most complete&comma. but significant cost&per. +Note&colon. NewView doesn&apos.t support everything IPFE can do&xclm. +.br +In the past there were many other options&per. Those listed should still be +available and have some support&per. +.* ************************************************************ +.* Topic Resource IDs +.* ************************************************************ +:h2 res=16 id='TopicResourceIDs'. +Topic Resource IDs +:p.:hp2.Topic Resource IDs:ehp2. +:p.Resource IDs are used by authors of online help for applications&comma. to +identify help topics&per. Applications call the Help Manager specifying a +resource ID&comma. either directly using the HM&us.DISPLAY&us.HELP +message&comma. or indirectly via help tables added to their resources&comma. +which PM automatically handles&per. The resource ID is stored in a table inside +the help file&per. +:p.For document authors&comma. NewView offers the ability to see and find +resource IDs&per. +:p.:hp2.Finding by Resource ID:ehp2. +:p.Use Tools &endash. Find Resource ID to search for a specified resource ID in +all opened files&per. +:p.:hp2.Displaying Resource IDs:ehp2. +:p.Use topic properties &lpar.right mouse click &endash. Properties&rpar. to see +which resource IDs are associated with a topic&per. +.* ************************************************************ +.* TopicNames +.* ************************************************************ +:h2 res=19 id='TopicNames'. +Topic Names +:p.:hp2.Topic Names:ehp2. +:p. +:p.Like resource IDs&comma. topic names can be used by developers to link to +help topics from within their application&comma. using the HM&us.DISPLAY&us.HELP +message with parameter 2 being HM&us.PANELNAME&per. +:p.These are not so often used&per. +:p.NewView can find a particular topic name&comma. using Tools &endash. Find +Topic Name&per. +:euserdoc. diff --git a/docview/docs/inf04.txt b/docview/docs/inf04.txt new file mode 100644 index 00000000..ac7cca8d --- /dev/null +++ b/docview/docs/inf04.txt @@ -0,0 +1,665 @@ + OS/2 2.0 Information Presentation Facility (IPF) Data Format - version 2 + ----------------------------------------------------------------------- - + + *** introduction to version 1 *** + + Having become extremely frustrated by VIEW.EXE's penchant for windows + that come and go, without even opening large enough to see everything + in them, I thought I'd try to turn .INF files into something more + conventional. While I don't have code to offer, I can tell you what I + learned about .INF format--it was enough to produce more-or-less + readable more-or-less plaintext from .INFs. + + I offer this in the hope that somebody will give the community a + really nice, tasteful, convenient, doesn't-use-too-much-screen-real-estate + .INF browser to replace VIEW.EXE. + + All of this was developed by looking at .INF files without any + documentation of the format except what VIEW.EXE showed for a + particular feature. + + I don't have a lot of personal interest in refining this document with + additional escape sequences, etc., but I would be happy to correspond + with someone who wanted to fill in the details, or to clarify anything + that may be confusing. If someone could point us to an official document + describing the format that would be most helpful. + + -- Carl Hauser (chauser.parc@xerox.com) + + + *** introduction to version 2 *** + + The original document contained most of the real tricky stuff in the file + format (especially the compression algorithm) so going on from there was + mainly a task of creating lots of help files using the IPFC and the + decompiling them again to see what came out. + + I fixed a few minor bugs in the description of the header which was + extended to describe the entire structure I believe to be the header + (because variable data starts afterwards). + + A number of escape codes have also been added and the descriptions of + others have been refined. There are still a lot of question marks about + the format, but this description already allows disassembling the text + into ASCII form in a fairly true-to-life format (including indentations + etc.). + + Further research should go into the way multiple windows are handled + (I didn't work on that because I have never required multiple window + displays in my help files and therefore am not familiar with the concepts). + Font usage and graphics linking could also use some more fiddling around. + + -- Marcus Groeber (marcusg@ph-cip.uni-koeln.de - Fidonet 2:243/8605.1) + + + *** introduction to version 3 *** + + Just a bit of an update and flesh out ;-) + + -- Peter Childs (pjchilds@apanix.apana.org.au) + + + *** Version 4 **** + + Further additions as found while writing NewView + + -- Aaron Lawrence + + Some more info and corrections while writing fpGUI's DocView + + -- Graeme Geldenhuys + + + **** Types **** + + All numeric quantities are least-significant-byte first in the file + (little-endian). + + bit1 1 bit boolean \ used only for explaining + int4 4 bit unsigned integer / packed structures + char8 8 bit character (ASCII more-or-less) + int8 8 bit unsigned integer + int16 16 bit unsigned integer + int32 32 bit unsigned integer + + + **** The File Header **** + + Starting at file offset 0 the following structure can overlay the file + to provide some starting values: + { + int16 ID; // ID magic word (5348h = "HS") + int8 unknown1; // unknown purpose, could be third letter of ID + int8 flags; // probably a flag word... + // bit 0: set if INF style file + // bit 4: set if HLP style file + // patching this byte allows reading HLP files + // using the VIEW command, while help files + // seem to work with INF settings here as well. + int16 hdrsize; // total size of header + int16 unknown2; // unknown purpose + int16 ntoc; // 16 bit number of entries in the tocarray + int32 tocstrtablestart; // 32 bit file offset of the start of the + // toc entries (this is redundant info; + // the individual offsets are stored starting + // at tocstart) + int32 tocstrlen; // number of bytes in file occupied by the + // table-of-contents entries + int32 tocstart; // 32 bit file offset of the start of tocarray + int16 nres; // number of panels with resource numbers + int32 resstart; // 32 bit file offset of resource number table + int16 nname; // number of panels with textual name + int32 namestart; // 32 bit file offset to panel name table + int16 nindex; // number of index entries + int32 indexstart; // 32 bit file offset to index table + int32 indexlen; // size of index table + int8 unknown3[10]; // unknown purpose + int32 searchstart; // 32 bit file offset of full text search table + int32 searchlen; // size of full text search table + int16 nslots; // number of "slots" + int32 slotsstart; // file offset of the slots array + int32 dictlen; // number of bytes occupied by the "dictionary" + int16 ndict; // number of entries in the dictionary + int32 dictstart; // file offset of the start of the dictionary + int32 imgstart; // file offset of image data + int8 unknown4; // unknown purpose + int32 nlsstart; // 32 bit file offset of NLS table + int32 nlslen; // size of NLS table + int32 extstart; // 32 bit file offset of extended data block + int8 unknown5[12]; // unknown purpose + char8 title[48]; // ASCII title of database + } + + + **** The table of contents entries **** + + Beginning at each file offset, tocentrystart[i]: + { + int8 len; // length of the entry including this byte (but not including extended data?) + int8 flags; // flag byte, description folows (MSB first) + // bit7 haschildren; // following nodes are a higher level + // bit6 hidden; // this entry doesn't appear in VIEW.EXE's + // presentation of the toc + // bit5 extended; // extended entry format + // bit4 // ?? + // int4 level; // nesting level + int8 ntocslots; // number of "slots" occupied by the text for + // this toc entry + } + + if the "extended" bit is not 1, this is immediately followed by + + { + int16 tocslots[ntocslots]; // indices of the slots that make up + // the article for this entry + char8 title[]; // the remainder of the tocentry + // until len bytes have been used [not + // zero terminated] + } + + if extended is 1 there are intervening bytes that describe + the kind, size and position of the window in which to display the + article. First, there are two flag bytes: + { + int8 w1; + // bit 3: Window controls are specified + // bit 2: Viewport + // bit 1: Size is specified. + // bit 0: Position is specified. + int8 w2; + // bit 3: + // bit 2: Group is specified. + // bit 1 + // bit 0: Clear (all windows before display) + } + Then the following optional fields may appear, as specified by w1: + + Origin ( 5 bytes ) + { + int8 Flags; + // bits 4-7: X position type + // bits 0-3: Y position type + int16 XPosition; // meaning depends on type + int16 YPosition; + } + + Position types are: + 0 = absolute character + 1 = relative % + 2 = absolute pixel + 3 = absolute points + For these types, the position is simply a number. + If one of the positions is not specified then the type will be 0 + and the value will be -1 (65535) + + 4 = dynamic + For this type the position is one of the following values: + 1: left + 2: right + 4: top; + 8: bottom + 16: center. + + Size ( 5 bytes ) + { + int8 Flags; + // bits 4-7: Width type + // bits 0-3: Height type + int16 Width; + int16 Height; + } + + Width/height type are same as position types, above, except that dynamic is not used. + + Window controls ( 2 bytes ) + 0, 112 means everything is turned off. + 8, 103 means no scroll bars IIRC + + Group ( 2 bytes ) + { + int16 GroupNumber; + } + GroupNumber is basically a 'frame' or window number. + + + Here's a C code fragment for computing the number of bytes to skip + int bytestoskip = 0; + if (w1 & 0x8) { bytestoskip += 2 }; + if (w1 & 0x1) { bytestoskip += 5 }; + if (w1 & 0x2) { bytestoskip += 5 }; + if (w2 & 0x4) { bytestoskip += 2 }; + + skip over bytestoskip bytes (after w2) and find the tocslots and title + as in the non-extended case. + + + **** The table of contents array **** + + Beginning at file offset tocstart, this structure can overlay the + file: + { + int32 tocentrystart[ntoc]; // array of file offsets of + // tocentries (above) + } + + + **** The Slots array **** + + Beginning at file offset slotsstart (provided by the file header) find + { + int32 slots[nslots]; // file offset of the article + // corresponding to this slot + } + + + **** The Dictionary **** + + Beginning at file offset dictstart (provided by the file header) and + continuing until ndict entries have been read (and dictlen bytes have + been consumed from the file) find a sequence of length-preceeded + strings. Note that the length includes the length byte (not Pascal + compatible!). Build a table mapping i to the ith string. + { + char8* strings[ndict]; + } + + + **** The Article entries **** + + Beginning at file offset slots[i] the following structure can overlay + the file: + { + int8 stuff; // ?? [always seen 0] + int32 localdictpos; // file offset of the local dictionary + int8 nlocaldict; // number of entries in the local dict + int16 ntext; // number of bytes in the text + int8 text[ntext]; // encoded text of the article + } + + + **** The Local dictionary **** + + Beginning at file position localdictpos (for each article) there is an + array: + { + int16 localwords[nlocaldict]; + } + + + **** The Text **** + + The text for an article then consists of words obtained by referencing + strings[localwords[text[i]]] for i in (0..ntext), with the following + exceptions. If text[i] is greater than nlocaldict it means + + 0xfa => end-of-paragraph, sets spacing to TRUE if not in monospace + 0xfb => [unknown] + 0xfc => spacing = !spacing + 0xfd => line break (outside an example: ".br", + sets spacing to TRUE if not in a + monospace example) + 0xfe => space + 0xff => escape sequence // see below + + When spacing is true, each word needs a space put after it. When + false, the words are abutted and spaces are supplied using 0xfe or the + dictionary. Examples are entered and left with 0xff escape sequences. + The variable "spacing" is initially (start of every article slot) TRUE. + + + **** 0xff escape sequences **** + + These are used to change fonts, make cross references, enter and leave + examples, etc. The general format is + { + int8 FF; // always equals 0xff + int8 esclen; // length of the sequence (including + // esclen but excluding FF) + int8 escCode; // which escape function + } + + escCodes I have partially deciphered are + + 0x01 => unknown + + 0x02 or 0x11 => (esclen==3) set left margin. + or 0x12 0x11 always starts a new line. Arguments + { + int8 margin; // in spaces, 0=no margin + } + note: in an IPF source, you must code + :lm margin=256. to reset the left margin. + + 0x03 => (esclen==3) set right margin. Arguments + { + int8 margin; // in spaces, 1=no margin + } + + 0x04 => (esclen==3) change style. Arguments + { + int8 style; // 1,2,3: same as :hp#. + // 4,5,6: same as :hp5,6,7. + // 0 returns to plain text + } + + 0x05 => (esclen varies) beginning of cross + reference. The next two bytes of the + escape sequence are an int16 index of + the tocentrystart array. The + remaining bytes (if any) describe the size, + position and characteristics of the + window created when the + cross-reference is followed by VIEW. + Flag1 bit 7: 'split' window + + bit 6: autolink + bit 3: window controls specified + bit 2: viewport + bit 1: target size supplied + bit 0: target position supplied + Flag2 bit 0: ? + bit 1: dependent + bit 2: group supplied + + + 0x06 => unknown + + 0x07 => (esclen==4) footnote start (:fn. tag). Arguments: + { + int16 toc; // toc entry number of text + } + footnotes end with 0x08 + + 0x08 => (escLen==2) end of cross reference + introduced by escape code 0x05 or 0x07 + + 0x09 => unknown + + 0x0A => unknown + + 0x0B => (escLen==2) begin monosp. example. set + spacing to FALSE + + 0x0C => (escLen==2) end monosp. example. set + spacing to TRUE + + 0x0D => (escLen==2) special text colors. Arguments: + { + int8 color; // 1,2,3: same as :hp4,8,9. + // 0: default color + } + + 0x0E => Bitmap. + { + int8 flags; + 4: runin flag + 3: fit (scale) to window + 2: align center + 1: align right + 0: always set? + int32 bitmapStartOffset; + } + e.g. first bitmap always has offset 0 + + 0x0F => if esclen==5 an inlined cross + reference: the title of the referenced + article becomes part of the text. + This is probably the case even if + esclen is not 5, but I don't know the + decoding. In the case that esclen is + 5, I don't know the purpose of the + byte following the escCode, but the + two bytes after that are an int16 + index of the tocentrystart array. + + 0x10 => [special link, reftype=launch] + { + int8 unknown; ? + char launch_string[ esclen - 3 ]; + } + + + 0x13 or 0x14 => (esclen==2) Set foreground (0x13) + and background (0x14) color. Arguments: + { + int8 color; + \\ 0 - default + \\ 1 - blue + \\ 2 - red + \\ 3 - ?? + \\ 4 - green + \\ 5 - cyan + \\ 6 - yellow + \\ 7 - neutral + } + + 0x15 => unknown + + 0x16 => [special link, reftype=inform] + + 0x17 => hide text (:hide. tag). Arguments: + { + char8 key[]; // key required to show text + } + + 0x18 => end of hidden text (:ehide.) + + 0x19 => (esclen==3) change font. Arguments + { + int8 fontTableIndex (?); + } + + 0x1A => (escLen==3) begin :lines. sequence. set + spacing to FALSE. Arguments + { + int8 alignment; // 1,2,4=left,right,center + } + + 0x1B => (escLen==2) end :lines. sequence. set + spacing to TRUE + + 0x1C => (escLen==2) Set left margin to current + position. Margin is reset at end of + paragraph. + + 0x1F => [special link, reftype=hd database=...] + + 0x20 => (esclen==4) :ddf. tag. Arguments: + { + int16 res; // value of res attribute + } + + The font used in the text is the normal IBM extended character set, + including line graphics and some of the characters below 32. + + + **** The resource number array **** + + Beginning at file offset resstart, this structure can overlay the + file: + { + int16 res[nres]; // resource number of panels + int16 toc[nres]; // toc entry number of panel + } + + + **** The text name array **** + + Beginning at file offset namestart, this structure can overlay the + file: + { + int16 name[nres]; // index to panel name in dictionary + int16 toc[nres]; // toc entry number of panel + } + + + **** The index table **** + + Beginning at file offset indexstart, a structure like the following + is stored for each of the nindex words (in alphabetical order). + { + int8 nword; // size of name + int8 level; // ? indent level + // bit 6 set: global entry + // bit 1 set: indent (:i2.) + bit 0 always set? + int8 number of roots; // number of root references following + int16 toc; // toc entry number of panel + char8 word[nword]; // index word [not zero-terminated] + + there are n roots following: + int32 synonyms; // 32 bit file offset to start of synonyms referencing this word + } + + + **** The extended data block **** + + Not yet decoded. This block has a size of 64 bytes and contains various + pointers to font names, names of externel databases etc. + + + **** The full text search table **** + + Not yet decoded. This table is supressed when "/S" is specified on + the IPFC command line. + + In addition to data in... + + RLE: + + byte RLEType; // ? always 1? + + Then a sequence of blocks, until all data used: + + byte Header; + // bits 0-6 are N + // bit 7: + // 0: there are N + 1 repeats of next byte. + // 1: N + 1 blocks of 'as is' data follow. + // except + // value $80 means (?) the next byte contains the data byte, + // and the next 2 bytes after that contain a 16 bit repeat number. + + + e.g. 04 00 means 5 repeats of 0 + 83 12 34 56 78 means the literal data 12 34 56 78 + 80 00 62 01 means $162 repeats of 0 + byte DataByte; // with escapes + // bit 7 set means there are actually N+1 (=bits0-6) bytes of data to follow + // 0 means there is a single byte of data to follow (e.g. when the byte > 80) + ( optionally ) byte[ N+1 ] data + int16 Number of zeroes to follow + + + **** Image data **** + + Beginning at file offset imgstart, this data is a series of compressed + OS/2 bitmaps. + Each starts with a BITMAPFILEHEADER: + { + int16 usType; // 'bM' for bitmap + int32 cbSize; // total bitmap size including header + // BEFORE compression: not correct in this context + int16 xHotspot; // only for icons/pointers, not relevant here? + int16 yHotspot; + int32 offBits; // offset to the actual bitmap data bits + BITMAPINFOHEADER bmp; // further bitmap data: + int32 cbFix; // length of bitmapinfo header structure (12) + // (including this field) + int16 cx; // bitmap width + int16 cy; // bitmap height + int16 cPlanes; // num bitplanes - always 1 AFAIK + int16 bitCount; // bits per pixel e.g. 4 = 16 colors + + RGB palette[ N ]; // 2 ^ bitCount * 3 bytes + + bitmapData; // in a special IPF format: + int32 totalLength; // not including this field, but including the next + int16 bitmapSize; // total size of memory required + // for uncompressed bitmap i.e. + // bytes per line rounded up to longword (4byte) + // x rows + // (This info is redundant) + + Followed by a series of blocks each up to 64k uncompressed. + Blocks: + int16 dataLength; // length of data following (including data type field) + + int8 dataType; // 0 = uncompressed + 2 = compressed + data... + Compression is LZW (Lempel Ziv Welch) + + } + + + **** NLS table **** + + Not yet decoded. This table contains informations specific to the + language and codepage the document was prepared in. It seems to contain + some bitfields as well that might be used for character classification. + + +Appendix 1: +----------- +Some useful translations from IBM Extended ASCII to normal ASCII + + One other transformation I had to make was of the character box + characters of the IBM extended ASCII set. These characters appear in strings + in the dicitonary. They are given here in octal together with their translation. + + 020, 021 => blank seems satisfactory + 037 => solid down arrow: used to give direction to + a line in the syntax diagrams + 0263 => vertical bar + 0264 => left connector: vertical bar with short + horizontal bar extending left from the + center + 0277, 0300 => top right or bottom left corner; one is + one, the other is the other and I + can't tell which from my translation + 0301 => up connector: horizontal line with vertical + line extending up from the center + 0302 => down connector: horizontal line with + vertical line extending down from the + center + 0303 => right connector: vertical bar with short + horizontal bar extending right from + the center + 0304 => horizontal bar + 0305 => cross connector, i.e. looks like + only + slightly larger to connect with + adjacent chars + 0331, 0332 => top left or bottom right corner; one is + one, the other is the other and I + can't tell which from my translation + + +Appendix 2: +----------- +Style codes for escCode 0x04 and 0x0D + + escCode 0x04 implements font changes associated with the :hp# IPF source tag. + + :hp1 is italic font + :hp2 is bold font + :hp3 is bold italic font + :hp5 is normal underlined font + :hp6 is italic underlined font + :hp7 is bold underlined font + + tags :hp4, :hp8, and :hp9 introduce different colored text which is encoded in + the .inf or .hlp file using escCode 0x0D. On my monitor normal text is dark blue. + + :hp4 text is light blue + :hp8 text is red + :hp9 text is magenta + + + +History: +-------- +October 22, 1992: version for initial posting (inf01.doc) +July 12, 1993: second version (refer to introduction for changes) (inf02.doc) +July 18, 1993: added appendices to the second version (inf02a.doc) + diff --git a/docview/images/docview-48x48.png b/docview/images/docview-48x48.png Binary files differnew file mode 100644 index 00000000..50758936 --- /dev/null +++ b/docview/images/docview-48x48.png diff --git a/docview/images/docview-48x48.xcf b/docview/images/docview-48x48.xcf Binary files differnew file mode 100644 index 00000000..80e925c1 --- /dev/null +++ b/docview/images/docview-48x48.xcf diff --git a/docview/images/go-down.bmp b/docview/images/go-down.bmp Binary files differnew file mode 100644 index 00000000..60676d0b --- /dev/null +++ b/docview/images/go-down.bmp diff --git a/docview/images/go-next.bmp b/docview/images/go-next.bmp Binary files differnew file mode 100644 index 00000000..1da9e144 --- /dev/null +++ b/docview/images/go-next.bmp diff --git a/docview/images/go-previous.bmp b/docview/images/go-previous.bmp Binary files differnew file mode 100644 index 00000000..6143639b --- /dev/null +++ b/docview/images/go-previous.bmp diff --git a/docview/images/go-up.bmp b/docview/images/go-up.bmp Binary files differnew file mode 100644 index 00000000..7b916d8f --- /dev/null +++ b/docview/images/go-up.bmp diff --git a/docview/images/inf-book-48x48.png b/docview/images/inf-book-48x48.png Binary files differnew file mode 100644 index 00000000..cb4b1761 --- /dev/null +++ b/docview/images/inf-book-48x48.png diff --git a/docview/images/install_splash.xcf b/docview/images/install_splash.xcf Binary files differnew file mode 100644 index 00000000..576aff4a --- /dev/null +++ b/docview/images/install_splash.xcf diff --git a/docview/images/missing.bmp b/docview/images/missing.bmp Binary files differnew file mode 100644 index 00000000..d8189537 --- /dev/null +++ b/docview/images/missing.bmp diff --git a/docview/install/docview-mime.xml b/docview/install/docview-mime.xml new file mode 100644 index 00000000..86674794 --- /dev/null +++ b/docview/install/docview-mime.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> + <mime-type type="application/inf"> + <comment>Compiled INF Help File</comment> + <acronym>INF</acronym> + <expanded-acronym>Information Help File</expanded-acronym> + <magic priority="50"> + <match type="string" offset="0" value="HSP"/> + </magic> + <glob pattern="*.inf"/> + <alias type="application/x-inf"/> + </mime-type> +</mime-info> diff --git a/docview/install/docview.desktop b/docview/install/docview.desktop new file mode 100644 index 00000000..53c007d6 --- /dev/null +++ b/docview/install/docview.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +Name=fpGUI DocView +GenericName=INF Help Viewer +Comment=A INF Documentation Viewer +Exec=docview %f +Terminal=false +Type=Application +Icon=docview.png +Categories=Utility;Application; +StartupWMClass=docview +MimeType=application/x-inf; + + diff --git a/docview/install/linux.readme.txt b/docview/install/linux.readme.txt new file mode 100644 index 00000000..b9af5a93 --- /dev/null +++ b/docview/install/linux.readme.txt @@ -0,0 +1,39 @@ + +Registering the INF file format and fpGUI Documentation Viewer +with Linux is pretty straight forward. Simply execute the following +commands for a console window. + +Steps: +------ +1 $ cd <fpgui> <-- replace <fpgui> the the appropriate + directory location on you system. + +2. $ cp images/docview-48x48.png ~/.icons/docview.png + +3. $ cp images/inf-book-28x48.png ~/.icons/inf-help.png + +4. $ cd ~/.icons; ln -s inf-help.png application-inf.png + +5. $ cp install/docview.desktop ~/.local/share/applications/ + +6. $ cp docview-mime.xml ~/.local/share/mime/packages + +7. $ update-mime-database ~/.local/share/mime/ + + + You are done! + +****** The rest is not needed anymore ******** + + +Gnome now knows the mime type for *.inf files. Now to setup the new default +icon Nautilus will show for *.inf files, you need to do these two steps. + + +8. $ mkdir ~/.icons/gnome/48x48/mimetypes + +9. $ ln -s ~/.icons/inf-help.png ~/.icons/gnome/48x48/mimetypes/gnome-mime-application-inf.png + +Now you are all done! + + diff --git a/docview/src/CompareWordUnit.pas b/docview/src/CompareWordUnit.pas new file mode 100644 index 00000000..49c2ea26 --- /dev/null +++ b/docview/src/CompareWordUnit.pas @@ -0,0 +1,107 @@ +Unit CompareWordUnit; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2001 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +// Compares words and produces a match level (relevance) based +// on the relative sizes etc. Used in searching help files +// to sort by relevance. + +const + // word weightings + mwExactWord = 20; + mwWordStart = 10; + mwWordWithin = 5; + +// Compares the given search word against the given +// reference word. Returns a value indicating how well the +// search word matches, 0 = not at all. +function CompareWord( const SearchWord: string; + const ReferenceWord: string ): longint; + +Implementation + +uses + SysUtils; + +// LOoks for string a within string b, case insensitively +function CaseInsensitivePos( const a, b: string ): longint; +begin + // Budget implementation to begin with. + Result := Pos( UpperCase( a ), UpperCase( b ) ); +end; + +function CompareWord( const SearchWord: string; + const ReferenceWord: string ): longint; +var + OccurrencePos: longint; +begin + Result := 0; + // First up, if the word we're searching for is longer than + // this word, then it can't match at all. + if Length( SearchWord ) > Length( ReferenceWord ) then + exit; + + OccurrencePos := CaseInsensitivePos( SearchWord, ReferenceWord ); + if OccurrencePos = 0 then + // no match. + exit; + + if Length( SearchWord ) = Length( ReferenceWord ) then + begin + // exact word match (except case) + Result := mwExactWord; + exit; + end; + + // partial word match + if OccurrencePos = 1 then + begin + // word starts with searchword + Result := mwWordStart + * Length( SearchWord ) + div Length( ReferenceWord ); + if Result = 0 then + Result := 1; + exit; + end; + + // Matched searchword somewhere within word + Result := mwWordWithin + * Length( SearchWord ) + div Length( ReferenceWord ); + if Result = 0 then + Result := 1; + +end; + +{// Note: searchstring must be uppercase, +function IsMatching( const SearchString: string; + const SearchType: TSearchType; + const Item: string ): boolean; +var + temp: string; +begin + case SearchType of + stStarts: + Result:= StrStarts( SearchString, Item ); + + stContains: + begin + temp:= UpperCase( Item ); + Result:= Pos( SearchString, temp ) <> 0; + end; + + stMatches: + Result:= CompareText( SearchString, + Item )= 0; + end; +end; +} +Initialization +End. diff --git a/docview/src/HelpBitmap.pas b/docview/src/HelpBitmap.pas new file mode 100644 index 00000000..5868f336 --- /dev/null +++ b/docview/src/HelpBitmap.pas @@ -0,0 +1,570 @@ +unit HelpBitmap; + +interface + +// Encapsulates a bitmap as stored in a IPF file. +// Once created from file data they can be used as a normal bitmap. + +uses + Classes, SysUtils, fpg_main, ctypes, + IPFFileFormatUnit; + +type + EHelpBitmapException = class( Exception ); + + + // Lead part of BITMAPARRAYFILEHEADER + INFBITMAPARRAYHEADER = packed record + usType: uint16; // 'BA', 16706 + cbSize: uint32; // Size of the BITMAPARRAYFILEHEADER structure in bytes. + offNext: uint32; // Offset of the next BITMAPARRAYFILEHEADER structure from the start of the file. + cxDisplay: uint16; // Device width, in pels. + cyDisplay: uint16; // Device height, in pels. + end; + + + INFBITMAPHEADER = packed record + // BITMAP FILE HEADER + usType: uint16; // = 'bM' + cbSize: uint32; + xHotspot: uint16; + yHotspot: uint16; + offBits: uint32; // =size(hdr)+size(palette) + // BITMAP INFO HEADER + cbFIx: uint32; // =size(info_hdr) (usually = 12?) + cx: uint16; // width size + cy: uint16; // height size + cPlanes: uint16; // planes, =1 (always seems to be one) + cBitCount: uint16; // bits per pixel + // followed by RGB triples if <= 8bpp + end; + + TRGB = packed record + Blue: uint8; + Green: uint8; + Red: uint8; + end; + + TRGBA = packed record + Blue: uint8; + Green: uint8; + Red: uint8; + Reserved: uint8; + end; + + + THelpBitmap = class( TfpgImage ) + protected + _Header: INFBITMAPHEADER; + _PaletteColorCount: longint; + _pPalette: ^TRGB; + _BitsSize: longint; + FileHandle: TFileStream; + _UncompressedBlockSize: longint; + function GetPaletteSize: longint; + procedure BitmapError(Msg: string); + procedure DecompressLZW(var Buffer: Pointer; const Count: integer; var NewBuffer: PByte; var NewCount: integer); + procedure ReadBitmapData( Blocks: TList; TotalSize: longint ); + public + constructor CreateFromHelpFile(var AFileHandle: TFileStream; Offset: longint); + destructor Destroy; override; + end; + + +var + LZWDecompressBlock: function( pInput: PBYTE; + pOutput: PBYTE; + bytesIn: uint32; + Var bytesOut: uint32; + Var FinalCode: byte ): Boolean; +// APIENTRY; +// 'newview' index 1; + +implementation + +uses + nvUtilities, Math, fpg_imgfmt_bmp; + +const + BFT_bMAP =$4d62; // 'bM' + BFT_BITMAP_ARRAY = $4142; // 'BA' + +type + INFBITMAPDATAHEADER = packed record + ulTotalSize: uint32; + usUncompressedBlockSize: uint16; // bytes per block, after decompression + end; + + TBitmapBlock = class(TObject) + public + _Size: uint16; + _CompressionType: uint8; + _Data: PBYTE; + destructor Destroy; override; + end; + +destructor TBitmapBlock.Destroy; +begin + FreeMem( _Data ); + inherited Destroy; +end; + +constructor THelpBitmap.CreateFromHelpFile(var AFileHandle: TFileStream; Offset: longint); +var + WordsPerLine: longint; + LineSize: longint; + DataHeader: INFBITMAPDATAHEADER; + BytesRead: longint; + + Block: TBitmapBlock; + p: pointer; + Blocks: TList; + BlockIndex: longint; + ImageType: uint16; + BitmapArrayHeader: INFBITMAPARRAYHEADER; + bytes: integer; +begin + inherited Create; + FileHandle := AFileHandle; + + FileHandle.Seek(Offset, soBeginning); + bytes := FileHandle.Read(ImageType, sizeof(ImageType)); + if bytes <> SizeOf(ImageType) then + raise EHelpBitmapException.Create( 'Failed to read ImageType.' ); + + if ImageType = BFT_BITMAP_ARRAY then + begin + // skip array header and read first bitmap only + FileHandle.Seek(Sizeof( BitmapArrayHeader ) - sizeof( ImageType ), soCurrent); + end + else + begin + // skip back over imagetype bytes to read header. + FileHandle.Seek(- sizeof( ImageType ), soCurrent); + end; + + // Read bitmap header + bytes := FileHandle.Read(_Header, SizeOf(_Header)); + if bytes <> SizeOf(_Header) then + raise EHelpBitmapException.Create( 'Failed to read Header.' ); + + // Check it's got a valid type + if _Header.usType <> BFT_bMAP then + raise EHelpBitmapException.Create( 'Invalid bitmap header' ); + + _Header.usType := $4d42; // sibyl only accepts 'BM' not 'bM' + + // We can only parse bitmaps with 1 colour plane + // (I can't be bothered and have never seen bitmaps + // with more than 1 color plane) + if _Header.cPlanes <> 1 then + exit; + + _PaletteColorCount := 0; + if _Header.cBitCount < 24 then + _PaletteColorCount := 1 shl _Header.cBitCount; + + // OS/2 always rounds bitmap rows up to a word: + WordsPerLine := ( _Header.cBitCount * _Header.cx + 31 ) div 32; + LineSize := WordsPerLine * 4; + + // Total size of the bitmap pixel data + _BitsSize := LineSize * _Header.cy; + + // Correct header offset - it is wrong in the header (why?) + _Header.OffBits := sizeof( _Header ) + GetPaletteSize; // TODO: Graeme, double check this! + + // Load palette + if _Header.cBitCount <= 8 then + begin + _pPalette := GetMem( GetPaletteSize ); + bytes := FileHandle.Read(_pPalette, GetPaletteSize); + if bytes <> GetPaletteSize then + raise EHelpBitmapException.Create( 'Failed to read Palette.' ); + end; + + // Read data header + FillChar( DataHeader, sizeof( DataHeader ), 0 ); + bytes := FileHandle.Read(DataHeader, SizeOf(DataHeader)); + if bytes <> SizeOf(DataHeader) then + raise EHelpBitmapException.Create( 'Failed to read DataHeader.' ); + _UncompressedBlockSize := DataHeader.usUncompressedBlockSize; + + // For counting total size, we have already read some bytes: + // the uncompressedblocksize field + BytesRead := sizeof( DataHeader.usUncompressedBlockSize ); + Blocks := TList.Create; + + while BytesRead < DataHeader.ulTotalSize do + begin + Block := TBitmapBlock.Create; + + // Read the block size + FileHandle.Read(Block._Size, SizeOf(Block._Size)); + inc( BytesRead, sizeof( Block._Size ) ); + + // Read the compression type + FileHandle.Read(Block._CompressionType, SizeOf(Block._CompressionType)); + inc( BytesRead, sizeof( Block._CompressionType ) ); + + // since size in the file includes this compression type field, subtract it + dec( Block._Size, sizeof( Block._CompressionType ) ); + + // Now read the block + Block._Data := GetMem( Block._Size ); + FileHandle.Read(Block._Data, Block._Size); + + inc( BytesRead, Block._Size ); + Blocks.Add( Block ); + end; + + ReadBitmapData( Blocks, sizeof( _Header ) + GetPaletteSize + _BitsSize ); + + for BlockIndex := 0 to Blocks.Count - 1 do + begin + Block := TBitmapBlock(Blocks[ BlockIndex ]); + Block.Free; + end; + + Blocks.Free; +end; + +function THelpBitmap.GetPaletteSize: longint; +begin + Result := sizeof( TRGB ) * _PaletteColorCount; +end; + +procedure THelpBitmap.BitmapError(Msg: string); +begin + //Msg:=Msg+' at position '+IntToStr(s.Position); + //if fStartPos>0 then + // Msg:=Msg+'(BitmapPosition='+IntToStr(fStartPos)+')'; + raise EHelpBitmapException.Create(Msg); +end; + +destructor THelpBitmap.Destroy; +begin + FreeMem( _pPalette ); + inherited Destroy; +end; + +procedure THelpBitmap.DecompressLZW(var Buffer: Pointer; const Count: Integer; var NewBuffer: PByte; var NewCount: integer); +type + TLZWString = packed record + Count: integer; + Data: PByte; + end; + PLZWString = ^TLZWString; +const + ClearCode = 256; // clear table, start with 9bit codes + EoiCode = 257; // end of input +var +// NewBuffer: PByte; +// NewCount: PtrInt; + NewCapacity: PtrInt; + SrcPos: PtrInt; + SrcPosBit: integer; + CurBitLength: integer; + Code: Word; + Table: PLZWString; + TableCapacity: integer; + TableCount: integer; + OldCode: Word; + + function GetNextCode: Word; + var + v: Integer; + begin + Result:=0; + // CurBitLength can be 9 to 12 + //writeln('GetNextCode CurBitLength=',CurBitLength,' SrcPos=',SrcPos,' SrcPosBit=',SrcPosBit,' ',hexstr(PByte(Buffer)[SrcPos],2),' ',hexstr(PByte(Buffer)[SrcPos+1],2),' ',hexstr(PByte(Buffer)[SrcPos+2],2)); + // read two or three bytes + if CurBitLength+SrcPosBit>16 then begin + // read from three bytes + if SrcPos+3>Count then BitmapError('LZW stream overrun'); + v:=PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + v:=v shr (24-CurBitLength-SrcPosBit); + end else begin + // read from two bytes + if SrcPos+2>Count then BitmapError('LZW stream overrun'); + v:=PByte(Buffer)[SrcPos]; + inc(SrcPos); + v:=(v shl 8)+PByte(Buffer)[SrcPos]; + if CurBitLength+SrcPosBit=16 then + inc(SrcPos); + v:=v shr (16-CurBitLength-SrcPosBit); + end; + Result:=v and ((1 shl CurBitLength)-1); + SrcPosBit:=(SrcPosBit+CurBitLength) and 7; + //writeln('GetNextCode END SrcPos=',SrcPos,' SrcPosBit=',SrcPosBit,' Result=',Result,' Result=',hexstr(Result,4)); + end; + + procedure ClearTable; + var + i: Integer; + begin + for i:=0 to TableCount-1 do + ReAllocMem(Table[i].Data,0); + TableCount:=0; + end; + + procedure InitializeTable; + begin + CurBitLength:=9; + ClearTable; + end; + + function IsInTable(Code: word): boolean; + begin + Result:=Code<258+TableCount; + end; + + procedure WriteStringFromCode(Code: integer; AddFirstChar: boolean = false); + var + s: TLZWString; + b: byte; + begin + //WriteLn('WriteStringFromCode Code=',Code,' AddFirstChar=',AddFirstChar,' x=',(NewCount div 4) mod IDF.ImageWidth,' y=',(NewCount div 4) div IDF.ImageWidth,' PixelByte=',NewCount mod 4); + if Code<256 then begin + // write byte + b:=Code; + s.Data:=@b; + s.Count:=1; + end else if Code>=258 then begin + // write string + if Code-258>=TableCount then + BitmapError('LZW code out of bounds'); + s:=Table[Code-258]; + end else + BitmapError('LZW code out of bounds'); + if NewCount+s.Count+1>NewCapacity then begin + NewCapacity:=NewCapacity*2+8; + ReAllocMem(NewBuffer,NewCapacity); + end; + System.Move(s.Data^,NewBuffer[NewCount],s.Count); + //for i:=0 to s.Count-1 do write(HexStr(NewBuffer[NewCount+i],2)); // debug + inc(NewCount,s.Count); + if AddFirstChar then begin + NewBuffer[NewCount]:=s.Data^; + //write(HexStr(NewBuffer[NewCount],2)); // debug + inc(NewCount); + end; + //writeln(',WriteStringFromCode'); // debug + end; + + procedure AddStringToTable(Code, AddFirstCharFromCode: integer); + // add string from code plus first character of string from code as new string + var + b1, b2: byte; + s1, s2: TLZWString; + p: PByte; + begin + //WriteLn('AddStringToTable Code=',Code,' FCFCode=',AddFirstCharFromCode,' TableCount=',TableCount,' TableCapacity=',TableCapacity); + // grow table + if TableCount>=TableCapacity then begin + TableCapacity:=TableCapacity*2+128; + ReAllocMem(Table,TableCapacity*SizeOf(TLZWString)); + end; + // find string 1 + if Code<256 then begin + // string is byte + b1:=Code; + s1.Data:=@b1; + s1.Count:=1; + end else if Code>=258 then begin + // normal string + if Code-258>=TableCount then + BitmapError('LZW code out of bounds'); + s1:=Table[Code-258]; + end else + BitmapError('LZW code out of bounds'); + // find string 2 + if AddFirstCharFromCode<256 then begin + // string is byte + b2:=AddFirstCharFromCode; + s2.Data:=@b2; + s2.Count:=1; + end else begin + // normal string + if AddFirstCharFromCode-258>=TableCount then + BitmapError('LZW code out of bounds'); + s2:=Table[AddFirstCharFromCode-258]; + end; + // set new table entry + Table[TableCount].Count:=s1.Count+1; + p:=nil; + GetMem(p,s1.Count+1); + Table[TableCount].Data:=p; + System.Move(s1.Data^,p^,s1.Count); + // add first character from string 2 + p[s1.Count]:=s2.Data^; + // increase TableCount + inc(TableCount); + case TableCount+259 of + 512,1024,2048: inc(CurBitLength); + 4096: BitmapError('LZW too many codes'); + end; + end; + +begin + if Count=0 then exit; + //WriteLn('TFPReaderTiff.DecompressLZW START Count=',Count); + //for SrcPos:=0 to 19 do + // write(HexStr(PByte(Buffer)[SrcPos],2)); + //writeln(); + + NewBuffer:=nil; + NewCount:=0; + NewCapacity:=Count*2; + ReAllocMem(NewBuffer,NewCapacity); + + SrcPos:=0; + SrcPosBit:=0; + CurBitLength:=9; + Table:=nil; + TableCount:=0; + TableCapacity:=0; + try + repeat + Code:=GetNextCode; + //WriteLn('TFPReaderTiff.DecompressLZW Code=',Code); + if Code=EoiCode then break; + if Code=ClearCode then begin + InitializeTable; + Code:=GetNextCode; + //WriteLn('TFPReaderTiff.DecompressLZW after clear Code=',Code); + if Code=EoiCode then break; + if Code=ClearCode then + BitmapError('LZW code out of bounds'); + WriteStringFromCode(Code); + OldCode:=Code; + end else begin + if Code<TableCount+258 then begin + WriteStringFromCode(Code); + AddStringToTable(OldCode,Code); + OldCode:=Code; + end else if Code=TableCount+258 then begin + WriteStringFromCode(OldCode,true); + AddStringToTable(OldCode,OldCode); + OldCode:=Code; + end else + BitmapError('LZW code out of bounds'); + end; + until false; + finally + ClearTable; + ReAllocMem(Table,0); + end; + + ReAllocMem(NewBuffer,NewCount); +// FreeMem(Buffer); +// Buffer:=NewBuffer; +// Count:=NewCount; +end; + + +procedure THelpBitmap.ReadBitmapData( Blocks: TList; + TotalSize: longint ); +var + BytesWritten: longint; + BytesWrittenFromBlock: longword; + BytesRemainingInBlock: longword; + BytesRemainingInBitmap: longword; + FillerBytesRequired: longint; + lastOutByte: byte; + BitmapOutputPointer: PByte; + Block: TBitmapBlock; + BlockIndex: longint; + BitmapData: PBYTE; + ptr: PByte; +begin + // Allocate memory to store the bitmap + Bitmapdata := GetMem( TotalSize ); + + // Copy header to bitmap + MemCopy( _Header, BitmapData, sizeof( _Header ) ); + + // Copy palette into bitmap + ptr := BitmapData + sizeof( _Header ); + MemCopy( _pPalette, ptr, GetPaletteSize ); + + BytesWritten := 0; + + // Point to start writing to bitmap bits. + BitmapOutputPointer := BitmapData + sizeof( _Header ) + GetPaletteSize; + + for BlockIndex := 0 to Blocks.Count - 1 do + begin + Block := TBitmapBlock(Blocks[ BlockIndex ]); + + case Block._CompressionType of + 0,1: // uncompressed (I'm not sure about 1) + begin + MemCopy( Block._Data, BitmapOutputPointer, Block._Size ); + BytesWrittenFromBlock := Block._Size; + inc( BytesWritten, BytesWrittenFromBlock ); + end; + + 2: // LZW compression + begin + // decompress block + if not Assigned( LZWDecompressBlock )then + raise EHelpBitmapException.Create( 'Cannot decode bitmap - DLL not found' ); + +// DecompressLZW(Block._Data, Block._Size); + //LZWDecompressBlock( Block._Data, + // BitmapOutputPointer, + // Block._Size, + // BytesWrittenFromBlock, + // lastOutByte ); + + inc( BytesWritten, BytesWrittenFromBlock ); + + // If the uncompressed data stopped short then + // copy the final code (byte) into remaining bytes + if ( BytesWrittenFromBlock < _UncompressedBlockSize ) + and ( BytesWritten < _BitsSize ) then + begin + BytesRemainingInBlock := _UncompressedBlockSize - BytesWrittenFromBlock; + BytesRemainingInBitmap := _BitsSize - BytesWritten; + + FillerBytesRequired := Min( BytesRemainingInBlock, + BytesRemainingInBitmap ); + + FillMem( BitmapOutputPointer + BytesWrittenFromBlock, + FillerBytesRequired, + LastOutByte ); + inc( BytesWritten, FillerBytesRequired ); + inc( BytesWrittenFromBlock, FillerBytesRequired ); + end; + end; + else + raise EHelpBitmapException.Create( 'Unrecognised bitmap block type' ); + end; // case + + assert( BytesWrittenFromBlock <= _UncompressedBlockSize ); + assert( BytesWritten <= _BitsSize ); + + if ( BitmapOutputPointer + BytesWrittenFromBlock + > BitmapData + TotalSize ) then + assert( false ); + + inc( BitmapOutputPointer, BytesWrittenFromBlock ); + end; + + + AllocateImage(32, _Header.cx, _Header.cy); + if TotalSize <> ImageDataSize then + writeln('Warning: INF Bitmap size and allocated bitmap size are different. ', TotalSize, ' vs ', ImageDataSize); + Move(BitmapData^, ImageData^, TotalSize); + UpdateImage; + + FreeMem( BitmapData, TotalSize ); +end; + + +end. diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas new file mode 100644 index 00000000..a3801aa5 --- /dev/null +++ b/docview/src/HelpFile.pas @@ -0,0 +1,1247 @@ +unit HelpFile; + +{$mode objfpc}{$H+} + +interface + +// Encapsulates the basic reading of a help file's structure. + +uses + Classes + ,SysUtils + ,fpg_imagelist + ,IPFFileFormatUnit + ,HelpTopic + ,HelpBitmap + ,SearchTable + ; + +type + + TIndexEntry = class(TObject) + private + name: String; + topic: TTopic; + flags: uint8; + public + constructor Create(aName: String; aTopic: TTopic; aFlags: uint8); + destructor Destroy; override; + property getTopic: TTopic read topic; + function getLabel: String; + function isGlobal: boolean; + function getLevel: integer; + end; + + + TIndex = class(TObject) + private + entries: TStringList; + public + constructor Create; + destructor Destroy; override; + function Count: longint; + function GetLabels: TStringList; + function GetTopic(aPos: longint): TTopic; + procedure Add(anIndexEntry: TIndexEntry); + end; + + + THelpFile = class(TObject) + private + function GetStringResourceIDCount: integer; + function GetNumericResourceIDCount: integer; + protected + _Filename : string; + _FileSize : longint; + _Handle: TFileStream; + + _pSlotData: pUInt16; + _SlotDataSize: longint; + + _Title: string; + + _Topics: TList; // of TTopics + + _Dictionary: TStringList; // pointers to strings. + + _Index: TIndex; + + _SearchTable: TSearchTable; + + _ReferencedFiles: TStringList; + + _FontTable: TList; + + _pHeader: TPHelpFileHeader; + _pExtendedHeader: TPExtendedHelpFileHeader; + _pContentsData: pointer; + _pResourceData: pointer; + _pSearchData: pointer; + _pHighlightWords: UInt32ArrayPointer; + _pSlotOffsets: Uint32ArrayPointer; + _pDictionaryData: pointer; + _pFontTableData: pointer; + _pTopicNameData: pointer; + _pTopicGlobalNamesData: pointer; + + procedure InitMembers; + procedure Open; + procedure Close; + procedure ReadFileBlock( Var Dest: pointer; + const StartPosition: LongWord; + const Length: LongWord); + + procedure ReadHeader; + procedure ReadContents; + procedure ReadDictionary; + procedure ReadSearchTable; + + procedure ReadIndex; + + procedure ReadReferencedFilesTable; + procedure ReadFontTableData; + procedure ParseFontTable; + + function GetTopic( Index: longint ): TTopic; + function GetTopicCount: longint; + + function GetDictionaryCount: longint; + function GetDictionaryWord( Index: longint ): string; + + function GetHighlightWords: UInt32ArrayPointer; + + function GetSearchTable: TSearchTable; + + // Lookup global or local panel name list + function FindTopicByName( const Name: string; + Var pData: pointer; + Count: longint; + Offset: longint ): TTopic; + + public + constructor Create( const aFileName: string ); + + destructor Destroy; override; + + function GetIndex: TIndex; + + property Title: string read _Title; + property Topics[ Index: longint ]: TTopic read GetTopic; + property TopicList: TList read _Topics; + property TopicCount: longint read GetTopicCount; + property StringResourceIDCount: integer read GetStringResourceIDCount; + property NumericResourceIDCount: integer read GetNumericResourceIDCount; + property Index: TIndex read GetIndex; + property Filename: string read _FileName; + + property ReferencedFiles: TStringList read _ReferencedFiles; + + procedure GetImages( ImageOffsets: TList; Images: TfpgImageList ); + + function GetImage( ImageOffset: longint ): THelpBitmap; + + property DictionaryCount: longint read GetDictionaryCount; + property DictionaryWords[ Index: longint ]: string read GetDictionaryWord; + + function IndexOfTopic( Topic: TTopic ): longint; + + property SearchTable: TSearchTable read GetSearchTable; + + function FindTopicByResourceID( ID: uint16 ): TTopic; + + function FindTopicByLocalName( const Name: string ): TTopic; + function FindTopicByGlobalName( const Name: string ): TTopic; + + function FindTopicByTitleStartsWith( const SearchText: string ): TTopic; + function FindTopicByTitleContains( const SearchText: string ): TTopic; + + function FindTopicByIndexStartsWith( const SearchText: string ): TTopic; + function FindTopicByIndexContains( const SearchText: string ): TTopic; + + procedure FindResourceIDsForTopic( Topic: TTopic; + ResourceIDs: TList ); + + property HighlightWords: UInt32ArrayPointer read GetHighlightWords; + + property FileSize: longint read _FileSize; + + procedure SetupFontSubstitutes( Substitutions: string ); + public + NotesLoaded: boolean; // used externally + + end; + +// Returns helpfile that the given topic is within +Function TopicFile( Topic: TTopic ): THelpFile; + +function GetHelpFileTitle( const Filename: string ): string; + +Implementation + +uses +// BseErr, +// StringUtilsUnit, +// CharUtilsUnit, +// DebugUnit, +// ACLFileIOUtility, +// ACLLanguageUnit; + fpg_main + ,nvUtilities + ,ACLStringUtility + ; + +// Load "missing" bitmap +{ TODO -oGraeme -cbitmap : Create and load a "missing image" image } +{.$R Images} + +const + FileErrorNotFound = 'File not found '; + FileErrorAccessDenied = 'File access denied'; + FileErrorInUse = 'File in use'; + FileErrorInvalidHeader = 'Invalid file header'; + + + // ----------- + // TIndexEntry + // ----------- + + CONSTRUCTOR TIndexEntry.Create(aName: String; aTopic: TTopic; aFlags: uint8); + begin + LogEvent(LogObjConstDest, 'TIndexEntry.Create'); + name := aName; + topic := aTopic; + flags := aFlags; + end; + + + DESTRUCTOR TIndexEntry.Destroy; + begin + LogEvent(LogObjConstDest, 'TIndexEntry.Destroy'); + topic := nil; + inherited Destroy; + end; + + + FUNCTION TIndexEntry.getLabel: String; + begin + result := name; + + // index level check (level 1 or 2) + if (getLevel) > 1 then + begin + result := '- ' + result; + end; + + if isGlobal then + begin + result := result + ' (g)'; + end; + end; + + + FUNCTION TIndexEntry.isGlobal: boolean; + begin + result := (flags and 64) > 0 + end; + + + FUNCTION TIndexEntry.getLevel: integer; + begin + result := 1; + + // index level check (level 1 or 2) + if (flags and 2 ) > 0 then + begin + result := 2; + end; + end; + + + + + // ----------- + // TIndex + // ----------- + CONSTRUCTOR TIndex.Create; + begin + inherited Create; + + entries := TStringList.Create; + // labels := nil; // lazy + end; + + + DESTRUCTOR TIndex.Destroy; + var + i : longint; + tmpEntry : TIndexEntry; + begin + LogEvent(LogObjConstDest, 'TIndex.Destroy (size:' + IntToStr(entries.Count) + ')'); + + for i := 0 to entries.Count - 1 do + begin + tmpEntry := TIndexEntry(entries.Objects[i]); + if tmpEntry <> nil then + begin + tmpEntry.Free; + entries.Objects[i] := nil; + end; + end; + entries.Free; + + inherited Destroy; + end; + + + FUNCTION TIndex.Count: longint; + begin + result := entries.Count; + end; + + + FUNCTION TIndex.GetLabels: TStringList; + begin + result := entries; + end; + + + FUNCTION TIndex.GetTopic(aPos: longint): TTopic; + begin + result := TIndexEntry(entries.Objects[aPos]).getTopic; + end; + + + PROCEDURE TIndex.add(anIndexEntry: TIndexEntry); + begin +// LogEvent(LogDebug, 'TIndex.add(' + anIndexEntry.getLabel + ', ' + anIndexEntry.ClassName + ')'); + entries.AddObject(anIndexEntry.getLabel, anIndexEntry); + end; + + + + +//Procedure OnLanguageEvent( Language: TLanguageFile; +// const Apply: boolean ); +//var +// tmpPrefix : String; +//begin +// tmpPrefix := 'HelpFile' + LANGUAGE_LABEL_DELIMITER; +// +// Language.LL( Apply, FileErrorNotFound, tmpPrefix + 'FileErrorNotFound', 'File not found' ); +// Language.LL( Apply, FileErrorAccessDenied, tmpPrefix + 'FileErrorAccessDenied', 'Access denied' ); +// Language.LL( Apply, FileErrorInUse, tmpPrefix + 'FileErrorInUse', 'File in use by another program' ); +// Language.LL( Apply, +// FileErrorInvalidHeader, +// tmpPrefix + 'FileErrorInvalidHeader', +// 'File doesn''t appear to be an OS/2 Help document (header ID not correct)' ); +// Language.LL( Apply, +// ErrorCorruptHelpFile, +// tmpPrefix + 'ErrorCorruptHelpFile', +// 'File is corrupt' ); +//end; + +Function TopicFile( Topic: TTopic ): THelpFile; +Begin + Result := Topic.HelpFile as THelpFile; +end; + +function THelpFile.GetStringResourceIDCount: integer; +begin + Result := _pHeader^.nname; +end; + +function THelpFile.GetNumericResourceIDCount: integer; +begin + Result := _pHeader^.nres; +end; + +procedure THelpFile.InitMembers; +begin + _SlotDataSize := 0; + + _pHeader := nil; + _pExtendedHeader := nil; + _pContentsData := nil; + _pSlotOffsets := nil; + _pResourceData := nil; + _pSearchData := nil; + _pDictionaryData := nil; +// _pIndexData := nil; + _pFontTableData := nil; + + _pHighlightWords := nil; + + _Dictionary:= TStringList.Create; + _Topics := TList.Create; +// _Index := TStringList.Create; + _ReferencedFiles := TStringList.Create; + _FontTable := TList.Create; + + NotesLoaded := false; +end; + + +constructor THelpFile.Create(const aFileName: string); +begin + LogEvent(LogObjConstDest, 'THelpFile.Create (file:' + aFileName + ')'); + LogEvent(LogParse, 'Helpfile Load: ' + aFileName); + + _FileName := aFileName; + + InitMembers; + + Open; + + // we always need these basics: + try + ReadHeader; + ReadContents; + ReadDictionary; + ReadFontTableData; + ParseFontTable; + ReadReferencedFilesTable; + except + Close; + raise; + end; + + // the rest is loaded on demand +end; + + +destructor THelpFile.Destroy; +begin + LogEvent(LogObjConstDest, 'THelpFile.Destroy'); + Dispose( _pHeader ); + Dispose( _pExtendedHeader ); + FreeMem( _pContentsData ); + FreeMem( _pSlotOffsets ); + FreeMem( _pResourceData ); + FreeMem( _pSearchData ); + FreeMem( _pDictionaryData ); +// DeallocateMemory( _pIndexData ); + FreeMem( _pFontTableData ); + + FreeMem( _pHighlightWords ); + + // index entries are pointing to topics + // so let us clean them first + if Assigned( _Index ) then + _Index.Free; + + if Assigned( _Topics ) then + DestroyListAndObjects( _Topics ); + + _Dictionary.Free; + _SearchTable.Free; + _ReferencedFiles.Free; + _FontTable.Free; + + _Handle.Free; +end; + +procedure THelpFile.Open; +begin + LogEvent(LogDebug, 'Open File >>'); + if not FileExists( _Filename ) then + raise EHelpFileException.Create( FileErrorNotFound ); + + try + _Handle := TFileStream.Create(_FileName, fmOpenRead or fmShareDenyWrite); + except + on E: Exception do + raise EHelpFileException.Create(E.Message); + end; + //case rc of + // ERROR_FILE_NOT_FOUND: // crap, this doesn't actually occur! + // raise EHelpFileException.Create( FileErrorNotFound ); + // + // ERROR_ACCESS_DENIED: + // raise EHelpFileException.Create( FileErrorAccessDenied ); + // + // ERROR_SHARING_VIOLATION: + // raise EHelpFileException.Create( FileErrorInUse ); + // + // else + // raise EHelpFileException.Create( SysErrorMessage( rc ) ); + //end; + + _FileSize := GetFileSize(_Filename); + LogEvent(LogDebug, 'Open File <<'); +end; + +procedure THelpFile.Close; +begin + _Handle.Free; + _Handle := nil; +end; + +procedure THelpFile.ReadFileBlock(var Dest: pointer; + const StartPosition: LongWord; const Length: LongWord); +var + bytes: LongWord; +begin + if Length = 0 then + exit; // nothing to read - go home! + + _Handle.Seek(StartPosition, soBeginning); + + // we allocate early so this should never happen + if Dest = nil then + Dest := GetMem(Length); + + bytes := _Handle.Read(Dest^, Length); + if bytes <> Length then + raise EHelpFileException.Create(ErrorCorruptHelpFile); +end; + +procedure THelpFile.ReadHeader; +begin + LogEvent(LogParse, 'Read header'); + New(_pHeader); + ReadFileBlock( _pHeader, + 0, + sizeof( THelpFileHeader ) ); + if _pHeader^.ID <> INF_HEADER_ID then + begin + // not an OS/2 help file. + if (Byte(_pHeader^.ID[0]) = $5f) and (Byte(_pHeader^.ID[1]) = $3f) then + raise EWindowsHelpFormatException.Create( 'It seems we have a Win16 help file!' ); + + raise EHelpFileException.Create( FileErrorInvalidHeader ); + end; + + _Title := _pHeader^.Title; + + if _pHeader^.extstart > 0 then + begin + New(_pExtendedHeader); + // read extended header + ReadFileBlock( _pExtendedHeader, + _pHeader^.extstart, + sizeof( _pExtendedHeader^ ) ); + end; +end; + +procedure THelpFile.ReadContents; +var + Topic: TTopic; + EntryIndex: longint; + pEntry: pTTOCEntryStart; + pEnd: pbyte; + tocarray: UInt32ArrayPointer; + pData: Pointer; + p: PByte; +begin + LogEvent(LogParse, 'Read contents'); + + if _pHeader^.ntoc = 0 then + exit; // explicit check required since ntoc is unsigned + + // Presize the topics list to save reallocation time + _Topics.Capacity := _pHeader^.ntoc; + + // read toc offsets array + //ReadFileBlock( tocarray, + // _pHeader^.tocoffsetsstart, + // _pHeader^.ntoc * SizeOf(uint32) ); + + // read slots first so that Topics can refer to it. + ReadFileBlock( _pSlotOffsets, + _pHeader^.slotsstart, + _pHeader^.nslots * sizeof( uint32 ) ); + + ReadFileBlock( _pContentsData, + _pHeader^.tocstart, + _pHeader^.toclen ); + + pEntry := _pContentsData; + pEnd := _pContentsData + _pHeader^.toclen; + p := PByte(pEntry); + + for EntryIndex := 0 to _pHeader^.ntoc - 1 do + begin +// pEntry := _Handle.Seek(tocarray[EntryIndex], soBeginning); +// pEntry := tocarray[EntryIndex]; + if p >= pEnd then + // runs off end of data! + raise EHelpFileException.Create( ErrorCorruptHelpFile ); + + Topic := TTopic.Create( _Handle, + _pSlotOffsets, + _Dictionary, + pEntry, + _FontTable, + _ReferencedFiles ); + + Topic.HelpFile := Self; + Topic.Index := EntryIndex; + + _Topics.Add( Topic ); + p := PByte(pEntry); + inc(p, pEntry^.Length); + pEntry := pTTOCentryStart(p); + end; +end; + +procedure THelpFile.ReadDictionary; +var + i: longint; + Len: uint8; + p: pbyte; + pEnd: pbyte; + s: string; + c: array[0..255] of char; +begin + LogEvent(LogParse, 'Read dictionary'); + + if _pHeader^.ndict = 0 then + exit; // explicit check required since ndict is unsigned + + ReadFileBlock( _pDictionaryData, + _pHeader^.dictstart, + _pHeader^.dictlen ); + + P := _pDictionaryData; + pEnd := _pDictionaryData + _pHeader^.dictlen; + + // Presize the dictionary to save reallocation + _Dictionary.Capacity := _pHeader^.ndict; + for i := 0 to _pHeader^.ndict - 1 do + begin + // adjust length so we can use as a Pascal string + // (file uses length including length byte, + // Pascal string have length excluding length byte) + if p >= pEnd then + // ran off end of data + raise EHelpFileException.Create( 'Error reading help file dictionary' ); + + + FillChar(c, sizeof(c), 0); // fill string with NUL chars + Len := p^ - 1; // read string length value (corrected length) + Inc(p, sizeof(byte)); // move pointer + Move(p^, c, Len); // read string of dictionary + s := c; // convert PChar to String type + + _Dictionary.Add( s ); + Inc(p, Len); // move pointer to next item + end; +end; + + +function THelpFile.GetIndex: TIndex; +begin + if _Index = nil then + begin + ReadIndex; + end; + Result := _Index; +end; + +type + TIndexEntryHeader = packed record + TextLength: uint8; + Flags: uint8; + NumberOfRoots: uint8; + TOCIndex: uint16; + end; + pTIndexEntryHeader = ^TIndexEntryHeader; + +procedure THelpFile.ReadIndex; +var + IndexIndex: longint; + pEntryHeader: pTIndexEntryHeader; + EntryText: string; + IndexTitleLen: longint; + p: pByte; + pEnd: pByte; + pIndexData: pointer; + tmpIndexEntry: TIndexEntry; +begin + LogEvent(LogParse, 'Read index'); + _Index := TIndex.Create; + if _pHeader^.nindex = 0 then + exit; // explicit check required since ndict is unsigned + + pIndexData := nil; + ReadFileBlock( pIndexData, + _pHeader^.indexstart, + _pHeader^.indexlen ); + + P := pIndexData; + pEnd := pIndexData + _pHeader^.indexlen; + + for IndexIndex := 0 to _pHeader^.nindex - 1 do + begin + if p >= pEnd then + // ran off end of data + raise EHelpFileException.Create( 'Error reading help file index' ); + + pEntryHeader := pTIndexEntryHeader(p); + IndexTitleLen := pEntryHeader^.TextLength; + inc( p, sizeof( TIndexEntryHeader ) ); + + EntryText := ''; + SetString(EntryText, PChar(p), IndexTitleLen); + + if pEntryHeader^.TOCIndex < _Topics.Count then + begin + tmpIndexEntry := TIndexEntry.Create(EntryText, TTopic(_Topics[pEntryHeader^.TOCIndex]), pEntryHeader^.flags); + _Index.Add(tmpIndexEntry); + end + else +// raise EHelpFileException.Create( 'Error reading help file index - out of range topic reference' ); + ; // pass! something special + + inc( p, IndexTitleLen + + pEntryHeader^.NumberOfRoots + * sizeof( uint32 ) ); // skip 'roots' for index search + end; + + FreeMem( pIndexData ); +end; + +function THelpFile.GetSearchTable: TSearchTable; +begin + if _SearchTable = nil then + ReadSearchTable; + Result := _SearchTable; +end; + +procedure THelpFile.ReadSearchTable; +var + SearchTableOffset: longint; + SearchTableRecordLengthIs16Bit: boolean; +begin + LogEvent(LogParse, 'Read search table'); + + if _pHeader^.SearchLen = 0 then + begin + LogEvent(LogParse, 'Read search table (len = 0'); + exit; + end; + + SearchTableOffset := _pHeader^.SearchStart and $7fffffff; + SearchTableRecordLengthIs16Bit := _pHeader^.SearchStart and $80000000 > 0; + ReadFileBlock( _pSearchData, + SearchTableOffset, + _pHeader^.SearchLen ); + + _SearchTable := TSearchTable.Create( _pSearchData, + SearchTableRecordLengthIs16Bit, + _Dictionary.Count, + _Topics.Count ); +end; + +function THelpFile.GetHighlightWords: UInt32ArrayPointer; +begin + if _pHighlightWords = nil then + _pHighlightWords := GetMem( _Dictionary.Count * sizeof( UInt32 ) ); + Result := _pHighlightWords; +end; + +function THelpFile.FindTopicByResourceID( ID: uint16 ): TTopic; +var + i: longint; + pResourceIDs: UInt16ArrayPointer; + pTopicIndices: UInt16ArrayPointer; + FileResourceID: uint16; + TopicIndex: uint16; +begin + Result := nil; + + if _pHeader^.nres = 0 then + // since nres is unsigned + exit; + + if _pResourceData = nil then + begin + ReadFileBlock( _pResourceData, + _pHeader^.resstart, + (_pHeader^.nres * sizeof( uint16 )) * 2 ); // list of IDs, list of topics + end; + + pResourceIDs := _pResourceData; + pTopicIndices := _pResourceData + + _pHeader^.nres * sizeof( uint16 ); + + for i := 0 to _pHeader^.nres - 1 do + begin + FileResourceID := pResourceIDs^[ i ]; + if FileResourceID = ID then + begin + // found + TopicIndex := pTopicIndices^[ i ]; + Result := TTopic(_Topics[ TopicIndex ]); + exit; + end; + end; +end; + +// Look up a local "panel name" and return associated topic, if any. +function THelpFile.FindTopicByLocalName( const Name: string ): TTopic; +begin + Result := FindTopicByName( Name, + _pTopicNameData, + _pHeader^.nname, + _pHeader^.namestart ); +end; + +function THelpFile.FindTopicByGlobalName( const Name: string ): TTopic; +begin + Result := nil; + + if _pExtendedHeader = nil then + // no extended header - no global list to lookup + exit; + + Result := FindTopicByName( Name, + _pTopicGlobalNamesData, + _pExtendedHeader ^. EntryInGNameTable, + _pExtendedHeader ^. HelpPanelGNameTblOffset ); + +end; + +// The text of the names are stored in the (global) dictionary +// with a table referencing them. +// We could use a binary search here... but whatever... +function THelpFile.FindTopicByName( const Name: string; + Var pData: pointer; + Count: longint; + Offset: longint ): TTopic; +var + i: longint; + pNameTable: UInt16ArrayPointer; + pTopicIndices: UInt16ArrayPointer; + TopicIndex: uint16; + + TopicNameWordIndex: uint16; + TopicName: string; +begin + Result := nil; + + if Count = 0 then + // since it's unsigned + exit; + + if pData = nil then + ReadFileBlock( pData, + Offset, + Count * sizeof( uint16 ) * 2 ); // list of name words, list of topics + + // get pointers to the two parts of the table + pNameTable := pData; + pTopicIndices := pData + + Count * sizeof( uint16 ); + + for i := 0 to Count - 1 do + begin + TopicNameWordIndex := pNameTable^[ i ]; + TopicName := DictionaryWords[ TopicNameWordIndex ]; + + if CompareText( TopicName, Name ) = 0 then + begin + // found + TopicIndex := pTopicIndices^[ i ]; + Result := TTopic(_Topics[ TopicIndex ]); + exit; + end; + end; +end; + + +// TODO move to index class +function THelpFile.FindTopicByIndexStartsWith( const SearchText: string ): TTopic; +var + i: longint; + tmpLabel: String; +begin + result := nil; + GetIndex; // make sure it's read + + for i := 0 to _Index.Count - 1 do + begin + tmpLabel := _Index.GetLabels[i]; + if SameText(tmpLabel, SearchText) then + begin + // found + result := Index.getTopic(i); + exit; + end; + end; +end; + + +function THelpFile.FindTopicByIndexContains(const SearchText: string): TTopic; +var + i: longint; + tmpLabel: String; +begin + result := nil; + GetIndex; // make sure it's read + + for i := 0 to _Index.Count - 1 do + begin + tmpLabel := _Index.GetLabels[i]; + if Pos(UpperCase(SearchText), UpperCase(tmpLabel)) > 0 then + begin + // found + result := Index.getTopic(i); + exit; + end; + end; +end; + + +function THelpFile.FindTopicByTitleStartsWith( const SearchText: string ): TTopic; +var + i: longint; + tmpTopic: TTopic; + tmpLevel : integer; + tmpMore : boolean; +begin + result := nil; + + tmpLevel := 0; + repeat + tmpMore := false; + inc(tmpLevel); + for i := 0 to _Topics.Count - 1 do + begin + tmpTopic := TTopic(_Topics[i]); + if tmpLevel = tmpTopic.ContentsLevel then + begin + if StrStartsWithIgnoringCase(tmpTopic.Title, SearchText) then + begin + result := tmpTopic; + exit; + end; + end; + if tmpLevel < tmpTopic.ContentsLevel then + begin + tmpMore := True; + end; + end; + until NOT tmpMore; +end; + +function THelpFile.FindTopicByTitleContains( const SearchText: string ): TTopic; +var + i: longint; + tmpTopic: TTopic; + tmpLevel : integer; + tmpMore : boolean; +begin + result := nil; + + tmpLevel := 0; + repeat + tmpMore := false; + inc(tmpLevel); + for i := 0 to _Topics.Count - 1 do + begin + tmpTopic := TTopic(_Topics[i]); + if tmpLevel = tmpTopic.ContentsLevel then + begin + if CaseInsensitivePos( SearchText, tmpTopic.Title) > 0 then + begin + result := tmpTopic; + exit; + end; + end; + if tmpLevel < tmpTopic.ContentsLevel then + begin + tmpMore := True; + end; + end; + until NOT tmpMore; +end; + +procedure THelpFile.FindResourceIDsForTopic( Topic: TTopic; + ResourceIDs: TList ); +var + i: longint; + pResourceIDs: UInt16ArrayPointer; + pTopicIndices: UInt16ArrayPointer; +begin + ResourceIDs.Clear; + + if _pHeader^.nres = 0 then + // since nres is unsigned + exit; + + if _pResourceData = nil then + ReadFileBlock( _pResourceData, + _pHeader^.resstart, + _pHeader^.nres * sizeof( uint16 ) * 2 ); // list of IDs, list of topics + + pResourceIDs := _pResourceData; + pTopicIndices := _pResourceData + + _pHeader^.nres * sizeof( uint16 ); + + for i := 0 to _pHeader^.nres - 1 do + begin + if pTopicIndices^[ i ] = Topic.Index then + begin + // found + ResourceIDs.Add( pointer( pResourceIDs^[ i ] ) ); + end; + end; +end; + +procedure THelpFile.ReadReferencedFilesTable; +var + i: longint; + p: pointer; + pData: pointer; + DatabaseName: string; + pLength: pByte; +begin + if _pExtendedHeader = nil then + // no extended header -> no referenced files table + exit; + + if _pExtendedHeader^.Numdatabase = 0 then + exit; + + pData := nil; // please allocate... + ReadFileBlock( pData, + _pExtendedHeader^.DatabaseOffset, + _pExtendedHeader^.DatabaseSize ); + + p := pData; + for i := 0 to _pExtendedHeader^.Numdatabase - 1 do + begin + pLength := p; // length byte, including itself + SetString(DatabaseName, p+1, pLength^-1); // use length value minus the length byte to get the string length + _ReferencedFiles.Add( DatabaseName ); + inc( p, pLength^ ); // skip to next entry using full length (including length byte) + end; + FreeMem( pData ); +end; + +procedure THelpFile.ReadFontTableData; +begin + if _pExtendedHeader = nil then + // no extended header -> no font table + exit; + + if _pExtendedHeader^.NumFontEntry = 0 then + exit; + + ReadFileBlock( _pFontTableData, + _pExtendedHeader^.FontTableOffset, + _pExtendedHeader^.NumFontEntry * sizeof( THelpFontSpec ) ); +end; + +procedure THelpFile.ParseFontTable; +var + i: longint; + p: pointer; + pFontSpec: pTHelpFontSpec; +begin + _FontTable.Clear; + + p := _pFontTableData; + if p = nil then + exit; // no data + + for i := 0 to _pExtendedHeader^.NumFontEntry - 1 do + begin + pFontSpec := p + i * sizeof( THelpFontSpec ); + _FontTable.Add( pFontSpec ); + end; +end; + +procedure THelpFile.GetImages( ImageOffsets: TList; Images: TfpgImageList ); +var + ListIndex: longint; + ImageOffset: longint; + Bitmap: THelpBitmap; +begin + Images.Clear; + + for ListIndex := 0 to ImageOffsets.Count - 1 do + begin + ImageOffset := longint( ImageOffsets[ ListIndex ] ); + try + Bitmap := THelpBitmap.CreateFromHelpFile( _Handle, + _pHeader^.imgstart + + ImageOffset ); + except + on e: EHelpBitmapException do +{ raise EHelpFileException.Create( 'Error loading help bitmap at' + + IntToStr( ImageOffset ) + + ': ' + + e.Message );} + begin +// Bitmap := THelpBitmap.Create; + Bitmap := THelpBitmap(fpgImages.GetImage('stdimg.dlg.critical')); +// Bitmap.LoadFromResourceName( 'MissingBitmap' ); // TODO: Add image resource to DocView + end; + end; + + Images.AddImage(Bitmap); + end; +end; + +function THelpFile.GetImage( ImageOffset: longint ): THelpBitmap; +begin + try + Result := THelpBitmap.CreateFromHelpFile( _Handle, + _pHeader^.imgstart + + ImageOffset ); + except + on e: EHelpBitmapException do + begin + result := nil; + raise EHelpFileException.Create( 'Error loading help bitmap at' + + IntToStr( ImageOffset ) + + ': ' + + e.Message ); + end; + end; +end; + +function THelpFile.GetTopic( Index: longint ): TTopic; +begin + if ( Index < 0 ) + or ( Index > _Topics.Count - 1 ) then + Result := nil + else + Result := TTopic(_Topics[ Index ]); +end; + +function THelpFile.GetTopicCount: longint; +begin + Result := _Topics.Count; +end; + +function THelpFile.IndexOfTopic( Topic: TTopic ): longint; +begin + Result := _Topics.IndexOf( Topic ); +end; + +function THelpFile.GetDictionaryCount: longint; +begin + Result := _Dictionary.Count; +end; + +function THelpFile.GetDictionaryWord( Index: longint ): string; +begin + Result := _Dictionary[ Index ]; +end; + + +// Looks for fonts that should be substitued to the +// users selected fixed font +// doesn't make a lot of sense for this to be here... +procedure THelpFile.SetupFontSubstitutes( Substitutions: string ); +var + Item: string; + FontName: string; + SpacePos: longint; + W: longint; + H: longint; + i: longint; + pFontSpec: pTHelpFontSpec; + tmpSubstitutionItems : TStrings; + tmpCounter : integer; + tmpDimensionParts : TStrings; + s: string; + PointSize: word; + cp: integer; +begin + ParseFontTable; // (re)load table from raw data + + tmpSubstitutionItems := TStringList.Create; + StrExtractStrings(tmpSubstitutionItems, Substitutions, [';'], #0); + + for tmpCounter := 0 to tmpSubstitutionItems.Count - 1 do + begin + Item := tmpSubstitutionItems[tmpCounter]; + try + if Item <> '' then + begin + // Look for space in xxxx WxH + SpacePos := LastDelimiter(' ', Item); + if SpacePos > 0 then + begin + // fontname comes before + FontName := StrLeft( Item, SpacePos - 1 ); + Delete( Item, 1, SpacePos ); + + // width and height after, with an X between + tmpDimensionParts := TStringList.Create; + StrExtractStrings(tmpDimensionParts, Item, ['x'], #0); + W := StrToInt(tmpDimensionParts[0]); + H := StrToInt(tmpDimensionParts[1]); + tmpDimensionParts.Destroy; + if ( W > 0 ) and ( H > 0 ) then + begin + // Now look through the font table for matches + for i := 0 to _FontTable.Count - 1 do + begin + pFontSpec := _FontTable[ i ]; + cp := pFontSpec^.Codepage; + s := StrNPas( pFontSpec^.FaceName, sizeof( pFontSpec^.FaceName ) ); + if s = FontName then + begin + // same face name... + // this formula seems to give a simulated pointsize compared to + // what the original VIEW program intended. + PointSize := (pFontSpec^.Height * 2) div 3; + if ( H = PointSize ) then + begin + // match + pFontSpec^.Codepage := High(word); // font substitute marker added +// _FontTable[ i ] := SubstituteFixedFont; + end; + end; + end; + end; + end; + end; + except + end; + end; + + tmpSubstitutionItems.Free; +end; + + +// ------------------------------------------------------------- +// Get the title only from specific help file (if possible) + +function GetHelpFileTitle( const Filename: string ): string; +var + Header: THelpFileHeader; + fstream: TFileStream; + Ext: string; +begin + Ext := ExtractFileExt( Filename ); + Result := ''; + + if SameText( Ext, '.inf' ) + or SameText( Ext, '.hlp' ) then + begin + try + try + fstream := TFileStream.Create(Filename, fmOpenRead); + fstream.Position := 0; + FillChar( Header, sizeof( Header ), 0 ); + fstream.Read(Header, SizeOf(Header)); + if Header.ID = INF_HEADER_ID then + Result := StrPas(Header.title); + except + // silently ignore errors - it's not to critical at this point. + end; + finally + fstream.Free; + end; + end; +end; + + +end. + diff --git a/docview/src/HelpTopic.pas b/docview/src/HelpTopic.pas new file mode 100644 index 00000000..a2ae38dc --- /dev/null +++ b/docview/src/HelpTopic.pas @@ -0,0 +1,2695 @@ +Unit HelpTopic; + +{$mode objfpc}{$H+} + +Interface + +// This is it - the monster which decodes IPF data. +// It's created with a reference to the contents data defining it. +// It gets relevant pointers out of that. When GetText is called +// it decodes the data and spits out formatted text to suit +// RichTextView. + +uses + Classes, + HelpWindowDimensions, + IPFFileFormatUnit; + +const + DefaultGroupIndex = 0; + + RTF_NewLine = #10; + +var + { TODO -oGraeme -cPointers : I don't like this - double check alternatives later } + // placeholder for font table entry, indiciating user fixed font should be substituted + SubstituteFixedFont: pointer = Pointer(1); + +type + THelpLink = class(TObject) + public + HelpFile: TObject; // file this link is within + // Even though it doesn't do anything, + // we have to have a constructor to allow + // virtual constructors to work + constructor Create; virtual; + end; + + + THelpTopicSlot = class(TObject) + public + pData: pUInt8; // Pointer to actual Slot structure in INF file. + Size: longint; // Number of bytes in the text for this Slot (slotheader.ntext) + pLocalDictionary: UInt16ArrayPointer; // Pointer to Slot's local dictionary + LocalDictSize: uint8; // Number of entries in the local dictionary + destructor Destroy; override; + end; + + + THelpLinkClass = class of THelpLink; + + + TFootnoteHelpLink = class(THelpLink) + public + TopicIndex: longint; + Title: string; // from text within link + end; + + + TWindowedHelpLink = class(THelpLink) + public + GroupIndex: longint; // DefaultGroupIndex if not specified. + // Note: Overrides contents group index of topic + Automatic: boolean; // link should be automatically followed on topic display + Split: boolean; // link should open the window within the parent + ViewPort: boolean; // link should always open a new window + Dependent: boolean; // window opened by link should be closed + // when current topic is closed + Rect: THelpWindowRect; // Display window with this rectangle. + // Note: overrides contents rect + constructor Create; override; + destructor Destroy; override; + end; + + + TInternalHelpLink = class(TWindowedHelpLink) + public + TopicIndex: longint; + end; + + + THelpLinkByResourceID = class(TWindowedHelpLink) + public + ResourceID: longint; + end; + + + SlotArray = array[0..0] of THelpTopicSlot; + pSlotArray = ^SlotArray; + + + TFontState = (fsNormal, fsFixed, fsCustom); + TIPFTextAlignment = (itaLeft, itaRight, itaCenter, itaCenterOnePara); + + + TParseState = record + Alignment: TIPFTextAlignment; + ForegroundColorTag: string; + BackgroundColorTag: string; + Spacing: boolean; + FontState: TFontState; + InCharGraphics: boolean; + LinkIndex: longint; + StartOfTextBlock: longint; + TextBlock: string; + FootnoteLink: TFootnoteHelpLink; + StyleCode: longint; + end; + + + TTopic = class(TObject) + protected + _FileHandle: TFileStream; + _pTOCEntry: pTTOCEntryStart; + _pSlotOffsets: UInt32ArrayPointer; + _Slots: TList; + _pSlotNumbers: puint16; + _NumSlots: longint; + _Title: string; + _GlobalDictionary: TStringList; + _ShowInContents: boolean; + _ContentsLevel: integer; + _ContentsGroupIndex: longint; + _FontTable: TList; + _ReferencedFiles: TStrings; + procedure SetTitle( const NewValue: string ); + function GetTitle: string; + + // Returns the tag texts for the given bitmap ref + function GetImageText( CurrentAlignment: TIPFTextAlignment; + BitmapOffset: longint; + BitmapFlags: longint; + ImageOffsets: TList ): string; + + Procedure ProcessLinkedImage( Var State: TParseState; + Var pData: pByte; + Var OutputString: string; + ImageOffsets: TList ); + procedure TranslateIPFEscapeCode( Var State: TParseState; + Var pData: pUInt8; + var AText: String; + Var WordsOnLine: longint; + ImageOffsets: TList ); + + function CreateLink( Var LinkIndex: longint; + Var Link: THelpLink; + LinkClass: THelpLinkClass ): boolean; + + procedure EnsureSlotsLoaded; + + // returns true if the escape code at pData results in whitespace. + function IPFEscapeCodeSpace( Var State: TParseState; Var pData: pUInt8 ): boolean; + + function GetNextIPFTextItem( Var SlotIndex: longint; + Var pData: pUInt8; + Var State: TParseState ): longint; + + function CheckForSequence( WordSequences: TList; + SlotIndex: longint; + pData: pUint8; + State: TParseState; + GlobalDictIndex: longint + ): longint; + + public + HelpFile: TObject; + Index: longint; + SearchRelevance: longint; + Links: TList; // only valid after GetText + constructor Create( var FileHandle: TFileStream; + pSlotOffsets: UInt32ArrayPointer; + Dictionary: TStringList; + var pTOCEntry: pTTOCEntryStart; + FontTable: TList; + ReferencedFiles: TStrings ); + destructor Destroy; override; + property Title: string read GetTitle write SetTitle; + procedure SetTitleFromMem( const p: pointer; const Len: byte ); + // Main function for retrieving text for topic. + // HighlightSequences: list of sequences to highlight + // if nil then ignored. + // ShowCodes: indicates debugging: hex output of escape + // codes will be included + // ShowWordSeparators: | will be included after each dictionary + // word inserted + // Text: The output is written to here. IS NOT CLEARED FIRST. + // ImageOffsets: For each image that occurs in the text, + // the help file offset will be written to this list. + // HighlightMatches: if not nil, and HighlightSequences is not nil, + // will return offsets to each highlight match + procedure GetText( HighlightSequences: TList; + ShowCodes: boolean; + ShowWordSeparators: boolean; + var Text: String; + ImageOffsets: TList; + HighlightMatches: TList ); + // if StopAtFirstOccurrence true, returns 0 or 1 + // if false, returns count of occurrences of word + function SearchForWord( DictIndex: integer; + StopAtFirstOccurrence: boolean ): longint; + // searches for sequences out of those listed in WordSequence + // Each element of WordSequence contains a pointer to an array + // of flags for each dictionary word, indicating whether that word + // is to be a possible match. + function SearchForWordSequences( WordSequence: TList; StopAtFirstOccurrence: boolean ): longint; + procedure GetContentsWindowRect( ContentsRect: THelpWindowRect ); + // search for binary data including codes + function SearchForData( Data: pbyte; DataLen: integer ): boolean; + procedure SaveIPFEscapeCode( Var State: TParseState; + Var pData: pUInt8; + Var F: TextFile; + ImageOffsets: TList ); + procedure SaveToIPF( Var f: TextFile; ImageOffsets: TList ); + property ShowInContents: boolean read _ShowInContents; + property ContentsLevel: integer read _ContentsLevel; + property ContentsGroupIndex: longint read _ContentsGroupIndex; + function CountWord( DictIndex: integer ): longint; + function ContainsWord( DictIndex: integer ): boolean; + end; + + +// Compares two topics for purposes of sorting by +// search match relevance +function TopicRelevanceCompare( Item1, Item2: pointer ): longint; + +// Compares two topics for purposes of sorting by title +function TopicTitleCompare( Item1, Item2: pointer ): longint; + + +implementation + + +uses + SysUtils + ,NewViewConstantsUnit + ,nvUtilities + ,ACLStringUtility + ,SettingsUnit + ; + +const + IPFColors: array[ 0..15 ] of string = + ( + //rrggbb + '', // default + '#0000ff', // blue + '#ff0000', // red + '#ff00ff', // pink (purple) + '#00ff00', // green + '#00ffff', // cyan + '#ffff00', // yellow + '#808000', // neutral = brown + '#404040', // dark gray + '#000080', // dark blue + '#800000', // dark red + '#800080', // dark pink (purple) + '#008000', // dark green + '#008080', // dark cyan + '#000000', // black + '#c0c0c0' // pale gray + ); + + // for ecHighlight1 + IPFHighlight1Tags : array [ 0..6 ] of string = + ( + '</i></b></u></color>', // normal + '<i>', // hp1 italitc + '<b>', // hp2 bold + '<b><i>', // hp3 bold italic + '<u>', // hp5 underline + '<u><i>', // hp6 underline italic + '<u><b>' // hp7 underline bold + ); + + // for ecHighlight2 + IPFHighlight2Tags : array [ 0..3 ] of string = + ( + '</i></b></u></color>', // normal + '<color blue>', // hp4 blue + '<color red>', // hp8 red + '<color purple>' // hp9 purple + ); + + BlankString: string = ''; + +var + DefaultTitle: string; + + +function GetBeginLink( LinkIndex: longint ): string; +begin + Result := '<link ' + IntToStr( LinkIndex ) + '>' +end; + +function GetEndLinkTags( const State: TParseState ): string; +begin + Result := '</link>' + State.ForegroundColorTag; +end; + +// Even though it doesn't do anything, +// we have to have a constructor to allow +// virtual constructors to work +constructor THelpLink.Create; +begin + // do nothing +end; + +constructor TWindowedHelpLink.Create; +begin + GroupIndex := DefaultGroupIndex; + Automatic := false; + ViewPort := false; + Dependent := false; + Rect := THelpWindowRect.Create; +end; + +destructor TWindowedHelpLink.Destroy; +begin + Rect.Destroy; +end; + +destructor THelpTopicSlot.Destroy; +begin + { TODO -ograeme -ccleanup memory : Double check this } + FreeMem(pData);// DeallocateMemory( pData ); + FreeMem(pLocalDictionary); // DeallocateMemory( pLocalDictionary ); +end; + +constructor TTopic.Create( var FileHandle: TFileStream; + pSlotOffsets: UInt32ArrayPointer; + Dictionary: TStringList; + var pTOCEntry: pTTOCEntryStart; + FontTable: TList; + ReferencedFiles: TStrings ); +var + pExtendedInfo: pExtendedTOCEntry; + titleLen: integer; + XY: THelpXYPair; + p: pbyte; + Flags: byte; +begin + _FileHandle := FileHandle; + _pSlotOffsets := pSlotOffsets; + + _Title := ''; + _GlobalDictionary := Dictionary; + _ContentsGroupIndex := 0; + + _pTOCEntry := pTOCEntry; + _NumSlots := pTOCEntry^.numslots; + + Flags := _pTOCEntry^.flags; + p := pByte( _pTOCEntry ) + sizeof( TTOCEntryStart ); + + if ( Flags and TOCEntryExtended ) = TOCEntryExtended then + begin + pExtendedInfo := pExtendedTOCEntry( p ); + inc( p, sizeof( TExtendedTOCEntry ) ); + + if ( pExtendedInfo^.w1 and 1 ) > 0 then + // skip position + inc( p, sizeof( XY ) ); + + if ( pExtendedInfo^.w1 and 2 ) > 0 then + // skip size + inc( p, sizeof( XY ) ); + + if ( pExtendedInfo^.w1 and 8 ) > 0 then + // skip window controls + inc( p, sizeof(word) ); // increment by 2 + + if ( pExtendedInfo^.w1 and $40 ) > 0 then + // skip something else, unknown... style? 2 bytes + inc( p, sizeof(word) ); // increment by 2 + + if ( pExtendedInfo^.w2 and 4 ) > 0 then + begin + _ContentsGroupIndex := pUInt16(p)^; + // read group + inc( p, sizeof( uint16 ) ); + end; + end; + + // skip slot numbers for now. + _pSlotNumbers := pUInt16(p); + inc( p, _NumSlots * sizeof( uint16 ) ); + + // Calculate the remainder of the tocentry length - that is the bytes used for TOC topic (title) text + titleLen := _pTOCEntry^.length - ( longword( p ) - longword( _pTOCEntry ) ); + + // Read title + if TitleLen > 0 then + SetTitleFromMem( p, TitleLen ) + else + Title := DefaultTitle; + + _ContentsLevel := ( Flags and TOCEntryLevelMask ); + _ShowInContents := Flags and TOCEntryHidden = 0; + if _ContentsLevel = 0 then + _ShowInContents := false; // hmmm.... + + _FontTable := FontTable; + _ReferencedFiles := ReferencedFiles; +end; + +destructor TTopic.Destroy; +begin + LogEvent(LogObjConstDest, 'TTopic.Destroy'); + DestroyListAndObjects( Links ); + DestroyListAndObjects( _Slots ); + inherited Destroy; +end; + +procedure TTopic.SetTitle( const NewValue: string ); +begin + _Title := NewValue; +end; + +procedure TTopic.SetTitleFromMem( const p: pointer; const Len: byte ); +begin + //FreePString( _Title ); + //GetMem( _Title, Len + 1 ); + //_Title^[ 0 ] := char( Len ); + //MemCopy( p, _Title + 1, Len ); + SetString(_Title, p, Len); +end; + +function TTopic.GetTitle: string; +begin + Result := _Title; +end; + +// Replace < and > characters with doubles << and >> +// for compatibility with richtextview. +// This works in place, assuming that instances of > or < are +// actually rare. In practice, IPF normally would insert these +// two characters as distinct words, but I don't want to assume that. +procedure SubstituteAngleBrackets( Var s: string ); +var + i: integer; +begin + i := 1; + while i <= Length( S ) do + begin + case S[ i ] of + '<': + begin + Insert( '<', s, i ); + inc( i ); + end; + + '>': + begin + Insert( '>', s, i ); + inc( i ); + end; + end; + inc( i ); + end; +end; + +function TTopic.GetImageText( CurrentAlignment: TIPFTextAlignment; + BitmapOffset: longint; + BitmapFlags: longint; + ImageOffsets: TList ): string; +var + BitmapIndex: longint; + OriginalAlignTag: string; + ImageTag: string; + AlignTag: string; +begin + BitmapIndex := ImageOffsets.IndexOf( pointer( BitmapOffset ) ); + if BitmapIndex = -1 then + BitmapIndex := ImageOffsets.Add( pointer( BitmapOffset ) ); + + ImageTag := '<image ' + + IntToStr( BitmapIndex ) + + '>'; + + if ( BitmapFlags and $08 ) > 0 then + begin + // stretch to fit - not implemented + end; + + // aligned + case CurrentAlignment of + itaLeft: + OriginalAlignTag := '<align left>'; + itaRight: + OriginalAlignTag := '<align right>'; + itaCenter, + itaCenterOnePara: + OriginalAlignTag := '<align center>'; + end; + + case BitmapFlags and 7 of + 0, // curious - should not occur? does in dbexpert.hlp + 1: // left + AlignTag := '<align left>'; + 2: // right + AlignTag := '<align right>'; + 4,5: // centre (4 is official, 5 seems to occur too) + AlignTag := '<align center>'; + end; + + Result := AlignTag + + ImageTag + + OriginalAlignTag; + + if ( BitmapFlags and $10 ) = 0 then + begin + // NOT runin, new lines before and after + Result := RTF_NewLine + Result + RTF_NewLine; + end; + +end; + +Procedure SaveImageText( BitmapOffset: longint; + BitmapFlags: longint; + Var F: TextFile; + ImageOffsets: TList ); +var + ImageIndex: longint; +begin + ImageIndex := ImageOffsets.IndexOf( pointer( BitmapOffset ) ); + if ImageIndex = -1 then + ImageIndex := ImageOffsets.Add( pointer( BitmapOffset ) ); + + Write( F, ':artwork name=' ); + Write( F, StrInSingleQuotes('img' + IntToStr(ImageIndex) + '.bmp') ); + + case BitmapFlags and 7 of + 2: // right + Write( F, ' align=right' ); + 4,5: // centre (4 is official, 5 seems to occur too) + Write( F, ' align=center' ); + end; + + if ( BitmapFlags and $10 ) > 0 then + begin + // runin + Write( F, ' runin' ); + end; + + // fit ... + Write( F, '.' ); +end; + +Procedure TTopic.ProcessLinkedImage( Var State: TParseState; + Var pData: pByte; + Var OutputString: string; + ImageOffsets: TList ); +var + EscapeLen: uint8; + EscapeCode: uint8; + SubEscapeCode: uint8; + BitmapOffset: longword; + BitmapFlags: uint8; + Link: THelpLink;//TInternalHelpLink; + LinkTopicIndex: integer; +begin + LinkTopicIndex := -1; + while true do + begin + EscapeLen := pData^; + SubEscapeCode := ( pData + 2 )^; + case SubEscapeCode of + HPART_DEFINE: + begin + BitmapFlags := ( pData + 3 )^; + BitmapOffset := pUInt32( pData + 4 )^; + end; + + HPART_HDREF: // define whole bitmap topic link? + begin + LinkTopicIndex := pUInt16( pData + 3 )^; + end; + end; + inc( pData, EscapeLen ); + + // Now pData points at next code or item + if pData^ <> IPF_ESC then + // not an escape code, done + break; + EscapeCode := (pData + 2) ^; + if EscapeCode <> ecLinkedImage then + // not a hyperlink code, done + break; + // another linked image code is coming up. + SubEscapeCode := ( pData + 3 )^; + if SubEscapeCode = HPART_DEFINE then + // started another linked image. + break; + inc( pData ); // move pointer to escape code len. + end; + + OutputString := GetImageText( State.Alignment, + BitmapOffset, + BitmapFlags, + ImageOffsets ); + + // Don't make it a link if we didn't find a + // overall link code, i.e. degrade gracefully. + if LinkTopicIndex > -1 then + begin + if CreateLink( State.LinkIndex, Link, TInternalHelpLink ) then + begin + TInternalHelpLink(Link).TopicIndex := LinkTopicIndex; + end; + + OutputString := GetBeginLink( State.LinkIndex ) + + OutputString + + GetEndLinkTags( State ); + + inc( State.LinkIndex ); + end; + +end; + +Procedure SaveLinkedImage( Var pData: pByte; + Var F: TextFile; + ImageOffsets: TList ); +var + EscapeLen: uint8; + EscapeCode: uint8; + SubEscapeCode: uint8; + BitmapOffset: longword; + BitmapFlags: uint8; + LinkTopicIndex: integer; +begin + LinkTopicIndex := -1; + while true do + begin + EscapeLen := pData^; + SubEscapeCode := ( pData + 2 )^; + case SubEscapeCode of + HPART_DEFINE: + begin + BitmapFlags := ( pData + 3 )^; + BitmapOffset := pUInt32( pData + 4 )^; + end; + + HPART_HDREF: // define whole bitmap topic link? + begin + LinkTopicIndex := pUInt16( pData + 3 )^; + end; + end; + inc( pData, EscapeLen ); + + // Now pData points at next code or item + if pData^ <> IPF_ESC then + // not an escape code, done + break; + EscapeCode := (pData + 2) ^; + if EscapeCode <> ecLinkedImage then + // not a hyperlink code, done + break; + // another linked image code is coming up. + SubEscapeCode := ( pData + 3 )^; + if SubEscapeCode = HPART_DEFINE then + // started another linked image. + break; + inc( pData ); // move pointer to escape code len. + end; + + SaveImageText( BitmapOffset, + BitmapFlags, + F, + ImageOffsets ); + + // Don't make it a link if we didn't find a + // overall link code, i.e. degrade gracefully. + if LinkTopicIndex > -1 then + begin + WriteLn( F, '' ); + WriteLn( F, ':artlink.' ); + Write( F, ':link reftype=hd' ); + Write( F, ' refid=' + IntToStr( LinkTopicIndex ) ); + WriteLn( F, '.' ); + WriteLn( F, ':eartlink.' ); + end; + +end; + +Procedure GetExtraLinkData( Link: TWindowedHelpLink; + pData: pUInt8 ); +var + LinkFlags1: uint8; + LinkFlags2: uint8; + LinkDataIndex: longint; + pLinkXY: pHelpXYPair; + pLinkData: pUInt8; +begin + LinkFlags1 := ( pData + 0 ) ^; + LinkFlags2 := ( pData + 1 ) ^; + + pLinkData := pData + 2; + + if ( LinkFlags1 and 1 ) > 0 then + begin + // position specified + pLinkXY := pHelpXYPair( pLinkData ); + ReadHelpPosition( pLinkXY^, Link.Rect ); + inc( pLinkData, sizeof( THelpXYPair ) ); + end; + + if ( LinkFlags1 and 2 ) > 0 then + begin + // size specified + pLinkXY := pHelpXYPair( pLinkData ); + ReadHelpSize( pLinkXY^, Link.Rect ); + inc( pLinkData, sizeof( THelpXYPair ) ); + end; + + if ( LinkFlags1 and 8 ) > 0 then + begin + // window controls specified - skip + inc( pLinkData, 2 ); + end; + + if ( LinkFlags2 and 4 ) > 0 then + begin + // group specified + Link.GroupIndex := pUInt16( pLinkData )^; + inc( LinkDataIndex, sizeof( uint16 ) ); + end; + + if ( LinkFlags1 and 64 ) > 0 then + begin + Link.Automatic := true; + end; + + if ( LinkFlags1 and 4 ) > 0 then + Link.ViewPort := true; + + if ( LinkFlags2 and 2 ) > 0 then + Link.Dependent := true; + + if ( LinkFlags1 and 128 ) > 0 then + Link.Split := true; + + // cant be bothered with the others. +end; + +// If the given link has already been decoded +// ie. the topic has been displayed before, +// then return the already decoded link & return false +// Otherwise, create a new link object & return true +function TTopic.CreateLink( Var LinkIndex: longint; + Var Link: THelpLink; + LinkClass: THelpLinkClass ): boolean; +begin + if LinkIndex >= Links.Count then + begin + Link := LinkClass.Create; + Link.HelpFile := HelpFile; + Links.Add( Link ); + Result := true; + end + else + begin + Link := THelpLink(Links[ LinkIndex ]); + Result := false; + end; +end; + +const + // size of the original View's default font + AverageViewCharWidth = 8; + +procedure GetMarginTag( const Margin: longint; + FontState: TFontState; + Var MarginString: string; + BreakIfPast: boolean ); +begin + MarginString := '<leftmargin '; + if FontState <> fsCustom then + // for standard fonts, scale margins to match font + MarginString := MarginString + IntToStr( Margin ) + else + // for custom fonts, since the IPF margins were always in + // terms of the standard font size, set the margin to a width based on that. + MarginString := MarginString + IntToStr( Margin * AverageViewCharWidth ) + ' pixels'; + + if BreakIfPast then + MarginString := MarginString + ' breakifpast'; + + MarginString := MarginString + '>'; +end; + +// TODO +function FullDoubleQuote( const s: string ): string; +begin + Result := StrDoubleQuote + + StrEscapeAllCharsBy(s, [], CharDoubleQuote) + + StrDoubleQuote; +end; + +// End URL, if it has been started. Go back and insert the start tag, +// and add the end tag. +procedure CheckForAutoURL( var Text: string; var State: TParseState ); +var + T: string; +begin + if State.StartOfTextBlock = -1 then + // haven't got any text yet + exit; + + TrimPunctuation( State.TextBlock ); + + if not CheckAndEncodeURL( State.TextBlock ) then + begin + // not a URL we know + State.TextBlock := ''; + exit; + end; + + // It's a URL. Insert link at start of URL + T := '<blue><link ' + PARAM_LINK_URL + ' "'; + T := T + State.TextBlock; + T := T + '">'; + Insert(T, Text, State.StartOfTextBlock); + Text := Text + GetEndLinkTags(State); + + State.TextBlock := ''; + State.StartOfTextBlock := -1; +end; + +procedure TTopic.TranslateIPFEscapeCode( Var State: TParseState; + Var pData: pUInt8; + var AText: String; + Var WordsOnLine: longint; + ImageOffsets: TList ); +var + EscapeLen: uint8; + EscapeCode: uint8; + + Link: THelpLink; //TInternalHelpLink; + FootnoteLink: THelpLink; //TFootnoteHelpLink; + LinkByResourceID: THelpLink; //THelpLinkByResourceID; + + Margin: integer; + + BitmapOffset: longword; + BitmapFlags: uint8; + + ColorCode: uint8; + StyleCode: uint8; + + FontIndex: uint8; + pFontSpec: pTHelpFontSpec; + + FaceName: string; + PointSize: longint; + QuotedFaceName: string; + + ExternalLinkFileIndex: uint8; + ExternalLinkTopicID: string; + + ProgramLink: string; + ProgramPath: string; + ProgramFilename: string; + ProgramInfo : TSerializableStringList; + tmpProgramLinkParts : TStrings; + + OutputString: string; +begin + EscapeLen := pData^; + EscapeCode := (pData + 1)^; + OutputString := ''; + + case EscapeCode of + + ecSetLeftMargin: + begin + CheckForAutoURL( AText, State ); + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, false ); + end; + + ecSetLeftMarginNewLine: + begin + CheckForAutoURL( AText, State ); + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, false ); + OutputString := OutputString + + RTF_NewLine; + end; + + ecSetLeftMarginFit: + begin + CheckForAutoURL( AText, State ); + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, true ); + // note that this will cause following tex to be "tabbed" across to the + // new margin position, if not yet there. + // if we are already past this margin then a new line should be started. + + end; + + ecSetLeftMarginHere: + begin + OutputString := '<leftmargin here>'; + end; + + ecHighlight1: + begin + StyleCode := ( pData + 2 )^; + if StyleCode <= High( IPFHighlight1Tags ) then + OutputString := IPFHighlight1Tags[ StyleCode ]; + if StyleCode = 0 then + State.ForegroundColorTag := '</color>'; + end; + + ecHighlight2: + begin + StyleCode := ( pData + 2 )^; + if StyleCode <= High( IPFHighlight2Tags ) then + OutputString := IPFHighlight2Tags[ StyleCode ]; + + if StyleCode = 0 then + State.ForegroundColorTag := '</color>' + else + State.ForegroundColorTag := OutputString; // only colours + end; + + ecLinkStart: + begin + CheckForAutoURL( AText, State ); + if CreateLink( State.LinkIndex, Link, TInternalHelpLink ) then + begin + TInternalHelpLink(Link).TopicIndex := pUInt16( pData + 2 )^; + + if EscapeLen >= 6 then + begin + GetExtraLinkData( TInternalHelpLink(Link), pData + 4 ); + end; + end; + + // If it's not an automatic link + // then put code in to show it. + if not TInternalHelpLink(Link).Automatic then + begin + OutputString := '<blue>' + + GetBeginLink( State.LinkIndex ); + end; + + inc( State.LinkIndex ); + end; + + ecFootnoteLinkStart: + begin + CheckForAutoURL( AText, State ); + if CreateLink( State.LinkIndex, FootnoteLink, TFootnoteHelpLink ) then + begin + TFootnoteHelpLink(FootnoteLink).TopicIndex := pUInt16( pData + 2 )^; + State.FootnoteLink := TFootnoteHelpLink(FootnoteLink); + end; + + OutputString := '<blue>' + GetBeginLink( State.LinkIndex ); + + inc( State.LinkIndex ); + end; + + ecStartLinkByResourceID: + begin + CheckForAutoURL( AText, State ); + if CreateLink( State.LinkIndex, LinkByResourceID, THelpLinkByResourceID ) then + begin + THelpLinkByResourceID(LinkByResourceID).ResourceID := pUInt16( pData + 2 )^; + + if EscapeLen >= 6 then + begin + GetExtraLinkData( THelpLinkByResourceID(LinkByResourceID), pData + 4 ); + end; + end; + + OutputString := '<blue>' + GetBeginLink( State.LinkIndex ); + + inc( State.LinkIndex ); + end; + + ecExternalLink: + begin + CheckForAutoURL( AText, State ); + // :link reftype=hd refid=... database=<filename> + ExternalLinkFileIndex := ( pData + 2 )^; + ExternalLinkTopicID := StrNPas( pchar(pData + 4), (pData + 3)^ ); + OutputString := '<blue><link ' + PARAM_LINK_EXTERNAL + ' ' + + IntToStr( ExternalLinkFileIndex ) + + ' ' + + ExternalLinkTopicID + + '>' + + end; + + ecProgramLink: + begin + CheckForAutoURL( AText, State ); + ProgramLink := StrNPas( pchar(pData + 3), EscapeLen-3 ); + + tmpProgramLinkParts := TStringList.Create; + StrExtractStrings(tmpProgramLinkParts, ProgramLink, [' '], #0); + ProgramPath := tmpProgramLinkParts[0]; + tmpProgramLinkParts.Destroy; + + ProgramFilename := ExtractFilename( ProgramPath ); + + if StrStartsWithIgnoringCase(ProgramFilename, PRGM_EXPLORER) + or StrStartsWithIgnoringCase(ProgramFilename, PRGM_NETSCAPE) + or StrStartsWithIgnoringCase(ProgramFilename, PRGM_MOZILLA) + or StrStartsWithIgnoringCase(ProgramFilename, PRGM_FIREFOX) + then + begin + OutputString := '<blue><link ' + PARAM_LINK_URL + ' ' + + FullDoubleQuote( ProgramLink ) + + '>'; + end + else + begin + ProgramInfo := TSerializableStringList.create; + ProgramInfo.add(ProgramPath); + ProgramInfo.add(ProgramLink); + OutputString := '<blue><link ' + PARAM_LINK_PROGRAM + ' ' + + ProgramInfo.getSerializedString + + '>'; + ProgramInfo.destroy; + end; + end; + + ecLinkEnd: + begin + OutputString := GetEndLinkTags( State ); + if State.FootnoteLink <> nil then + State.FootnoteLink := nil; + end; + + ecStartCharGraphics: + begin + State.FontState := fsFixed; + State.InCharGraphics := true; + OutputString := RTF_NewLine + RTF_NewLine + '<tt><wrap no>'; + State.Spacing := false; + WordsOnLine := 0; + end; + + ecEndCharGraphics: + begin + State.FontState := fsNormal; + State.InCharGraphics := false; + OutputString := '</tt><wrap yes>' + RTF_NewLine; + State.Spacing := true; + end; + + ecImage: + begin + CheckForAutoURL( AText, State ); + BitmapFlags := ( pData + 2 )^; + BitmapOffset := pUInt32( pData + 3 )^; + + OutputString := GetImageText( State.Alignment, + BitmapOffset, + BitmapFlags, + ImageOffsets ); + + if State.Spacing + AND (OutputString[Length(OutputString)] <> RTF_NewLine) // no space after a line break + then + OutputString := OutputString + ' '; + end; + + ecLinkedImage: + begin + CheckForAutoURL( AText, State ); + ProcessLinkedImage( State, + pData, + OutputString, + ImageOffsets ); + if State.Spacing then + OutputString := OutputString + ' '; + + // Note! Early exit, since the procedure + // will update pData. + AText := AText + OutputString; + exit; + end; + + ecStartLines: + begin + CheckForAutoURL( AText, State ); + // aligned text + case ( pData + 2 )^ of + 0, // just in case - to match image alignment oddities + 1: + begin + OutputString := RTF_NewLine + '<align left>'; + State.Alignment := itaLeft; + end; + + 2: + begin + OutputString := RTF_NewLine + '<align right>'; + State.Alignment := itaRight; + end; + + 4: + begin + OutputString := RTF_NewLine + '<align center>'; + State.Alignment := itaCenter; + end; + end; + OutputString := OutputString + '<wrap no>'; + WordsOnLine := 0; + end; + + ecEndLines: + begin + CheckForAutoURL( AText, State ); + // supposed to turn word wrap on, default font + OutputString := '<align left><wrap yes>'; // I guess... + State.Alignment := itaLeft; + end; + + ecForegroundColor: + begin + ColorCode := ( pData + 2 )^; + if ColorCode = 0 then + State.ForegroundColorTag := '</color>' + else if ColorCode <= High( IPFColors ) then + State.ForegroundColorTag := '<color ' + IPFColors[ ColorCode ] + '>'; + OutputString := State.ForegroundColorTag; + end; + + ecBackgroundColor: + begin + ColorCode := ( pData + 2 )^; + if ColorCode = 0 then + State.BackgroundColorTag := '</backcolor>' + else if ColorCode <= High( IPFColors ) then + State.BackgroundColorTag := '<backcolor ' + IPFColors[ ColorCode ] + '>'; + OutputString := State.BackgroundColorTag; + end; + + ecFontChange: + begin + FontIndex := ( pData + 2 )^; + if FontIndex = 0 then + begin + // back to default font + OutputString := '</font>'; + State.FontState := fsNormal; + end + else if FontIndex < _FontTable.Count then + begin + // valid font index + pFontSpec := _FontTable[ FontIndex ]; + +// if pFontSpec = SubstituteFixedFont then + if pFontSpec^.Codepage = High(word) then // Substitute Fixed Font detected + begin + OutputString := '<tt>'; + State.FontState := fsFixed; + end + else + begin +// pFontSpec := _FontTable[ FontIndex ]; + FaceName := StrNPas( pFontSpec^.FaceName, sizeof(pFontSpec^.FaceName) ); + // arbitrarily and capriciously use specified height * 2/3 + // as the point size - seems to correspond to what original + // view wanted... note this doesn't necessarily scale + // correctly, since default font could be different. whatever. + PointSize := (pFontSpec^.Height * 2) div 3; + + if PointSize < 8 then + PointSize := 8; + // quote font name, escape double quotes with duplicates + // e.g. Bob's "Big" Font would become + // "Bob's ""Big"" Font" + QuotedFaceName := FullDoubleQuote( FaceName ); + OutputString := '<font ' + + QuotedFaceName + + ' ' + + IntToStr( PointSize ) + + '>'; + { + // for when (if ever) RTV allows setting font + // by precise dimensions + + '[' + + IntToStr( pFontSpec ^. Width ) + + 'x' + + IntToStr( pFontSpec ^. Height ) + + ']'; + } + State.FontState := fsCustom; + end; + end; + end + end; // case escape code of... + + AText := AText + OutputString; + inc( pData, EscapeLen ); +end; + +// returns true if the escape code results in whitespace +// also updates the bits of State that relate to spacing +// ie. .Spacing, and .InCharGraphics (which affects whether +// spacing is reset at paragraph ends etc) +function TTopic.IPFEscapeCodeSpace( Var State: TParseState; + Var pData: pUInt8 ): boolean; +var + EscapeLen: uint8; + EscapeCode: uint8; + +begin + EscapeLen := pData^; + EscapeCode := (pData + 1) ^; + + result := false; // for most + case EscapeCode of + ecSetLeftMargin, + ecSetLeftMarginNewLine, + ecSetLeftMarginFit: + result := true; + + ecStartCharGraphics: + begin + result := true; + State.InCharGraphics := true; + State.Spacing := false; + end; + + ecEndCharGraphics: + begin + result := true; + State.InCharGraphics := false; + State.Spacing := true; + end; + + ecImage: + result := State.Spacing; + + ecLinkedImage: + result := State.Spacing; + + ecStartLines: + begin + result := true; + State.Spacing := false; + end; + + ecEndLines: + begin + result := true; + // supposed to turn word wrap on, default font + State.Spacing := true; + end; + end; // case escape code of... + + inc( pData, EscapeLen ); +end; + +procedure TTopic.EnsureSlotsLoaded; +var + i: longint; + pSlotNumber: puint16; + SlotNumber: uint16; + SlotHeader: TSlotHeader; + Slot: THelpTopicSlot; + bytes: integer; + expected: integer; +begin + if _Slots = nil then + begin + try + _Slots := TList.Create; + + // Read slot data + pSlotNumber := _pSlotNumbers; + + for i := 1 to _NumSlots do + begin + SlotNumber := pSlotNumber^; + + // Seek to start of slot + try + _FileHandle.Seek(_pSlotOffsets^[SlotNumber], soBeginning); + except + // not a valid offset + raise EHelpFileException.Create( ErrorCorruptHelpFile ); + end; + + // Read header + bytes := _FileHandle.Read(SlotHeader, SizeOf(TSlotHeader)); + if bytes <> SizeOf(TSlotHeader) then + // couldn't read slot header + raise EHelpFileException.Create( 'Failed to load Topic Slots.' ); + + // Create slot object + Slot := THelpTopicSlot.Create; + + Slot.LocalDictSize := SlotHeader.nLocalDict; + Slot.Size := SlotHeader.ntext; + + // Allocate and read slot dictionary + _FileHandle.Seek(SlotHeader.localDictPos, soBeginning); + expected := uint32(Slot.LocalDictSize) * sizeof(uint16); // size we need + if Slot.pLocalDictionary = nil then + // allocate memory + Slot.pLocalDictionary := GetMem(expected); + bytes := _FileHandle.Read(Slot.pLocalDictionary^, expected); + if bytes <> expected then + raise EHelpFileException.Create('Failed to read complete slot dictionary'); + + // Allocate and read slot data (text) + _FileHandle.Seek(_pSlotOffsets^[SlotNumber] + sizeof(TSlotHeader), soBeginning); + expected := Slot.Size; // size we need + if Slot.pData = nil then + // allocate memory + Slot.pData := GetMem(expected); + bytes := _FileHandle.Read(Slot.pData^, expected); + if bytes <> expected then + raise EHelpFileException.Create('Failed to read complete slot data (text)'); + + _Slots.Add( Slot ); + inc( pByte(pSlotNumber), sizeof( UInt16 ) ); + end; + except + on E: EHelpFileException do + begin + DestroyListAndObjects( _Slots ); + raise; + end; + end; + end; +end; + +// returns a global dict index. +// or, -1 for a whitespace item. +// or, -2 for end of text. +function TTopic.GetNextIPFTextItem( Var SlotIndex: longint; + Var pData: pUInt8; + Var State: TParseState ): longint; +var + Slot: THelpTopicSlot; + pSlotEnd: pUInt8; + + LocalDictIndex: uint8; +begin + while SlotIndex < _NumSlots do + begin + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + pSlotEnd := Slot.pData + Slot.Size; + + while pData < pSlotEnd do + begin + LocalDictIndex := pData^; + inc( pData ); + + if LocalDictIndex < Slot.LocalDictSize then + begin + // Normal word lookup + result := Slot.pLocalDictionary^[ LocalDictIndex ]; + exit; + end; + + // special code + case LocalDictIndex of + IPF_END_PARA: + begin + result := -1; + if not State.InCharGraphics then + State.Spacing := true; + exit; + end; + + IPF_CENTER: + begin + result := -1; + exit; + end; + + IPF_INVERT_SPACING: + begin + State.Spacing := not State.Spacing; + end; + + IPF_LINEBREAK: + begin + result := -1; + if not State.InCharGraphics then + State.Spacing := true; + exit; + end; + + IPF_SPACE: + begin + result := -1; + exit; + end; + + IPF_ESC: + begin + // escape sequence + if IPFEscapeCodeSpace( State, pData ) then + result := -1; + end; + end; + end; // while in slot... + inc( SlotIndex ); + end; + Result := -2; +end; + +// Checks to see if the given word (at pData) +// starts one of the given sequences, by looking forward +// If found, returns the length of the sequence. +function TTopic.CheckForSequence( WordSequences: TList; + SlotIndex: longint; + pData: pUint8; + State: TParseState; + GlobalDictIndex: longint + ): longint; +var + WordSequence: TList; + SequenceStepIndex: longint; + pSequenceStepWords: Uint32ArrayPointer; + + SequenceIndex: longint; + + SlotIndexTemp: longint; + pDataTemp: pUint8; + StateTemp: TParseState; +// s : string; + DictIndex: longint; +begin + result := 0; // if we don't find a match. + + for SequenceIndex := 0 to WordSequences.Count - 1 do + begin + WordSequence := TList(WordSequences[ SequenceIndex ]); + pSequenceStepWords := WordSequence[ 0 ]; + + if pSequenceStepWords^[ GlobalDictIndex ] > 0 then + begin + // matched first step in this sequence. Look ahead... + + SequenceStepIndex := 0; + + pDataTemp := pData; + SlotIndexTemp := SlotIndex; + StateTemp := State; + while true do + begin + inc( SequenceStepIndex ); + if SequenceStepIndex = WordSequence.Count then + begin + // have a match for the sequence, insert start highlight + Result := WordSequence.Count; + break; + end; + + // get words for next step in sequence + pSequenceStepWords := WordSequence[ SequenceStepIndex ]; + + DictIndex := GetNextIPFTextItem( SlotIndexTemp, + pDataTemp, + StateTemp ); + if DictIndex = -2 then + begin + // end of text - abort + break; + end; + + if DictIndex = -1 then + begin + // whitespace - abort + // for multi-word phrase searching - count this and subsequent whitespace... + break; + end; + +// s := _GlobalDictionary[ DictIndex ]; // for debug only + if not StrIsEmptyOrSpaces(_GlobalDictionary[ DictIndex ]) then + begin + if pSequenceStepWords^[ DictIndex ] = 0 then + begin + // word doesn't match - abort + break; + end; + end; + + end; // while + + end; + // else - doesn't match first step, do nothing + end; // for sequenceindex ... +end; + +// Main translation function. Turns the IPF data into +// a text string. Translates formatting codes into tags +// as for Rich Text Viewer. +procedure TTopic.GetText( HighlightSequences: TList; + // each element is a TList + // containing a sequence of possible words + // each element of each sequence + // is an array of flags for the dictionary + // indicating if the word is a allowed match at that step + // a match is any sequence that matches one or more words at each step. + ShowCodes: boolean; + ShowWordSeparators: boolean; + var Text: String; + ImageOffsets: TList; + HighlightMatches: TList ); +var + SlotIndex: integer; + Slot: THelpTopicSlot; + pData: pUInt8; + pSlotEnd: pUInt8; + + GlobalDictIndex: uint32; + + WordsOnLine: longint; + + StringToAdd: string; + LocalDictIndex: uint8; + + State: TParseState; + + EscapeLen: uint8; + i: longint; + + SequenceStepIndex: longint; +begin + if Links = nil then + Links := TList.Create; + + if HighlightMatches <> nil then + HighlightMatches.Clear; + + // Text.Clear; + ImageOffsets.Clear; + + try + EnsureSlotsLoaded; + except + on E: EHelpFileException do + begin + Text := Text + E.Message; + exit; + end; + end; + + WordsOnLine := 0; + + State.LinkIndex := 0; + State.FontState := fsNormal; // ? Not sure... this could be reset at start of slot + State.InCharGraphics := false; + State.Spacing := true; + State.ForegroundColorTag := '</color>'; + State.BackgroundColorTag := '</backcolor>'; + State.StartOfTextBlock := -1; + State.TextBlock := ''; + State.FootnoteLink := nil; + Text := Text + '<leftmargin 1>'; + + SequenceStepIndex := 0; + + for SlotIndex := 0 to _NumSlots - 1 do + begin + if not State.InCharGraphics then + State.Spacing := true; // this is just a guess as to the exact view behaviour. + // inf.txt indicates that spacing is reset to true at + // slot (cell) start, but that doesn't seem to be the + // case when in character graphics... hey ho. + + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + pData := Slot.pData; + pSlotEnd := pData + Slot.Size; + State.Alignment := itaLeft; + + while pData < pSlotEnd do + begin + LocalDictIndex := pData^; + inc( pData ); + + if LocalDictIndex < Slot.LocalDictSize then + begin + // Normal word lookup + GlobalDictIndex := Slot.pLocalDictionary^[ LocalDictIndex ]; + + if ShowWordSeparators then + Text := Text + '{' + IntToStr( GlobalDictIndex )+ '}'; + + // normal lookup + if GlobalDictIndex < _GlobalDictionary.Count then + StringToAdd := _GlobalDictionary[ GlobalDictIndex ] + else + StringToAdd := ''; + + if StrIsEmptyOrSpaces( StringToAdd ) then + begin + // spaces only... + CheckForAutoURL( Text, State ); + end + else + begin + // really is a word, not a space. + + // store string into "word" + if Length(State.TextBlock) = 0 then + // store start of block + State.StartOfTextBlock := Length(Text); + + State.TextBlock := State.TextBlock + StringToAdd; + + SubstituteAngleBrackets( StringToAdd ); + + if HighlightSequences <> nil then + begin + if SequenceStepIndex > 0 then + begin + // currently highlighting a sequence. + dec( SequenceStepIndex ); + if SequenceStepIndex = 0 then + begin + // now finished, insert end highlight + StringToAdd := StringToAdd + + State.BackgroundColorTag; + + end; + end + else + begin + // not yet in a sequence, searching. + SequenceStepIndex := + CheckForSequence( HighlightSequences, + SlotIndex, + pData, + State, + GlobalDictIndex ); + + if SequenceStepIndex > 0 then + begin + // this word starts a sequence! + if HighlightMatches <> nil then + HighlightMatches.Add( pointer( Length(Text) ) ); + StringToAdd := '<backcolor #' + + IntToHex( Settings.Colors[ SearchHighlightTextColorIndex ], 6 ) + + '>' + + StringToAdd; + dec( SequenceStepIndex ); + if SequenceStepIndex = 0 then + // and ends it. + StringToAdd := StringToAdd + + State.BackgroundColorTag; + end; + + end; + end; // if processing sequence + inc( WordsOnLine ); + end; + + Text := Text + StringToAdd; + + if State.FootnoteLink <> nil then + begin + State.FootnoteLink.Title := State.FootnoteLink.Title + StringToAdd; + if State.Spacing then + begin + State.FootnoteLink.Title := State.FootnoteLink.Title + ' '; + end; + end; + + if State.Spacing then + begin + CheckForAutoURL( Text, State ); + Text := Text + ' '; + end; + end + else + begin + // special code + + if ShowCodes then + begin + Text := Text + '[' + IntToHex( LocalDictIndex, 2 ); + if LocalDictIndex = IPF_ESC then + begin + EscapeLen := pData^; + for i := 1 to EscapeLen - 1 do + Text := Text + ' ' + IntToHex( ( pData + i )^, 2 ); + end; + Text := Text + ']'; + end; + + case LocalDictIndex of + IPF_END_PARA: + begin + if SlotIndex = 0 then + if pData - 1 = Slot.pData then + // ignore first FA, not needed with RichTextView + continue; + + CheckForAutoURL( Text, State ); + if State.Alignment = itaCenterOnePara then + begin + State.Alignment := itaLeft; + Text := Text + '<align left>'; + end; + Text := Text + RTF_NewLine; + + if WordsOnLine > 0 then + Text := Text + RTF_NewLine; + + if not State.InCharGraphics then + State.Spacing := true; + + WordsOnLine := 0; + end; + + IPF_CENTER: + begin + CheckForAutoURL( Text, State ); + Text := Text + RTF_NewLine + '<align center>'; + State.Alignment := itaCenterOnePara; + end; + + IPF_INVERT_SPACING: + begin + if not State.InCharGraphics then + State.Spacing := not State.Spacing; + end; + + IPF_LINEBREAK: + begin + CheckForAutoURL( Text, State ); + + if State.Alignment = itaCenterOnePara then + begin + State.Alignment := itaLeft; + Text := Text + '<align left>'; + end; + Text := Text + RTF_NewLine; + if not State.InCharGraphics then + State.Spacing := true; + WordsOnLine := 0; + end; + + IPF_SPACE: + begin + CheckForAutoURL( Text, State ); + if State.Spacing then + Text := Text + ' '; + end; + + IPF_ESC: + begin + // escape sequence + TranslateIPFEscapeCode( State, + pData, + Text, + WordsOnLine, + ImageOffsets ); + + end; + + end; // case code of... + end; + end; // for slotindex = ... + end; + State.TextBlock := ''; +end; + +function TTopic.SearchForWord( DictIndex: integer; + StopAtFirstOccurrence: boolean ) + : longint; +var + SlotIndex: integer; + Slot: THelpTopicSlot; + pData: pUInt8; + pSlotEnd: pUInt8; + + EscapeLen: longint; + + GlobalDictIndex: uint32; + + LocalDictIndex: uint8; +begin + EnsureSlotsLoaded; + + Result := 0; + for SlotIndex := 0 to _NumSlots - 1 do + begin + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + + pData := Slot.pData; + + pSlotEnd := pData + Slot.Size; + + while pData < pSlotEnd do + begin + LocalDictIndex := pData^; + + if LocalDictIndex < Slot.LocalDictSize then + begin + // Normal word lookup + GlobalDictIndex := Slot.pLocalDictionary^[ LocalDictIndex ]; + + if GlobalDictIndex = DictIndex then + begin + inc( result ); + if StopAtFirstOccurrence then + exit; + end; + end + else + begin + // special code + if LocalDictIndex = $ff then + begin + // escape string, skip it + EscapeLen := ( pData + 1 ) ^; + inc( pData, EscapeLen ); + end; + end; + + inc( pData ); + end; // for slotindex = ... + end; +end; + +// Search for a sequence of bytes, including in escape codes +// this is for debugging to allow finding specific sequences +function TTopic.SearchForData( Data: pbyte; + DataLen: integer ): boolean; +var + SlotIndex: integer; + Slot: THelpTopicSlot; + pData: pUInt8; + pSlotEnd: pUInt8; + + pHold: pUint8; + pSearch: pUint8; +begin + EnsureSlotsLoaded; + + for SlotIndex := 0 to _NumSlots - 1 do + begin + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + + pSearch := Data; + pHold := Slot.pData; + pData := Slot.pData; + pSlotEnd := Slot.pData + Slot.Size; + + while pHold < pSlotEnd do + begin + if pData^ = pSearch^ then + begin + // byte matches + inc( pData ); + inc( pSearch ); + if ( pSearch >= Data + DataLen ) then + begin + // matches + result := true; + exit; + end + end + else + begin + // no match + pSearch := Data; + inc( pHold ); + pData := pHold; + end; + end; // for slotindex = ... + end; + + result := false; // not found +end; + +function TTopic.SearchForWordSequences( WordSequence: TList; + StopAtFirstOccurrence: boolean ): longint; +var + SlotIndex: integer; + Slot: THelpTopicSlot; + pData: pUInt8; + pSlotEnd: pUInt8; + + EscapeLen: longint; + + GlobalDictIndex: uint32; + IsWord: boolean; + WordRelevance: uint32; + + CurrentMatchRelevance: uint32; // total relevances for words matched so far + // in the current sequence + +// CurrentMatch: string; // useful for debugging only + LocalDictIndex: uint8; + + SequenceIndex: longint; + SequenceStartSlotIndex: longint; + pSequenceStartData: pUInt8; + + pStepWordRelevances: UInt32ArrayPointer; // word relevances for the current step in the sequence + + // get the current slot start and end pointers + procedure GetSlot; + begin + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + pData := Slot.pData; + pSlotEnd := pData + Slot.Size; + end; + + // get pointer to the current set of word relevances + procedure GetStepFlags; + begin + pStepWordRelevances := WordSequence[ SequenceIndex ]; + end; + + // store the current point as start of a sequence + procedure StoreStartOfSequence; + begin + SequenceIndex := 0; + SequenceStartSlotIndex := SlotIndex; + pSequenceStartData := pData; + CurrentMatchRelevance := 0; +// CurrentMatch := ''; + GetStepFlags; + end; + +begin + Result := 0; + + EnsureSlotsLoaded; + + if _NumSlots = 0 then + // thar's nowt in yon topic, cannae be a match laid + exit; + + SlotIndex := 0; + + GetSlot; + + StoreStartOfSequence; + + while true do + begin + LocalDictIndex := pData^; + IsWord := false; + if LocalDictIndex < Slot.LocalDictSize then + begin + IsWord := true; + // Normal word lookup, so get the global dict idnex before we + // (potentially) move to next slot + GlobalDictIndex := Slot.pLocalDictionary^[ LocalDictIndex ]; + end; + + inc( pData ); + if pData >= pSlotEnd then + begin + // reached end of slot, next please + inc( SlotIndex ); + if SlotIndex < _NumSlots then + GetSlot; + // else - there is nothing more to search + // but we need to check this last item + end; + + if IsWord then + begin + // Normal word lookup + WordRelevance := 0; + + if GlobalDictIndex < _GlobalDictionary.Count then + if not StrIsEmptyOrSpaces( _GlobalDictionary[ GlobalDictIndex ] ) then; + WordRelevance := pStepWordRelevances^[ GlobalDictIndex ]; + + if WordRelevance > 0 then + begin + // Found a matching word + inc( CurrentMatchRelevance, WordRelevance ); +// debug: +// CurrentMatch := CurrentMatch + +// pstring( _GlobalDictionary[ GlobalDictIndex ] )^; + + if SequenceIndex = 0 then + begin + // remember next start point + SequenceStartSlotIndex := SlotIndex; + pSequenceStartData := pData; + end; + + inc( SequenceIndex ); + + if SequenceIndex < WordSequence.Count then + begin + // get next set of flags. + GetStepFlags; + end + else + begin + // found a complete sequence. Cool! + + inc( result, CurrentMatchRelevance ); + + if StopAtFirstOccurrence then + exit; + + // start looking from the beginning of the sequence again. + StoreStartOfSequence; + end; + end + else + begin + // not a match at this point, restart search + if SequenceIndex > 0 then + begin + // we had matched one or more steps already, + // back to start of sequence AND back to + // point we started matching from (+1) + SequenceIndex := 0; + CurrentMatchRelevance := 0; +// CurrentMatch := ''; + SlotIndex := SequenceStartSlotIndex; + GetSlot; + pData := pSequenceStartData; + GetStepFlags; + end + else + begin + // haven't matched anything yet. + // update start of sequence + SequenceStartSlotIndex := SlotIndex; + pSequenceStartData := pData; + end; + end; + end + else + begin + // special code + if LocalDictIndex = $ff then + begin + // escape string, skip it + EscapeLen := pData ^; + inc( pData, EscapeLen ); + end; + end; + + if SlotIndex >= _NumSlots then + begin + // finished searching topic + break; + end; + + // next item + end; +end; + + +function TTopic.CountWord( DictIndex: integer ): longint; +begin + Result := SearchForWord( DictIndex, false ); +end; + +function TTopic.ContainsWord( DictIndex: integer ): boolean; +begin + Result := SearchForWord( DictIndex, true ) > 0; +end; + +// Gets the window dimensions specified by this topic's +// contents header +procedure TTopic.GetContentsWindowRect( ContentsRect: THelpWindowRect ); +var + extendedinfo: TExtendedTOCEntry; + XY: THelpXYPair; + p: pbyte; + + Flags: byte; +begin + Flags := _pTOCEntry ^.flags; + p := pByte( _pTOCEntry + sizeof( TTOCEntryStart ) ); + + ContentsRect.Left := 0; + ContentsRect.Bottom := 0; + ContentsRect.Width := 100; + ContentsRect.Height := 100; + + if ( Flags and TOCEntryExtended ) > 0 then + begin + // have more details available... + ExtendedInfo.w1 := p^; + ExtendedInfo.w2 := ( p+1) ^; + inc( p, sizeof( ExtendedInfo ) ); + + if ( ExtendedInfo.w1 and 1 ) > 0 then + begin + // read origin + XY := pHelpXYPair( p )^; + inc( p, sizeof( XY ) ); + ReadHelpPosition( XY, ContentsRect ); + end; + if ( ExtendedInfo.w1 and 2 ) > 0 then + begin + // read size + XY := pHelpXYPair( p )^; + inc( p, sizeof( XY ) ); + ReadHelpSize( XY, ContentsRect ); + end; + end; +end; + +const + IPFColorNames: array[ 0..15 ] of string = + ( + 'default', + 'blue', + 'red', + 'pink', + 'green', + 'cyan', + 'yellow', + 'neutral', +// 'brown', ?? + 'darkgray', + 'darkblue', + 'darkred', + 'darkpink', + 'darkgreen', + 'darkcyan', + 'black', + 'palegray' + ); + +Procedure SaveExtraLinkData( Link: TWindowedHelpLink; + pData: pUInt8 ); +var + LinkFlags1: uint8; + LinkFlags2: uint8; + LinkDataIndex: longint; + pLinkXY: pHelpXYPair; + pLinkData: pUInt8; +begin + LinkFlags1 := ( pData + 0 ) ^; + LinkFlags2 := ( pData + 1 ) ^; + + pLinkData := pData + 2; + + if ( LinkFlags1 and 1 ) > 0 then + begin + // position specified + pLinkXY := pHelpXYPair( pLinkData ); + inc( pLinkData, sizeof( THelpXYPair ) ); + end; + + if ( LinkFlags1 and 2 ) > 0 then + begin + // size specified + pLinkXY := pHelpXYPair( pLinkData ); + inc( pLinkData, sizeof( THelpXYPair ) ); + end; + + if ( LinkFlags1 and 8 ) > 0 then + begin + // window controls specified - skip + inc( pLinkData, 2 ); + end; + + if ( LinkFlags2 and 4 ) > 0 then + begin + // group specified + Link.GroupIndex := pUInt16( pLinkData )^; + inc( LinkDataIndex, sizeof( uint16 ) ); + end; + + if ( LinkFlags1 and 64 ) > 0 then + begin + Link.Automatic := true; + end; + + if ( LinkFlags1 and 4 ) > 0 then + Link.ViewPort := true; + + if ( LinkFlags2 and 2 ) > 0 then + Link.Dependent := true; + + if ( LinkFlags1 and 128 ) > 0 then + Link.Split := true; + + // cant be bothered with the others. +end; + +procedure TTopic.SaveIPFEscapeCode( Var State: TParseState; + Var pData: pUInt8; + Var F: TextFile; + ImageOffsets: TList ); +var + EscapeLen: uint8; + EscapeCode: uint8; + + Margin: integer; + + BitmapOffset: longword; + BitmapFlags: uint8; + + ColorCode: uint8; + StyleCode: uint8; + + FontIndex: uint8; + pFontSpec: pTHelpFontSpec; + + FaceName: string; + + ExternalLinkFileIndex: uint8; + ExternalLinkTopicID: string; + + ProgramLink: string; + ProgramPath: string; + tmpProgramLinkParts : TStrings; + + OutputString: string; +begin + EscapeLen := pData^; + EscapeCode := (pData + 1) ^; + OutputString := ''; + + case EscapeCode of + + ecSetLeftMargin: + begin + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, false ); + end; + + ecSetLeftMarginNewLine: + begin + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, false ); + OutputString := OutputString + + RTF_NewLine; + end; + + ecSetLeftMarginFit: + begin + Margin := integer( ( pData + 2 )^ ); + GetMarginTag( Margin, State.FontState, OutputString, true ); + // note that this will cause following tex to be "tabbed" across to the + // new margin position, if not yet there. + // if we are already past this margin then a new line should be started. + + end; + + ecSetLeftMarginHere: + begin + OutputString := '<leftmargin here>'; + end; + + ecHighlight1: // hp1,2,3, 5,6,7 + begin + StyleCode := ( pData + 2 ) ^; + if StyleCode > 3 then + StyleCode := StyleCode + 1; // 4, 8 and 9 are expressed in highlight2 code + + if StyleCode > 0 then + Write( F, ':hp' + IntToStr( StyleCode ) + '.' ) + else + Write( F, ':ehp' + IntToStr( State.StyleCode ) + '.' ); + State.StyleCode := StyleCode; + end; + + ecHighlight2: // hp4, 8, 9 + begin + StyleCode := ( pData + 2 ) ^; + case StyleCode of + 1: StyleCode := 4; + 2: StyleCode := 8; + 3: StyleCode := 9; + end; + + if StyleCode > 0 then + Write( F, ':hp' + IntToStr( StyleCode ) + '.' ) + else + Write( F, ':ehp' + IntToStr( State.StyleCode ) + '.' ); + State.StyleCode := StyleCode; + end; + + ecLinkStart: + begin + Write( F, ':link reftype=hd' ); // link to heading + + Write( F, ' refid=' + IntToStr( pUInt16( pData + 2 )^ ) ); + + { + if EscapeLen >= 6 then + begin + GetExtraLinkData( Link, pData + 4 ); + end;} + +// if Link.Automatic then +// Write( F, ' auto' ); + + Write( F, '.' ); + + inc( State.LinkIndex ); + end; + + ecFootnoteLinkStart: + begin + Write( F, ':link reftype=fn refid=fn' + + IntToStr( pUInt16( pData + 2 )^ ) + + '.' ); + inc( State.LinkIndex ); + end; + + ecStartLinkByResourceID: + begin + Write( F, ':link reftype=hd res=' + + IntToStr( pUInt16( pData + 2 )^ ) + + '.' ); + + inc( State.LinkIndex ); + end; + + ecExternalLink: + begin + ExternalLinkFileIndex := ( pData + 2 )^; + ExternalLinkTopicID := StrNPas( pchar( pData + 4 ), ( pData + 3 )^ ); + Write( F, ':link reftype=hd ' + + ' refid=' + StrInSingleQuotes( ExternalLinkTopicID ) + + ' database=' + StrInSingleQuotes( _ReferencedFiles[ ExternalLinkFileIndex ] ) + + '.' ); + + end; + + ecProgramLink: + begin + ProgramLink := StrNPas( pchar( pData + 3 ), EscapeLen - 3 ); + tmpProgramLinkParts := TStringList.Create; + StrExtractStrings(tmpProgramLinkParts, ProgramLink, [' '], #0); + ProgramPath := tmpProgramLinkParts[0]; + tmpProgramLinkParts.Destroy; + + Write( F, ':link reftype=launch' + + ' object=' + StrInSingleQuotes( ProgramPath ) + + ' data=' + StrInSingleQuotes( ProgramLink ) + + '.' ); + end; + + ecLinkEnd: + begin + Write( F, ':elink.' ); + if State.FootnoteLink <> nil then + State.FootnoteLink := nil; + end; + + ecStartCharGraphics: + begin + State.FontState := fsFixed; + State.InCharGraphics := true; + WriteLn( F, '' ); + WriteLn( F, ':cgraphic.' ); + State.Spacing := false; + end; + + ecEndCharGraphics: + begin + State.FontState := fsNormal; + State.InCharGraphics := false; + WriteLn( F, '' ); + WriteLn( F, ':ecgraphic.' ); + State.Spacing := true; + end; + + ecImage: + begin + BitmapFlags := ( pData + 2 )^; + BitmapOffset := pUInt32( pData + 3 )^; + + SaveImageText( BitmapOffset, BitmapFlags, F, ImageOffsets ); + + if State.Spacing then + Write( F, ' ' ); + end; + + ecLinkedImage: + begin + SaveLinkedImage( pData, F, ImageOffsets ); + // Note! Early exit, since the procedure + // will update pData. + exit; + end; + + ecStartLines: + begin + WriteLn( F, '' ); + // aligned text + case ( pData + 2 )^ of + 0, // just in case - to match image alignment oddities + 1: + begin + WriteLn( F, ':lines.' ); + State.Alignment := itaLeft; + end; + + 2: + begin + WriteLn( F, ':lines align=right.' ); + State.Alignment := itaRight; + end; + + 4: + begin + WriteLn( F, ':lines align=center.' ); + State.Alignment := itaCenter; + end; + end; + end; + + ecEndLines: + begin + // supposed to turn word wrap on, default font + WriteLn( F, '' ); + WriteLn( F, ':elines.' ); + State.Alignment := itaLeft; + end; + + ecForegroundColor: + begin + ColorCode := ( pData + 2 )^; + + if ColorCode < High( IPFColorNames ) then + Write( F, ':color fc=' + IPFColorNames[ ColorCode ] + '.' ); + end; + + ecBackgroundColor: + begin + ColorCode := ( pData + 2 )^; + if ColorCode < High( IPFColorNames ) then + Write( F, ':color bc=' + IPFColorNames[ ColorCode ] + '.' ); + end; + + ecFontChange: + begin + FontIndex := ( pData + 2 )^; + if FontIndex = 0 then + begin + // back to default font + Write( F, ':font facename=default.' ); + State.FontState := fsNormal; + end + else if FontIndex < _FontTable.Count then + begin + // valid font index + pFontSpec := _FontTable[ FontIndex ]; + + if pFontSpec = SubstituteFixedFont then + begin + // oops. + OutputString := '<tt>'; + State.FontState := fsFixed; + end + else + begin + pFontSpec := _FontTable[ FontIndex ]; + FaceName := StrNPas( pFontSpec^.FaceName, + sizeof( pFontSpec^.FaceName ) ); + Write( F, + ':font facename=' + StrInSingleQuotes( FaceName ) + + ' size=' + IntToStr( pFontSpec^.Height ) + + 'x' + IntToStr( pFontSpec^.Width ) + + '.' ); + State.FontState := fsCustom; + end; + end; + end + end; // case escape code of... + + // Write( F, OutputString ); + + inc( pData, EscapeLen ); +end; + +procedure TTopic.SaveToIPF( Var f: TextFile; + ImageOffsets: TList ); +var + SlotIndex: integer; + Slot: THelpTopicSlot; + pData: pUInt8; + pSlotEnd: pUInt8; + GlobalDictIndex: uint32; + StringToAdd: string; + LocalDictIndex: uint8; + State: TParseState; + SequenceStepIndex: longint; + LineLen: longint; + c: char; +begin + EnsureSlotsLoaded; + + State.LinkIndex := 0; + State.FontState := fsNormal; // ? Not sure... this could be reset at start of slot + State.InCharGraphics := false; + State.Spacing := true; + State.ForegroundColorTag := '</color>'; + State.BackgroundColorTag := '</backcolor>'; + + State.StartOfTextBlock := -1; + State.TextBlock := ''; + + State.FootnoteLink := nil; + + State.StyleCode := 0; + + SequenceStepIndex := 0; + + LineLen := 0; + + for SlotIndex := 0 to _NumSlots - 1 do + begin + if not State.InCharGraphics then + State.Spacing := true; // this is just a guess as to the exact view behaviour. + // inf.txt indicates that spacing is reset to true at + // slot (cell) start, but that doesn't seem to be the + // case when in character graphics... hey ho. + + Slot := THelpTopicSlot(_Slots[ SlotIndex ]); + + pData := Slot.pData; + + pSlotEnd := pData + Slot.Size; + + State.Alignment := itaLeft; + + while pData < pSlotEnd do + begin + LocalDictIndex := pData^; + inc( pData ); + + if LocalDictIndex < Slot.LocalDictSize then + begin + // Normal word lookup + GlobalDictIndex := Slot.pLocalDictionary^[ LocalDictIndex ]; + + // normal lookup + if GlobalDictIndex < _GlobalDictionary.Count then + StringToAdd := _GlobalDictionary[ GlobalDictIndex ] + else + StringToAdd := ''; + + if (Length( StringToAdd ) = 1) and Settings.IPFTopicSaveAsEscaped then + begin + // could be symbol + c := StringToAdd[ 1 ]; + case C of + '&': StringToAdd := '&.'; + '''': StringToAdd := '&apos.'; + '*': StringToAdd := '&asterisk.'; + '@': StringToAdd := '&atsign.'; + '\': StringToAdd := '&bsl.'; + '^': StringToAdd := '&caret.'; + '"': StringToAdd := '&osq.'; + ':': StringToAdd := '&colon.'; + '.': StringToAdd := '&per.'; + '(': StringToAdd := '&lpar.'; + ')': StringToAdd := '&rpar.'; + '/': StringToAdd := '&slash.'; + ',': StringToAdd := '&comma.'; + '-': StringToAdd := '&hyphen.'; + '_': StringToAdd := '&us.'; + '~': StringToAdd := '&tilde.'; + '+': StringToAdd := '&plus.'; + '>': StringToAdd := '>.'; + ';': StringToAdd := '&semi.'; + Chr($da): StringToAdd := '+'; + Chr($c4): StringToAdd := '-'; + Chr($b3): StringToAdd := '|'; + Chr($c3): StringToAdd := '|'; + Chr($bf): StringToAdd := '+'; + end; + end; + + inc( LineLen, Length( StringToAdd ) ); + if ( LineLen > 80 ) and ( not State.InCharGraphics ) then + begin + WriteLn( F ); + LineLen := 0; + end; + + Write( F, StringToAdd ); +{ + if State.FootnoteLink <> nil then + begin + State.FootnoteLink.Title := State.FootnoteLink.Title + StringToAdd; + if State.Spacing then + begin + State.FootnoteLink.Title := State.FootnoteLink.Title + ' '; + end; + end; + } + if State.Spacing then + begin + Write( F, ' ' ); + inc( LineLen ); + end; + end + else + begin + // special code + + case LocalDictIndex of + IPF_END_PARA: + begin + WriteLn( F, '' ); + Write( F, ':p.' ); + LineLen := 3; + + if not State.InCharGraphics then + State.Spacing := true; + end; + + IPF_CENTER: + begin + WriteLn( F, '' ); + Write( F, '.ce ' ); // remainder of this line is centered. + LineLen := 4; + State.Alignment := itaCenterOnePara; + end; + + IPF_INVERT_SPACING: + begin + State.Spacing := not State.Spacing; + end; + + IPF_LINEBREAK: + begin + WriteLn( F, '' ); + if not State.InCharGraphics then + WriteLn( F, '.br ' ); // break must be the only thing on the line + + LineLen := 0; + if not State.InCharGraphics then + State.Spacing := true; + end; + + IPF_SPACE: + begin + if State.Spacing then + Write( F, ' ' ) + else + Write( F, ' ' ); + end; + + IPF_ESC: + begin + // escape sequence + SaveIPFEscapeCode( State, + pData, + F, + ImageOffsets ); + end; + + end; // case code of... + end; + end; // for slotindex = ... + end; + State.TextBlock := ''; + +end; + +// Compares two topics for purposes of sorting by +// search match relevance +function TopicRelevanceCompare( Item1, Item2: pointer ): longint; +var + Topic1, Topic2: TTopic; +begin + Topic1 := TTopic(Item1); + Topic2 := TTopic(Item2); + + if Topic1.SearchRelevance > Topic2.SearchRelevance then + Result := -1 + else if Topic1.SearchRelevance < Topic2.SearchRelevance then + Result := 1 + else + Result := 0; +end; + +// Compares two topics for purposes of sorting by title +function TopicTitleCompare( Item1, Item2: pointer ): longint; +begin + Result := CompareText( TTopic( Item1 )._Title, + TTopic( Item2 )._Title ); +end; + + +end. diff --git a/docview/src/HelpWindowDimensions.pas b/docview/src/HelpWindowDimensions.pas new file mode 100644 index 00000000..c8335176 --- /dev/null +++ b/docview/src/HelpWindowDimensions.pas @@ -0,0 +1,126 @@ +unit HelpWindowDimensions; + +{$mode objfpc}{$H+} + + // NewView - a new OS/2 Help Viewer + // Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) + // This software is released under the Gnu Public License - see readme.txt + +interface + +uses + IPFFileFormatUnit; + +const + ptCharacters = 0; + ptPercentage = 1; + ptPixels = 2; + ptPoints = 3; + ptDynamic = 4; + + XPosRight = 577; // some random values as markers + YPosTop = 577; + XYPosCenter = 578; + +type + THelpWindowRect = class(TObject) + public + Left: longint; // xposright means, right aligned + Bottom: longint; // xpostop means top aligned + // both: xyposcenter means centered + Width: longint; + Height: longint; + constructor Create; + procedure Assign(Rect: THelpWindowRect); + end; + +var + FootnoteRect: THelpWindowRect; + +procedure ReadHelpSize(const XY: THelpXYPair; var Rect: THelpWindowRect); +procedure ReadHelpPosition(const XY: THelpXYPair; var Rect: THelpWindowRect); + + +implementation + +constructor THelpWindowRect.Create; +begin + Left := -1; + Bottom := -1; + Width := -1; + Height := -1; +end; + +procedure THelpWindowRect.Assign(Rect: THelpWindowRect); +begin + Left := Rect.Left; + Bottom := Rect.Bottom; + Width := Rect.Width; + Height := Rect.Height; +end; + +function GetPos(const PositionType: uint8; const Value: longint): longint; +begin + case PositionType of + ptCharacters: + Result := Value; + ptPercentage: + Result := Value; + ptPixels: + Result := Value * 5; + ptPoints: + Result := Value; + ptDynamic: + case Value of + 1: + Result := 0; // left + 2: + Result := XPosRight; // right + 4: + Result := YPosTop; // top + 8: + Result := 0; // bottom + 16: + Result := XYPosCenter; // center. + end; + end; +end; + +procedure ReadHelpPosition(const XY: THelpXYPair; var Rect: THelpWindowRect); +var + XPositionType: uint8; + YPositionType: uint8; +begin + // read origin + XPositionType := XY.Flags div 16; + YPositionType := XY.Flags and 15; + + if XY.X <> $ffff then + Rect.Left := GetPos(XPositionType, XY.X); + if XY.Y <> $ffff then + Rect.Bottom := GetPos(YPositionType, XY.Y); +end; + +procedure ReadHelpSize(const XY: THelpXYPair; var Rect: THelpWindowRect); +begin + if XY.X <> $ffff then + Rect.Width := XY.X; + if XY.Y <> $ffff then + Rect.Height := XY.Y; +end; + +initialization + FootnoteRect := THelpWindowRect.Create; + with FootnoteRect do + begin + Left := 10; + Width := 80; + Bottom := 10; + Height := 40; + end; + +finalization + FootnoteRect.Free; + +end. + diff --git a/docview/src/IPFEscapeCodes.pas b/docview/src/IPFEscapeCodes.pas new file mode 100644 index 00000000..41e743d4 --- /dev/null +++ b/docview/src/IPFEscapeCodes.pas @@ -0,0 +1,47 @@ +Unit IPFEscapeCodes; + +{$mode objfpc}{$H+} + + +// NewView - a new OS/2 Help Viewer +// Copyright 2001 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +// List of IPF escape codes. Not complete! Many are just used +// as magic numbers in HelpTopic.pas + +const + // Basic byte codes + IPF_END_PARA = $fa; + IPF_CENTER = $fb; + IPF_INVERT_SPACING = $fc; + IPF_LINEBREAK = $fd; + IPF_SPACE = $fe; + IPF_ESC = $ff; + + // Subescape codes of + HPART_DEFINE = 0; + HPART_PT_HDREF = 1; + HPART_PT_FNREF = 2; + HPART_PT_SPREF = 3; + HPART_HDREF = 4; + HPART_FNREF = 5; + HPART_SPREF = 6; + HPART_LAUNCH = 7; + HPART_PT_LAUNCH = 8; + HPART_INFORM = 9; + HPART_PT_INFORM = 10; + // ?? 11 ?? + HPART_EXTERN_PT_HDREF = 12; + HPART_EXTERN_PT_SPREF = 13; + HPART_EXTERN_HDREF = 14; + HPART_EXTERN_SPREF = 15; + HPART_GLOBAL_HDREF = 16; + HPART_GLOBAL_PT_HDREF = 17; + +Implementation + +Initialization +End. diff --git a/docview/src/IPFFileFormatUnit.pas b/docview/src/IPFFileFormatUnit.pas new file mode 100644 index 00000000..b954f4c8 --- /dev/null +++ b/docview/src/IPFFileFormatUnit.pas @@ -0,0 +1,493 @@ +Unit IPFFileFormatUnit; + +{$mode objfpc}{$H+} + +interface + +// Definition of IPF file header and other structures + +uses + SysUtils; + +type + uint32 = longword; + uint16 = word; + uint8 = byte; + pUInt16 = ^uint16; + pUInt32 = ^uint32; + pUInt8 = ^uint8; + Unsigned_31 = 0 .. (1 shl 31) - 1; // 31-bit type + Unsigned_4 = 0 .. (1 shl 4) - 1; // 4-bit type + Unsigned_1 = 0 .. (1 shl 1) - 1; // 1-bit type + + + PCharArray = packed array[ 0..0 ] of PCHar; + UInt32Array = packed array[ 0..0 ] of UInt32; + UInt16Array = packed array[ 0..0 ] of UInt16; + UInt8Array = packed array[ 0..0 ] of UInt8; + + PCharArrayPointer = ^PCharArray; + UInt32ArrayPointer = ^UInt32Array; + UInt16ArrayPointer = ^UInt16Array; + UInt8ArrayPointer = ^UInt8Array; + + TBooleanArray = array[ 0..0 ] of boolean; + BooleanArrayPointer = ^TBooleanArray; + + + EHelpFileException = class( Exception ) + end; + + + EWindowsHelpFormatException = class( Exception ) + end; + + + TProgressCallback = procedure(n, outof: integer; AMessage: string) of object; + + +const + ErrorCorruptHelpFile = 'Corrupt help file, or something similar'; + +const + INF_HEADER_ID = 'HSP'; + +Type + THelpFileHeader = packed record + ID: array[0..2] of ansichar; // ID magic word "HSP" + flags: uint8; // probably a flag word... + // [0x01] bit 0: set if INF style file + // [0x10] bit 4: set if HLP style file + // patching this byte allows reading HLP files + // using the VIEW command, while help files + // seem to work with INF settings here as well. + hdrsize: uint16; // total size of header + version_hi: uint8; + version_lo: uint8; + ntoc: uint16; // number of entries in the tocarray + tocstart: uint32; // file offset of the start of the toc + toclen: uint32; // number of bytes in file occupied by the toc + tocoffsetsstart: uint32; // file offset of the start of array of toc offsets + nres: uint16; // number of panels with ressource numbers + resstart: uint32; // 32 bit file offset of ressource number table + nname: uint16; // number of panels with textual name + namestart: uint32; // 32 bit file offset to panel name table + nindex: uint16; // number of index entries + indexstart: uint32; // 32 bit file offset to index table + indexlen: uint32; // size of index table + icmdCount: uint16; // number of icmd index items + icmdOffset: uint32; // file offset to icmd index items + icmdSize: uint32; // size of icmd index table + searchstart: uint32; // 31 bit file offset of full text search table + // Note: top bit indicates 32 bit search record! + searchlen: uint32; // size of full text search table + nslots: uint16; // number of "slots" + slotsstart: uint32; // file offset of the slots array + dictlen: uint32; // number of bytes occupied by the "dictionary" + ndict: uint16; // number of entries in the dictionary + dictstart: uint32; // file offset of the start of the dictionary + imgstart: uint32; // file offset of image data + maxCVTIndex: byte; // highest index inside panel's local dictionary, + // always seems to be 245 + nlsstart: uint32; // 32 bit file offset of NLS table + nlslen: uint32; // size of NLS table + extstart: uint32; // 32 bit file offset of extended data block + reserved: array[ 0..11 ] of byte; // for future use. set to zero. + title: array[ 0..47 ] of ansichar; // ASCII title of database + end; + TPHelpFileHeader = ^THelpFileHeader; + + TExtendedHelpFileHeader = packed record + NumFontEntry: uint16; // FONT TABLE: Number entries + FontTableOffset: uint32; // FONT TABLE: Offset in file + NumDataBase: uint16; // DATA BASE: Number of files + DataBaseOffset: uint32; // DATA BASE: Offset in file + DataBaseSize: uint32; // DATA BASE: Size in bytes + EntryInGNameTable: uint16; // GLOBAL NAMES: Number entries + HelpPanelGNameTblOffset: uint32; // GLOBAL NAMES: Offset in file + StringsOffset: uint32; // STRINGS : Offset in file + StringsSize: uint16; // STRINGS : Total bytes of all strings + ChildPagesOffset: uint32; // CHILDPAGES : Offset in file + ChildPagesSize: uint32; // CHILDPAGES : Total bytes of all strings + NumGIndexEntry: uint32; // Total number of Global Index items + CtrlOffset: uint32; // CTRL BUTTONS : offset in file + CtrlSize: uint32; // CTRL BUTTONS : size in bytes + Reserved: array[0..3] of uint32; // For future use. Set to zero + end; + TPExtendedHelpFileHeader = ^TExtendedHelpFileHeader; + +Type + TTOCEntryStart = packed record + length: uint8; // length of the entry including this byte (but not including extended data) + flags: uint8; // flag byte, description folows (MSB first) + // bit8 haschildren; // following nodes are a higher level + // bit7 hidden; // this entry doesn't appear in VIEW.EXE's + // presentation of the toc + // bit6 extended; // extended entry format + // bit5 stuff; // ?? + // int4 level; // nesting level + numSlots: uint8; // number of "slots" occupied by the text for + // this toc entry + end; + pTTOCEntryStart = ^TTOCEntryStart; + + TExtendedTOCEntry = packed record + w1: uint8; + // bit 3: Window controls are specified + // bit 2: Viewport + // bit 1: Size is specified. + // bit 0: Position is specified. + w2: uint8; + // bit 3: + // bit 2: Group is specified. + // bit 1 + // bit 0: Clear (all windows before display) + end; + pExtendedTOCEntry = ^TExtendedTOCEntry; + + TTOCEntryOffsetArray = packed array[ 0..0 ] of uint32; + pTTOCEntryOffsetArray = ^TTOCEntryOffsetArray; + +const + TOCEntryExtended = $20; { extended entry format } + TOCEntryHidden = $40; { this entry doesn't appear in VIEW.EXE's presentation of the toc } + TOCEntryHasChildren = $80; { following nodes are a higher level } + TOCEntryLevelMask = $0f; + +type + THelpXYPair = packed record + Flags: uint8; + X: uint16; + Y: uint16; + end; + pHelpXYPair = ^THelpXYPair; + + TSlotHeader = packed record + stuff: uint8; // always 0?? + localdictpos: uint32; // file offset of the local dictionary + nlocaldict: uint8; // number of entries in the local dict + ntext: uint16; // number of bytes in the text + end; + pSlotHeader = ^TSlotHeader; + + THelpFontSpec = packed record + FaceName: array[ 0..32 ] of ansichar; + Height: uint16; + Width: uint16; + Codepage: uint16; + end; + pTHelpFontSpec = ^THelpFontSpec; + + TNlsHeader = packed record + NlsSize: uint16; + NlsType: uint8; + NlsFormat: uint8; + end; + + TNlsCountryDef = packed record + { if the following is true then... + NlsHeader.size = 10 + NlsHeader.type = NLSRecType.CONTROL + NlsHeader.format = 0 + } + Value: uint16; // =256 + Code: uint16; // country code + Page: uint16; // code page + Reserved: uint16; + end; + + // Single-byte character set + TSbcsNlsGrammerDef = packed record + { if the following is true then... + NlsHeader.size = 36 + NlsHeader.type = NLSRecType.WORD || NLSRecType.GRAPHIC + NlsHeader.format = 0 + } + bits: array[0..31] of uint8; // high-order bits first + end; + + TPanelControls = packed record + ControlCount: uint16; // number of ControlDef records + GroupCount: uint16; // number of GroupDef records + GroupIndex: uint16; // for cover page + Reserved: uint16; + end; + + TControlDef = packed record + CtrlType: uint16; // type of control + ResourceID: uint16; // resource id (panel) it belongs to + { variable length data follows, contains button text } + // DictString: array of char; + end; + + TControlGroupDef = packed record + Count: uint16; // number of indexes into ControlDef records + { variable length data follows } + // index[count] of type uint16 + end; + +// List of IPF escape codes. + +const + // Basic byte codes + IPF_END_PARA = $fa; + IPF_CENTER = $fb; + IPF_INVERT_SPACING = $fc; + IPF_LINEBREAK = $fd; + IPF_SPACE = $fe; + IPF_ESC = $ff; // followed by one of the ecXXX codes below + + // FF XX + ecSetLeftMargin = $02; + ecHighlight1 = $04; // hp1,2,3,5,6,7 + ecLinkStart = $05; + ecFootnoteLinkStart = $07; + ecLinkEnd = $08; + ecStartCharGraphics = $0b; + ecEndCharGraphics = $0c; + ecHighlight2 = $0d; // hp4,8,9 + ecImage = $0e; + ecLinkedImage = $0f; + ecProgramLink = $10; + ecSetLeftMarginNewLine = $11; + ecSetLeftMarginFit = $12; + ecForegroundColor = $13; + ecBackgroundColor = $14; + ecFontChange = $19; + ecStartLines = $1a; + ecEndLines = $1b; + ecSetLeftMarginHere = $1c; + ecStartLinkByResourceID = $1d; + ecExternalLink = $1f; + + // Subescape codes of + HPART_DEFINE = 0; + HPART_PT_HDREF = 1; + HPART_PT_FNREF = 2; + HPART_PT_SPREF = 3; + HPART_HDREF = 4; + HPART_FNREF = 5; + HPART_SPREF = 6; + HPART_LAUNCH = 7; + HPART_PT_LAUNCH = 8; + HPART_INFORM = 9; + HPART_PT_INFORM = 10; + // ?? 11 ?? + HPART_EXTERN_PT_HDREF = 12; + HPART_EXTERN_PT_SPREF = 13; + HPART_EXTERN_HDREF = 14; + HPART_EXTERN_SPREF = 15; + HPART_GLOBAL_HDREF = 16; + HPART_GLOBAL_PT_HDREF = 17; + +// ----------------------------------------------------------- +// Operations on Int32 arrays, used for searching +// These could be optimised heavily if needed. +procedure AllocUInt32Array( Var pArray: UInt32ArrayPointer; + Size: longint ); +procedure FreeUInt32Array( Var pArray: UInt32ArrayPointer; + Size: longint ); + +procedure FillUInt32Array( pArray: UInt32ArrayPointer; + Size: longint; + Value: UInt32 ); + +procedure AddUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +// Dest = Dest + source * Multiplier +procedure AddMultConstUInt32Array( pSource: UInt32ArrayPointer; + Multiplier: longint; + pDest: UInt32ArrayPointer; + Size: longint ); + +procedure AndUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +// If both source and dest > 0 then +// add source to dest +procedure AndAddUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +// if Source > 0 then dest is set to 0 +procedure AndNotUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +// dest = dest or source; +// if source > 0 then set dest to > 0 +procedure OrUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +// if source = 0 then dest set to >0 +procedure NotOrUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +procedure CopyUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); + +procedure ClearUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ); +procedure SetUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ); + +// returns the result of ORing every array element. +// Can be useful for debugging e.g. seeing at a glance +// if any element is non-zero +function OrAllUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ): longint; + + +Implementation + + +// Operations on int32 arrays +// ----------------------------------------------------------- + +procedure AllocUInt32Array( Var pArray: UInt32ArrayPointer; + Size: longint ); +begin + GetMem( pArray, + Size + * sizeof( UInt32 ) ); +end; + +procedure FreeUInt32Array( Var pArray: UInt32ArrayPointer; + Size: longint ); +begin + FreeMem( pArray, + Size + * sizeof( UInt32 ) ); +end; + +// This is a nice fast implementation of filling an +// array of dwords (Int32/longword) +procedure FillUInt32Array( pArray: UInt32ArrayPointer; + Size: longint; + Value: UInt32 ); +var + i: integer; +begin + assert( Size > 0 ); + if Size < 1 then + Exit; + for i := 0 to Size-1 do + begin + pArray^[i] := Value; + end; +end; + +procedure ClearUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ); +begin + FillUInt32Array( pArray, Size, 0 ); +end; + +procedure SetUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ); +begin + FillUInt32Array( pArray, Size, $ffffffff ); +end; + +procedure AddUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + inc( pDest^[ i ], pSource^[ i ] ); +end; + +procedure AddMultConstUInt32Array( pSource: UInt32ArrayPointer; + Multiplier: longint; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + inc( pDest^[ i ], pSource^[ i ] * Multiplier ); +end; + +procedure OrUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + pDest^[ i ] := pDest^[ i ] or pSource^[ i ]; +end; + +procedure CopyUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +begin + Move(pSource^, PDest^, Size * SizeOf(LongInt)); +end; + +procedure NotOrUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + if pSource^[ i ] = 0 then + pDest^[ i ] := 1; +end; + +procedure AndUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + pDest^[ i ] := pDest^[ i ] and pSource^[ i ]; +end; + +procedure AndAddUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + if ( pSource^[ i ] > 0 ) + and ( pDest^[ i ] > 0 ) then + inc( pDest^[ i ], pSource^[ i ] ) + else + pDest^[ i ] := 0; +end; + +procedure AndNotUInt32Array( pSource: UInt32ArrayPointer; + pDest: UInt32ArrayPointer; + Size: longint ); +var + i: longint; +begin + for i := 0 to Size - 1 do + if pSource^[ i ] > 0 then + pDest^[ i ] := 0; +end; + +function OrAllUInt32Array( pArray: UInt32ArrayPointer; + Size: longint ): longint; +var + i: longint; +begin + Result := 0; + for i := 0 to Size - 1 do + Result := Result or pArray^[ i ]; +end; + + +end. diff --git a/docview/src/NewViewConstantsUnit.pas b/docview/src/NewViewConstantsUnit.pas new file mode 100644 index 00000000..4e191b15 --- /dev/null +++ b/docview/src/NewViewConstantsUnit.pas @@ -0,0 +1,28 @@ +Unit NewViewConstantsUnit; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) +// Copyright 2006-2009 Ronald Brill (rbri at rbri dot de) +// This software is released under the Gnu Public License - see readme.txt + +// Common used constants for NewView + +Interface + +const + PARAM_LINK_NOTE = 'note'; + PARAM_LINK_PROGRAM = 'program'; + PARAM_LINK_URL = 'url'; + PARAM_LINK_EXTERNAL = 'external'; + + PRGM_EXPLORER = 'explore'; // web explorer + PRGM_NETSCAPE = 'netscape'; + PRGM_MOZILLA = 'mozilla'; + PRGM_FIREFOX = 'firefox'; + + +Implementation + +End. diff --git a/docview/src/SearchTable.pas b/docview/src/SearchTable.pas new file mode 100644 index 00000000..49c67ff5 --- /dev/null +++ b/docview/src/SearchTable.pas @@ -0,0 +1,298 @@ +Unit SearchTable; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +uses + Classes, IPFFileFormatUnit; + +// Code to read and use IPF search tables +// NB The RLE decompression was arrived at by trial and error +// it seems to be correct but it's difficult to test. + +type + TSearchTable = class(TObject) + protected + _Data: pointer; + _Entries: TList; // pointers to panel flag records + _RecordLengthIs16Bit: boolean; + _DictionaryCount: longint; + _TopicCount: longint; + + procedure ReadEntries; + + Procedure Check1ByteOfFlags( b: byte; + StartingIndex: longint; + Results: UInt32ArrayPointer ); + + procedure DoRLESearch( p: pbyte; + pDataEnd: pointer; + Results: UInt32ArrayPointer ); + + public + constructor Create( Data: pointer; + RecordLengthIs16Bit: boolean; + DictionaryCount: longint; + TopicCount: longint ); + destructor Destroy; override; + + // Sets Results to 1 for occurrences of DictIndex + procedure Search( DictIndex: uint16; + Results: UInt32ArrayPointer ); + + end; + +Implementation + +constructor TSearchTable.Create( Data: pointer; + RecordLengthIs16Bit: boolean; + DictionaryCount: longint; + TopicCount: longint ); +begin + _Data := Data; + _RecordLengthIs16Bit := RecordLengthIs16Bit; + _Entries := TList.Create; + _DictionaryCount := DictionaryCount; + _TopicCount := TopicCount; + ReadEntries; +end; + +destructor TSearchTable.Destroy; +begin + _Entries.Destroy; +end; + +procedure TSearchTable.ReadEntries; +var + pWordRecord: pointer; + RecordLen: uint16; + WordIndex: uint16; +begin + pWordRecord:= _Data; + + for WordIndex:= 0 to _DictionaryCount - 1 do + begin + _Entries.Add( pWordRecord ); + + if _RecordLengthIs16Bit then + RecordLen:= pUInt16( pWordRecord )^ + else // 8 bit + RecordLen:= pUInt8( pWordRecord )^; + inc( pWordRecord, RecordLen ); + end; +end; + + +// Search table decompression + +// Looks through a single byte of 8 flags, given by b, +// and updates topic entries within results for any flags +// that are set. +Procedure TSearchTable.Check1ByteOfFlags( b: byte; + StartingIndex: longint; + Results: UInt32ArrayPointer ); +var + TopicIndex: longint; +begin + TopicIndex:= StartingIndex; + while b > 0 do + begin + if b and $80 > 0 then + Results^[ TopicIndex ] := 1; + inc( TopicIndex ); + b:= b shl 1; + end; +end; + +// Decompress RLE compressed data starting at p, +// running til pDataEnd. Update topic entries in Results. +procedure TSearchTable.DoRLESearch( p: pbyte; + pDataEnd: pointer; + Results: UInt32ArrayPointer ); +var + TopicIndex: integer; + + N: integer; + thebyte: byte; + byte1, byte2: byte; +begin + assert( pbyte( p )^ = 1, 'Unexpected RLE type' ); + inc( p ); // skip header, always 1? + + TopicIndex:= 0; + + while p < pDataEnd do + begin + thebyte:= p^; + inc( p ); + + if thebyte = $80 then + begin + // escape + thebyte := p^; + inc( p ); + + if thebyte = 0 then + begin + // 16 bit repeat of zeroes?? + N := pUInt16( p )^ + 1; + inc( p, 2 ); + inc( TopicIndex, N ); + end + else + begin + // n+1 repeats of next 2 bytes??? + N := thebyte + 1; + byte1 := p^; + inc( p ); + byte2 := p^; + inc( p ); + while N > 0 do + begin + Check1ByteOfFlags( byte1, + TopicIndex, + Results ); + inc( TopicIndex, 8 ); + Check1ByteOfFlags( byte2, + TopicIndex, + Results ); + inc( TopicIndex, 8 ); + dec( N ); + end; + end; + end + else + begin + N:= thebyte and $7f + 1; + + if thebyte and $80 > 0 then + begin + // literal data + while N > 0 do + begin + Check1ByteOfFlags( p^, + TopicIndex, + Results ); + inc( TopicIndex, 8 ); + inc( p ); + dec( N ); + end; + end + else + begin + // repeat of next byte + thebyte := p^; + inc( p ); + while N > 0 do + begin + Check1ByteOfFlags( thebyte, + TopicIndex, + Results ); + inc( TopicIndex, 8 ); + dec( N ); + end; + end; + end; + end; +end; + +// This function finds uses of the given word (DictIndex) +// using the search table. Results[ topic ] is set to +// non-zero for topics which contain the word. +procedure TSearchTable.Search( DictIndex: uint16; + Results: UInt32ArrayPointer ); +var + TopicIndex: integer; + pWordRecord: pointer; + RecordLen: uint16; + CompressionCode: uint8; + pData: pointer; + pDataEnd: pointer; + Flags: uint8; +begin + FillUInt32Array( Results, _TopicCount, 0 ); + pWordRecord:= _Entries[ DictIndex ]; + + // Check search table format + if _RecordLengthIs16Bit then + begin + RecordLen:= pUInt16( pWordRecord )^; + CompressionCode:= pUInt8( pWordRecord + 2 )^; + pData:= pWordRecord + 3; + end + else // 8 bit + begin + RecordLen:= pUInt8( pWordRecord )^; + CompressionCode:= pUInt8( pWordRecord + 1 )^; + pData:= pWordRecord + 2; + end; + + // Decompress the search table for this word + pDataEnd:= pWordRecord + RecordLen; + case CompressionCode of + 0: // word not used anywhere. + ; + + 1: // used in all panels + FillUInt32Array( Results, _TopicCount, 1 ); + + 2: // RLE + begin + DoRLESearch( pData, + pDataEnd, + Results ); + end; + + 3: // list of topics containing word + begin + while pData < pDataEnd do + begin + TopicIndex:= pUInt16( pData )^; + Results^[ TopicIndex ] := 1; + inc( pData, 2 ); + end; + end; + + 4: // list of topics NOT containing word + begin + FillUInt32Array( Results, _TopicCount, 1 ); + + while pData < pDataEnd do + begin + TopicIndex:= pUInt16( pData )^; + Results^[ TopicIndex ] := 0; + inc( pData, 2 ); + end; + end; + + 5, // compressed by truncating bit stream at last byte containing a set bit. + 6: // same as above but starting at non-zero byte + begin + if CompressionCode = 5 then + TopicIndex:= 0 + else + begin + TopicIndex:= pUInt16( pData )^ * 8; + inc( pData, 2 ); + end; + + while pData < pDataEnd do + begin + Flags:= pUInt8( pData )^; + Check1ByteOfFlags( Flags, + TopicIndex, + Results ); + inc( TopicIndex, 8 ); + inc( pData ); + end; + end; + end; +end; + + +end. diff --git a/docview/src/SearchUnit.pas b/docview/src/SearchUnit.pas new file mode 100644 index 00000000..f7a8eb8e --- /dev/null +++ b/docview/src/SearchUnit.pas @@ -0,0 +1,567 @@ +Unit SearchUnit; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +// Contains code to search help files. + +uses + Classes, + HelpFile, + TextSearchQuery, + IPFFileFormatUnit; + +const + // match weightings + mwOnlyTitleWord = 200; + mwFirstTitleWord = 50; + mwTitleWord = 20; + + mwOnlyIndexWord = 100; + mwFirstIndexWord = 20; + mwIndexWord = 10; + mwTopicTextWord = 1; + + // best case match weighting of a word + mwExactWord = 20; + + +// note on weightings. The title/index weightings +// are multipled by word weightings. +// Topic text matches are equal to word weighting +// times word weighting. + +procedure SearchHelpFile( HelpFile: THelpFile; + Query: TTextSearchQuery; + Results: TList; + WordSequences: TList ); + +// clear a lsit of word sequences (as produced by above) +procedure ClearWordSequences( WordSequences: TList; DictionaryCount: longint ); + +Implementation + +uses + SysUtils + ,HelpTopic + ,CompareWordUnit + ,nvUtilities + ,ACLStringUtility + ; + +type + TSearchType = ( stGeneral, stStarts, stExactMatch, stEnds ); + +procedure ClearWordSequence( WordSequence: TList; + DictionaryCount: longint ); +var + StepIndex: longint; + DictionaryRelevances: UInt32ArrayPointer; +begin + for StepIndex := 0 to WordSequence.Count - 1 do + begin + DictionaryRelevances := WordSequence[ StepIndex ]; + FreeUInt32Array( DictionaryRelevances, DictionaryCount ); + end; + WordSequence.Clear; +end; + +procedure ClearWordSequences( WordSequences: TList; DictionaryCount: longint ); +var + SequenceIndex: longint; + lWordSequence: TList; +begin + for SequenceIndex := 0 to WordSequences.Count - 1 do + begin + lWordSequence := TList(WordSequences[ SequenceIndex ]); + ClearWordSequence( lWordSequence, DictionaryCount ); + lWordSequence.Destroy; + end; + WordSequences.Clear; +end; + +// given a search word which is known to matche Reference word, +// return the relevance +function MatchedWordRelevance( const SearchWord: string; + const ReferenceWord: string ): longint; +begin + Result := mwExactWord + * Length( SearchWord ) + div Length( ReferenceWord ); + if Result = 0 then + Result := 1; +end; + +// Compares the given search word against the given +// reference word. Returns a value indicating how well the +// search word matches, 0 = not at all. +function CompareWord( const SearchWord: string; + const ReferenceWord: string ): longint; +var + OccurrencePos: longint; +begin + Result := 0; + OccurrencePos := CaseInsensitivePos( SearchWord, ReferenceWord ); + if OccurrencePos = 0 then + begin + // no match + exit; + end; + + Result := MatchedWordRelevance( SearchWord, ReferenceWord ); +end; + +// Search the help file dictionary for words that match +// the given search word. Partial matches are considered. +// Results returns the matching word indexes. +procedure SearchDictionary( HelpFile: THelpFile; + SearchWord: string; + Results: UInt32ArrayPointer ); +var + DictIndex: integer; + DictWord: string; +begin + for DictIndex := 0 to HelpFile.DictionaryCount - 1 do + begin + DictWord := HelpFile.DictionaryWords[ DictIndex ]; + Results^[ DictIndex ] := CompareWord( SearchWord, DictWord ); + end; +end; + +// Search the help file dictionary for words that +// match the given search word exactly (except for case-insensitive) +procedure SearchDictionaryExact( HelpFile: THelpFile; + SearchWord: string; + Results: UInt32ArrayPointer ); +var + DictIndex: integer; + DictWord: string; +begin + FillUInt32Array( Results, HelpFile.DictionaryCount, 0 ); + + for DictIndex := 0 to HelpFile.DictionaryCount - 1 do + begin + DictWord := HelpFile.DictionaryWords[ DictIndex ]; + if SameText( SearchWord, DictWord ) then + Results^[ DictIndex ] := mwExactWord; + end; +end; + +// Search the help file dictionary for words that +// start with the given word +procedure SearchDictionaryStarts( HelpFile: THelpFile; + SearchWord: string; + Results: UInt32ArrayPointer ); +var + DictIndex: integer; + DictWord: string; +begin + FillUInt32Array( Results, HelpFile.DictionaryCount, 0 ); + + for DictIndex := 0 to HelpFile.DictionaryCount - 1 do + begin + DictWord := HelpFile.DictionaryWords[ DictIndex ]; + if StrStartsWithIgnoringCase(DictWord, SearchWord) then + Results^[ DictIndex ] := MatchedWordRelevance( SearchWord, DictWord ); + end; +end; + +// Search the help file dictionary for words that +// end with the given word +procedure SearchDictionaryEnds( HelpFile: THelpFile; + SearchWord: string; + Results: UInt32ArrayPointer ); +var + DictIndex: integer; + DictWord: string; +begin + FillUInt32Array( Results, HelpFile.DictionaryCount, 0 ); + + for DictIndex := 0 to HelpFile.DictionaryCount - 1 do + begin + DictWord := HelpFile.DictionaryWords[ DictIndex ]; + if StrEndsWithIgnoringCase( SearchWord, DictWord ) then + Results^[ DictIndex ] := MatchedWordRelevance( SearchWord, DictWord ); + end; +end; + +// Search titles of topics for given searchword +procedure SearchTopicTitles( HelpFile: THelpFile; + SearchWord: string; + Results: UInt32ArrayPointer ); +var + TopicIndex: longint; + Title: string; + TitleWord: string; + Topic: TTopic; + TitleWordIndex: longint; + WordRelevance: longint; + TitleWordRelevance: longint; + tmpTitleWords : TStrings; + i : integer; +begin + tmpTitleWords := TStringList.Create; + + // Search topic titles + for TopicIndex := 0 to HelpFile.TopicCount - 1 do + begin + Topic := HelpFile.Topics[ TopicIndex ]; + Title:= Topic.Title; + TitleWordIndex := 0; + + tmpTitleWords.Clear; + StrExtractStringsQuoted(tmpTitleWords, Title); + + for i := 0 to tmpTitleWords.count-1 do + begin + TitleWord := tmpTitleWords[i]; + + WordRelevance := CompareWord( SearchWord, + TitleWord ); + if WordRelevance > 0 then + begin + if TitleWordIndex = 0 then + begin + // matching the first word is best + if i = tmpTitleWords.count-1 then + begin + // in fact it's the only word + TitleWordRelevance := mwOnlyTitleWord * WordRelevance + end + else + TitleWordRelevance := mwFirstTitleWord * WordRelevance + end + else + begin + TitleWordRelevance := mwTitleWord * WordRelevance; + end; + inc( Results^[ Topic.Index ], TitleWordRelevance ); + end; + inc( TitleWordIndex ); + end; + end; + tmpTitleWords.Free; +end; + +// Search index entries for given searchword +procedure SearchIndex( HelpFile: THelpFile; SearchWord: string; Results: UInt32ArrayPointer ); +var + IndexIndex: longint; + IndexEntry: string; + IndexEntryWord: string; + tmpTopic: TTopic; + IndexEntryWordIndex: longint; + WordRelevance: longint; + IndexEntryWordRelevance: longint; + tmpIndexWords : TStrings; + i : integer; +begin + tmpIndexWords := TStringList.Create; + + for IndexIndex := 0 to HelpFile.Index.Count - 1 do + begin + IndexEntry := HelpFile.Index.GetLabels[IndexIndex]; + IndexEntryWordIndex := 0; + + tmpIndexWords.Clear; + StrExtractStringsQuoted(tmpIndexWords, IndexEntry); + + for i := 0 to tmpIndexWords.count-1 do + begin + IndexEntryWord := tmpIndexWords[i]; + + WordRelevance := CompareWord( SearchWord, IndexEntryWord ); + if WordRelevance > 0 then + begin + if IndexEntryWordIndex = 0 then + begin + // matching the first word is best + if i = tmpIndexWords.count-1 then + begin + // in fact it's the only word + IndexEntryWordRelevance := mwOnlyIndexWord * WordRelevance + end + else + IndexEntryWordRelevance := mwFirstIndexWord * WordRelevance + end + else + begin + IndexEntryWordRelevance := mwIndexWord * WordRelevance; + end; + tmpTopic := HelpFile.Index.getTopic(IndexIndex); + inc( Results^[ tmpTopic.Index ], IndexEntryWordRelevance ); + end; + inc( IndexEntryWordIndex ); + end; + end; + + tmpIndexWords.Free; +end; + +// ------------------------------------------------------ + +// Master search function. Given a search query, +// searches topic text, titles, index entries. +// Matching topics are added to TList, with their +// SearchRelevance set appropriately. +procedure SearchHelpFile( HelpFile: THelpFile; + Query: TTextSearchQuery; + Results: TList; + WordSequences: TList ); +var + TopicCount: longint; + Topic: TTopic; + TopicIndex: longint; + TermIndex: longint; + Term: TSearchTerm; + + DictionaryRelevances: UInt32ArrayPointer; + + TopicsMatchingDictWord: UInt32ArrayPointer; // flags + TopicsMatchingTermPart: UInt32ArrayPointer; // flags + TopicsMatchingTerm: UInt32ArrayPointer; // flag then relevances + TopicRelevances: UInt32ArrayPointer; + TopicsExcluded: UInt32ArrayPointer; + + TopicRelevanceForTerm: longint; + + WordRelevance: longint; + DictIndex: longint; + + TermPartIndex: longint; + TermPart: string; + + s: string; + + TermWordSequence: TList; +begin + if HelpFile.SearchTable = nil then + begin + exit; + end; + + // Reset flags per topic + TopicCount := HelpFile.TopicCount; + + // Get memory for topic relevance arrays + + AllocUInt32Array( TopicsMatchingDictWord, + TopicCount ); + AllocUInt32Array( TopicsMatchingTermPart, + TopicCount ); + AllocUInt32Array( TopicsMatchingTerm, + TopicCount ); + AllocUInt32Array( TopicRelevances, // functions as a flag and a cumulative relevance + TopicCount ); + AllocUInt32Array( TopicsExcluded, // Exclusions are treated as boolean only + TopicCount ); + + FillUInt32Array( TopicRelevances, TopicCount, 0); + FillUInt32Array( TopicsExcluded, TopicCount, 0); + + for TermIndex := 0 to Query.TermCount - 1 do + begin + Term := Query.Term[ TermIndex ]; + + LogEvent(LogSearch, 'Searching for term "' + + Term.Text + + '", ' + + IntToStr( Term.Parts.Count ) + + ' parts' ); + + // look thru all parts of the term. eg. CAKE_SAUSAGE + + TermWordSequence := TList.Create; + + if WordSequences <> nil then + if Term.CombineMethod <> cmExcluded then + // this term is an inclusive one, so we want to remember the matches + WordSequences.Add( TermWordSequence ); + + for TermPartIndex := 0 to Term.Parts.Count - 1 do + begin + TermPart := Term.Parts[ TermPartIndex ]; + + LogEvent(LogSearch, ' Searching for [' + TermPart + ']' ); + + AllocUInt32Array( DictionaryRelevances, + HelpFile.DictionaryCount ); + + TermWordSequence.Add( DictionaryRelevances ); + + // Search the dictionary for matches. + // alpha numeric match + + if Term.Parts.Count = 1 then + // general match allowing all kinds of partial matches + SearchDictionary( HelpFile, + TermPart, + DictionaryRelevances ) + + else if TermPartIndex = 0 then + // first term part: word must match end of a topic word e.g. must end in "cake" + SearchDictionaryEnds( HelpFile, + TermPart, + DictionaryRelevances ) + + else if TermPartIndex = Term.Parts.Count - 1 then + // last term part: word must match start of a topic word e.g. must start with "sausage" + SearchDictionaryStarts( HelpFile, + TermPart, + DictionaryRelevances ) + + else + // intermediate term part: word must match exactly e.g. must be "_" + SearchDictionaryExact( HelpFile, + TermPart, + DictionaryRelevances ); + + // For each word in the dictionary that matches + // this search term part, search topic texts + + LogEvent(LogSearch, ' Dictionary search done' ); + ClearUInt32Array( TopicsMatchingTermPart, + TopicCount ); + + for DictIndex := 0 to HelpFile.DictionaryCount - 1 do + begin + WordRelevance := DictionaryRelevances^[ DictIndex ]; + if WordRelevance > 0 then + begin + // Search for occurrences of this word + // within the text of topics + HelpFile.SearchTable.Search( DictIndex, + TopicsMatchingDictWord ); + + // debug + s := HelpFile.DictionaryWords[ DictIndex ]; + // TopicRelevancesForDictWord now contains 1 + // for topics that contain this word. + + OrUInt32Array( TopicsMatchingDictWord, + TopicsMatchingTermPart, + TopicCount ); + end + end; + + LogEvent(LogSearch, 'Topic searches done' ); + + if TermPartIndex = 0 then + // first part, just copy + CopyUInt32Array( TopicsMatchingTermPart, + TopicsMatchingTerm, + TopicCount ) + else + // and with previous term part results + AndUInt32Array( TopicsMatchingTermPart, + TopicsMatchingTerm, + TopicCount ); + + // loop for next term part (IPF word) + end; + + // Now we have searched the dictionary and worked out matching topics + // for all parts of the term. Now combine all together + + LogEvent(LogSearch, 'Checking for sequences' ); + for TopicIndex := 0 to TopicCount - 1 do + begin + if TopicsMatchingTerm^[ TopicIndex ] > 0 then + begin + Topic := HelpFile.Topics[ TopicIndex ]; + // Topic text contained a match for the all the parts + // of the term. + // Now we need to: + // - verify that they actually occur all in a sequence (if it's a multi-part term) + // - count occurrences for relevance. + + TopicRelevanceForTerm := + Topic.SearchForWordSequences( TermWordSequence, + false ); // don't stop at first match + + TopicRelevanceForTerm := + TopicRelevanceForTerm div Term.Parts.Count; // divide to bring back into scale + + TopicsMatchingTerm^[ TopicIndex ] := TopicRelevanceForTerm; + + end; + end; + + if WordSequences = nil then + begin + // we don't need to keep the sequence + ClearWordSequence( TermWordSequence, HelpFile.DictionaryCount ); + TermWordSequence.Free; + end; + + // Search titles and index + + LogEvent(LogSearch, ' Searching titles' ); + SearchTopicTitles( HelpFile, Term.Text, TopicsMatchingTerm ); + + LogEvent(LogSearch, ' Searching index' ); + SearchIndex( HelpFile, Term.Text, TopicsMatchingTerm ); + + LogEvent(LogSearch, ' Combining' ); + case Term.CombineMethod of + cmOptional: + AddUInt32Array( TopicsMatchingTerm, + TopicRelevances, + TopicCount ); + + cmRequired: + begin + // if zero then add to exclusions + NotOrUInt32Array( TopicsMatchingTerm, + TopicsExcluded, + TopicCount ); + + AddUInt32Array( TopicsMatchingTerm, + TopicRelevances, + TopicCount ); + end; + + cmExcluded: + OrUInt32Array( TopicsMatchingTerm, + TopicsExcluded, + TopicCount ); + end; + +// Term.ClearMatches; + + // loop for next term... + end; + + LogEvent(LogSearch, 'Search completed, converting to list' ); + + // Now convert to list form. + + for TopicIndex := 0 to TopicCount - 1 do + begin + if TopicsExcluded^[ TopicIndex ] = 0 then + begin + Topic := HelpFile.Topics[ TopicIndex ]; + Topic.SearchRelevance := TopicRelevances^[ TopicIndex ]; + if Topic.SearchRelevance > 0 then + begin + Results.Add( Topic ); + end; + end; + end; + + LogEvent(LogSearch, 'Freeing arrays' ); + FreeUInt32Array( TopicRelevances, TopicCount ); + FreeUInt32Array( TopicsExcluded, TopicCount ); + FreeUInt32Array( TopicsMatchingTerm, TopicCount ); + FreeUInt32Array( TopicsMatchingTermPart, TopicCount ); + FreeUInt32Array( TopicsMatchingDictWord, TopicCount ); + + LogEvent(LogSearch, 'Done' ); +end; + +End. diff --git a/docview/src/SettingsUnit.pas b/docview/src/SettingsUnit.pas new file mode 100644 index 00000000..82a3aaf7 --- /dev/null +++ b/docview/src/SettingsUnit.pas @@ -0,0 +1,528 @@ +Unit SettingsUnit; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +// Defines settings (options) in a record and contains functions +// for loading and saving them to ini file. + +Uses + Classes + ,contnrs + ,fpg_base + ,fpg_main + ,CanvasFontManager + ; + +Const + ContentsBackgroundColorIndex = 0; + ContentsTextColorIndex = 1; + ContentsLinesColorIndex = 2; + IndexBackgroundColorIndex = 3; + IndexTextColorIndex = 4; + SearchBackgroundColorIndex = 5; + SearchTextColorIndex = 6; + NotesListBackgroundColorIndex = 7; + NotesListTextColorIndex = 8; + TopicBackgroundColorIndex = 9; + NotesTextColorIndex = 10; + SearchHighlightTextColorIndex = 11; + NumColorSettings = 12; + + // already defined, but these values are slightly different + //clLightYellow = $ffffc0; + //clLightBlue = $e0e0ff; + //clLightCyan = $c0ffff; + //clLightGreen = $e0ffe0; + + VGADefaultColors: array[ 0 .. NumColorSettings - 1 ] of TfpgColor + = ( clBoxColor, + clText1, + clText1, + clBoxColor, + clText1, + clBoxColor, + clText1, + clBoxColor, + clText1, + clBoxColor, + clGreen, + clYellow ); + + DefaultColors: array[ 0 .. NumColorSettings - 1 ] of TfpgColor + = ( clLightCyan, + clBlack, + clBlue, + clLightGreen, + clBlack, + clLightBlue, + clBlack, + clWhite, + clBlack, + clWhite, + clGreen, + clYellow ); + + ApplicationFontIndex = 0; + NumFontSettings = 1; + + DefaultTopicFont = DefaultTopicFont + '-' + DefaultTopicFontSize; + DefaultTopicFixedFont = DefaultTopicFixedFont + '-10' + DefaultTopicFixedFontSize; + + +Type + TIndexStyle = ( isAlphabetical, isFileOnly, isFull ); + TToolbarStyle = ( tsNone, tsImages, tsText, tsImagesAndText ); + TGlobalSearchLocation = ( gsHelpPaths, gsFixedDrives, gsSelectedHelpPaths, gsCustom ); + + TMRUItem = class(TObject) + public + Title: string; + Filenames: TStringList; + constructor Create; + destructor Destroy; override; + end; + + + TSettings = record + MRUList: TObjectList; + LastOpenDirectory: string; + LastSaveDirectory: string; + StartupHelp: boolean; + LeftPanelWidth: longint; + ShowLeftPanel_Help: boolean; + ShowLeftPanel_Standalone: boolean; + FileDialogSplit: Double; + Colors: array[ 0..NumColorSettings - 1 ] of TfpgColor; + NormalFont: TfpgFont; + FixedFont: TfpgFont; + Fonts: array[ 0..NumFontSettings - 1 ] of TfpgFont; + FixedFontSubstitution: boolean; + FixedFontSubstitutes: string; + IndexStyle: TIndexStyle; + SmoothScrolling: boolean; + UseOriginalDialogs: boolean; + OpenWithExpandedContents: boolean; + ToolbarBackgroundImageFilename: string; + ToolbarStyle: TToolbarStyle; + ConfirmWinHelp: boolean; + GlobalSearchLocation: TGlobalSearchLocation; + SearchDirectories: TStringList; + IPFTopicSaveAsEscaped: boolean; + end; + +// global procs +procedure LoadSettings; +procedure SaveSettings; +procedure writeSettingsDetailsTo(aStrings : TStrings); +procedure AddToMRUList( const Title: string; Filenames: TStrings ); + +var + Settings: TSettings; + +Implementation + +Uses + SysUtils + ,fpg_iniutils + ,ACLStringUtility + ,nvUtilities + ; + +const + GeneralSection = 'General'; + FontsSection = 'Fonts'; + ColoursSection = 'Colours'; + MRUSection = 'RecentFiles'; + MRUItemBaseSection = 'RecentFile'; + SearchSection = 'Search'; + + DefaultWidth = 620; + DefaultHeight = 460; + + MaxMRUListEntries = 9; + +constructor TMRUItem.Create; +begin + Title := ''; + Filenames := TStringList.Create; +end; + +destructor TMRUItem.Destroy; +begin + Filenames.Free; + inherited Destroy; +end; + +Procedure LoadSettings; +var + ColorIndex: longint; + DefaultColor: TfpgColor; + FontName: string; + SettingString: string; + MRUItem: TMRUItem; + MRUItemSection: string; + MRUItemFileCount: longint; + MRUItemFileIndex: longint; + i: longint; + Count: longint; + MRUFilename: string; +// MRUFileTitle: string; +begin + LogEvent(LogSettings, 'LoadSettings' ); + with gINI do + begin + EraseSection( 'Windows' ); + with Settings do + begin + LastOpenDirectory := ReadString( GeneralSection, 'LastOpenDirectory', '' ); + LastSaveDirectory := ReadString( GeneralSection, 'LastSaveDirectory', '' ); + + // Read split points, as units of 0.1% + LeftPanelWidth := ReadInteger( GeneralSection, 'LeftPanelWidth', 225 ); + FileDialogSplit := ReadInteger( GeneralSection, 'FileDialogSplit', 500 ) / 1000; + + ShowLeftPanel_Help := ReadBool( GeneralSection, 'ShowLeftPanel_Help', true ); + ShowLeftPanel_Standalone := ReadBool( GeneralSection, 'ShowLeftPanel_Standalone', true ); + + // Colours + for ColorIndex := 0 to High( Colors ) do + begin + //if GetScreenColorDepth > 8 then + DefaultColor := DefaultColors[ ColorIndex ]; + //else + // DefaultColor := VGADefaultColors[ ColorIndex ]; + Colors[ ColorIndex ] := ReadInteger( ColoursSection, + 'Color' + IntToStr( ColorIndex ), + DefaultColor ); + end; + + // Most Recently Used files list... + Count := ReadInteger( MRUSection, 'Count', 0 ); + for i := 0 to Count - 1 do + begin + MRUItemSection := MRUItemBaseSection + IntToStr( i ); + MRUItem := TMRUItem.Create; + MRUItem.Title := ReadString( MRUItemSection, 'Title', '' ); + MRUItemFileCount := ReadInteger( MRUItemSection, 'FileCount', 0 ); + for MRUItemFileIndex := 0 to MRUItemFileCount - 1 do + begin + MRUFilename := ReadString( MRUItemSection, + 'File' + IntToStr( MRUItemFileIndex ), + '' ); + if MRUFilename <> '' then + MRUItem.Filenames.Add( MRUFilename ); + end; + if ( MRUItem.Title <> '' ) and ( MRUItem.Filenames.Count > 0 ) then + // valid MRU item + MRUList.Add( MRUItem ) + else + begin + // not valid + MRUItem.Free; + MRUItem := nil; + end; + end; + + // Fonts + NormalFont := fpgGetFont(ReadString(FontsSection, 'NormalFont', DefaultTopicFont)); + if NormalFont = nil then + NormalFont := fpgStyle.DefaultFont; + + FixedFont := fpgGetFont(ReadString(FontsSection, 'FixedFont', DefaultTopicFixedFont)); + if FixedFont = nil then + FixedFont := fpgStyle.FixedFont; + + for i := 0 to NumFontSettings - 1 do + begin + FontName := 'Font' + IntToStr( i ); + Fonts[ i ] := nil; + if ReadBool( FontsSection, FontName + 'Customised', false ) then + Fonts[ i ] := fpgGetFont(ReadString(FontsSection, FontName + 'Desc', DefaultTopicFont)); + end; + + FixedFontSubstitution := ReadBool( FontsSection, 'FixedFontSubstitution', true ); + FixedFontSubstitutes := ReadString( FontsSection, 'FixedFontSubstitutes', 'Mono-10' ); + + // Index style + SettingString := ReadString( GeneralSection, 'IndexStyle', 'Full' ); + if SameText( SettingString, 'FileOnly' ) then + IndexStyle := isFileOnly + else if Sametext( SettingString, 'Alphabetical' ) then + IndexStyle := isAlphabetical + else + IndexStyle := isFull; + + StartupHelp := ReadBool( GeneralSection, 'StartupHelp', true ); + + SmoothScrolling := ReadBool( GeneralSection, 'SmoothScrolling', true ); +// UseOriginalDialogs := ReadBool( GeneralSection, 'UseOriginalDialogs', false ); + OpenWithExpandedContents := ReadBool( GeneralSection, 'OpenWithExpandedContents', false ); + +// ToolBarBackgroundImageFilename := ReadString( GeneralSection, 'ToolbarBackground', '' ); + SettingString := ReadString( GeneralSection, 'ToolbarStyle', 'ImagesAndText' ); + + if SameText( SettingString, 'None' ) then + ToolbarStyle := tsNone + else if SameText( SettingString, 'Images' ) then + ToolbarStyle := tsImages + else if SameText( SettingString, 'Text' ) then + ToolbarStyle := tsText + else + ToolbarStyle := tsImagesAndText; + + ConfirmWinHelp := ReadBool( GeneralSection, 'ConfirmWinHelp', true ); + IPFTopicSaveAsEscaped := ReadBool(GeneralSection, 'IPFTopicSaveAsEscaped', true); + + Count := ReadInteger( SearchSection, 'CustomDirCount', 0 ); + + SearchDirectories.Clear; + for i := 0 to Count - 1 do + begin + SettingString := ReadString( SearchSection, + 'CustomDir' + IntToStr( i ), + '' ); + if trim( SettingString ) <> '' then + SearchDirectories.Add( SettingString ); + end; + SettingString := ReadString( SearchSection, + 'Location', + 'HelpPaths' ); + if SameText( SettingString, 'HelpPaths' ) then + GlobalSearchLocation := gsHelpPaths + else if SameText( SettingString, 'FixedDrives' ) then + GlobalSearchLocation := gsFixedDrives + else if SameText( SettingString, 'SelectedHelpPaths' ) then + GlobalSearchLocation := gsSelectedHelpPaths + else + GlobalSearchLocation := gsCustom; + + end; + end; + LogEvent(LogSettings, ' Done' ); +end; + +procedure SaveSettings; +var + ColorIndex: longint; + FontIndex: longint; + FontName: string; + i: longint; + MRUItemFileIndex: longint; + SettingString: string; + MRUItem: TMRUItem; + MRUItemSection: string; +begin + LogEvent(LogSettings, 'SaveSettings' ); + with gINI do + begin + with Settings do + begin + WriteString( GeneralSection, 'LastOpenDirectory', LastOpenDirectory ); + WriteString( GeneralSection, 'LastSaveDirectory', LastSaveDirectory ); + + WriteInteger( GeneralSection, 'LeftPanelWidth', LeftPanelWidth ); + // Write split points, as units of 0.1% + WriteInteger( GeneralSection, 'FileDialogSplit', Round( FileDialogSplit * 1000 ) ); + + WriteBool( GeneralSection, 'ShowLeftPanel_Help', ShowLeftPanel_Help ); + WriteBool( GeneralSection, 'ShowLeftPanel_Standalone', ShowLeftPanel_Standalone ); + + // Colours + for ColorIndex := 0 to High( Colors ) do + WriteInteger( ColoursSection, + 'Color' + IntToStr( ColorIndex ), + Colors[ ColorIndex ] ); + + // MRU files + WriteInteger( MRUSection, 'Count', MRUList.Count ); + for i := 0 to MRUList.Count - 1 do + begin + MRUItem := TMRUItem(MRUList[ i ]); + MRUItemSection := MRUItemBaseSection + IntToStr( i ); + EraseSection( MRUItemSection ); + WriteString( MRUItemSection, 'Title', MRUItem.Title ); + WriteInteger( MRUItemSection, 'FileCount', MRUItem.Filenames.Count ); + for MRUItemFileIndex := 0 to MRUItem.Filenames.Count - 1 do + WriteString( MRUItemSection, + 'File' + IntToStr( MRUItemFileIndex ), + MRUItem.Filenames[ MRUItemFileIndex ] ); + end; + + // clear unused sections + for i := MRUList.Count to MaxMRUListEntries do + begin + MRUItemSection := MRUItemBaseSection + IntToStr( i ); + EraseSection( MRUItemSection ); + end; + + // Fonts + WriteString( FontsSection, 'NormalFont', NormalFont.FontDesc ); + WriteString( FontsSection, 'FixedFont', FixedFont.FontDesc ); + for FontIndex := 0 to NumFontSettings - 1 do + begin + FontName := 'Font' + IntToStr( FontIndex ); + WriteBool( FontsSection, FontName + 'Customised', Fonts[ FontIndex ] <> nil ); + if Fonts[ FontIndex ] <> nil then + WriteString( FontsSection, FontName + 'Desc', Fonts[ FontIndex ].FontDesc ); + end; + + WriteBool( FontsSection, 'FixedFontSubstitution', FixedFontSubstitution ); + WriteString( FontsSection, 'FixedFontSubstitutes', FixedFontSubstitutes ); + + case IndexStyle of + isFileOnly: + SettingString := 'FileOnly'; + isAlphabetical: + SettingString := 'Alphabetical'; + isFull: + SettingString := 'Full'; + end; + WriteString( GeneralSection, 'IndexStyle', SettingString ); + + WriteBool( GeneralSection, 'StartupHelp', StartupHelp ); + WriteBool( GeneralSection, 'SmoothScrolling', SmoothScrolling ); +// WriteBool( GeneralSection, 'UseOriginalDialogs', UseOriginalDialogs ); + WriteBool( GeneralSection, 'OpenWithExpandedContents', OpenWithExpandedContents ); +// WriteString( GeneralSection, 'ToolbarBackground', ToolbarBackgroundImageFilename ); + + case ToolbarStyle of + tsNone: + SettingString := 'None'; + tsImages: + SettingString := 'Images'; + tsText: + SettingString := 'Text'; + tsImagesAndText: + SettingString := 'ImagesAndText'; + end; + + WriteString( GeneralSection, 'ToolbarStyle', SettingString ); + WriteBool( GeneralSection, 'ConfirmWinHelp', ConfirmWinHelp ); + WriteBool( GeneralSection, 'IPFTopicSaveAsEscaped', IPFTopicSaveAsEscaped); + WriteInteger( SearchSection, 'CustomDirCount', SearchDirectories.Count ); + + SearchDirectories.Sorted := true; + SearchDirectories.CaseSensitive := True; + SearchDirectories.Duplicates := dupIgnore; + + for i := 0 to SearchDirectories.Count - 1 do + begin + WriteString( SearchSection, + 'CustomDir' + IntToStr( i ), + SearchDirectories[ i ] ); + end; + + case GlobalSearchLocation of + gsHelpPaths: + SettingString := 'HelpPaths'; + + gsFixedDrives: + SettingString := 'FixedDrives'; + + gsSelectedHelpPaths: + SettingString := 'SelectedHelpPaths'; + + gsCustom: + SettingString := 'Custom'; + end; + + WriteString( SearchSection, 'Location', SettingString ); + end; + end; + LogEvent(LogSettings, ' Done' ); +End; + +Procedure AddToMRUList( const Title: string; Filenames: TStrings ); +var + MRUIndex: longint; + PreviousMRUIndex: longint; + MRUItem: TMRUItem; +begin + PreviousMRUIndex := -1; + for MRUIndex := 0 to Settings.MRUList.Count - 1 do + begin + MRUItem := TMRUItem(Settings.MRUList[ MRUIndex ]); + if ( MRUItem.Title = Title ) + and ( MRUItem.Filenames.Equals( Filenames ) ) then + begin + // found identical entry in the list already. + PreviousMRUIndex := MRUIndex; + break; + end; + end; + + if PreviousMRUIndex > -1 then + begin + // is already in list. Get instance so we can move it to the top of list + MRUItem := TMRUItem(Settings.MRUList[PreviousMRUIndex]); + Settings.MRUList.Extract(MRUItem); + end + else + begin + // not yet in list. Create new + MRUItem := TMRUItem.Create; + MRUItem.Title := Title; + MRUItem.Filenames.Assign( Filenames ); + end; + + Settings.MRUList.Insert( 0, MRUItem ); + while Settings.MRUList.Count > MaxMRUListEntries do + begin + Settings.MRUList.Remove(Settings.MRUList.Last); + end; +end; + +procedure writeSettingsDetailsTo(aStrings : TStrings); +Begin + aStrings.Add(''); + aStrings.Add('---- Settings ----'); + aStrings.Add('info: Screenwidth=' + IntToStr(fpgApplication.ScreenWidth)); + aStrings.Add('info: Screenheight=' + IntToStr(fpgApplication.ScreenHeight)); + aStrings.Add('info: dpi=' + IntToStr(fpgApplication.Screen_dpi)); + + aStrings.Add('LastOpenDirectory: ' + Settings.LastOpenDirectory); + aStrings.Add('LastSaveDirectory: ' + Settings.LastSaveDirectory); + aStrings.Add('StartupHelp: ' + boolToStr(Settings.StartupHelp)); + // LeftPanelWidth: longint; + aStrings.Add('ShowLeftPanel_Help: ' + boolToStr(Settings.ShowLeftPanel_Help)); + aStrings.Add('ShowLeftPanel_Standalone: ' + boolToStr(Settings.ShowLeftPanel_Standalone)); + // FileDialogSplit: real; + // Colors: array[ 0..NumColorSettings - 1 ] of TColor; + // NormalFont: TFont; + // FixedFont: TFont; + // Fonts: array[ 0..NumFontSettings - 1 ] of TFont; + aStrings.Add('FixedFontSubstitution: ' + boolToStr(Settings.FixedFontSubstitution)); + aStrings.Add('FixedFontSubstitutes: ' + Settings.FixedFontSubstitutes); + // IndexStyle: TIndexStyle; + aStrings.Add('SmoothScrolling: ' + boolToStr(Settings.SmoothScrolling)); +// aStrings.Add('UseOriginalDialogs: ' + boolToStr(Settings.UseOriginalDialogs)); + aStrings.Add('OpenWithExpandedContents: ' + boolToStr(Settings.OpenWithExpandedContents)); +// aStrings.Add('ToolbarBackgroundImageFilename: ' + Settings.ToolbarBackgroundImageFilename); + // ToolbarStyle: TToolbarStyle; + aStrings.Add('ConfirmWinHelp: ' + boolToStr(Settings.ConfirmWinHelp)); + aStrings.Add('IPFTopicSaveAsEscaped: ' + BoolToStr(Settings.IPFTopicSaveAsEscaped)); + // GlobalSearchLocation: TGlobalSearchLocation; + // SearchDirectories: TStringList; +end; + + +Initialization + Settings.MRUList := TObjectList.Create; + + //Settings.NormalFont := fpgStyle.DefaultFont; + //Settings.FixedFont := fpgStyle.FixedFont; + //Settings.SearchDirectories := TStringList.Create; + +Finalization + Settings.NormalFont.Free; + Settings.FixedFont.Free; + Settings.SearchDirectories.Free; + Settings.MRUList.Free; + +End. diff --git a/docview/src/TextSearchQuery.pas b/docview/src/TextSearchQuery.pas new file mode 100644 index 00000000..3a8037a2 --- /dev/null +++ b/docview/src/TextSearchQuery.pas @@ -0,0 +1,208 @@ +Unit TextSearchQuery; + +{$mode objfpc}{$H+} + +// NewView - a new OS/2 Help Viewer +// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) +// This software is released under the Gnu Public License - see readme.txt + +Interface + +// Encapsulates a parsed search query. + +uses + Classes, SysUtils; + +Type + ESearchSyntaxError = class( Exception ) + end; + + TSearchTermCombineMethod = + ( + cmOptional, + cmRequired, + cmExcluded + ); + + TSearchTerm = class(TObject) + public + Text: string; + Parts: TStringList; + CombineMethod: TSearchTermCombineMethod; + constructor Create( const TheText: string; + const TheCombineMethod: TSearchTermCombineMethod ); + destructor Destroy; override; + end; + + + TTextSearchQuery = class(TObject) + protected + Terms: TList; + function GetTerm( Index: longint ): TSearchTerm; + function GetTermCount: longint; + public + constructor Create( const SearchString: string ); + destructor Destroy; override; + property Term[ Index: longint ]: TSearchTerm read GetTerm; + property TermCount: longint read GetTermCount; + end; + + +implementation + +uses + nvUtilities + ,ACLStringUtility + ; + + +const + QueryErrorMissingWord1 = 'No search word given after'; + QueryErrorMissingWord2 = ' before '; + + +constructor TTextSearchQuery.Create( const SearchString: string ); +var + TermText: string; + CombineMethod: TSearchTermCombineMethod; + lTerm: TSearchTerm; + tmpTerms : TStrings; + i : integer; +begin + inherited Create; + Terms := TList.Create; + try + tmpTerms := TStringList.Create; + StrExtractStringsQuoted(tmpTerms, SearchString); + + for i := 0 to tmpTerms.count-1 do + begin + TermText := tmpTerms[i]; + + // Check for modifiers: + // + word must be matched + // - word must not be matched + case TermText[ 1 ] of + '+': + CombineMethod := cmRequired; + '-': + CombineMethod := cmExcluded; + else + CombineMethod := cmOptional; + end; + + if CombineMethod <> cmOptional then + begin + // delete + or - + if Length( TermText ) = 1 then + if (i < tmpTerms.count-1) then + raise ESearchSyntaxError.Create( QueryErrorMissingWord1 + + StrInDoubleQuotes(TermText) + + QueryErrorMissingWord2 + + StrInDoubleQuotes(tmpTerms[i+1]) ) + else + raise ESearchSyntaxError.Create( QueryErrorMissingWord1 + + StrInDoubleQuotes(TermText)); + Delete( TermText, 1, 1 ); + end; + + lTerm := TSearchTerm.Create( TermText, + CombineMethod ); + Terms.Add( lTerm ); + end; + tmpTerms.Free; + except + while Terms.Count > 0 do + begin + lTerm := TSearchTerm(Terms.Last); + Terms.Remove(lTerm); + lTerm.Free; + end; + Terms.Free; + raise; // reraise exception + end; +end; + +destructor TTextSearchQuery.Destroy; +begin + DestroyListObjects( Terms ); + Terms.Free; + inherited Destroy; +end; + +function TTextSearchQuery.GetTerm( index: longint ): TSearchTerm; +begin + Result := TSearchTerm(Terms[ Index ]); +end; + +function TTextSearchQuery.GetTermCount: longint; +begin + Result := Terms.Count; +end; + +constructor TSearchTerm.Create( const TheText: string; + const TheCombineMethod: TSearchTermCombineMethod ); +var + TermParseIndex: longint; + TermChar: char; + TermPart: string; +begin + Parts := TStringList.Create; + + Text := TheText; + CombineMethod := TheCombineMethod; + + // Break out each part of the term as IPF does: + // consecutive alphanumeric chars become a "word" + // but each symbol is a separate word, and symbols break + // up alphanumerics into multiple words. e.g. + // CAKE_SAUSAGE becomes three words in IPF, + // one each for "CAKE" "_" and "SAUSAGE" + + TermParseIndex := 1; + while TermParseIndex <= Length( Text ) do + begin + // collect alphanumeric chars + TermPart := ''; + while TermParseIndex <= Length( Text ) do + begin + TermChar := Text[ TermParseIndex ]; + if ( IsAlpha( TermChar ) + or IsDigit( TermChar ) ) then + begin + // alpha numeric, collect it + TermPart := TermPart + TermChar; + inc( TermParseIndex ); + end + else + begin + // not alpha numeric, so stop + break; + end; + end; + if Length( TermPart ) > 0 then + begin + Parts.Add( TermPart ); // add collected alphanumeric part + end; + + if TermParseIndex <= Length( Text ) then + begin + // must be a symbol, + // each symbol (excluding space) is an individual item + if Text[ TermParseIndex ] <> ' ' then + Parts.Add( Text[ TermParseIndex ] ); + inc( TermParseIndex ); + end; + + end; + +end; + +destructor TSearchTerm.Destroy; +begin + Parts.Free; + inherited Destroy; +end; + + +end. diff --git a/docview/src/arrows.inc b/docview/src/arrows.inc new file mode 100644 index 00000000..bfe510a5 --- /dev/null +++ b/docview/src/arrows.inc @@ -0,0 +1,380 @@ + +Const + usr_arrow_up : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,227,197,133,218,175,131,219,174,131, + 222,176,132,223,177,132,224,177,132,223,177,131,221,175, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,228,198, 30,189,108, 16,190,102, 18, + 196,106, 19,201,109, 20,203,110, 19,199,108,132,223,177, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,228,198, 41,193,116, 16,191,102, 18, + 198,107, 20,204,111, 21,208,113, 19,202,109,132,224,177, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,227,196, 56,195,124, 16,189,101, 17, + 195,105, 18,199,107, 19,200,108, 18,198,107,132,223,176, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,225,194, 74,199,135, 20,186,102, 16, + 189,101, 16,191,103, 17,192,103, 16,191,102,131,220,175, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, + 58, 4,115, 58, 5,120, 61,162,222,192, 69,193,130, 42,187,114, 14, + 182, 96, 14,184, 97, 14,184, 98, 14,183, 97,130,217,172, 5,121, 62, + 4,115, 58, 4,115, 58, 4,115, 58, 4,118, 58,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 40,138, 88,160,215, + 187,165,219,191,163,219,190,160,220,189, 65,187,125, 58,188,121, 25, + 179,101, 12,176, 92, 12,176, 92, 12,175, 92,129,213,170,128,211,169, + 128,209,168,121,203,160, 31,133, 79, 3,114, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,148, + 100,152,213,181, 81,184,132, 65,181,121, 59,181,119, 52,180,115, 44, + 179,110, 17,170, 92, 10,168, 87, 9,167, 87, 9,166, 86, 23,168, 94, + 114,200,156, 41,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, + 60, 73,161,116,141,209,173, 64,177,119, 52,173,111, 45,172,107, 39, + 171,104, 28,168, 97, 9,161, 83, 7,160, 81, 14,161, 86,106,195,149, + 57,154,104, 3,117, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, + 85, 4,118, 58, 89,172,130,125,202,162, 49,172,108, 40,168,102, 33, + 165, 97, 26,162, 92, 15,158, 84, 8,155, 79, 95,190,141, 72,167,118, + 4,118, 59, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0,118, 59, 3,118, 60,101,182,140,105,194,148, 35,166, 99, 28, + 163, 94, 22,160, 89, 14,157, 84, 80,184,131, 85,178,130, 3,117, 59, + 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,114, 62, 9,118, 62,112,191,150, 82,185,133, 24, + 161, 90, 17,158, 86, 67,179,121,100,187,142, 8,120, 61, 7,118, 59, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 5,113, 59, 16,124, 69,118,195,156, 58, + 175,114, 53,173,111,109,193,150, 15,123, 68, 4,116, 56,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 24,129, 75,117, + 197,156,114,197,154, 23,131, 75, 5,117, 60,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,118, 59, 34, + 139, 85, 34,141, 85, 3,117, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 118, 60, 4,118, 60, 0, 85, 85,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_down : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 109, 54, 5,112, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 57, 35, + 142, 87, 36,149, 90, 3,113, 57,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,117, 58, 22,130, 76,119, + 216,167,120,221,170, 24,137, 79, 5,117, 60,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 5,113, 59, 15,123, 68,114,209,161, 57, + 206,131, 59,211,134,117,221,169, 15,126, 69, 4,116, 56,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,114, 62, 9,119, 63,102,198,149, 72,204,137, 17, + 195,105, 19,200,108, 74,214,143,105,208,157, 9,122, 63, 7,118, 59, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0,118, 59, 5,119, 60, 94,186,138, 85,201,142, 14,185, 98, 16, + 189,101, 17,193,103, 17,194,104, 87,211,148, 89,193,139, 4,118, 60, + 0,113, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 85, + 85, 4,118, 58, 89,175,131,129,211,169, 19,177, 96, 13,179, 94, 14, + 183, 97, 14,185, 98, 15,186, 99, 15,185, 99,100,208,153, 74,175,123, + 4,119, 60, 0,102, 51,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,118, + 60, 73,160,116,144,212,177, 71,186,128, 52,183,116, 15,173, 93, 12, + 175, 92, 12,177, 93, 12,178, 94, 12,177, 93, 18,177, 96,108,204,156, + 57,157,105, 3,118, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 55,149, + 100,154,213,182, 86,186,134, 70,182,125, 63,182,121, 51,180,114, 24, + 173, 96, 10,169, 88, 10,170, 88, 10,169, 88, 10,168, 87, 23,170, 95, + 114,201,156, 40,142, 91, 4,117, 57,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,114, 57, 41,138, 88,163,216, + 189,168,219,193,164,218,190,160,216,187, 65,178,121, 58,178,116, 49, + 176,111, 34,170,101, 9,162, 84, 8,161, 83,126,205,165,126,204,164, + 126,203,163,119,198,158, 29,131, 79, 3,114, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 4,117, 59, 4,115, 58, 4,115, + 58, 4,115, 58, 5,119, 60,162,217,189, 69,179,123, 60,176,116, 50, + 172,109, 42,168,103, 26,162, 92, 6,154, 78,126,202,163, 5,119, 60, + 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,164,218,190, 71,180,124, 62,176,118, 52, + 173,111, 44,169,105, 35,165, 98, 17,158, 86,126,202,163, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,218,191, 73,181,125, 64,177,119, 54, + 173,112, 45,169,105, 36,166, 99, 24,161, 91,126,202,163, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, + 173,112, 46,170,106, 37,166,100, 26,162, 92,127,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,166,218,191, 74,181,126, 64,177,119, 54, + 173,112, 46,170,106, 36,166, 99, 26,162, 92,127,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,165,218,191,160,216,187,156,214,184,150, + 212,180,146,210,177,141,208,174,136,206,170,128,203,164, 4,115, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,117, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4, + 115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,117, 58, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_left : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 0,102, 51, 3,110, 55,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3, + 89, 45, 27,129, 76, 6,116, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 2,101, 51, 37, + 139, 87,121,206,163, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 54,152,102,117, + 208,161,129,216,172, 8,118, 60,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,102, 51, 3,114, 58, 69,166,117,111,206,157, 28, + 185,105,128,219,173, 9,125, 65, 4,115, 58, 4,115, 58, 4,115, 58, + 4,115, 58, 4,115, 58, 4,115, 59,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 3, 88, 44, 7,118, 60, 83,176,129, 99,198,148, 20,177, 97, 14, + 182, 96,128,221,174,132,225,178,134,230,181,133,229,180,132,225,178, + 131,221,175,130,217,173, 8,118, 60, 0,102, 51,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,109, + 55, 13,121, 66, 97,185,140, 83,187,134, 12,165, 87, 11,172, 90, 13, + 180, 95, 15,187,100, 17,193,104, 18,198,107, 18,197,106, 17,193,103, + 15,186, 99,127,215,170, 8,117, 60, 0,102, 51,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 0,128, 0, 4,116, 58, 21,130, + 73,108,192,149, 68,179,122, 6,154, 78, 7,160, 82, 9,167, 87, 11, + 174, 91, 13,180, 95, 14,184, 98, 15,187,100, 15,187, 99, 14,184, 98, + 13,179, 95,126,212,168, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,119, 59, 32,138, 84,113,196, + 154, 54,173,112, 13,157, 83, 16,158, 85, 15,158, 84, 15,164, 87, 11, + 167, 87, 10,171, 89, 11,174, 91, 12,176, 92, 12,176, 92, 11,174, 91, + 11,170, 90,132,211,170, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255, 3,117, 59, 32,136, 84,116,196, + 155, 62,177,117, 23,161, 90, 28,163, 94, 33,165, 97, 37,167,100, 43, + 171,105, 44,175,107, 40,176,106, 35,175,103, 35,175,103, 41,175,107, + 54,178,114,149,213,180, 8,117, 61, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,116, 58, 22,128, + 73,116,195,154, 85,186,135, 35,166, 99, 40,168,102, 45,170,106, 50, + 172,109, 54,173,112, 58,175,115, 61,176,117, 63,177,118, 65,178,120, + 65,178,120,154,214,184, 9,118, 62, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,114, + 57, 15,123, 68,108,188,148,107,195,150, 49,172,109, 52,173,111, 57, + 175,114, 62,177,118, 66,178,120, 68,179,122, 71,181,125, 73,181,126, + 74,182,127,159,216,187, 10,118, 63, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 5,117, 58, 8,119, 61, 99,182,139,127,203,164, 66,178,120, 65, + 178,120,157,215,185,161,217,188,163,218,190,164,218,191,166,219,192, + 166,219,192,166,219,192, 10,118, 63, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0,118, 59, 4,116, 60, 85,170,126,142,209,175, 82, + 185,132,160,217,188, 11,123, 65, 4,115, 58, 4,115, 58, 4,115, 58, + 4,115, 58, 4,115, 58, 4,117, 59, 0,128, 64,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0,116, 70, 4,117, 59, 69,158,113,152, + 212,181,165,218,191, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 0,128, 0, 3,116, 58, 52, + 146, 98,159,214,186, 11,119, 63, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 5, + 117, 60, 37,136, 84, 7,117, 60, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 4,115, 57, 4,116, 58, 0,128, 64,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); + +Const + usr_arrow_right : Array[0..1549] of byte = ( + 66, 77, 14, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 22, 0, 0, 0, 22, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 5, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 3,110, 55, 2, + 82, 42,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 30, + 131, 78, 3, 93, 47,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,122, + 207,164, 41,141, 90, 2,102, 51,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,130, + 216,172,118,214,166, 58,159,107, 4,112, 56,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 57, 4,115, + 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 61,131, + 219,174, 31,198,113,114,222,167, 74,180,127, 4,116, 59,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163,126,203,163,126,203,164,127,207,166,129,212,169,130,216,172,131, + 220,175, 17,195,105, 26,204,115,105,223,163, 90,195,142, 9,119, 62, + 2, 86, 44,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163, 6,154, 78, 6,154, 78, 8,161, 82, 10,168, 87, 12,176, 92, 14, + 183, 97, 16,189,101, 17,193,103, 19,194,105, 89,211,149,103,201,152, + 15,125, 68, 4,110, 56,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,126,203, + 163, 6,154, 78, 6,154, 78, 6,156, 79, 8,163, 84, 10,169, 88, 12, + 175, 92, 13,179, 94, 14,182, 96, 14,182, 96, 13,180, 95, 71,196,132, + 112,202,156, 22,131, 74, 3,119, 59, 0,128, 0,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,133,205, + 168, 7,154, 79, 6,154, 78, 6,154, 78, 6,156, 79, 8,161, 82, 9, + 165, 85, 12,170, 88, 18,174, 94, 21,175, 96, 22,173, 97, 19,170, 93, + 58,182,119,117,199,157, 34,139, 85, 4,118, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,151,213, + 181, 52,173,111, 40,168,102, 33,165, 97, 33,165, 97, 39,167,102, 45, + 171,107, 46,173,107, 43,173,106, 39,171,104, 34,169,100, 28,165, 95, + 65,178,120,120,198,159, 34,138, 86, 3,117, 59,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,156,215, + 185, 65,178,120, 65,178,120, 65,178,120, 63,177,118, 61,176,117, 58, + 175,115, 54,173,112, 50,172,109, 45,170,106, 40,168,102, 88,188,137, + 120,197,157, 24,129, 75, 4,115, 58,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,160,217, + 188, 74,182,127, 74,182,127, 73,181,126, 71,181,125, 68,179,122, 66, + 178,120, 62,177,118, 58,175,115, 54,174,112,111,197,152,113,191,151, + 16,124, 69, 3,116, 60,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,166,219, + 192,166,219,192,166,219,192,166,219,192,164,218,191,163,218,190,161, + 217,188, 69,180,123, 71,180,124,130,204,166,103,183,141, 9,118, 61, + 5,114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255, 4,117, 58, 4,115, + 58, 4,115, 58, 4,115, 58, 4,115, 58, 4,115, 58, 5,119, 60,165, + 218,191, 87,187,135,144,210,176, 91,173,131, 3,116, 59, 0,118, 55, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169, + 220,193,155,213,183, 74,161,116, 4,116, 59, 0,106, 64,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,164, + 217,190, 57,149,102, 3,118, 60, 0, 85, 85,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, 41, + 137, 88, 5,117, 59,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,117, 59, 3, + 114, 57,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 0, 0); diff --git a/docview/src/docdump/docdump.lpi b/docview/src/docdump/docdump.lpi new file mode 100644 index 00000000..440c482c --- /dev/null +++ b/docview/src/docdump/docdump.lpi @@ -0,0 +1,114 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <SessionStorage Value="InIDEConfig"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <Units Count="15"> + <Unit0> + <Filename Value="docdump.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="docdump"/> + </Unit0> + <Unit1> + <Filename Value="../IPFEscapeCodes.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="IPFEscapeCodes"/> + </Unit1> + <Unit2> + <Filename Value="../IPFFileFormatUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="IPFFileFormatUnit"/> + </Unit2> + <Unit3> + <Filename Value="readheader.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readheader"/> + </Unit3> + <Unit4> + <Filename Value="filestreamhelper.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="filestreamhelper"/> + </Unit4> + <Unit5> + <Filename Value="readextfiles.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readextfiles"/> + </Unit5> + <Unit6> + <Filename Value="../../docs/inf04.txt"/> + <IsPartOfProject Value="True"/> + </Unit6> + <Unit7> + <Filename Value="readstrings.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readstrings"/> + </Unit7> + <Unit8> + <Filename Value="iterator_impl.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="iterator_impl"/> + </Unit8> + <Unit9> + <Filename Value="iterator_intf.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="iterator_intf"/> + </Unit9> + <Unit10> + <Filename Value="readnlsdata.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readnlsdata"/> + </Unit10> + <Unit11> + <Filename Value="readfonts.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readfonts"/> + </Unit11> + <Unit12> + <Filename Value="readcontrols.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readcontrols"/> + </Unit12> + <Unit13> + <Filename Value="readtoc.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="readtoc"/> + </Unit13> + <Unit14> + <Filename Value="u_Tools.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="u_Tools"/> + </Unit14> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + <OtherUnitFiles Value="../"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/docview/src/docdump/docdump.lpr b/docview/src/docdump/docdump.lpr new file mode 100644 index 00000000..84077608 --- /dev/null +++ b/docview/src/docdump/docdump.lpr @@ -0,0 +1,98 @@ +{ + Dumps the structure of an OS/2 IPF help file +} +program docdump; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, IPFFileFormatUnit, IPFEscapeCodes, CustApp, readheader, + filestreamhelper, readextfiles, readstrings, iterator_intf, iterator_impl, + readnlsdata, readfonts, readcontrols, readtoc, u_Tools; + +type + + { TDocDump } + + TDocDump = class(TCustomApplication) + private + FIn: TFileStream; + FOut: TFileTextStream; + protected + procedure DoRun; override; + public + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + procedure WriteHelp; virtual; + end; + +{ TDocDump } + +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 + WriteHelp; + Terminate; + Exit; + end; + + FIn := TFileStream.Create(ParamStr(1), fmOpenRead); + FOut := TFileTextStream.Create(ExtractFileName(ParamStr(1))+'.txt', fmCreate); + try + FOut.WriteLn(Format('File name: %s (%d bytes)', [ExtractFileName(ParamStr(1)), FIn.Size])); + ProcessHeader(FIn, FOut); + ProcessExtFiles(FIn, FOut); + ProcessStringsTable(FIn, FOut); + ProcessNLSData(FIn, FOut); + ProcessFonts(FIn, FOut); + ProcessControls(FIn, FOut); + ProcessTOC(FIn, FOut); + finally + FIn.Free; + FOut.Free; + end; + // stop program loop + Terminate; +end; + +constructor TDocDump.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + StopOnException:=True; +end; + +destructor TDocDump.Destroy; +begin + inherited Destroy; +end; + +procedure TDocDump.WriteHelp; +begin + { add your help code here } + writeln('Usage: ',ExeName,' -h'); +end; + +var + Application: TDocDump; + + +begin + Application:=TDocDump.Create(nil); + Application.Run; + Application.Free; +end. + diff --git a/docview/src/docdump/filestreamhelper.pas b/docview/src/docdump/filestreamhelper.pas new file mode 100644 index 00000000..ff831a91 --- /dev/null +++ b/docview/src/docdump/filestreamhelper.pas @@ -0,0 +1,35 @@ +unit filestreamhelper; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +type + TFileTextStream = class(TFileStream) + public + procedure WriteLn(const fmt: String; const args: array of const); + procedure WriteLn(const s: String); + end; + +implementation + +{ TFileTextStream } + +procedure TFileTextStream.WriteLn(const fmt: String; const args: array of const); +var + temp: String; +begin + temp := Format(fmt, args) + LineEnding; + Write(temp[1], Length(temp)); +end; + +procedure TFileTextStream.WriteLn(const s: String); +begin + self.WriteLn('%s', [s]); +end; + +end. + diff --git a/docview/src/docdump/iterator_impl.pas b/docview/src/docdump/iterator_impl.pas new file mode 100644 index 00000000..4ad88052 --- /dev/null +++ b/docview/src/docdump/iterator_impl.pas @@ -0,0 +1,480 @@ +unit iterator_impl; + +{$mode objfpc}{$H+} + +interface + +uses + Classes + ,SysUtils + ,Regex { to be used with filtered string iterator } + ,iterator_intf + ,contnrs + ; + +type + + TTBStringsIterator = class(TInterfacedObject, ITBStringIterator, ITBStringAndObjectIterator) + private + FStrings: TStrings; + FCursor: Integer; + { Interface methods should always be private because + we will only ever access them via an Interface, + never via an Object instance } + + { Interface: ITBStringIterator and ITBStringAndObjectIterator } + function HasNext: Boolean; + function Next: string; + function HasPrevious: Boolean; + function Previous: string; + { Interface: ITBStringAndObjectIterator } + function HasNextObject: Boolean; + function NextObject: TObject; + function HasPreviousObject: Boolean; + function PreviousObject: TObject; + public + constructor CreateCustom(const ASource: TStrings); virtual; + end; + + + TTBListIterator = class(TInterfacedObject, ITBIterator) + private + FList: TList; + FCursor: Integer; + { Interface: ITBIterator } + function HasNext: Boolean; + function Next: TObject; + function HasPrevious: Boolean; + function Previous: TObject; + public + constructor CreateCustom(const ASource: TList); virtual; + end; + + + TTBCollectionIterator = class(TInterfacedObject, ITBIterator) + private + FCollection: TCollection; + FCursor: Integer; + { Interface: ITBIterator } + function HasNext: Boolean; + function Next: TObject; + function HasPrevious: Boolean; + function Previous: TObject; + public + constructor CreateCustom(const ASource: TCollection); virtual; + end; + + + TTBInterfaceListIterator = class(TInterfacedObject, ITBInterfaceIterator) + private + FList: TInterfaceList; + FCursor: integer; + { Interface: ITBinterfaceIterator } + function HasNext: Boolean; + function Next: IInterface; + function HasPrevious: Boolean; + function Previous: IInterface; + public + constructor CreateCustom(const ASource: TInterfaceList); virtual; + end; + + + TTBFilteredStringsIterator = class(TTBStringsIterator, ITBFilteredStringIterator) + private + FNextIndex: Integer; + FRegex: TRegexEngine; + { Interface: ITBFilteredStringIterator } + function GetFilter: string; + procedure SetFilter(const AValue: string); + { Interface: ITBStringIterator and ITBStringAndObjectIterator } + function HasNext: Boolean; + function Next: string; + function HasPrevious: Boolean; + function Previous: string; + public + constructor CreateCustom(const ASource: TStrings); override; + destructor Destroy; override; + end; + + + TTBObjectListIterator = class(TInterfacedObject, ITBIterator) + private + FList: TObjectList; + FCursor: Integer; + { Interface: ITBIterator } + function HasNext: Boolean; + function Next: TObject; + function HasPrevious: Boolean; + function Previous: TObject; + public + constructor CreateCustom(const ASource: TObjectList); virtual; + end; + + + +implementation + + +{ TTBStringsIterator } + +function TTBStringsIterator.HasNext: Boolean; +begin + Result := False; + if Assigned(FStrings) then + if FCursor < FStrings.Count - 1 then + Result := True; +end; + +function TTBStringsIterator.Next: string; +begin + Result := ''; + if HasNext then + begin + Inc(FCursor, 1); + Result := FStrings.Strings[FCursor]; + end; +end; + +function TTBStringsIterator.HasPrevious: Boolean; +begin + Result := False; + if Assigned(FStrings) then + if FCursor > 0 then + Result := True; +end; + +function TTBStringsIterator.Previous: string; +begin + Result := ''; + if HasPrevious then + begin + Dec(FCursor, 1); + Result := FStrings.Strings[FCursor]; + end; +end; + +function TTBStringsIterator.HasNextObject: Boolean; +begin + Result := False; + if Assigned(FStrings) then + if FCursor < FStrings.Count - 1 then + Result := FStrings.Objects[FCursor] <> nil; +end; + +function TTBStringsIterator.NextObject: TObject; +begin + Result := nil; + if HasNextObject then + // Note that Next(...) increments the FCursor + Result := FStrings.Objects[FCursor]; +end; + +function TTBStringsIterator.HasPreviousObject: Boolean; +begin + Result := False; + if Assigned(FStrings) then + if FCursor > 0 then + Result := FStrings.Objects[FCursor] <> nil; +end; + +function TTBStringsIterator.PreviousObject: TObject; +begin + Result := nil; + if HasPreviousObject then + // Note that Previous(...) decrements the FCursor + Result := FStrings.Objects[FCursor]; +end; + +constructor TTBStringsIterator.CreateCustom(const ASource: TStrings); +begin + inherited Create; + FStrings := ASource; + FCursor := -1; +end; + + +{ TTBListIterator } + +function TTBListIterator.HasNext: Boolean; +begin + Result := False; + if Assigned(FList) then + if FCursor < FList.Count - 1 then + Result := True; +end; + +function TTBListIterator.Next: TObject; +begin + Result := nil; + if HasNext then + begin + Inc(FCursor, 1); + result := TObject(FList.Items[FCursor]); + end; +end; + +function TTBListIterator.HasPrevious: Boolean; +begin + Result := False; + if Assigned(FList) then + begin + if FCursor > 0 then + Result := True; + end; +end; + +function TTBListIterator.Previous: TObject; +begin + Result := nil; + if HasPrevious then + begin + Dec(FCursor, 1); + Result := TObject(FList.Items[FCursor]); + end; +end; + +constructor TTBListIterator.CreateCustom(const ASource: TList); +begin + inherited Create; + FList := ASource; + FCursor := -1; +end; + + +{ TTBCollectionIterator } + +function TTBCollectionIterator.HasNext: Boolean; +begin + Result := False; + if Assigned(FCollection) then + if FCursor < FCollection.Count - 1 then + Result := True; +end; + +function TTBCollectionIterator.Next: TObject; +begin + Result := nil; + if HasNext then + begin + Inc(FCursor, 1); + result := FCollection.Items[FCursor]; + end; +end; + +function TTBCollectionIterator.HasPrevious: Boolean; +begin + Result := False; + if Assigned(FCollection) then + if FCursor > 0 then + Result := True; +end; + +function TTBCollectionIterator.Previous: TObject; +begin + Result := nil; + if HasPrevious then + begin + Dec(FCursor, 1); + Result := FCollection.Items[FCursor]; + end; +end; + +constructor TTBCollectionIterator.CreateCustom(const ASource: TCollection); +begin + inherited Create; + FCollection := ASource; + FCursor := -1; +end; + + +{ TTBFilteredStringsIterator } + +function TTBFilteredStringsIterator.GetFilter: string; +begin + Result := FRegex.RegexString; +end; + +procedure TTBFilteredStringsIterator.SetFilter(const AValue: string); +const + cFilterErr = 'Error in Filter string at position %d with ErrorCode %d. Filter string <%s>'; +var + LErrorCode: TRegexError; + LErrorPos: integer; +begin + if AValue <> FRegex.RegexString then + begin + FRegex.RegexString := AValue; + if not FRegex.Parse(LErrorPos, LErrorCode) then + raise Exception.CreateFmt(cFilterErr, [LErrorPos, Ord(LErrorCode), AValue]); + end; + FNextIndex := -1; +end; + +function TTBFilteredStringsIterator.HasNext: Boolean; +var + LIndex: integer; + LMatchPos: integer; + LOffset: integer; +begin + Result := False; + if GetFilter = '' then + begin + Result := inherited HasNext; + if Result then + FNextIndex := FCursor + 1; + end + else + begin + if FCursor < FStrings.Count - 1 then + begin + { If we haven't already calculated the next matching item } + if FNextIndex = -1 then + begin + LIndex := FCursor + 1; + { Peek ahead to find the next matching string } + while (LIndex < FStrings.Count) and (FNextIndex = -1) do + begin + { reset MatchString parameters } + LOffset := 0; + LMatchPos := 0; + if FRegex.MatchString(FStrings.Strings[LIndex], LMatchPos, LOffset) then + FNextIndex := LIndex; + Inc(LIndex); + end; + end; + if FNextIndex <> -1 then + Result := True; + end; + end; { if..else } +end; + +function TTBFilteredStringsIterator.Next: string; +begin + Result := ''; + if HasNext then + begin + FCursor := FNextIndex; + FNextIndex := -1; + Result := FStrings.Strings[FCursor]; + end; +end; + +function TTBFilteredStringsIterator.HasPrevious: Boolean; +begin + Result := False; // Filtered String is uni-directional +end; + +function TTBFilteredStringsIterator.Previous: string; +begin + Result := ''; + raise EUniDirectionalIterator.Create('Filtered String Iterator is uni-directional (forward) only.'); +end; + +constructor TTBFilteredStringsIterator.CreateCustom(const ASource: TStrings); +begin + inherited CreateCustom(ASource); + FRegex := TRegexEngine.Create(''); + FRegex.IgnoreCase := True; + FNextIndex := -1; +end; + +destructor TTBFilteredStringsIterator.Destroy; +begin + FRegex.Free; + inherited Destroy; +end; + + +{ TTBInterfaceListIterator } + +function TTBInterfaceListIterator.HasNext: Boolean; +begin + Result := False; + if Assigned(FList) then + if FCursor < FList.Count - 1 then + Result := True; +end; + +function TTBInterfaceListIterator.Next: IInterface; +begin + Result := nil; + if HasNext then + begin + Inc(FCursor, 1); + Result := FList.Items[FCursor]; + end; +end; + +function TTBInterfaceListIterator.HasPrevious: Boolean; +begin + Result := False; + if Assigned(FList) then + if FCursor > 0 then + Result := True; +end; + +function TTBInterfaceListIterator.Previous: IInterface; +begin + Result := nil; + if HasPrevious then + begin + Dec(FCursor, 1); + Result := FList.Items[FCursor]; + end; +end; + +constructor TTBInterfaceListIterator.CreateCustom(const ASource: TInterfaceList); +begin + inherited Create; + FList := ASource; + FCursor := -1; +end; + +{ TTBObjectListIterator } + +function TTBObjectListIterator.HasNext: Boolean; +begin + Result := False; + if Assigned(FList) then + if FCursor < FList.Count - 1 then + Result := True; +end; + +function TTBObjectListIterator.Next: TObject; +begin + result := nil; + if HasNext then + begin + Inc(FCursor); + result := FList.Items[FCursor]; + end; +end; + +function TTBObjectListIterator.HasPrevious: Boolean; +begin + Result := False; + if Assigned(FList) then + if FCursor > 0 then + Result := True; +end; + +function TTBObjectListIterator.Previous: TObject; +begin + result := nil; + if HasPrevious then + begin + Dec(FCursor); + result := FList.Items[FCursor]; + end; +end; + +constructor TTBObjectListIterator.CreateCustom(const ASource: TObjectList); +begin + inherited Create; + FList := ASource; + FCursor := -1; +end; + + +end. + diff --git a/docview/src/docdump/iterator_intf.pas b/docview/src/docdump/iterator_intf.pas new file mode 100644 index 00000000..e82b59a1 --- /dev/null +++ b/docview/src/docdump/iterator_intf.pas @@ -0,0 +1,169 @@ +unit iterator_intf; + +{$mode objfpc}{$H+} + +interface + +uses + Classes + ,SysUtils + ; + +type + { A custom exception class } + ENoIteratorImpl = class(Exception); + EUniDirectionalIterator = class(Exception); + + + { Standard iterators } + + ITBIterator = interface(IInterface) + ['{9C2BC10D-54C8-4B59-88B5-A564921CF0E3}'] + function HasNext: Boolean; + function Next: TObject; + function HasPrevious: Boolean; + function Previous: TObject; + end; + + + ITBStringIterator = interface(IInterface) + ['{B2A449B4-5D0A-4F14-AC11-CA055EDA3ED7}'] + function HasNext: Boolean; + function Next: string; + function HasPrevious: Boolean; + function Previous: string; + end; + + + ITBStringAndObjectIterator = interface(ITBStringIterator) + ['{287373DC-A90D-400E-BAEE-C85474C317A8}'] + function HasNextObject: Boolean; + function NextObject: TObject; + function HasPreviousObject: Boolean; + function PreviousObject: TObject; + end; + + + ITBInterfaceIterator = interface + ['{9B599C5B-4BBB-43F6-AF8E-09FEE9AE0E20}'] + function HasNext: Boolean; + function Next: IInterface; + function HasPrevious: Boolean; + function Previous: IInterface; + end; + + { TODO: + More interfaces could be added for collections like: + TTreeView, TStringGrid etc... } + + + { Filtered iterators } + + ITBFilteredStringIterator = interface(ITBStringIterator) + ['{CF1B9E2D-DD05-4D15-95C6-686EAFA4ED82}'] + function GetFilter: string; + procedure SetFilter(const AValue: string); + property Filter: string read GetFilter write SetFilter; + end; + + + { TODO: + More filtered versions of the standard iterators could + be added here... } + + + + { Iterator Factory } + + TTBIteratorFactory = class(TObject) + function Iterator(const ASource: TObject): ITBIterator; + function StringIterator(const ASource: TObject): ITBStringIterator; + function StringAndObjectIterator(const ASource: TObject): ITBStringAndObjectIterator; + function InterfaceIterator(const ASource: TObject): ITBInterfaceIterator; + function FilteredStringIterator(const ASource: TObject; const AFilter: string): ITBFilteredStringIterator; + end; + + +{ Global iterator factory singleton } +function gIteratorFactory: TTBIteratorFactory; + + +implementation + +uses + iterator_impl; + +var + uIteratorFactory: TTBIteratorFactory; + +const + cNoIteratorImpl = 'No Iterator implementation found for <%s>'; + + +{ The lazy mans singleton implementation, but it does the job just fine. } +function gIteratorFactory: TTBIteratorFactory; +begin + if not Assigned(uIteratorFactory) then + uIteratorFactory := TTBIteratorFactory.Create; + Result := uIteratorFactory; +end; + + +{ TTBIteratorFactory } + +function TTBIteratorFactory.Iterator(const ASource: TObject): ITBIterator; +begin + if ASource is TList then + Result := TTBListIterator.CreateCustom(TList(ASource)) + else if ASource is TCollection then + Result := TTBCollectionIterator.CreateCustom(TCollection(ASource)) + //else if ASource is TTreeNodes then + //Result := TTBTreeNodesIterator.CreateCustom(TTreeNodes(ASource)) + else + raise ENoIteratorImpl.CreateFmt(cNoIteratorImpl, [ASource.ClassName]); +end; + +function TTBIteratorFactory.StringIterator(const ASource: TObject): ITBStringIterator; +begin + if ASource is TStrings then + Result := TTBStringsIterator.CreateCustom(TStrings(ASource)) + else + raise ENoIteratorImpl.CreateFmt(cNoIteratorImpl, [ASource.ClassName]); +end; + +function TTBIteratorFactory.StringAndObjectIterator(const ASource: TObject): ITBStringAndObjectIterator; +begin + if ASource is TStrings then + Result := TTBStringsIterator.CreateCustom(TStrings(ASource)) + else + raise ENoIteratorImpl.CreateFmt(cNoIteratorImpl, [ASource.ClassName]); +end; + +function TTBIteratorFactory.InterfaceIterator(const ASource: TObject): ITBInterfaceIterator; +begin + if ASource is TInterfaceList then + Result := TTBInterfaceListIterator.CreateCustom(TInterfaceList(ASource)) + else + raise ENoIteratorImpl.CreateFmt(cNoIteratorImpl, [ASource.ClassName]); +end; + +function TTBIteratorFactory.FilteredStringIterator(const ASource: TObject; const AFilter: string): ITBFilteredStringIterator; +begin + if ASource is TStrings then + begin + Result := TTBFilteredStringsIterator.CreateCustom(TStrings(ASource)); + Result.Filter := AFilter; + end + else + raise ENoIteratorImpl.CreateFmt(cNoIteratorImpl, [ASource.ClassName]); +end; + + +initialization + uIteratorFactory := nil; + +finalization + uIteratorFactory.Free; + +end. + diff --git a/docview/src/docdump/readcontrols.pas b/docview/src/docdump/readcontrols.pas new file mode 100644 index 00000000..395a36db --- /dev/null +++ b/docview/src/docdump/readcontrols.pas @@ -0,0 +1,44 @@ +{ + Dump the controls data +} +unit readcontrols; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper; + +procedure ProcessControls(AIn: TFileStream; AOut: TFileTextStream); + + +implementation + +uses + readheader, IPFFileFormatUnit; + +procedure ProcessControls(AIn: TFileStream; AOut: TFileTextStream); +var + ctrls: TPanelControls; + i: integer; +begin + AOut.WriteLn(''); + AOut.WriteLn('Panel Controls (Buttons)'); + if eHdr.CtrlOffset > 0 then + begin + AIn.Seek(eHdr.CtrlOffset, soBeginning); + AIn.Read(ctrls, SizeOf(TControlDef)); + AOut.WriteLn(Format(' PanelControls.ControlCount: %4.4x (%0:d)', [ctrls.ControlCount])); + AOut.WriteLn(Format(' PanelControls.GroupCount: %4.4x (%0:d)', [ctrls.GroupCount])); + AOut.WriteLn(Format(' PanelControls.GroupIndex: %4.4x (%0:d)', [ctrls.GroupIndex])); + AOut.WriteLn(Format(' PanelControls.Reserved: %4.4x (%0:d)', [ctrls.Reserved])); + AOut.WriteLn(' *****'); + AOut.WriteLn(' <todo - process CountrolCount and GroupCount data>'); + end + else + AOut.WriteLn(' No panel control found'); +end; + +end. + diff --git a/docview/src/docdump/readextfiles.pas b/docview/src/docdump/readextfiles.pas new file mode 100644 index 00000000..6ea979d9 --- /dev/null +++ b/docview/src/docdump/readextfiles.pas @@ -0,0 +1,53 @@ +{ + Dumps the names of external database (help) files referenced by this file +} +unit readextfiles; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, IPFFileFormatUnit, filestreamhelper; + +procedure ProcessExtFiles(AIn: TFileStream; AOut: TFileTextStream); + + +implementation + +uses + readheader; + +procedure ProcessExtFiles(AIn: TFileStream; AOut: TFileTextStream); +var + count: integer; + name: string; + pData: pointer; + p: pointer; + pLength: pByte; +begin + AOut.WriteLn(''); + AOut.WriteLn('External File References'); + + if eHdr.NumDataBase > 0 then + begin + pData := nil; + AIn.Seek(eHdr.DataBaseOffset, soBeginning); + GetMem(pData, eHdr.DataBaseSize); // allocate temp space for data + AIn.Read(pData^, eHdr.DataBaseSize); // read all data in one shot + p := pData; // p is our incrementing position in the data + for count := 0 to eHdr.NumDataBase-1 do + begin + pLength := p; // length byte, including itself + SetString(name, p+1, pLength^-1); // use length value minus the length byte to get the string length + AOut.WriteLn(Format(' File #%d: %s', [count, name])); + inc(p, pLength^); // skip to next entry using full length (including length byte) + end; + FreeMem(pData, eHdr.DataBaseSize); // free allocated space + end + else + AOut.WriteLn(' No external file references found'); +end; + +end. + diff --git a/docview/src/docdump/readfonts.pas b/docview/src/docdump/readfonts.pas new file mode 100644 index 00000000..6b684cac --- /dev/null +++ b/docview/src/docdump/readfonts.pas @@ -0,0 +1,47 @@ +{ + Dumps the font data +} +unit readfonts; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper; + +procedure ProcessFonts(AIn: TFileStream; AOut: TFileTextStream); + + +implementation + +uses + readheader, IPFFileFormatUnit; + +procedure ProcessFonts(AIn: TFileStream; AOut: TFileTextStream); +var + fnt: THelpFontSpec; + pData: pointer; + i: integer; +begin + AOut.WriteLn(''); + AOut.WriteLn('Font Data'); + if eHdr.NumFontEntry > 0 then + begin + AIn.Seek(eHdr.FontTableOffset, soBeginning); + for i := 0 to eHdr.NumFontEntry-1 do + begin + AIn.Read(fnt, SizeOf(THelpFontSpec)); + AOut.WriteLn(Format(' Font Entry #%d', [i+1])); + AOut.WriteLn(Format(' FontSpec.FaceName: %s', [fnt.FaceName])); + AOut.WriteLn(Format(' FontSpec.Height: %4.4x (%0:d)', [fnt.Height])); + AOut.WriteLn(Format(' FontSpec.Width: %4.4x (%0:d)', [fnt.Width])); + AOut.WriteLn(Format(' FontSpec.CodePage: %4.4x (%0:d)', [fnt.Codepage])); + end; + end + else + AOut.WriteLn(' No font data is present'); +end; + +end. + diff --git a/docview/src/docdump/readheader.pas b/docview/src/docdump/readheader.pas new file mode 100644 index 00000000..201fcb86 --- /dev/null +++ b/docview/src/docdump/readheader.pas @@ -0,0 +1,135 @@ +{ + Dump the INF header & extended header structures to a text file +} +unit readheader; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper, IPFFileFormatUnit; + +procedure ProcessHeader(AIn: TFileStream; AOut: TFileTextStream); + +var + hdr: THelpFileHeader; + eHdr: TExtendedHelpFileHeader; + + +implementation + + +type + TWord = record + b1: AnsiChar; + b2: AnsiChar; + end; + + TOverlayID = packed record + b1: Byte; + b2: Byte; + b3: Byte; + end; + + TOverlaySearchStart = bitpacked record + SearchOffset: Unsigned_31; + IsRec16bitSize: boolean; + end; + + +procedure ProcessHeader(AIn: TFileStream; AOut: TFileTextStream); +var + bytes: integer; + s: string; + w: TWord; + i: uint32; + t0: TOverlayID; + t1: TOverlaySearchStart; +begin + try + AIn.Seek(0, soBeginning); + bytes := AIn.Read(hdr, SizeOf(THelpFileHeader)); + if bytes <> SizeOf(THelpFileHeader) then + raise Exception.Create('Failed to read complete file header'); + + if hdr.ID <> INF_HEADER_ID then + raise Exception.Create('This is not an OS/2 help file'); + + AOut.WriteLn('Header Section'); + t0 := TOverlayID(hdr.ID); + s := hdr.ID; + AOut.WriteLn(Format(' ipfheader.id: %4.2x %2x %2x ("%s") : Magic word' ,[Byte(hdr.id[0]), Byte(hdr.id[1]), Byte(hdr.id[2]), s])); + if (hdr.flags and $01) > 0 then + s := 'INF' + else + s := 'HLP'; + AOut.WriteLn(Format(' ipfheader.flags: %8.2x (%s format) : File format' ,[hdr.flags, s])); + AOut.WriteLn(Format(' ipfheader.size: %8.4x (%0:7d bytes) : Size of this header structure', [hdr.hdrsize])); + AOut.WriteLn(Format(' ipfheader.version: %6d.%d : version of file format?', [hdr.version_hi, hdr.version_lo])); + AOut.WriteLn(Format(' ipfheader.ntoc: %8.4x (%0:13d) : No of TOC entries', [hdr.ntoc])); + AOut.WriteLn(Format(' ipfheader.tocstart: %8.8x (%0:7d bytes) : 32bit file offset to start of TOC', [hdr.tocstart])); + AOut.WriteLn(Format(' ipfheader.toclen: %8.8x (%0:7d bytes) : bytes occupied by TOC entries', [hdr.toclen])); + AOut.WriteLn(Format(' ipfheader.tocoffsetsstart: %8.8x (%0:7d bytes) : file offset to array of TOC offsets', [hdr.tocoffsetsstart])); + AOut.WriteLn(Format(' ipfheader.nres: %8.4x (%0:13d) : number of panels with resource numbers', [hdr.nres])); + AOut.WriteLn(Format(' ipfheader.resstart: %8.8x (%0:7d bytes) : 32bit file offset of ressource number table', [hdr.resstart])); + AOut.WriteLn(Format(' ipfheader.nname: %8.4x (%0:13d) : number of panels with textual name', [hdr.nname])); + AOut.WriteLn(Format(' ipfheader.namestart: %8.8x (%0:7d bytes) : 32bit file offset to panel name table', [hdr.namestart])); + AOut.WriteLn(Format(' ipfheader.nindex: %8.4x (%0:13d) : number of index entries', [hdr.nindex])); + AOut.WriteLn(Format(' ipfheader.indexstart: %8.8x (%0:7d bytes) : 32bit file offset to index table', [hdr.indexstart])); + AOut.WriteLn(Format(' ipfheader.indexlen: %8.8x (%0:7d bytes) : size of index table', [hdr.indexlen])); + AOut.WriteLn(Format(' ipfheader.icmdCount: %8.4x (%0:13d) : number of icmd index items', [hdr.icmdCount])); + AOut.WriteLn(Format(' ipfheader.icmdOffset: %8.8x (%0:7d bytes) : file offset to icmd index items', [hdr.icmdOffset])); + AOut.WriteLn(Format(' ipfheader.icmdSize: %8.8x (%0:7d bytes) : size of icmd index table', [hdr.icmdSize])); + t1 := TOverlaySearchStart(hdr.searchstart); + i := t1.SearchOffset; + AOut.WriteLn(Format(' ipfheader.searchstart :31 %8.8x (%0:7d bytes) : 31bit file offset of full text search table', [i, i])); + if t1.IsRec16bitSize then + s := 'search rec is 16bit size' + else + s := 'search rec is 8bit size'; + AOut.WriteLn(Format(' ipfheader.recSize :1 %s (%s) : if high bit set, search record size is 16bit', [BoolToStr(t1.IsRec16bitSize, True), s])); + AOut.WriteLn(Format(' ipfheader.searchlen: %8.8x (%0:7d bytes) : size of full text search table', [hdr.searchlen])); + AOut.WriteLn(Format(' ipfheader.nslots: %8.4x (%0:13d) : number of "slots"', [hdr.nslots])); + AOut.WriteLn(Format(' ipfheader.slotsstart: %8.8x (%0:7d bytes) : 32bit file offset of the slots array', [hdr.slotsstart])); + AOut.WriteLn(Format(' ipfheader.dictlen: %8.8x (%0:7d bytes) : bytes occupied by the "dictionary"', [hdr.dictlen])); + AOut.WriteLn(Format(' ipfheader.ndict: %8.4x (%0:13d) : number of entries in the dictionary', [hdr.ndict])); + AOut.WriteLn(Format(' ipfheader.dictstart: %8.8x (%0:7d bytes) : 32bit file offset to start of dictionary', [hdr.dictstart])); + AOut.WriteLn(Format(' ipfheader.imgstart: %8.8x (%0:7d bytes) : 32bit file offset to image data', [hdr.imgstart])); + AOut.WriteLn(Format(' ipfheader.maxCVTIndex: %8.2x (%0:13d) : highest index inside panel''s local dictionary', [hdr.maxCVTIndex])); + AOut.WriteLn(Format(' ipfheader.nlsstart: %8.8x (%0:7d bytes) : 32bit file offset of NLS table', [hdr.nlsstart, hdr.nlsstart])); + AOut.WriteLn(Format(' ipfheader.nlslen: %8.8x (%0:7d bytes) : size of NLS table', [hdr.nlslen])); + AOut.WriteLn(Format(' ipfheader.extstart: %8.8x (%0:7d bytes) : 32bit file offset of extended data block', [hdr.extstart])); + AOut.WriteLn(Format(' ipfheader.reserved: %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x : for future use. set to zero.', + [hdr.reserved[0], hdr.reserved[1], hdr.reserved[2], hdr.reserved[3], hdr.reserved[4], hdr.reserved[5], + hdr.reserved[6], hdr.reserved[7], hdr.reserved[8], hdr.reserved[9], hdr.reserved[10], hdr.reserved[11] ])); + AOut.WriteLn(Format(' ipfheader.title: "%s" : ASCII title of database', [hdr.title])); + + AOut.WriteLn(''); + AOut.WriteLn('Extended Header Section'); + AIn.Seek(hdr.extstart, soBeginning); + AIn.Read(eHdr, SizeOf(TExtendedHelpFileHeader)); + AOut.WriteLn(Format(' extheader.NumFontEntry %8.4x (%0:13d) : Font Table - number of entries', [eHdr.NumFontEntry])); + AOut.WriteLn(Format(' extheader.FontTableOffset %8.8x (%0:7d bytes) : Font Table - 32bit offset in file', [eHdr.FontTableOffset])); + AOut.WriteLn(Format(' extheader.NumDataBase %8.4x (%0:13d) : Data Base - No of files', [eHdr.NumDataBase])); + AOut.WriteLn(Format(' extheader.DataBaseOffset %8.8x (%0:7d bytes) : Data Base - 32bit offset in file', [eHdr.DataBaseOffset])); + AOut.WriteLn(Format(' extheader.DataBaseSize %8.8x (%0:7d bytes) : Data Base - Size in bytse', [eHdr.DataBaseSize])); + AOut.WriteLn(Format(' extheader.EntryInGNameTable %8.4x (%0:13d) : Global Names - No entries', [eHdr.EntryInGNameTable])); + AOut.WriteLn(Format(' extheader.HelpPanelGNameTblOffset %8.8x (%0:7d bytes) : Global Names - 32bit offset in file', [eHdr.HelpPanelGNameTblOffset])); + AOut.WriteLn(Format(' extheader.StringsOffset %8.8x (%0:7d bytes) : Strings - 32bit offset in file', [eHdr.StringsOffset])); + AOut.WriteLn(Format(' extheader.StringsSize %8.4x (%0:7d bytes) : Strings - Total bytes of all strings', [eHdr.StringsSize])); + AOut.WriteLn(Format(' extheader.ChildPagesOffset %8.8x (%0:7d bytes) : Child Pages - 32bit offset in file', [eHdr.ChildPagesOffset])); + AOut.WriteLn(Format(' extheader.ChildPagesSize %8.8x (%0:7d bytes) : Child Pages - Total bytes of all strings', [eHdr.ChildPagesSize])); + AOut.WriteLn(Format(' extheader.NumGIndexEntry %8.8x (%0:13d) : Total number of Global Index items', [eHdr.NumGIndexEntry])); + AOut.WriteLn(Format(' extheader.CtrlOffset %8.8x (%0:7d bytes) : Ctrl Buttons : offset in file', [eHdr.CtrlOffset])); + AOut.WriteLn(Format(' extheader.CtrlSize %8.8x (%0:7d bytes) : Ctrl Buttons : size in bytes', [eHdr.CtrlSize])); + AOut.WriteLn(Format(' extheader.reserved: %8.8x %8.8x %8.8x %8.8x : for future use. set to zero.', + [eHdr.reserved[0], eHdr.reserved[1], eHdr.reserved[2], eHdr.reserved[3]])); + + finally + // no nothing + end; +end; + +end. + diff --git a/docview/src/docdump/readnlsdata.pas b/docview/src/docdump/readnlsdata.pas new file mode 100644 index 00000000..68609235 --- /dev/null +++ b/docview/src/docdump/readnlsdata.pas @@ -0,0 +1,31 @@ +unit readnlsdata; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper; + +procedure ProcessNLSData(AIn: TFileStream; AOut: TFileTextStream); + +implementation + +uses + readheader; + +procedure ProcessNLSData(AIn: TFileStream; AOut: TFileTextStream); +begin + AOut.WriteLn(''); + AOut.WriteLn('NLS Data'); + if hdr.nlslen > 0 then + begin + AOut.WriteLn(' <todo - process NLS data>'); + + end + else + AOut.WriteLn('NLS Data is not present'); +end; + +end. + diff --git a/docview/src/docdump/readstrings.pas b/docview/src/docdump/readstrings.pas new file mode 100644 index 00000000..7b397408 --- /dev/null +++ b/docview/src/docdump/readstrings.pas @@ -0,0 +1,56 @@ +{ + Dump the String table data +} +unit readstrings; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper; + +procedure ProcessStringsTable(AIn: TFileStream; AOut: TFileTextStream); + + +implementation + +uses + readheader; + +procedure ProcessStringsTable(AIn: TFileStream; AOut: TFileTextStream); +var + name: string; + pData: pointer; + p: pointer; + pLength: pByte; + bytes: integer; +begin + AOut.WriteLn(''); + AOut.WriteLn('Strings Data'); + + if eHdr.StringsSize > 0 then + begin + pData := nil; + AIn.Seek(eHdr.StringsOffset, soBeginning); + GetMem(pData, eHdr.StringsSize); // allocate temp space for data + AIn.Read(pData^, eHdr.StringsSize); // read all data in one shot + p := pData; // p is our incrementing position in the data + bytes := 0; + while bytes < eHdr.StringsSize do; + begin + pLength := p; // length byte, including itself + bytes := bytes + pLength^; + SetString(name, p+1, pLength^-1); // use length value minus the length byte to get the string length + AOut.WriteLn(Format(' %s', [name])); + inc(p, pLength^); // skip to next entry using full length (including length byte) + end; + FreeMem(pData, eHdr.StringsSize); // free allocated space + end + else + AOut.WriteLn(' There are no strings'); + +end; + +end. + diff --git a/docview/src/docdump/readtoc.pas b/docview/src/docdump/readtoc.pas new file mode 100644 index 00000000..0cfae395 --- /dev/null +++ b/docview/src/docdump/readtoc.pas @@ -0,0 +1,171 @@ +{ + Dump the Table of Contents data +} +unit readtoc; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, filestreamhelper; + +procedure ProcessTOC(AIn: TFileStream; AOut: TFileTextStream); + +implementation + +uses + IPFFileFormatUnit, readheader, u_Tools; + +type + TTOCOverlay = bitpacked record + length: uint8; // length of the entry including this byte (but not including extended data) + nestlevel: Unsigned_4; + unknown: boolean; + extended: boolean; + hidden: boolean; + haschildren: boolean; + numSlots: uint8; // number of "slots" occupied by the text for this toc entry + end; + + + TTOCExtendedOverlay = bitpacked record + setPos: boolean; + setSize: boolean; + setView: boolean; + setStyle: boolean; + noSearch: boolean; + noPrint: boolean; + setCtrl: boolean; + setTutor: boolean; + clear: boolean; + unknown1: Unsigned_1; + setGroup: boolean; + isParent: boolean; + unknown2: Unsigned_4; + end; + + +procedure ProcessTOC(AIn: TFileStream; AOut: TFileTextStream); +var + Count: integer; + VisCount: integer; + pOffsets: UInt32ArrayPointer; + toc: TTOCEntryStart; + olay: TTOCOverlay; + tocextolay: TTOCExtendedOverlay; + pData: pointer; + pEntry: pTTOCEntryStart; + pExtendedInfo: pExtendedTOCEntry; + p: PByte; + i: integer; + titleLen: integer; + title: string; +begin + AOut.WriteLn(''); + AOut.WriteLn('Table of Contents'); + VisCount := 0; + GetMem(pOffsets, SizeOf(uint32) * hdr.ntoc); + AIn.Seek(hdr.tocoffsetsstart, soBeginning); + AIn.Read(pOffsets^, SizeOf(uint32) * hdr.ntoc); // now we have array of toc offsets + + AIn.Seek(hdr.tocstart, soBeginning); + GetMem(pData, hdr.toclen); + AIn.Read(pData^, hdr.toclen); + pEntry := pData; + for count := 1 to hdr.ntoc do + begin +// AIn.Read(toc, SizeOf(TTOCEntryStart)); +// FillChar(olay, SizeOf(TTOCOverlay), 0); + p := PByte(pEntry) + sizeof(TTOCEntryStart); + i := Longint(p^); + + olay.extended := (pEntry^.flags and TOCEntryExtended ) = TOCEntryExtended; + olay.nestlevel := (pEntry^.flags and TOCEntryLevelMask); + olay.hidden := (pEntry^.flags and TOCEntryHidden) = TOCEntryHidden; + olay.haschildren := (pEntry^.flags and TOCEntryHasChildren) = TOCEntryHasChildren; + + AOut.WriteLn(Format(' TOC Entry #%d at offset %8.8x (%d bytes)', [count, p^, i])); + AOut.WriteLn(Format(' tocentry.length: %2.2x (%0:d bytes)', [pEntry^.length])); + AOut.WriteLn(Format(' tocentry.nestlevel: %d', [olay.nestlevel])); + AOut.WriteLn(Format(' tocentry.unknown: %s', [iif(olay.unknown, 'set', 'clear')])); + AOut.WriteLn(Format(' tocentry.extended: %s', [iif(olay.extended, 'yes', 'no')])); + AOut.WriteLn(Format(' tocentry.hidden: %s', [iif(olay.hidden, 'yes', 'no')])); + AOut.WriteLn(Format(' tocentry.haschildren: %s', [iif(olay.haschildren, 'yes', 'no')])); + AOut.WriteLn(Format(' tocentry.numSlots: %d', [pEntry^.numSlots])); + if not olay.hidden then + inc(VisCount); + if olay.extended then + begin + pExtendedInfo := pExtendedTOCEntry( p ); // next data to follow must be Extended TOC Entry + + AOut.WriteLn(' Extended TOC Entry'); + tocextolay := TTOCExtendedOverlay(pExtendedInfo^); + + AOut.Writeln(Format(' ExtTocEntry.setPos: %s', [iif(tocextolay.setPos, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.setSize: %s', [iif(tocextolay.setSize, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.setView: %s', [iif(tocextolay.setView, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.setStyle: %s', [iif(tocextolay.setStyle, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.noSearch: %s', [iif(tocextolay.noSearch, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.noPrint: %s', [iif(tocextolay.noPrint, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.setCtrl: %s', [iif(tocextolay.setCtrl, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.setTutor: %s', [iif(tocextolay.setTutor, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.clear: %s', [iif(tocextolay.clear, 'clear', 'set')])); + AOut.Writeln(Format(' ExtTocEntry.unknown1: %1.1x', [tocextolay.unknown1])); + AOut.Writeln(Format(' ExtTocEntry.setGroup: %s', [iif(tocextolay.setGroup, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.isParent: %s', [iif(tocextolay.isParent, 'yes', 'no')])); + AOut.Writeln(Format(' ExtTocEntry.unknown2: %1.1x', [tocextolay.unknown2])); + + inc( p, sizeof( TExtendedTOCEntry ) ); // move p past two flag bytes + + if ( pExtendedInfo^.w1 and 1 ) > 0 then + // skip position + inc( p, sizeof( THelpXYPair ) ); + + if ( pExtendedInfo^.w1 and 2 ) > 0 then + // skip size + inc( p, sizeof( THelpXYPair ) ); + + if ( pExtendedInfo^.w1 and 8 ) > 0 then + // skip window controls + inc( p, sizeof(word) ); // increment by 2 + + if ( pExtendedInfo^.w1 and $40 ) > 0 then + // skip something else, unknown... style? 2 bytes + inc( p, sizeof(word) ); // increment by 2 + + if ( pExtendedInfo^.w2 and 4 ) > 0 then + begin +// _ContentsGroupIndex := pUInt16(p)^; + // read group + inc( p, sizeof( uint16 ) ); + end; + end; + + // skip slot numbers for now. +// _pSlotNumbers := pUInt16(p); + inc( p, pEntry^.numSlots * sizeof(uint16) ); + + // Calculate the remainder of the tocentry length - that is the bytes used for TOC topic (title) text + titleLen := pEntry^.length - ( longword( p ) - longword( pEntry ) ); + + // Read title + if TitleLen > 0 then + SetString(Title, Pointer(p), TitleLen) + else + Title := '<unknown>'; + AOut.WriteLn(Format(' toc Title: %s', [title])); + + + p := PByte(pEntry); + inc(p, pEntry^.Length); + pEntry := pTTOCEntryStart(p); + end; + + AOut.WriteLn(Format(' TOC visible count: %d', [VisCount])); + FreeMem(pOffsets, SizeOf(uint32) * hdr.ntoc); + FreeMem(pData, hdr.toclen); +end; + +end. + diff --git a/docview/src/docdump/u_Tools.pas b/docview/src/docdump/u_Tools.pas new file mode 100644 index 00000000..96192db9 --- /dev/null +++ b/docview/src/docdump/u_Tools.pas @@ -0,0 +1,52 @@ +{ + This unit will grow to include all handy functions that can be used in + different Lazarus projects. + + There may be no links to other non-standard units! +} +unit u_Tools; + +{$mode objfpc}{$H+} + +interface + + { Missing iif() known from Visual Basic - return a string } + function iif(fCon: Boolean; sTrue, sFalse: String): String; + { Missing iif() known from Visual Basic - return an Integer } + function iif(fCon: Boolean; iTrue, iFalse: Integer): Integer; + { Missing iif() known from Visual Basic - return an Extended } + function iif(fCon: Boolean; iTrue, iFalse: Extended): Extended; + + +implementation +uses + SysUtils; + + +function iif(fCon: Boolean; sTrue, sFalse: String): String; +begin + if fCon then + Result := sTrue + else + Result := sFalse; +end; + +function iif(fCon: Boolean; iTrue, iFalse: Integer): Integer; +begin + if fCon then + Result := iTrue + else + Result := iFalse; +end; + +function iif(fCon: Boolean; iTrue, iFalse: Extended): Extended; +begin + if fCon then + Result := iTrue + else + Result := iFalse; +end; + + +end. + diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi new file mode 100644 index 00000000..f64b028f --- /dev/null +++ b/docview/src/docview.lpi @@ -0,0 +1,210 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="8"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="InIDEConfig"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <Title Value="docview"/> + <UseAppBundle Value="False"/> + </General> + <VersionInfo> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion="0.0.0.0"/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="30"> + <Unit0> + <Filename Value="docview.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="docview"/> + </Unit0> + <Unit1> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit1> + <Unit2> + <Filename Value="IPFEscapeCodes.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="IPFEscapeCodes"/> + </Unit2> + <Unit3> + <Filename Value="HelpTopic.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpTopic"/> + </Unit3> + <Unit4> + <Filename Value="HelpFile.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpFile"/> + </Unit4> + <Unit5> + <Filename Value="CompareWordUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="CompareWordUnit"/> + </Unit5> + <Unit6> + <Filename Value="SearchTable.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="SearchTable"/> + </Unit6> + <Unit7> + <Filename Value="TextSearchQuery.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="TextSearchQuery"/> + </Unit7> + <Unit8> + <Filename Value="nvUtilities.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="nvUtilities"/> + </Unit8> + <Unit9> + <Filename Value="../docs/inf04.txt"/> + <IsPartOfProject Value="True"/> + </Unit9> + <Unit10> + <Filename Value="SearchUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="SearchUnit"/> + </Unit10> + <Unit11> + <Filename Value="../components/richtext/RichTextStyleUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="RichTextStyleUnit"/> + </Unit11> + <Unit12> + <Filename Value="../components/richtext/CanvasFontManager.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="CanvasFontManager"/> + </Unit12> + <Unit13> + <Filename Value="../components/richtext/ACLStringUtility.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="ACLStringUtility"/> + </Unit13> + <Unit14> + <Filename Value="../components/richtext/RichTextDocumentUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="RichTextDocumentUnit"/> + </Unit14> + <Unit15> + <Filename Value="../components/richtext/RichTextView.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="RichTextView"/> + </Unit15> + <Unit16> + <Filename Value="../components/richtext/RichTextLayoutUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="RichTextLayoutUnit"/> + </Unit16> + <Unit17> + <Filename Value="../components/richtext/RichTextDisplayUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="RichTextDisplayUnit"/> + </Unit17> + <Unit18> + <Filename Value="IPFFileFormatUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="IPFFileFormatUnit"/> + </Unit18> + <Unit19> + <Filename Value="HelpWindowDimensions.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpWindowDimensions"/> + </Unit19> + <Unit20> + <Filename Value="NewViewConstantsUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="NewViewConstantsUnit"/> + </Unit20> + <Unit21> + <Filename Value="SettingsUnit.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="SettingsUnit"/> + </Unit21> + <Unit22> + <Filename Value="dvconstants.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="dvConstants"/> + </Unit22> + <Unit23> + <Filename Value="dvHelpers.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="dvHelpers"/> + </Unit23> + <Unit24> + <Filename Value="HelpWindow.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpWindow"/> + </Unit24> + <Unit25> + <Filename Value="../TODO.txt"/> + <IsPartOfProject Value="True"/> + </Unit25> + <Unit26> + <Filename Value="frm_configuration.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_configuration"/> + </Unit26> + <Unit27> + <Filename Value="arrows.inc"/> + <IsPartOfProject Value="True"/> + </Unit27> + <Unit28> + <Filename Value="HelpBitmap.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="HelpBitmap"/> + </Unit28> + <Unit29> + <Filename Value="missing.inc"/> + <IsPartOfProject Value="True"/> + </Unit29> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="9"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + <OtherUnitFiles Value="../components/richtext/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <CStyleOperator Value="False"/> + <IncludeAssertionCode Value="True"/> + <AllowLabel Value="False"/> + <CPPInline Value="False"/> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Optimizations> + <OptimizationLevel Value="0"/> + </Optimizations> + </CodeGeneration> + <Other> + <CustomOptions Value="-O-"/> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/docview/src/docview.lpr b/docview/src/docview.lpr new file mode 100644 index 00000000..91e50323 --- /dev/null +++ b/docview/src/docview.lpr @@ -0,0 +1,41 @@ +program docview; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, + fpg_main, frm_main, IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, + TextSearchQuery, nvUtilities, HelpFile, SearchUnit, + fpg_cmdlineparams, IPFFileFormatUnit, HelpWindowDimensions, + NewViewConstantsUnit, SettingsUnit, RichTextStyleUnit, CanvasFontManager, + ACLStringUtility, RichTextDocumentUnit, RichTextView, RichTextLayoutUnit, + RichTextDisplayUnit, dvconstants, dvHelpers, frm_configuration, HelpBitmap; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + + // always load custom style for help viewer + //if Assigned(fpgStyle) then + // fpgStyle.Free; + //fpgStyle := TMyStyle.Create; + + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/docview/src/dvHelpers.pas b/docview/src/dvHelpers.pas new file mode 100644 index 00000000..c5486bb7 --- /dev/null +++ b/docview/src/dvHelpers.pas @@ -0,0 +1,50 @@ +unit dvHelpers; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +const + OWN_HELP_MARKER = '[DOCVIEWHELP]'; + + +function GetOwnHelpFileName: String; +function FindHelpFile(const AFilename: string): string; + + +implementation + +uses + fpg_utils + ; + + +function GetOwnHelpFileName: String; +//var +// tmpLanguage : String; +begin + //tmpLanguage := getLanguage; + //if tmpLanguage = '' then + //begin + // tmpLanguage := GetEnv(LanguageEnvironmentVar) + //end; + // + //result := FindDefaultLanguageHelpFile('NewView', tmpLanguage); + + { TODO -oGraeme -cown help : Improve own help file location } + result := fpgExtractFilePath(ParamStr(0)) + 'docview.inf'; +end; + +// Given a "filename" which may include a path, find it in various paths and extensions +function FindHelpFile(const AFilename: string): string; +begin + { TODO -ograemeg -csearch files : Implement searching know locations } + Result := AFileName; +end; + + +end. + diff --git a/docview/src/dvconstants.pas b/docview/src/dvconstants.pas new file mode 100644 index 00000000..626e0840 --- /dev/null +++ b/docview/src/dvconstants.pas @@ -0,0 +1,39 @@ +unit dvConstants; + +{$mode objfpc}{$H+} + +interface + +const + { DO NOT LOCALIZE } + HelpPathEnvironmentVar = 'HELP'; + BookshelfEnvironmentVar = 'BOOKSHELF'; + HELP_FILE_DELIMITER = '+'; + HELP_FILE_EXTENSION = ExtensionSeparator + 'hlp'; + INF_FILE_EXTENSION = ExtensionSeparator + 'inf'; + + +resourcestring + rsDVTitle = 'Documentation Viewer'; + rsDVSearchingMsg = 'Searching...'; + rsDVDisplaying = 'Displaying...'; + rsDVLoadingNotes = 'Loading notes...'; + rsDVDisplayContents = 'Display contents...'; + rsDVDisplayingFirstTopic = 'Display first topic...'; + rsDVDone = 'Done'; + rsDVNoFile = 'No file'; + rsDVOpenHelpFile = 'Open Help File'; + rsDVHelpFiles = 'Help Files'; + rsDVNoMatchesFound = '(No matches found for ''%s'')'; + rsDVSearchSyntaxError = 'Error in search syntax: '; + rsDVSearchFoundMsg = 'Found %d matches for '; + rsDVCouldNotOpen = 'Could not open <%s>'; + +const + hcConfigGeneralTab = 510; + hcConfigFontsColorTab = 520; + +implementation + +end. + diff --git a/docview/src/extrafpc.cfg b/docview/src/extrafpc.cfg new file mode 100644 index 00000000..b68bb1b4 --- /dev/null +++ b/docview/src/extrafpc.cfg @@ -0,0 +1,10 @@ +-Sa +-gl +-Xs +-l +-Fiunits/ +-Fu../components/richtext/ +-Fu../../lib/$fpctarget +-Fu. +-FUunits + diff --git a/docview/src/frm_configuration.pas b/docview/src/frm_configuration.pas new file mode 100644 index 00000000..2e19939b --- /dev/null +++ b/docview/src/frm_configuration.pas @@ -0,0 +1,412 @@ +unit frm_configuration; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_tab, fpg_button, + fpg_label, fpg_edit, fpg_panel, fpg_combobox, fpg_listbox, fpg_checkbox; + +type + + TConfigurationForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: ConfigurationForm} + PageControl1: TfpgPageControl; + btnSave: TfpgButton; + btnCancel: TfpgButton; + tsGeneral: TfpgTabSheet; + tsFontsColor: TfpgTabSheet; + Label1: TfpgLabel; + edtNormalFont: TfpgEdit; + btnNormalFont: TfpgButton; + Label2: TfpgLabel; + edtFixedFont: TfpgEdit; + btnFixedFont: TfpgButton; + btnHelp: TfpgButton; + Panel1: TfpgPanel; + cbIndexStyle: TfpgComboBox; + lblIndexStyle: TfpgLabel; + lblSearchDirs: TfpgLabel; + btnSearchDirAdd: TfpgButton; + lbSearchDirs: TfpgListBox; + btnSearchDirDelete: TfpgButton; + chkEscapeIPFSymbols: TfpgCheckBox; + {@VFD_HEAD_END: ConfigurationForm} + procedure btnNormalFontClicked(Sender: TObject); + procedure btnFixedFontClicked(Sender: TObject); + procedure ConfigurationFormShow(Sender: TObject); + procedure btnHelpClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabSheet); + procedure btnCancelClick(Sender: TObject); + procedure btnSaveClick(Sender: TObject); + procedure btnSearchDirAddClicked(Sender: TObject); + procedure SettingsToGui; + procedure GuiToSettings; + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +procedure ShowConfigForm; + +implementation + +uses + fpg_dialogs, SettingsUnit, dvConstants; + +procedure ShowConfigForm; +var + frm: TConfigurationForm; +begin + frm := TConfigurationForm.Create(nil); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + +{@VFD_NEWFORM_IMPL} + +procedure TConfigurationForm.btnNormalFontClicked(Sender: TObject); +var + f: TfpgString; +begin + f := edtNormalFont.Text; + if SelectFontDialog(f) then + edtNormalFont.Text := f; +end; + +procedure TConfigurationForm.btnFixedFontClicked(Sender: TObject); +var + f: TfpgString; +begin + f := edtFixedFont.Text; + if SelectFontDialog(f) then + edtFixedFont.Text := f; +end; + +procedure TConfigurationForm.ConfigurationFormShow(Sender: TObject); +begin + SettingsToGui; + PageControl1.ActivePage := tsGeneral; + // programatically seting a tab does not fire OnChange event, so we do it mantually + PageControl1Change(self, tsGeneral); +end; + +procedure TConfigurationForm.btnHelpClick(Sender: TObject); +begin + ShowMessage(IntToStr(btnHelp.HelpContext)); +end; + +procedure TConfigurationForm.PageControl1Change(Sender: TObject; + NewActiveSheet: TfpgTabSheet); +begin + if NewActiveSheet = tsGeneral then + begin + btnHelp.HelpContext := hcConfigGeneralTab; + end + else if NewActiveSheet = tsFontsColor then + begin + btnHelp.HelpContext := hcConfigFontsColorTab; + end; +end; + +procedure TConfigurationForm.btnCancelClick(Sender: TObject); +begin + ModalResult := mrCancel; +end; + +procedure TConfigurationForm.btnSaveClick(Sender: TObject); +begin + GuiToSettings; + SaveSettings; + ModalResult := mrOK; +end; + +procedure TConfigurationForm.btnSearchDirAddClicked(Sender: TObject); +var + s: TfpgString; +begin + s := SelectDirDialog(''); + if s <> '' then + lbSearchDirs.Items.Add(s); +end; + +procedure TConfigurationForm.SettingsToGui; +begin + // General + cbIndexStyle.FocusItem := Ord(Settings.IndexStyle); + lbSearchDirs.Items.Assign(Settings.SearchDirectories); + chkEscapeIPFSymbols.Checked := Settings.IPFTopicSaveAsEscaped; + // Fonts & Color + edtNormalFont.Text := Settings.NormalFont.FontDesc; + edtFixedFont.Text := Settings.FixedFont.FontDesc; +end; + +procedure TConfigurationForm.GuiToSettings; +begin + // General + Settings.IndexStyle := TIndexStyle(cbIndexStyle.FocusItem); + Settings.SearchDirectories.Assign(lbSearchDirs.Items); + Settings.IPFTopicSaveAsEscaped := chkEscapeIPFSymbols.Checked; + // Fonts & Color + Settings.NormalFont.Free; + Settings.NormalFont := fpgGetFont(edtNormalFont.Text); + Settings.FixedFont.Free; + Settings.FixedFont := fpgGetFont(edtFixedFont.Text); +end; + +constructor TConfigurationForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + OnShow := @ConfigurationFormShow; +end; + +procedure TConfigurationForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: ConfigurationForm} + Name := 'ConfigurationForm'; + SetPosition(310, 157, 515, 439); + WindowTitle := 'Configuration'; + WindowPosition := wpOneThirdDown; + + PageControl1 := TfpgPageControl.Create(self); + with PageControl1 do + begin + Name := 'PageControl1'; + SetPosition(4, 4, 506, 388); + Anchors := [anLeft,anRight,anTop,anBottom]; + ActivePageIndex := 0; + TabOrder := 0; + OnChange := @PageControl1Change; + end; + + btnSave := TfpgButton.Create(self); + with btnSave do + begin + Name := 'btnSave'; + SetPosition(344, 408, 80, 24); + Text := 'Save'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnSaveClick; + end; + + btnCancel := TfpgButton.Create(self); + with btnCancel do + begin + Name := 'btnCancel'; + SetPosition(428, 408, 80, 24); + Text := 'Cancel'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @btnCancelClick; + end; + + tsGeneral := TfpgTabSheet.Create(PageControl1); + with tsGeneral do + begin + Name := 'tsGeneral'; + SetPosition(3, 24, 500, 361); + Text := 'General'; + end; + + tsFontsColor := TfpgTabSheet.Create(PageControl1); + with tsFontsColor do + begin + Name := 'tsFontsColor'; + SetPosition(3, 24, 500, 361); + Text := 'Fonts & Color'; + end; + + Label1 := TfpgLabel.Create(tsFontsColor); + with Label1 do + begin + Name := 'Label1'; + SetPosition(12, 20, 108, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Normal Font'; + end; + + edtNormalFont := TfpgEdit.Create(tsFontsColor); + with edtNormalFont do + begin + Name := 'edtNormalFont'; + SetPosition(124, 16, 248, 24); + Anchors := [anLeft,anRight,anTop]; + TabOrder := 1; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnNormalFont := TfpgButton.Create(tsFontsColor); + with btnNormalFont do + begin + Name := 'btnNormalFont'; + SetPosition(384, 16, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Select...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick := @btnNormalFontClicked; + end; + + Label2 := TfpgLabel.Create(tsFontsColor); + with Label2 do + begin + Name := 'Label2'; + SetPosition(12, 52, 104, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Fixed Font'; + end; + + edtFixedFont := TfpgEdit.Create(tsFontsColor); + with edtFixedFont do + begin + Name := 'edtFixedFont'; + SetPosition(124, 48, 248, 24); + Anchors := [anLeft,anRight,anTop]; + TabOrder := 4; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnFixedFont := TfpgButton.Create(tsFontsColor); + with btnFixedFont do + begin + Name := 'btnFixedFont'; + SetPosition(384, 48, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Select...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + OnClick :=@btnFixedFontClicked; + end; + + btnHelp := TfpgButton.Create(self); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(468, 356, 28, 24); + Anchors := [anRight,anBottom]; + Text := '?'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 6; + HelpType := htContext; + OnClick := @btnHelpClick; + end; + + Panel1 := TfpgPanel.Create(tsFontsColor); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(128, 116, 204, 28); + FontDesc := '#Label1'; + Style := bsLowered; + Text := 'Panel'; + end; + + cbIndexStyle := TfpgComboBox.Create(tsGeneral); + with cbIndexStyle do + begin + Name := 'cbIndexStyle'; + SetPosition(12, 32, 160, 22); + FontDesc := '#List'; + Items.Add('Alphabetical'); + Items.Add('FileOnly'); + Items.Add('Full'); + TabOrder := 0; + end; + + lblIndexStyle := TfpgLabel.Create(tsGeneral); + with lblIndexStyle do + begin + Name := 'lblIndexStyle'; + SetPosition(12, 12, 212, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Index style'; + end; + + lblSearchDirs := TfpgLabel.Create(tsGeneral); + with lblSearchDirs do + begin + Name := 'lblSearchDirs'; + SetPosition(12, 64, 216, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Search directories'; + end; + + btnSearchDirAdd := TfpgButton.Create(tsGeneral); + with btnSearchDirAdd do + begin + Name := 'btnSearchDirAdd'; + SetPosition(408, 84, 80, 24); + Text := 'Add...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick :=@btnSearchDirAddClicked; + end; + + lbSearchDirs := TfpgListBox.Create(tsGeneral); + with lbSearchDirs do + begin + Name := 'lbSearchDirs'; + SetPosition(12, 84, 388, 148); + FontDesc := '#List'; + HotTrack := False; + PopupFrame := False; + TabOrder := 5; + Items.Duplicates := dupIgnore; + end; + + btnSearchDirDelete := TfpgButton.Create(tsGeneral); + with btnSearchDirDelete do + begin + Name := 'btnSearchDirDelete'; + SetPosition(408, 116, 80, 24); + Text := 'Remove...'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + end; + + chkEscapeIPFSymbols := TfpgCheckBox.Create(tsGeneral); + with chkEscapeIPFSymbols do + begin + Name := 'chkEscapeIPFSymbols'; + SetPosition(12, 244, 480, 20); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#Label1'; + TabOrder := 6; + Text := 'Escape symbols when saving topics as IPF text'; + end; + + {@VFD_BODY_END: ConfigurationForm} + {%endregion} +end; + + +end. diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas new file mode 100644 index 00000000..3e24c320 --- /dev/null +++ b/docview/src/frm_main.pas @@ -0,0 +1,2753 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_tab, + fpg_tree, fpg_splitter, fpg_menu, fpg_button, fpg_listbox, + fpg_label, fpg_edit, fpg_radiobutton, fpg_progressbar, fpg_imagelist, + fpg_imgfmt_bmp, + HelpFile, RichTextView, HelpTopic; + +type + // Used by Index ListBox. We can generate a custom Index if the help file + // doesn't contain it's own index entries. + TListType = ( ltContents, ltIndex ); + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + bvlStatusBar: TfpgBevel; + ProgressBar: TfpgProgressBar; + lblStatus: TfpgLabel; + bvlBody: TfpgBevel; + PageControl1: TfpgPageControl; + tsContents: TfpgTabSheet; + tvContents: TfpgTreeView; + btnGo: TfpgButton; + tsIndex: TfpgTabSheet; + btnIndex: TfpgButton; + lbIndex: TfpgListBox; + IndexSearchEdit: TfpgEdit; + tsSearch: TfpgTabSheet; + Label1: TfpgLabel; + edSearchText: TfpgEdit; + Label2: TfpgLabel; + RadioButton1: TfpgRadioButton; + RadioButton2: TfpgRadioButton; + RadioButton3: TfpgRadioButton; + RadioButton4: TfpgRadioButton; + RadioButton5: TfpgRadioButton; + RadioButton6: TfpgRadioButton; + lbSearchResults: TfpgListBox; + Label3: TfpgLabel; + btnSearch: TfpgButton; + tsNotes: TfpgTabSheet; + ListBox1: TfpgListBox; + btnNotesAdd: TfpgButton; + btnNotesEdit: TfpgButton; + btnNotesDel: TfpgButton; + btnNotesGoto: TfpgButton; + tsHistory: TfpgTabSheet; + lbHistory: TfpgListBox; + Splitter1: TfpgSplitter; + RichView: TRichTextView; + MainMenu: TfpgMenuBar; + miFile: TfpgPopupMenu; + miSettings: TfpgPopupMenu; + miBookmarks: TfpgPopupMenu; + miHelp: TfpgPopupMenu; + miDebug: TfpgPopupMenu; + ToolBar: TfpgBevel; + btnOpen: TfpgButton; + btnBack: TfpgButton; + btnFwd: TfpgButton; + btnPrev: TfpgButton; + btnNext: TfpgButton; + btnHelp: TfpgButton; + btnQuit: TfpgButton; + Bevel1: TfpgBevel; + Bevel2: TfpgBevel; + {@VFD_HEAD_END: MainForm} + miOpenRecentMenu: TfpgPopupMenu; + miDebugHexInfo: TfpgMenuItem; +// Files: TList; // current open help files. + Debug: boolean; + FFileOpenRecent: TfpgMenuItem; + FHistorySelection: Boolean; + FImages: TfpgImageList; + + LoadingFilenameList: TStringList; + LoadingFileIndex: integer; + LoadingTotalSize: longint; + LoadingSizeSoFar: longint; + AllFilesWordSequences: TList; // of lists; one per open file; of possible word sequences + CurrentOpenFiles: TList; // current open help files. + MainTitle: string; + InIndexSearch: boolean; // true while searching index + IndexLoaded: boolean; + ContentsLoaded: boolean; + DisplayedIndex: TStringList; // duplicate of index listbox, for fast case insensitive searching + CurrentTopic: TTopic; // so we can get easy access to current topic viewed + CurrentHistoryIndex: integer; + + procedure btnBackHistClick(Sender: TObject); + procedure btnFwdHistClick(Sender: TObject); + procedure btnPrevClick(Sender: TObject); + procedure btnNextClick(Sender: TObject); + procedure RichViewClickLink(Sender: TRichTextView; Link: string); + procedure IndexSearchEditKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure MainFormShow(Sender: TObject); + procedure MainFormDestroy(Sender: TObject); + procedure miFileQuitClicked(Sender: TObject); + procedure miFileOpenClicked(Sender: TObject); + procedure miFileOpenSpecialClicked(Sender: TObject); + procedure miFileCloseClicked(Sender: TObject); + procedure miConfigureClicked(Sender: TObject); + procedure miHelpProdInfoClicked(Sender: TObject); + procedure miHelpAboutFPGui(Sender: TObject); + procedure miHelpCmdLineParams(Sender: TObject); + procedure miDebugHeader(Sender: TObject); + procedure miDebugHex(Sender: TObject); + procedure miFileSaveTopicAsIPF(Sender: TObject); + procedure OnMRUMenuItemClick(Sender: TObject); + procedure btnShowIndex(Sender: TObject); + procedure btnGoClicked(Sender: TObject); + procedure tvContentsChange(Sender: TObject); + procedure edSearchTextKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure lbSearchResultsKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure MainFormException(Sender: TObject; E: Exception); + procedure MainFormCloseQuery(Sender: TObject; var CanClose: boolean); + procedure PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabSheet); + procedure tvContentsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbIndexDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbIndexKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure lbSearchResultsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbHistoryDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure lbHistoryKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure btnSearchClicked(Sender: TObject); + procedure IndexSearchEditOnChange(Sender: TObject); + procedure DisplaySelectedSearchResultTopic; + procedure NavigateToHistoryIndex(AIndex: integer); + procedure UpdateLocationPanel; + procedure EnableControls; + procedure ClearAllWordSequences; + procedure DoSearch; + procedure SetWaitCursor; + procedure ClearWaitCursor; + procedure SetMainCaption; + procedure DisplayFiles(NewFiles: TList; var FirstContentsNode: TfpgTreeNode); + procedure FileOpen; + function LoadFiles(const aFileNames: TStrings; aHelpFiles: TList): boolean; + function OpenFiles(const FileNames: TStrings; const AWindowTitle: string; const DisplayFirstTopic: boolean): boolean; + function OpenFile(const AFileName: string; const AWindowTitle: string; const DisplayFirstTopic: boolean): boolean; + procedure CloseFile(const ADestroying: boolean = False); + procedure OnHelpFileLoadProgress(n, outof: integer; AMessage: string); + procedure LoadNotes(AHelpFile: THelpFile); + procedure LoadContents(AFiles: TList; var FirstNode: TfpgTreeNode); + procedure LoadIndex; + // Used in loading contents + procedure AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; ALevel: longint; var ATopicIndex: longint ); + procedure ClearNotes; + procedure ClearIndexComponents; + procedure SaveNotes(AHelpFile: THelpFile); + procedure DisplayTopic(ATopic: TTopic = nil); + procedure ResetProgress; + procedure SetStatus(const AText: TfpgString); + function TranslateEnvironmentVar(AFilenames: TfpgString): TfpgString; + procedure RefreshFontSubstitutions; + procedure DisplaySelectedContentsTopic; + procedure DisplaySelectedIndexTopic; + procedure ProcessCommandLineParams; + procedure SaveNavigatePoint; + procedure ShowCmdLineParamHelp; + function FindTopicForLink( Link: THelpLink ): TTopic; + function FindTopicByResourceID( ID: word ): TTopic; + function FindTopicByName(const AName: string): TTopic; + procedure AddCurrentToMRUFiles; + procedure CreateMRUMenuItems; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + +implementation + +uses + fpg_dialogs + ,fpg_constants + ,fpg_iniutils + ,fpg_cmdlineparams + ,fpg_utils + ,fpg_stringutils + ,nvUtilities + ,ACLStringUtility + ,TextSearchQuery + ,SearchUnit + ,dvconstants + ,IPFFileFormatUnit + ,SettingsUnit + ,dvHelpers + ,frm_configuration + ; + +const + cLongName = 'fpGUI Documentation Viewer'; + cCreatedBy = 'Created by Graeme Geldenhuys'; + cVersion = 'Version ' + FPGUI_VERSION; + +{$I arrows.inc} +{$I missing.inc} + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.MainFormException(Sender: TObject; E: Exception); +begin + TfpgMessageDialog.Critical('An unexpected error occurred.', E.Message); +end; + +procedure TMainForm.lbIndexKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + DisplayTopic(nil); + end +end; + +procedure TMainForm.btnBackHistClick(Sender: TObject); +begin + if CurrentHistoryIndex > 0 then + begin + NavigateToHistoryIndex(CurrentHistoryIndex - 1); + //lbHistory.FocusItem := CurrentHistoryIndex - 1; + //DisplayTopic(TTopic(lbHistory.Items.Objects[lbHistory.FocusItem])); + end; +end; + +procedure TMainForm.btnFwdHistClick(Sender: TObject); +begin + if CurrentHistoryIndex < lbHistory.Items.Count-1 then + begin + NavigateToHistoryIndex(CurrentHistoryIndex + 1); + //lbHistory.FocusItem := CurrentHistoryIndex + 1; + //DisplayTopic(TTopic(lbHistory.Items.Objects[lbHistory.FocusItem])); + end; +end; + +procedure TMainForm.btnPrevClick(Sender: TObject); +begin + if CurrentOpenFiles.Count > 0 then + begin + tvContents.GotoNextNodeUp; + tvContents.SetFocus; + DisplaySelectedContentsTopic; + end; +end; + +procedure TMainForm.btnNextClick(Sender: TObject); +begin + if CurrentOpenFiles.Count > 0 then + begin + tvContents.GotoNextNodeDown; + tvContents.SetFocus; + DisplaySelectedContentsTopic; + end; +end; + +procedure TMainForm.RichViewClickLink(Sender: TRichTextView; Link: string); +var + LinkIndex: integer; + lLink: THelpLink; + lHelp: THelpFile; + i: integer; + lTopic: TTopic; + lFound: Boolean; + lURL: TfpgString; +begin + // TODO: process other types of links (external, application etc...) too! + if pos('external', Link) > 0 then + begin + TfpgMessageDialog.Warning('', 'External links are not supported in DocView yet. Please try again with a later build.') + end + else if pos('url', Link) > 0 then + begin + // we have a external URL of some kind + // format is always: 'url "<uri>"' +// ShowMessage('Found an external Link' + LineEnding + Link); + lURL := StringReplace(Link, 'url "', '', []); + lURL := UTF8Copy(lURL, 0, UTF8Length(lURL)-1); + fpgOpenURL(lURL); + end + else + begin + // we have a internal INF file link + LinkIndex := StrToInt( Link ); + lLink := THelpLink(CurrentTopic.Links[LinkIndex]); + lTopic := FindTopicForLink(lLink); + if lTopic <> nil then + DisplayTopic(lTopic); + exit; + + lHelp := THelpFile(lLink.HelpFile); + lTopic := nil; + lFound := False; + for i := 0 to CurrentOpenFiles.Count-1 do + begin + lHelp := THelpFile(CurrentOpenFiles[i]); + lTopic := lHelp.Topics[LinkIndex]; + if lTopic <> nil then + begin + lFound := True; +// writeln('Found Topic! ', lTopic.Title); + break; + end; + if lFound then + break; + end; + if lTopic <> nil then + begin +// writeln('Displaying topic <', lTopic.Title, '>'); + DisplayTopic(lTopic); + end; + end; +end; + +procedure TMainForm.IndexSearchEditKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + if (KeyCode = keyEnter) or (KeyCode = keyPEnter) then + begin + Consumed := True; + DisplaySelectedIndexTopic; + end; +end; + +procedure TMainForm.MainFormShow(Sender: TObject); +begin + bvlBody.Realign; + + // restore previous window position and size + gINI.ReadFormState(self); + PageControl1.Width := gINI.ReadInteger('Options', 'SplitterLeft', 260); + UpdateWindowPosition; + + Settings.NormalFont := fpgStyle.DefaultFont; + Settings.FixedFont := fpgStyle.FixedFont; + Settings.SearchDirectories := TStringList.Create; + + LogEvent(LogSettings, 'Loading settings'); + LoadSettings; + CreateMRUMenuItems; + ProcessCommandLineParams; + + RichView.Images := FImages; +end; + +procedure TMainForm.MainFormDestroy(Sender: TObject); +begin + ClearAllWordSequences; + DisplayedIndex.Free; + // save splitter position + gINI.WriteInteger('Options', 'SplitterLeft', PageControl1.Width); + // save form size and position + gINI.WriteFormState(self); + LogEvent(LogSettings, 'Save settings'); + SaveSettings; + LogEvent(LogSettings, 'Save settings done'); +end; + +procedure TMainForm.miFileQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miFileOpenClicked(Sender: TObject); +begin + FileOpen; +end; + +procedure TMainForm.miFileOpenSpecialClicked(Sender: TObject); +var + s: TfpgString; +begin + if fpgInputQuery('Open Special...', 'Enter environment variable to open', s) then + begin + if s <> '' then + OpenFile(s, '', True); + end; +end; + +procedure TMainForm.miFileCloseClicked(Sender: TObject); +begin + CloseFile; +end; + +procedure TMainForm.miConfigureClicked(Sender: TObject); +begin + ShowConfigForm; +end; + +procedure TMainForm.miHelpProdInfoClicked(Sender: TObject); +var + s: TfpgString; +begin + s := cLongName + LineEnding + LineEnding + + cCreatedBy + LineEnding + + cVersion + ' - '+ {$I %date%} + ' ' + {$I %time%}; + + TfpgMessageDialog.Information('Product Information', s); +end; + +procedure TMainForm.miHelpAboutFPGui(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui; +end; + +procedure TMainForm.miHelpCmdLineParams(Sender: TObject); +begin + CloseFile(False); + ShowCmdLineParamHelp; +end; + +procedure TMainForm.miDebugHeader(Sender: TObject); +var + f: THelpFile; + i: integer; + sl: TStringList; +begin + RichView.Clear; + sl := TStringList.Create; + RichView.AddText(PChar('FileCount = ' + IntToStr(CurrentOpenFiles.Count))); + for i := 0 to CurrentOpenFiles.Count-1 do + begin + f := THelpFile(CurrentOpenFiles[i]); + sl.Clear; + with sl do + begin + Add('<b><u>Filename:</u></b> <red>' + f.Filename + '<black>'); + Add(''); + Add('<b>Title:</b> ' + f.Title); + Add('<b>Dictionary count:</b> ' + IntToStr(f.DictionaryCount)); + Add('<b>Topic count:</b> ' + IntToStr(f.TopicCount)); + Add('<b>Index count:</b> ' + IntToStr(f.Index.Count)); + Add('<b>String resource id count:</b> ' + IntToStr(f.StringResourceIDCount)); + Add('<b>Numeric resource id count:</b> ' + IntToStr(f.NumericResourceIDCount)); + Add(' '); + //Add('Dictionary contents:'); + //for i := 0 to f.DictionaryCount-1 do + // Add('[' + IntToStr(i) + '] = <' + f.DictionaryWords[i] + '>'); + end; + RichView.AddParagraph(PChar(sl.Text)); + end; + sl.Free; +end; + +procedure TMainForm.miDebugHex(Sender: TObject); +begin + Debug := not Debug; + miDebugHexInfo.Checked := Debug; + DisplayTopic(nil); +end; + +procedure TMainForm.miFileSaveTopicAsIPF(Sender: TObject); +var + F: TextFile; + T: TTopic; + dlg: TfpgFileDialog; + H: THelpFile; + i: integer; + filename: string; + imglist: TList; +begin +(* + H := THelpFile(CurrentOpenFiles[0]); + + FileName := ChangeFileExt( ExtractFileName( H.Filename ), '.ipf' ); + if not DoSaveFileDialog( FileSaveTitle, + 'IPF' + '|*.ipf', + Filename, + Settings.LastSaveDirectory, + Filename ) then + exit; + if FileExists( Filename ) then + if not DoConfirmDlg( FileSaveTitle, + ReplaceFilePromptA + + Filename + + ReplaceFilePromptB ) then + exit; + + ImageOffsets := TList.Create; + + AssignFile( F, FileName ); + Rewrite( F ); + WriteLn( F, ':userdoc.' ); + + // We can't tell if some levels of the contents were + // merged into the text of topics. So we just assume all are visible + WriteLn( F, ':docprof toc=123456.' ); + + ResourceIDs := TList.Create; + + WriteLn( F, ':title.' + H.Title ); + + for i := 0 to H.TopicCount - 1 do + begin + T := H.Topics[ i ]; + + SetProgress( i div 2, H.TopicCount , 'Saving text...' ); + + WriteLn( F, '' ); + + + if T.ContentsLevel = 0 then + begin + // perhaps it means footnote? + // Level := 1; + Write( F, ':fn id=fn' + IntToStr( i ) + '.' ); // use index as id + + T.SaveToIPF( F, ImageOffsets ); + + WriteLn( F, '' ); + WriteLn( F, ':efn.' ); + end + else + begin + Write( F, ':h' + IntToStr( T.ContentsLevel ) ); + Write( F, ' id=' + IntToStr( i ) ); // use index as id + + H.FindResourceIDsForTopic( T, ResourceIDs ); + if ResourceIDs.Count > 0 then + begin + Write( F, ' res=' + IntToStr( longint( ResourceIDs[ 0 ] ) ) ); + end; + + if not T.ShowInContents then + Write( F, ' hide' ); + + if T.ContentsGroupIndex > 0 then + Write( F, ' group=' + IntToStr( T.ContentsGroupIndex ) ); + + Write( F, '.' ); // end of header + WriteLn( F, T.Title ); + + T.SaveToIPF( F, ImageOffsets ); + end; + + + + end; + + ResourceIDs.Destroy; + + WriteLn( F, ':euserdoc.' ); + System.Close( F ); + + // Now write images + + for i := 0 to ImageOffsets.Count - 1 do + begin + ImageOffset := longint( ImageOffsets[ i ] ); + + SetProgress( i div 2 + ImageOffsets.Count div 2, + ImageOffsets.Count , + 'Saving images...' ); + + Image := H.GetImage( ImageOffset ); + + if Image <> nil then + begin + Image.SaveToFile( ExtractFilePath( Filename ) + + 'img' + + IntToStr( i ) + + '.bmp' ); + Image.Destroy; + end; + + end; + + ResetProgress; + SetStatus( 'Save complete' ); + ImageOffsets.Destroy; +*) + + + + //----------------------------- + if tvContents.Selection = nil then + Exit; //--> + + T := TTopic(tvContents.Selection.Data); + if T <> nil then + begin + dlg := TfpgFileDialog.Create(nil); + try + dlg.FileName := T.Title + '.ipf'; + if dlg.RunSaveFile then + begin + imglist := TList.Create; + AssignFile( F, dlg.FileName ); + Rewrite( F ); + T.SaveToIPF(F, imglist); + System.Close(F); + imglist.free; + dlg.Close; + dlg.Free; + end; + finally + end; + end; +end; + +procedure TMainForm.OnMRUMenuItemClick(Sender: TObject); +var + lTag: longint; + MenuItem: TfpgMenuItem; + MRUItem: TMRUItem; +begin + MenuItem := Sender as TfpgMenuItem; + lTag := MenuItem.Tag; + MRUItem := TMRUItem(Settings.MRUList[ lTag ]); + OpenFiles(MRUItem.FileNames, '', True); +end; + +procedure TMainForm.btnShowIndex(Sender: TObject); +begin + DisplaySelectedIndexTopic; +end; + +procedure TMainForm.btnGoClicked(Sender: TObject); +begin + if tvContents.Selection <> nil then + DisplayTopic(nil); +end; + +procedure TMainForm.tvContentsChange(Sender: TObject); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + DisplayTopic(nil); +end; + +procedure TMainForm.edSearchTextKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + btnSearch.Click; + end + else if (KeyCode = keyDown) then + begin + Consumed := True; + lbSearchResults.SetFocus; + end; +end; + +procedure TMainForm.lbSearchResultsKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + DisplayTopic(nil); + end +end; + +procedure TMainForm.MainFormCloseQuery(Sender: TObject; var CanClose: boolean); +begin + CloseFile(True); +end; + +procedure TMainForm.PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabSheet); +begin + if NewActiveSheet = tsIndex then + begin + if not IndexLoaded then + LoadIndex; + IndexSearchEdit.SetFocus; + end + else if NewActiveSheet = tsHistory then + lbHistory.FocusItem := CurrentHistoryIndex; +end; + +procedure TMainForm.tvContentsDoubleClick(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + if tvContents.Selection <> nil then + DisplayTopic(nil); +end; + +procedure TMainForm.lbIndexDoubleClick(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + InIndexSearch := True; // prevent edit.OnChange from executing too + try + IndexSearchEdit.Text := lbIndex.Items[lbIndex.FocusItem]; + DisplayTopic(nil); + finally + InIndexSearch := False; + end; +end; + +procedure TMainForm.lbSearchResultsDoubleClick(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + DisplaySelectedSearchResultTopic; +end; + +procedure TMainForm.lbHistoryDoubleClick(Sender: TObject; + AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); +begin + try + FHistorySelection := True; + DisplayTopic(nil); + CurrentHistoryIndex := lbHistory.FocusItem; + finally + FHistorySelection := False; + end; +end; + +procedure TMainForm.lbHistoryKeyPress(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then + begin + Consumed := True; + try + FHistorySelection := True; + DisplayTopic(nil); + CurrentHistoryIndex := lbHistory.FocusItem; + finally + FHistorySelection := False; + end; + end +end; + +procedure TMainForm.btnSearchClicked(Sender: TObject); +begin + DoSearch; +end; + +procedure TMainForm.IndexSearchEditOnChange(Sender: TObject); +var + tmpMatchIndex: longint; + tmpSearchText: string; + i: longint; +begin + if InIndexSearch then + exit; + + tmpMatchIndex := -1; + tmpSearchText := trim(IndexSearchEdit.Text); + + for i := 0 to DisplayedIndex.Count - 1 do + begin + if StrStartsWithIgnoringCase(DisplayedIndex[i], tmpSearchText) then + begin + tmpMatchIndex := i; + break; + end; + end; + + if tmpMatchIndex = -1 then + exit; + + InIndexSearch:= true; + + + if lbIndex.FocusItem <> tmpMatchIndex then + lbIndex.FocusItem := tmpMatchIndex; + + InIndexSearch:= false; +end; + +procedure TMainForm.DisplaySelectedSearchResultTopic; +var + Topic: TTopic; +begin + if lbSearchResults.FocusItem = -1 then + exit; + if lbSearchResults.Items.Objects[lbSearchResults.FocusItem] = nil then + // the "no results" place holder + exit; + Topic := lbSearchResults.Items.Objects[lbSearchResults.FocusItem] as TTopic; + DisplayTopic( Topic ); +end; + +procedure TMainForm.NavigateToHistoryIndex(AIndex: integer); +begin + try + FHistorySelection := True; + CurrentHistoryIndex := AIndex; + lbHistory.FocusItem := AIndex; + DisplayTopic(TTopic(lbHistory.Items.Objects[AIndex])); + finally + FHistorySelection := False; + end; +end; + +procedure TMainForm.UpdateLocationPanel; +var + i: integer; + s: string; + n: TfpgTreeNode; + sep: string; +begin + s := ''; + sep := ''; + n := tvContents.Selection; + while n.Parent <> nil do + begin + s := n.Parent.Text + sep + s; + n := n.Parent; + sep := ' > '; + end; + SetStatus(s); +end; + +procedure TMainForm.EnableControls; +begin + // +end; + +procedure TMainForm.ClearAllWordSequences; +var + i: longint; + FileWordSequences: TList; + HelpFile: THelpFile; +begin + if AllFilesWordSequences = nil then + exit; + + for i := 0 to AllFilesWordSequences.Count - 1 do + begin + FileWordSequences := TList(AllFilesWordSequences[ i ]); + HelpFile := THelpFile(CurrentOpenFiles[ i ]); + ClearWordSequences( FileWordSequences, HelpFile.DictionaryCount ); + FileWordSequences.Free; + end; + AllFilesWordSequences.Clear; +end; + +procedure TMainForm.DoSearch; +var + SearchResults: TList; + SearchText: string; + FileIndex: longint; + HelpFile: THelpFile; + TopicIndex: longint; + Topic: TTopic; + FileWordSequences: TList; + Query: TTextSearchQuery; +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + SearchText := Trim(edSearchText.Text); + lbSearchResults.Items.Clear; + + if SearchText = '' then + exit; + + lbSearchResults.Items.Add(rsDVSearchingMsg); + SetStatus(rsDVSearchingMsg); + + try + Query := TTextSearchQuery.Create( SearchText ); + except + on e: ESearchSyntaxError do + begin + TfpgMessageDialog.Critical( rsSearch, rsDVSearchSyntaxError + e.Message ); + exit; + end; + end; + + ClearAllWordSequences; + + SetWaitCursor; + + SearchResults := TList.Create; + + // Search open help file + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + HelpFile := THelpFile(CurrentOpenFiles[ FileIndex ]); + FileWordSequences := TList.Create; + try + SearchHelpFile( HelpFile, + Query, + SearchResults, + FileWordSequences ); + except + on E: EHelpFileException do + begin + TfpgMessageDialog.Critical(rsError , E.Message); + Query.Destroy; + ClearWaitCursor; + exit; + end; + end; + + AllFilesWordSequences.Add( FileWordSequences ); + end; + + // Sort results across all files by relevance + SearchResults.Sort( @TopicRelevanceCompare ); + + // Load topics into search results list. + lbSearchResults.Items.BeginUpdate; + lbSearchResults.Items.Clear; + + for TopicIndex := 0 to SearchResults.Count - 1 do + begin + Topic := TTopic(SearchResults[ TopicIndex ]); + lbSearchResults.Items.AddObject( Topic.Title + + ' [' + + IntToStr( Topic.SearchRelevance ) + + ']', + Topic ); + end; + + EnableControls; +// if lbSearchResults.Items.Count > 0 then + // there are some search matches, so highlight words +// ViewHighlightSearchWordsMI.Checked := true; + + lbSearchResults.FocusItem := -1; + lbSearchResults.Items.EndUpdate; + + Query.Free; + SearchResults.Free; + + if lbSearchResults.Items.Count > 0 then + begin + lbSearchResults.FocusItem := 0; + end + else + begin + lbSearchResults.Items.Add( Format(rsDVNoMatchesFound, [SearchText])); +// RefreshWindows( Windows ); // update to remove old highlights + end; + SetStatus( Format(rsDVSearchFoundMsg, [lbSearchResults.Items.Count]) + + StrInDoubleQuotes(SearchText)); + + ClearWaitCursor; + DisplaySelectedSearchResultTopic; +end; + +procedure TMainForm.SetWaitCursor; +begin + // +end; + +procedure TMainForm.ClearWaitCursor; +begin + // +end; + +procedure TMainForm.SetMainCaption; +begin + WindowTitle:= MainTitle; + fpgApplication.ProcessMessages; +end; + +procedure TMainForm.DisplayFiles(NewFiles: TList; var FirstContentsNode: TfpgTreeNode); +var + HelpFile: THelpFile; + FileIndex: longint; +begin + LogEvent(LogStartup, 'DisplayFiles' ); + // Now load the various parts of the file(s) + // into the user interface + ProgressBar.Position := 52; + SetStatus( rsDVDisplaying ); + + // Add our open files in the global filelist + { TODO -ograeme : implement global filelist support } + //for FileIndex := 0 to NewFiles.Count - 1 do + //begin + // HelpFile := NewFiles[ FileIndex ]; + // GlobalFilelist.AddFile( HelpFile.Filename, Frame.Handle ); + // // LoadNotes( HelpFile ); + // LoadBookmarks( HelpFile ); + //end; + + { TODO -ograeme : update notes display } + //UpdateNotesDisplay; + + { TODO -ograeme : bookmarks } + //BuildBookmarksMenu; + //UpdateBookmarksForm; + + ProgressBar.Position := 55; + + ContentsLoaded := false; + IndexLoaded := false; + + LoadContents( NewFiles, FirstContentsNode ); + + ProgressBar.Position := 75; + + LoadIndex; + + ProgressBar.Position := 100; + SetStatus( rsDVDone ); + + LogEvent(LogStartup, 'DisplayFiles Done' ); +end; + +procedure TMainForm.FileOpen; +var + dlg: TfpgFileDialog; +begin + dlg := TfpgFileDialog.Create(nil); + try + dlg.InitialDir := Settings.LastOpenDirectory; + dlg.WindowTitle := rsDVOpenHelpFile; + dlg.Filter := rsDVHelpFiles + ' (*.hlp, *.inf)|*.inf;*.hlp '; + // and a catch all filter + dlg.Filter := dlg.Filter + '|(' + rsAllFiles + ' (*)|*'; + + if dlg.RunOpenFile then + begin + Settings.LastOpenDirectory := ExtractFilePath(dlg.Filename); + OpenFile(dlg.Filename, '', true); + end; + { TODO -oGraeme : Add support for multiple files. } + finally + dlg.Free; + end; +end; + +function TMainForm.LoadFiles(const aFileNames: TStrings; aHelpFiles: TList): boolean; +var + HelpFile: THelpFile; + FileIndex, i: longint; + FileName: string; + FullFilePath: string; +begin + LogEvent(LogStartup, 'LoadFiles' ); + LoadingFilenameList := TStringList.Create; + +// RBRi TranslateIPFEnvironmentVars( FileNames, LoadingFilenameList ); + for i := 0 to aFileNames.Count - 1 do + LoadingFilenameList.Add(aFileNames[i]); + + LogEvent(LogStartup, 'Finding files' ); + ProgressBar.Visible := True; + + // now find full file paths, + // and also the total file size for progress display + for FileIndex := 0 to LoadingFilenameList.Count - 1 do + begin + FileName := LoadingFilenameList[ FileIndex ]; + LogEvent(LogStartup, ' File: ' + FileName ); + + // Find the help file, if possible + if Filename = OWN_HELP_MARKER then + begin + FullFilePath := GetOwnHelpFileName; + end + else + begin + FullFilePath := FindHelpFile( Filename ); + end; + + if FullFilePath <> '' then + begin + LogEvent(LogStartup, ' Full path: ' + FullFilePath ); + end + else + begin + LogEvent(LogStartup, ' File not found' ); + FullFilePath := FileName; // we'll complain later. + end; + LoadingFilenameList[ FileIndex ] := FullFilePath; + end; + + // Now actually load the files + for FileIndex := 0 to LoadingFilenameList.Count - 1 do + begin + Filename := LoadingFilenameList[ FileIndex ]; + LogEvent(LogStartup, ' Loading: ' + Filename ); + try + LoadingFileIndex := FileIndex; + + // load the file + HelpFile := THelpFile.Create( FileName ); + if Settings.FixedFontSubstitution then + HelpFile.SetupFontSubstitutes( Settings.FixedFontSubstitutes ); + + aHelpFiles.Add( HelpFile ); + + except + on E: Exception do + begin + + if E is EWindowsHelpFormatException then + begin + { TODO -ograeme -cnice to have : Implement opening Windows help } + //OpenWindowsHelp( Filename ); + end + else + begin + TfpgMessageDialog.Critical( rsDVOpenHelpFile, + Format(rsDVCouldNotOpen, [Filename]) + + ': ' + + E.Message ); + end; + + // back out of the load process + Result := false; + + DestroyListObjects( aHelpFiles ); + + LoadingFilenameList.Free; + ResetProgress; + exit; + end + end; + end; + + LoadingFilenameList.Free; + Result := true; +end; + +{ Open the file or list of files in FileNames + Set the window title if given, otherwise get it from first file } +function TMainForm.OpenFiles(const FileNames: TStrings; + const AWindowTitle: string; const DisplayFirstTopic: boolean): boolean; +var + tmpHelpFiles: TList; + FirstContentsNode: TfpgTreeNode; +begin + LogEvent(LogStartup, 'OpenFiles' ); + + //if not OKToCloseFile then + // exit; + + SetWaitCursor; + tmpHelpFiles := TList.Create; + + if not LoadFiles(FileNames, tmpHelpFiles) then + begin + ClearWaitCursor; + tmpHelpFiles.Free; + exit; + end; + + Result := true; + + lbSearchResults.Items.Clear; + lbHistory.Items.Clear; + CurrentHistoryIndex := -1; + + // Now that we have successfully loaded the new help file(s) + // close the existing one. + CloseFile; + + AssignList(tmpHelpFiles, CurrentOpenFiles ); + + ProgressBar.Position := 50; + SetStatus( rsDVDisplaying ); + + AddCurrentToMRUFiles; + + if AWindowTitle = '' then + MainTitle := THelpFile( CurrentOpenFiles[ 0 ] ).Title + else + MainTitle := AWindowTitle; + SetMainCaption; + + // Now load the various parts of the file(s) + // into the user interface + DisplayFiles( tmpHelpFiles, FirstContentsNode ); + + //if CmdLineParameters.getHelpManagerFlag then + // ShowLeftPanel := Settings.ShowLeftPanel_Help + //else + // ShowLeftPanel := Settings.ShowLeftPanel_Standalone; + + // Select first contents node if there is one + if FirstContentsNode <> nil then + begin + LogEvent(LogStartup, ' Select first node' ); + tvContents.Selection := FirstContentsNode; + tvContents.SetFocus; + end; + + ClearWaitCursor; + + ResetProgress; + +// NotebookOnPageChanged( self ); // ensure e.g. index loaded + + EnableControls; + + if DisplayFirstTopic then + begin + LogEvent(LogStartup, 'Display first topic' ); + DisplaySelectedContentsTopic; +// DisplayTopic(nil); + end; + + LogEvent(LogStartup, 'OpenFiles complete' ); +end; + +{ Open a single file } +function TMainForm.OpenFile(const AFileName: string; const AWindowTitle: string; + const DisplayFirstTopic: boolean): boolean; +var + tmpFileNames: TStringList; +begin + tmpFileNames := TStringList.Create; + ParseAndExpandFileNames(AFileName, tmpFileNames); + Result := OpenFiles( tmpFileNames, AWindowTitle, DisplayFirstTopic ); + tmpFileNames.Free; +end; + +procedure TMainForm.CloseFile(const ADestroying: boolean = False); +var + FileIndex: longint; + lHelpFile: THelpFile; +begin + tvContents.Selection := nil; + tvContents.RootNode.Clear; + + lbSearchResults.Items.Clear; + edSearchText.Clear; + lbHistory.Items.Clear; + + RichView.Clear(ADestroying); + if not ADestroying then + begin + WindowTitle := rsDVTitle + ' - ' + rsDVNoFile; + tvContents.Invalidate; + end; + + // First save notes. It's important we do this first + // since we scan all notes each time to find the ones + // belonging to this file. + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + lHelpFile := THelpFile(CurrentOpenFiles[FileIndex]); + SaveNotes( lHelpFile ); + end; + + ClearIndexComponents; + ClearAllWordSequences; + + // Now destroy help files + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + lHelpFile := THelpFile(CurrentOpenFiles[FileIndex]); + lHelpFile.Free; + end; + + CurrentOpenFiles.Clear; + ClearNotes; +end; + +procedure TMainForm.OnHelpFileLoadProgress(n, outof: integer; AMessage: string); +begin + // +end; + +procedure TMainForm.LoadNotes(AHelpFile: THelpFile); +begin +// NotesFileName:= ChangeFileExt( HelpFile.FileName, '.nte' ); + +end; + +procedure TMainForm.LoadContents(AFiles: TList; var FirstNode: TfpgTreeNode); +var + FileIndex: integer; + HelpFile: THelpFile; + TopicIndex: integer; + Node: TfpgTreeNode; + Topic: TTopic; +begin + LogEvent(LogStartup, 'Load contents outline'); + // we don't clear treeview here in case we need to load more files later. + LogEvent(LogStartup, 'Loop files'); + + FirstNode := nil; + Node := nil; + + for FileIndex:= 0 to AFiles.Count - 1 do + begin + HelpFile:= THelpFile(AFiles[ FileIndex ]); + ProfileEvent( 'File ' + IntToStr( FileIndex ) ); + TopicIndex:= 0; + ProfileEvent('TopicCount=' + IntToStr(HelpFile.TopicCount)); + while TopicIndex < HelpFile.TopicCount do + begin + Topic := HelpFile.Topics[ TopicIndex ]; + if Topic.ShowInContents then + begin + if Topic.ContentsLevel = 1 then + begin + Node := tvContents.RootNode.AppendText(Topic.Title); + Node.Data := Topic; + if FirstNode = nil then + FirstNode := Node; + inc( TopicIndex ); + end + else + begin + // child nodes + AddChildNodes( HelpFile, + Node, + Topic.ContentsLevel, + TopicIndex ); + Node := nil; + end; + end + else + begin + inc( TopicIndex ); + end; + end; + end; + LogEvent(LogStartup, ' EndUpdate' ); + + if Settings.OpenWithExpandedContents then + begin + LogEvent(LogStartup, ' Expand all contents' ); + tvContents.RootNode.Expand; + node := tvContents.RootNode.Next; + while node <> nil do + begin + node.Expand; + node := tvContents.RootNode.Next; + end; + end + else + begin + LogEvent(LogStartup, ' Expand first node' ); + // Contents has only one top level node... expand it + FirstNode.Expand; + end; + + ContentsLoaded := true; + tvContents.Invalidate; + LogEvent(LogStartup, ' Contents loaded' ); +end; + +// Gets the contents from each file. Sorts it alphabetically. +// Merges all the sorted contents and indexes together, alphabetically. +procedure TMainForm.LoadIndex; +var + tmpHelpFile: THelpFile; + tmpTextCompareResult: integer; + FileIndex: longint; + Contents: TList; + ContentsLists: TList; // of tlist + tmpIndexLists: TList; // of tstringlist + ContentsNextIndex: array[ 0..255 ] of longint; + IndexNextIndex: array[ 0..255 ] of longint; + Topic: TTopic; + ListEntry: string; + LowestEntry: string; + LastEntry: string; + tmpLowestEntryListIndex: longint; + tmpLowestEntryListType: TListType; + tmpLowestEntryTopic: TTopic; + tmpIndex: TStringList; + i: longint; +begin + if CurrentOpenFiles.Count = 0 then + Exit; + LogEvent(LogStartup, 'Create index' ); + SetWaitCursor; + LogEvent(LogStartup, ' Get/sort lists' ); + + ProgressBar.Position := 70; + SetStatus( 'Building index... ' ); + + ContentsLists := TList.Create; + tmpIndexLists := TList.Create; + + // collect the contents and index lists from the files + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + tmpHelpFile := THelpFile(CurrentOpenFiles[ FileIndex ]); + ProgressBar.Position := 70 + 10 * FileIndex div CurrentOpenFiles.Count; + + if Settings.IndexStyle in [ isAlphabetical, isFull ] then + begin + Contents := TList.Create; + Contents.Capacity := tmpHelpFile.TopicCount; // speeds up inserts + // copy [contents] topic list + for i := 0 to tmpHelpFile.TopicCount - 1 do + begin + Topic := tmpHelpFile.Topics[ i ]; + if Topic.ShowInContents then + Contents.Add( Topic ); + end; + // sort by title + Contents.Sort( @TopicTitleCompare ); + ContentsLists.Add( Contents ); + // initialise list index + ContentsNextIndex[ ContentsLists.Count - 1 ] := 0; + end; + + if Settings.IndexStyle in [ isFileOnly, isFull ] then + begin + tmpIndexLists.Add(tmpHelpFile.Index.GetLabels); + IndexNextIndex[ tmpIndexLists.Count - 1 ] := 0; + end; + end; + + // Unlike contents, we do clear the index (even if we are adding more files) + // because we need to re-merge the whole thing + DisplayedIndex.Clear; + ProgressBar.Position := 80; + + LogEvent(LogStartup, ' Merge lists' ); + LastEntry := ''; + while true do + begin + LowestEntry := ''; + tmpLowestEntryListIndex := -1; + // Find alphabetically lowest (remaining) topic + // first, look in contents lists + LogEvent(LogDebug, ' Merge contents' ); + for i := 0 to ContentsLists.Count - 1 do + begin + Contents := TList(ContentsLists.Items[i]); + if ContentsNextIndex[i] < Contents.Count then + begin + // list is not yet finished, get next entry + Topic := TTopic(Contents[ ContentsNextIndex[i] ]); + ListEntry := Topic.Title; + + if LowestEntry <> '' then + tmpTextCompareResult := CompareText( ListEntry, LowestEntry ) + else + tmpTextCompareResult := -1; + + if tmpTextCompareResult < 0 then + begin + // this index entry comes before the lowest one so far + LowestEntry := ListEntry; + tmpLowestEntryListIndex := i; + tmpLowestEntryListType := ltContents; + tmpLowestEntryTopic := Topic; + end; + end; + end; + + // look in indices + LogEvent(LogDebug, ' Merge indices' ); + for i := 0 to tmpIndexLists.Count - 1 do + begin + LogEvent(LogDebug, ' Merge indices ' + IntToStr(i) ); + tmpIndex := TStringList(tmpIndexLists.Items[i]); + if IndexNextIndex[i] < tmpIndex.Count then + begin + // list is not yet finished, get next entry + ListEntry := tmpIndex.Strings[ IndexNextIndex[i] ]; + LogEvent(LogDebug, ' indices ListEntry=' + ListEntry ); + if LowestEntry <> '' then + tmpTextCompareResult := CompareText( ListEntry, LowestEntry ) + else + tmpTextCompareResult := -1; + + if tmpTextCompareResult < 0 then + begin + // this index entry comes before the lowest one so far + LowestEntry := ListEntry; + tmpLowestEntryListIndex := i; + tmpLowestEntryListType := ltIndex; + + LogEvent(LogDebug, ' Merge indices ' + tmpIndex.Objects[ IndexNextIndex[i] ].ClassName); + tmpLowestEntryTopic := TIndexEntry( tmpIndex.Objects[ IndexNextIndex[i] ] ).getTopic; + end; + end; + end; + + if tmpLowestEntryListIndex = -1 then + // we're out + break; + + if LowestEntry <> LastEntry then + // add, if different from last + DisplayedIndex.AddObject( LowestEntry, tmpLowestEntryTopic ); + LastEntry := LowestEntry; + + if tmpLowestEntryListType = ltContents then + begin + inc( ContentsNextIndex[ tmpLowestEntryListIndex ] ); + end + else + begin + // found in one of indices. + // Check for subsequent indented strings + tmpIndex := TStringList(tmpIndexLists[ tmpLowestEntryListIndex ]); + + i := IndexNextIndex[ tmpLowestEntryListIndex ] + 1; + while i < tmpIndex.Count do + begin + ListEntry := tmpIndex.Strings[ i ]; + if ListEntry = '' then + break; + + if ListEntry[ 1 ] <> ' ' then + // not indented, stop looking + break; + + // found one, + Topic := TIndexEntry(tmpIndex.Objects[ i ]).getTopic; + DisplayedIndex.AddObject( ListEntry, Topic ); + inc( i ); + end; + IndexNextIndex[ tmpLowestEntryListIndex ] := i; + end; + end; + + ProgressBar.Position := 95; + LogEvent(LogStartup, ' Display index (count = ' + IntToStr(DisplayedIndex.Count) + ')'); + + // Now display the final index list + lbIndex.BeginUpdate; + lbIndex.Items.Assign( DisplayedIndex ); + lbIndex.EndUpdate; + + LogEvent(LogStartup, ' Tidy up' ); + tmpIndexLists.Free; + DestroyListAndObjects( ContentsLists ); + IndexLoaded := true; + + ClearWaitCursor; + + SetStatus( 'Index loaded' ); + LogEvent(LogStartup, ' Done' ); +end; + +procedure TMainForm.AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; + ALevel: longint; var ATopicIndex: longint); +var + Topic: TTopic; + Node: TfpgTreeNode; +begin + Node := nil; + while ATopicIndex < AHelpFile.TopicCount do + begin + Topic := AHelpFile.Topics[ ATopicIndex ]; + if Topic.ShowInContents then + begin + if Topic.ContentsLevel < ALevel then + break; + + if Topic.ContentsLevel = ALevel then + begin + Node := AParentNode.AppendText(Topic.Title); + Node.Data := Topic; + inc( ATopicIndex ); + end + else + begin + AddChildNodes( AHelpFile, + Node, + Topic.ContentsLevel, + ATopicIndex ); + Node := nil; + end + end + else + begin + inc( ATopicIndex ); + end; + end; { while } +end; + +procedure TMainForm.ClearNotes; +begin + { TODO -oGraeme : Implement me } +end; + +procedure TMainForm.ClearIndexComponents; +begin + IndexSearchEdit.Clear; + lbIndex.FocusItem := -1; + lbIndex.Items.Clear; + DisplayedIndex.Clear; + IndexLoaded := False; +end; + +procedure TMainForm.SaveNotes(AHelpFile: THelpFile); +begin + { TODO -oGraeme : Implement me } +end; + +procedure TMainForm.DisplayTopic(ATopic: TTopic); +var + lText: String; + ImageIndices: TList; + LinkIndex: longint; + Link: THelpLink; + HelpFile: THelpFile; + Topic: TTopic; + HighlightWordSequences: TList; + FileIndex: integer; +begin + if CurrentOpenFiles.Count = 0 then + Exit; + + ProfileEvent('DisplayTopic >>>>'); + if ATopic = nil then + begin + case PageControl1.ActivePageIndex of + 0: begin // TOC tab + if tvContents.Selection = nil then + begin + ShowMessage('You must select a topic first by clicking it.'); + Exit; //==> + end + else + Topic := TTopic(tvContents.Selection.Data); + ProfileEvent('Got Topic from Treeview'); + end; + 1: begin // Index tab + if lbIndex.FocusItem = -1 then + begin + ShowMessage('You must select a index first by clicking it.'); + Exit; //==> + end + else + Topic := TTopic(lbIndex.Items.Objects[lbIndex.FocusItem]); + ProfileEvent('Got Topic from Index listbox'); + end; + 2: begin // Search tab + if lbSearchResults.FocusItem = -1 then + begin + ShowMessage('You must select a search result first by clicking it.'); + Exit; //==> + end + else + Topic := TTopic(lbSearchResults.Items.Objects[lbSearchResults.FocusItem]); + ProfileEvent('Got Topic from Search Results listbox'); + end; + 4: begin // History tab + if lbHistory.FocusItem = -1 then + begin + ShowMessage('You must select a history item first by clicking it.'); + Exit; //==> + end + else + Topic := TTopic(lbHistory.Items.Objects[lbHistory.FocusItem]); + ProfileEvent('Got Topic from History listbox'); + end; + end; + end // case.. + else + Topic := ATopic; // use topic passed in as a parameter + + if Topic = nil then + raise Exception.Create('Unable to locate the Topic'); + + CurrentTopic := Topic; + + RichView.Clear; + ImageIndices := TList.Create; + ProfileEvent('Cleared memo...'); + + HelpFile := TopicFile(CurrentTopic); + if HelpFile = nil then + raise Exception.Create('Failed to get active HelpFile from Topic'); + + if HelpFile.HighlightWords <> nil then + ProfileEvent('highlightwords is ok'); + + if (AllFilesWordSequences.Count > 0) // ie we have done a search... + {and ViewHighlightSearchWordsMI.Checked} then + begin + FileIndex := CurrentOpenFiles.IndexOf( HelpFile ); + HighlightWordSequences := TList(AllFilesWordSequences[ FileIndex ]); + end + else + HighlightWordSequences := nil; + + lText := ''; + ProfileEvent('Debug show hex values = ' + BoolToStr(Debug)); + if ImageIndices <> nil then + ProfileEvent('ImageIndices initialized'); + + CurrentTopic.GetText( HighlightWordSequences, + Debug {ShowCodes}, + False {ShowWordIndices}, + lText {TopicText}, + ImageIndices, + nil {Highlights} ); + + if ImageIndices.Count > 0 then + begin + { TODO -oGraeme : We do not support images yet } +// THelpFile(CurrentTopic.HelpFile).GetImages(ImageIndices, FImages); + end; + + ImageIndices.Free; + + //writeln(lText); + //writeln('-----------------------------'); + RichView.AddText(PChar(lText)); + + tvContents.Selection := tvContents.RootNode.FindSubNode(CurrentTopic, True); + tvContents.Invalidate; + SaveNavigatePoint; + UpdateLocationPanel; +end; + +procedure TMainForm.ResetProgress; +begin + { TODO -oGraeme : implement ResetProgress } + ProgressBar.Visible := False; + ProgressBar.Position := 0; +end; + +procedure TMainForm.SetStatus(const AText: TfpgString); +begin + lblStatus.Text := AText; +end; + +function TMainForm.TranslateEnvironmentVar(AFilenames: TfpgString): TfpgString; +var + EnvironmentVarValue: string; +begin + EnvironmentVarValue := GetEnvironmentVariable(UpperCase(AFilenames)); + if EnvironmentVarValue <> '' then + Result := EnvironmentVarValue + else + Result := AFileNames; +end; + +constructor TMainForm.Create(AOwner: TComponent); +var + img: TfpgImage; +begin + inherited Create(AOwner); + fpgApplication.OnException := @MainFormException; + OnShow := @MainFormShow; + OnDestroy :=@MainFormDestroy; +// Files := TList.Create; + AllFilesWordSequences := TList.Create; + CurrentOpenFiles := TList.Create; + DisplayedIndex := TStringList.Create; + CurrentHistoryIndex := -1; + FHistorySelection := False; + { TODO -oGraeme : Make Debug a menu option } + Debug := False; + + FImages := TfpgImageList.Create; + // store up to three images per Topic - while we don't support INF images + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); + FImages.AddImage(img); + + + // load toolbar images + fpgImages.AddMaskedBMP( + 'dv.arrowleft', @usr_arrow_left, + sizeof(usr_arrow_left), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowright', @usr_arrow_right, + sizeof(usr_arrow_right), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowup', @usr_arrow_up, + sizeof(usr_arrow_up), 0, 0); + + fpgImages.AddMaskedBMP( + 'dv.arrowdown', @usr_arrow_down, + sizeof(usr_arrow_down), 0, 0); + +end; + +destructor TMainForm.Destroy; +begin + RichView.Images := nil; + FImages.Free; + CurrentTopic := nil; // it was a reference only + FFileOpenRecent := nil; // it was a reference only + miOpenRecentMenu.Free; +// DestroyListAndObjects(Files); + DestroyListAndObjects(AllFilesWordSequences); + DestroyListAndObjects(CurrentOpenFiles); + inherited Destroy; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(602, 274, 654, 386); + WindowTitle := 'fpGUI Documentation Viewer'; + Hint := ''; + ShowHint := True; + WindowPosition := wpUser; + OnCloseQuery := @MainFormCloseQuery; + + bvlStatusBar := TfpgBevel.Create(self); + with bvlStatusBar do + begin + Name := 'bvlStatusBar'; + SetPosition(0, 366, 653, 20); + Anchors := [anLeft,anRight,anBottom]; + Hint := ''; + Style := bsLowered; + end; + + ProgressBar := TfpgProgressBar.Create(bvlStatusBar); + with ProgressBar do + begin + Name := 'ProgressBar'; + SetPosition(501, 2, 150, 16); + Anchors := [anRight,anBottom]; + Hint := ''; + end; + + lblStatus := TfpgLabel.Create(bvlStatusBar); + with lblStatus do + begin + Name := 'lblStatus'; + SetPosition(4, 2, 380, 16); + Anchors := [anLeft,anRight,anBottom]; + FontDesc := '#Label1'; + Hint := ''; + Text := ''; + end; + + bvlBody := TfpgBevel.Create(self); + with bvlBody do + begin + Name := 'bvlBody'; + SetPosition(0, 55, 653, 310); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Shape := bsSpacer; + end; + + PageControl1 := TfpgPageControl.Create(bvlBody); + with PageControl1 do + begin + Name := 'PageControl1'; + SetPosition(0, 16, 260, 276); + ActivePageIndex := 0; + Hint := ''; + TabOrder := 0; + Align := alLeft; + OnChange := @PageControl1Change; + end; + + tsContents := TfpgTabSheet.Create(PageControl1); + with tsContents do + begin + Name := 'tsContents'; + SetPosition(3, 24, 254, 249); + Text := 'Contents'; + end; + + tvContents := TfpgTreeView.Create(tsContents); + with tvContents do + begin + Name := 'tvContents'; + SetPosition(4, 32, 242, 212); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#Label1'; + Hint := ''; + ScrollWheelDelta := 60; + ShowImages := True; + TabOrder := 0; + OnChange := @tvContentsChange; + //OnDoubleClick := @tvContentsDoubleClick; + end; + + btnGo := TfpgButton.Create(tsContents); + with btnGo do + begin + Name := 'btnGo'; + SetPosition(166, 4, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Go to'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnGoClicked; + end; + + tsIndex := TfpgTabSheet.Create(PageControl1); + with tsIndex do + begin + Name := 'tsIndex'; + SetPosition(3, 24, 254, 249); + Text := 'Index'; + end; + + btnIndex := TfpgButton.Create(tsIndex); + with btnIndex do + begin + Name := 'btnIndex'; + SetPosition(166, 4, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Go to'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnShowIndex; + end; + + lbIndex := TfpgListBox.Create(tsIndex); + with lbIndex do + begin + Name := 'lbIndex'; + SetPosition(4, 32, 242, 212); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; + TabOrder := 1; + OnDoubleClick := @lbIndexDoubleClick; + OnKeyPress:=@lbIndexKeyPress; + end; + + IndexSearchEdit := TfpgEdit.Create(tsIndex); + with IndexSearchEdit do + begin + Name := 'IndexSearchEdit'; + SetPosition(4, 4, 152, 24); + Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; + TabOrder := 2; + Text := ''; + FontDesc := '#Edit1'; + OnChange := @IndexSearchEditOnChange; + OnKeyPress :=@IndexSearchEditKeyPress; + end; + + tsSearch := TfpgTabSheet.Create(PageControl1); + with tsSearch do + begin + Name := 'tsSearch'; + SetPosition(3, 24, 254, 301); + Text := 'Search'; + end; + + Label1 := TfpgLabel.Create(tsSearch); + with Label1 do + begin + Name := 'Label1'; + SetPosition(4, 4, 120, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Search for:'; + end; + + edSearchText := TfpgEdit.Create(tsSearch); + with edSearchText do + begin + Name := 'edSearchText'; + SetPosition(4, 20, 210, 26); + Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; + TabOrder := 1; + Text := ''; + FontDesc := '#Edit1'; + OnKeyPress :=@edSearchTextKeyPress; + end; + + Label2 := TfpgLabel.Create(tsSearch); + with Label2 do + begin + Name := 'Label2'; + SetPosition(4, 48, 172, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Criteria:'; + end; + + RadioButton1 := TfpgRadioButton.Create(tsSearch); + with RadioButton1 do + begin + Name := 'RadioButton1'; + SetPosition(12, 68, 192, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 3; + Text := 'This section'; + Enabled := False; + end; + + RadioButton2 := TfpgRadioButton.Create(tsSearch); + with RadioButton2 do + begin + Name := 'RadioButton2'; + SetPosition(12, 88, 192, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 4; + Text := 'Marked sections'; + Enabled := False; + end; + + RadioButton3 := TfpgRadioButton.Create(tsSearch); + with RadioButton3 do + begin + Name := 'RadioButton3'; + SetPosition(12, 108, 192, 20); + Checked := True; + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 5; + Text := 'All sections'; + Enabled := False; + end; + + RadioButton4 := TfpgRadioButton.Create(tsSearch); + with RadioButton4 do + begin + Name := 'RadioButton4'; + SetPosition(12, 128, 192, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 6; + Text := 'Index'; + Enabled := False; + end; + + RadioButton5 := TfpgRadioButton.Create(tsSearch); + with RadioButton5 do + begin + Name := 'RadioButton5'; + SetPosition(12, 148, 192, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 7; + Text := 'Marked libraries'; + Enabled := False; + end; + + RadioButton6 := TfpgRadioButton.Create(tsSearch); + with RadioButton6 do + begin + Name := 'RadioButton6'; + SetPosition(12, 168, 192, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 8; + Text := 'All libraries'; + Enabled := False; + end; + + lbSearchResults := TfpgListBox.Create(tsSearch); + with lbSearchResults do + begin + Name := 'lbSearchResults'; + SetPosition(4, 220, 242, 76); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; + TabOrder := 9; + OnDoubleClick := @lbSearchResultsDoubleClick; + OnKeyPress := @lbSearchResultsKeyPress; + end; + + Label3 := TfpgLabel.Create(tsSearch); + with Label3 do + begin + Name := 'Label3'; + SetPosition(4, 200, 196, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Search results:'; + end; + + btnSearch := TfpgButton.Create(tsSearch); + with btnSearch do + begin + Name := 'btnSearch'; + SetPosition(220, 20, 28, 26); + Anchors := [anRight,anTop]; + Text := 'Go'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 11; + OnClick := @btnSearchClicked; + end; + + tsNotes := TfpgTabSheet.Create(PageControl1); + with tsNotes do + begin + Name := 'tsNotes'; + SetPosition(3, 24, 254, 289); + Text := 'Notes'; + end; + + ListBox1 := TfpgListBox.Create(tsNotes); + with ListBox1 do + begin + Name := 'ListBox1'; + SetPosition(4, 32, 242, 252); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; + TabOrder := 0; + end; + + btnNotesAdd := TfpgButton.Create(tsNotes); + with btnNotesAdd do + begin + Name := 'btnNotesAdd'; + SetPosition(4, 4, 24, 24); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := 0; + ImageName := 'stdimg.add'; + TabOrder := 1; + end; + + btnNotesEdit := TfpgButton.Create(tsNotes); + with btnNotesEdit do + begin + Name := 'btnNotesEdit'; + SetPosition(32, 4, 24, 24); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := 0; + ImageName := 'stdimg.edit'; + TabOrder := 2; + end; + + btnNotesDel := TfpgButton.Create(tsNotes); + with btnNotesDel do + begin + Name := 'btnNotesDel'; + SetPosition(60, 4, 24, 24); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := 0; + ImageName := 'stdimg.remove'; + TabOrder := 3; + end; + + btnNotesGoto := TfpgButton.Create(tsNotes); + with btnNotesGoto do + begin + Name := 'btnNotesGoto'; + SetPosition(166, 4, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Go to'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + end; + + tsHistory := TfpgTabSheet.Create(PageControl1); + with tsHistory do + begin + Name := 'tsHistory'; + SetPosition(3, 24, 254, 249); + Text := 'History'; + end; + + lbHistory := TfpgListBox.Create(tsHistory); + with lbHistory do + begin + Name := 'lbHistory'; + SetPosition(4, 8, 242, 236); + Anchors := [anLeft,anRight,anTop,anBottom]; + FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; + TabOrder := 0; + OnDoubleClick := @lbHistoryDoubleClick; + OnKeyPress := @lbHistoryKeyPress; + end; + + Splitter1 := TfpgSplitter.Create(bvlBody); + with Splitter1 do + begin + Name := 'Splitter1'; + SetPosition(265, 120, 8, 168); + Align := alLeft; + end; + + RichView := TRichTextView.Create(bvlBody); + with RichView do + begin + Name := 'RichView'; + SetPosition(368, 192, 244, 92); + TabOrder := 2; + Align := alClient; + OnClickLink:=@RichViewClickLink; + end; + + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 654, 24); + Anchors := [anLeft,anRight,anTop]; + end; + + miFile := TfpgPopupMenu.Create(self); + with miFile do + begin + Name := 'miFile'; + SetPosition(292, 96, 132, 20); + AddMenuItem('Open...', '', @miFileOpenClicked); + AddMenuItem('Open Special...', '', @miFileOpenSpecialClicked); + AddMenuItem('Save current Topic to IPF...', '', @miFileSaveTopicAsIPF); + AddMenuItem('Close', '', @miFileCloseClicked); + AddMenuitem('-', '', nil); + FFileOpenRecent := AddMenuItem('Open Recent...', '', nil); + AddMenuitem('-', '', nil); + AddMenuItem('Quit', '', @miFileQuitClicked); + end; + + miSettings := TfpgPopupMenu.Create(self); + with miSettings do + begin + Name := 'miSettings'; + SetPosition(292, 120, 132, 20); + AddMenuItem('Options...', '', @miConfigureClicked); + end; + + miBookmarks := TfpgPopupMenu.Create(self); + with miBookmarks do + begin + Name := 'miBookmarks'; + SetPosition(292, 144, 132, 20); + AddMenuItem('Add..', '', nil); + AddMenuItem('Show', '', nil); + end; + + miHelp := TfpgPopupMenu.Create(self); + with miHelp do + begin + Name := 'miHelp'; + SetPosition(292, 168, 132, 20); + AddMenuItem('Contents...', '', nil); + AddMenuItem('Help using help', '', nil); + AddMenuItem('Command line parameters', '', @miHelpCmdLineParams); + AddMenuItem('-', '', nil); + AddMenuItem('Show help file header info', '', @miDebugHeader); + AddMenuItem('-', '', nil); + AddMenuItem('About fpGUI Toolkit...', '', @miHelpAboutFPGui); + AddMenuItem('Product Information...', '', @miHelpProdInfoClicked); + end; + + miDebug := TfpgPopupMenu.Create(self); + with miDebug do + begin + Name := 'miDebug'; + SetPosition(292, 192, 132, 20); + miDebugHexInfo := AddMenuItem('Toggle Hex INF Values in Contents', '', @miDebugHex); + end; + + ToolBar := TfpgBevel.Create(self); + with ToolBar do + begin + Name := 'ToolBar'; + SetPosition(0, 25, 654, 28); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + btnOpen := TfpgButton.Create(ToolBar); + with btnOpen do + begin + Name := 'btnOpen'; + SetPosition(30, 1, 24, 24); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Open a new help file.'; + ImageMargin := -1; + ImageName := 'stdimg.open'; + ImageSpacing := 0; + TabOrder := 0; + OnClick := @miFileOpenClicked; + Focusable := False; + end; + + btnBack := TfpgButton.Create(ToolBar); + with btnBack do + begin + Name := 'btnBack'; + SetPosition(70, 1, 32, 24); + Text := '<'; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Previous history item.'; + ImageMargin := -1; + ImageName := 'dv.arrowleft'; + ImageSpacing := 0; + TabOrder := 2; + Focusable := False; + OnClick := @btnBackHistClick; + end; + + btnFwd := TfpgButton.Create(ToolBar); + with btnFwd do + begin + Name := 'btnFwd'; + SetPosition(104, 1, 32, 24); + Text := '>'; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Next history item.'; + ImageMargin := -1; + ImageName := 'dv.arrowright'; + ImageSpacing := 0; + TabOrder := 3; + Focusable := False; + OnClick := @btnFwdHistClick; + end; + + btnPrev := TfpgButton.Create(ToolBar); + with btnPrev do + begin + Name := 'btnPrev'; + SetPosition(138, 1, 32, 24); + Text := 'prev'; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Previous Topic.'; + ImageMargin := -1; + ImageName := 'dv.arrowup'; + ImageSpacing := 0; + TabOrder := 4; + Focusable := False; + OnClick := @btnPrevClick; + end; + + btnNext := TfpgButton.Create(ToolBar); + with btnNext do + begin + Name := 'btnNext'; + SetPosition(172, 1, 32, 24); + Text := 'next'; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Next Topic.'; + ImageMargin := -1; + ImageName := 'dv.arrowdown'; + ImageSpacing := 0; + TabOrder := 5; + Focusable := False; + OnClick :=@btnNextClick; + end; + + btnHelp := TfpgButton.Create(ToolBar); + with btnHelp do + begin + Name := 'btnHelp'; + SetPosition(218, 1, 24, 24); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'Display Product Information.'; + ImageMargin := -1; + ImageName := 'stdimg.help'; + ImageSpacing := 0; + TabOrder := 6; + Focusable := False; + OnClick := @miHelpProdInfoClicked; + end; + + btnQuit := TfpgButton.Create(ToolBar); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 1, 24, 24); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 8; + OnClick := @miFileQuitClicked; + Focusable := False; + end; + + Bevel1 := TfpgBevel.Create(ToolBar); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(61, 0, 6, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + Bevel2 := TfpgBevel.Create(ToolBar); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(210, 0, 6, 24); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + // remove toolbar button text + btnBack.Text := ''; + btnFwd.Text := ''; + btnNext.Text := ''; + btnPrev.Text := ''; + + miOpenRecentMenu := TfpgPopupMenu.Create(nil); + with miOpenRecentMenu do + begin + Name := 'miOpenRecentMenu'; + SetPosition(309, 52, 132, 20); + end; + + // hook up the sub-menus. + MainMenu.AddMenuItem('&File', nil).SubMenu := miFile; + MainMenu.AddMenuItem('&Settings', nil).SubMenu := miSettings; + MainMenu.AddMenuItem('&Bookmarks', nil).SubMenu := miBookmarks; + MainMenu.AddMenuItem('&Help', nil).SubMenu := miHelp; + MainMenu.AddMenuItem('&Debug', nil).SubMenu := miDebug; + FFileOpenRecent.SubMenu := miOpenRecentMenu; + + // correct default visible tabsheet + PageControl1.ActivePageIndex := 0; +end; + +procedure TMainForm.RefreshFontSubstitutions; +var + FileIndex: longint; + HelpFile: THelpFile; +begin + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + HelpFile := THelpFile(CurrentOpenFiles[ FileIndex ]); + + if Settings.FixedFontSubstitution then + HelpFile.SetupFontSubstitutes( Settings.FixedFontSubstitutes ) + else + HelpFile.SetupFontSubstitutes( '' ); + end; +end; + +procedure TMainForm.DisplaySelectedContentsTopic; +var + Topic: TTopic; +Begin + if tvContents.Selection = nil then + Exit; + Topic := TTopic(tvContents.Selection.Data); + DisplayTopic(Topic); +End; + +procedure TMainForm.DisplaySelectedIndexTopic; +var + Topic: TTopic; +begin + if lbIndex.FocusItem = -1 then + exit; + Topic := DisplayedIndex.Objects[ lbIndex.FocusItem ] as TTopic; + DisplayTopic(Topic); +end; + +procedure TMainForm.ProcessCommandLineParams; +var + showtopic: boolean; + t: TTopic; +begin + if ParamCount > 0 then + begin + if gCommandLineParams.IsParam('h') then + begin + ShowCmdLineParamHelp; + Exit; //==> + end + else if gCommandLineParams.IsParam('debuglog') then + // do nothing + else + begin +//writeln('DEBUG: TMainForm.ProcessCommandLineParams - Open file...'); + showtopic := not gCommandLineParams.IsParam('k'); + OpenFile(ParamStr(1), '', showtopic); + end; + end; + + // now process all other parameters + if gCommandLineParams.IsParam('k') then + begin +//writeln('DEBUG: TMainForm.ProcessCommandLineParams - Keyword Search string'); + { Search for a string } + edSearchText.Text := gCommandLineParams.GetParam('k'); + PageControl1.ActivePage := tsSearch; + btnSearch.Click; + end + else if gCommandLineParams.IsParam('n') then + begin + { Display topic with numeric topic id } +//writeln('DEBUG: TMainForm.ProcessCommandLineParams - Display numeric topic id'); + t := FindTopicByResourceID(StrToInt(gCommandLineParams.GetParam('n'))); +//if not Assigned(t) then +// writeln(Format('Failed to find topic <%s>', [gCommandLineParams.GetParam('n')])); + DisplayTopic(t); + end + else if gCommandLineParams.IsParam('s') then + begin +//writeln('DEBUG: TMainForm.ProcessCommandLineParams - display string topic id'); + { Display topic with string topic id } + t := FindTopicByName(gCommandLineParams.GetParam('s')); +//if not Assigned(t) then +// writeln(Format('Failed to find topic <%s>', [gCommandLineParams.GetParam('k')])); + DisplayTopic(t); + end; +end; + +procedure TMainForm.SaveNavigatePoint; +begin + // if we selected an item from history listbox, don't record that save point + if FHistorySelection then + Exit; + + // delete rest of history + while CurrentHistoryIndex < lbHistory.Items.Count-1 do + lbHistory.Items.Delete(CurrentHistoryIndex + 1); + + if CurrentTopic <> nil then + lbHistory.Items.AddObject(CurrentTopic.Title, CurrentTopic); + + inc(CurrentHistoryIndex); +end; + +procedure TMainForm.ShowCmdLineParamHelp; +const + le = LineEnding; +var + s: string; +begin + s := '<font "Arial" 12><b>' + cLongName + '</b></font>' + le + + cVersion + le + le + + 'Supported command line parameters:' + le + le + + '<tt>' + + ' <<filename> Load the help file <<filename>' + le + + ' -h Show this help' + le + + ' -k <<text> Search for keyword <<text> in open help files' + le + + ' -n <<id> Open Topic with numeric ID equal to <<id>' + le + + ' -s <<id> Open Topic with string ID equal to <<id>' + le + + ' -debuglog <<filename> Log information to a file' + le + + '</tt>' + ; + RichView.AddText(PChar(s)); +end; + +// Find the target topic for the given link +function TMainForm.FindTopicForLink(Link: THelpLink): TTopic; +var + HelpFile: THelpFile; +begin + HelpFile := Link.HelpFile as THelpFile; + if Link is TFootnoteHelpLink then + begin + Result := HelpFile.Topics[ TFootnoteHelpLink( Link ).TopicIndex ]; + end + else if Link is TInternalHelpLink then + begin + Result := HelpFile.Topics[ TInternalHelpLink( Link ).TopicIndex ]; + end + else if Link is THelpLinkByResourceID then + begin + Result := FindTopicByResourceID( THelpLinkByResourceID( Link ).ResourceID ); + end +end; + +// Find topic specified by numeric resource ID, in all open files +function TMainForm.FindTopicByResourceID(ID: word): TTopic; +var + FileIndex: longint; + HelpFile: THelpFile; +begin + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + HelpFile := THelpFile(CurrentOpenFiles[ FileIndex ]); + + Result := HelpFile.FindTopicByResourceID( ID ); + if Result <> nil then + // found + exit; + end; + + // not found. + Result := nil; +end; + +function TMainForm.FindTopicByName(const AName: string): TTopic; +var + FileIndex: longint; + HelpFile: THelpFile; +begin + Result := nil; + for FileIndex := 0 to CurrentOpenFiles.Count - 1 do + begin + HelpFile := THelpFile(CurrentOpenFiles[ FileIndex ]); + Result := HelpFile.FindTopicByLocalName(AName); + if Result <> nil then + // found + exit; //==> + end; + // not found. + Result := nil; +end; + +// Add the current list of open files as +// a Most Recently Used entry +procedure TMainForm.AddCurrentToMRUFiles; +var + tmpFilenames: TStringList; + i: longint; + tmpHelpFile: THelpFile; +begin + tmpFilenames := TStringList.Create; + + if CurrentOpenFiles.Count > 0 then + begin + for i := 0 to CurrentOpenFiles.Count - 1 do + begin + tmpHelpFile := THelpFile(CurrentOpenFiles[ i ]); + tmpFilenames.Add(tmpHelpFile.Filename); + end; + + // update most-recently-used file list + tmpHelpFile := THelpFile(CurrentOpenFiles[ 0 ]); + AddToMRUList(tmpHelpFile.Title, tmpFilenames); + end; + + // recreate menu + CreateMRUMenuItems; + + tmpFilenames.Destroy; +end; + +procedure TMainForm.CreateMRUMenuItems; +var + MenuItem: TfpgMenuItem; + i: integer; + FileName: TfpgString; + FileNameIndex: longint; + MRUText: TfpgString; + MRUItem: TMRUItem; +begin + FFileOpenRecent.SubMenu := nil; + miOpenRecentMenu.Free; + miOpenRecentMenu := TfpgPopupMenu.Create(nil); + FFileOpenRecent.SubMenu := miOpenRecentMenu; + + // Add items for the MRU files + for i:= 0 to Settings.MRUList.Count -1 do + begin + MRUItem := TMRUItem(Settings.MRUList[ i ]); + MenuItem := miOpenRecentMenu.AddMenuItem('?', '', @OnMRUMenuItemClick); +// MenuItem.Name := 'MRUItem' + IntToStr( i ) + 'MI'; + + MRUText := MRUItem.Title; + if Trim( MRUText ) = '' then + begin + // Take the filenames, less path, as caption... + MRUText := ''; + for FileNameIndex := 0 to MRUItem.Filenames.Count - 1 do + begin + FileName := MRUItem.Filenames[ FileNameIndex ]; + FileName := fpgExtractFileName(FileName); + FileName := ChangeFileExt( FileName, '' );// remove extension + + if FileNameIndex > 0 then + begin + MRUText := MRUText + HELP_FILE_DELIMITER; + end; + MRUText := MRUText + FileName; + + // stop after 50 chars + if UTF8Length( MRUText ) > 50 then + begin + MRUText := MRUText + HELP_FILE_DELIMITER + ' ...'; + break; + end; + end; + end; + + MenuItem.Text := '&' + + IntToStr( i + 1 ) + + '. ' + + MRUText; + if MRUItem.Filenames.Count = 1 then + MenuItem.Hint := MRUItem.Filenames[ 0 ] + else + MenuItem.Hint := MRUItem.Title + + ' (' + + IntToStr( MRUItem.Filenames.Count ) + + ' ' + + rsfiles + + ')'; + + MenuItem.Tag := i; + end; +end; + + +end. diff --git a/docview/src/missing.inc b/docview/src/missing.inc new file mode 100644 index 00000000..8be26a60 --- /dev/null +++ b/docview/src/missing.inc @@ -0,0 +1,730 @@ + +Const + dv_missing : Array[0..12341] of byte = ( + 66, 77, 54, 48, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 64, 0, 0, 0, 64, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 48, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255, + 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255, + 255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, + 255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ); diff --git a/docview/src/nvNullObjects.pas b/docview/src/nvNullObjects.pas new file mode 100644 index 00000000..c5e52a22 --- /dev/null +++ b/docview/src/nvNullObjects.pas @@ -0,0 +1,39 @@ +unit nvNullObjects; + +{$mode objfpc}{$H+} + +interface + +uses + contnrs, Classes, SysUtils, fpg_main; + +type + EHelpBitmapException = class(Exception); + + THelpBitmap = class(TfpgImage) + public + constructor CreateFromHelpFile( FileHandle: TFileStream; Offset: longint ); + procedure LoadFromResourceName(const AName: string); + end; + + + +implementation + + + +{ THelpBitmap } + +constructor THelpBitmap.CreateFromHelpFile(FileHandle: TFileStream; Offset: longint); +begin + inherited Create; +end; + +procedure THelpBitmap.LoadFromResourceName(const AName: string); +begin + // +end; + + +end. + diff --git a/docview/src/nvUtilities.pas b/docview/src/nvUtilities.pas new file mode 100644 index 00000000..568fbc19 --- /dev/null +++ b/docview/src/nvUtilities.pas @@ -0,0 +1,404 @@ +unit nvUtilities; + +{$mode objfpc}{$H+} + +// disable to remove debugging output +{.$Define DEBUG} + +interface + +uses + Classes, SysUtils, fpg_base; + +const + { TODO -oGraeme : Should this change to LineEnding (platfrom dependant) } + EndLine= chr(13)+chr(10); + TwoEndLines= chr(13)+chr(10)+chr(13)+chr(10); + Quote = ''''; + DoubleQuote = '"'; + + // -- Logging -- +type + LogAspect = ( LogStartup, + LogShutdown, + LogSettings, + LogI18n, + LogParse, + LogDisplay, + LogSearch, + LogNHM, + LogViewStub, + LogObjConstDest, + LogDebug + ); + LogAspects = SET OF LogAspect; + +procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String); + +// Removes and returns the first value in a separated +// value list (removes quotes if found) +Function ExtractNextValue(var S: string; const Separator: string ): string; + +Function ExtractNextValueNoTrim(var S: string; const Separator: string ): string; + +function AllocateMemory( const Size: ValUInt ): pointer; +procedure DeallocateMemory( Var P: pointer ); + +// Alias method which is the same as Move() but with less confusing name +procedure MemCopy(const src; var dest; size: SizeInt); +procedure FillMem( Dest: pointer; Size: longint; Data: Byte ); +// Allows for debug output and quite disable of output +procedure ProfileEvent(const AString: string); +// Return AFilename's size in bytes +function GetFileSize(const AFilename: string): integer; + +function IsDigit(const AChar: TfpgChar): boolean; +function IsAlpha(const AChar: TfpgChar): boolean; +function Between( const Value: longint; const Limit1: longint; const Limit2: longint ): boolean; + + +operator = (ARect: TRect; BRect: TRect): boolean; + +// Destroy the objects stored in List and clear the list. +procedure ClearListAndObjects( List: TList ); +// Destroy the objects stored in the list and then destroy the list itself +// And set the reference to nil +procedure DestroyListAndObjects( Var List: TList ); +// Destroy the objects stored in the list. +// You probably want to use one of the two functions above. +procedure DestroyListObjects( List: TList ); + +procedure AddList( Source, Dest: TList ); +procedure AssignList( Source, Dest: TList ); + +procedure ListFilesInDirectory(const aDirectory: String; const aFilter: String; const aWithDirectoryFlag: boolean; var aList: TStrings); + +// add all file name parts of aFileNameString to the aResult +// check for containing environment vars +// and include all help files if the environment var points +// to a directory +procedure ParseAndExpandFileNames(const aFileNameString: String; aResult: TStrings); + + + +var + startTime : Cardinal; + lastTime : Cardinal; + activeLogAspects : LogAspects; + infoMessage1 : String; + infoMessage2 : String; + + +implementation + +uses + fpg_utils + ,fpg_main + ,ACLStringUtility + ,dvconstants + ; + + Function GetAspectPrefix(const aLogAspect: LogAspect): String; + Begin + Case aLogAspect of + LogStartup : result := 'Startup'; + LogShutdown : result := 'Start'; + LogSettings : result := 'Settings'; + LogI18n : result := 'I18n'; + LogParse : result := 'Parse'; + LogDisplay : result := 'Display'; + LogSearch : result := 'Search'; + LogNHM : result := 'NewHelpManager'; + LogViewStub : result := 'ViewStub'; + LogObjConstDest : result := 'ObjConstDest'; + LogDebug : result := 'Debug'; + else result := 'Unknown'; + end; + End; + + + Procedure SetLogAspects(const aCommaSeparatedListOfAspectNames : String); + Var + tmpAspects : TStrings; + i : Integer; + Begin + tmpAspects := TStringList.Create; + StrExtractStrings(tmpAspects, aCommaSeparatedListOfAspectNames, [','], #0); + + for i:=0 to tmpAspects.count-1 do + begin + if tmpAspects[i] = 'LogStartup' then activeLogAspects := activeLogAspects + [ LogStartup ]; + if tmpAspects[i] = 'LogShutdown' then activeLogAspects := activeLogAspects + [ LogShutdown ]; + if tmpAspects[i] = 'LogSettings' then activeLogAspects := activeLogAspects + [ LogSettings ]; + if tmpAspects[i] = 'LogI18n' then activeLogAspects := activeLogAspects + [ LogI18n ]; + if tmpAspects[i] = 'LogParse' then activeLogAspects := activeLogAspects + [ LogParse ]; + if tmpAspects[i] = 'LogDisplay' then activeLogAspects := activeLogAspects + [ LogDisplay ]; + if tmpAspects[i] = 'LogSearch' then activeLogAspects := activeLogAspects + [ LogSearch ]; + if tmpAspects[i] = 'LogNHM' then activeLogAspects := activeLogAspects + [ LogNHM ]; + if tmpAspects[i] = 'LogViewStub' then activeLogAspects := activeLogAspects + [ LogViewStub ]; + if tmpAspects[i] = 'LogObjConstDest' then activeLogAspects := activeLogAspects + [ LogObjConstDest ]; + if tmpAspects[i] = 'LogDebug' then activeLogAspects := activeLogAspects + [ LogDebug ]; + end; + + tmpAspects.Destroy; + End; + +procedure LogEvent(const aLogAspect: LogAspect; const anEventDescription: String); +var + tmpMessage: String; +begin + if (aLogAspect IN activeLogAspects) then + begin + tmpMessage := 'Log[' + GetAspectPrefix(aLogAspect) + '] ' + anEventDescription; + debugln(tmpMessage); + end; +end; + +Function ExtractNextValue( var S: string; + const Separator: string ): string; +begin + Result := ExtractNextValueNoTrim( S, Separator ); + Result := trim( Result ); + + // Remove quotes if present + if Result <> '' then + if Result[ 1 ] = DoubleQuote then + Delete( Result, 1, 1 ); + + if Result <> '' then + if Result[ length( Result ) ] = DoubleQuote then + Delete( Result, length( Result ), 1 ); +end; + +Function ExtractNextValueNoTrim( var S: string; + const Separator: string ): string; +Var + SeparatorPos: integer; +Begin + SeparatorPos := Pos( Separator, S ); + if SeparatorPos > 0 then + begin + Result := Copy( S, 1, SeparatorPos-1 ); + Delete( S, 1, SeparatorPos + length( Separator ) - 1 ); + end + else + begin + Result := S; + S := ''; + end; +end; + +function AllocateMemory( const Size: ValUInt ): pointer; +begin + GetMem( Result, size + sizeof( Size ) ); + PtrUInt(Result^) := Size; + inc( Result, sizeof( Size ) ); +end; + +procedure DeallocateMemory( Var P: pointer ); +var + Size: ValUInt; +begin + if P = nil then + exit; + + dec( P, sizeof( size ) ); + Size := ValUInt(P^); + FreeMem( P, Size + sizeof( Size ) ); + P := nil; +end; + +procedure MemCopy(const src; var dest; size: SizeInt); +begin + Move(src, dest, size); +end; + +procedure FillMem( Dest: pointer; Size: longint; Data: Byte ); +begin + FillChar( Dest^, Size, Data ); +end; + +procedure ProfileEvent(const AString: string); +begin + {$IFDEF DEBUG} + writeln('DEBUG: ', AString); + {$ENDIF} +end; + +function GetFileSize(const AFilename: string): integer; +var + f: File; +begin + Result := 0; + {$i-} + FileMode := 0; // read-only + Assign(f, fpgToOSEncoding(AFileName)); + Reset(f); + {$i+} + Result := FileSize(f); + CloseFile(f); +end; + +function IsDigit(const AChar: TfpgChar): boolean; +begin + { TODO -oGraeme -cunicode : Not utf-8 compliant. } + Result := ( AChar>='0' ) and ( AChar<='9' ); + //Result := TCharacter.IsDigit(AChar); +end; + +function IsAlpha(const AChar: TfpgChar): boolean; +var + UppercaseC: TfpgChar; +Begin + { TODO -oGraeme -cunicode : Not utf-8 compliant. } + UppercaseC := UpperCase( AChar ); + Result := ( UppercaseC >= 'A' ) and ( UppercaseC <= 'Z' ); + //Result := TCharacter.IsLetter(AChar); +end; + +function Between( const Value: longint; const Limit1: longint; const Limit2: longint ): boolean; +begin + if Limit1 < Limit2 then + Result:= ( Value >= Limit1 ) and ( Value <= Limit2 ) + else + Result:= ( Value >= Limit2 ) and ( Value <= Limit1 ) +end; + +operator = (ARect: TRect; BRect: TRect): boolean; +begin + result := (ARect.Top = BRect.Top) and + (ARect.Left = BRect.Left) and + (ARect.Bottom = BRect.Bottom) and + (ARect.Right = BRect.Right); +end; + +// Destroy the objects stored in List +// and clear the list. +Procedure ClearListAndObjects( List: TList ); +begin + DestroyListObjects( List ); + List.Clear; +end; + +// Destroy the objects stored in the list +// and then destroy the list itself. +Procedure DestroyListAndObjects( Var List: TList ); +begin + if not Assigned( List ) then + exit; + + DestroyListObjects( List ); + List.Free; + List := nil; +end; + +Procedure DestroyListObjects( List: TList ); +var + Index: longint; +begin + for Index := 0 to List.Count - 1 do + begin + if List[ Index ] <> nil then + begin + TObject( List[ Index ] ).Free; + List[ Index ] := nil; + end; + end; +end; + +Procedure AddList( Source, Dest: TList ); +var + i: longint; +begin + // expand the destination list to what's required + Dest.Capacity := Dest.Capacity + Source.Capacity; + for i:= 0 to Source.Count - 1 do + Dest.Add( Source[ i ] ); +end; + +Procedure AssignList( Source, Dest: TList ); +begin + Dest.Clear; + AddList( Source, Dest ); +end; + +procedure ListFilesInDirectory(const aDirectory: String; const aFilter: String; + const aWithDirectoryFlag: boolean; var aList: TStrings); +var + tmpRC: longint; + tmpSearchResults: TSearchRec; + tmpMask: String; + tmpFilterParts : TStrings; + tmpDirectory: String; + i: integer; +begin + tmpFilterParts := TStringList.Create; + + StrExtractStrings(tmpFilterParts, aFilter, [PathSeparator], #0); + + for i:=0 to tmpFilterParts.count-1 do + begin + tmpMask := tmpFilterParts[i]; + tmpDirectory := IncludeTrailingPathDelimiter(aDirectory); + tmpRC := fpgFindFirst(tmpDirectory + tmpMask, faAnyFile, tmpSearchResults); + + while tmpRC = 0 do + begin + if (tmpSearchResults.Attr and faDirectory) = 0 then + begin + if (aWithDirectoryFlag) then + aList.Add(tmpDirectory + tmpSearchResults.Name) + else + aList.Add(tmpSearchResults.Name); + end; + + tmpRC := fpgFindNext(tmpSearchResults); + end; + + FindClose(tmpSearchResults); + end; + tmpFilterParts.Destroy; +end; + +procedure ParseAndExpandFileNames(const aFileNameString: String; aResult: TStrings); +var + i: longint; + tmpFileNamesList: TStrings; + tmpItem: String; + tmpEnvironmentVarValue: string; +begin + LogEvent(LogDebug, 'ParseAndExpandFileNames "' + aFileNameString + '"'); + tmpFileNamesList := TStringList.Create; + + StrExtractStrings(tmpFileNamesList, aFileNameString, [HELP_FILE_DELIMITER, PathSeparator], #0); + for i := 0 to tmpFileNamesList.Count - 1 do + begin + tmpItem := tmpFileNamesList[i]; + + // is this a environment var + tmpEnvironmentVarValue := GetEnvironmentVariable(tmpItem); + if tmpEnvironmentVarValue <> '' then // environment var exists + begin + LogEvent(LogStartup, ' Environment var found; translated to: "' + tmpEnvironmentVarValue + '"'); + ParseAndExpandFileNames(tmpEnvironmentVarValue, aResult); + end + else if fpgDirectoryExists(tmpItem) then + begin + ListFilesInDirectory(tmpItem, '*' + INF_FILE_EXTENSION, true, aResult); + end + else + begin + aResult.Add(tmpItem); + end; + end; + + tmpFileNamesList.Free; +end; + +{$IFDEF DEBUG} +initialization + SetLogAspects('LogDebug,LogStartup'); +{$ENDIF} + +end. + diff --git a/docview/src/units/.gitignore b/docview/src/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/docview/src/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/docview/test/newview.inf b/docview/test/newview.inf Binary files differnew file mode 100644 index 00000000..d711e4a6 --- /dev/null +++ b/docview/test/newview.inf diff --git a/docview/test/testcase1.hlp b/docview/test/testcase1.hlp Binary files differnew file mode 100644 index 00000000..2b88bc7d --- /dev/null +++ b/docview/test/testcase1.hlp diff --git a/docview/test/testcase1.ipf b/docview/test/testcase1.ipf new file mode 100644 index 00000000..bcec749d --- /dev/null +++ b/docview/test/testcase1.ipf @@ -0,0 +1,12 @@ +:userdoc. +:title. Sample INF file... +:h1.Header One +:p.This is a test. Os/2, lies, and Windows 95. +:p.1234.5 +:artwork name='in_inf.bmp'. +Hello +:p. +:artwork name='tocarray.bmp'. +:i1. This is a index entry +:euserdoc. + diff --git a/examples/apps/compileall.sh b/examples/apps/compileall.sh new file mode 100755 index 00000000..1fed112d --- /dev/null +++ b/examples/apps/compileall.sh @@ -0,0 +1,16 @@ +#!/bin/sh +FPC=fpc +for f in `find -name '*.lpr'` +do + DIR=`dirname $f` + PROJECT=`basename $f` + LPRNAME=`basename $PROJECT .lpr` + echo Doing $LPRNAME in $DIR + cd $DIR + if [ ! -d units ]; then + echo 'Missing units dir' + mkdir units + fi + $FPC @extrafpc.cfg $PROJECT; + cd .. +done diff --git a/examples/apps/debugserver/extrafpc.cfg b/examples/apps/debugserver/extrafpc.cfg new file mode 100644 index 00000000..bf32f456 --- /dev/null +++ b/examples/apps/debugserver/extrafpc.cfg @@ -0,0 +1,6 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fi. +-Xs +-XX +-CX diff --git a/examples/apps/debugserver/fpgDebugServer.lpi b/examples/apps/debugserver/fpgDebugServer.lpi new file mode 100644 index 00000000..9dff3598 --- /dev/null +++ b/examples/apps/debugserver/fpgDebugServer.lpi @@ -0,0 +1,94 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="8"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <UseDefaultCompilerOptions Value="True"/> + </Flags> + <SessionStorage Value="InIDEConfig"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <Language Value=""/> + <CharSet Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="fpgDebugServer.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="fpgDebugServer"/> + </Unit0> + <Unit1> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="9"/> + <Target> + <Filename Value="fpgDebugServer"/> + </Target> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <AllowLabel Value="False"/> + <CPPInline Value="False"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/examples/apps/debugserver/fpgDebugServer.lpr b/examples/apps/debugserver/fpgDebugServer.lpr new file mode 100644 index 00000000..eaf9492b --- /dev/null +++ b/examples/apps/debugserver/fpgDebugServer.lpr @@ -0,0 +1,30 @@ +program fpgDebugServer; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes + ,fpg_main, frm_main + ; + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/apps/debugserver/frm_main.pas b/examples/apps/debugserver/frm_main.pas new file mode 100644 index 00000000..e0da08a7 --- /dev/null +++ b/examples/apps/debugserver/frm_main.pas @@ -0,0 +1,467 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This is the server part to a standard FPC unit - dbugintf. This unit + offers a simple API to send messages to a debug server (using + SimpleIPC), modeled after the GExperts GDebug tool for Delphi, with + some minor enhancements. This is a great way to debug CGI apps on a + server as well. + + NOTE: you would normally wrap the SendXXX methods with {$ifdef debug} so + the code can be excluded from a final released product (without debug + information). But this is obviously for you do decide. + + Typical usage is as follows: + + uses + dbugintf, sysutils; + + procedure BackupFile(FN : String); + var + BFN: String; + begin + SendMethodEnter('BackupFile'); + BFN := FN + '.bak'; + SendDebug(Format('backup file "%s" exists, deleting',[BFN])); + SendDebug(Format('Backing up "%s" to "%s"',[FN,BFN])); + SendMethodExit('BackupFile'); + end; + + procedure SaveToFile(FN : String); + begin + SendMethodEnter('SaveToFile'); + BackupFile(FN); + SendDebug('Saving to file '+FN); + SendMethodExit('SaveToFile'); + end; + + + Available SendXXX methods from the dbugintf unit are: + + procedure SendBoolean(const Identifier: string; const Value: Boolean); + procedure SendDateTime(const Identifier: string; const Value: TDateTime); + procedure SendInteger(const Identifier: string; const Value: Integer; HexNotation: Boolean = False); + procedure SendPointer(const Identifier: string; const Value: Pointer); + procedure SendDebugEx(const Msg: string; MType: TDebugLevel); + procedure SendDebug(const Msg: string); + procedure SendMethodEnter(const MethodName: string); + procedure SendMethodExit(const MethodName: string); + procedure SendSeparator; + procedure SendDebugFmt(const Msg: string; const Args: array of const); + procedure SendDebugFmtEx(const Msg: string; const Args: array of const; MType: TDebugLevel); + +} +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils + ,Classes + ,fpg_base + ,fpg_main + ,fpg_form + ,fpg_button + ,fpg_panel + ,fpg_menu + ,fpg_basegrid + ,fpg_grid + ,simpleipc + ,dbugmsg + ; + +type + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + MainMenu: TfpgMenuBar; + Bevel1: TfpgBevel; + grdMessages: TfpgStringGrid; + mnuFile: TfpgPopupMenu; + mnuEdit: TfpgPopupMenu; + mnuHelp: TfpgPopupMenu; + btnQuit: TfpgButton; + Bevel2: TfpgBevel; + btnPause: TfpgButton; + btnStart: TfpgButton; + btnClear: TfpgButton; + {@VFD_HEAD_END: MainForm} + FIPCSrv: TSimpleIPCServer; + FPaused: Boolean; + FAddAtBottom: Boolean; + FDiscarded: Integer; + FShowOnMessage: Boolean; + procedure StartServer; + procedure StopServer; + procedure CheckMessages(Sender: TObject); + procedure CheckDebugMessages; + procedure ReadDebugMessage; + procedure ShowDebugMessage(const AMsg: TDebugmessage); + procedure ShowMessageWindow; + procedure miFileQuit(Sender: TObject); + procedure miHelpAboutFPGui(Sender: TObject); + procedure miHelpProductInformation(Sender: TObject); + procedure btnClearClicked(Sender: TObject); + procedure btnPauseClicked(Sender: TObject); + procedure btnStartClicked(Sender: TObject); + procedure GridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + dateutils + ,fpg_dialogs + ; + + +{$I images.inc} +{$I state_images.inc} + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.btnClearClicked(Sender: TObject); +begin + grdMessages.RowCount := 0; +end; + +procedure TMainForm.btnPauseClicked(Sender: TObject); +begin + FPaused := not FPaused; +end; + +procedure TMainForm.btnStartClicked(Sender: TObject); +begin + if Assigned(FIPCSrv) then + Exit; + StartServer; +end; + +procedure TMainForm.GridDrawCell(Sender: TObject; const ARow, ACol: Integer; + const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); +var + img: TfpgImage; + i: integer; + dx: integer; +begin + if ACol = 0 then + begin + ADefaultDrawing := False; + try + i := StrToInt(grdMessages.Cells[ACol, ARow]); + case i of + -1: img := fpgImages.GetImage('dbs.state.stop'); + 0: img := fpgImages.GetImage('dbs.state.info'); + 1: img := fpgImages.GetImage('dbs.state.warning'); + 2: img := fpgImages.GetImage('dbs.state.error'); + 3: img := fpgImages.GetImage('dbs.state.identify'); + end; + dx := (grdMessages.ColumnWidth[ACol] - 16) div 2; + grdMessages.Canvas.DrawImage(ARect.Left + dx, ARect.Top {+ y}, img); + except + on E: Exception do + begin +// writeln('Cell text = ' + grdMessages.Cells[ACol, ARow]); + end; + end; + end; +end; + +procedure TMainForm.StartServer; +begin + FIPCSrv := TSimpleIPCServer.Create(nil); + FIPCSrv.ServerID := DebugServerID; + FIPCSrv.Global := True; + FIPCSrv.Active := True; + FIPCSrv.StartServer; + fpgApplication.OnIdle := @CheckMessages; +// ITMessages.Enabled:=True; +end; + +procedure TMainForm.StopServer; +begin + fpgApplication.OnIdle := nil; +// ITMessages.Enabled := False; + FreeAndNil(FIPCSrv); +end; + +procedure TMainForm.CheckMessages(Sender: TObject); +begin + CheckDebugMessages; +end; + +procedure TMainForm.CheckDebugMessages; +begin + while FIPCSrv.PeekMessage(1, True) do + ReadDebugMessage; +end; + +procedure TMainForm.ReadDebugMessage; +var + Msg: TDebugMessage; +begin + FIPCSrv.MsgData.Seek(0, soFromBeginning); + ReadDebugMessageFromStream(FIPCSrv.MsgData, MSg); + if not FPaused then + ShowDebugMessage(Msg) + else + Inc(FDiscarded); +end; + +procedure TMainForm.ShowDebugMessage(const AMsg: TDebugmessage); +var + r: integer; +begin + grdMessages.BeginUpdate; + try + grdMessages.RowCount := grdMessages.RowCount + 1; + r := grdMessages.RowCount-1; + //if FAddAtBottom then + // grdMessages.Items.Add(LI) + //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[2, r] := AMsg.Msg; + grdMessages.FocusCol := 0; + grdMessages.FocusRow := grdMessages.RowCount-1; + finally + grdMessages.EndUpdate; + end; + if FShowOnMessage then + ShowMessageWindow; +end; + +procedure TMainForm.ShowMessageWindow; +begin + if not Visible then + Show; +end; + +procedure TMainForm.miFileQuit(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miHelpAboutFPGui(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui; +end; + +procedure TMainForm.miHelpProductInformation(Sender: TObject); +begin + TfpgMessageDialog.Information('Product Information', WindowTitle + LineEnding + 'Written by Graeme Geldenhuys - 2010'); +end; + +constructor TMainForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPaused := False; + FAddAtBottom := False; + FShowOnMessage := False; + StartServer; + + fpgImages.AddMaskedBMP('dbs.clean', @DBS_clean, sizeof(DBS_clean), 15, 0); + fpgImages.AddMaskedBMP('dbs.stop', @DBS_stop, sizeof(DBS_stop), 0, 0); + fpgImages.AddMaskedBMP('dbs.pause', @DBS_pause, sizeof(DBS_pause), 0, 0); + fpgImages.AddMaskedBMP('dbs.run', @DBS_run, sizeof(DBS_run), 0, 0); + + fpgImages.AddMaskedBMP('dbs.state.info', @DBS_state_info, sizeof(DBS_state_info), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.warning', @DBS_state_warning, sizeof(DBS_state_warning), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.error', @DBS_state_error, sizeof(DBS_state_error), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.identify', @DBS_state_lightbulb, sizeof(DBS_state_lightbulb), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.stop', @DBS_state_lightbulb_off, sizeof(DBS_state_lightbulb_off), 0, 0); +end; + +destructor TMainForm.Destroy; +begin + StopServer; + inherited Destroy; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(353, 245, 486, 313); + WindowTitle := 'fpGUI''s Debug Server'; + Hint := ''; + ShowHint := True; + + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 486, 26); + Anchors := [anLeft,anRight,anTop]; + end; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(0, 26, 486, 31); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + grdMessages := TfpgStringGrid.Create(self); + with grdMessages do + begin + Name := 'grdMessages'; + SetPosition(4, 63, 478, 246); + Anchors := [anLeft,anRight,anTop,anBottom]; + AddColumn('Type', 50, taLeftJustify); + AddColumn('Time', 75, taCenter); + AddColumn('Message', 330, taLeftJustify); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := True; + ShowGrid := False; + TabOrder := 2; + Options := [go_SmoothScroll]; + OnDrawCell := @GridDrawCell; + end; + + mnuFile := TfpgPopupMenu.Create(self); + with mnuFile do + begin + Name := 'mnuFile'; + SetPosition(260, 100, 120, 24); + AddMenuItem('Quit', '', @miFileQuit); + end; + + mnuEdit := TfpgPopupMenu.Create(self); + with mnuEdit do + begin + Name := 'mnuEdit'; + SetPosition(260, 126, 120, 24); + AddMenuItem('Cut', '', nil).Enabled := False; + AddMenuItem('Copy', '', nil).Enabled := False; + AddMenuItem('Paste', '', nil).Enabled := False; + AddMenuItem('-', '', nil); + AddMenuItem('Preferences...', '', nil).Enabled := False; + end; + + mnuHelp := TfpgPopupMenu.Create(self); + with mnuHelp do + begin + Name := 'mnuHelp'; + SetPosition(260, 152, 120, 24); + AddMenuItem('About fpGUI...', '', @miHelpAboutFPGui); + AddMenuItem('Product Information...', '', @miHelpProductInformation); + end; + + btnQuit := TfpgButton.Create(Bevel1); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 0; + Focusable := False; + OnClick := @miFileQuit; + end; + + Bevel2 := TfpgBevel.Create(Bevel1); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(34, 2, 8, 25); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + btnPause := TfpgButton.Create(Bevel1); + with btnPause do + begin + Name := 'btnPause'; + SetPosition(43, 2, 25, 25); + Text := ''; + AllowAllUp := True; + Flat := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := 'pause server'; + ImageMargin := -1; + ImageName := 'dbs.pause'; + TabOrder := 2; + Focusable := False; + OnClick :=@btnPauseClicked; + end; + + btnStart := TfpgButton.Create(Bevel1); + with btnStart do + begin + Name := 'btnStart'; + SetPosition(70, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'start server'; + ImageMargin := -1; + ImageName := 'dbs.run'; + TabOrder := 2; + Focusable := False; + OnClick := @btnStartClicked; + Enabled := False; + end; + + btnClear := TfpgButton.Create(Bevel1); + with btnClear do + begin + Name := 'btnClear'; + SetPosition(97, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'clear listview'; + ImageMargin := -1; + ImageName := 'dbs.clean'; + TabOrder := 2; + Focusable := False; + OnClick :=@btnClearClicked; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + // Hook up the menus to the MenuBar + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; + MainMenu.AddMenuItem('Edit', nil).SubMenu := mnuEdit; + MainMenu.AddMenuItem('Help', nil).SubMenu := mnuHelp; +end; + + +end. diff --git a/examples/apps/debugserver/images.inc b/examples/apps/debugserver/images.inc new file mode 100644 index 00000000..166155c9 --- /dev/null +++ b/examples/apps/debugserver/images.inc @@ -0,0 +1,208 @@ + +Const + DBS_clean : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,224, 17,243, 18,130,164, 19,130,165, 97, 87,195,222, + 18,242,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,236, 10, + 248, 29,125,169, 80,193,210, 91,211,225, 52,177,199, 17,139,164, 86, + 93,191,235, 11,247,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 58,110,181, 58,177, + 198, 95,216,231, 38,202,223, 78,212,229,109,217,231, 53,177,198, 25, + 127,168,217, 21,240,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,188, 37,229, 34,150,174,108,218,232, 16,197, + 220, 3,194,218, 3,194,218, 21,198,220, 91,215,231, 87,199,214, 19, + 135,165,192, 34,231,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 44,118,176, 94,207,221, 70,218,237, 24,208,231, 17,203, + 227, 7,196,220, 3,194,218, 3,194,218, 76,211,228, 88,205,220, 15, + 136,163,227, 15,244,255, 0,255,255, 0,255,255, 0,255,229, 14,245, + 24,143,168,139,237,251, 60,229,252, 55,228,251, 47,222,246, 35,215, + 238, 20,205,229, 4,195,219, 3,194,218, 86,214,230, 54,179,199, 87, + 94,192,255, 0,255,255, 0,255,255, 0,255,160, 47,218, 55,169,194, + 138,239,253, 95,234,253, 97,235,253, 82,233,253, 60,230,253, 42,219, + 243, 24,208,231, 16,198,220, 73,210,228,103,212,226, 23,129,167,255, + 0,255,255, 0,255,248, 4,252, 40, 30,176, 22, 65,174,132,234,251, + 107,236,253,132,239,253,109,236,253, 82,233,253, 68,229,251,101,227, + 243,119,221,235, 74,192,207, 38,151,178, 21,128,165,255, 0,255,160, + 52,218, 20,130,166, 49,159,189, 40, 74,187, 29, 56,184, 97,216,246, + 99,234,253,108,235,253,125,238,253,136,234,248, 73,186,206, 13,139, + 162, 92, 91,194,191, 35,230,253, 1,254,255, 0,255,165, 49,220, 10, + 136,161, 79,200,216,104,220,236, 51,109,200, 13, 27,171, 98,177,215, + 114,220,234, 73,183,206, 18,139,165, 97, 89,195,228, 15,245,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,126, 51,194, 1, + 135,156, 65,189,205,119,222,235, 30,102,178, 27, 48,170, 46,118,177, + 136, 65,209,234, 11,247,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,253, 1,254,106, 43,178, 12, 75,133, 11,118,178, 1, + 136,161, 51,173,190, 41,152,181,194, 33,231,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,144, 32,197, 14, 78,139, 15,122,188, 16,125,193, 14, 78,138, 49, + 107,173, 0,139,156,214, 22,239,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 18, 69, + 132, 12,114,178, 16,125,193, 10,107,169, 37, 63,142,253, 1,254,125, + 71,205,236, 10,248,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 26, 66,136, 10,105, + 166, 11,109,171, 10, 71,128,187, 19,219,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,196, 17,224, 37, 64,143, 28, 66, + 137,184, 20,217,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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 + DBS_run : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255, 4,115, 58, 33,130, 79, 99,130, + 114,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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, 44,140, 90, 61,118, + 89,174,174,174,255, 0,255,255, 0,255,255, 0,255,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, 60,157,106, 39,116, + 76,172,174,173,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 9,119, 63,131,219,174, 31,198,113,114,222,167, 75,178,127, 23,116, + 69,168,173,170,255, 0,255,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, + 131,220,175, 17,195,105, 26,204,115,105,223,163, 90,194,141, 19,118, + 67,158,167,163,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, + 16,189,101, 17,193,103, 19,194,105, 89,211,149,103,201,152, 22,124, + 71,136,156,146,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, 13,179, 94, + 14,182, 96, 14,182, 96, 13,180, 95, 71,196,132,112,202,156, 29,130, + 77,103,140,121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 4,115, 58,169,220,193, 12,170, 88, 18,174, 94, + 21,175, 96, 22,173, 97, 19,170, 93, 58,182,119,117,199,157, 40,137, + 87, 78,131,103,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 4,115, 58,169,220,193, 46,173,107, 43,173,106, 39,171,104, + 34,169,100, 28,165, 95, 65,178,120,120,198,159, 41,136, 88,103,140, + 121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4, + 115, 58,169,220,193, 54,173,112, 50,172,109, 45,170,106, 40,168,102, + 88,188,137,120,197,157, 31,128, 78,131,154,142,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169, + 220,193, 62,177,118, 58,175,115, 54,174,112,111,197,152,113,191,151, + 24,123, 73,166,176,171,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, 69, + 180,123, 71,180,124,130,204,166,103,182,140, 23,119, 69,193,197,195, + 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,165,218,191, 87,187,135,144, + 210,176, 91,171,130, 35,119, 76,212,213,212,255, 0,255,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, 76,159,115, 61, + 125, 92,255, 0,255,255, 0,255,255, 0,255,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, 61,147,102, 95,136,115,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,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, 45,136, 89,133,156,144,255, 0,255,255, 0,255,255, 0,255,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 + DBS_pause : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,152,112, 80,164,101, + 52,164,101, 52,152,112, 80,255, 0,255,255, 0,255,152,112, 80,164, + 101, 52,164,101, 52,152,112, 80,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,159,104, 62,201,156,118,205,165, + 133,159,104, 62,255, 0,255,255, 0,255,159,104, 62,201,156,118,205, + 165,133,159,104, 62,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,163,101, 53,215,172,136,225,197,173,163,101, + 53,255, 0,255,255, 0,255,163,101, 53,215,172,136,225,197,173,163, + 101, 53,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,164,101, 52,216,169,129,230,204,181,164,101, 52,255, 0, + 255,255, 0,255,164,101, 52,216,169,129,230,204,181,164,101, 52,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 164,101, 52,215,167,127,230,204,181,164,101, 52,255, 0,255,255, 0, + 255,164,101, 52,215,167,127,230,204,181,164,101, 52,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52, + 215,169,129,230,205,182,164,101, 52,255, 0,255,255, 0,255,164,101, + 52,215,169,129,230,205,182,164,101, 52,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,216,171,132, + 230,206,183,164,101, 52,255, 0,255,255, 0,255,164,101, 52,216,171, + 132,230,206,183,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,164,101, 52,217,174,137,230,206,183, + 164,101, 52,255, 0,255,255, 0,255,164,101, 52,217,174,137,230,206, + 183,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,164,101, 52,217,176,141,230,206,183,164,101, 52, + 255, 0,255,255, 0,255,164,101, 52,217,176,141,230,206,183,164,101, + 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,164,101, 52,217,178,143,230,206,183,164,101, 52,255, 0,255, + 255, 0,255,164,101, 52,217,178,143,230,206,183,164,101, 52,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164, + 101, 52,218,179,145,230,206,183,164,101, 52,255, 0,255,255, 0,255, + 164,101, 52,218,179,145,230,206,183,164,101, 52,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,218, + 181,147,230,207,185,164,101, 52,255, 0,255,255, 0,255,164,101, 52, + 218,181,147,230,207,185,164,101, 52,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,219,182,148,231, + 209,187,164,101, 52,255, 0,255,255, 0,255,164,101, 52,219,182,148, + 231,209,187,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,164,101, 52,221,188,157,231,209,188,164, + 101, 52,255, 0,255,255, 0,255,164,101, 52,221,188,157,231,209,188, + 164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,162,102, 55,220,191,164,223,198,175,162,102, 55,255, + 0,255,255, 0,255,162,102, 55,220,191,164,223,198,175,162,102, 55, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,153,110, 76,171,113, 67,172,114, 68,153,110, 76,255, 0,255,255, + 0,255,153,110, 76,171,113, 67,172,114, 68,153,110, 76,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_stop : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 87, 72,197, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51, + 146, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51,146, 76, + 51,146, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 87, 72,197,135,150,246,124,141,247,114,132,248,104,124,248, 94,115, + 250, 83,106,250, 74, 99,250, 66, 92,251, 58, 85,252, 51, 79,252, 76, + 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197, + 146,158,245,135,150,246,124,141,247,114,133,248,104,124,249, 94,115, + 249, 84,107,250, 75, 99,251, 66, 92,251, 57, 85,252, 76, 51,146,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,155,167,245, + 146,159,245,135,150,247,124,141,247,114,132,248,103,124,248, 94,115, + 249, 84,107,250, 74, 99,251, 65, 92,251, 76, 51,146,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 87, 72,197,166,175,244,156,167,245, + 145,159,245,135,150,246,125,141,247,113,132,247,104,124,248, 93,115, + 249, 84,106,250, 74, 99,251, 76, 51,146,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 87, 72,197,174,183,243,165,175,245,156,167,245, + 145,159,245,135,150,247,124,141,247,114,132,248,104,123,249, 93,115, + 249, 83,107,250, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 87, 72,197,183,190,243,175,183,244,166,176,244,155,168,245, + 146,159,246,135,150,246,124,141,247,114,132,248,103,123,248, 93,115, + 249, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, + 72,197,191,197,242,183,190,243,175,183,244,165,175,244,156,167,245, + 146,159,246,135,149,246,125,141,247,114,132,248,104,124,248, 76, 51, + 146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,199, + 202,241,191,197,243,183,190,243,174,183,244,166,175,244,155,167,245, + 146,159,246,135,150,246,124,141,247,114,132,247, 76, 51,146,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,204,208,241,198, + 203,241,191,197,242,183,191,243,175,183,244,166,175,245,155,168,245, + 145,159,246,135,150,246,125,141,247, 76, 51,146,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 87, 72,197,209,212,241,204,208,242,198, + 203,242,191,197,242,183,190,243,174,184,243,165,175,244,155,168,244, + 145,159,245,135,149,246, 76, 51,146,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, + 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, + 87, 72,197, 87, 72,197,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); diff --git a/examples/apps/debugserver/images/clean.bmp b/examples/apps/debugserver/images/clean.bmp Binary files differnew file mode 100644 index 00000000..74575793 --- /dev/null +++ b/examples/apps/debugserver/images/clean.bmp diff --git a/examples/apps/debugserver/images/pause.bmp b/examples/apps/debugserver/images/pause.bmp Binary files differnew file mode 100644 index 00000000..677d37b2 --- /dev/null +++ b/examples/apps/debugserver/images/pause.bmp diff --git a/examples/apps/debugserver/images/run.bmp b/examples/apps/debugserver/images/run.bmp Binary files differnew file mode 100644 index 00000000..9cccfaa0 --- /dev/null +++ b/examples/apps/debugserver/images/run.bmp diff --git a/examples/apps/debugserver/images/state_error.bmp b/examples/apps/debugserver/images/state_error.bmp Binary files differnew file mode 100644 index 00000000..d99e6440 --- /dev/null +++ b/examples/apps/debugserver/images/state_error.bmp diff --git a/examples/apps/debugserver/images/state_info.bmp b/examples/apps/debugserver/images/state_info.bmp Binary files differnew file mode 100644 index 00000000..d92895ae --- /dev/null +++ b/examples/apps/debugserver/images/state_info.bmp diff --git a/examples/apps/debugserver/images/state_lightbulb.bmp b/examples/apps/debugserver/images/state_lightbulb.bmp Binary files differnew file mode 100644 index 00000000..f9937c70 --- /dev/null +++ b/examples/apps/debugserver/images/state_lightbulb.bmp diff --git a/examples/apps/debugserver/images/state_lightbulb_off.bmp b/examples/apps/debugserver/images/state_lightbulb_off.bmp Binary files differnew file mode 100644 index 00000000..1bdcdb45 --- /dev/null +++ b/examples/apps/debugserver/images/state_lightbulb_off.bmp diff --git a/examples/apps/debugserver/images/state_warning.bmp b/examples/apps/debugserver/images/state_warning.bmp Binary files differnew file mode 100644 index 00000000..e1a75926 --- /dev/null +++ b/examples/apps/debugserver/images/state_warning.bmp diff --git a/examples/apps/debugserver/images/status.bmp b/examples/apps/debugserver/images/status.bmp Binary files differnew file mode 100644 index 00000000..4bdd4ad7 --- /dev/null +++ b/examples/apps/debugserver/images/status.bmp diff --git a/examples/apps/debugserver/images/stop.bmp b/examples/apps/debugserver/images/stop.bmp Binary files differnew file mode 100644 index 00000000..f27fc185 --- /dev/null +++ b/examples/apps/debugserver/images/stop.bmp diff --git a/examples/apps/debugserver/state_images.inc b/examples/apps/debugserver/state_images.inc new file mode 100644 index 00000000..1c6aa2e3 --- /dev/null +++ b/examples/apps/debugserver/state_images.inc @@ -0,0 +1,260 @@ + +Const + DBS_state_info : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,241, 12,227,203, 41, + 155,161, 70, 81,144, 76, 62,142, 75, 62,154, 69, 82,197, 39,156,238, + 11,227,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,224, 28,189,163, 77, 72,178,128, 87,213,183, + 147,219,195,166,218,195,166,210,180,144,171,122, 82,146, 71, 72,216, + 26,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 226, 32,189,163, 81, 60,203,167,125,216,187,159,195,156,119,182,138, + 98,180,134, 96,190,150,114,209,179,151,197,163,119,137, 76, 62,217, + 26,189,255, 0,255,255, 0,255,255, 0,255,244, 15,228,180, 94, 74, + 207,170,129,218,188,162,190,145,102,186,140, 98,183,137, 95,179,132, + 94,177,131, 93,176,131, 92,205,170,141,198,165,121,149, 72, 73,239, + 11,228,255, 0,255,255, 0,255,220, 59,155,191,145, 94,224,194,168, + 197,150,108,194,145,105,225,203,184,254,253,252,255,255,254,234,220, + 208,180,133, 94,179,133, 94,212,181,153,174,123, 86,200, 40,155,255, + 0,255,255, 0,255,197,108, 82,219,188,156,213,173,137,199,152,108, + 195,149,105,193,147,103,237,223,211,250,247,244,187,139, 99,185,138, + 99,184,138, 98,197,157,120,210,184,147,160, 70, 82,255, 0,255,255, + 0,255,193,122, 60,227,199,175,208,162,118,197,153,107,196,151,106, + 196,150,105,238,224,212,251,247,244,191,144,102,190,143,101,190,143, + 100,190,146,105,223,198,170,150, 77, 59,255, 0,255,255, 0,255,199, + 128, 66,228,201,176,208,163,122,204,157,113,199,154,108,197,152,107, + 255,255,255,255,255,254,195,150,105,193,148,104,194,148,104,195,152, + 109,223,197,171,153, 80, 59,255, 0,255,255, 0,255,210,122, 92,224, + 188,159,219,179,147,207,160,117,205,158,114,203,156,113,221,191,163, + 221,191,162,197,153,107,197,153,107,196,152,107,209,171,133,216,186, + 151,172, 74, 82,255, 0,255,255, 0,255,231, 72,164,205,156,104,231, + 203,180,212,165,122,208,160,119,207,158,116,251,248,245,251,248,245, + 203,158,113,203,157,113,205,161,119,223,192,165,185,138, 91,210, 45, + 155,255, 0,255,255, 0,255,249, 20,231,211,128, 90,217,178,140,230, + 202,179,214,169,125,209,165,121,226,196,168,225,195,168,208,162,118, + 209,164,119,221,189,162,208,172,133,180, 92, 74,244, 13,228,255, 0, + 255,255, 0,255,255, 0,255,241, 49,197,209,135, 79,217,178,140,230, + 205,184,224,186,157,215,171,133,214,169,130,217,179,145,225,194,171, + 212,174,134,180,102, 62,230, 36,189,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,242, 49,198,214,131, 91,208,160,106,224, + 191,160,227,197,174,227,197,174,223,188,159,200,151, 98,195,113, 73, + 233, 41,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,250, 21,231,234, 74,168,216,125,101,207, + 133, 78,205,132, 74,209,119, 91,228, 68,161,247, 19,228,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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 + DBS_state_lightbulb : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,212, 61, + 230, 79, 77, 92, 69, 69, 70, 64, 65, 66, 70, 68, 80,201, 65,223,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,131, 85,149,188,188, + 187,235,234,234,205,204,204,163,161,159, 90, 65,109,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,121,105,140,166,165,162,168,162, + 162,157,153,152,148,143,139, 82, 69, 96,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,219, 49,236,102,126,151,122,149,163, 58,138,152, 53,127, + 140, 96,110,118, 46, 67, 88,223, 41,239,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,227, 38,251, + 112,151,225, 70,157,230, 75,190,247, 71,230,253, 65,229,253, 81,195, + 251, 22,124,222, 61,123,211,213, 47,247,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,230, 35,251,105,159,233,166,211,243, + 101,174,240,116,225,246,115,225,246,114,224,246,113,224,246, 76,163, + 236,156,195,239, 44,125,215,201, 59,245,255, 0,255,255, 0,255,255, + 0,255,253, 3,255,127,153,236,165,212,243,220,250,254, 56,161,235, + 116,225,246,106,228,246, 93,226,245,114,224,246, 22,145,232,192,245, + 253,172,206,241, 45,124,215,234, 25,251,255, 0,255,255, 0,255,183, + 102,245,139,200,239,236,252,254,119,225,247, 47,153,234,117,225,246, + 116,225,246,104,222,245,115,225,246, 9,134,230, 70,213,243,220,254, + 254,111,170,229,121,115,230,255, 0,255,255, 0,255,127,169,238,201, + 233,249,212,249,253,124,227,247,134,229,248, 96,177,239,104,181,239, + 99,180,239, 76,166,236,130,228,247, 89,220,245,138,235,250,203,226, + 247, 57,135,218,255, 0,255,255, 0,255,126,192,238,223,246,253,200, + 245,252,205,246,252,214,247,253,211,244,252,207,242,252,202,241,251, + 196,240,252,186,242,251,150,234,248,114,229,247,226,244,253, 50,136, + 216,255, 0,255,255, 0,255,149,183,242,210,239,251,219,249,254,223, + 249,253,236,251,254,238,252,254,239,252,254,239,252,254,235,251,254, + 224,249,254,184,241,251,168,241,251,203,229,248, 62,141,221,255, 0, + 255,255, 0,255,200,115,249,180,227,248,229,250,254,219,248,253,228, + 250,254,240,252,254,249,254,255,249,254,255,239,252,254,210,246,253, + 180,241,251,237,253,255,107,179,234,136,121,236,255, 0,255,255, 0, + 255,252, 10,255,181,173,246,195,235,250,226,249,253,224,249,253,213, + 247,253,207,246,253,201,244,252,199,244,252,214,249,253,235,250,254, + 144,202,242, 80,151,230,243, 17,253,255, 0,255,255, 0,255,255, 0, + 255,247, 22,254,196,159,249,183,228,248,199,236,251,215,243,252,225, + 247,253,226,248,254,216,240,252,182,223,248,107,187,237,108,152,235, + 232, 33,252,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,227, 82,251,193,156,248,168,192,246,148,202,241,133, + 197,240,128,182,240,135,157,240,187, 98,246,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_state_warning : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 123,108,237, 45,167,224, 43,164,223, 41,161,221, 39,158,220, 37,155, + 218, 35,152,217, 32,147,214, 27,140,211, 22,133,207, 17,126,204, 13, + 119,201, 9,113,198, 6,108,195, 3,104,193, 93, 64,214, 72,154,230, + 190,227,245,244,252,254,239,251,254,238,251,254,238,251,254,239,252, + 254,239,252,254,239,251,254,238,251,254,237,251,254,237,251,254,236, + 251,254,242,252,254,171,206,235, 42, 88,202,195, 52,247, 98,191,232, + 244,252,254,181,239,250, 88,218,245, 88,218,245, 87,216,243, 88,215, + 242, 88,214,242, 87,217,244, 81,216,245, 78,215,244, 98,218,246,234, + 251,254, 68,147,210,182, 32,237,255, 0,255, 94,139,234,157,215,241, + 231,249,253,139,229,248, 90,219,246, 91,218,244, 61,161,213, 61,161, + 213, 84,214,242, 82,216,245, 80,214,244,216,246,252,136,191,229, 85, + 85,217,255, 0,255,255, 0,255,227, 25,251, 55,174,229,243,251,254, + 195,242,251, 92,220,246, 92,218,244,100,223,246, 87,203,235, 85,214, + 242, 84,217,245,148,231,248,227,244,251, 28,132,209,222, 18,248,255, + 0,255,255, 0,255,255, 0,255,121,119,238,140,210,240,234,251,254, + 148,230,248, 92,218,244, 71,177,221, 61,161,213, 86,215,242, 92,219, + 245,222,248,253,125,192,231,135, 75,232,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,246, 9,254, 69,167,232,200,234,247,230,250,253, + 93,218,244, 61,161,213, 61,161,213, 87,215,242,199,243,252,192,227, + 244, 59,137,221,245, 7,253,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,185, 64,247,113,200,237,249,254,255, 94,220,244, + 62,162,213, 62,162,213, 92,217,244,237,251,254,104,187,229,178, 55, + 242,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 90,152,236,169,223,244,237,249,253, 62,163,214, + 62,163,214,212,245,252,162,215,241, 93,125,230,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,218, 35,251, 58,182,232,249,253,255,148,233,249,158,235,250, + 236,250,254, 49,167,225,215, 31,249,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,116,131,239,148,216,242,243,252,254,231,250,254,143,211,240, + 134,101,239,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,241, + 13,254, 68,177,234,241,250,253,213,239,250, 67,165,232,241, 12,253, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,141, + 110,243,133,212,241,130,209,240,173, 75,245,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,253, 2,255, 93, + 156,238,104,142,239,253, 2,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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 + DBS_state_error : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,227, 11,247,154, 37, + 227, 76, 62,204, 54, 67,197, 52, 65,195, 70, 57,199,149, 31,222,225, + 9,246,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,191, 27,239, 76, 74,209, 82,100,212,132,144, + 231,149,160,238,149,159,237,131,142,229, 76, 93,206, 61, 59,195,184, + 21,233,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 193, 30,241, 71, 85,213,117,132,227,161,172,244,127,139,236, 92,103, + 228, 91,102,227,125,135,234,159,168,241,111,124,221, 50, 64,194,185, + 21,234,255, 0,255,255, 0,255,255, 0,255,231, 13,250, 89, 86,222, + 120,136,230,163,176,245, 87,103,231, 86,101,230,137,146,237,136,146, + 236, 83, 95,226, 82, 93,225,159,169,242,111,125,221, 65, 61,198,226, + 9,246,255, 0,255,255, 0,255,168, 51,240, 96,115,224,164,179,247, + 90,110,235, 89,108,234, 88,105,232,255,255,255,255,255,255, 85, 98, + 229, 84, 97,227, 83, 95,226,159,169,242, 80, 97,209,151, 35,225,255, + 0,255,255, 0,255,106, 94,233,142,159,240,132,153,244, 92,115,238, + 91,112,236, 90,110,235,144,157,241,166,175,243, 87,103,231, 86,101, + 230, 85, 98,229,125,137,235,133,145,231, 78, 64,206,255, 0,255,255, + 0,255, 93,109,234,160,179,247,101,128,242, 95,120,240, 93,118,239, + 92,115,238,211,217,250,255,255,255, 89,108,234, 88,105,232, 87,103, + 231, 93,108,231,153,165,241, 60, 76,204,255, 0,255,255, 0,255, 97, + 114,238,161,182,248,103,132,244, 96,124,243, 95,122,241, 95,120,240, + 255,255,255,255,255,255, 91,112,236, 90,110,235, 89,108,234, 95,111, + 233,155,168,241, 65, 80,208,255, 0,255,255, 0,255,118,105,243,145, + 166,243,136,161,248, 98,128,244, 97,126,243, 96,124,243,255,255,255, + 255,255,255, 93,118,239, 92,115,238, 91,112,236,130,147,241,137,152, + 236, 89, 76,216,255, 0,255,255, 0,255,178, 62,250,108,129,236,169, + 189,251, 99,130,245, 98,129,245, 98,128,244,255,255,255,255,255,255, + 95,122,241, 95,120,240, 93,118,239,165,181,248, 93,112,221,162, 46, + 235,255, 0,255,255, 0,255,235, 17,254,117,114,247,131,151,240,169, + 189,251, 99,130,245, 99,130,245,255,255,255,255,255,255, 97,126,243, + 96,124,243,166,185,249,123,141,234, 92, 90,225,231, 13,250,255, 0, + 255,255, 0,255,255, 0,255,206, 43,253,109,123,248,132,151,241,169, + 189,251,138,163,248,107,137,246,107,137,246,137,162,248,168,188,250, + 127,146,236, 89,103,229,198, 34,246,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,206, 43,253,119,117,250,110,131,238,146, + 166,244,160,180,248,160,180,248,145,166,243,104,125,233,105,104,237, + 200, 37,248,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,235, 18,255,181, 65,253,124,112,250,108, + 122,247,106,120,245,119,106,245,177, 60,248,233, 16,253,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,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 + DBS_state_lightbulb_off : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,212, 61, + 230, 79, 77, 92, 69, 69, 70, 64, 65, 66, 70, 68, 80,201, 65,223,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,131, 85,149,188,188, + 187,235,234,234,205,204,204,163,161,159, 90, 65,109,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,121,105,140,166,165,162,168,162, + 162,157,153,152,148,143,139, 82, 69, 96,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,243, 57,227,102,126,151,152,161,154,105,145,134,100,136, + 123,129,127,113, 46, 67, 88,244, 48,230,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,248, 41,238, + 216,175,166,207,186,147,212,193,158,213,194,160,212,193,157,215,197, + 164,195,168,118,201,164,133,244, 54,229,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,249, 38,240,215,178,166,232,222,203, + 217,200,168,221,206,179,221,206,178,221,206,178,221,206,178,210,190, + 154,229,217,196,198,168,125,241, 69,222,255, 0,255,255, 0,255,255, + 0,255,255, 3,254,222,169,180,232,222,203,247,243,237,145,174,179, + 221,206,179,219,203,174,216,199,167,221,206,178,127,161,167,240,234, + 222,233,223,205,198,165,126,249, 29,242,255, 0,255,255, 0,255,236, + 109,213,225,212,187,251,249,246,223,209,182,141,169,176,221,206,179, + 221,206,179,218,202,172,221,206,178,119,153,161,210,190,154,247,243, + 237,217,200,168,219,139,173,255, 0,255,255, 0,255,222,179,180,242, + 236,225,245,240,232,223,209,183,226,213,190,167,189,195,172,192,197, + 169,191,196,156,180,187,224,211,186,215,197,165,228,216,193,242,236, + 225,202,170,134,255, 0,255,255, 0,255,222,201,180,247,243,237,242, + 236,226,243,238,228,245,241,233,244,239,230,243,238,229,242,236,226, + 241,235,224,239,232,218,229,218,197,221,206,178,248,245,239,199,173, + 129,255, 0,255,255, 0,255,227,189,193,243,238,229,246,242,236,247, + 243,237,251,249,246,251,249,246,251,249,246,251,249,246,250,248,244, + 248,245,239,238,231,217,234,225,208,242,236,225,204,172,139,255, 0, + 255,255, 0,255,241,117,224,237,229,214,249,247,242,246,242,236,249, + 247,242,251,250,247,254,254,253,254,254,253,251,249,246,244,239,230, + 237,229,214,251,249,246,217,200,168,224,136,184,255, 0,255,255, 0, + 255,254, 10,253,236,174,212,240,234,222,248,245,239,247,243,237,245, + 241,233,243,238,229,242,236,226,242,236,225,245,241,233,250,248,244, + 227,215,192,209,171,152,252, 18,248,255, 0,255,255, 0,255,255, 0, + 255,253, 22,251,240,161,221,237,229,214,242,236,225,245,241,233,248, + 245,239,248,245,240,245,241,233,237,229,214,217,200,169,218,168,170, + 249, 35,241,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,248, 82,239,239,158,220,234,195,206,228,208,194,224, + 203,185,222,190,182,225,165,186,237,102,215,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); diff --git a/examples/apps/docedit/docedit.lpi b/examples/apps/docedit/docedit.lpi index 98b5cf0f..640d3114 100644 --- a/examples/apps/docedit/docedit.lpi +++ b/examples/apps/docedit/docedit.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -31,7 +30,7 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="8"> + <Units Count="7"> <Unit0> <Filename Value="docedit.lpr"/> <IsPartOfProject Value="True"/> @@ -58,27 +57,19 @@ <UnitName Value="FPDEUtil"/> </Unit4> <Unit5> - <Filename Value="pkeditor.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="PkEditor"/> - </Unit5> - <Unit6> <Filename Value="doceditmsg.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="doceditmsg"/> - </Unit6> - <Unit7> + </Unit5> + <Unit6> <Filename Value="doceditopts.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="doceditopts"/> - </Unit7> + </Unit6> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> <Other> <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> diff --git a/examples/apps/docedit/docedit.lpr b/examples/apps/docedit/docedit.lpr index e9a6a915..07f849e5 100644 --- a/examples/apps/docedit/docedit.lpr +++ b/examples/apps/docedit/docedit.lpr @@ -7,9 +7,8 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, - fpgfx, - frm_main, frm_options, model, FPDEUtil, PkEditor, doceditmsg, doceditopts, - fpgui_toolkit; + fpg_main, + frm_main, frm_options, model, FPDEUtil, doceditmsg, doceditopts; procedure MainProc; diff --git a/examples/apps/docedit/frm_main.pas b/examples/apps/docedit/frm_main.pas index e2ddca95..f6404b79 100644 --- a/examples/apps/docedit/frm_main.pas +++ b/examples/apps/docedit/frm_main.pas @@ -11,16 +11,16 @@ interface uses Classes, SysUtils, - gfxbase, - fpgfx, - gui_form, - gui_button, - gui_edit, - gui_label, - gui_menu, - gui_memo, - gui_tree, - gui_bevel, + fpg_base, + fpg_main, + fpg_form, + fpg_button, + fpg_edit, + fpg_label, + fpg_menu, + fpg_memo, + fpg_tree, + fpg_panel, dom, XMLWrite, XMLRead, contnrs, model; type @@ -63,7 +63,7 @@ type implementation uses - gui_dialogs, frm_options; + fpg_dialogs, frm_options; const @@ -150,7 +150,7 @@ begin ShowMessage(cAppName + #10 + #10 + 'Written by Graeme Geldenhuys - 2007' - + #10 + 'Using the ' + fpGUIName + ' v' + fpGUIVersion + + #10 + 'Using the ' + fpGUIName + ' v' + fpGUI_Version ,'About'); end; @@ -275,7 +275,6 @@ begin Text := 'Quit'; FontDesc := '#Label1'; ImageName := 'stdimg.Quit'; - ModalResult := 0; ShowImage := True; OnClick := @btnQuitClicked; end; diff --git a/examples/apps/docedit/frm_options.pas b/examples/apps/docedit/frm_options.pas index 0b552317..d34ef758 100644 --- a/examples/apps/docedit/frm_options.pas +++ b/examples/apps/docedit/frm_options.pas @@ -5,12 +5,12 @@ unit frm_options; interface uses - SysUtils, Classes, gfxbase, fpgfx, gui_edit, - gfx_widget, gui_form, gui_label, gui_button, - gui_listbox, gui_memo, gui_combobox, gui_grid, - gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, - gui_progressbar, gui_radiobutton, gui_tab, gui_menu, - gui_bevel; + SysUtils, Classes, fpg_base, fpg_main, fpg_edit, + fpg_widget, fpg_form, fpg_label, fpg_button, + fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, + fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, + fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, + fpg_panel; type @@ -155,7 +155,6 @@ begin Text := '...'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; end; edtFPDoc := TfpgEdit.Create(self); @@ -175,7 +174,6 @@ begin Text := '...'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; end; cbShowHints := TfpgCheckBox.Create(self); @@ -204,7 +202,7 @@ begin Text := 'OK'; FontDesc := '#Label1'; ImageName := 'stdimg.ok'; - ModalResult := 1; + ModalResult := mrOK; end; btnCancel := TfpgButton.Create(self); @@ -215,7 +213,7 @@ begin Text := 'Cancel'; FontDesc := '#Label1'; ImageName := 'stdimg.cancel'; - ModalResult := 2; + ModalResult := mrCancel; end; lblName5 := TfpgLabel.Create(self); diff --git a/examples/apps/docedit/pkeditor.pas b/examples/apps/docedit/pkeditor.pas index 0dcde7f1..57caf197 100644 --- a/examples/apps/docedit/pkeditor.pas +++ b/examples/apps/docedit/pkeditor.pas @@ -27,8 +27,8 @@ unit PkEditor; interface uses - SysUtils, Classes, DOM, gui_bevel, gui_label, gui_tree, gui_menu, - gfx_imagelist, FPDEUtil, doceditmsg, doceditopts; + SysUtils, Classes, DOM, fpg_panel, fpg_label, fpg_tree, fpg_menu, + fpg_imagelist, FPDEUtil, doceditmsg, doceditopts; Type { TPackageEditor } diff --git a/examples/corelib/canvastest/fpgcanvas.lpi b/examples/corelib/canvastest/fpgcanvas.lpi index 66833b5b..5516e884 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpi +++ b/examples/corelib/canvastest/fpgcanvas.lpi @@ -5,15 +5,16 @@ <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> - <Title Value="fpcanvas"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -45,6 +46,9 @@ <SmartLinkUnit Value="True"/> </CodeGeneration> <Linking> + <Debugging> + <UseLineInfoUnit Value="False"/> + </Debugging> <LinkSmart Value="True"/> </Linking> <Other> diff --git a/examples/corelib/canvastest/fpgcanvas.lpr b/examples/corelib/canvastest/fpgcanvas.lpr index c5473ba9..9d0656e4 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpr +++ b/examples/corelib/canvastest/fpgcanvas.lpr @@ -15,20 +15,18 @@ uses type - { TMainForm } - TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} bmp: TfpgImage; dst: TfpgImage; - procedure FormPaint(Sender: TObject); - procedure CustomPaintJob; - protected - procedure HandlePaint; override; + procedure FormPaint(Sender: TObject); + procedure CustomPaintJob; public - procedure AfterCreate; override; - procedure AfterConstruction; override; - procedure BeforeDestruction; override; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; end; { TMainForm } @@ -46,10 +44,17 @@ var fnt: TfpgFont; y: integer; c: TfpgColor; + lImage: TfpgImage; begin // Testing Rectangles Canvas.SetColor(clBlack); - r.SetRect(0, 0, 1, 1); + r.SetRect(0, 0, 1, 1); // 1x1 (this is really a dot) + Canvas.DrawRectangle(r); + Canvas.SetColor(clRed); + r.SetRect(0, 1, 1, 5); // 1x5 (this is really a vertical line) + Canvas.DrawRectangle(r); + Canvas.SetColor(clMagenta); + r.SetRect(1, 0, 5, 1); // 5x1 (this is really a horizontal line) Canvas.DrawRectangle(r); Canvas.SetColor(clBlack); @@ -138,15 +143,26 @@ begin // Testing Bitmap painting Canvas.DrawString(5, 180, 'Single BMP file:'); - Canvas.DrawString(300, 210, '(mask enabled for all images)'); + Canvas.DrawString(310, 210, '(mask enabled for all images)'); Canvas.DrawImage(150, 180, bmp); Canvas.DrawString(5, 210, 'Parts of BMP file:'); Canvas.DrawImagePart(150, 210, bmp, 0, 0, 32, 21); Canvas.DrawImagePart(190, 210, bmp, 32, 0, 32, 21); Canvas.DrawImagePart(230, 210, bmp, 64, 0, 32, 21); + // create image from an image + r.SetRect(32, 0, 32, 21); // second button in image + lImage := bmp.ImageFromRect(r); + try + lImage.CreateMaskFromSample(0, 0); + lImage.UpdateImage; + Canvas.DrawImage(270, 215, lImage); + finally + lImage.Free; + end; - Canvas.StretchDraw(150, 240, 300, 50, bmp); + // Testing Bitmap strechdraw + Canvas.StretchDraw(150, 240, 300, 50, bmp); Canvas.DrawImage(150, 300, dst); Canvas.StretchDraw(180, 300, 70, 70, dst); Canvas.StretchDraw(265, 300, 230, 25, bmp); @@ -186,47 +202,46 @@ begin // Gradient testing r.SetRect(265, 340, 185, 35); Canvas.GradientFill(r, clBlue, clMagenta, gdHorizontal); - -end; - -procedure TMainForm.HandlePaint; -begin - inherited HandlePaint; -// CustomPaintJob; end; -procedure TMainForm.AfterCreate; +constructor TMainForm.Create(AOwner: TComponent); begin - inherited AfterCreate; - SetPosition(100, 100, 500, 400); - WindowTitle := 'fpGFX Canvas Test'; + inherited Create(AOwner); bmp := LoadImage_BMP('button.bmp'); if not Assigned(bmp) then raise Exception.Create('Failed to load button.bmp'); bmp.CreateMaskFromSample(0,0); bmp.UpdateImage; - -// dst := TfpgImage.Create; -// dst.AllocateImage(bmp.ColorDepth, 200, 50); + dst := LoadImage_BMP('gears2.bmp'); dst.CreateMaskFromSample(0,0); dst.UpdateImage; end; -procedure TMainForm.AfterConstruction; +destructor TMainForm.Destroy; begin - inherited AfterConstruction; - OnPaint := @FormPaint; + dst.Free; + bmp.Free; + inherited Destroy; end; -procedure TMainForm.BeforeDestruction; +procedure TMainForm.AfterCreate; begin - dst.Free; - bmp.Free; - inherited BeforeDestruction; + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(357, 214, 500, 400); + WindowTitle := 'fpGUI Canvas Test'; + Hint := ''; + WindowPosition := wpOneThirdDown; + OnPaint := @FormPaint; + + {@VFD_BODY_END: MainForm} + {%endregion} end; + procedure MainProc; var frm: TMainForm; diff --git a/examples/corelib/canvastest/linux_screenshot.png b/examples/corelib/canvastest/linux_screenshot.png Binary files differindex e7268d23..bd5c519c 100644 --- a/examples/corelib/canvastest/linux_screenshot.png +++ b/examples/corelib/canvastest/linux_screenshot.png diff --git a/examples/corelib/canvastest/windows_screenshot.png b/examples/corelib/canvastest/windows_screenshot.png Binary files differnew file mode 100644 index 00000000..13305e95 --- /dev/null +++ b/examples/corelib/canvastest/windows_screenshot.png diff --git a/examples/corelib/compileall.sh b/examples/corelib/compileall.sh new file mode 100755 index 00000000..1fed112d --- /dev/null +++ b/examples/corelib/compileall.sh @@ -0,0 +1,16 @@ +#!/bin/sh +FPC=fpc +for f in `find -name '*.lpr'` +do + DIR=`dirname $f` + PROJECT=`basename $f` + LPRNAME=`basename $PROJECT .lpr` + echo Doing $LPRNAME in $DIR + cd $DIR + if [ ! -d units ]; then + echo 'Missing units dir' + mkdir units + fi + $FPC @extrafpc.cfg $PROJECT; + cd .. +done diff --git a/examples/corelib/helloworld/helloworld.pas b/examples/corelib/helloworld/helloworld.pas index be6b99c3..d7178c9d 100644 --- a/examples/corelib/helloworld/helloworld.pas +++ b/examples/corelib/helloworld/helloworld.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -26,6 +26,7 @@ uses const HelloWorldString: String = 'Hello, world!'; + ClickToClose: String = 'click to close'; type @@ -35,6 +36,7 @@ type procedure MsgPaint(var msg: TfpgMessageRec); message FPGM_PAINT; procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE; procedure MsgResize(var msg: TfpgMessageRec); message FPGM_RESIZE; + procedure MsgMouseUp(var msg: TfpgMessageRec); message FPGM_MOUSEUP; public constructor Create(AOwner: TComponent); override; procedure Show; @@ -55,36 +57,43 @@ begin DoSetWindowVisible(True); // We can't set a title if we don't have a window handle. So we do that here // and not in the constructor. - SetWindowTitle('fpGFX Hello World'); + SetWindowTitle('fpGUI Hello World'); end; procedure TMainWindow.MsgPaint(var msg: TfpgMessageRec); var - Color: TfpgColor; r: TfpgRect; i: Integer; + fnt: TfpgFont; begin Canvas.BeginDraw; // begin double buffering - Color := 0; - r.SetRect(0, 0, Width, 1); - for i := 0 to FHeight-1 do - begin - Color := $ff - (i * $ff) div FHeight; // shades of Blue - Canvas.SetColor(Color); - r.Top := i; - Canvas.DrawRectangle(r); - end; + r.SetRect(0, 0, Width, Height); + Canvas.GradientFill(r, clBlue, clBlack, gdVertical); + + fnt := fpgGetFont('Arial-20'); + try + Canvas.Font := fnt; - Canvas.Font := fpgGetFont('Arial-30'); + Canvas.SetTextColor(clBlack); + Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 + 1, + (Height - Canvas.Font.Height) div 2 + 1, HelloWorldString); - Canvas.SetTextColor(clBlack); - Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 + 1, - (Height - Canvas.Font.Height) div 2 + 1, HelloWorldString); + Canvas.SetTextColor(clWhite); + Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 - 1, + (Height - Canvas.Font.Height) div 2 - 1, HelloWorldString); + finally + fnt.Free; + end; - Canvas.SetTextColor(clWhite); - Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 - 1, - (Height - Canvas.Font.Height) div 2 - 1, HelloWorldString); + fnt := fpgGetFont('Arial-10'); + try + Canvas.Font := fnt; + Canvas.DrawString((Width - Canvas.Font.TextWidth(ClickToClose)) div 2 - 1, + Height - (Canvas.Font.Height*2), ClickToClose); + finally + fnt.Free; + end; Canvas.EndDraw; end; @@ -92,7 +101,7 @@ end; procedure TMainWindow.MsgClose(var msg: TfpgMessageRec); begin ReleaseWindowHandle; - Halt(0); + fpgApplication.Terminate; end; procedure TMainWindow.MsgResize(var msg: TfpgMessageRec); @@ -101,6 +110,11 @@ begin FHeight := msg.Params.rect.Height; end; +procedure TMainWindow.MsgMouseUp(var msg: TfpgMessageRec); +begin + MsgClose(msg); +end; + var @@ -108,6 +122,7 @@ var begin fpgApplication.Initialize; MainWindow := TMainWindow.Create(nil); + fpgApplication.MainForm := MainWindow; MainWindow.Show; fpgApplication.Run; MainWindow.Free; diff --git a/examples/gui/animation/anim_test.lpi b/examples/gui/animation/anim_test.lpi index b7506331..16a03599 100644 --- a/examples/gui/animation/anim_test.lpi +++ b/examples/gui/animation/anim_test.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=".elf"/> </General> <VersionInfo> @@ -43,8 +42,7 @@ <CompilerOptions> <Version Value="8"/> <Other> - <CustomOptions Value="-FUunits -"/> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/animation/anim_test.lpr b/examples/gui/animation/anim_test.lpr index 79a2bbb8..b7baef3b 100644 --- a/examples/gui/animation/anim_test.lpr +++ b/examples/gui/animation/anim_test.lpr @@ -28,6 +28,8 @@ type lblName1: TfpgLabel; lblName2: TfpgLabel; lblName3: TfpgLabel; + loadinglogo: TfpgImgAnim; + Label1: TfpgLabel; {@VFD_HEAD_END: MainForm} procedure AfterCreate; override; end; @@ -86,7 +88,9 @@ begin SetPosition(212, 216, 80, 24); Text := 'Quit'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; + TabOrder := 0; OnClick := @btnQuitClicked; end; @@ -97,6 +101,7 @@ begin SetPosition(140, 12, 80, 24); Text := 'Start'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 1; OnClick := @btnStartClicked; @@ -139,6 +144,7 @@ begin Name := 'lblName1'; SetPosition(140, 52, 152, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Step through frames'; end; @@ -146,8 +152,9 @@ begin with lblName2 do begin Name := 'lblName2'; - SetPosition(56, 136, 192, 16); + SetPosition(56, 136, 108, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Wanda the fish'; end; @@ -157,9 +164,32 @@ begin Name := 'lblName3'; SetPosition(140, 68, 152, 16); FontDesc := '#Label1'; + Hint := ''; Text := '(stop the animation first)'; end; + loadinglogo := TfpgImgAnim.Create(self); + with loadinglogo do + begin + Name := 'loadinglogo'; + SetPosition(236, 156, 16, 16); + IsTransparent := True; + ImageFileName := 'loading.bmp'; + FrameCount := 8; + Interval := 200; + Enabled := True; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(204, 136, 112, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Loading...'; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/examples/gui/animation/loading.bmp b/examples/gui/animation/loading.bmp Binary files differnew file mode 100644 index 00000000..cf976c53 --- /dev/null +++ b/examples/gui/animation/loading.bmp diff --git a/examples/gui/animation/loading.xcf b/examples/gui/animation/loading.xcf Binary files differnew file mode 100644 index 00000000..77491058 --- /dev/null +++ b/examples/gui/animation/loading.xcf diff --git a/examples/gui/bevel/beveltest.lpi b/examples/gui/bevel/beveltest.lpi index c29961c6..2486d074 100644 --- a/examples/gui/bevel/beveltest.lpi +++ b/examples/gui/bevel/beveltest.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/bevel/beveltest.lpr b/examples/gui/bevel/beveltest.lpr index f3e1a23c..4fae96c2 100644 --- a/examples/gui/bevel/beveltest.lpr +++ b/examples/gui/bevel/beveltest.lpr @@ -12,7 +12,8 @@ uses fpg_form, fpg_button, fpg_panel, - fpg_label; + fpg_label, + fpg_checkbox; type TMainForm = class(TfpgForm) @@ -25,6 +26,8 @@ type lblStyle: TfpgLabel; lblShape: TfpgLabel; lblNext: TfpgLabel; + chkDouble: TfpgCheckBox; + procedure chkDoubleChanged(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure btnStylesClick(Sender: TObject); procedure btnShapesClick(Sender: TObject); @@ -34,6 +37,14 @@ type { TMainForm } +procedure TMainForm.chkDoubleChanged(Sender: TObject); +begin + if chkDouble.Checked then + Bevel.BorderStyle := bsDouble + else + Bevel.BorderStyle := bsSingle; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -88,6 +99,8 @@ begin lblNext := CreateLabel(self, 200, 80, 'Next value is...'); btnShapes := CreateButton(self, 200, 100, 90, 'bsFrame', @btnShapesClick); btnStyles := CreateButton(self, 200, 130, 90, 'bsLowered', @btnStylesClick); + chkDouble := CreateCheckBox(self, 200, 160, 'Double Line'); + chkDouble.OnChange := @chkDoubleChanged; lblShape := CreateLabel(self, 6, 190, 'Shape is bsBox'); lblStyle := CreateLabel(self, 6, 210, 'Style is bsRaised'); diff --git a/examples/gui/calendar/calendartest.lpi b/examples/gui/calendar/calendartest.lpi index f4094a2a..20afc9c1 100644 --- a/examples/gui/calendar/calendartest.lpi +++ b/examples/gui/calendar/calendartest.lpi @@ -12,7 +12,7 @@ <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -46,6 +46,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/calendar/calendartest.lpr b/examples/gui/calendar/calendartest.lpr index 67e94651..5de312f2 100644 --- a/examples/gui/calendar/calendartest.lpr +++ b/examples/gui/calendar/calendartest.lpr @@ -1,7 +1,3 @@ -{ - This is still under development!!!!!!!!!!!!!!!!! -} - program calendartest; {$mode objfpc}{$H+} @@ -36,6 +32,9 @@ type cbCloseOnSelect: TfpgCheckBox; lblName1: TfpgLabel; bvlName1: TfpgBevel; + CalendarCombo1: TfpgCalendarCheckCombo; + Label1: TfpgLabel; + cbSingleClickClose: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure btnDateFormatClicked(Sender: TObject); procedure btnTodayClicked(Sender: TObject); @@ -44,6 +43,7 @@ type procedure cbWHolidayChange(Sender: TObject); procedure cbName1Change(Sender: TObject); procedure cbCloseOnSelectChanged(Sender: TObject); + procedure cbSingleClickCloseChanged(Sender: TObject); procedure btnClearClicked(Sender: TObject); procedure DrawCalendar(month, year: integer); public @@ -60,6 +60,11 @@ begin cal.CloseOnSelect := TfpgCheckBox(Sender).Checked; end; +procedure TMainForm.cbSingleClickCloseChanged(Sender: TObject); +begin + cal.SingleClickSelect := TfpgCheckBox(Sender).Checked; +end; + procedure TMainForm.btnClearClicked(Sender: TObject); begin cbWHoliday.FocusItem := -1; @@ -181,8 +186,9 @@ begin inherited AfterCreate; {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; - SetPosition(286, 234, 372, 275); + SetPosition(362, 186, 372, 340); WindowTitle := 'fpGUI Calendar Test'; + Hint := ''; WindowPosition := wpUser; btnClear := TfpgButton.Create(self); @@ -215,6 +221,7 @@ begin Name := 'cbWHoliday'; SetPosition(132, 32, 120, 23); FontDesc := '#List'; + Hint := ''; Items.Add('Sun'); Items.Add('Mon'); Items.Add('Tue'); @@ -232,6 +239,7 @@ begin Name := 'cbName1'; SetPosition(132, 64, 120, 23); FontDesc := '#List'; + Hint := ''; Items.Add('Sun'); Items.Add('Mon'); Items.Add('Tue'); @@ -248,10 +256,11 @@ begin with cal do begin Name := 'cal'; - SetPosition(132, 224, 120, 23); + SetPosition(132, 268, 120, 23); + DateFormat := 'dd mmm yyyy'; FontDesc := '#List'; + Hint := ''; TabOrder := 5; - DateFormat := 'dd mmm yyyy'; DayColor := clBlue; HolidayColor := clRed; SelectedColor:= clYellow; @@ -261,7 +270,7 @@ begin with btnDateFormat do begin Name := 'btnDateFormat'; - SetPosition(232, 116, 75, 23); + SetPosition(232, 160, 75, 23); Text := 'Set Format'; FontDesc := '#Label1'; Hint := ''; @@ -274,7 +283,9 @@ begin with edtDateFormat do begin Name := 'edtDateFormat'; - SetPosition(132, 116, 92, 22); + SetPosition(132, 160, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 7; Text := 'yy-mm-d'; FontDesc := '#Edit1'; @@ -294,7 +305,7 @@ begin with lblName5 do begin Name := 'lblName5'; - SetPosition(8, 228, 104, 15); + SetPosition(8, 272, 104, 15); FontDesc := '#Label1'; Hint := ''; Text := 'Calendar Combo:'; @@ -304,7 +315,7 @@ begin with btnToday do begin Name := 'btnToday'; - SetPosition(256, 224, 59, 23); + SetPosition(256, 268, 59, 23); Text := 'Today'; FontDesc := '#Label1'; Hint := ''; @@ -317,7 +328,9 @@ begin with edtMinDate do begin Name := 'edtMinDate'; - SetPosition(132, 144, 92, 22); + SetPosition(132, 188, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 13; Text := '2005-01-01'; FontDesc := '#Edit1'; @@ -327,7 +340,9 @@ begin with edtMaxDate do begin Name := 'edtMaxDate'; - SetPosition(132, 172, 92, 22); + SetPosition(132, 216, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 14; Text := '2009-01-01'; FontDesc := '#Edit1'; @@ -337,7 +352,7 @@ begin with btnMinDate do begin Name := 'btnMinDate'; - SetPosition(232, 144, 75, 23); + SetPosition(232, 188, 75, 23); Text := 'Min Date'; FontDesc := '#Label1'; Hint := ''; @@ -350,7 +365,7 @@ begin with btnMaxDate do begin Name := 'btnMaxDate'; - SetPosition(232, 172, 75, 23); + SetPosition(232, 216, 75, 23); Text := 'Max Date'; FontDesc := '#Label1'; Hint := ''; @@ -366,6 +381,7 @@ begin SetPosition(128, 92, 236, 20); Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 17; Text := 'Close combo on date selection'; OnChange := @cbCloseOnSelectChanged; @@ -385,11 +401,46 @@ begin with bvlName1 do begin Name := 'bvlName1'; - SetPosition(8, 204, 350, 2); + SetPosition(8, 248, 350, 2); Anchors := [anLeft,anRight,anTop]; + Hint := ''; Style := bsLowered; end; + CalendarCombo1 := TfpgCalendarCheckCombo.Create(self); + with CalendarCombo1 do + begin + Name := 'CalendarCombo1'; + SetPosition(132, 308, 120, 22); + Checked := True; + DateFormat := 'yyyy-mm-dd'; + FontDesc := '#List'; + Hint := ''; + TabOrder := 18; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 312, 116, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Optional date:'; + end; + + cbSingleClickClose := TfpgCheckBox.Create(self); + with cbSingleClickClose do + begin + Name := 'cbSingleClickClose'; + SetPosition(128, 112, 236, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 20; + Text := 'Single click selection'; + OnChange := @cbSingleClickCloseChanged; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/examples/gui/colorwheel/frm_main.pas b/examples/gui/colorwheel/frm_main.pas index 3633b740..63518360 100644 --- a/examples/gui/colorwheel/frm_main.pas +++ b/examples/gui/colorwheel/frm_main.pas @@ -67,14 +67,14 @@ end; procedure TMainForm.RGBChanged(Sender: TObject); var - rgb: TRGBTriple; + rgb: TFPColor; c: TfpgColor; begin FViaRGB := True; // revent recursive updates rgb.Red := StrToInt(edR.Text); rgb.Green := StrToInt(edG.Text); rgb.Blue := StrToInt(edB.Text); - c := RGBTripleTofpgColor(rgb); + c := FPColorTofpgColor(rgb); ColorWheel1.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event FViaRGB := False; end; @@ -122,11 +122,11 @@ end; procedure TMainForm.UpdateRGBComponents; var - rgb: TRGBTriple; + rgb: TFPColor; c: TfpgColor; begin c := ValueBar1.SelectedColor; - rgb := fpgColorToRGBTriple(c); + rgb := fpgColorToFPColor(c); edR.Text := IntToStr(rgb.Red); edG.Text := IntToStr(rgb.Green); edB.Text := IntToStr(rgb.Blue); diff --git a/examples/gui/combobox/comboboxtest.lpi b/examples/gui/combobox/comboboxtest.lpi index 45eaa7c1..41f6ae73 100644 --- a/examples/gui/combobox/comboboxtest.lpi +++ b/examples/gui/combobox/comboboxtest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> diff --git a/examples/gui/combobox/extrafpc.cfg b/examples/gui/combobox/extrafpc.cfg index 775d592f..07f6831a 100644 --- a/examples/gui/combobox/extrafpc.cfg +++ b/examples/gui/combobox/extrafpc.cfg @@ -1,5 +1,6 @@ -FUunits -Fu../../../lib/$fpctarget +-Fu../common/ -Xs -XX -CX diff --git a/examples/gui/common/randomdata.pas b/examples/gui/common/randomdata.pas index 94d8586a..0bb7ba93 100644 --- a/examples/gui/common/randomdata.pas +++ b/examples/gui/common/randomdata.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/docs/tipue/tipue_data.lpi b/examples/gui/embedded_form/demo1.lpi index 4df7189a..f6200396 100644 --- a/docs/tipue/tipue_data.lpi +++ b/examples/gui/embedded_form/demo1.lpi @@ -1,8 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> @@ -10,6 +9,7 @@ <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> </General> <VersionInfo> <ProjectVersion Value=""/> @@ -26,20 +26,36 @@ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> - <Units Count="1"> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="3"> <Unit0> - <Filename Value="tipue_data.lpr"/> + <Filename Value="demo1.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="tipue_data"/> + <UnitName Value="demo1"/> </Unit0> + <Unit1> + <Filename Value="fra_test.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="fra_test"/> + </Unit1> + <Unit2> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit2> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + </SearchPaths> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/embedded_form/demo1.lpr b/examples/gui/embedded_form/demo1.lpr new file mode 100644 index 00000000..c006d530 --- /dev/null +++ b/examples/gui/embedded_form/demo1.lpr @@ -0,0 +1,29 @@ +program demo1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, frm_main, fra_test; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/gui/embedded_form/extrafpc.cfg b/examples/gui/embedded_form/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/embedded_form/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/embedded_form/fra_test.pas b/examples/gui/embedded_form/fra_test.pas new file mode 100644 index 00000000..184ee2da --- /dev/null +++ b/examples/gui/embedded_form/fra_test.pas @@ -0,0 +1,148 @@ +unit fra_test; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_checkbox, fpg_button, + fpg_menu, fpg_memo, fpg_panel; + +type + + { Note the tags for the UI Designer. This allows use to visually design + our frame. } + TMyFrame = class(TfpgBevel) + private + {@VFD_HEAD_BEGIN: MyFrame} + fraCheckBox1: TfpgCheckBox; + fraMenu1: TfpgMenuBar; + Button1: TfpgButton; + Memo1: TfpgMemo; + {@VFD_HEAD_END: MyFrame} + framnuFile: TfpgPopupMenu; + framnuHelp: TfpgPopupMenu; + WindowTitle: TfpgString; + procedure miHelpAboutClicked(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + fpg_dialogs; + +{@VFD_NEWFORM_IMPL} + +procedure TMyFrame.miHelpAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui(''); +end; + +constructor TMyFrame.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Shape := bsSpacer; + AfterCreate; +end; + +destructor TMyFrame.Destroy; +begin + framnuFile.Free; + framnuHelp.Free; + inherited Destroy; +end; + +procedure TMyFrame.AfterCreate; +var + miFile: TfpgMenuItem; + miHelp: TfpgMenuItem; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MyFrame} + Name := 'MyFrame'; + SetPosition(380, 237, 200, 203); + WindowTitle := 'MyFrame'; + Hint := ''; + + fraCheckBox1 := TfpgCheckBox.Create(self); + with fraCheckBox1 do + begin + Name := 'fraCheckBox1'; + SetPosition(8, 40, 120, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 0; + Text := 'CheckBox'; + end; + + fraMenu1 := TfpgMenuBar.Create(self); + with fraMenu1 do + begin + Name := 'fraMenu1'; + SetPosition(0, 0, 200, 24); + Anchors := [anLeft,anRight,anTop]; + miFile := AddMenuItem('File', nil); + AddMenuItem('Edit', nil).Enabled := False; + miHelp := AddMenuItem('Help', nil); + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(104, 164, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Button'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + end; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(12, 60, 172, 88); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Lines.Add(''); + FontDesc := '#Edit1'; + TabOrder := 3; + end; + + {@VFD_BODY_END: MyFrame} + {%endregion} + + { There still seems to be a minor issue with Popup Menus used in a frame. So + for now the work around is to manually maintain the life of the Popup + Menus - so Owner is set to nil. } + framnuFile := TfpgPopupMenu.Create(nil); + with framnuFile do + begin + Name := 'framnuFile'; + SetPosition(44, 64, 120, 20); + AddMenuItem('Open...', '', nil); + AddMenuItem('-', '', nil); + AddMenuItem('Save', '', nil); + end; + miFile.SubMenu := framnuFile; + + framnuHelp := TfpgPopupMenu.Create(nil); + with framnuHelp do + begin + Name := 'framnuHelp'; + SetPosition(44, 64, 120, 20); + AddMenuItem('About fpGUI...', '', @miHelpAboutClicked); + end; + miHelp.SubMenu := framnuHelp; +end; + + +end. diff --git a/examples/gui/embedded_form/frm_main.pas b/examples/gui/embedded_form/frm_main.pas new file mode 100644 index 00000000..831385cc --- /dev/null +++ b/examples/gui/embedded_form/frm_main.pas @@ -0,0 +1,278 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, + fpg_base, fpg_main, fpg_form, fpg_panel, fpg_button, + fpg_checkbox, fra_test, fpg_menu; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + BorderBevel: TfpgBevel; + Container: TfpgBevel; + btnExternal: TfpgButton; + btnEmbed1: TfpgButton; + CheckBox1: TfpgCheckBox; + MainMenu: TfpgMenubar; + mnuFile: TfpgPopupMenu; + mnuHelp: TfpgPopupMenu; + btnEmbed2: TfpgButton; + {@VFD_HEAD_END: MainForm} + frame: TMyFrame; + procedure btnExternalClicked(Sender: TObject); + procedure btnEmbed1Clicked(Sender: TObject); + procedure btnEmbed2Clicked(Sender: TObject); + procedure CheckBoxChanged(Sender: TObject); + procedure miQuitClicked(Sender: TObject); + procedure miHelpAboutClicked(Sender: TObject); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + fpg_widget, fpg_dialogs; + + +var + { manage indentation level } + indent: integer = 0; + +{ Output component hierarchy and status of each component's Visible property } +procedure PrintVisibleState(AComponent: TfpgWidget); +var + i: integer; + { Create string equal to indentation level } + function Spaces: string; + var + j: integer; + begin + if indent = 0 then + exit; + for j := 1 to indent do + Result := Result + ' '; + end; + +begin + writeln(Spaces + AComponent.ClassName + ' - [parent]: ' + BoolToStr(AComponent.Visible, True)); + Inc(indent, 2); + for i := 0 to AComponent.ComponentCount-1 do + begin + if AComponent.Components[i].ComponentCount > 0 then + PrintVisibleState(TfpgWidget(AComponent.Components[i])) + else + writeln(Spaces + AComponent.Components[i].ClassName + ': ' + BoolToStr(TfpgWidget(AComponent.Components[i]).Visible, True)); + end; + dec(indent, 2); +end; + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.CheckBoxChanged(Sender: TObject); +begin + if Assigned(frame) then + begin + frame.Visible := Checkbox1.Checked; + writeln('Checkbox clicked...'); + PrintVisibleState(self); + end; +end; + +procedure TMainForm.miQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miHelpAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.Information('Embedded Frame Demo', 'A simple demo showing how to embed frames') +end; + +procedure TMainForm.btnExternalClicked(Sender: TObject); +var + frm: TfpgForm; + fra: TMyFrame; +begin + { create a form at runtime that will hold our frame. } + frm := TfpgForm.Create(nil); + try + frm.WindowPosition := wpOneThirdDown; + frm.Width := 284; + frm.Height := 257; + + // embed the frame in the form + fra := TMyFrame.Create(frm); + fra.Align := alClient; + + frm.ShowModal; + finally + frm.Free; + end; +end; + +procedure TMainForm.btnEmbed1Clicked(Sender: TObject); +begin + if Assigned(frame) then + exit; + + frame := TMyFrame.Create(Container); + with frame do + begin + Name := 'frame'; + SetPosition(0, 0, 280, 196); + Shape := bsSpacer; + Align := alClient; + end; + PrintVisibleState(self); + + CheckBox1.Enabled := True; + CheckBox1.Checked := True; + btnEmbed2.Enabled := False; +end; + +procedure TMainForm.btnEmbed2Clicked(Sender: TObject); +begin + if Assigned(frame) then + exit; + + frame := TMyFrame.Create(Container); + with frame do + begin + Name := 'frame'; + SetPosition(0, 0, 280, 196); + Shape := bsSpacer; + Align := alClient; + Visible := False; + end; + PrintVisibleState(self); + + CheckBox1.Enabled := True; + CheckBox1.Checked := False; + btnEmbed1.Enabled := False; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(387, 207, 393, 340); + WindowTitle := 'MainForm'; + Hint := ''; + ShowHint := True; + + BorderBevel := TfpgBevel.Create(self); + with BorderBevel do + begin + Name := 'BorderBevel'; + SetPosition(0, 68, 393, 272); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Shape := bsSpacer; + end; + + Container := TfpgBevel.Create(BorderBevel); + with Container do + begin + Name := 'Container'; + SetPosition(8, 8, 377, 257); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Style := bsLowered; + Shape := bsSpacer; + end; + + btnExternal := TfpgButton.Create(self); + with btnExternal do + begin + Name := 'btnExternal'; + SetPosition(12, 40, 80, 24); + Text := 'External'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnExternalClicked; + end; + + btnEmbed1 := TfpgButton.Create(self); + with btnEmbed1 do + begin + Name := 'btnEmbed1'; + SetPosition(96, 40, 80, 24); + Text := 'Embed 1'; + FontDesc := '#Label1'; + Hint := 'Create embedded Form with Visible = True (default behaviour)'; + ImageName := ''; + TabOrder := 2; + OnClick := @btnEmbed1Clicked; + end; + + CheckBox1 := TfpgCheckBox.Create(self); + with CheckBox1 do + begin + Name := 'CheckBox1'; + SetPosition(296, 40, 93, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 4; + Text := 'Visible'; + Enabled := false; + OnChange := @CheckBoxChanged; + end; + + MainMenu := TfpgMenubar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 393, 28); + Anchors := [anLeft,anRight,anTop]; + end; + + mnuFile := TfpgPopupMenu.Create(self); + with mnuFile do + begin + Name := 'mnuFile'; + SetPosition(156, 88, 120, 20); + AddMenuItem('Quit', '', @miQuitClicked); + end; + + mnuHelp := TfpgPopupMenu.Create(self); + with mnuHelp do + begin + Name := 'mnuHelp'; + SetPosition(156, 112, 120, 20); + AddMenuItem('About...', '', @miHelpAboutClicked); + end; + + btnEmbed2 := TfpgButton.Create(self); + with btnEmbed2 do + begin + Name := 'btnEmbed2'; + SetPosition(180, 40, 80, 24); + Text := 'Embed 2'; + FontDesc := '#Label1'; + Hint := 'Create embedded Form with Visible = False'; + ImageName := ''; + TabOrder := 7; + OnClick := @btnEmbed2Clicked; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; + MainMenu.AddMenuItem('Help', nil).SubMenu := mnuHelp; +end; + + +end. diff --git a/examples/gui/embedded_form/units/.gitignore b/examples/gui/embedded_form/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/embedded_form/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi index bd328806..2291e3f1 100644 --- a/examples/gui/filedialog/filedialog.lpi +++ b/examples/gui/filedialog/filedialog.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr index 676100cc..37f90ddf 100644 --- a/examples/gui/filedialog/filedialog.lpr +++ b/examples/gui/filedialog/filedialog.lpr @@ -55,7 +55,10 @@ type function TMyDBLoginDlg.GetDatabase: TfpgString; begin - Result := aStringList.ValueFromIndex[cbDatabases.FocusItem]; + if cbDatabases.FocusItem = -1 then + Result := '<nothing selected>' + else + Result := aStringList.ValueFromIndex[cbDatabases.FocusItem]; end; procedure TMyDBLoginDlg.PopulateComboDb; @@ -83,13 +86,13 @@ begin dlg := TMyDBLoginDlg.Create(nil); try dlg.WindowTitle := 'Sample Login'; - if dlg.ShowModal = 1 then + if dlg.ShowModal = mrOK then begin TfpgMessageDialog.Information('User Results', 'User=' + dlg.UserID + #13 + 'Pass=' + dlg.Password + #13 + 'Database=' + dlg.Database, [mbOK]); - fpgApplication.ProcessMessages; +// fpgApplication.ProcessMessages; end; finally dlg.Free; diff --git a/examples/gui/gauges/gaugetest.lpi b/examples/gui/gauges/gaugetest.lpi index 60994bb5..731e6f4d 100644 --- a/examples/gui/gauges/gaugetest.lpi +++ b/examples/gui/gauges/gaugetest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=".exe"/> </General> <VersionInfo> diff --git a/examples/gui/gauges/gaugetest.lpr b/examples/gui/gauges/gaugetest.lpr index 3e7de4d4..d5ef47ab 100644 --- a/examples/gui/gauges/gaugetest.lpr +++ b/examples/gui/gauges/gaugetest.lpr @@ -72,7 +72,7 @@ begin Text := 'Close'; FontDesc := '#Label1'; ImageName := 'stdimg.close'; - ModalResult := 1; + ModalResult := mrOK; OnClick:= @OnCloseClick; end; diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi index 25664143..8d6de301 100644 --- a/examples/gui/gridtest/gridtest.lpi +++ b/examples/gui/gridtest/gridtest.lpi @@ -1,18 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="8"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -39,7 +39,12 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Other> <CustomOptions Value="-FUunits "/> diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 56afaa10..29a51b43 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -39,9 +39,9 @@ type btnAddOne: TfpgButton; btnFiveOnly: TfpgButton; btnDelRow: TfpgButton; + chkSmoothScroll: TfpgCheckBox; {@VFD_HEAD_END: MainForm} - procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; - AShift: TShiftState; const AMousePos: TPoint); + procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure btnAddFiveClicked(Sender: TObject); procedure btnAddOneClicked(Sender: TObject); procedure btnFiveOnlyClicked(Sender: TObject); @@ -51,6 +51,7 @@ type procedure chkShowHeaderChange(Sender: TObject); procedure chkShowGridChange(Sender: TObject); procedure chkHideFocusChange(Sender: TObject); + procedure chkSmoothScrollChange(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); @@ -117,10 +118,19 @@ begin if chkHideFocus.Checked then stringgrid.Options := stringgrid.Options + [go_HideFocusRect] else - stringgrid.Options := []; + stringgrid.Options := stringgrid.Options - [go_HideFocusRect]; stringgrid.Invalidate; end; +procedure TMainForm.chkSmoothScrollChange(Sender: TObject); +begin + if chkSmoothScroll.Checked then + stringgrid.Options := stringgrid.Options + [go_SmoothScroll] + else + stringgrid.Options := stringgrid.Options - [go_SmoothScroll]; + stringgrid.Update; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -156,6 +166,7 @@ begin Name := 'MainForm'; SetPosition(351, 214, 515, 350); WindowTitle := 'Grid control test'; + Hint := ''; WindowPosition := wpScreenCenter; btnQuit := TfpgButton.Create(self); @@ -168,6 +179,7 @@ begin FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.Quit'; + TabOrder := 1; OnClick := @btnQuitClick; end; @@ -182,7 +194,9 @@ begin AddColumn('Numbers', 150, taRightJustify); FontDesc := '#Grid'; HeaderFontDesc := '#GridHeader'; + Hint := ''; RowCount := 17; + RowSelect := False; TabOrder := 1; AddColumn('Column 0', 65); // Alignment test @@ -213,6 +227,7 @@ begin Anchors := [anRight,anTop]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 2; Text := 'Show Header'; OnChange := @chkShowHeaderChange; @@ -226,6 +241,7 @@ begin Anchors := [anRight,anTop]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 3; Text := 'Show Grid'; OnChange := @chkShowGridChange; @@ -238,6 +254,7 @@ begin SetPosition(394, 60, 116, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 4; Text := 'Row Select'; OnChange := @chkRowSelectChange; @@ -250,6 +267,7 @@ begin SetPosition(394, 84, 116, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 5; Text := 'Disabled'; OnChange := @chkDisabledChange; @@ -262,6 +280,7 @@ begin SetPosition(394, 108, 120, 20); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 6; Text := 'Hide Focus'; OnChange := @chkHideFocusChange; @@ -271,8 +290,12 @@ begin with edtTopRow do begin Name := 'edtTopRow'; - SetPosition(12, 280, 56, 22); + SetPosition(12, 280, 56, 24); Anchors := [anLeft,anBottom]; + Hint := ''; + TabOrder := 8; + FontDesc := '#Edit1'; + Value := 0; end; btnTopRow := TfpgButton.Create(self); @@ -336,6 +359,7 @@ begin begin Name := 'btnDelRow'; SetPosition(168, 308, 80, 23); + Anchors := [anLeft,anBottom]; Text := 'Delete Row'; FontDesc := '#Label1'; Hint := ''; @@ -344,6 +368,19 @@ begin OnClick := @btnDelRowClicked; end; + chkSmoothScroll := TfpgCheckBox.Create(self); + with chkSmoothScroll do + begin + Name := 'chkSmoothScroll'; + SetPosition(394, 128, 120, 20); + Anchors := [anRight,anTop]; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 14; + Text := 'Smooth Scroll'; + OnChange := @chkSmoothScrollChange; + end; + {@VFD_BODY_END: MainForm} for r := 0 to stringgrid.RowCount-1 do diff --git a/examples/gui/hintwindow/hintwindowtest.lpi b/examples/gui/hintwindow/hintwindowtest.lpi index 312b1b3b..eef2ca11 100644 --- a/examples/gui/hintwindow/hintwindowtest.lpi +++ b/examples/gui/hintwindow/hintwindowtest.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> diff --git a/examples/gui/hintwindow/hintwindowtest.lpr b/examples/gui/hintwindow/hintwindowtest.lpr index 59319057..4b709dd2 100644 --- a/examples/gui/hintwindow/hintwindowtest.lpr +++ b/examples/gui/hintwindow/hintwindowtest.lpr @@ -11,9 +11,16 @@ uses fpg_radiobutton, fpg_listbox, fpg_checkbox, fpg_panel, fpg_hint; type + { A very simple custom hint window. } + TMyHintWindow = class(TfpgHintWindow) + private + procedure FormPaint(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + end; - { TMainForm } + { test application main form } TMainForm = class(TfpgForm) private function GetHintWnd: TfpgHintWindow; @@ -50,6 +57,8 @@ type procedure rb_bgcolor_blueChange(Sender: TObject); procedure rb_shadowcolor_grayChange(Sender: TObject); procedure rb_shadowcolor_blackChange(Sender: TObject); + procedure cbShadowChanged(Sender: TObject); + procedure chbCustomHintChanged(Sender: TObject); public {@VFD_HEAD_BEGIN: MainForm} lblName1: TfpgLabel; @@ -97,10 +106,12 @@ type rb_bgcolor_green: TfpgRadioButton; rb_bgcolor_blue: TfpgRadioButton; p_shadowcolor: TfpgPanel; + cbShadow: TfpgCheckBox; rb_shadowcolor_gray: TfpgRadioButton; rb_shadowcolor_black: TfpgRadioButton; chbShowHint: TfpgCheckBox; chbAppShowHint: TfpgCheckBox; + chbCustomHint: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure AfterCreate; override; end; @@ -295,49 +306,49 @@ end; procedure TMainForm.rb_color_blackChange(Sender: TObject); begin if rb_color_black.Checked then - GetHintWnd.LTextColor := clBlack; + GetHintWnd.TextColor := clBlack; end; procedure TMainForm.rb_color_redChange(Sender: TObject); begin if rb_color_red.Checked then - GetHintWnd.LTextColor := clRed; + GetHintWnd.TextColor := clRed; end; procedure TMainForm.rb_color_greenChange(Sender: TObject); begin if rb_color_green.Checked then - GetHintWnd.LTextColor := clGreen; + GetHintWnd.TextColor := clGreen; end; procedure TMainForm.rb_color_blueChange(Sender: TObject); begin if rb_color_blue.Checked then - GetHintWnd.LTextColor := clBlue; + GetHintWnd.TextColor := clBlue; end; procedure TMainForm.rb_bgcolor_yellowChange(Sender: TObject); begin if rb_bgcolor_yellow.Checked then - GetHintWnd.LBackgroundColor := TfpgColor($ffffbf); //clYellow; + GetHintWnd.BackgroundColor := clHintWindow; end; procedure TMainForm.rb_bgcolor_whiteChange(Sender: TObject); begin if rb_bgcolor_white.Checked then - GetHintWnd.LBackgroundColor := clWhite; + GetHintWnd.BackgroundColor := clWhite; end; procedure TMainForm.rb_bgcolor_greenChange(Sender: TObject); begin if rb_bgcolor_green.Checked then - GetHintWnd.LBackgroundColor := clPaleGreen; + GetHintWnd.BackgroundColor := clPaleGreen; end; procedure TMainForm.rb_bgcolor_blueChange(Sender: TObject); begin if rb_bgcolor_blue.Checked then - GetHintWnd.LBackgroundColor := clLightBlue; + GetHintWnd.BackgroundColor := clLightBlue; end; procedure TMainForm.rb_shadowcolor_grayChange(Sender: TObject); @@ -352,6 +363,23 @@ begin GetHintWnd.ShadowColor := clBlack; end; +procedure TMainForm.cbShadowChanged(Sender: TObject); +begin + if cbShadow.Checked then + GetHintWnd.Shadow := 2 + else + GetHintWnd.Shadow := 0; +end; + +procedure TMainForm.chbCustomHintChanged(Sender: TObject); +begin + if chbCustomHint.Checked then + HintWindowClass := TMyHintWindow + else + HintWindowClass := TfpgHintWindow; + fpgApplication.RecreateHintWindow; +end; + procedure TMainForm.AfterCreate; begin {@VFD_BODY_BEGIN: MainForm} @@ -375,9 +403,15 @@ begin Name := 'edtText'; SetPosition(24, 28, 120, 22); TabOrder := 1; -// Text := 'Hello World!'; + Text := 'A very long hint'; FontDesc := '#Edit1'; - Hint := 'generic edit control' + Hint := 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control. The end.'; end; chbPasswd := TfpgCheckBox.Create(self); @@ -452,7 +486,7 @@ begin SetPosition(24, 108, 120, 22); ShowThousand := True; CustomThousandSeparator := ','; - onChange := @edtIntegerChange; + OnChange := @edtIntegerChange; Hint := 'integer edit control'; end; @@ -463,7 +497,7 @@ begin SetPosition(24, 164, 120, 22); ShowThousand := True; CustomThousandSeparator := ','; - onChange := @edtFloatChange; + OnChange := @edtFloatChange; Hint := 'float edit control'; end; @@ -476,7 +510,7 @@ begin CustomThousandSeparator := ','; // Decimals := 2; Value := -123.45; - onChange := @edtCurrencyChange; + OnChange := @edtCurrencyChange; Hint := 'currency edit control'; end; @@ -624,8 +658,8 @@ begin rb_time_3.OnChange:= @rb_time_3Change; rb_time_5 := CreateRadioButton(p_time,80,50,'5 seconds'); - rb_time_5.Checked:= True; rb_time_5.OnChange:= @rb_time_5Change; + rb_time_5.Checked:= True; p_color := TfpgPanel.Create(self); with p_color do @@ -660,7 +694,7 @@ begin Text := 'Hint background color'; end; - rb_bgcolor_yellow := CreateRadioButton(p_bgcolor,10,25,'Yellow'); + rb_bgcolor_yellow := CreateRadioButton(p_bgcolor,10,25,'Default'); rb_bgcolor_yellow.Checked:= True; rb_bgcolor_yellow.OnChange:= @rb_bgcolor_yellowChange; @@ -677,27 +711,33 @@ begin with p_shadowcolor do begin name := 'p_shadowcolor'; - SetPosition(200,440,180,50); + SetPosition(200,440,180,80); Layout := tlTop; FontDesc := '#Label1'; Text := 'Shadow color'; end; - rb_shadowcolor_gray := CreateRadioButton(p_shadowcolor,10,25,'Gray'); + cbShadow := CreateCheckBox(p_shadowcolor, 10, 25, 'Show Hint Shadow'); + cbShadow.OnChange := @cbShadowChanged; + + rb_shadowcolor_gray := CreateRadioButton(p_shadowcolor,10,50,'Gray'); rb_shadowcolor_gray.Checked:= True; rb_shadowcolor_gray.OnChange:= @rb_shadowcolor_grayChange; - rb_shadowcolor_black := CreateRadioButton(p_shadowcolor,80,25,'Black'); + rb_shadowcolor_black := CreateRadioButton(p_shadowcolor,80,50,'Black'); rb_shadowcolor_black.OnChange:= @rb_shadowcolor_blackChange; - chbShowHint := CreateCheckBox(Self,200,495,'Form.ShowHint'); + chbShowHint := CreateCheckBox(Self,10,520,'Form.ShowHint'); chbShowHint.Checked := self.ShowHint; chbShowhint.OnChange:= @chbShowHintChange; - chbAppShowHint := CreateCheckBox(Self,200,515,'Application.ShowHint'); + chbAppShowHint := CreateCheckBox(Self,10,540,'Application.ShowHint'); chbAppShowHint.Checked := fpgApplication.ShowHint; chbAppShowhint.OnChange:= @chbAppShowHintChange; + chbCustomHint := CreateCheckBox(self, 200, 520, 'Custom Hint Window'); + chbCustomHint.OnChange := @chbCustomHintChanged; + {@VFD_BODY_END: MainForm} if edtFloat.CustomDecimalSeparator = '.' then @@ -707,20 +747,33 @@ begin end; -type - { A very simple custom hint window. } - TMyHintWindow = class(TfpgHintWindow) - public - constructor Create(AOwner: TComponent); override; - end; - { TMyHintWindow } +{ Not so efficient, but good enough for this demo } +procedure TMyHintWindow.FormPaint(Sender: TObject); +var + img: TfpgImage; + r: TfpgRect; +begin + r := GetClientRect; + InflateRect(r, -Border, -Border); + Canvas.GradientFill(r, clLavender, clWhite, gdVertical); + img := fpgImages.GetImage('stdimg.dlg.info'); + Canvas.TextColor := clMagenta; + Canvas.DrawImage(10, 10, img); + Canvas.DrawText(img.Width + 10, 10+(img.Height div 2), 'I am a custom hint window'); + Canvas.TextColor := TextColor; + Canvas.DrawText(GetClientRect, Text, [txtVCenter, txtHCenter, txtWrap]); + Canvas.DrawButtonFace(300, 165, 90, 25, []); +end; + constructor TMyHintWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); + OnPaint := @FormPaint; MinWidth := 400; MinHeight := 200; + Border := 2; end; diff --git a/examples/gui/imgtest/bitmaptest.lpi b/examples/gui/imgtest/bitmaptest.lpi index af74913a..ec9a5f70 100644 --- a/examples/gui/imgtest/bitmaptest.lpi +++ b/examples/gui/imgtest/bitmaptest.lpi @@ -1,20 +1,19 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> <Title Value="bitmaptest"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/imgtest/bitmaptest.lpr b/examples/gui/imgtest/bitmaptest.lpr index 010ff886..898b7c61 100644 --- a/examples/gui/imgtest/bitmaptest.lpr +++ b/examples/gui/imgtest/bitmaptest.lpr @@ -19,8 +19,7 @@ type TMainForm = class(TfpgForm) private img: TfpgImage; - protected - procedure HandlePaint; override; + procedure FormPaint(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -29,22 +28,21 @@ type { TMainForm } -procedure TMainForm.HandlePaint; +procedure TMainForm.FormPaint(Sender: TObject); var i, j: integer; begin - Canvas.BeginDraw; // activate double buffering in time. -// inherited HandlePaint; - img.Free; - img := TfpgImage.Create; - img.AllocateImage(32, 256, 256); - img.UpdateImage; - // populate the bitmap with pretty colors :-) - for j := 0 to 255 do - for i := 0 to 255 do - PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); + if not Assigned(img) then // we only need to create the image once + begin + img := TfpgImage.Create; + img.AllocateImage(32, 256, 256); + // populate the bitmap with pretty colors :-) + for j := 0 to 255 do + for i := 0 to 255 do + PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); + img.UpdateImage; // now only do we allocate OS resources + end; Canvas.DrawImage(0, 0, img); - Canvas.EndDraw; end; constructor TMainForm.Create(AOwner: TComponent); @@ -52,6 +50,9 @@ begin inherited Create(AOwner); SetPosition(100, 100, 256, 256); WindowTitle := 'fpGUI Bitmap Test'; + WindowPosition := wpOneThirdDown; + Sizeable := False; + OnPaint := @FormPaint; end; destructor TMainForm.Destroy; diff --git a/examples/gui/imgtest_jpeg/extrafpc.cfg b/examples/gui/imgtest_jpeg/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/imgtest_jpeg/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/imgtest_jpeg/jpeg.lpi b/examples/gui/imgtest_jpeg/jpeg.lpi new file mode 100644 index 00000000..6b0fc630 --- /dev/null +++ b/examples/gui/imgtest_jpeg/jpeg.lpi @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <UseDefaultCompilerOptions Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <Language Value=""/> + <CharSet Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="jpeg.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="main"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="True"/> + </SyntaxOptions> + </Parsing> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="1"> + <Item1> + <Name Value="EDatabaseError"/> + </Item1> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/examples/gui/imgtest_jpeg/jpeg.lpr b/examples/gui/imgtest_jpeg/jpeg.lpr new file mode 100644 index 00000000..00c5fbd5 --- /dev/null +++ b/examples/gui/imgtest_jpeg/jpeg.lpr @@ -0,0 +1,24 @@ +program jpeg; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, main; + +procedure MainProc; +begin + fpgApplication.Initialize; + frmMain := TfrmMain.Create(nil); + frmMain.Show; + fpgApplication.Run; + frmMain.Free; +end; + +begin + MainProc; +end. + + diff --git a/examples/gui/imgtest_jpeg/main.pas b/examples/gui/imgtest_jpeg/main.pas new file mode 100644 index 00000000..3525045e --- /dev/null +++ b/examples/gui/imgtest_jpeg/main.pas @@ -0,0 +1,206 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_button, + fpg_radiobutton, fpg_dialogs, fpg_imgfmt_jpg; + +type + + TfrmMain = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: frmMain} + Panel1: TfpgPanel; + RadioButton1: TfpgRadioButton; + RadioButton2: TfpgRadioButton; + RadioButton3: TfpgRadioButton; + RadioButton4: TfpgRadioButton; + Button1: TfpgButton; + Button2: TfpgButton; + {@VFD_HEAD_END: frmMain} + FImage: TfpgImage; + FImageName: string; + SizeSelect: integer; + procedure Btn1Click(Sender: TObject); + procedure Btn2Click(Sender: TObject); + procedure rbChanged(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure LoadImage; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + var frmMain: TfrmMain; + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TfrmMain.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: frmMain} + Name := 'frmMain'; + SetPosition(321, 289, 330, 380); + WindowTitle := 'JPEG Image Test'; + WindowPosition := wpOneThirdDown; + Hint := ''; + + Panel1 := TfpgPanel.Create(self); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(16, 260, 96, 112); + FontDesc := '#Label1'; + Hint := ''; + Text := ''; + end; + + RadioButton1 := TfpgRadioButton.Create(Panel1); + with RadioButton1 do + begin + Name := 'RadioButton1'; + SetPosition(8, 8, 80, 20); + Checked := True; + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 1; + Text := 'Full size'; + Tag:=1; + OnChange := @rbChanged; + end; + + RadioButton2 := TfpgRadioButton.Create(Panel1); + with RadioButton2 do + begin + Name := 'RadioButton2'; + SetPosition(8, 32, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 1; + Text := '1/2 size'; + Tag:=2; + OnChange := @rbChanged; + end; + + RadioButton3 := TfpgRadioButton.Create(Panel1); + with RadioButton3 do + begin + Name := 'RadioButton3'; + SetPosition(8, 56, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 2; + Text := '1/4 size'; + Tag:=3; + OnChange := @rbChanged; + end; + + RadioButton4 := TfpgRadioButton.Create(Panel1); + with RadioButton4 do + begin + Name := 'RadioButton4'; + SetPosition(8, 80, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 3; + Text := '1/8 size'; + Tag:=4; + OnChange := @rbChanged; + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(216, 260, 80, 24); + Text := 'Open'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick:=@Btn1Click; + end; + + Button2 := TfpgButton.Create(self); + with Button2 do + begin + Name := 'Button2'; + SetPosition(216, 304, 80, 24); + Text := 'Close'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + OnClick:=@Btn2Click; + end; + + {@VFD_BODY_END: frmMain} + {%endregion} +end; + +procedure TfrmMain.LoadImage; +begin + WindowTitle := FImageName; + FImage := LoadImage_JPG(FImageName, SizeSelect); + RePaint; +end; + +constructor TfrmMain.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + OnPaint := @FormPaint; + SizeSelect := 1; // full size by default +end; + +destructor TfrmMain.Destroy; +begin + FImage.Free; + inherited Destroy; +end; + +procedure TfrmMain.Btn1Click(Sender: TObject); +var + dlg: TfpgFileDialog; +begin + dlg := TfpgFileDialog.Create(nil); + try + dlg.Filter := 'JPEG Image (*.jpg)|*.jpg'; + if dlg.RunOpenFile then + begin + FImageName:= dlg.FileName; + end; + finally + dlg.Free; + end; + LoadImage; +end; + +procedure TfrmMain.Btn2Click(Sender: TObject); +begin + Close; +end; + +procedure TfrmMain.FormPaint(Sender: TObject); +begin + Canvas.DrawImage(0, 0, FImage); +end; + +procedure TfrmMain.rbChanged(Sender: TObject); +begin + if Sender is TfpgRadioButton then + SizeSelect := TfpgRadioButton(Sender).Tag; + LoadImage; +end; + +end. diff --git a/examples/gui/imgtest_jpeg/poppy.jpg b/examples/gui/imgtest_jpeg/poppy.jpg Binary files differnew file mode 100644 index 00000000..367efe30 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppy.jpg diff --git a/examples/gui/imgtest_jpeg/poppygray.jpg b/examples/gui/imgtest_jpeg/poppygray.jpg Binary files differnew file mode 100644 index 00000000..0a9b4d20 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppygray.jpg diff --git a/examples/gui/imgtest_jpeg/poppyprogressif.jpg b/examples/gui/imgtest_jpeg/poppyprogressif.jpg Binary files differnew file mode 100644 index 00000000..2147ed64 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppyprogressif.jpg diff --git a/examples/gui/imgtest_jpeg/units/.gitignore b/examples/gui/imgtest_jpeg/units/.gitignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/examples/gui/imgtest_jpeg/units/.gitignore @@ -0,0 +1 @@ +*
\ No newline at end of file diff --git a/examples/gui/memo/memotest.lpi b/examples/gui/memo/memotest.lpi index 51f39bef..0102fcfc 100644 --- a/examples/gui/memo/memotest.lpi +++ b/examples/gui/memo/memotest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -24,7 +23,7 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication Use="True" PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -42,11 +41,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> - <Linking> - <Debugging> - <GenGProfCode Value="True"/> - </Debugging> - </Linking> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> <Other> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/examples/gui/memo/memotest.lpr b/examples/gui/memo/memotest.lpr index 31f5799f..d38a4f95 100644 --- a/examples/gui/memo/memotest.lpr +++ b/examples/gui/memo/memotest.lpr @@ -12,86 +12,68 @@ uses fpg_main, fpg_form, fpg_button, - fpg_label, fpg_memo; type - - { TMainForm } - TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} memo: TfpgMemo; btnQuit: TfpgButton; - procedure btnQuitClick(Sender: TObject); - procedure HandleResize(awidth, aheight: TfpgCoord); override; + {@VFD_HEAD_END: MainForm} + procedure btnQuitClicked(Sender: TObject); public - constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; end; { TMainForm } -procedure TMainForm.btnQuitClick(Sender: TObject); +procedure TMainForm.btnQuitClicked(Sender: TObject); begin Close; end; -procedure TMainForm.HandleResize(awidth, aheight: TfpgCoord); +procedure TMainForm.AfterCreate; begin - inherited HandleResize(awidth, aheight); - if Assigned(Memo) then + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(329, 251, 300, 201); + WindowTitle := 'Memo Test'; + WindowPosition := wpOneThirdDown; + + memo := TfpgMemo.Create(self); + with memo do begin - Memo.SetPosition(Memo.Left, Memo.Top, awidth-20, aheight- Memo.Top - 10); - btnQuit.Left := awidth - btnQuit.Width - 10; - btnQuit.UpdateWindowPosition; + Name := 'memo'; + SetPosition(10, 40, 280, 150); + Anchors := [anLeft,anRight,anTop,anBottom]; + Lines.Add('Memo Test0'); + Lines.Add('Memo Test1'); + Lines.Add('Memo Test2'); + Lines.Add('Memo Test3'); + Lines.Add('Memo Test4'); + FontDesc := '#Edit1'; + TabOrder := 0; + Lines.Insert(1, '0 Before 1 after'); end; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - WindowTitle := 'Memo test'; - SetPosition(100, 100, 300, 300); - memo := CreateMemo(self, 10, 40, 280, 150); - - memo.Lines.Add('Memo Test0'); - memo.Lines.Add('Memo Test1'); - memo.Lines.Add('Memo Test2'); - memo.Lines.Add('Memo Test3'); - memo.Lines.Add('Memo Test4'); - memo.Lines.Insert(1,'0 Before 1 after'); - //memo.Lines.Delete(1); - //memo.Lines.Text := 'Dude'+LineEnding+'What''s mine say?'+LineEnding;; - //memo.Lines.Text := memo.Lines.Text + 'Sweet'+LineEnding; - //memo.lines.LoadFromFile('/home/andrew/programming/groupprojects/fpgui/src/gui/fpg_memo.pas'); - //memo.lines.LoadFromFile('/usr/share/dict/cracklib-small'); - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - { memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; } - btnQuit := CreateButton(self, 210, 10, 80, 'Quit', @btnQuitClick); - btnQuit.ImageName := 'stdimg.quit'; - btnQuit.ShowImage := True; - - HandleResize(Width, Height); + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(208, 8, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Quit'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'stdimg.quit'; + TabOrder := 1; + OnClick := @btnQuitClicked; + end; + {@VFD_BODY_END: MainForm} end; + procedure MainProc; var frm: TMainForm; diff --git a/examples/gui/menutest/menutest.lpi b/examples/gui/menutest/menutest.lpi index f3d307af..522b9451 100644 --- a/examples/gui/menutest/menutest.lpi +++ b/examples/gui/menutest/menutest.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -45,6 +44,11 @@ <Debugging> <GenerateDebugInfo Value="True"/> </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> </Linking> <Other> <CustomOptions Value="-FUunits diff --git a/examples/gui/menutest/menutest.lpr b/examples/gui/menutest/menutest.lpr index 1db064fb..e4d40cf0 100644 --- a/examples/gui/menutest/menutest.lpr +++ b/examples/gui/menutest/menutest.lpr @@ -7,24 +7,44 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, + fpg_base, fpg_main, fpg_form, fpg_menu, - fpg_edit; + fpg_edit, + fpg_panel, + fpg_button, + fpg_dialogs, + fpg_memo; type TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} FMenuBar: TfpgMenuBar; + StatusBar: TfpgPanel; + Toolbar: TfpgBevel; + btnQuit: TfpgButton; + btnSave: TfpgButton; + btnOpen: TfpgButton; + btnAbout: TfpgButton; + edit1: TfpgEdit; + Memo1: TfpgMemo; FFileSubMenu: TfpgPopupMenu; FEditSubMenu: TfpgPopupMenu; FEditSelectSubMenu: TfpgPopupMenu; + FViewSubMenu: TfpgPopupMenu; FHelpSubMenu: TfpgPopupMenu; - edit1: TfpgEdit; + {@VFD_HEAD_END: MainForm} procedure miExitClicked(Sender: TObject); procedure miMenuItemSelected(Sender: TObject); + procedure miMenuItemChecked(Sender: TObject); + procedure miToolBarChecked(Sender: TObject); + procedure miStatusBarChecked(Sender: TObject); + procedure btnAboutClicked(Sender: TObject); + procedure Log(const AText: TfpgString); public - constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; end; @@ -38,52 +58,233 @@ end; procedure TMainForm.miMenuItemSelected(Sender: TObject); begin if Sender is TfpgMenuItem then - writeln('Menu clicked: ', TfpgMenuItem(Sender).Text); + Log('Menu clicked: ' + TfpgMenuItem(Sender).Text); +end; + +procedure TMainForm.miMenuItemChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + Log('Check Menu item toggled'); +end; + +procedure TMainForm.miToolBarChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + ToolBar.Visible := not ToolBar.Visible; + Log('Check Menu for Toolbar toggled'); +end; + +procedure TMainForm.miStatusBarChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + StatusBar.Visible := not StatusBar.Visible; + Log('Check Menu for Statusbar toggled'); +end; + +procedure TMainForm.btnAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui; +end; + +procedure TMainForm.Log(const AText: TfpgString); +begin + Memo1.Lines.Add(AText); end; -constructor TMainForm.Create(AOwner: TComponent); +procedure TMainForm.AfterCreate; begin - inherited Create(AOwner); + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(316, 169, 400, 200); WindowTitle := 'Menu Test'; - WindowPosition := wpUser; - SetPosition(100, 100, 400, 200); - - // Create top level sub-menus + Hint := ''; + WindowPosition := wpOneThirdDown; + + FMenuBar := TfpgMenuBar.Create(self); + with FMenuBar do + begin + Name := 'FMenuBar'; + SetPosition(0, 0, 400, 24); + Anchors := [anLeft,anRight,anTop]; + end; + + StatusBar := TfpgPanel.Create(self); + with StatusBar do + begin + Name := 'StatusBar'; + SetPosition(0, 176, 400, 24); + Anchors := [anLeft,anRight,anBottom]; + Alignment := taLeftJustify; + FontDesc := '#Label1'; + Hint := ''; + Style := bsLowered; + Text := 'This is the status bar...'; + end; + + Toolbar := TfpgBevel.Create(self); + with Toolbar do + begin + Name := 'Toolbar'; + SetPosition(0, 24, 400, 29); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Shape := bsBottomLine; + end; + + btnQuit := TfpgButton.Create(Toolbar); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 1; + OnClick := @miExitClicked; + end; + + btnSave := TfpgButton.Create(Toolbar); + with btnSave do + begin + Name := 'btnSave'; + SetPosition(56, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.save'; + ImageSpacing := 0; + TabOrder := 2; + end; + + btnOpen := TfpgButton.Create(Toolbar); + with btnOpen do + begin + Name := 'btnOpen'; + SetPosition(32, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.open'; + ImageSpacing := 0; + TabOrder := 3; + end; + + btnAbout := TfpgButton.Create(Toolbar); + with btnAbout do + begin + Name := 'btnAbout'; + SetPosition(84, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.help'; + ImageSpacing := 0; + TabOrder := 4; + OnClick := @btnAboutClicked; + end; + + edit1 := TfpgEdit.Create(self); + with edit1 do + begin + Name := 'edit1'; + SetPosition(8, 62, 100, 24); + ExtraHint := ''; + Hint := ''; + TabOrder := 6; + Text := ''; + FontDesc := '#Edit1'; + end; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(124, 60, 268, 108); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Lines.Add('<= Text Edit has a popup menu too.'); + FontDesc := '#Edit1'; + TabOrder := 10; + end; + FFileSubMenu := TfpgPopupMenu.Create(self); - FFileSubMenu.AddMenuItem('&Open', 'Ctrl-O', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('&Save', 'Ctrl-S', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('S&ave As', 'Ctrl+Shift+S', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('-', '', nil); - FFileSubMenu.AddMenuItem('Save && Reload', '', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('-', '', nil); - FFileSubMenu.AddMenuItem('&Quit', 'Ctrl-Q', @miExitClicked); + with FFileSubMenu do + begin + Name := 'FFileSubMenu'; + SetPosition(264, 60, 120, 20); + AddMenuItem('&Open', 'Ctrl-O', @miMenuItemSelected); + AddMenuItem('&Save', 'Ctrl-S', @miMenuItemSelected); + AddMenuItem('S&ave As', 'Ctrl+Shift+S', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('Save && Reload', '', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('&Quit', 'Ctrl-Q', @miExitClicked); + end; FEditSubMenu := TfpgPopupMenu.Create(self); - FEditSubMenu.AddMenuItem('&Cut', 'Ctrl-X', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('C&opy', 'Ctrl-C', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('&Paste', 'Ctrl-V', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('-', '', nil); - FEditSubMenu.AddMenuItem('&Spell check', 'F4', @miMenuItemSelected).Enabled := False; + with FEditSubMenu do + begin + Name := 'FEditSubMenu'; + SetPosition(264, 80, 120, 20); + AddMenuItem('&Cut', 'Ctrl-X', @miMenuItemSelected); + AddMenuItem('C&opy', 'Ctrl-C', @miMenuItemSelected); + AddMenuItem('&Paste', 'Ctrl-V', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('&Spell check', 'F4', @miMenuItemSelected).Enabled := False; + end; + FEditSelectSubMenu := TfpgPopupMenu.Create(self); - FEditSubMenu.AddMenuItem('Selec&t', '', nil).SubMenu := FEditSelectSubMenu; - FEditSelectSubMenu.AddMenuItem('Select All', '', @miMenuItemSelected); - FEditSelectSubMenu.AddMenuItem('Select Word', '', @miMenuItemSelected); - FEditSelectSubMenu.AddMenuItem('Select Line', '', @miMenuItemSelected); + with FEditSelectSubMenu do + begin + Name := 'FEditSelectSubMenu'; + SetPosition(264, 100, 120, 20); + AddMenuItem('Select All', '', @miMenuItemSelected); + AddMenuItem('Select Word', '', @miMenuItemSelected); + AddMenuItem('Select Line', '', @miMenuItemSelected); + FEditSubMenu.AddMenuItem('Selec&t', '', nil).SubMenu := FEditSelectSubMenu; + end; + + FViewSubMenu := TfpgPopupMenu.Create(self); + with FViewSubMenu do + begin + Name := 'FViewSubMenu'; + SetPosition(264, 120, 120, 20); + AddMenuItem('Full Screen', '', @miMenuItemChecked); + AddMenuItem('Tool Bar', '', @miToolBarChecked).Checked := True; + AddMenuItem('Status Bar', '', @miStatusBarChecked).Checked := True; + AddMenuItem('Line Numbers', '', @miMenuItemChecked); + end; FHelpSubMenu := TfpgPopupMenu.Create(self); - FHelpSubMenu.AddMenuItem('&About', 'F12', @miMenuItemSelected); - FHelpSubMenu.AddMenuItem('Test Russian text -> Òåñò', '', @miMenuItemSelected); + with FHelpSubMenu do + begin + Name := 'FHelpSubMenu'; + SetPosition(264, 140, 120, 20); + AddMenuItem('&About', 'F12', @btnAboutClicked); + AddMenuItem('Test Russian text -> Òåñò', '', @miMenuItemSelected); + end; + + {@VFD_BODY_END: MainForm} + {%endregion} - // Create main menu bar - FMenuBar := CreateMenuBar(self); + // Attach sub menus to main menu bar FMenuBar.AddMenuItem('&File', nil).SubMenu := FFileSubMenu; FMenuBar.AddMenuItem('&Edit', nil).SubMenu := FEditSubMenu; + FMenuBar.AddMenuItem('&View', nil).SubMenu := FViewSubMenu; FMenuBar.AddMenuItem('&Windows', nil); FMenuBar.AddMenuItem('&Disabled', nil).Enabled := False; FMenuBar.AddMenuItem('&Help', nil).SubMenu := FHelpSubMenu; - - edit1 := TfpgEdit.Create(self); - edit1.SetPosition(10, 70, 100, 24); end; diff --git a/examples/gui/mousecursor/cursordemo.lpi b/examples/gui/mousecursor/cursordemo.lpi new file mode 100644 index 00000000..7aea18fa --- /dev/null +++ b/examples/gui/mousecursor/cursordemo.lpi @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="None"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <Title Value="cursordemo"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="cursordemo.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="cursordemo"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="True"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <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/mousecursor/cursordemo.lpr b/examples/gui/mousecursor/cursordemo.lpr new file mode 100644 index 00000000..2cbcf1a3 --- /dev/null +++ b/examples/gui/mousecursor/cursordemo.lpr @@ -0,0 +1,227 @@ +program cursordemo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_label; + +type + + TMainForm = class(TfpgForm) + public + {@VFD_HEAD_BEGIN: MainForm} + Panel1: TfpgPanel; + Panel2: TfpgPanel; + Panel3: TfpgPanel; + Panel4: TfpgPanel; + Panel5: TfpgPanel; + Panel6: TfpgPanel; + Panel7: TfpgPanel; + Panel8: TfpgPanel; + Panel9: TfpgPanel; + Panel10: TfpgPanel; + Panel11: TfpgPanel; + Panel12: TfpgPanel; + Panel13: TfpgPanel; + Label1: TfpgLabel; + {@VFD_HEAD_END: MainForm} + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(388, 200, 311, 204); + WindowTitle := 'Mouse Cursor Demo'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(20, 4, 256, 16); + Alignment := taCenter; + FontDesc := '#Label2'; + Hint := ''; + Text := 'Available mouse cursors in fpGUI'; + end; + + Panel1 := TfpgPanel.Create(self); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(8, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcDefault'; + MouseCursor := mcDefault; + end; + + Panel2 := TfpgPanel.Create(self); + with Panel2 do + begin + Name := 'Panel2'; + SetPosition(108, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcArrow'; + MouseCursor := mcArrow; + end; + + Panel3 := TfpgPanel.Create(self); + with Panel3 do + begin + Name := 'Panel3'; + SetPosition(208, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcCross'; + MouseCursor := mcCross; + end; + + Panel4 := TfpgPanel.Create(self); + with Panel4 do + begin + Name := 'Panel4'; + SetPosition(8, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcIBeam'; + MouseCursor := mcIBeam; + end; + + Panel5 := TfpgPanel.Create(self); + with Panel5 do + begin + Name := 'Panel5'; + SetPosition(108, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeEW'; + MouseCursor := mcSizeEW; + end; + + Panel6 := TfpgPanel.Create(self); + with Panel6 do + begin + Name := 'Panel6'; + SetPosition(208, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNS'; + MouseCursor := mcSizeNS; + end; + + Panel7 := TfpgPanel.Create(self); + with Panel7 do + begin + Name := 'Panel7'; + SetPosition(8, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNWSE'; + MouseCursor := mcSizeNWSE; + end; + + Panel8 := TfpgPanel.Create(self); + with Panel8 do + begin + Name := 'Panel8'; + SetPosition(108, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNESW'; + MouseCursor := mcSizeNESW; + end; + + Panel9 := TfpgPanel.Create(self); + with Panel9 do + begin + Name := 'Panel9'; + SetPosition(208, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeSWNE'; + MouseCursor := mcSizeSWNE; + end; + + Panel10 := TfpgPanel.Create(self); + with Panel10 do + begin + Name := 'Panel10'; + SetPosition(8, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeSENW'; + MouseCursor := mcSizeSENW; + end; + + Panel11 := TfpgPanel.Create(self); + with Panel11 do + begin + Name := 'Panel11'; + SetPosition(108, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcMove'; + MouseCursor := mcMove; + end; + + Panel12 := TfpgPanel.Create(self); + with Panel12 do + begin + Name := 'Panel12'; + SetPosition(208, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcHourGlass'; + MouseCursor := mcHourGlass; + end; + + Panel13 := TfpgPanel.Create(self); + with Panel13 do + begin + Name := 'Panel13'; + SetPosition(8, 160, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcHand'; + MouseCursor := mcHand; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + + +begin + MainProc; +end. + diff --git a/examples/gui/mousecursor/extrafpc.cfg b/examples/gui/mousecursor/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/mousecursor/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/mousecursor/units/.gitignore b/examples/gui/mousecursor/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/mousecursor/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/splashscreen/commands.pas b/examples/gui/splashscreen/commands.pas index c487b0b1..e9adf75d 100644 --- a/examples/gui/splashscreen/commands.pas +++ b/examples/gui/splashscreen/commands.pas @@ -37,10 +37,22 @@ type end; + TShowSplashCommand = class(TInterfacedObject, ICommand) + public + procedure Execute; + end; + + + TShowBorderlessForm = class(TInterfacedObject, ICommand) + public + procedure Execute; + end; + + implementation uses - fpg_main, SysUtils; + SysUtils, fpg_main, frm_main, frm_splashscreen; { TNullInterfacedObject } @@ -72,18 +84,30 @@ end; procedure TAddCommand.Execute; begin - Writeln('>> TAddComand.Execute'); FMemo.Lines.Add('Hello ' + IntToStr(Random(500))); - FMemo.Invalidate; end; { TExitCommand } procedure TExitCommand.Execute; begin - Writeln('>> TExitComand.Execute'); fpgApplication.Terminated := True; end; +{ TShowSplashCommand } + +procedure TShowSplashCommand.Execute; +begin + frmSplash := TSplashForm.Create(nil); + frmSplash.Show; +end; + +{ TShowBorderlessForm } + +procedure TShowBorderlessForm.Execute; +begin + TBorderLessForm.Execute; +end; + end. diff --git a/examples/gui/splashscreen/frm_main.pas b/examples/gui/splashscreen/frm_main.pas index 6835b98a..7ecf663c 100644 --- a/examples/gui/splashscreen/frm_main.pas +++ b/examples/gui/splashscreen/frm_main.pas @@ -9,27 +9,39 @@ unit frm_main; interface uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel; + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_button, + fpg_memo, fpg_menu, fpg_label, fpg_trackbar; type TMainForm = class(TfpgForm) private - procedure CommandHandler(Sender: TObject); - public {@VFD_HEAD_BEGIN: MainForm} btnAdd: TfpgButton; memName1: TfpgMemo; btnQuit: TfpgButton; MainMenu: TfpgMenuBar; mnuFile: TfpgPopupMenu; + btnShowBorderless: TfpgButton; + btnShowSplash: TfpgButton; + Label1: TfpgLabel; {@VFD_HEAD_END: MainForm} - procedure AfterCreate; override; + public + procedure AfterCreate; override; + end; + + + TBorderLessForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: BorderLessForm} + btnClose: TfpgButton; + Label1: TfpgLabel; + TrackBar1: TfpgTrackBar; + {@VFD_HEAD_END: BorderLessForm} + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + class procedure Execute; end; {@VFD_NEWFORM_DECL} @@ -42,45 +54,107 @@ uses {@VFD_NEWFORM_IMPL} -{ A single event handler that handles all Command based events. } -procedure TMainForm.CommandHandler(Sender: TObject); -var - cmd: ICommand; - holder: ICommandHolder; +{ TBorderLessForm } + +constructor TBorderLessForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Include(FWindowAttributes, waBorderLess); // borderless and steals focus like a normal form +end; + +procedure TBorderLessForm.AfterCreate; begin - if Supports(Sender, ICommandHolder, holder) then + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: BorderLessForm} + Name := 'BorderLessForm'; + SetPosition(321, 549, 323, 133); + WindowTitle := 'BorderLessForm'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + btnClose := TfpgButton.Create(self); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(232, 100, 80, 24); + Text := 'Close'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 1; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do begin - cmd := holder.GetCommand; - cmd.Execute; + Name := 'Label1'; + SetPosition(8, 32, 304, 16); + FontDesc := '#Label2'; + Hint := ''; + Layout := tlCenter; + Text := 'Look Mom, no borders!'; end; + + TrackBar1 := TfpgTrackBar.Create(self); + with TrackBar1 do + begin + Name := 'TrackBar1'; + SetPosition(72, 60, 148, 30); + Hint := ''; + TabOrder := 3; + end; + + {@VFD_BODY_END: BorderLessForm} + {%endregion} end; +class procedure TBorderLessForm.Execute; +var + frm: TBorderLessForm; +begin + frm := TBorderLessForm.Create(nil); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + + +{ TMainForm } + procedure TMainForm.AfterCreate; begin + {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; SetPosition(293, 236, 416, 273); WindowTitle := 'Command Interface Test'; + Hint := ''; WindowPosition := wpScreenCenter; btnAdd := TfpgButton.Create(self); with btnAdd do begin Name := 'btnAdd'; - SetPosition(332, 36, 75, 24); - Text := 'Add'; + SetPosition(260, 28, 148, 24); + Text := 'Add Text to Memo'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; - OnClick := @CommandHandler; + TabOrder := 1; end; memName1 := TfpgMemo.Create(self); with memName1 do begin Name := 'memName1'; - SetPosition(8, 36, 316, 228); + SetPosition(8, 28, 236, 236); + Hint := ''; Lines.Add(''); FontDesc := '#Edit1'; + TabOrder := 2; end; btnQuit := TfpgButton.Create(self); @@ -90,8 +164,9 @@ begin SetPosition(332, 240, 75, 24); Text := 'Quit'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; - OnClick := @CommandHandler; + TabOrder := 3; end; MainMenu := TfpgMenuBar.Create(self); @@ -107,16 +182,56 @@ begin begin Name := 'mnuFile'; SetPosition(44, 72, 120, 20); - AddMenuItem('Quit', '', @CommandHandler); + AddMenuItem('Quit', '', nil); + end; + + btnShowBorderless := TfpgButton.Create(self); + with btnShowBorderless do + begin + Name := 'btnShowBorderless'; + SetPosition(260, 56, 148, 24); + Text := 'Show Borderless Form'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 6; + end; + + btnShowSplash := TfpgButton.Create(self); + with btnShowSplash do + begin + Name := 'btnShowSplash'; + SetPosition(260, 84, 148, 24); + Text := 'Show Splash Screen'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 7; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(252, 120, 156, 116); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Note the difference between a borderless form and a splash screen (wtPopup) form. wtPopup doesn''t steal focus (eg: hint window)'; + WrapText := True; end; {@VFD_BODY_END: MainForm} - + {%endregion} + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; - // instantiate the Command classes + { Instantiate the Command classes. By setting a Command it + take preference over OnClick event handlers and is handled + automatically for you. No need to declare a OnClick event handler. } btnAdd.SetCommand(TAddCommand.Create(memName1)); btnQuit.SetCommand(TExitCommand.Create); + btnShowBorderless.SetCommand(TShowBorderlessForm.Create); + btnShowSplash.SetCommand(TShowSplashCommand.Create); // The menu item File|Quit shares the command of btnQuit mnuFile.MenuItemByName('Quit').SetCommand(btnQuit.GetCommand); end; diff --git a/examples/gui/splashscreen/frm_splashscreen.pas b/examples/gui/splashscreen/frm_splashscreen.pas index 46433ab0..30dff1c9 100644 --- a/examples/gui/splashscreen/frm_splashscreen.pas +++ b/examples/gui/splashscreen/frm_splashscreen.pas @@ -5,33 +5,24 @@ unit frm_splashscreen; interface uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel, fpg_popupcalendar, fpg_gauge; + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, + fpg_label; type - - { TSplashForm } - TSplashForm = class(TfpgForm) - procedure SplashFormShow(Sender: TObject); - procedure TimerFired(Sender: TObject); private - tmr: TfpgTimer; - protected - procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; - procedure AdjustWindowStyle; override; - public {@VFD_HEAD_BEGIN: SplashForm} pnlName1: TfpgBevel; lblName2: TfpgLabel; lblName1: TfpgLabel; {@VFD_HEAD_END: SplashForm} + tmr: TfpgTimer; + procedure SplashFormShow(Sender: TObject); + procedure TimerFired(Sender: TObject); + procedure SplashFormClick(Sender: TObject); + public constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; + procedure AfterCreate; override; end; {@VFD_NEWFORM_DECL} @@ -43,6 +34,11 @@ implementation {@VFD_NEWFORM_IMPL} +procedure TSplashForm.SplashFormClick(Sender: TObject); +begin + TimerFired(nil); +end; + procedure TSplashForm.SplashFormShow(Sender: TObject); begin tmr.Enabled := True; @@ -56,28 +52,17 @@ begin Hide; end; -procedure TSplashForm.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); -begin - inherited HandleLMouseUp(x, y, shiftstate); - TimerFired(nil); -end; - -procedure TSplashForm.AdjustWindowStyle; -begin - inherited AdjustWindowStyle; - -end; - constructor TSplashForm.Create(AOwner: TComponent); begin inherited Create(AOwner); - WindowType := wtPopup; // removes borders and title bar + WindowType := wtPopup; // borderless but doesn't steal focus WindowAttributes := WindowAttributes + [waStayOnTop]; // well, it lets the window stay on top. :) tmr := TfpgTimer.Create(3000); tmr.OnTimer := @TimerFired; OnShow := @SplashFormShow; + OnClick := @SplashFormClick; end; procedure TSplashForm.AfterCreate; diff --git a/examples/gui/splashscreen/test.lpi b/examples/gui/splashscreen/test.lpi index d347a75a..fa0ecd6b 100644 --- a/examples/gui/splashscreen/test.lpi +++ b/examples/gui/splashscreen/test.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/stdimages/stdimglist.lpi b/examples/gui/stdimages/stdimglist.lpi index d136ae4d..94af915b 100644 --- a/examples/gui/stdimages/stdimglist.lpi +++ b/examples/gui/stdimages/stdimglist.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/stdimages/stdimglist.lpr b/examples/gui/stdimages/stdimglist.lpr index c70f6a0d..09e57990 100644 --- a/examples/gui/stdimages/stdimglist.lpr +++ b/examples/gui/stdimages/stdimglist.lpr @@ -15,7 +15,6 @@ type protected procedure HandlePaint; override; public - constructor Create(aowner: TComponent); override; procedure AfterCreate; override; end; @@ -25,6 +24,13 @@ procedure TMainForm.AfterCreate; begin SetPosition(100,100,700,500); WindowTitle := 'fpGUI Standard Image Listing'; + WindowPosition := wpOneThirdDown; + MinWidth := 200; + MinHeight := 100; + + btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick); + btnClose.ImageName := 'stdimg.quit'; + btnClose.Anchors := [anRight, anBottom]; end; procedure TMainForm.btnCloseClick(Sender: TObject); @@ -68,16 +74,6 @@ begin sl.Free; end; -constructor TMainForm.Create(aowner: TComponent); -begin - inherited Create(aowner); - // Place button in bottom right corner. - btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick); - btnClose.ImageName := 'stdimg.quit'; -// btnClose.Focusable := False; - btnClose.Anchors := [anRight, anBottom]; -end; - procedure MainProc; var frm : TMainForm; diff --git a/examples/gui/tabtest/tabtest.lpi b/examples/gui/tabtest/tabtest.lpi index ac64bf44..b29eb7a0 100644 --- a/examples/gui/tabtest/tabtest.lpi +++ b/examples/gui/tabtest/tabtest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -41,8 +40,15 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Linking> + <Debugging> + <UseHeaptrc Value="True"/> + </Debugging> + </Linking> <Other> - <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/tabtest/tabtest.lpr b/examples/gui/tabtest/tabtest.lpr index 46d1a108..016d5af5 100644 --- a/examples/gui/tabtest/tabtest.lpr +++ b/examples/gui/tabtest/tabtest.lpr @@ -64,8 +64,14 @@ procedure TMainForm.cbTabPosChanged(Sender: TObject); begin if cbTabPos.FocusItem = 0 then pcMain.TabPosition := tpTop + else if cbTabPos.FocusItem = 1 then + pcMain.TabPosition := tpBottom + else if cbTabPos.FocusItem = 2 then + pcMain.TabPosition := tpLeft + else if cbTabPos.FocusItem = 3 then + pcMain.TabPosition := tpRight else - pcMain.TabPosition := tpBottom; + pcMain.TabPosition := tpNone; end; constructor TMainForm.Create(AOwner: TComponent); @@ -85,6 +91,7 @@ begin pcMain.Width := Width - 20; pcMain.Height := 300; pcMain.Anchors := [anLeft, anTop, anRight, anBottom]; +// pcMain.FixedTabWidth:=150; // Tab One tsOne := TfpgTabSheet.Create(pcMain); @@ -124,6 +131,9 @@ begin cbTabPos := CreateComboBox(self, 300, 320, 80, nil); cbTabPos.Items.Add('tpTop'); cbTabPos.Items.Add('tpBottom'); + cbTabPos.Items.Add('tpLeft'); + cbTabPos.Items.Add('tpRight'); + cbTabPos.Items.Add('tpNone'); cbTabPos.FocusItem := 0; cbTabPos.Anchors := [anBottom, anLeft]; cbTabPos.OnChange := @cbTabPosChanged; diff --git a/examples/readme.txt b/examples/readme.txt index 80aaeee6..05331e24 100644 --- a/examples/readme.txt +++ b/examples/readme.txt @@ -1,22 +1,25 @@ + Compiling the fpGUI Demos + + Compiling any of the examples from the Command Line =================================================== -You need to compile the fpGUI toolkit first as mentioned in -the ../src/readme.txt file. +You need to compile the fpGUI toolkit first as mentioned in the +README.txt file located in the <fpgui>/docs/ directory. I'll assume the fpc executable path has been setup so you can execute 'fpc' -from any directory. Every project in the 'examples' directory has it's -own extrafpc.cfg file. You only need to specify that config file and the -project's main unit to compile it. +from any directory. Every project in the 'examples' directory has its +own extrafpc.cfg file. You only need to specify that config file and the +project's main unit to compile it. The format is as follows: fpc @extrafpc.cfg <project main unit> Example: - fpc @extrafpc.cfg docedit.lpr - or - fpc @extrafpc.cfg helloworld.pas + fpc @extrafpc.cfg docedit.lpr + or + fpc @extrafpc.cfg helloworld.pas ======================================================= diff --git a/extras/cleanbuild.sh b/extras/cleanbuild.sh index acb57bc9..e4e68996 100755 --- a/extras/cleanbuild.sh +++ b/extras/cleanbuild.sh @@ -3,4 +3,8 @@ cd ../src ./build.sh cd ../uidesigner fpc @extrafpc.cfg uidesigner.lpr +cd ../docview/src +fpc @extrafpc.cfg docview.lpr +cd ../.. + diff --git a/extras/contributed/ats/ats_editor.lpi b/extras/contributed/ats/ats_editor.lpi new file mode 100644 index 00000000..16f21757 --- /dev/null +++ b/extras/contributed/ats/ats_editor.lpi @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <LRSInOutputDirectory Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="4"> + <Unit0> + <Filename Value="ats_editor.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="ats_editor"/> + </Unit0> + <Unit1> + <Filename Value="ats_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="ats_main"/> + </Unit1> + <Unit2> + <Filename Value="ptrparsefunc.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="ptrparsefunc"/> + </Unit2> + <Unit3> + <Filename Value="atstable.inc"/> + <IsPartOfProject Value="True"/> + </Unit3> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <Other> + <CustomOptions Value="-FUunits/$(TargetCPU)-$(TargetOS)/"/> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/extras/contributed/ats/ats_editor.pas b/extras/contributed/ats/ats_editor.pas new file mode 100644 index 00000000..92d5ce3e --- /dev/null +++ b/extras/contributed/ats/ats_editor.pas @@ -0,0 +1,526 @@ +program ats_editor; + +{$mode objfpc}{$H+} + +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; + +const + 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; + public + atstable: TatsTextTable; + procedure UpdateColumns; + end; + + { TfrmLangTable } + + TfrmLangTable = class(TfpgForm) + public + menuFile: TfpgPopupMenu; + + {@VFD_HEAD_BEGIN: frmLangTable} + mainmenu: TfpgMenuBar; + grid: TLangGrid; + btnNewRow: TfpgButton; + btnCopyRow: TfpgButton; + btnDeleteRow: TfpgButton; + btnEdit: TfpgButton; + {@VFD_HEAD_END: frmLangTable} + + procedure AfterCreate; override; + + procedure menuProcExit(Sender: TObject); + procedure menuProcSave(Sender: TObject); + procedure menuProcOpen(Sender: TObject); + procedure menuProcNew(Sender: TObject); + + procedure EditClick(Sender : TObject); + + end; + + { TfrmTextEdit } + + TfrmTextEdit = class(TfpgForm) + public + {@VFD_HEAD_BEGIN: frmTextEdit} + Label1: TfpgLabel; + edID: TfpgEdit; + cmbLang1: TfpgComboBox; + edLang1: TfpgEdit; + cmbLang2: TfpgComboBox; + edLang2: TfpgEdit; + btnOK: TfpgButton; + btnCancel: TfpgButton; + {@VFD_HEAD_END: frmTextEdit} + + textrow : TatsTextRow; + + procedure AfterCreate; override; + + procedure OnLangChange(sender : TObject); + + procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; + + procedure LoadTexts; + end; + +{@VFD_NEWFORM_DECL} + +var + frmMain : TfrmLangTable; + +{@VFD_NEWFORM_IMPL} + +{ TLangGrid } + +procedure TLangGrid.DrawCell(ARow, ACol: Integer; ARect: TfpgRect; AFlags: TfpgGridDrawState); +var + s : string; + tr : TatsTextRow; + b : boolean; +begin + tr := atstable.GetRow(ARow); + if ACol = 0 then + begin + s := tr.TextId; + end + else + begin + //s := 'Col '+IntToStr(ACol); + s := tr.GetText(Columns[ACol].Title, b); + end; + Canvas.DrawString(ARect.Left+1, ARect.Top+1, s); + + //inherited DrawCell(ARow, ACol, ARect, AFlags); +end; + +function TLangGrid.GetRowCount: Integer; +begin + if atstable <> nil then + result := atstable.RowCount + else + result := 2; +end; + +procedure TLangGrid.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); +begin + if keycode = keyEnter then + begin + frmMain.btnEdit.Click; + end + else + inherited HandleKeyPress(keycode, shiftstate, consumed); +end; + +procedure TLangGrid.UpdateColumns; +var + n : integer; + gc : TfpgGridColumn; +begin + if atstable = nil then Exit; + + ColumnCount := atstable.LangList.Count+1; + + gc := Columns[0]; + gc.Title := 'ID'; + gc.Width := 140; + + for n := 0 to atstable.LangList.Count-1 do + begin + gc := Columns[n+1]; + gc.Title := atstable.Langlist[n]; + gc.Width := 80; + end; +end; + +procedure TfrmTextEdit.AfterCreate; +begin + textrow := nil; + + {@VFD_BODY_BEGIN: frmTextEdit} + Name := 'frmTextEdit'; + SetPosition(326, 139, 466, 168); + WindowTitle := 'Edit Text'; + Hint := ''; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 8, 80, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Text ID:'; + end; + + edID := TfpgEdit.Create(self); + with edID do + begin + Name := 'edID'; + SetPosition(8, 28, 228, 24); + ExtraHint := ''; + Hint := ''; + TabOrder := 1; + Text := ''; + FontDesc := '#Edit1'; + end; + + cmbLang1 := TfpgComboBox.Create(self); + with cmbLang1 do + begin + Name := 'cmbLang1'; + SetPosition(8, 65, 80, 22); + FontDesc := '#List'; + Hint := ''; + TabOrder := 3; + OnChange := @OnLangChange; + end; + + edLang1 := TfpgEdit.Create(self); + with edLang1 do + begin + Name := 'edLang1'; + SetPosition(100, 64, 356, 24); + ExtraHint := ''; + Hint := ''; + TabOrder := 3; + Text := ''; + FontDesc := '#Edit1'; + end; + + cmbLang2 := TfpgComboBox.Create(self); + with cmbLang2 do + begin + Name := 'cmbLang2'; + SetPosition(8, 97, 80, 22); + FontDesc := '#List'; + Hint := ''; + TabOrder := 4; + OnChange := @OnLangChange; + end; + + edLang2 := TfpgEdit.Create(self); + with edLang2 do + begin + Name := 'edLang2'; + SetPosition(100, 96, 356, 24); + ExtraHint := ''; + Hint := ''; + TabOrder := 4; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnOK := TfpgButton.Create(self); + with btnOK do + begin + Name := 'btnOK'; + SetPosition(8, 133, 99, 24); + Text := 'OK'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'stdimg.ok'; + ModalResult := mrOK; + TabOrder := 6; + Default := true; + end; + + btnCancel := TfpgButton.Create(self); + with btnCancel do + begin + Name := 'btnCancel'; + SetPosition(356, 133, 99, 24); + Text := 'Cancel'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'stdimg.cancel'; + ModalResult := mrCancel; + TabOrder := 7; + end; + + {@VFD_BODY_END: frmTextEdit} +end; + +procedure TfrmTextEdit.OnLangChange(sender: TObject); +var + b : boolean; +begin + if sender = cmbLang1 then + begin + edLang1.Text := textrow.GetText(cmbLang1.Text, b); + end + else + begin + edLang2.Text := textrow.GetText(cmbLang2.Text, b); + end; +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); +end; + +procedure TfrmTextEdit.LoadTexts; +var + b : boolean; +begin + edLang1.Text := textrow.GetText(cmbLang1.Text, b); + edLang2.Text := textrow.GetText(cmbLang2.Text, b); +end; + + +procedure TfrmLangTable.AfterCreate; +var + mi : TfpgMenuItem; +begin + {@VFD_BODY_BEGIN: frmLangTable} + Name := 'frmLangTable'; + SetPosition(282, 304, 619, 513); + WindowTitle := 'ATS Table Editor'; + Hint := ''; + + mainmenu := TfpgMenuBar.Create(self); + with mainmenu do + begin + Name := 'mainmenu'; + SetPosition(0, 0, 619, 28); + Anchors := [anLeft,anRight,anTop]; + end; + + grid := TLangGrid.Create(self); + with grid do + begin + Name := 'grid'; + SetPosition(0, 28, 619, 447); + Anchors := [anLeft,anRight,anTop,anBottom]; + end; + + btnNewRow := TfpgButton.Create(self); + with btnNewRow do + begin + Name := 'btnNewRow'; + SetPosition(8, 482, 75, 24); + Anchors := [anLeft,anBottom]; + Text := 'New Row'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + end; + + btnCopyRow := TfpgButton.Create(self); + with btnCopyRow do + begin + Name := 'btnCopyRow'; + SetPosition(92, 482, 71, 24); + Anchors := [anLeft,anBottom]; + Text := 'Copy Row'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + end; + + btnDeleteRow := TfpgButton.Create(self); + with btnDeleteRow do + begin + Name := 'btnDeleteRow'; + SetPosition(292, 482, 83, 24); + Anchors := [anLeft,anBottom]; + Text := 'Delete Row'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + end; + + btnEdit := TfpgButton.Create(self); + with btnEdit do + begin + Name := 'btnEdit'; + SetPosition(188, 482, 79, 24); + Anchors := [anLeft,anBottom]; + Text := 'Edit Item'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 5; + OnClick := @EditClick; + 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; + + grid.atstable := atsTexts; + grid.UpdateColumns; +end; + +procedure TfrmLangTable.menuProcExit(Sender: TObject); +begin + Close; +end; + +procedure TfrmLangTable.menuProcSave(Sender: TObject); +var + dlg : TfpgFileDialog; + fname : string; +begin + dlg := TfpgFileDialog.Create(nil); + dlg.Filter := 'Pascal include (*.inc;*.pas)|*.inc;*.pas|ATS text (*.ats)|*.ats|CSV (*.csv)|*.csv|All Files (*)|*|'; + + if dlg.RunSaveFile then fname := dlg.FileName + else fname := ''; + + dlg.Free; + + if fname <> '' then + begin + if ExtractFileExt(fname) = '' then fname := fname + '.inc'; + if (UpperCase(ExtractFileExt(fname)) = '.INC') + or (UpperCase(ExtractFileExt(fname)) = '.PAS') then + begin + atsTexts.SaveToFile(fname, atsPascalSource); + end + else if UpperCase(ExtractFileExt(fname)) = '.CSV' then + begin + atsTexts.SaveToFile(fname, atsCSV); + end + else // if UpperCase(ExtractFileExt(fname)) = '.ATS' then + begin + atsTexts.SaveToFile(fname, atsPureText); + end; + + ShowMessage('Save done.'); + end; +end; + +procedure TfrmLangTable.menuProcOpen(Sender: TObject); +var + dlg : TfpgFileDialog; + fname : string; +begin + dlg := TfpgFileDialog.Create(nil); + dlg.Filter := 'Pascal include (*.inc;*.pas)|*.inc;*.pas|ATS text (*.ats)|*.ats|CSV (*.csv)|*.csv|All Files (*)|*|'; + + if dlg.RunOpenFile then fname := dlg.FileName + else fname := ''; + + dlg.Free; + + if not FileExists(fname) then + begin + ShowMessage('File does not exists.'); + Exit; + end; + + if fname <> '' then + begin + if (UpperCase(ExtractFileExt(fname)) = '.INC') + or (UpperCase(ExtractFileExt(fname)) = '.PAS') then + begin + atsTexts.LoadFromPascalFile(fname); + end + else if UpperCase(ExtractFileExt(fname)) = '.CSV' then + begin + ShowMessage('CSV loading is not supported.'); + + //atsTexts.SaveToFile(fname, atsCSV); + end + else // if UpperCase(ExtractFileExt(fname)) = '.ATS' then + begin + atsTexts.LoadFromFile(fname); + end; + end; +end; + +procedure TfrmLangTable.menuProcNew(Sender: TObject); +begin + atsTexts.Clear; + grid.Update; +end; + +procedure TfrmLangTable.EditClick(Sender: TObject); +var + frm : TfrmTextEdit; + tr : TatsTextRow; +begin + tr := grid.atstable.GetRow(grid.FocusRow); + + frm := TfrmTextEdit.Create(nil); + + frm.textrow := tr; + + // load + frm.edID.Text := tr.TextID; + + frm.cmbLang1.Items.Assign(grid.atstable.LangList); + frm.cmbLang2.Items.Assign(grid.atstable.LangList); + + frm.cmbLang1.Text := 'EN'; + + if grid.FocusCol > 0 + then frm.cmbLang2.Text := grid.Columns[grid.FocusCol].Title + else frm.cmbLang2.Text := 'EN'; + + frm.LoadTexts; + + frm.ActiveWidget := frm.edLang2; + + if frm.ShowModal = mrOK then + begin + // store + tr.SetText(frm.cmbLang1.Text,frm.edLang1.Text); + if frm.cmbLang2.Text <> frm.cmbLang1.Text + then tr.SetText(frm.cmbLang2.Text,frm.edLang2.Text); + + grid.Update; + end; + + frm.Free; +end; + +procedure MainProc; +begin + fpgApplication.Initialize; + + //atsTexts.LoadFromFile('test.ats'); + + //atsTexts.LoadFromArray(langtabledata); + if fpgFileExists('atstable.inc') then + atsTexts.LoadFromPascalFile('atstable.inc'); + + frmMain := TfrmLangTable.Create(nil); + + frmMain.Show; + fpgApplication.Run; + frmMain.Free; +end; + +begin + MainProc; +end. + + diff --git a/extras/contributed/ats/ats_main.pas b/extras/contributed/ats/ats_main.pas new file mode 100644 index 00000000..e8efb251 --- /dev/null +++ b/extras/contributed/ats/ats_main.pas @@ -0,0 +1,643 @@ +unit ats_main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +type + TatsFormat = (atsPureText, atsPascalSource, atsCSV); + + TatsTextItem = record + LangId : string; + Text : string; + end; + + { TatsTextRow } + + TatsTextRow = class + protected + FTextId : string; + FTexts : array of TatsTextItem; + public + constructor Create(const atextid : string); + destructor Destroy; override; + + procedure SetText(const alangid, atext : string); + procedure DeleteText(const alangid : string); + + function GetText(const alangid : string; var afound : boolean) : string; + + property TextId : string read FTextId; + end; + + { TatsTextTable } + + TatsTextTable = class + private + FLangIds : TStringList; + + FTable : TStringList; + + FCurrentLangId : string; + + 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; + + property LangList : TStringList read FLangIds; + end; + +var + atsTexts : TatsTextTable; + +function atsGetText(const atextid : string) : string; +function atsText(const atextid : string) : string; + +implementation + +uses + ptrparsefunc; + +function atsGetText(const atextid : string) : string; +begin + result := atsTexts.GetText(atextid); +end; + +function atsText(const atextid : string) : string; +begin + result := atsTexts.GetText(atextid); +end; + +{ TatsTextRow } + +constructor TatsTextRow.Create(const atextid : string); +begin + FTextId := atextid; + SetLength(FTexts,0); +end; + +destructor TatsTextRow.Destroy; +var + n : integer; +begin + // good to be sure about freeing ansi string + for n := 0 to length(FTexts)-1 do + begin + FTexts[n].LangId := ''; + FTexts[n].Text := ''; + end; + SetLength(FTexts,0); +end; + +procedure TatsTextRow.SetText(const alangid, atext: string); +var + n : integer; +begin + // search for an existing + for n := 0 to length(FTexts)-1 do + begin + if FTexts[n].LangId = alangid then + begin + FTexts[n].Text := atext; + Exit; //==> + end; + end; + // add as new + n := length(FTexts); + SetLength(FTexts,n+1); + FTexts[n].LangId := alangid; + FTexts[n].Text := atext; +end; + +procedure TatsTextRow.DeleteText(const alangid: string); +var + n : integer; +begin + // search for an existing + n := 0; + while (n < length(FTexts)) and (FTexts[n].LangId <> alangid) do + begin + inc(n); + end; + + // for ansi string safety + if n < length(FTexts) then + begin + FTexts[n].LangId := ''; + FTexts[n].Text := ''; + inc(n); + end; + + while (n < length(FTexts)) do + begin + FTexts[n-1] := FTexts[n]; + inc(n); + end; + + SetLength(FTexts,length(FTexts)-1); +end; + +function TatsTextRow.GetText(const alangid: string; var afound : boolean) : string; +var + n : integer; +begin + // search for an existing + for n := 0 to length(FTexts)-1 do + begin + if FTexts[n].LangId = alangid then + begin + result := FTexts[n].Text; + afound := true; + Exit; //==> + end; + end; + result := ''; + afound := false; +end; + +{ TatsTextTable } + +function TatsTextTable.FindRow(const atextid: string) : TatsTextRow; +var + i : integer; +begin + i := FTable.IndexOf(atextid); + + if i >= 0 then result := TatsTextRow(FTable.Objects[i]) + else result := nil; +end; + +function TatsTextTable.AddRow(const atextid: string) : TatsTextRow; +begin + result := FindRow(atextid); + if result = nil then + begin + result := TatsTextRow.Create(atextid); + FTable.AddObject(atextid, result); + end; +end; + +constructor TatsTextTable.Create; +begin + FTable := TStringList.Create; + FLangIds := TStringList.Create; + FCurrentLangId := ''; +end; + +destructor TatsTextTable.Destroy; +begin + Clear; + FTable.Free; + FLangIds.Free; +end; + +procedure TatsTextTable.Clear; +var + n : integer; +begin + for n := 0 to FTable.Count - 1 do + begin + TatsTextRow(FTable.Objects[n]).Free; + end; + FTable.Clear; + FLangIds.Clear; +end; + +procedure TatsTextTable.AddLang(const alangid: string); +var + i : integer; +begin + i := FLangIds.IndexOf(alangid); + if i < 0 then FLangIds.Add(alangid); + if FCurrentLangId = '' then FCurrentLangId := alangid; +end; + +procedure TatsTextTable.SetText(const atextid, alangid, atext: string); +var + tr : TatsTextRow; +begin + AddLang(alangid); + tr := AddRow(atextid); + tr.SetText(alangid, atext); +end; + +function TatsTextTable.GetText(const atextid, alangid: string; var found: boolean): string; +var + tr : TatsTextRow; +begin + tr := FindRow(atextid); + if tr <> nil then result := tr.GetText(alangid, found) + else + begin + result := ''; + found := false; + end; +end; + +function TatsTextTable.GetText(const atextid: string): string; +var + found : boolean; +begin + result := GetText(atextid, FCurrentLangId, found); + if not found then + begin + // some fallback mechanism + result := '#'+atextid+'@'+FCurrentLangId; + end; +end; + +procedure TatsTextTable.SelectLang(const alangid: string); +var + i : integer; +begin + i := FLangIds.indexof(alangid); + if i >= 0 then + begin + FCurrentLangId := alangid; + end; +end; + +function GetFileContent(const afilename : string) : string; +var + f : file; + toread, rcnt, brres : integer; +begin + try + AssignFile(f,afilename); + Reset(f,1); + + toread := FileSize(f); + rcnt := 0; + + SetLength(result, toread); + + repeat + BlockRead(f, result[1+rcnt], toread, brres); + + if brres > 0 then + begin + inc(rcnt,brres); + dec(toread,brres); + end; + until toread <= 0; + + finally + CloseFile(f); + end; +end; + +procedure PutFileContent(const afilename : string; const adata : string); +var + f : file; + towrite, wcnt, wrres : integer; +begin + try + AssignFile(f,afilename); + Rewrite(f,1); + + towrite := length(adata); + wcnt := 0; + + repeat + BlockWrite(f, adata[1+wcnt], towrite, wrres); + + if wrres > 0 then + begin + inc(wcnt,wrres); + dec(towrite,wrres); + end; + until towrite <= 0; + + finally + CloseFile(f); + end; +end; + + +function TatsTextTable.LoadFromFile(const afilename: string): boolean; +var + fdata : string; +begin + fdata := GetFileContent(afilename); + //writeln('File content:'); + //writeln(fdata); + LoadPureText(fdata); + + result := true; +end; + +function TatsTextTable.LoadFromPascalFile(const afilename : string) : boolean; +var + fdata, data : string; + rp,sp,ep : PChar; // read ptr, start ptr, end ptr + len : integer; + tid, lid, txt : string; + inquote : boolean; +begin + result := false; + + fdata := GetFileContent(afilename); + + if fdata = '' then Exit; + + sp := @fdata[1]; + ep := sp + length(fdata); + + rp := sp; + + // skipping UTF8 marker first + ppCheckSymbol(rp, ep, #$EF#$BB#$BF); + + ppSkipSpaces(rp, ep); + + if not ppCheckSymbolCI(rp, ep, 'array') then EXIT; + + ppSkipSpaces(rp, ep); + if not ppCheckSymbol(rp, ep, '[') then EXIT; + + if not ppSearchPattern(rp, ep, ']', len) then EXIT; + + ppSkipSpaces(rp, ep); + if not ppCheckSymbolCI(rp, ep, 'of') then EXIT; + ppSkipSpaces(rp, ep); + if not ppCheckSymbolCI(rp, ep, 'string') then EXIT; + ppSkipSpaces(rp, ep); + if not ppCheckSymbol(rp, ep, '=') then EXIT; + ppSkipSpaces(rp, ep); + if not ppCheckSymbol(rp, ep, '(') then EXIT; + + ppSkipSpaces(rp, ep); + + data := ''; + + inquote := false; + + while rp < ep do + begin + if not inquote then + begin + ppSkipSpaces(rp, ep); + if ppCheckSymbol(rp, ep, '''') then + begin + inquote := true; + sp := rp; + end + else if ppCheckSymbol(rp, ep, ',') then + begin + // just skip ip + ppSkipSpaces(rp, ep); + end + else if ppCheckSymbol(rp, ep, ')') then + begin + // closing char + break; + end + else + begin + // invalid char + break; + end; + end; + + if inquote then + begin + if ppReadTo(rp, ep, '''', len) then + begin + // closing quote or double quote + if len > 0 then data := data + ppMakeString(sp, len); + inc(rp); + if (rp < ep) and (rp^ = '''') then + begin + data := data + ''''; + inc(rp); + sp := rp; + end + else + begin + data := data + #10; + inquote := false; + end; + end; + end; + end; // while + + //writeln('Pure content:'); + //writeln(data); + + LoadPureText(data); + + result := true; +end; + +function TatsTextTable.LoadFromArray(const aarr: array of string): boolean; +var + fdata : string; + n : integer; +begin + fdata := ''; + for n := low(aarr) to high(aarr) do + begin + fdata := fdata + aarr[n] + #10; + end; + LoadPureText(fdata); +end; + +procedure TatsTextTable.LoadPureText(const fdata: string); +var + rp,sp,ep : PChar; // read ptr, start ptr, end ptr + len : integer; + tid, lid, txt : string; +begin + if fdata = '' then Exit; + + sp := @fdata[1]; + ep := sp + length(fdata); + + rp := sp; + + // skipping UTF8 marker first + ppCheckSymbol(rp, ep, #$EF#$BB#$BF); + + ppSkipSpaces(rp, ep); + + tid := '???'; + + while rp < ep do + begin + sp := rp; + // reading identifier (txt or lang) + if ppReadTo(rp, ep, '=:', len) then + begin + if rp^ = ':' then + begin + // text id is this + tid := trim(ppMakeString(sp, len)); + inc(rp); // skip ':' + end + else if rp^ = '=' then + begin + // lang id is this + lid := trim(ppMakeString(sp,len)); + inc(rp); // skip '=' + + ppSkipSpaces(rp, ep); + + if not ppCheckSymbol(rp,ep,'"') then + begin + // starting quote is missing + end; + + txt := ''; + sp := rp; + if ppReadTo(rp, ep, '"', len) then + begin + txt := ppMakeString(sp,len); + inc(rp); + end + else + begin + // end quote is missing + end; + + if txt <> '' then + begin + atsTexts.SetText(tid, lid, txt); + end; + end; + + ppSkipSpaces(rp, ep); + end; // reading identifier + end; +end; + +procedure TatsTextTable.SaveToFile(const afilename: string; aformat: TatsFormat); +var + sl : TStringList; + tr : TatsTextRow; + n,i : integer; + s : string; + b : boolean; + fdata : string; +begin + sl := TStringList.Create; + + for n:=0 to FTable.Count-1 do + begin + tr := TatsTextRow(FTable.Objects[n]); + if aformat = atsCSV then + begin + s := '"'+tr.TextId+'"'; + for i := 0 to FLangIds.Count-1 do + begin + s := s + ',"' + tr.GetText(FLangIds[i],b) + '"'; + end; + sl.Add(s); + end + else + begin + sl.Add(tr.TextID+':'); + for i := 0 to FLangIds.Count-1 do + begin + s := tr.GetText(FLangIds[i],b); + if b then sl.Add(' '+FLangIds[i]+'="'+s+'"'); + end; + end; + end; + + // assembly the final buffer + + if aformat = atsCSV then + begin + fdata := '"ATSF1"'; + for i := 0 to FLangIds.Count-1 do + begin + fdata := fdata + ',"' + FLangIds[i] + '"'; + end; + for n := 0 to sl.Count-1 do + begin + fdata := fdata + #13#10 + sl[n]; + end; + end + else if aformat = atsPascalSource then + begin + fdata := 'array[1..'+IntToStr(sl.Count)+'] of string = ('+#13#10; + s := ' '; + for n := 0 to sl.Count-1 do + begin + fdata := fdata + ' ' + s + QuotedStr(sl[n]) + #13#10; + s := ','; + end; + fdata := fdata + #13#10 + ');' + #13#10; + end + else + begin + // pure text... + fdata := ''; // no header + for n := 0 to sl.Count-1 do + begin + fdata := fdata + sl[n] + #13#10; + end; + end; + + sl.Free; + + PutFileContent(afilename, fdata); +end; + +function TatsTextTable.RowCount: integer; +begin + result := FTable.Count; +end; + +function TatsTextTable.GetRow(arow: integer): TatsTextRow; +begin + result := TatsTextRow(FTable.Objects[arow]); +end; + + +initialization +begin + atsTexts := TatsTextTable.Create; +end; + +end. + diff --git a/extras/contributed/ats/atstable.ats b/extras/contributed/ats/atstable.ats new file mode 100644 index 00000000..412fa3c5 --- /dev/null +++ b/extras/contributed/ats/atstable.ats @@ -0,0 +1,218 @@ +rsLanguage:
+ EN="English"
+ RU="РуÑÑкий"
+ AF="Afrikaans"
+rsOK:
+ EN="OK"
+ RU="OK"
+ AF="Goed"
+rsCancel:
+ EN="Cancel"
+ RU="Отмена"
+ AF="Kanseleer"
+rsHelp:
+ EN="Help"
+ RU="Справка"
+ AF="Help"
+rsOpen:
+ EN="Open"
+ RU="Открыть"
+ AF="Maak oop"
+rsSave:
+ EN="Save"
+ RU="Сохранить"
+ AF="Stoor"
+rsCreate:
+ EN="Create"
+ RU="Создать"
+rsChange:
+ EN="Change"
+ RU="Изменить"
+rsFind:
+ EN="Find"
+ RU="Ðайти"
+rsSearch:
+ EN="Search"
+ RU="ПоиÑк"
+rsReplace:
+ EN="Replace"
+ RU="Заменить"
+rsConfirm:
+ EN="Confirm"
+ RU="Подтвердить"
+rsAll:
+ EN="All"
+ RU="Ð’Ñе"
+rsSelect:
+ EN="Select"
+ RU="Выбрать"
+rsYes:
+ EN="Yes"
+ RU="Да"
+rsNo:
+ EN="No"
+ RU="Ðет"
+ AF="Nee"
+rsAbort:
+ EN="Abort"
+ RU="Прервать"
+rsRetry:
+ EN="Retry"
+ RU="Повторить"
+rsIgnore:
+ EN="Ignore"
+ RU="ПропуÑтить"
+rsClose:
+ EN="Close"
+ RU="Закрыть"
+rsInsert:
+ EN="Insert"
+ RU="Ð’Ñтавка"
+rsEdit:
+ EN="Edit"
+ RU="Редактировать"
+rsDelete:
+ EN="Delete"
+ RU="Удалить"
+rsExit:
+ EN="Exit"
+ RU="Выход"
+rsYesToAll:
+ EN="Yes to All"
+ RU="Да Ð´Ð»Ñ Ð²Ñех"
+rsNoToAll:
+ EN="No to All"
+ RU="Ðет Ð´Ð»Ñ Ð²Ñех"
+rsCut:
+ EN="Cut"
+ RU="Вырезать"
+rsCopy:
+ EN="Copy"
+ RU="Копировать"
+rsPaste:
+ EN="Paste"
+ RU="Ð’Ñтавить"
+rsError:
+ EN="Error"
+rsCriticalError:
+ EN="Critical Error"
+rsInformation:
+ EN="Information"
+rsConfirmation:
+ EN="Confirmation"
+rsWarning:
+ EN="Warning"
+rsMessage:
+ EN="Message"
+rsAbout:
+ EN="About %s"
+rsAllFiles:
+ EN="All Files"
+rsCreateDirectory:
+ EN="Create directory"
+rsEnterNewDirectory:
+ EN="Enter new directory name"
+rsCannotCreateDir:
+ EN="Cannot create directory"
+rsSelectAFont:
+ EN="Select a font"
+rsName:
+ EN="Name"
+rsCollection:
+ EN="Collection"
+rsSize:
+ EN="Size"
+rsStyle:
+ EN="Style"
+rsItalic:
+ EN="Italic"
+rsBold:
+ EN="Bold"
+rsUnderScore:
+ EN="UnderScore"
+rsTypeface:
+ EN="Typeface"
+rsAntiAliasing:
+ EN="Anti aliasing"
+rsExampleText:
+ EN="Example Text"
+rsCollectionAllFonts:
+ EN="All Fonts"
+rsCollectionRecentlyUsed:
+ EN="Recently Used"
+rsCollectionFavourites:
+ EN="Favourites"
+rsCollectionFixedWidth:
+ EN="Fixed Width"
+rsCollectionSans:
+ EN="Sans"
+rsCollectionSerif:
+ EN="Serif"
+rsCollectionFontAliases:
+ EN="Font Aliases"
+rsOpenAFile:
+ EN="Open a file"
+rsFileName:
+ EN="Filename"
+rsFileType:
+ EN="Type of file"
+rsDrive:
+ EN="Drive"
+rsFiles:
+ EN="Files"
+rsDirectories:
+ EN="Directories"
+rsShowHidden:
+ EN="Show hidden files"
+rsFileSelection:
+ EN="File Selection"
+rsFileModifiedTime:
+ EN="Mod. Time"
+rsFileAttributes:
+ EN="Attributes"
+rsFileRights:
+ EN="Rights"
+rsFileOwner:
+ EN="Owner"
+rsFileGroup:
+ EN="Group"
+rsSaveAFile:
+ EN="Save file as"
+rsErrListMustBeEmpty:
+ EN="List must be empty"
+rsErrCouldNotOpenDir:
+ EN="Could not open the directory <%s>"
+rsErrItemOfWrongType:
+ EN="Item is not of <%s> type!"
+rsErrFailedToCreateDir:
+ EN="Failed to create the directory <%s>"
+rsErrNotAssigned:
+ EN="<%s> not assigned"
+rsShortMon:
+ EN="Mon"
+rsShortTue:
+ EN="Tue"
+rsShortWed:
+ EN="Wed"
+rsShortThu:
+ EN="Thu"
+rsShortFri:
+ EN="Fri"
+rsShortSat:
+ EN="Sat"
+rsShortSun:
+ EN="Sun"
+rsLongMon:
+ EN="Monday"
+rsLongTue:
+ EN="Tuesday"
+rsLongWed:
+ EN="Wednesday"
+rsLongThu:
+ EN="Thursday"
+rsLongFri:
+ EN="Friday"
+rsLongSat:
+ EN="Saturday"
+rsLongSun:
+ EN="Sunday"
diff --git a/extras/contributed/ats/atstable.csv b/extras/contributed/ats/atstable.csv new file mode 100644 index 00000000..84dffa92 --- /dev/null +++ b/extras/contributed/ats/atstable.csv @@ -0,0 +1,92 @@ +"ATSF1","EN","RU","AF"
+"rsLanguage","English","РуÑÑкий","Afrikaans"
+"rsOK","OK","OK","Goed"
+"rsCancel","Cancel","Отмена","Kanseleer"
+"rsHelp","Help","Справка","Help"
+"rsOpen","Open","Открыть","Maak oop"
+"rsSave","Save","Сохранить","Stoor"
+"rsCreate","Create","Создать",""
+"rsChange","Change","Изменить",""
+"rsFind","Find","Ðайти",""
+"rsSearch","Search","ПоиÑк",""
+"rsReplace","Replace","Заменить",""
+"rsConfirm","Confirm","Подтвердить",""
+"rsAll","All","Ð’Ñе",""
+"rsSelect","Select","Выбрать",""
+"rsYes","Yes","Да",""
+"rsNo","No","Ðет","Nee"
+"rsAbort","Abort","Прервать",""
+"rsRetry","Retry","Повторить",""
+"rsIgnore","Ignore","ПропуÑтить",""
+"rsClose","Close","Закрыть",""
+"rsInsert","Insert","Ð’Ñтавка",""
+"rsEdit","Edit","Редактировать",""
+"rsDelete","Delete","Удалить",""
+"rsExit","Exit","Выход",""
+"rsYesToAll","Yes to All","Да Ð´Ð»Ñ Ð²Ñех",""
+"rsNoToAll","No to All","Ðет Ð´Ð»Ñ Ð²Ñех",""
+"rsCut","Cut","Вырезать",""
+"rsCopy","Copy","Копировать",""
+"rsPaste","Paste","Ð’Ñтавить",""
+"rsError","Error","",""
+"rsCriticalError","Critical Error","",""
+"rsInformation","Information","",""
+"rsConfirmation","Confirmation","",""
+"rsWarning","Warning","",""
+"rsMessage","Message","",""
+"rsAbout","About %s","",""
+"rsAllFiles","All Files","",""
+"rsCreateDirectory","Create directory","",""
+"rsEnterNewDirectory","Enter new directory name","",""
+"rsCannotCreateDir","Cannot create directory","",""
+"rsSelectAFont","Select a font","",""
+"rsName","Name","",""
+"rsCollection","Collection","",""
+"rsSize","Size","",""
+"rsStyle","Style","",""
+"rsItalic","Italic","",""
+"rsBold","Bold","",""
+"rsUnderScore","UnderScore","",""
+"rsTypeface","Typeface","",""
+"rsAntiAliasing","Anti aliasing","",""
+"rsExampleText","Example Text","",""
+"rsCollectionAllFonts","All Fonts","",""
+"rsCollectionRecentlyUsed","Recently Used","",""
+"rsCollectionFavourites","Favourites","",""
+"rsCollectionFixedWidth","Fixed Width","",""
+"rsCollectionSans","Sans","",""
+"rsCollectionSerif","Serif","",""
+"rsCollectionFontAliases","Font Aliases","",""
+"rsOpenAFile","Open a file","",""
+"rsFileName","Filename","",""
+"rsFileType","Type of file","",""
+"rsDrive","Drive","",""
+"rsFiles","Files","",""
+"rsDirectories","Directories","",""
+"rsShowHidden","Show hidden files","",""
+"rsFileSelection","File Selection","",""
+"rsFileModifiedTime","Mod. Time","",""
+"rsFileAttributes","Attributes","",""
+"rsFileRights","Rights","",""
+"rsFileOwner","Owner","",""
+"rsFileGroup","Group","",""
+"rsSaveAFile","Save file as","",""
+"rsErrListMustBeEmpty","List must be empty","",""
+"rsErrCouldNotOpenDir","Could not open the directory <%s>","",""
+"rsErrItemOfWrongType","Item is not of <%s> type!","",""
+"rsErrFailedToCreateDir","Failed to create the directory <%s>","",""
+"rsErrNotAssigned","<%s> not assigned","",""
+"rsShortMon","Mon","",""
+"rsShortTue","Tue","",""
+"rsShortWed","Wed","",""
+"rsShortThu","Thu","",""
+"rsShortFri","Fri","",""
+"rsShortSat","Sat","",""
+"rsShortSun","Sun","",""
+"rsLongMon","Monday","",""
+"rsLongTue","Tuesday","",""
+"rsLongWed","Wednesday","",""
+"rsLongThu","Thursday","",""
+"rsLongFri","Friday","",""
+"rsLongSat","Saturday","",""
+"rsLongSun","Sunday","",""
\ No newline at end of file diff --git a/extras/contributed/ats/atstable.inc b/extras/contributed/ats/atstable.inc new file mode 100644 index 00000000..3a06923e --- /dev/null +++ b/extras/contributed/ats/atstable.inc @@ -0,0 +1,291 @@ +array[1..288] of string = (
+ 'rsLanguage:'
+ ,' EN="English"'
+ ,' RU="РуÑÑкий"'
+ ,' HU="Magyar"'
+ ,' AF="Afrikaans"'
+ ,'rsOK:'
+ ,' EN="OK"'
+ ,' RU="OK"'
+ ,' HU="OK"'
+ ,' AF="Goed"'
+ ,'rsCancel:'
+ ,' EN="Cancel"'
+ ,' RU="Отмена"'
+ ,' HU="Mégse"'
+ ,' AF="Kanselleer"'
+ ,'rsHelp:'
+ ,' EN="Help"'
+ ,' RU="Справка"'
+ ,' HU="SegÃtség"'
+ ,'rsOpen:'
+ ,' EN="Open"'
+ ,' RU="Открыть"'
+ ,' HU="Megnyitás"'
+ ,'rsSave:'
+ ,' EN="Save"'
+ ,' RU="Сохранить"'
+ ,' HU="Mentés"'
+ ,' AF="Stoor"'
+ ,'rsCreate:'
+ ,' EN="Create"'
+ ,' RU="Создать"'
+ ,' HU="Létrehoz"'
+ ,'rsChange:'
+ ,' EN="Change"'
+ ,' RU="Изменить"'
+ ,' HU="Változtat"'
+ ,' AF="Verander"'
+ ,'rsFind:'
+ ,' EN="Find"'
+ ,' RU="Ðайти"'
+ ,' HU="Talál"'
+ ,' AF="Vind"'
+ ,'rsSearch:'
+ ,' EN="Search"'
+ ,' RU="ПоиÑк"'
+ ,' HU="Keres"'
+ ,' AF="Soek"'
+ ,'rsReplace:'
+ ,' EN="Replace"'
+ ,' RU="Заменить"'
+ ,' HU="Cserél"'
+ ,' AF="Vervang"'
+ ,'rsConfirm:'
+ ,' EN="Confirm"'
+ ,' RU="Подтвердить"'
+ ,' HU="Jóváhagy"'
+ ,'rsAll:'
+ ,' EN="All"'
+ ,' RU="Ð’Ñе"'
+ ,' HU="Mind"'
+ ,' AF="Alles"'
+ ,'rsSelect:'
+ ,' EN="Select"'
+ ,' RU="Выбрать"'
+ ,' HU="Kiválaszt"'
+ ,'rsYes:'
+ ,' EN="Yes"'
+ ,' RU="Да"'
+ ,' HU="Igen"'
+ ,' AF="Ja"'
+ ,'rsNo:'
+ ,' EN="No"'
+ ,' RU="Ðет"'
+ ,' HU="Nem"'
+ ,' AF="Nee"'
+ ,'rsAbort:'
+ ,' EN="Abort"'
+ ,' RU="Прервать"'
+ ,' HU="MegszakÃt"'
+ ,'rsRetry:'
+ ,' EN="Retry"'
+ ,' RU="Повторить"'
+ ,' HU="Újra"'
+ ,'rsIgnore:'
+ ,' EN="Ignore"'
+ ,' RU="ПропуÑтить"'
+ ,' HU="Kihagy"'
+ ,' AF="Ignoreer"'
+ ,'rsClose:'
+ ,' EN="Close"'
+ ,' RU="Закрыть"'
+ ,' HU="Bezár"'
+ ,' AF="Sluit"'
+ ,'rsInsert:'
+ ,' EN="Insert"'
+ ,' RU="Ð’Ñтавка"'
+ ,' HU="Beszúr"'
+ ,'rsEdit:'
+ ,' EN="Edit"'
+ ,' RU="Редактировать"'
+ ,' HU="Szerkeszt"'
+ ,'rsDelete:'
+ ,' EN="Delete"'
+ ,' RU="Удалить"'
+ ,' HU="Töröl"'
+ ,'rsExit:'
+ ,' EN="Exit"'
+ ,' RU="Выход"'
+ ,' HU="Kilép"'
+ ,' AF="Verlaat"'
+ ,'rsYesToAll:'
+ ,' EN="Yes to All"'
+ ,' RU="Да Ð´Ð»Ñ Ð²Ñех"'
+ ,' HU="Mindre igen"'
+ ,'rsNoToAll:'
+ ,' EN="No to All"'
+ ,' RU="Ðет Ð´Ð»Ñ Ð²Ñех"'
+ ,' HU="Mindre nem"'
+ ,'rsCut:'
+ ,' EN="Cut"'
+ ,' RU="Вырезать"'
+ ,' HU="Kivág"'
+ ,'rsCopy:'
+ ,' EN="Copy"'
+ ,' RU="Копировать"'
+ ,' HU="Másol"'
+ ,'rsPaste:'
+ ,' EN="Paste"'
+ ,' RU="Ð’Ñтавить"'
+ ,' HU="Beilleszt"'
+ ,'rsError:'
+ ,' EN="Error"'
+ ,' HU="Hiba"'
+ ,'rsCriticalError:'
+ ,' EN="Critical Error"'
+ ,' HU="Kritikus hiba"'
+ ,'rsInformation:'
+ ,' EN="Information"'
+ ,' HU="Információ"'
+ ,'rsConfirmation:'
+ ,' EN="Confirmation"'
+ ,' HU="MegerÅ‘sÃtés"'
+ ,'rsWarning:'
+ ,' EN="Warning"'
+ ,' HU="Figyelmeztetés"'
+ ,'rsMessage:'
+ ,' EN="Message"'
+ ,' HU="Ãœzenet"'
+ ,'rsAbout:'
+ ,' EN="About %s"'
+ ,' HU="About %s"'
+ ,'rsAllFiles:'
+ ,' EN="All Files"'
+ ,' HU="Összes fájl"'
+ ,'rsCreateDirectory:'
+ ,' EN="Create directory"'
+ ,' HU="Könyvtár létrehozása"'
+ ,'rsEnterNewDirectory:'
+ ,' EN="Enter new directory name"'
+ ,'rsCannotCreateDir:'
+ ,' EN="Cannot create directory"'
+ ,'rsSelectAFont:'
+ ,' EN="Select a font"'
+ ,'rsName:'
+ ,' EN="Name"'
+ ,' AF="Naam"'
+ ,'rsCollection:'
+ ,' EN="Collection"'
+ ,'rsSize:'
+ ,' EN="Size"'
+ ,' AF="Goote"'
+ ,'rsStyle:'
+ ,' EN="Style"'
+ ,' AF="Steil"'
+ ,'rsItalic:'
+ ,' EN="Italic"'
+ ,'rsBold:'
+ ,' EN="Bold"'
+ ,'rsUnderScore:'
+ ,' EN="UnderScore"'
+ ,'rsTypeface:'
+ ,' EN="Typeface"'
+ ,'rsAntiAliasing:'
+ ,' EN="Anti aliasing"'
+ ,'rsExampleText:'
+ ,' EN="Example Text"'
+ ,' AF="Voorbeeld Teks"'
+ ,'rsCollectionAllFonts:'
+ ,' EN="All Fonts"'
+ ,'rsCollectionRecentlyUsed:'
+ ,' EN="Recently Used"'
+ ,'rsCollectionFavourites:'
+ ,' EN="Favourites"'
+ ,'rsCollectionFixedWidth:'
+ ,' EN="Fixed Width"'
+ ,'rsCollectionSans:'
+ ,' EN="Sans"'
+ ,'rsCollectionSerif:'
+ ,' EN="Serif"'
+ ,'rsCollectionFontAliases:'
+ ,' EN="Font Aliases"'
+ ,'rsOpenAFile:'
+ ,' EN="Open a file"'
+ ,'rsFileName:'
+ ,' EN="Filename"'
+ ,'rsFileType:'
+ ,' EN="Type of file"'
+ ,'rsDrive:'
+ ,' EN="Drive"'
+ ,'rsFiles:'
+ ,' EN="Files"'
+ ,'rsDirectories:'
+ ,' EN="Directories"'
+ ,'rsShowHidden:'
+ ,' EN="Show hidden files"'
+ ,'rsFileSelection:'
+ ,' EN="File Selection"'
+ ,'rsFileModifiedTime:'
+ ,' EN="Mod. Time"'
+ ,'rsFileAttributes:'
+ ,' EN="Attributes"'
+ ,'rsFileRights:'
+ ,' EN="Rights"'
+ ,'rsFileOwner:'
+ ,' EN="Owner"'
+ ,'rsFileGroup:'
+ ,' EN="Group"'
+ ,'rsSaveAFile:'
+ ,' EN="Save file as"'
+ ,'rsErrListMustBeEmpty:'
+ ,' EN="List must be empty"'
+ ,'rsErrCouldNotOpenDir:'
+ ,' EN="Could not open the directory <%s>"'
+ ,'rsErrItemOfWrongType:'
+ ,' EN="Item is not of <%s> type!"'
+ ,'rsErrFailedToCreateDir:'
+ ,' EN="Failed to create the directory <%s>"'
+ ,'rsErrNotAssigned:'
+ ,' EN="<%s> not assigned"'
+ ,'rsShortMon:'
+ ,' EN="Mon"'
+ ,' HU="H"'
+ ,'rsShortTue:'
+ ,' EN="Tue"'
+ ,' HU="K"'
+ ,'rsShortWed:'
+ ,' EN="Wed"'
+ ,' HU="Sz"'
+ ,'rsShortThu:'
+ ,' EN="Thu"'
+ ,' HU="Cs"'
+ ,'rsShortFri:'
+ ,' EN="Fri"'
+ ,' HU="P"'
+ ,'rsShortSat:'
+ ,' EN="Sat"'
+ ,' HU="Szo"'
+ ,'rsShortSun:'
+ ,' EN="Sun"'
+ ,' HU="V"'
+ ,'rsLongMon:'
+ ,' EN="Monday"'
+ ,' HU="Hétfő"'
+ ,' AF="Maandag"'
+ ,'rsLongTue:'
+ ,' EN="Tuesday"'
+ ,' HU="Kedd"'
+ ,' AF="Dinsdag"'
+ ,'rsLongWed:'
+ ,' EN="Wednesday"'
+ ,' HU="Szerda"'
+ ,' AF="Woensdag"'
+ ,'rsLongThu:'
+ ,' EN="Thursday"'
+ ,' HU="Csütörtök"'
+ ,' AF="Donderdag"'
+ ,'rsLongFri:'
+ ,' EN="Friday"'
+ ,' HU="Péntek"'
+ ,' AF="Vrydag"'
+ ,'rsLongSat:'
+ ,' EN="Saturday"'
+ ,' HU="Szombat"'
+ ,' AF="Saterdag"'
+ ,'rsLongSun:'
+ ,' EN="Sunday"'
+ ,' HU="Vasárnap"'
+ ,' AF="Sondag"'
+
+);
diff --git a/extras/contributed/ats/extrafpc.cfg b/extras/contributed/ats/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/extras/contributed/ats/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/extras/contributed/ats/ptrparsefunc.pas b/extras/contributed/ats/ptrparsefunc.pas new file mode 100644 index 00000000..7c2c0790 --- /dev/null +++ b/extras/contributed/ats/ptrparsefunc.pas @@ -0,0 +1,165 @@ +unit ptrparsefunc; + +interface + +procedure ppSkipSpaces(var ReadPtr : PChar; bufend : PChar); + +function ppReadLine(var ReadPtr : PChar; bufend : PChar; var LineLength : integer) : boolean; + +function ppReadTo(var ReadPtr : PChar; bufend : PChar; const stopchars : shortstring; var CharCount : integer) : boolean; + +function ppCheckSymbol(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring) : boolean; +function ppCheckSymbolCI(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring) : boolean; // case insensitive + +function ppSearchPattern(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring; + var distance : integer) : boolean; + +function ppMakeString(buf : pointer; len : integer) : string; + +implementation + +function ppMakeString(buf : pointer; len : integer) : string; +begin + SetLength(result, len); + if len > 0 then move(buf^, result[1], len); +end; + +procedure ppSkipSpaces(var ReadPtr : PChar; bufend : PChar); +begin + while (ReadPtr < bufend) and (ReadPtr^ in [#13,#10,#9,#32]) do + begin + inc(ReadPtr); + end; +end; + +function ppReadLine(var ReadPtr : PChar; bufend : PChar; var LineLength : integer) : boolean; +begin + LineLength := 0; + result := true; + while (ReadPtr < bufend) do + begin + if ReadPtr^ = #10 then + begin + // unix line end + inc(ReadPtr); + exit; + end + else if ReadPtr^ = #13 then + begin + // DOS or Mac line end + inc(ReadPtr); + if (ReadPtr < bufend) and (ReadPtr^ = #10) then inc(ReadPtr); // DOS line ending + Exit; + end; + inc(LineLength); + inc(ReadPtr); + end; + result := false; +end; + +function ppReadTo(var ReadPtr : PChar; bufend : PChar; const stopchars : shortstring; var CharCount : integer) : boolean; +begin + CharCount := 0; + while (ReadPtr < bufend) do + begin + if pos(ReadPtr^,stopchars) > 0 then + begin + result := true; + exit; + end; + inc(CharCount); + inc(ReadPtr); + end; + Result := false; +end; + + +function ppCheckSymbol(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring) : boolean; +var + rp : PChar; + cc : integer; +begin + result := false; + cc := 1; + rp := ReadPtr; + while rp < bufend do + begin + if checkstring[cc] <> rp^ then + begin + EXIT; + end + else if cc >= length(checkstring) then + begin + ReadPtr := rp; + inc(ReadPtr); + result := true; + EXIT; + end; + inc(cc); + inc(rp); + end; +end; + +function ppCheckSymbolCI(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring) : boolean; +var + rp : PChar; + cc : integer; +begin + result := false; + cc := 1; + rp := ReadPtr; + while rp < bufend do + begin + if UpCase(checkstring[cc]) <> UpCase(rp^) then + begin + EXIT; + end + else if cc >= length(checkstring) then + begin + ReadPtr := rp; + inc(ReadPtr); + result := true; + EXIT; + end; + inc(cc); + inc(rp); + end; +end; + +function ppSearchPattern(var ReadPtr : PChar; bufend : PChar; const checkstring : shortstring; + var distance : integer) : boolean; +var + rp, cstartp : PChar; + cc : integer; +begin + result := false; + cc := 1; + cstartp := ReadPtr; + rp := ReadPtr; + while rp < bufend do + begin + if checkstring[cc] <> rp^ then + begin + // try the next position + inc(cstartp); + rp := cstartp; + cc := 1; + end + else if cc >= length(checkstring) then + begin + inc(rp); + distance := rp - ReadPtr; + ReadPtr := rp; + result := true; + EXIT; + end + else + begin + inc(cc); + inc(rp); + end; + end; +end; + +end. + diff --git a/extras/contributed/ats/readme.txt b/extras/contributed/ats/readme.txt new file mode 100644 index 00000000..9e6941e6 --- /dev/null +++ b/extras/contributed/ats/readme.txt @@ -0,0 +1,10 @@ + +Name: ats (alternative translation strings) editor +Author: Nagy Viktor <nvitya@freemail.hu> +Date: around 2006 +Description: +This uses a single file for all language translations. You can then +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. + diff --git a/extras/lazarus_ide/fpgui_ide.pas b/extras/lazarus_ide/fpgui_ide.pas index 2520d304..2520d304 100755..100644 --- a/extras/lazarus_ide/fpgui_ide.pas +++ b/extras/lazarus_ide/fpgui_ide.pas diff --git a/extras/mseide_templates/fpgui.prj b/extras/mseide_templates/fpgui.prj new file mode 100644 index 00000000..2cf0c420 --- /dev/null +++ b/extras/mseide_templates/fpgui.prj @@ -0,0 +1,976 @@ +[componentpalette] +order0=0 +order1=0 +order2=0 +order3=0 +order4=0 +order5=0 +order6=0 +order7=0 +order8=0 +order9=0 +order10=0 +order11=0 +[projectoptions] +projectdir=/opt/msegui_svn/apps/ide/templates +projectfilename=/opt/msegui_svn/apps/ide/templates/fpgui.prj +findinfiledialog=30 + [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=0 + [findinfileadialogfo.dir] + filenames=1 + /opt/msegui_svn/ + filehistory=1 + /opt/msegui_svn/apps/ide/ + filefilterindex=-1 + filecolwidth=174 + [findinfileadialogfo.findtext] + value=MSEDIR + history=1 + MSEDIR + [findinfileadialogfo] + stackedunder= + x=268 + y=415 + cx=339 + cy=251 +finddialog=8 + [finddialogfo.selectedonly] + value=0 + [finddialogfo] + stackedunder= + x=319 + y=205 + cx=331 + cy=116 +replacedialog=13 + [replacedialogfo.promptonreplace] + value=1 + [replacedialogfo.selectedonly] + value=0 + [replacedialogfo.replacetext] + value= + history=0 + [replacedialogfo] + stackedunder= + x=142 + y=302 + cx=421 + cy=163 +options=93 + [projectoptionsfo.twidgetgrid3] + propcolwidthref=801 + sortdescent0=0 + sortdescent1=0 + sortdescent2=0 + width3=139 + sortdescent3=0 + width4=292 + sortdescent4=0 + width5=320 + sortdescent5=0 + [projectoptionsfo.twidgetgrid4] + propcolwidthref=612 + width0=96 + sortdescent0=0 + width1=13 + sortdescent1=0 + width2=73 + sortdescent2=0 + width3=293 + sortdescent3=0 + width4=309 + sortdescent4=0 + sortcol=-1 + col=4 + row=0 + rowheight=17 + [projectoptionsfo.newfile] + firsttab=0 + index=0 + [projectoptionsfo.fontaliasgrid] + propcolwidthref=471 + values0=0 + width0=98 + sortdescent0=0 + values1=0 + width1=460 + sortdescent1=0 + values2=0 + width2=30 + sortdescent2=0 + values3=0 + width3=50 + sortdescent3=0 + values4=0 + width4=50 + sortdescent4=0 + values5=0 + width5=50 + sortdescent5=0 + values6=0 + width6=70 + sortdescent6=0 + [projectoptionsfo.macrosplitter] + x=0 + y=178 + xprop=0 + yprop=0.34296724470134 + [projectoptionsfo.macrogrid] + propcolwidthref=595 + sortdescent0=0 + sortdescent1=0 + sortdescent2=0 + sortdescent3=0 + sortdescent4=0 + sortdescent5=0 + width6=146 + sortdescent6=0 + width7=583 + sortdescent7=0 + [projectoptionsfo.makegroupbox] + firsttab=0 + index=1 + [projectoptionsfo.exceptionsgrid] + propcolwidthref=772 + width0=47 + sortdescent0=0 + values1=1 + EconvertError + width1=766 + sortdescent1=0 + [projectoptionsfo.ttabwidget1] + firsttab=0 + index=0 + [projectoptionsfo.tabwidget] + firsttab=0 + index=6 + [projectoptionsfo] + stackedunder= + x=283 + y=107 + cx=821 + cy=572 +settings=8 + [settingsfo] + x=966 + y=138 + cx=358 + cy=574 + wsize=0 + active=1 + visible=1 +colordialog=5 + [colordialogfo] + x=140 + y=234 + cx=342 + cy=303 +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 +gridsizex=8 +gridsizey=8 +exceptclassnames=1 + EconvertError +exceptignore=1 + 0 +modulenames=3 + ACTIONSMO + MAINFO + SOURCEPAGE +moduletypes=3 + TACTIONSMO + TMAINFO + TSOURCEPAGE +modulefiles=3 + /opt/msegui_svn/apps/ide/actionsmodule.mfm + /opt/msegui_svn/apps/ide/main.mfm + /opt/msegui_svn/apps/ide/sourcepage.mfm +mainfile=${PROJECTNAME}.pas +targetfile=${PROJECTNAME}${EXEEXT} +messageoutputfile= +copymessages=0 +closemessages=1 +checkmethods=1 +makecommand=${COMPILER} +makedir= +debugcommand=${DEBUGGER} +debugoptions= +debugtarget= +runcommand= +remoteconnection= +uploadcommand= +gdbdownload=0 +downloadalways=0 +startupbkpt=0 +startupbkpton=0 +gdbsimulator=0 +gdbprocessor=i386 +gdbservercommand= +gdbservercommandattach= +gdbserverwait=0 +beforeload= +afterload= +beforerun= +defaultmake=1 +makeoptions=5 + -l -Mobjfpc -Sh + -gl -O- + -B + -O2 -XX -Xs -CX + -FUunits/${TargetCPU}-${TargetOS}/ +makeoptionson=5 + 63 + 31 + 34 + 32 + 63 +macroon=5 + 1 + 3 + 6 + 4 + 63 +macronames=5 + TargetCPU + TargetOS + TargetCPU + TargetOS + FPGUI_DIR +macrovalues=5 + x86_64 + linux + i386 + win32 + /home/graemeg/programming/fpgui +macrogroup=0 +groupcomments=6 + Linux 64-bit + Linux 32-bit + Windows 32-bit + + + +sourcedirs=4 + ${MSEDIR}lib/addon/*/ + ${MSELIBDIR}kernel/$TARGET/ + ${MSELIBDIR}*/ + ./ +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 + 65599 + 131102 + 196618 + 196614 + 65566 + 65566 +unitpref=-Fu +incpref=-Fi +libpref=-Fl +objpref=-Fo +targpref=-o +sourcefilemasks=4 + "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" + "*.c" "*.cc" "*.h" + "*.mfm" + "*.ipf" +syntaxdeffiles=4 + ${SYNTAXDEFDIR}pascal.sdef + ${SYNTAXDEFDIR}cpp.sdef + ${SYNTAXDEFDIR}objecttext.sdef + ${SYNTAXDEFDIR}ipf2.sdef +filemasknames=5 + Source + Forms + Text + IPF help + All Files +filemasks=5 + "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" + *.mfm + *.txt + *.ipf + * +toolsave=0 +toolhide=0 +toolparse=0 +toolmenus=0 +toolfiles=0 +toolparams=0 +fontalias=0 +fontancestors=0 +fontnames=0 +fontheights=0 +fontwidths=0 +fontoptions=0 +fontxscales=0 +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +showgrid=1 +snaptogrid=1 +moveonfirstclick=1 +autoindent=1 +blockindent=1 +rightmarginon=1 +rightmarginchars=80 +scrollheight=0 +tabstops=4 +spacetabs=0 +tabindent=0 +editfontname=Raize +editfontheight=13 +editfontwidth=0 +editfontextraspace=2 +editfontantialiased=1 +editmarkbrackets=1 +backupfilecount=2 +encoding=0 +scriptbeforecopy= +scriptaftercopy= +newprojectfiles=5 + ${TEMPLATEDIR}fpgui/project.pas + ${TEMPLATEDIR}fpgui/frm_main.pas + ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt + ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt + ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt +newprojectfilesdest=5 + ${%PROJECTNAME%}.pas + + ${%PROJECTDIR%}units/i386-linux/placeholder.txt + ${%PROJECTDIR%}units/i386-win32/placeholder.txt + ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt +expandprojectfilemacros=5 + 1 + 1 + -1 + -1 + -1 +loadprojectfile=5 + 1 + 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 + + +stoponexception=0 +valuehints=1 +activateonbreak=1 +showconsole=0 +externalconsole=0 +[breakpoints] +on=0 +path=0 +line=0 +address=0 +addbkpt=0 +ignore=0 +condition=0 +panels=2 + panel1 + panel2 +units= + ( + modulefilenames=0 + modulenames=0 + moduleclassnames=0 + a=0,4133,0,Units + ) +files= + ( + a=0,4132,0,Text Files + ) +[componentstore] +storedir=/opt/msegui_svn/apps/ide/compstore/ +filename= +[layout] +windowlayout=413 + [mainfo.openfile] + filenames=0 + filehistory=10 + /opt/msegui_svn/apps/ide/targetconsole.pas + /opt/msegui_svn/apps/ide/threadsform.pas + /opt/msegui_svn/apps/ide/main.pas + /opt/msegui_svn/apps/ide/actionsmodule.pas + /opt/msegui_svn/apps/ide/sourcepage.mfm + /home/graemeg/Public/rtl.ipf + /home/graemeg/Public/NewView.ipf + /opt/msegui_svn/lib/common/kernel/msescrollbar.pas + /home/mse/proj/msegui/testcase/jean-pierre/Demo/main.pas + /D:/MSE/Livre/DemoMSE/Demo.pas + filefilterindex=0 + filecolwidth=174 + [mainfo.basedock] + splitdir=2 + useroptions=15488 + [mainfo] + stackedunder= + x=4 + y=24 + cx=322 + cy=74 + wsize=0 + active=0 + visible=1 + [targetconsolefo] + splitdir=0 + useroptions=16489 + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=405 + y=452 + cx=904 + cy=347 + wsize=0 + active=0 + visible=0 + [threadsfo] + splitdir=0 + useroptions=16489 + parent=mainfo.panel2.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=470 + cy=340 + [memoryfo] + splitdir=0 + useroptions=16507 + parent=mainfo.panel2.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=470 + cy=340 + [memoryfo.add] + value=0 + [memoryfo.memon] + value=0 + [memoryfo.bitwidth] + value=0 + [memoryfo.cnt] + value=0 + [disassfo] + splitdir=0 + useroptions=16491 + stackedunder=componentstorefo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=162 + y=502 + cx=564 + cy=210 + wsize=0 + active=0 + visible=0 + [findinfilefo] + splitdir=0 + useroptions=16491 + stackedunder=mainfo.panel1 + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=548 + y=115 + cx=786 + cy=207 + [projecttreefo] + splitdir=0 + useroptions=16491 + stackedunder=objectinspectorfo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=695 + y=39 + cx=698 + cy=413 + wsize=0 + active=0 + visible=0 + [stackfo] + splitdir=0 + useroptions=16489 + parent=mainfo.panel2.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=470 + cy=340 + [watchpointsfo] + splitdir=0 + useroptions=16489 + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=537 + y=26 + cx=483 + cy=210 + wsize=0 + active=0 + visible=0 + [watchpointsfo.grid] + propcolwidthref=352 + width0=16 + sortdescent0=0 + values1=1 + 0 + width1=33 + sortdescent1=0 + values2=1 + pinteger(0x126c6b4)^ + width2=239 + sortdescent2=0 + width4=34 + sortdescent4=0 + values5=1 + 0 + width5=38 + sortdescent5=0 + values6=1 + + width6=103 + sortdescent6=0 + [breakpointsfo] + splitdir=0 + useroptions=16491 + stackedunder=watchpointsfo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=107 + y=404 + cx=477 + cy=128 + wsize=0 + active=0 + visible=0 + [breakpointsfo.bkptson] + value=1 + [objectinspectorfo] + splitdir=0 + useroptions=16491 + stackedunder=mainfo.panel2 + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=670 + y=179 + cx=447 + cy=484 + wsize=0 + active=0 + visible=0 + [objectinspectorfo.grid] + propcolwidthref=437 + width0=221 + sortdescent0=0 + width1=210 + sortdescent1=0 + [watchfo] + splitdir=0 + useroptions=90217 + parent=mainfo.panel2.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=470 + cy=340 + [watchfo.grid] + propcolwidthref=275 + values0=0 + width0=13 + sortdescent0=0 + values1=0 + width1=152 + sortdescent1=0 + values3=0 + width3=12 + sortdescent3=0 + values4=0 + width4=13 + sortdescent4=0 + [watchfo.watchon] + [watchfo.expression] + [watchfo.watcheson] + value=1 + [messagefo] + splitdir=0 + useroptions=49259 + parent=mainfo.panel1.container + visible=0 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=359 + cx=925 + cy=226 + [componentstorefo] + splitdir=0 + useroptions=24675 + stackedunder=projecttreefo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=100 + y=100 + cx=445 + cy=354 + wsize=0 + active=0 + visible=0 + [componentstorefo.grid] + propcolwidthref=435 + width0=111 + sortdescent0=0 + width1=157 + sortdescent1=0 + width2=160 + sortdescent2=0 + [componentstorefo.storefiledialog] + filenames=1 + /home/mse/test/msegui/apps/ide/compstore/ + lastdir=/home/mse/test/msegui/apps/ide/compstore/ + filehistory=0 + filefilterindex=0 + filecolwidth=0 + [componentstorefo.groupfiledialog] + filenames=1 + /home/mse/test/msegui/apps/ide/compstore/ + lastdir=/home/mse/test/msegui/apps/ide/compstore/ + filehistory=0 + filefilterindex=0 + filecolwidth=0 + [componentpalettefo] + splitdir=0 + useroptions=24683 + stackedunder=targetconsolefo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=331 + y=3 + cx=440 + cy=107 + wsize=0 + active=0 + visible=0 + [componentpalettefo.componentpages] + activetab=0 + [debuggerfo] + splitdir=0 + useroptions=24683 + parent=mainfo.basedock + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=322 + cy=36 + [sourcefo] + splitdir=0 + useroptions=16489 + parent=mainfo.panel1.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=925 + cy=585 + [actionsmo.watchesonact] + checked=1 + [actionsmo.bluedotsonact] + checked=1 + [cpui386fo] + irqoff=0 + splitdir=0 + useroptions=16491 + parent=mainfo.panel2.container + visible=1 + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=0 + y=0 + cx=470 + cy=340 + [mainfo.panel1] + splitdir=2 + useroptions=33586667 + stackedunder=mainfo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=4 + y=201 + cx=935 + cy=585 + wsize=0 + active=1 + visible=1 + [mainfo.panel2] + splitdir=3 + useroptions=33586667 + order=5 + watchfo + stackfo + threadsfo + memoryfo + cpui386fo + activetab=4 + stackedunder=formdesignerfo + parent= + mdistate=0 + nx=0 + ny=0 + ncx=0 + ncy=0 + x=928 + y=256 + cx=480 + cy=359 + wsize=0 + active=0 + visible=0 +[edit] +hintwidth=0 +hintheight=0 +autoindent=1 +blockindent=1 +rightmarginon=1 +rightmarginchars=80 +tabstops=4 +finddtext=terminal +findhistory=1 + terminal +findoptions=1 +editpos=0 +sourcefiles=0 +relpaths=0 +ismoduletexts=0 +modules=3 + /opt/msegui_svn/apps/ide/sourcepage.mfm + /opt/msegui_svn/apps/ide/main.mfm + /opt/msegui_svn/apps/ide/actionsmodule.mfm +visiblemodules=3 + 0 + 0 + 0 +[sourcefo.tabwidget] +tabsize=134 +firsttab=0 +index=-1 +[components] +[selecteditpage] +colwidth=100 +x=0 +y=0 +cx=0 +cy=0 +[progparams] +parameters= +progparamhistory=0 +workingdirectory= +envvarons=0 +envvarnames=0 +envvarvalues=0 diff --git a/extras/mseide_templates/fpgui/frm_main.pas b/extras/mseide_templates/fpgui/frm_main.pas new file mode 100644 index 00000000..bd0230f4 --- /dev/null +++ b/extras/mseide_templates/fpgui/frm_main.pas @@ -0,0 +1,41 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(374, 228, 490, 258); + WindowTitle := 'MainForm'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +end. diff --git a/extras/mseide_templates/fpgui/mainform.pas b/extras/mseide_templates/fpgui/mainform.pas new file mode 100644 index 00000000..bd0230f4 --- /dev/null +++ b/extras/mseide_templates/fpgui/mainform.pas @@ -0,0 +1,41 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(374, 228, 490, 258); + WindowTitle := 'MainForm'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +end. diff --git a/extras/mseide_templates/fpgui/program.pas b/extras/mseide_templates/fpgui/program.pas new file mode 100644 index 00000000..4338fda3 --- /dev/null +++ b/extras/mseide_templates/fpgui/program.pas @@ -0,0 +1,29 @@ +program ${%PROJECTNAME%}; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, frm_main; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/extras/mseide_templates/fpgui/project.pas b/extras/mseide_templates/fpgui/project.pas new file mode 100644 index 00000000..4338fda3 --- /dev/null +++ b/extras/mseide_templates/fpgui/project.pas @@ -0,0 +1,29 @@ +program ${%PROJECTNAME%}; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, frm_main; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/extras/mseide_templates/fpgui/simpleform.pas b/extras/mseide_templates/fpgui/simpleform.pas new file mode 100644 index 00000000..a17cf812 --- /dev/null +++ b/extras/mseide_templates/fpgui/simpleform.pas @@ -0,0 +1,41 @@ +unit ${%UNITNAME%}; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form; + +type + + T${%FORMNAME%} = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: ${%FORMNAME%}} + {@VFD_HEAD_END: ${%FORMNAME%}} + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure T${%FORMNAME%}.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := '${%FORMNAME%}'; + SetPosition(374, 228, 490, 258); + WindowTitle := 'NewForm'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + {@VFD_BODY_END: ${%FORMNAME%}} + {%endregion} +end; + + +end. diff --git a/extras/mseide_templates/fpgui/units/i386-linux/placeholder.txt b/extras/mseide_templates/fpgui/units/i386-linux/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/extras/mseide_templates/fpgui/units/i386-linux/placeholder.txt diff --git a/extras/mseide_templates/fpgui/units/i386-win32/placeholder.txt b/extras/mseide_templates/fpgui/units/i386-win32/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/extras/mseide_templates/fpgui/units/i386-win32/placeholder.txt diff --git a/extras/mseide_templates/fpgui/units/x86_64-linux/placeholder.txt b/extras/mseide_templates/fpgui/units/x86_64-linux/placeholder.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/extras/mseide_templates/fpgui/units/x86_64-linux/placeholder.txt diff --git a/extras/mseide_templates/readme.txt b/extras/mseide_templates/readme.txt new file mode 100644 index 00000000..380c23a4 --- /dev/null +++ b/extras/mseide_templates/readme.txt @@ -0,0 +1,17 @@ + +Project Template for MSEide +---------------------------- + + To use it, copy the project template to the usual + MSEide templates directory, or use if from where + it is - inside fpGUI directory. + "Project > New > From Template" then browse to + fpGUI directory and select the "fpgui.prj" file. + + Under "Project > Options > Macros" you need to update + the path to where fpGUI is located on your system. + + + -------------- end ----------------- + + diff --git a/extras/tiopf/demos/Common/Model_View.pas b/extras/tiopf/demos/Common/Model_View.pas index ad027534..ceac389f 100644 --- a/extras/tiopf/demos/Common/Model_View.pas +++ b/extras/tiopf/demos/Common/Model_View.pas @@ -13,7 +13,7 @@ uses type { TMemo - Name } - TPerson_Name_Memo_Mediator = class(TMediatorMemoView) + TPerson_Name_Memo_Mediator = class(TtiMemoMediatorView) protected procedure SetupGUIandObject; override; end; @@ -40,7 +40,7 @@ end; procedure TPerson_Name_Memo_Mediator.SetupGUIandObject; begin inherited SetupGUIandObject; - EditControl.Enabled := False; // fpGUI doesn't have a ReadOnly property yet + View.Enabled := False; // fpGUI doesn't have a ReadOnly property yet end; diff --git a/extras/tiopf/demos/Common/frm_pickdatabase.pas b/extras/tiopf/demos/Common/frm_pickdatabase.pas index de215829..7dcee309 100644 --- a/extras/tiopf/demos/Common/frm_pickdatabase.pas +++ b/extras/tiopf/demos/Common/frm_pickdatabase.pas @@ -226,7 +226,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 0; @@ -349,7 +348,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 11; diff --git a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi b/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi index d2059b58..34df30b5 100644 --- a/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi +++ b/extras/tiopf/demos/Demo_04_CreateDatabase/demo_04.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> @@ -56,6 +56,7 @@ <Version Value="8"/> <SearchPaths> <OtherUnitFiles Value="../Common/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> @@ -63,8 +64,6 @@ </SyntaxOptions> </Parsing> <Other> - <CustomOptions Value="-FUunits -"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas b/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas index 4bd0c9ab..cee11cd0 100644 --- a/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas +++ b/extras/tiopf/demos/Demo_04_CreateDatabase/frm_main.pas @@ -108,7 +108,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 0; @@ -131,7 +130,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 1; @@ -154,7 +152,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 2; diff --git a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi b/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi index 3e2e075a..4a8402a2 100644 --- a/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi +++ b/extras/tiopf/demos/Demo_06_CreateTable/demo_06.lpi @@ -1,17 +1,16 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -48,6 +47,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Parsing> <SyntaxOptions> <AllowLabel Value="False"/> @@ -55,8 +57,7 @@ </SyntaxOptions> </Parsing> <Other> - <CustomOptions Value="-FUunits --dUseCThreads"/> + <CustomOptions Value="-dUseCThreads"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi b/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi index a4d89aea..10179042 100644 --- a/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi +++ b/extras/tiopf/demos/Demo_07_VisitorBasics/demo_07.lpi @@ -1,17 +1,16 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -54,6 +53,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Parsing> <SyntaxOptions> <AllowLabel Value="False"/> @@ -61,8 +63,7 @@ </SyntaxOptions> </Parsing> <Other> - <CustomOptions Value="-FUunits --dUseCThreads"/> + <CustomOptions Value="-dUseCThreads"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi b/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi index f8e27367..04d2b379 100644 --- a/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi +++ b/extras/tiopf/demos/Demo_08_Collection/demo_08.lpi @@ -1,17 +1,16 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -68,6 +67,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Parsing> <SyntaxOptions> <AllowLabel Value="False"/> @@ -75,8 +77,7 @@ </SyntaxOptions> </Parsing> <Other> - <CustomOptions Value="-FUunits --dUseCThreads"/> + <CustomOptions Value="-dUseCThreads"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/Demo_08_Collection/frm_main.pas b/extras/tiopf/demos/Demo_08_Collection/frm_main.pas index 170ef96b..34241b17 100644 --- a/extras/tiopf/demos/Demo_08_Collection/frm_main.pas +++ b/extras/tiopf/demos/Demo_08_Collection/frm_main.pas @@ -10,7 +10,7 @@ uses fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel, Client_BOM, tiFormMediator; + fpg_panel, Client_BOM, tiModelMediator; type @@ -31,7 +31,7 @@ type grdCollection: TfpgStringGrid; {@VFD_HEAD_END: MainForm} FClients: TClients; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure MainFormShow(Sender: TObject); procedure CreateTable; procedure DropTable; @@ -112,7 +112,7 @@ procedure TMainForm.CreateMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('ClientName(200,"Client name");ClientID(80,"Client ID")', grdCollection); end; FMediator.Subject := FClients; @@ -327,6 +327,6 @@ begin end; initialization - gMediatorManager.RegisterMediator(TStringGridMediator, TClients); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TClients); end. diff --git a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi b/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi index 5cfa02ee..ece8df27 100644 --- a/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi +++ b/extras/tiopf/demos/Demo_20_ListMediators/demo_listmediators.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -64,6 +63,7 @@ <Version Value="8"/> <SearchPaths> <OtherUnitFiles Value="../Common/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> @@ -77,8 +77,6 @@ <LinkSmart Value="True"/> </Linking> <Other> - <CustomOptions Value="-FUunits -"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas b/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas index 85a51e30..f186340b 100644 --- a/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas +++ b/extras/tiopf/demos/Demo_20_ListMediators/frmMain.pas @@ -7,7 +7,7 @@ interface uses SysUtils, Classes, fpg_base, fpg_main, fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_checkbox, fpg_panel, fpg_listview, fpg_listbox, fpg_combobox, - Model, tiFormMediator, tiMediators; + Model, tiModelMediator, tiMediators; type @@ -15,9 +15,8 @@ type private { The object we will be working with. } FPersonList: TPersonList; - FMediator: TFormMediator; - medCombo: TMediatorComboBoxView; - + FMediator: TtiModelMediator; + medCombo: TtiComboBoxMediatorView; procedure btnViaCodeChangeClick(Sender: TObject); procedure btnQuitClicked(Sender: TObject); procedure btnViaCodeAddClick(Sender: TObject); @@ -89,17 +88,17 @@ end; procedure TMainForm.btnShowDeletedClick(Sender: TObject); var - med: TMediatorView; + med: TtiMediatorView; begin med := FMediator.FindByComponent(grdName1).Mediator; - tiShowString(TStringGridMediator(med).SelectedObject.AsDebugString); + tiShowString(TtiStringGridMediatorView(med).SelectedObject.AsDebugString); end; procedure TMainForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.Name := 'DemoFormMediator'; FMediator.AddComposite('Name(150,"Name",<);Age(50,"Age",>);GenderGUI(80,"Gender",|)', grdName1); // FMediator.AddComposite('Name(150,"Name",<);Age(75,"Age",>);GenderGUI(50,"Gender",|)', lvName1); @@ -271,7 +270,7 @@ end; initialization - gMediatorManager.RegisterMediator(TStringGridMediator, TtiObjectList); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TtiObjectList); // gMediatorManager.RegisterMediator(TListBoxMediator, TPersonList); // gMediatorManager.RegisterMediator(TListViewMediator, TtiObjectList); diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi index b497cf84..6f88bb12 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/demo_adrsbook_mgm.lpi @@ -81,6 +81,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Parsing> <SyntaxOptions> <CStyleOperator Value="False"/> @@ -89,7 +92,7 @@ </SyntaxOptions> </Parsing> <Other> - <CustomOptions Value="-FUunits + <CustomOptions Value=" "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas index b8212b3d..931b36c5 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_combobox, fpg_dialogs, fpg_menu, - model, tiFormMediator; + model, tiModelMediator; type TAddressEditForm = class(TfpgForm) @@ -32,7 +32,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: AddressEditForm} FData: TAddress; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TAddress); procedure SetupMediators; public @@ -76,7 +76,7 @@ procedure TAddressEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('AddressType', cbType).ValueList := gContactManager.AddressTypeList; FMediator.AddProperty('Nr', edNo); FMediator.AddProperty('Street', edStreet); diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas index f14c13ee..522362d1 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas @@ -9,7 +9,7 @@ uses fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, fpg_panel, - tiFormMediator, model; + tiModelMediator, model; type @@ -24,7 +24,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: CityListForm} FData: TCityList; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TCityList); procedure SetupMediators; procedure btnEditClicked(Sender: TObject); @@ -63,7 +63,7 @@ procedure TCityListForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('Name(110);Zip(80);CountryAsString(150)', grdName1); end; FMediator.Subject := FData; @@ -74,7 +74,7 @@ procedure TCityListForm.btnEditClicked(Sender: TObject); var c: TCity; begin - c := TCity(TStringGridMediator(FMediator.FindByComponent(grdName1).Mediator).SelectedObject); + c := TCity(TtiStringGridMediatorView(FMediator.FindByComponent(grdName1).Mediator).SelectedObject); // tiShowString(c.AsDebugString); if not Assigned(c) then diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas index 31a6326d..1b6f27f7 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_dialogs, fpg_combobox, - model, tiFormMediator; + model, tiModelMediator; type @@ -25,7 +25,7 @@ type btnCancel: TfpgButton; btnDebug: TfpgButton; {@VFD_HEAD_END: CityEditForm} - FMediator: TFormMediator; + FMediator: TtiModelMediator; FData: TCity; procedure SetData(const AValue: TCity); procedure SetupMediators; @@ -72,7 +72,7 @@ procedure TCityEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('Name', edName); FMediator.AddProperty('ZIP', edZIP); FMediator.AddProperty('Country', cbCountry).ValueList := gContactManager.CountryList; diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas index 5832af55..8bd46e31 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_listview, fpg_memo, - model, tiFormMediator; + model, tiModelMediator; type @@ -35,8 +35,8 @@ type btnDebug: TfpgButton; {@VFD_HEAD_END: ContactEditForm} FData: TContact; - FMediator: TFormMediator; - FAdrsMediator: TFormMediator; + FMediator: TtiModelMediator; + FAdrsMediator: TtiModelMediator; procedure SetData(const AValue: TContact); procedure SetupMediators; procedure btnDebugClicked(Sender: TObject); @@ -77,7 +77,7 @@ procedure TContactEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('FirstName', edFName); FMediator.AddProperty('LastName', edLName); FMediator.AddProperty('EMail', edEmail); @@ -89,7 +89,7 @@ begin if not Assigned(FAdrsMediator) then begin - FAdrsMediator := TFormMediator.Create(self); + FAdrsMediator := TtiModelMediator.Create(self); FAdrsMediator.AddComposite({'AddressType.Name;}'AddressType4GUI(50,"Type");Nr;Street;Telephone1', lvAddresses); end; FAdrsMediator.Subject := FData.AddressList; @@ -105,7 +105,7 @@ procedure TContactEditForm.btnEditClicked(Sender: TObject); var obj: TAddress; begin - obj := TAddress(TListViewMediator(FAdrsMediator.FindByComponent(lvAddresses).Mediator).SelectedObject); + obj := TAddress(TtiListViewMediatorView(FAdrsMediator.FindByComponent(lvAddresses).Mediator).SelectedObject); tiShowString(obj.AsDebugString); if not Assigned(obj) then diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas index 0a6a6332..c9f54537 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas @@ -9,7 +9,7 @@ uses fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, fpg_panel, - model, tiFormMediator; + model, tiModelMediator; type @@ -24,7 +24,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: CountryListForm} FData: TCountryList; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TCountryList); procedure SetupMediators; procedure btnEditClicked(Sender: TObject); @@ -62,7 +62,7 @@ procedure TCountryListForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('ISO(60);Name(110)', grdName1); end; FMediator.Subject := FData; diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas index 374a971a..979e6592 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas @@ -10,7 +10,7 @@ uses fpg_base, fpg_main, fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, { tiOPF } - tiFormMediator; + tiModelMediator; type { The main application window } @@ -26,7 +26,7 @@ type miEdit: TfpgPopupMenu; miSystem: TfpgPopupMenu; {@VFD_HEAD_END: MainForm} - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure FormShow(Sender: TObject); procedure GridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure SetupMediators; @@ -68,7 +68,7 @@ procedure TMainForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('FirstName;LastName(130);EMail(180);Mobile(130);Comments(200)', grdContacts); end; FMediator.Subject := gContactManager.ContactList; @@ -95,7 +95,7 @@ begin tiAppError('You need to select a Contact first'); Exit; end; - c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); + c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if not Assigned(c) then Exit; //==> @@ -115,7 +115,7 @@ begin tiAppError('You need to select a Contact first'); Exit; end; - c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); + c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if tiAppConfirmation('Are you sure you want to delete <%s>', [c.FirstName + ' ' + c.LastName]) then begin @@ -266,11 +266,11 @@ end; initialization RegisterFallBackMediators; - gMediatorManager.RegisterMediator(TStringGridMediator, TContactList); - gMediatorManager.RegisterMediator(TListViewMediator, TAddressList); - gMediatorManager.RegisterMediator(TStringGridMediator, TCityList); - gMediatorManager.RegisterMediator(TStringGridMediator, TCountryList); - gMediatorManager.RegisterMediator(TMediatorDynamicComboBoxView, TCity, 'Country'); - gMediatorManager.RegisterMediator(TMediatorDynamicComboBoxView, TAddressType, 'AddressType'); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TContactList); + gMediatorManager.RegisterMediator(TtiListViewMediatorView, TAddressList); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCityList); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCountryList); + gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TCity, 'Country'); + gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TAddressType, 'AddressType'); end. diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi b/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi index 08c1bbe6..047ccf7a 100644 --- a/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi +++ b/extras/tiopf/demos/Demo_TtiBaseObject/PerformanceTesting.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -48,9 +47,11 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Other> - <CustomOptions Value="-FUunits --dUseCThreads + <CustomOptions Value="-dUseCThreads "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi b/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi index a7940dba..cf7d5e86 100644 --- a/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi +++ b/extras/tiopf/demos/Demo_TtiBaseObject/performancetest.lpi @@ -1,11 +1,12 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> + <Flags> + <LRSInOutputDirectory Value="False"/> + </Flags> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> <ActiveEditorIndexAtStart Value="0"/> </General> @@ -32,7 +33,7 @@ <IsPartOfProject Value="True"/> <UnitName Value="performancetest"/> <CursorPos X="1" Y="13"/> - <TopLine Value="43"/> + <TopLine Value="13"/> <EditorIndex Value="0"/> <UsageCount Value="20"/> <Loaded Value="True"/> @@ -42,12 +43,12 @@ <UnitName Value="frm_main"/> <CursorPos X="37" Y="85"/> <TopLine Value="65"/> - <EditorIndex Value="4"/> + <EditorIndex Value="2"/> <UsageCount Value="10"/> <Loaded Value="True"/> </Unit1> <Unit2> - <Filename Value="../../../../../../../../opt/fpc_2.2.0/src/packages/fcl-base/src/inc/custapp.pp"/> + <Filename Value="/opt/fpc_2.2.0/src/packages/fcl-base/src/inc/custapp.pp"/> <UnitName Value="CustApp"/> <CursorPos X="3" Y="26"/> <TopLine Value="11"/> @@ -72,25 +73,21 @@ <UnitName Value="tiBaseObject"/> <CursorPos X="1" Y="128"/> <TopLine Value="94"/> - <EditorIndex Value="3"/> + <EditorIndex Value="1"/> <UsageCount Value="10"/> <Loaded Value="True"/> </Unit5> <Unit6> - <Filename Value="../../../../../../../../opt/fpc_2.2.0/src/rtl/inc/objpash.inc"/> + <Filename Value="/opt/fpc_2.2.0/src/rtl/inc/objpash.inc"/> <CursorPos X="29" Y="220"/> <TopLine Value="212"/> - <EditorIndex Value="1"/> <UsageCount Value="10"/> - <Loaded Value="True"/> </Unit6> <Unit7> - <Filename Value="../../../../../../../../opt/fpc_2.2.0/src/rtl/inc/objpas.inc"/> + <Filename Value="/opt/fpc_2.2.0/src/rtl/inc/objpas.inc"/> <CursorPos X="9" Y="709"/> <TopLine Value="705"/> - <EditorIndex Value="2"/> <UsageCount Value="10"/> - <Loaded Value="True"/> </Unit7> <Unit8> <Filename Value="FMain.pas"/> diff --git a/extras/tiopf/demos/EditControlsDemo/editmediators.lpi b/extras/tiopf/demos/EditControlsDemo/editmediators.lpi index bceed7e6..0f0543c7 100644 --- a/extras/tiopf/demos/EditControlsDemo/editmediators.lpi +++ b/extras/tiopf/demos/EditControlsDemo/editmediators.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> <UseAppBundle Value="False"/> </General> @@ -65,10 +64,9 @@ <Version Value="8"/> <SearchPaths> <OtherUnitFiles Value="../Common/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Other> - <CustomOptions Value="-FUunits -"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/demos/EditControlsDemo/frmMain.pas b/extras/tiopf/demos/EditControlsDemo/frmMain.pas index 75719922..03749901 100644 --- a/extras/tiopf/demos/EditControlsDemo/frmMain.pas +++ b/extras/tiopf/demos/EditControlsDemo/frmMain.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, fpg_form, fpg_button, fpg_label, fpg_edit, fpg_trackbar, - fpg_combobox, fpg_memo, Model, tiFormMediator, Model_View; + fpg_combobox, fpg_memo, Model, tiModelMediator, Model_View; type TMainForm = class(TfpgForm) @@ -25,7 +25,7 @@ type { The object we will be working with. } FPerson: TPerson; { Form Mediator } - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure btnCloseClick(Sender: TObject); procedure btnShowModelClick(Sender: TObject); @@ -183,7 +183,7 @@ begin } if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.Name := 'DemoFormMediator'; FMediator.AddProperty('Name', edtName); FMediator.AddProperty('Age', AgeTrackBar); diff --git a/extras/tiopf/demos/ListControlDemo/frmMain.pas b/extras/tiopf/demos/ListControlDemo/frmMain.pas index b95924e0..551a6b18 100644 --- a/extras/tiopf/demos/ListControlDemo/frmMain.pas +++ b/extras/tiopf/demos/ListControlDemo/frmMain.pas @@ -5,8 +5,8 @@ unit frmMain; interface uses - Classes, SysUtils, gui_form, gui_button, gui_label, gui_edit, gui_trackbar, - gui_combobox, gui_checkbox, gui_listbox, Model, + Classes, SysUtils, fpg_form, fpg_button, fpg_label, fpg_edit, fpg_trackbar, + fpg_combobox, fpg_checkbox, fpg_listbox, Model, tiGenericEditMediators, tiGenericListMediators; type diff --git a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi index 57dc14b8..6faa819b 100644 --- a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi +++ b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -61,15 +60,13 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="8"/> <SearchPaths> <OtherUnitFiles Value="../Common/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> <Other> - <CustomOptions Value="-FUunits + <CustomOptions Value=" "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr index 0761498e..6455aa9b 100644 --- a/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr +++ b/extras/tiopf/demos/ListControlDemo/listcontroldemo.lpr @@ -6,7 +6,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, fpgfx, frmMain, Model, Constants, Model_View; + Classes, fpg_base, fpg_main, frmMain, Model, Constants, Model_View; procedure MainProc; diff --git a/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas b/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas index 7adc3145..3878ad61 100644 --- a/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas +++ b/extras/tiopf/demos/StringGridMediatorDemo/frm_main.pas @@ -5,17 +5,17 @@ unit frm_main; interface uses - SysUtils, Classes, gfxbase, fpgfx, gui_edit, - gfx_widget, gui_form, gui_label, gui_button, - gui_basegrid, gui_grid, gui_menu, - gui_panel, gui_popupcalendar, gui_gauge, Model, tiCompositeMediators; + SysUtils, Classes, fpg_base, fpg_main, fpg_edit, + fpg_widget, fpg_form, fpg_label, fpg_button, + fpg_basegrid, fpg_grid, fpg_menu, + fpg_panel, fpg_popupcalendar, fpg_gauge, Model, tiListMediators; type TMainForm = class(TfpgForm) private FList: TPersonList; - medGrid: TCompositeStringGridMediator; + medGrid: TtiStringGridMediatorView; procedure SetupMediators; procedure ValidateData; procedure btnAddClicked(Sender: TObject); @@ -49,13 +49,13 @@ type implementation uses - gui_dialogs, frm_personmaint; + fpg_dialogs, frm_personmaint; {@VFD_NEWFORM_IMPL} procedure TMainForm.SetupMediators; begin - medGrid := TCompositeStringGridMediator.CreateCustom(FList, grdName1, 'Name(200);Age'); + medGrid := TtiStringGridMediatorView.CreateCustom(FList, grdName1, 'Name(200);Age'); end; procedure TMainForm.ValidateData; diff --git a/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas b/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas index 00296e96..96620e92 100644 --- a/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas +++ b/extras/tiopf/demos/StringGridMediatorDemo/frm_personmaint.pas @@ -5,12 +5,9 @@ unit frm_personmaint; interface uses - SysUtils, Classes, gfxbase, fpgfx, gui_edit, - gfx_widget, gui_form, gui_label, gui_button, - gui_listbox, gui_memo, gui_combobox, gui_basegrid, gui_grid, - gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, - gui_progressbar, gui_radiobutton, gui_tab, gui_menu, - gui_panel, gui_popupcalendar, gui_gauge, model, model_view; + SysUtils, Classes, fpg_base, fpg_main, fpg_edit, + fpg_form, fpg_label, fpg_button, + model, model_view; type diff --git a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi index c7b38fd4..b18e4bf3 100644 --- a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi +++ b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -66,20 +65,18 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="8"/> <SearchPaths> <OtherUnitFiles Value="../Common/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> <Linking> <Debugging> <GenerateDebugInfo Value="True"/> </Debugging> </Linking> <Other> - <CustomOptions Value="-FUunits + <CustomOptions Value=" "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr index 2a0a31e3..366718b0 100644 --- a/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr +++ b/extras/tiopf/demos/StringGridMediatorDemo/stringgridmediatordemo.lpr @@ -6,7 +6,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, fpgfx, frm_main, Model, Constants, tiOPFfpGUI, frm_personmaint, + Classes, fpg_main, frm_main, Model, Constants, tiOPFfpGUI, frm_personmaint, Model_View; diff --git a/extras/tiopf/demos/rtf_reporting/demoproject.lpi b/extras/tiopf/demos/rtf_reporting/demoproject.lpi index ac6d8c87..dd154d16 100644 --- a/extras/tiopf/demos/rtf_reporting/demoproject.lpi +++ b/extras/tiopf/demos/rtf_reporting/demoproject.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> @@ -46,8 +46,10 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Other> - <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/extras/tiopf/gui/tiDialogs.pas b/extras/tiopf/gui/tiDialogs.pas index fe75a749..04f4d896 100644 --- a/extras/tiopf/gui/tiDialogs.pas +++ b/extras/tiopf/gui/tiDialogs.pas @@ -9,7 +9,8 @@ interface uses Classes, SysUtils, - Variants; + Variants, + fpg_base; // Call showMessage, but accepts a variant. Good for debugging. @@ -18,25 +19,28 @@ uses // Show the contents of a TStringList - for debugging - procedure tiShowStringList(const pStringList: TStringList; const pHeading: string = 'Show string list'); + procedure tiShowStringList(const AStringList: TStringList; const AHeading: TfpgString = 'Show string list'); // Show the contents of a TStrings - for debugging - procedure tiShowStrings(const AStrings: TStrings; const pHeading: string = 'Show strings'); + procedure tiShowStrings(const AStrings: TStrings; const AHeading: TfpgString = 'Show strings'); // Show a long string - for debugging - procedure tiShowString(const AStr: string; const pHeading: string = 'Show string'); + procedure tiShowString(const AStr: TfpgString; const AHeading: TfpgString = 'Show string'); // Show a variant array of variants - for debugging - procedure tiShowVariant(AValue: Variant; pHeading: string = 'Show variant'); + procedure tiShowVariant(AValue: Variant; AHeading: TfpgString = 'Show variant'); // Show the contents of a stream - procedure tiShowStream(const AValue: TStream; const pHeading: string = 'Show stream'); + procedure tiShowStream(const AValue: TStream; const AHeading: TfpgString = 'Show stream'); // Show a <Yes>, <No> dialog box, and return true if <Yes> was selected - function tiAppConfirmation(const AMessage: string; ATitle: string = ''): boolean; overload; - function tiAppConfirmation(const AMessage: string; const AValues: array of const): boolean; overload; + function tiAppConfirmation(const AMessage: TfpgString; ATitle: TfpgString = ''): boolean; overload; + function tiAppConfirmation(const AMessage: TfpgString; const AValues: array of const): boolean; overload; // Show a message - procedure tiAppMessage(const AMessage: string; ATitle: string = ''); + procedure tiAppMessage(const AMessage: TfpgString; ATitle: TfpgString = ''); // Show a warning - procedure tiAppWarning(const AMessage: string; ATitle: string = ''); + procedure tiAppWarning(const AMessage: TfpgString; ATitle: TfpgString = ''); // Show a error message - procedure tiAppError(const AMessage: string; ATitle: string = ''); + procedure tiAppError(const AMessage: TfpgString; ATitle: TfpgString = ''); + // A type of notification window that will disappear by it self + procedure tiProcessing(const AMessage: TfpgString); + procedure tiEndProcessing; implementation @@ -44,10 +48,67 @@ uses fpg_main, fpg_form, fpg_memo, + fpg_label, fpg_dialogs, + fpg_panel, tiGUIINI, tiUtils; +var + pWorkingForm: TfpgForm; + +type + TProcessingForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: ProcessingForm} + Bevel1: TfpgBevel; + lblMessage: TfpgLabel; + {@VFD_HEAD_END: ProcessingForm} + public + procedure AfterCreate; override; + end; + +{ TProcessingForm } + +procedure TProcessingForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: ProcessingForm} + Name := 'ProcessingForm'; + SetPosition(317, 177, 400, 150); + WindowTitle := 'Processing...'; + WindowPosition := wpScreenCenter; + BackgroundColor := clHilite1; + WindowType := wtPopup; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(8, 4, 232, 80); + Align := alClient; + end; + + lblMessage := TfpgLabel.Create(Bevel1); + with lblMessage do + begin + Name := 'lblMessage'; + SetPosition(32, 28, 108, 32); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Layout := tlCenter; + Text := '...'; + WrapText := True; + Align := alClient; + MouseCursor := mcHourGlass; + end; + + {@VFD_BODY_END: ProcessingForm} + {%endregion} +end; + + procedure tiShowMessage(const AArray: array of const); const @@ -84,12 +145,12 @@ begin ShowMessage(VarToStr(AValue)); end; -procedure tiShowStringList(const pStringList: TStringList; const pHeading: string); +procedure tiShowStringList(const AStringList: TStringList; const AHeading: TfpgString); begin - tiShowStrings(pStringList, pHeading); + tiShowStrings(AStringList, AHeading); end; -procedure tiShowStrings(const AStrings: TStrings; const pHeading: string); +procedure tiShowStrings(const AStrings: TStrings; const AHeading: TfpgString); var lForm: TfpgForm; lMemo: TfpgMemo; @@ -97,7 +158,7 @@ begin lForm := TfpgForm.Create(nil); lMemo := TfpgMemo.Create(lForm); try - lForm.WindowTitle := pHeading; + lForm.WindowTitle := AHeading; lForm.Width := 300; lForm.Height := 300; lForm.WindowPosition := wpScreenCenter; @@ -114,28 +175,28 @@ begin end; end; -procedure tiShowString(const AStr: string; const pHeading: string); +procedure tiShowString(const AStr: TfpgString; const AHeading: TfpgString); var lSL: TStringList; begin lSL := TStringList.Create; try lSL.Text := AStr; - tiShowStringList(lSL, pHeading); + tiShowStringList(lSL, AHeading); finally lSL.Free; end; end; -procedure tiShowVariant(AValue: Variant; pHeading: string); +procedure tiShowVariant(AValue: Variant; AHeading: TfpgString); var ls: string; begin ls := tiVariantArrayToString(AValue); - tiShowString(ls, pHeading); + tiShowString(ls, AHeading); end; -procedure tiShowStream(const AValue: TStream; const pHeading: string); +procedure tiShowStream(const AValue: TStream; const AHeading: TfpgString); var lStringStream: TStringStream; begin @@ -143,37 +204,57 @@ begin try AValue.Position := 0; lStringStream.CopyFrom(AValue, AValue.Size); - tiShowString(lStringStream.DataString, pHeading); + tiShowString(lStringStream.DataString, AHeading); finally lStringStream.Free; end; end; -function tiAppConfirmation(const AMessage: string; ATitle: string = ''): boolean; +function tiAppConfirmation(const AMessage: TfpgString; ATitle: TfpgString = ''): boolean; begin Result := TfpgMessageDialog.Question(ATitle, AMessage) = mbYes end; -function tiAppConfirmation(const AMessage: string; +function tiAppConfirmation(const AMessage: TfpgString; const AValues: array of const): boolean; begin Result := tiAppConfirmation(Format(AMessage, AValues)); end; -procedure tiAppMessage(const AMessage: string; ATitle: string = ''); +procedure tiAppMessage(const AMessage: TfpgString; ATitle: TfpgString = ''); begin TfpgMessageDialog.Information(ATitle, AMessage); end; -procedure tiAppWarning(const AMessage: string; ATitle: string = ''); +procedure tiAppWarning(const AMessage: TfpgString; ATitle: TfpgString = ''); begin TfpgMessageDialog.Warning(ATitle, AMessage); end; -procedure tiAppError(const AMessage: string; ATitle: string = ''); +procedure tiAppError(const AMessage: TfpgString; ATitle: TfpgString = ''); begin TfpgMessageDialog.Critical(ATitle, AMessage); end; +procedure tiProcessing(const AMessage: TfpgString); +begin + if not Assigned(pWorkingForm) then + begin + pWorkingForm := TProcessingForm.Create(nil); + TProcessingForm(pWorkingForm).lblMessage.Text := AMessage; + pWorkingForm.Show; + end + else + TProcessingForm(pWorkingForm).lblMessage.Text := AMessage; + fpgApplication.ProcessMessages; +end; + +procedure tiEndProcessing; +begin + if Assigned(pWorkingForm) then + pWorkingForm.Close; + FreeAndNil(pWorkingForm); +end; + end. diff --git a/extras/tiopf/gui/tiListMediators.pas b/extras/tiopf/gui/tiListMediators.pas index 8f924306..89b99135 100644 --- a/extras/tiopf/gui/tiListMediators.pas +++ b/extras/tiopf/gui/tiListMediators.pas @@ -15,6 +15,7 @@ uses tiBaseMediator, fpg_listview, fpg_grid, + fpg_listbox, tiObject; type @@ -26,7 +27,7 @@ type function GetSelectedObject: TtiObject; override; procedure SetSelectedObject(const AValue: TtiObject); override; procedure CreateColumns; override; - procedure DoCreateItemMediator(AData: TtiObject; ARowIdx: integer); override; + function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; procedure SetupGUIandObject; override; procedure ClearList; override; @@ -47,7 +48,7 @@ type { Composite mediator for TfpgStringGrid } TtiStringGridMediatorView = class(TtiCustomListMediatorView) private - procedure DoCreateItemMediator(AData: TtiObject; ARowIdx: integer); override; + function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; protected function GetSelectedObject: TtiObject; override; @@ -96,6 +97,41 @@ type end; + { Composite mediator for TfpgListBox } + TtiListBoxMediatorView = class(TtiCustomListMediatorView) + private + function DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; override; + procedure DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); override; + protected + function GetSelectedObject: TtiObject; override; + procedure SetSelectedObject(const AValue: TtiObject); override; + procedure CreateColumns; override; + procedure ClearList; override; + procedure RebuildList; override; + procedure SetupGUIandObject; override; + public + constructor CreateCustom(AModel: TtiObjectList; AListBox: TfpgListBox; ADisplayNames: string; AIsObserving: Boolean = True); reintroduce; overload; + destructor Destroy; override; + class function ComponentClass: TClass; override; + function GetObjectFromRow(ARow: Integer): TtiObject; + function View: TfpgListBox; reintroduce; + end; + + { Used internally for sub-mediators in ListBox mediator. Moved to interface + section so it can be overridden. } + TtiListBoxItemMediator = class(TtiListItemMediator) + private + FView: TfpgListBox; + FRowIndex: integer; + public + constructor CreateCustom(AModel: TtiObject; AListBox: TfpgListBox; const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean = True); + procedure Update(ASubject: TtiObject); override; + published + property View: TfpgListBox read FView; + property RowIndex: integer read FRowIndex; + end; + + procedure RegisterFallBackListMediators; @@ -109,6 +145,7 @@ procedure RegisterFallBackListMediators; begin gMediatorManager.RegisterMediator(TtiListViewMediatorView, TtiObjectList); gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TtiObjectList); + gMediatorManager.RegisterMediator(TtiListBoxMediatorView, TtiObjectList); end; { TtiListViewMediatorView } @@ -131,10 +168,9 @@ begin Result := GetObjectFromItem(View.Items.Item[View.ItemIndex]); end; -procedure TtiListViewMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer); +function TtiListViewMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; var li: TfpgLVItem; - m: TtiListViewListItemMediator; begin DataAndPropertyValid(AData); { Create ListItem and Mediator } @@ -142,9 +178,9 @@ begin try li := TfpgLVItem.Create(View.Items); View.Items.Add(li); - m := TtiListViewListItemMediator.CreateCustom(AData, li, OnBeforeSetupField, FieldsInfo, Active); - li.UserData := m; - MediatorList.Add(m); + Result := TtiListViewListItemMediator.CreateCustom(AData, li, OnBeforeSetupField, FieldsInfo, Active); + li.UserData := Result; + MediatorList.Add(Result); finally View.EndUpdate; end; @@ -395,11 +431,10 @@ begin end; { for } end; -procedure TtiStringGridMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer); +function TtiStringGridMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; var i: integer; lFieldName: string; - lMediatorView: TtiStringGridRowMediator; begin View.BeginUpdate; try @@ -410,9 +445,9 @@ begin lFieldName := FieldsInfo[i].PropName; View.Cells[i, ARowIdx] := tiGetProperty(AData, lFieldName); // set Cell text end; - lMediatorView := TtiStringGridRowMediator.CreateCustom(AData, View, FieldsInfo, ARowIdx, Active); - View.Objects[0, ARowIdx] := lMediatorView; // set Object reference inside grid. It used to be AData. - MediatorList.Add(lMediatorView); + Result := TtiStringGridRowMediator.CreateCustom(AData, View, FieldsInfo, ARowIdx, Active); + View.Objects[0, ARowIdx] := Result; // set Object reference inside grid. It used to be AData. + MediatorList.Add(Result); finally View.EndUpdate; end; @@ -565,5 +600,173 @@ begin end; +{ TtiListBoxMediatorView } + +function TtiListBoxMediatorView.DoCreateItemMediator(AData: TtiObject; ARowIdx: integer): TtiListItemMediator; +var + i: integer; + lFieldName: string; +begin + View.BeginUpdate; + try + if FieldsInfo.Count > 0 then // only take the first field it if exists + begin + lFieldName := FieldsInfo[0].PropName; + View.Items.Add(tiGetProperty(AData, lFieldName)); // set Cell text + end + else + View.Items.Add(AData.Caption); // the default fallback + + Result := TtiListBoxItemMediator.CreateCustom(AData, View, FieldsInfo, ARowIdx, Active); + View.Items.Objects[ARowIdx] := Result; // set Object reference inside grid. It used to be AData. + MediatorList.Add(Result); + finally + View.EndUpdate; + end; +end; + +procedure TtiListBoxMediatorView.DoDeleteItemMediator(AIndex: Integer; AMediator: TtiListItemMediator); +begin + View.Items.Delete(AIndex); + inherited DoDeleteItemMediator(AIndex, AMediator); +end; + +function TtiListBoxMediatorView.GetSelectedObject: TtiObject; +begin + Result := GetObjectFromRow(View.FocusItem); +end; + +procedure TtiListBoxMediatorView.SetSelectedObject(const AValue: TtiObject); +var + i: integer; + o: TObject; +begin + for i := 0 to View.ItemCount - 1 do + begin + o := View.Items.Objects[i]; + if Assigned(o) and (TtiListItemMediator(o).Model = AValue) then + begin + View.FocusItem := i; + Exit; //==> + end; + end; { for } +// inherited SetSelectedObject(AValue); +end; + +procedure TtiListBoxMediatorView.CreateColumns; +begin + // do nothing - we don't support columns +end; + +procedure TtiListBoxMediatorView.ClearList; +begin + MediatorList.Clear; + if View <> nil then + View.Items.Clear; +end; + +procedure TtiListBoxMediatorView.RebuildList; +begin + { This rebuilds the whole list. Not very efficient. } + View.BeginUpdate; + try + SetupGUIandObject; + MediatorList.Clear; +// CreateColumns; + CreateSubMediators; + finally + View.EndUpdate; + end; +end; + +procedure TtiListBoxMediatorView.SetupGUIandObject; +begin + View.Items.Clear; + inherited SetupGUIandObject; +end; + +constructor TtiListBoxMediatorView.CreateCustom(AModel: TtiObjectList; + AListBox: TfpgListBox; ADisplayNames: string; AIsObserving: Boolean); +begin + inherited Create; + DisplayNames := ADisplayNames; + Subject := AModel; + SetView(AListBox); + CreateSubMediators; + IsObserving := AIsObserving; +end; + +destructor TtiListBoxMediatorView.Destroy; +begin + IsObserving := False; + inherited Destroy; +end; + +class function TtiListBoxMediatorView.ComponentClass: TClass; +begin + Result := TfpgListView; +end; + +function TtiListBoxMediatorView.GetObjectFromRow(ARow: Integer): TtiObject; +var + O: TObject; +begin + if View.ItemCount = 0 then + begin + Result := nil; + Exit; + end; + + if ARow = -1 then + Result := nil + else + begin + O := View.Items.Objects[ARow]; + if O <> nil then + Result := TtiListItemMediator(O).Model + else + Result := nil; + end; +end; + +function TtiListBoxMediatorView.View: TfpgListBox; +begin + Result := TfpgListBox(inherited View); +end; + +{ TtiListBoxItemMediator } + +constructor TtiListBoxItemMediator.CreateCustom(AModel: TtiObject; AListBox: TfpgListBox; + const AFieldsInfo: TtiMediatorFieldInfoList; ARowIndex: integer; IsObserving: Boolean); +begin + inherited Create; + Model := AModel; + FView := AListBox; + FFieldsInfo := AFieldsInfo; + FRowIndex := ARowIndex; + Active := IsObserving; // Will attach +end; + +procedure TtiListBoxItemMediator.Update(ASubject: TtiObject); +var + i: integer; + lFieldName: string; + lValue: string; + s: string; +begin + Assert(Model = ASubject); + s := ''; + for i := 0 to FFieldsInfo.Count - 1 do + begin + lFieldName := FFieldsInfo[I].PropName; + lValue := tiGetProperty(Model, lFieldName); + if Assigned(OnBeforeSetupField) then + OnBeforeSetupField(Model, lFieldName, lValue); + s := s + ', ' + lValue; + end; + FView.Items[FRowIndex] := s; +// inherited Update(ASubject); +end; + end. diff --git a/extras/tiopf/gui/tiMediators.pas b/extras/tiopf/gui/tiMediators.pas index 736d782d..889f6540 100644 --- a/extras/tiopf/gui/tiMediators.pas +++ b/extras/tiopf/gui/tiMediators.pas @@ -214,9 +214,10 @@ type { Base class to handle TfpgCalendarCombo controls } - TtiCalendarComboMediatorView = class(TtiBaseEditMediatorView) + TtiCalendarComboMediatorView = class(TtiControlMediatorView) protected procedure SetupGUIandObject; override; + procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; public constructor Create; override; function View: TfpgCalendarCombo; reintroduce; @@ -373,15 +374,21 @@ begin THackBaseEdit(View).MaxLength := Ma; end; -procedure TtiBaseEditMediatorView.SetObjectUpdateMoment( - const AValue: TtiObjectUpdateMoment); +procedure TtiBaseEditMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnchange,ouCustom] then THackBaseEdit(View).OnChange := @DoOnChange else THackBaseEdit(View).OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiBaseEditMediatorView.Create; @@ -442,15 +449,21 @@ begin end; end; -procedure TtiSpinEditMediatorView.SetObjectUpdateMoment( - const AValue: TtiObjectUpdateMoment); +procedure TtiSpinEditMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; constructor TtiSpinEditMediatorView.Create; @@ -488,10 +501,17 @@ procedure TtiTrackBarMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectU begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoTrackBarChanged // TfpgTrackBar has a different event signature else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; constructor TtiTrackBarMediatorView.Create; @@ -538,10 +558,17 @@ procedure TtiComboBoxMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectU begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; @@ -554,17 +581,24 @@ end; procedure TtiMemoMediatorView.DoGuiToObject; begin - Subject.PropValue[FieldName] := View.Lines.Text; + Subject.PropValue[FieldName] := Trim(View.Lines.Text); end; procedure TtiMemoMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; constructor TtiMemoMediatorView.Create; @@ -585,8 +619,12 @@ begin end; procedure TtiMemoMediatorView.SetupGUIandObject; +var + Mi, Ma: integer; begin inherited SetupGUIandObject; + if Subject.GetFieldBounds(FieldName,Mi,Ma) and (Ma>0) then + View.MaxLength := Ma; View.Lines.Text := ''; end; @@ -721,15 +759,21 @@ end; { TtiCheckBoxMediatorView } -procedure TtiCheckBoxMediatorView.SetObjectUpdateMoment( - const AValue: TtiObjectUpdateMoment); +procedure TtiCheckBoxMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; constructor TtiCheckBoxMediatorView.Create; @@ -788,6 +832,23 @@ begin end; end; +procedure TtiCalendarComboMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); +begin + inherited SetObjectUpdateMoment(AValue); + if View <> nil then + begin + if ObjectUpdateMoment in [ouOnChange,ouCustom] then + View.OnChange := @DoOnChange + else + View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; +end; + constructor TtiCalendarComboMediatorView.Create; begin inherited Create; @@ -837,15 +898,21 @@ begin end; end; -procedure TtiSpinEditFloatMediatorView.SetObjectUpdateMoment( - const AValue: TtiObjectUpdateMoment); +procedure TtiSpinEditFloatMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + View.OnChange := nil; + View.OnExit := nil; + end; + end; end; constructor TtiSpinEditFloatMediatorView.Create; diff --git a/extras/tiopf/gui/tiRtfReport.pas b/extras/tiopf/gui/tiRtfReport.pas index 627d6d26..1041cd37 100644 --- a/extras/tiopf/gui/tiRtfReport.pas +++ b/extras/tiopf/gui/tiRtfReport.pas @@ -3102,8 +3102,9 @@ end; procedure TRtfColorList.Clear; begin - inherited; - Add(0, 0, 0); //Dummy color.. + inherited Clear; + { TODO -oGraeme : Not sure why this was here, so I removed it. 2009-11-10 } +// Add(0, 0, 0); //Dummy color.. end; function TRtfColorList.Add(ARed, AGreen, ABlue: integer): integer; @@ -4631,7 +4632,3 @@ end; end. - - - - diff --git a/extras/tiopf/tiOPFfpGUI.lpk b/extras/tiopf/tiOPFfpGUI.lpk index 1ed2634c..1a93652d 100644 --- a/extras/tiopf/tiOPFfpGUI.lpk +++ b/extras/tiopf/tiOPFfpGUI.lpk @@ -30,6 +30,7 @@ -dLINK_XMLLIGHTx -dLINK_ZEOS_FB15x -dUseCThreads +-Xd "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/extras/x11_wininfo/x11wininfo.lpi b/extras/x11_wininfo/x11wininfo.lpi index 0096dd7b..ff317c0e 100644 --- a/extras/x11_wininfo/x11wininfo.lpi +++ b/extras/x11_wininfo/x11wininfo.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> diff --git a/extras/x11_wininfo/x11wininfo.lpr b/extras/x11_wininfo/x11wininfo.lpr index 39e0eae4..11486f5b 100644 --- a/extras/x11_wininfo/x11wininfo.lpr +++ b/extras/x11_wininfo/x11wininfo.lpr @@ -204,7 +204,6 @@ begin ImageMargin := 3; ImageName := ''; ImageSpacing := -1; - ModalResult := 0; ParentShowHint := True; ShowImage := True; TabOrder := 0; diff --git a/images/ellipse.bmp b/images/ellipse.bmp Binary files differnew file mode 100644 index 00000000..06fd71fe --- /dev/null +++ b/images/ellipse.bmp diff --git a/images/folder_open_file_16.bmp b/images/folder_open_file_16.bmp Binary files differnew file mode 100644 index 00000000..c4405ca7 --- /dev/null +++ b/images/folder_open_file_16.bmp diff --git a/images/menu_check_16.bmp b/images/menu_check_16.bmp Binary files differnew file mode 100644 index 00000000..7fec8e3c --- /dev/null +++ b/images/menu_check_16.bmp diff --git a/languages/fpgui.af.po b/languages/fpgui.af.po index 0c45d67b..f5ced39b 100644 --- a/languages/fpgui.af.po +++ b/languages/fpgui.af.po @@ -5,7 +5,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-03-18 00:00+0200\n" "PO-Revision-Date: 2009-06-26 14:51+0200\n" -"Last-Translator: <>\n" +"Last-Translator: Graeme Geldenhuys <graemeg@gmail.com>\n" "Language-Team: <en@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -80,6 +80,10 @@ msgstr "Kan nie die lêergids skep nie" msgid "Change" msgstr "Verander" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "Karakter Kaart" + #: fpg_constants:rsclose msgid "Close" msgstr "Sluit" @@ -240,6 +244,10 @@ msgstr "Informasie" msgid "Insert" msgstr "Invoeg" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "Voeg in van Karakter Kaart" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Kursief" @@ -400,6 +408,10 @@ msgstr "Soek" msgid "Select" msgstr "Kies" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Kies 'n lêergids" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Kies 'n lettertipe" @@ -436,6 +448,10 @@ msgstr "So" msgid "Sunday" msgstr "Sondag" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "Teks om in te voeg" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Do" diff --git a/languages/fpgui.de.po b/languages/fpgui.de.po index 0d55262d..52400040 100644 --- a/languages/fpgui.de.po +++ b/languages/fpgui.de.po @@ -79,6 +79,10 @@ msgstr "Kann Verzeichnis nicht anlegen" msgid "Change" msgstr "Ändern" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Schließen" @@ -239,6 +243,10 @@ msgstr "Information" msgid "Insert" msgstr "Einfügen" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Kursiv" @@ -399,6 +407,10 @@ msgstr "Suchen" msgid "Select" msgstr "Ausgewählte" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Wählen Sie ein Verzeichnis" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Schriftart auswählen" @@ -435,6 +447,10 @@ msgstr "Son" msgid "Sunday" msgstr "Sonntag" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Don" diff --git a/languages/fpgui.en.po b/languages/fpgui.en.po index 45906e38..3752d4e7 100644 --- a/languages/fpgui.en.po +++ b/languages/fpgui.en.po @@ -80,6 +80,10 @@ msgstr "" msgid "Change" msgstr "" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "" @@ -240,6 +244,10 @@ msgstr "" msgid "Insert" msgstr "" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "" @@ -400,6 +408,10 @@ msgstr "" msgid "Select" msgstr "" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "" @@ -436,6 +448,10 @@ msgstr "" msgid "Sunday" msgstr "" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "" diff --git a/languages/fpgui.es.po b/languages/fpgui.es.po index a8a36eae..69548bea 100644 --- a/languages/fpgui.es.po +++ b/languages/fpgui.es.po @@ -80,6 +80,10 @@ msgstr "No se puede crear la carpeta" msgid "Change" msgstr "Cambiar" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Cerrar" @@ -240,6 +244,10 @@ msgstr "Información" msgid "Insert" msgstr "Insertar" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Italica" @@ -400,6 +408,10 @@ msgstr "Buscar" msgid "Select" msgstr "Seleccionar" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Seleccione un directorio" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Seleccione una fuente" @@ -436,6 +448,10 @@ msgstr "Dom" msgid "Sunday" msgstr "Domingo" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Jun" diff --git a/languages/fpgui.fr.po b/languages/fpgui.fr.po index 84dfb749..8b827ff1 100644 --- a/languages/fpgui.fr.po +++ b/languages/fpgui.fr.po @@ -80,6 +80,10 @@ msgstr "Impossible de créer le répertoire" msgid "Change" msgstr "Modifier" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "Table de caractères" + #: fpg_constants:rsclose msgid "Close" msgstr "Fermer" @@ -240,6 +244,10 @@ msgstr "Information" msgid "Insert" msgstr "Insérer" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Italique" @@ -400,6 +408,10 @@ msgstr "Chercher" msgid "Select" msgstr "Selectionner" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Sélectionner un répertoire" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Choisir la police" @@ -436,6 +448,10 @@ msgstr "Dim" msgid "Sunday" msgstr "Dimanche" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "Texte à insérer" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Jeu" diff --git a/languages/fpgui.it.po b/languages/fpgui.it.po index 984504a2..551c74b9 100644 --- a/languages/fpgui.it.po +++ b/languages/fpgui.it.po @@ -80,6 +80,10 @@ msgstr "Non riesco a creare la cartella" msgid "Change" msgstr "Cambia" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Chiudi" @@ -240,6 +244,10 @@ msgstr "Informazione" msgid "Insert" msgstr "Inserisci" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Italico" @@ -400,6 +408,10 @@ msgstr "Cerca" msgid "Select" msgstr "Seleziona" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Selezionare una directory" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Seleziona un font" @@ -436,6 +448,10 @@ msgstr "Dom" msgid "Sunday" msgstr "Domenica" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Gio" diff --git a/languages/fpgui.po b/languages/fpgui.po index 61fb6e7f..1371f791 100644 --- a/languages/fpgui.po +++ b/languages/fpgui.po @@ -390,6 +390,10 @@ msgstr "" msgid "Select" msgstr "" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "" @@ -490,3 +494,15 @@ msgstr "" msgid "Yes to All" msgstr "" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + diff --git a/languages/fpgui.pt.po b/languages/fpgui.pt.po index 0bb524ec..55a3df4c 100644 --- a/languages/fpgui.pt.po +++ b/languages/fpgui.pt.po @@ -80,6 +80,10 @@ msgstr "Não foi possÃvel criar diretório" msgid "Change" msgstr "Editar" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Fechar" @@ -240,6 +244,10 @@ msgstr "Informação" msgid "Insert" msgstr "Inserir" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "Itálico" @@ -400,6 +408,10 @@ msgstr "Pesquisar" msgid "Select" msgstr "Selecionar" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Selecione um diretório" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Selecione a fonte" @@ -436,6 +448,10 @@ msgstr "" msgid "Sunday" msgstr "" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "" diff --git a/languages/fpgui.ru.po b/languages/fpgui.ru.po index 637e5ce8..87141b94 100644 --- a/languages/fpgui.ru.po +++ b/languages/fpgui.ru.po @@ -80,6 +80,10 @@ msgstr "Ðевозможно Ñоздать директорию" msgid "Change" msgstr "Изменить" +#: fpg_constants:rscharactermap +msgid "Character Map" +msgstr "" + #: fpg_constants:rsclose msgid "Close" msgstr "Закрыть" @@ -240,6 +244,10 @@ msgstr "ИнформациÑ" msgid "Insert" msgstr "Ð’Ñтавка" +#: fpg_constants:rsinsertfromcharactermap +msgid "Insert from Character Map" +msgstr "" + #: fpg_constants:rsitalic msgid "Italic" msgstr "КурÑив" @@ -400,6 +408,10 @@ msgstr "ПоиÑк" msgid "Select" msgstr "Выбрать" +#: fpg_constants:rsselectadirectory +msgid "Select a Directory" +msgstr "Выберите директорию" + #: fpg_constants:rsselectafont msgid "Select a font" msgstr "Выбор шрифта" @@ -436,6 +448,10 @@ msgstr "Ð’Ñ" msgid "Sunday" msgstr "ВоÑкреÑенье" +#: fpg_constants:rstexttoinsert +msgid "Text to Insert" +msgstr "" + #: fpg_constants:rsshortthu msgid "Thu" msgstr "Чт" diff --git a/prototypes/fpgui2/tests/drawtest.lpi b/prototypes/fpgui2/tests/drawtest.lpi index 978bd036..b24d08d8 100644 --- a/prototypes/fpgui2/tests/drawtest.lpi +++ b/prototypes/fpgui2/tests/drawtest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -40,10 +39,7 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> <Other> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/prototypes/fpgui2/tests/drawtest.lpr b/prototypes/fpgui2/tests/drawtest.lpr index dc2dfaec..b9f917aa 100644 --- a/prototypes/fpgui2/tests/drawtest.lpr +++ b/prototypes/fpgui2/tests/drawtest.lpr @@ -7,10 +7,10 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, - fpgfx, - gfxbase, - gui_form, - gfx_imgfmt_bmp, fpgui_toolkit; + fpg_base, + fpg_main, + fpg_form, + fpg_imgfmt_bmp; type diff --git a/prototypes/fpgui2/tests/edittest.lpi b/prototypes/fpgui2/tests/edittest.lpi index fa79a0d7..11119cdb 100644 --- a/prototypes/fpgui2/tests/edittest.lpi +++ b/prototypes/fpgui2/tests/edittest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -45,10 +44,7 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> <Linking> <Debugging> <UseLineInfoUnit Value="False"/> diff --git a/prototypes/fpgui2/tests/edittest.lpr b/prototypes/fpgui2/tests/edittest.lpr index ede76f86..16b32e58 100644 --- a/prototypes/fpgui2/tests/edittest.lpr +++ b/prototypes/fpgui2/tests/edittest.lpr @@ -5,24 +5,24 @@ program edittest; uses Classes, SysUtils, - gfxbase, - fpgfx, - gfx_widget, - gfx_imgfmt_bmp, - gfx_UTF8utils, - gui_form, - gui_label, - gui_button, - gui_edit, - gui_combobox, - gui_scrollbar, - gui_memo, - gui_dialogs, - gui_listbox, - gui_checkbox, - gui_radiobutton, - gui_trackbar, - gui_progressbar; + fpg_base, + fpg_main, + fpg_widget, + fpg_imgfmt_bmp, + fpg_stringutils, + fpg_form, + fpg_label, + fpg_button, + fpg_edit, + fpg_combobox, + fpg_scrollbar, + fpg_memo, + fpg_dialogs, + fpg_listbox, + fpg_checkbox, + fpg_radiobutton, + fpg_trackbar, + fpg_progressbar; type diff --git a/prototypes/fpgui2/tests/frm_threedee.pas b/prototypes/fpgui2/tests/frm_threedee.pas index dd3bc46d..5f6548ed 100644 --- a/prototypes/fpgui2/tests/frm_threedee.pas +++ b/prototypes/fpgui2/tests/frm_threedee.pas @@ -10,12 +10,9 @@ unit frm_threedee; interface uses - SysUtils, Classes, gfxbase, fpgfx, gui_edit, - gfx_widget, gui_form, gui_label, gui_button, - gui_listbox, gui_memo, gui_combobox, gui_grid, - gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, - gui_progressbar, gui_radiobutton, gui_tab, gui_menu, - gui_bevel; + SysUtils, Classes, fpg_base, fpg_main, fpg_edit, + fpg_widget, fpg_form, fpg_label, fpg_button, fpg_dialogs, + fpg_checkbox, fpg_trackbar, fpg_progressbar, fpg_menu; type @@ -69,8 +66,8 @@ type implementation uses - gfx_UTF8utils, - gfx_imgfmt_bmp; + fpg_stringutils, + fpg_imgfmt_bmp; const clM2DarkBlue = $187EC0; @@ -122,18 +119,18 @@ Const procedure FillRectGradient(Canvas: TfpgCanvas; X, Y, W, H: TfpgCoord; Strip: Integer; Astart, Astop: TfpgColor); var - RGBStart: TRGBTriple; - RGBStop: TRGBTriple; + RGBStart: TFPColor; + RGBStop: TFPColor; RDiff, GDiff, BDiff: Integer; count: Integer; i: Integer; - newcolor: TRGBTriple; + newcolor: TFPColor; Hx, Hy: TfpgCoord; // Coordinates for Horizontal Lines Vx, Vy: TfpgCoord; // Coordinates for Vertical Lines avgcolor: TfpgColor; begin - RGBStart := fpgColorToRGBTriple(fpgColorToRGB(AStart)); - RGBStop := fpgColorToRGBTriple(fpgColorToRGB(AStop)); + RGBStart := fpgColorToFPColor(fpgColorToRGB(AStart)); + RGBStop := fpgColorToFPColor(fpgColorToRGB(AStop)); count := Strip; Hx := X; @@ -154,7 +151,7 @@ begin newcolor.Blue := RGBStart.Blue + (i * BDiff) div count; Canvas.SetLineStyle(1, lsSolid); - Canvas.SetColor(RGBTripleTofpgColor(newcolor)); + Canvas.SetColor(FPColorTofpgColor(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/prototypes/fpgui2/tests/themetest.lpi b/prototypes/fpgui2/tests/themetest.lpi index e269e7ee..3af53c03 100644 --- a/prototypes/fpgui2/tests/themetest.lpi +++ b/prototypes/fpgui2/tests/themetest.lpi @@ -2,14 +2,14 @@ <CONFIG> <ProjectOptions> <PathDelim Value="\"/> - <Version Value="5"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value=".\"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -40,11 +40,8 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="8"/> <PathDelim Value="\"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> <Other> <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> diff --git a/prototypes/fpgui2/tests/themetest.lpr b/prototypes/fpgui2/tests/themetest.lpr index c194e571..60cb95f4 100644 --- a/prototypes/fpgui2/tests/themetest.lpr +++ b/prototypes/fpgui2/tests/themetest.lpr @@ -8,17 +8,17 @@ uses {$ENDIF}{$ENDIF} Classes, SysUtils, - fpgfx, - gfxbase, - gui_form, - gui_scrollbar, - gui_button, - gui_label, - gfx_imgfmt_bmp, - gfx_extinterpolation, - gui_trackbar, - gui_style, - gui_dialogs; + fpg_base, + fpg_main, + fpg_form, + fpg_scrollbar, + fpg_button, + fpg_label, + fpg_imgfmt_bmp, + fpg_extinterpolation, + fpg_trackbar, + fpg_style, + fpg_dialogs; type { Note: @@ -142,21 +142,21 @@ begin buttonoptions.ButtonFeatures := []; if Enabled then - Include(buttonoptions.State, stEnabled); - + buttonoptions.State := buttonoptions.State + [stEnabled]; + if FDown then - Include(buttonoptions.State, stLowered) + buttonoptions.State := buttonoptions.State + [stLowered] else - Include(buttonoptions.State, stRaised); + buttonoptions.State := buttonoptions.State + [stRaised]; if FFocused then - Include(buttonoptions.State, stHasFocus); + buttonoptions.State := buttonoptions.State + [stHasFocus]; if FEmbedded then - Include(buttonoptions.ButtonFeatures, bfEmbedded); + buttonoptions.ButtonFeatures := buttonoptions.ButtonFeatures + [bfEmbedded]; if FDefault then - Include(buttonoptions.ButtonFeatures, bfDefault); + buttonoptions.ButtonFeatures := buttonoptions.ButtonFeatures + [bfDefault]; // Now let the Style do ALL the drawing. Nothing must be done here! FStyle.DrawControl(cePushButtonBevel, buttonoptions, Canvas, self); @@ -562,7 +562,10 @@ begin inherited HandleMouseEnter; if Enabled then begin - State := 1; + if not FDown then + State := 1 + else + State := 2; Repaint; end; end; diff --git a/prototypes/fpgui2/tests/threedee.lpi b/prototypes/fpgui2/tests/threedee.lpi index c0669034..73845ab0 100644 --- a/prototypes/fpgui2/tests/threedee.lpi +++ b/prototypes/fpgui2/tests/threedee.lpi @@ -1,17 +1,16 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -47,10 +46,7 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> <Other> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/prototypes/fpgui2/tests/threedee.lpr b/prototypes/fpgui2/tests/threedee.lpr index 83766c7b..380d431b 100644 --- a/prototypes/fpgui2/tests/threedee.lpr +++ b/prototypes/fpgui2/tests/threedee.lpr @@ -11,7 +11,7 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} - Classes, fpgfx, frm_threedee, fpgui_toolkit; + Classes, fpg_main, frm_threedee; procedure MainProc; diff --git a/prototypes/fpgui2/tests/units/.gitignore b/prototypes/fpgui2/tests/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/prototypes/fpgui2/tests/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/prototypes/textedit/demo_textedit.lpi b/prototypes/textedit/demo_textedit.lpi index 11639711..1ba9ad2c 100644 --- a/prototypes/textedit/demo_textedit.lpi +++ b/prototypes/textedit/demo_textedit.lpi @@ -14,7 +14,7 @@ <UseAppBundle Value="False"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -25,7 +25,7 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication Use="True" PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -50,6 +50,7 @@ <Version Value="8"/> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)/"/> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> @@ -64,8 +65,6 @@ </Debugging> </Linking> <Other> - <CustomOptions Value="-FUunits -"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/prototypes/textedit/demo_textedit.lpr b/prototypes/textedit/demo_textedit.lpr index 6211cc7f..06e19d63 100644 --- a/prototypes/textedit/demo_textedit.lpr +++ b/prototypes/textedit/demo_textedit.lpr @@ -7,7 +7,7 @@ uses typinfo, Sysutils, fpg_base, fpg_main, fpg_form, fpg_button, fpg_label, - fpg_memo, fpg_dialogs, fpg_utils, fpg_radiobutton, + fpg_memo, fpg_dialogs, fpg_utils, fpg_stringutils, fpg_radiobutton, fpg_textedit, fpg_checkbox, fpg_panel; type @@ -30,22 +30,105 @@ type Label3: TfpgLabel; Label4: TfpgLabel; Bevel2: TfpgBevel; + chkRightEdge: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure ShowGutterChanged(Sender: TObject); procedure ShowLineNumbers(Sender: TObject); + procedure ShowRightEdge(Sender: TObject); procedure AppExceptions(Sender: TObject; E: Exception); procedure btnQuitClick(Sender: TObject); procedure HandleResize(awidth, aheight: TfpgCoord); override; procedure btnLoadClicked(Sender: TObject); procedure ChangeFontClicked(Sender: TObject); + procedure TextEditDrawLine(Sender: TObject; ALineText: TfpgString; ALineIndex: Integer; ACanvas: TfpgCanvas; ATextRect: TfpgRect; var AllowSelfDraw: Boolean); public constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; + procedure AfterCreate; override; end; { TMainForm } +const + cReservedWords: array[1..44] of string = + ('begin', 'end', 'program', 'procedure', 'var', + 'uses', 'type', 'const', 'if', 'then', + 'for', 'do', 'unit', 'interface', 'implementation', + 'initialization', 'finalization', 'with', 'case', 'private', + 'protected', 'public', 'published', 'override', 'virtual', + 'class', 'record', 'function', 'property', 'to', + 'else', 'finally', 'while', 'except', 'try', + 'constructor', 'destructor', 'read', 'write', 'out', + 'default', 'not', 'and', 'in'); + +procedure TMainForm.TextEditDrawLine(Sender: TObject; ALineText: TfpgString; + ALineIndex: Integer; ACanvas: TfpgCanvas; ATextRect: TfpgRect; + var AllowSelfDraw: Boolean); +var + oldfont, newfont: TfpgFont; + s: TfpgString; // copy of ALineText we work with + i, j, c: integer; // i = position of reserved word; c = last character pos + iLength: integer; // length of reserved word + w: integer; // reserved word loop variable + r: TfpgRect; // string rectangle to draw in + edt: TfpgTextEdit; + + procedure TestFurther(var AIndex: integer); + begin + if AIndex = 0 then + begin + AIndex := UTF8Pos(cReservedWords[w], s); + if (AIndex > 0) then + begin +// writeln('>> ', s); +// writeln(AIndex+iLength-1, ' ---- ', Length(s)); + if (AIndex+iLength-1 <> Length(s)) and not (s[AIndex+iLength] in [';', '.', '(', #10, #13]) then + AIndex := 0; + end; + end; + end; + +begin + edt := TfpgTextEdit(Sender); + AllowSelfDraw := False; + ACanvas.TextColor := clBlack; + ACanvas.DrawText(ATextRect, ALineText); // draw plain text first + oldfont := TfpgFont(ACanvas.Font); + newfont := fpgGetFont(edt.FontDesc + ':bold'); // 'Bitstream Vera Sans Mono-10' + ACanvas.Font := newfont; +// PrintRect(ATextRect); + + for w := Low(cReservedWords) to High(cReservedWords) do + begin + s := ALineText; + i := UTF8Pos(cReservedWords[w]+' ', s); + iLength := UTF8Length(cReservedWords[w]); + TestFurther(i); + j := 0; + while i > 0 do + begin +// writeln('DEBUG: TMainForm.TextEditDrawLine - s = <' + s + '>'); +// writeln('DEBUG: TMainForm.TextEditDrawLine - found keyword: ' + cReservedWords[w]); + j := j + i; + s := UTF8Copy(ALineText, j, iLength+1); + UTF8Delete(s, 1, i + iLength); + r.SetRect(ATextRect.Left + edt.FontWidth * (j - 1), ATextRect.Top, + edt.FontWidth * (j + iLength), ATextRect.Height); +// PrintRect(r); +// ACanvas.Color := clWhite; +// ACanvas.FillRectangle(r); // clear area of previous text + ACanvas.DrawText(r, cReservedWords[w]); // draw bold text + i := UTF8Pos(cReservedWords[w]+' ', s); + TestFurther(i); + j := j + iLength; + end; { while } + end; { for w } + + ACanvas.Font := oldfont; + newfont.Free; +// writeln('------'); +end; + procedure TMainForm.ShowGutterChanged(Sender: TObject); begin TextEdit.GutterVisible := chkShowGutter.Checked; @@ -56,6 +139,11 @@ begin TextEdit.GutterShowLineNumbers := chkLineNumbers.Checked; end; +procedure TMainForm.ShowRightEdge(Sender: TObject); +begin + TextEdit.RightEdge := chkRightEdge.Checked; +end; + procedure TMainForm.AppExceptions(Sender: TObject; E: Exception); begin DumpStack; @@ -136,10 +224,8 @@ end; constructor TMainForm.Create(AOwner: TComponent); begin inherited Create(AOwner); - // HandleResize(Width, Height); - - fpgApplication.OnException :=@AppExceptions; + fpgApplication.OnException := @AppExceptions; end; procedure TMainForm.AfterCreate; @@ -148,6 +234,7 @@ begin Name := 'MainForm'; SetPosition(319, 180, 594, 455); WindowTitle := 'TextEdit (new Memo) test'; + Hint := ''; WindowPosition := wpScreenCenter; memo := TfpgMemo.Create(self); @@ -156,6 +243,7 @@ begin Name := 'memo'; SetPosition(6, 172, 280, 235); Anchors := [anLeft,anTop,anBottom]; + Hint := ''; Lines.Add('Memo Test0'); Lines.Add('Memo Test1'); Lines.Add('Memo Test2'); @@ -187,15 +275,21 @@ begin Name := 'TextEdit'; SetPosition(300, 172, 280, 235); Anchors := [anLeft,anRight,anTop,anBottom]; - Lines.Add('Memo Test0'); - Lines.Add('Memo Test1'); - Lines.Add('Memo Test2'); - Lines.Add('Memo Test3'); - Lines.Add('Memo Test4'); + Lines.Add('program Test1;'); + Lines.Add('{$mode objfpc}{$H+}'); + Lines.Add('uses'); + Lines.Add(' classes;'); + Lines.Add('var'); + Lines.Add(' i: integer;'); + Lines.Add('begin'); + Lines.Add(' writeln(i);'); + Lines.Add('end.'); + Lines.Add(''); // FontDesc := '#Edit1'; FontDesc := 'Bitstream Vera Sans Mono-10'; // Lines.Insert(1,'0 Beforje 1 after'); ParentShowHint := True; +// OnDrawLine := @TextEditDrawLine; end; btnLoad := TfpgButton.Create(self); @@ -219,6 +313,7 @@ begin SetPosition(20, 28, 120, 20); FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 4; Text := 'Left'; end; @@ -228,8 +323,10 @@ begin begin Name := 'rbRight'; SetPosition(20, 52, 120, 20); + Checked := True; FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 5; Text := 'Right'; end; @@ -239,9 +336,9 @@ begin begin Name := 'rbBoth'; SetPosition(20, 76, 120, 20); - Checked := True; FontDesc := '#Label1'; GroupIndex := 0; + Hint := ''; TabOrder := 6; Text := 'Both'; end; @@ -262,20 +359,22 @@ begin with chkShowGutter do begin Name := 'chkShowGutter'; - SetPosition(168, 28, 120, 20); + SetPosition(168, 28, 172, 20); FontDesc := '#Label1'; + Hint := ''; TabOrder := 14; Text := 'Show Gutter'; - OnChange :=@ShowGutterChanged; + OnChange := @ShowGutterChanged; end; chkLineNumbers := TfpgCheckBox.Create(self); with chkLineNumbers do begin Name := 'chkLineNumbers'; - SetPosition(168, 52, 120, 20); + SetPosition(168, 52, 172, 20); Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 15; Text := 'Show Line Numbers'; OnChange := @ShowLineNumbers; @@ -332,9 +431,22 @@ begin begin Name := 'Bevel2'; SetPosition(140, 8, 16, 148); + Hint := ''; Shape := bsLeftLine; end; + chkRightEdge := TfpgCheckBox.Create(self); + with chkRightEdge do + begin + Name := 'chkRightEdge'; + SetPosition(168, 76, 172, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 16; + Text := 'Right Edge Line'; + OnChange := @ShowRightEdge; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/prototypes/textedit/fpg_textedit.pas b/prototypes/textedit/fpg_textedit.pas index 21f4e5e9..73c30b47 100644 --- a/prototypes/textedit/fpg_textedit.pas +++ b/prototypes/textedit/fpg_textedit.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -62,12 +62,18 @@ type end; + TfpgDrawLineEvent = procedure(Sender: TObject; ALineText: TfpgString; + ALineIndex: Integer; ACanvas: TfpgCanvas; ATextRect: TfpgRect; + var AllowSelfDraw: Boolean) of object; + + TfpgBaseTextEdit = class(TfpgWidget) private FFont: TfpgFont; FFullRedraw: Boolean; FLines: TStrings; CaretPos: TPoint; + FOnDrawLine: TfpgDrawLineEvent; FScrollBarStyle: TfpgScrollStyle; MousePos: TPoint; FChrW: Integer; @@ -89,6 +95,8 @@ type FSelDrag: Boolean; FSelected, FSelMouseDwn: Boolean; FGutterPan: TfpgGutter; + FRightEdge: Boolean; + FRightEdgeCol: Integer; function GetFontDesc: string; function GetGutterShowLineNumbers: Boolean; function GetGutterVisible: Boolean; @@ -113,8 +121,12 @@ type procedure UpdateGutterCoords; procedure KeyboardCaretNav(const ShiftState: TShiftState; const AKeyCode: Word); procedure InitMemoObjects; + procedure SetRightEdge(const AValue: Boolean); + procedure SetRightEdgeCol(const AValue: Integer); protected { -- internal events -- } + procedure HandleShow; override; + procedure HandleResize(AWidth, AHeight: TfpgCoord); override; procedure HandlePaint; override; procedure HandleMouseEnter; override; procedure HandleMouseExit; override; @@ -124,8 +136,8 @@ type procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override; { -- local widget functions -- } procedure DrawVisible; virtual; - procedure DrawLine(const I, Y: Integer); virtual; - procedure FormatLine(const I, X, Y: Integer); + procedure DrawLine(const ALineIndex, Y: Integer); virtual; + procedure FormatLine(const ALineIndex, X, Y: Integer); procedure DrawCaret(const X, Y: Integer); virtual; { -- to be published --} property FontDesc: string read GetFontDesc write SetFontDesc; @@ -136,6 +148,7 @@ type property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth; property TabWidth: Integer read FTabWidth write SetTabWidth default 8; property Tracking: Boolean read FTracking write FTracking default True; + property OnDrawLine: TfpgDrawLineEvent read FOnDrawLine write FOnDrawLine; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -147,10 +160,14 @@ type procedure DeleteSelection; procedure SaveToFile(const AFileName: TfpgString); procedure LoadFromFile(const AFileName: TfpgString); + property FontHeight: Integer read FChrH; + property FontWidth: Integer read FChrW; property ScrollPos_H: Integer read GetHScrollPos write SetHScrollPos; property ScrollPos_V: Integer read GetVScrollPos write SetVScrollPos; property TopLine: Integer read FTopLine; property VisibleLines: Integer read FVisLines; + property RightEdge: Boolean read FRightEdge write SetRightEdge default False; + property RightEdgeCol: Integer read FRightEdgeCol write SetRightEdgeCol default 80; end; @@ -164,13 +181,14 @@ type property ScrollBarStyle; property TabWidth; property Tracking; + property OnDrawLine; end; implementation uses - fpg_dialogs{, fpg_constants}, fpg_stringutils, fpg_utils; + fpg_dialogs{, fpg_constants}, fpg_stringutils, fpg_utils, math; function GetNextWord(SLine: TfpgString; var PosX: Integer): Boolean; @@ -370,6 +388,8 @@ end; procedure TfpgBaseTextEdit.SetGutterVisible(const AValue: Boolean); begin FGutterPan.Visible := AValue; + if FGutterPan.Visible then + UpdateGutterCoords; Invalidate; end; @@ -406,6 +426,7 @@ begin FVisCols := GetClientRect.Width div FChrW; end; +{ Re-order StartXXX and EndXXX if user is selecting backwards } procedure TfpgBaseTextEdit.GetSelBounds(var AStartNo, AEndNo, AStartOffs, AEndOffs: Integer); begin @@ -417,12 +438,14 @@ begin begin AStartOffs := FSelStartOffs; AEndOffs := FSelEndOffs; - end else + end + else begin AStartOffs := FSelEndOffs; AEndOffs := FSelStartOffs; end; - end else + end + else begin AStartNo := FSelEndNo; AEndNo := FSelStartNo; @@ -434,18 +457,26 @@ end; procedure TfpgBaseTextEdit.UpdateScrollBars; begin FVScrollBar.Min := 0; - FVScrollBar.PageSize := FVisLines - 2; - FVScrollBar.Max := FLines.Count +1 - FVisLines; // +1 is so the last line is completely visible + FVScrollBar.PageSize := FVisLines - 4; + FVScrollBar.Max := FLines.Count - FVisLines + 1; // +1 is so the last line is completely visible FVScrollBar.Position := VPos; + if FLines.Count > 0 then + FVScrollBar.SliderSize := FVisLines / FLines.Count; FVScrollBar.Visible := FLines.Count > FVisLines; + if FVScrollBar.Visible then + FVScrollBar.RepaintSlider; FHScrollBar.Min := 0; - FHScrollBar.PageSize := FVisCols div 4; //FMaxScrollH div 4; - FHScrollBar.Max := FMaxScrollH;// div 2; + FHScrollBar.PageSize := FVisCols div 2; //FMaxScrollH div 4; + FHScrollBar.Max := FMaxScrollH - FVisCols + 1;// div 2; FHScrollBar.Position := HPos; + FHScrollBar.SliderSize := FVisCols / FMaxScrollH; FHScrollBar.Visible := FMaxScrollH > FVisCols; + if FHScrollBar.Visible then + FHScrollBar.RepaintSlider; UpdateScrollBarCoords; + UpdateCharBounds; end; procedure TfpgBaseTextEdit.VScrollBarMove(Sender: TObject; position: integer); @@ -499,7 +530,7 @@ var begin OldPos := VPos; VPos := p; - UpdateScrollBars; + {$IFDEF gDEBUG} writeln('OldPos:', OldPos, ' NewPos:', VPos, ' SB.Max:', FVScrollBar.Max); {$ENDIF} @@ -533,7 +564,7 @@ var begin OldPos := HPos; HPos := p; - UpdateScrollBars; + {$IFDEF gDEBUG} writeln('OldPos:', OldPos, ' NewPos:', HPos, ' SB.Max:', FHScrollBar.Max); {$ENDIF} @@ -565,11 +596,6 @@ begin VHeight := r.Height; HWidth := r.Width; - //if FVScrollBar.Visible then - //Dec(HWidth, FVScrollBar.Width); - //if FHScrollBar.Visible then - //Dec(VHeight, FHScrollBar.Height); - FHScrollBar.Top := Height - FHScrollBar.Height - r.Top; FHScrollBar.Left := r.Top; FHScrollBar.Width := HWidth; @@ -594,6 +620,8 @@ end; { This procedure is used to set caret position on keyboard navigation and to set selection if Shift key is pressed. } procedure TfpgBaseTextEdit.KeyboardCaretNav(const ShiftState: TShiftState; const AKeyCode: Word); +var + SaveXCaret: Integer; procedure CtrlKeyLeftKey; var @@ -651,7 +679,6 @@ procedure TfpgBaseTextEdit.KeyboardCaretNav(const ShiftState: TShiftState; const end; begin - writeln('DEBUG: TfpgBaseTextEdit.KeyboardCaretNav >>'); case AKeyCode of keyLeft: begin @@ -660,12 +687,12 @@ begin begin if CaretPos.Y > 0 then begin - if CaretPos.Y <= pred(FLines.Count) then + if CaretPos.Y <= (FLines.Count-1) then begin if (ssCtrl in ShiftState) and (CaretPos.Y > 0) then begin CaretPos.Y := CaretPos.Y - 1; - CaretPos.X := Length(FLines[CaretPos.Y]); + CaretPos.X := UTF8Length(FLines[CaretPos.Y]); if FSelected then begin FSelEndNo := CaretPos.Y; @@ -675,7 +702,7 @@ begin end; end; CaretPos.Y := CaretPos.Y - 1; - CaretPos.X := Length(FLines[CaretPos.Y]); + CaretPos.X := UTF8Length(FLines[CaretPos.Y]); end else begin @@ -686,9 +713,9 @@ begin begin if not FSelected then begin - if CaretPos.Y <= pred(FLines.Count) then - if CaretPos.X > Length(FLines[CaretPos.Y]) then - CaretPos.Y := Length(FLines[CaretPos.Y]) - 1; + if CaretPos.Y <= (FLines.Count-1) then + if CaretPos.X > UTF8Length(FLines[CaretPos.Y]) then + CaretPos.Y := UTF8Length(FLines[CaretPos.Y]) - 1; FSelected := True; FSelStartNo := CaretPos.Y; FSelStartOffs := CaretPos.X + 1; @@ -705,11 +732,11 @@ begin CtrlKeyLeftKey else FSelEndOffs := CaretPos.X; - if FSelEndNo <= pred(FLines.Count) then + if FSelEndNo <= (FLines.Count-1) then begin - if FSelEndOffs > Length(FLines[FSelEndNo]) then + if FSelEndOffs > UTF8Length(FLines[FSelEndNo]) then begin - FSelEndOffs := Length(FLines[FSelEndNo]) - 1; + FSelEndOffs := UTF8Length(FLines[FSelEndNo]) - 1; CaretPos.X := FSelEndOffs; end; end @@ -783,6 +810,9 @@ begin if not (ssShift in ShiftState) and not (ssCtrl in ShiftState) then begin CaretPos.Y := CaretPos.Y - 1; + // scroll text + if FVScrollBar.Visible and (CaretPos.Y < FTopLine) then + FVScrollBar.LineUp; if FSelected then begin FSelected := False; @@ -794,8 +824,8 @@ begin else if (ssCtrl in ShiftState) and not (ssShift in ShiftState) then begin CaretPos.Y := CaretPos.Y - 1; - {$Note This does not work. The view must scroll and caret pos stay the same. } - VScrollBarMove(self, FVScrollBar.Position-1); + if FVScrollBar.Visible then + FVScrollBar.LineUp; // VScrollBarMove(self, FVScrollBar.Position-1); FSelStartNo := CaretPos.Y; Exit; end @@ -806,7 +836,7 @@ begin begin FSelStartNo := CaretPos.Y + 1; FSelStartOffs := CaretPos.X; - FSelEndNo := CaretPos.X; + FSelEndNo := CaretPos.Y; FSelEndOffs := CaretPos.X; FSelected := True; end @@ -826,7 +856,10 @@ begin if not (ssShift in ShiftState) and not (ssCtrl in ShiftState) then begin CaretPos.Y := CaretPos.Y + 1; - if FSelected then + // scroll text + if FVScrollBar.Visible and (CaretPos.Y > FTopLine+FVisLines-2) then + FVScrollBar.LineDown; + if FSelected then begin FSelected := False; Exit; @@ -837,8 +870,8 @@ begin else if (ssCtrl in ShiftState) and not (ssShift in ShiftState) then begin CaretPos.Y := CaretPos.Y + 1; - {$Note This does not work. The view must scroll and caret pos stay the same. } - VScrollBarMove(self, FVScrollBar.Position+1); + if FVScrollBar.Visible then + FVScrollBar.LineDown; // VScrollBarMove(self, FVScrollBar.Position+1); FSelStartNo := CaretPos.Y; Exit; end @@ -864,17 +897,154 @@ begin keyHome: begin + if not (ssCtrl in ShiftState) and not (ssShift in ShiftState) then + begin + CaretPos.X := 0; + if FSelected then + begin + FSelected := False; + Exit; + end; + end; + if ssCtrl in ShiftState then + begin + if ssShift in ShiftState then + begin + if not FSelected then + begin + FSelStartNo := CaretPos.Y; + FSelStartOffs := CaretPos.X; + FSelected := True; + end; + CaretPos.Y := 0; + CaretPos.X := 0; + FSelEndNo := 0; + FSelEndOffs := 0; + end + else + begin + CaretPos.Y := 0; + CaretPos.X := 0; + end; + Exit; + end; + if ssShift in ShiftState then + begin + if not FSelected then + begin + FSelStartNo := CaretPos.Y; + FSelStartOffs := CaretPos.X; + FSelected := True; + end; + CaretPos.X := 0; + FSelEndNo := CaretPos.Y; + FSelEndOffs := 0; + if FSelEndNo = FSelStartNo then + FSelected := (FSelStartOffs <> FSelEndOffs); + end; end; keyEnd: begin + if not (ssCtrl in ShiftState) and not (ssShift in ShiftState) then + begin + if CaretPos.Y <= pred(FLines.Count) then + CaretPos.X := Length(FLines[CaretPos.Y]) + else + CaretPos.X := 0; + end; + if ssCtrl in ShiftState then + begin + if ssShift in ShiftState then + begin + if not FSelected then + begin + FSelStartNo := CaretPos.Y; + FSelStartOffs := CaretPos.X; + FSelected := True; + end; + CaretPos.Y := pred(FLines.Count); + CaretPos.X := Length(FLines[CaretPos.Y]); + FSelEndNo := pred(FLines.Count); + FSelEndOffs := Length(FLines[CaretPos.Y]); + end else + begin + CaretPos.Y := pred(FLines.Count); + CaretPos.X := Length(FLines[CaretPos.Y]); + end; + Exit; + end; + if ssShift in ShiftState then + begin + if not FSelected then + begin + FSelStartNo := CaretPos.Y; + if CaretPos.Y <= pred(FLines.Count) then + if CaretPos.X > Length(FLines[CaretPos.Y]) then + CaretPos.X := Length(FLines[CaretPos.Y]); + FSelStartOffs := CaretPos.X; + FSelected := True; + end; + if CaretPos.Y <= pred(FLines.Count) then + CaretPos.X := Length(FLines[CaretPos.Y]) + else + CaretPos.X := 0; + FSelEndNo := CaretPos.Y; + FSelEndOffs := CaretPos.X; + if FSelEndNo = FSelStartNo then + FSelected := (FSelStartOffs <> FSelEndOffs); + end; end; - keyPrior, keyNext: + keyPageUp, keyPageDown: begin + if not FSelected then + begin + FSelStartNo := CaretPos.Y; + FSelStartOffs := CaretPos.X; + end; + SaveXCaret := CaretPos.Y - FTopLine; + if AKeyCode = keyPageUp then + begin + if VPos = 0 then + begin + CaretPos.Y := 0; + CaretPos.X := 0; + end + else + begin + // scroll text + if FVScrollBar.Visible then + FVScrollBar.PageUp; + // restore caret at same line offset as before + CaretPos.Y := FTopLine + SaveXCaret; + end; + end + else + begin + if VPos > (FLines.Count - FVisLines) then + begin + CaretPos.Y := FLines.Count-1; + CaretPos.X := Length(FLines[CaretPos.Y]); + end + else + begin + // scroll text + if FVScrollBar.Visible then + FVScrollBar.PageDown; + // restore caret at same line offset as before + CaretPos.Y := FTopLine + SaveXCaret; + end; + end; + if ssShift in ShiftState then + begin + FSelEndNo := CaretPos.Y; + FSelEndOffs := CaretPos.X; + if not FSelected then + FSelected := True; + end; end; end; - writeln('DEBUG: TfpgBaseTextEdit.KeyboardCaretNav <<'); end; procedure TfpgBaseTextEdit.InitMemoObjects; @@ -887,10 +1057,50 @@ begin end; end; +procedure TfpgBaseTextEdit.SetRightEdge(const AValue: Boolean); +begin + if FRightEdge <> AValue then + begin + FRightEdge := AValue; + Invalidate; + end; +end; + +procedure TfpgBaseTextEdit.SetRightEdgeCol(const AValue: Integer); +var + v: Integer; +begin + v := AValue; + if v < 20 then v := 20; + if v > 160 then v := 160; + if FRightEdgeCol <> v then + begin + FRightEdgeCol := v; + if FRightEdge then + Invalidate; + end; +end; + +procedure TfpgBaseTextEdit.HandleShow; +begin + inherited HandleShow; + HandleResize(Width, Height); +end; + +procedure TfpgBaseTextEdit.HandleResize(AWidth, AHeight: TfpgCoord); +begin + inherited HandleResize(AWidth, AHeight); + if HasHandle then + begin + UpdateCharBounds; + UpdateScrollBars; + UpdateGutterCoords; + end; +end; + procedure TfpgBaseTextEdit.HandlePaint; begin // inherited HandlePaint; - UpdateCharBounds; // normal house keeping Canvas.ClearClipRect; Canvas.Clear(clBoxColor); @@ -899,8 +1109,6 @@ begin Canvas.SetClipRect(GetClientRect); // do the actual drawing - UpdateScrollBarCoords; - UpdateGutterCoords; DrawVisible; DrawCaret(CaretPos.X, CaretPos.Y); Canvas.ClearClipRect; @@ -1009,8 +1217,6 @@ var X: Integer; CaretScroll: Boolean; begin - writeln('>> TfpgBaseTextEdit.HandleKeyPress: keycode:', keycode); - writeln(' CaretPos X:', CaretPos.X, ' Y:', CaretPos.Y); // inherited HandleKeyPress(keycode, shiftstate, consumed); { Add lines as we go, so we can cursor past EOF. } @@ -1018,6 +1224,7 @@ begin if CaretPos.Y > pred(FLines.Count) then begin FLines.Add(''); + FVScrollBar.Max := FVScrollBar.Max + 1; Exit; //==> end; // if (keycode = keyEscape) or (ssCtrl in ShiftState) then @@ -1103,13 +1310,12 @@ begin else if CaretPos.X < HPos then ScrollPos_H := CaretPos.X; - if CaretPos.Y < FTopLine then + if CaretPos.Y < (FTopLine+1) then ScrollPos_V := CaretPos.Y - else if CaretPos.Y > FTopLine + FVisLines - 2 then + else if CaretPos.Y > (FTopLine + FVisLines - 2) then ScrollPos_V := CaretPos.Y - FVisLines + 2; Invalidate; - writeln('<< TfpgBaseTextEdit.HandleKeyPress'); end; procedure TfpgBaseTextEdit.HandleKeyChar(var AText: TfpgChar; @@ -1128,8 +1334,8 @@ begin SLine := FLines[CaretPos.Y]; { cursor was somewhere in whitespace, so we need to fill up the spaces } - if UTF8Length(SLine) < CaretPos.y + 1 then - for Fill := Length(SLine) to CaretPos.y + 1 do + if UTF8Length(SLine) < CaretPos.X + 1 then + for Fill := Length(SLine) to CaretPos.X + 1 do SLine := SLine + ' '; UTF8Insert(AText, SLine, CaretPos.X + 1); @@ -1155,38 +1361,37 @@ begin Y := 0; cntVis := 1; GetSelBounds(StartNo, EndNo, StartOffs, EndOffs); - for I := FTopLine to FTopLine + FVisLines do - begin - DrawLine(I, Y); - Y := Y + FChrH; - cntVis := cntVis + 1; - if cntVis > FVisLines then - Break; //==> - end; - { todo: implement this } -{ + + // Draw right edge line first, so text can draw over it. if FRightEdge then begin - if not FGutterOpt.Visible then + if not FGutterPan.Visible then begin with Canvas do begin - Pen.Color := FEnvironment.RightEdgeColor; - MoveTo((FRightEdgeCol * FChrW) - (HPos * FChrW), 0); - LineTo((FRightEdgeCol * FChrW) - (HPos * FChrW), ClientHeight); + Canvas.Color := clShadow1; // FEnvironment.RightEdgeColor; + Canvas.DrawLine((FRightEdgeCol * FChrW) - (HPos * FChrW), GetClientRect.Top, (FRightEdgeCol * FChrW) - (HPos * FChrW), GetClientRect.Height); end; end else with Canvas do begin - Pen.Color := FEnvironment.RightEdgeColor; - MoveTo((FRightEdgeCol * FChrW) - (HPos * FChrW) + FGutterPan.Width, 0); - LineTo((FRightEdgeCol * FChrW) - (HPos * FChrW) + FGutterPan.Width, ClientHeight); + Canvas.Color := clShadow1; // FEnvironment.RightEdgeColor; + Canvas.DrawLine((FRightEdgeCol * FChrW) - (HPos * FChrW) + FGutterPan.Width, GetClientRect.Top, (FRightEdgeCol * FChrW) - (HPos * FChrW) + FGutterPan.Width, GetClientRect.Height); end; end; -} + + // Draw lines of text + for I := FTopLine to FTopLine + FVisLines do + begin + DrawLine(I, Y); + Y := Y + FChrH; + cntVis := cntVis + 1; + if cntVis > FVisLines then + Break; //==> + end; end; -procedure TfpgBaseTextEdit.DrawLine(const I, Y: Integer); +procedure TfpgBaseTextEdit.DrawLine(const ALineIndex, Y: Integer); var X: Integer; GSz: Integer; @@ -1203,14 +1408,14 @@ begin else GSz := GetClientRect.Left + 1; // gutter size if no gutter panel - if I < FLines.Count then + if ALineIndex < FLines.Count then begin X := -(HPos * FChrW) + GSz; - FormatLine(I, X, Y); + FormatLine(ALineIndex, X, Y); end; end; -procedure TfpgBaseTextEdit.FormatLine(const I, X, Y: Integer); +procedure TfpgBaseTextEdit.FormatLine(const ALineIndex, X, Y: Integer); var S, CorrectS, SS: TfpgString; TI, Si, Ei, T: Integer; @@ -1219,9 +1424,9 @@ var begin if FLines.Count = 0 then Exit; //==> - if (I < 0) or (I > Pred(FLines.Count)) then + if (ALineIndex < 0) or (ALineIndex > FLines.Count-1) then Exit; //==> - S := FLines[I]; + S := FLines[ALineIndex]; if Pos(#9, S) > 0 then begin CorrectS := ''; @@ -1241,14 +1446,65 @@ begin { start drawing formatted text } R.SetRect(X, Y, UTF8Length(S) * FChrW, FChrH); AllowDraw := True; -// if Assigned(FOnDrawLine) then FOnDrawLine(Self, S, I, LGliph, R, AllowDraw); + { end-user can hook in here to do syntax highlighting and other custom drawing } + if Assigned(FOnDrawLine) then + FOnDrawLine(self, S, ALineIndex, Canvas, R, AllowDraw); { Draw simple text line... } if AllowDraw then + begin Canvas.DrawText(R, S); -// DrawText(LGliph.Canvas.Handle, PChar(S), Length(S), R, DT_DRAWLINE); + end; + if FSelected then + begin + Canvas.TextColor := clWhite; + Canvas.Color := fpgColorToRGB(clSelection); + if (ALineIndex > StartNo) and (ALineIndex < EndNo) then // whole line is selected + begin + R.SetRect(X, Y, UTF8Length(S) * FChrW, FChrH); + Canvas.FillRectangle(R); + Canvas.DrawText(R, S); + end + else + begin + Ei := EndOffs; + Si := StartOffs; + if (ALineIndex = StartNo) and (ALineIndex = EndNo) then // start/end selection on same line + begin + SS := UTF8Copy(S, Si + 1, UTF8Length(S) - Si); + if Ei > UTF8Length(S) then + SS := UTF8Copy(S, Si + 1, UTF8Length(S) - Si) + else + SS := UTF8Copy(S, Si + 1, Ei - Si); + R.SetRect(X+(Si * FChrW), Y, (UTF8Length(SS) * FChrW), FChrH); + Canvas.FillRectangle(R); + Canvas.DrawText(R, SS); + end + else + begin + if (ALineIndex = StartNo) and (ALineIndex < EndNo) then + begin + SS := UTF8Copy(S, Si + 1, UTF8Length(S) - Si); + R.SetRect(X+(Si * FChrW), Y, (UTF8Length(SS) * FChrW), FChrH); + Canvas.FillRectangle(R); + Canvas.DrawText(R, SS); + end + else + begin + if (ALineIndex > StartNo) and (ALineIndex = EndNo) then + begin + if Ei > UTF8Length(S) then + Ei := UTF8Length(S); + SS := UTF8Copy(S, 1, Ei); + R.SetRect(X, Y, (UTF8Length(SS) * FChrW), FChrH); + Canvas.FillRectangle(R); + Canvas.DrawText(R, SS); + end; + end; + end; + end; + end; { if FSelected... } +// end; { if AllowDraw... } - { todo: Do other formatting here. } - { todo: Do selection painting here. } if UTF8Length(S) > FMaxScrollH then begin FMaxScrollH := UTF8Length(S); @@ -1307,29 +1563,31 @@ begin if not FSelected then begin - FSelStartNo := CaretPos.x; - FSelStartOffs := CaretPos.y; + FSelStartNo := CaretPos.Y; + FSelStartOffs := CaretPos.X; end; end; constructor TfpgBaseTextEdit.Create(AOwner: TComponent); begin inherited Create(AOwner); - Focusable := True; - FFont := fpgGetFont('#Edit1'); - Width := 320; - Height := 240; - FLines := TStringList.Create; - CaretPos.x := 0; - CaretPos.y := 0; - FTopLine := 0; - FTabWidth := 8; - FMaxScrollH := 0; - VPos := 0; - HPos := 0; - FTracking := True; - FFullRedraw := False; - FSelected := False; + Focusable := True; + FFont := fpgGetFont('#Edit1'); + Width := 320; + Height := 240; + FLines := TStringList.Create; + CaretPos.x := 0; + CaretPos.y := 0; + FTopLine := 0; + FTabWidth := 8; + FMaxScrollH := 1; + VPos := 0; + HPos := 0; + FTracking := True; + FFullRedraw := False; + FSelected := False; + FRightEdge := False; + FRightEdgeCol := 80; FVScrollBar := TfpgScrollBar.Create(self); FVScrollBar.Orientation := orVertical; @@ -1503,6 +1761,7 @@ begin Exit; //==> Clear; FLines.LoadFromFile(AFileName); + HandleResize(Width, Height); Invalidate; end; diff --git a/src/VERSION_FILE.inc b/src/VERSION_FILE.inc new file mode 100644 index 00000000..14e23a39 --- /dev/null +++ b/src/VERSION_FILE.inc @@ -0,0 +1 @@ +FPGUI_VERSION = '0.7'; diff --git a/src/build_204.sh b/src/build_204.sh deleted file mode 100755 index d1b96860..00000000 --- a/src/build_204.sh +++ /dev/null @@ -1,2 +0,0 @@ -fpc @extrafpc.cfg corelib/x11/fpgui_toolkit.pas -OG -O2 -dX11 - diff --git a/src/buildcrosslinux32.sh b/src/buildcrosslinux32.sh new file mode 100755 index 00000000..1c900532 --- /dev/null +++ b/src/buildcrosslinux32.sh @@ -0,0 +1,51 @@ +#!/bin/bash +########################################################################### +# NOTE: +# Cross compiling is from Linux 64-bit to Linux 32-bit only. +# +# This is really only for my testing purposes so I can quickly test +# other platforms and targets +# +########################################################################### + +CROSSFPC=/opt/fpc_2.4.1/i386-linux/bin/fpc + +#fpctarget=`$CROSSFPC -iTP`-`fpc -iTO` +#echo $fpctarget + +#libpath='../lib/'$fpctarget +unitpath='../lib/i386-linux' +# Must we create the output directory? +if [ ! -d $unitpath ]; then + echo 'creating directory: '$unitpath + mkdir $unitpath + echo ' ' +fi +# compile fpGUI Toolkit itself +echo 'compiling fpGUI Toolkit library' +$CROSSFPC -Tlinux -Pi386 -dRELEASE -dX11 @extrafpc.cfg corelib/x11/fpgui_toolkit.pas +echo ' ' + +unitpath='../docview/src/units/i386-linux' +# Must we create the output directory for DocView? +if [ ! -d $unitpath ]; then + echo 'creating directory: '$unitpath + mkdir $unitpath + echo ' ' +fi +# compile the DocView (documentation viewer) application +echo 'compiling DocView' +$CROSSFPC -Tlinux -Pi386 -dRELEASE -dX11 @extrafpc.cfg -Fu../docview/components/richtext/ -FE$unitpath ../docview/src/docview.lpr +echo ' ' + +unitpath='../uidesigner/units/i386-linux' +# Must we create the output directory for DocView? +if [ ! -d $unitpath ]; then + echo 'creating directory: '$unitpath + mkdir $unitpath + echo ' ' +fi +# compile the UI Designer (visual form designer) application +echo 'compiling UIDesigner' +$CROSSFPC -Tlinux -Pi386 -dRELEASE -dX11 @extrafpc.cfg -FE$unitpath ../uidesigner/uidesigner.lpr +echo ' ' diff --git a/src/buildcrosswin32.sh b/src/buildcrosswin32.sh new file mode 100755 index 00000000..82189dfe --- /dev/null +++ b/src/buildcrosswin32.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# NOTE: Cross compiling is from Linux to Windows 32-bit only + +CROSSFPC=/opt/fpc_2.3.1/i386-win32/lib/fpc/2.3.1/ppcross386 + +#fpctarget=`$CROSSFPC -iTP`-`fpc -iTO` +#echo $fpctarget + +#libpath='../lib/'$fpctarget +libpath='../lib/i386-win32' + +# Must we create the output directory? +if [ ! -d $libpath ]; then + echo 'creating directory: '$libpath + mkdir $libpath + echo ' ' +fi + +$CROSSFPC -Twin32 dRELEASE -dGDI @extrafpc.cfg corelib/gdi/fpgui_toolkit.pas diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 020f9943..199004ba 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -32,7 +32,6 @@ type TfpgColor = type longword; // Always in RRGGBB (Alpha, Red, Green, Blue) format!! TfpgString = type string; TfpgChar = type string[4]; - TfpgModalResult = Low(integer)..High(integer); PPoint = ^TPoint; @@ -41,6 +40,14 @@ type Green: word; Blue: word; Alpha: word; + end deprecated; + + // Same declaration as in FPImage unit, but we don't use FPImage yet, so declare it here + TFPColor = record + Red: word; + Green: word; + Blue: word; + Alpha: word; end; TWindowType = (wtChild, wtWindow, wtModalForm, wtPopup); @@ -59,6 +66,10 @@ type TClipboardKeyType = (ckNone, ckCopy, ckPaste, ckCut); + // If you have to convert this to an Integer, mrNone = 0 etc. + TfpgModalResult = (mrNone, mrOK, mrCancel, mrYes, mrNo, mrAbort, mrRetry, + mrIgnore, mrAll, mrNoToAll, mrYesToAll); + const MOUSE_LEFT = 1; MOUSE_RIGHT = 3; @@ -83,25 +94,13 @@ const FPGM_MOVE = 16; FPGM_POPUPCLOSE = 17; FPGM_HINTTIMER = 18; + FPGM_FREEME = 19; FPGM_USER = 50000; - FPGM_KILLME = High(Integer); + FPGM_KILLME = MaxInt; // The special keys, based on the well-known keyboard scan codes {$I keys.inc} - { TfpgModalResult values } - mrNone = 0; - mrOk = mrNone + 1; - mrCancel = mrOk + 1; - mrYes = mrCancel + 1; - mrNo = mrYes + 1; - mrAbort = mrNo + 1; - mrRetry = mrAbort + 1; - mrIgnore = mrRetry + 1; - mrAll = mrIgnore + 1; - mrNoToAll = mrAll + 1; - mrYesToAll = mrNoToAll + 1; - { Default fpGUI help viewer } FPG_HELPVIEWER = 'docview'; @@ -190,17 +189,19 @@ type FImageDataSize: integer; FMaskData: pointer; FMaskDataSize: integer; + FMaskPoint: TPoint; procedure DoFreeImage; virtual; abstract; procedure DoInitImage(acolordepth, awidth, aheight: integer; aimgdata: Pointer); virtual; abstract; procedure DoInitImageMask(awidth, aheight: integer; aimgdata: Pointer); virtual; abstract; public constructor Create; destructor Destroy; override; - procedure Invert; + procedure Invert(IncludeMask: Boolean = False); procedure FreeImage; procedure AllocateImage(acolordepth, awidth, aheight: integer); procedure AllocateMask; procedure CreateMaskFromSample(x, y: TfpgCoord); + { Must always be called AFTER you populated the ImageData array. Then only does it allocate OS resources. } procedure UpdateImage; property ImageData: pointer read FImageData; property ImageDataSize: integer read FImageDataSize; @@ -210,6 +211,7 @@ type property Height: integer read FHeight; property ColorDepth: integer read FColorDepth; property Masked: boolean read FMasked; + property MaskPoint: TPoint read FMaskPoint; property Colors[x, y: TfpgCoord]: TfpgColor read GetColor write SetColor; end; @@ -227,6 +229,7 @@ type protected FFontDesc: string; FFontRes: TfpgFontResourceBase; + function GetIsFixedWidth: boolean; virtual; public function TextWidth(const txt: string): integer; function Ascent: integer; @@ -235,6 +238,7 @@ type property FontDesc: string read FFontDesc; property FontRes: TfpgFontResourceBase read FFontRes; property Handle: TfpgFontResourceBase read FFontRes; + property IsFixedWidth: boolean read GetIsFixedWidth; end; @@ -370,8 +374,19 @@ type TfpgComponent = class(TComponent) private FTagPointer: Pointer; + FHelpContext: THelpContext; + FHelpKeyword: TfpgString; + FHelpType: THelpType; + protected + procedure SetHelpContext(const AValue: THelpContext); virtual; + procedure SetHelpKeyword(const AValue: TfpgString); virtual; public + constructor Create(AOwner: TComponent); override; property TagPointer: Pointer read FTagPointer write FTagPointer; + published + property HelpContext: THelpContext read FHelpContext write SetHelpContext default 0; + property HelpKeyword: TfpgString read FHelpKeyword write SetHelpKeyword; + property HelpType: THelpType read FHelpType write FHelpType default htKeyword; end; @@ -400,6 +415,7 @@ type FCanvas: TfpgCanvasBase; FSizeIsDirty: Boolean; FPosIsDirty: Boolean; + FMouseCursorIsDirty: Boolean; function HandleIsValid: boolean; virtual; abstract; procedure DoUpdateWindowPosition; virtual; abstract; procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); virtual; abstract; @@ -458,16 +474,11 @@ type end; - { TfpgApplicationBase } - - TfpgApplicationBase = class(TComponent) + TfpgApplicationBase = class(TfpgComponent) private FMainForm: TfpgWindowBase; FTerminated: boolean; FCritSect: TCriticalSection; - FHelpType: THelpType; - FHelpContext: THelpContext; - FHelpWord: TfpgString; FHelpKey: word; FHelpFile: TfpgString; function GetForm(Index: Integer): TfpgWindowBase; @@ -498,15 +509,13 @@ type procedure Lock; procedure Unlock; procedure InvokeHelp; - function ContextHelp(const HelpContext: THelpContext): Boolean; - function KeywordHelp(const HelpKeyword: string): Boolean; + function ContextHelp(const AHelpContext: THelpContext): Boolean; + function KeywordHelp(const AHelpKeyword: string): Boolean; property FormCount: integer read GetFormCount; property Forms[Index: Integer]: TfpgWindowBase read GetForm; - property HelpContext: THelpContext read FHelpContext write FHelpContext; + property HelpContext; property HelpFile: TfpgString read GetHelpFile write FHelpFile; property HelpKey: word read FHelpKey write FHelpKey default keyF1; - property HelpType: THelpType read FHelpType write FHelpType default htContext; - property HelpWord: TfpgString read FHelpWord write FHelpWord; property IsInitialized: boolean read FIsInitialized; property TopModalForm: TfpgWindowBase read GetTopModalForm; property MainForm: TfpgWindowBase read FMainForm write FMainForm; @@ -602,8 +611,10 @@ function KeycodeToText(AKey: Word; AShiftState: TShiftState): string; function CheckClipboardKey(AKey: Word; AShiftstate: TShiftState): TClipboardKeyType; { Color } -function fpgColorToRGBTriple(const AColor: TfpgColor): TRGBTriple; -function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; +function fpgColorToRGBTriple(const AColor: TfpgColor): TRGBTriple; deprecated; +function fpgColorToFPColor(const AColor: TfpgColor): TFPColor; +function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; deprecated; +function FPColorTofpgColor(const AColor: TFPColor): TfpgColor; function fpgGetRed(const AColor: TfpgColor): word; function fpgGetGreen(const AColor: TfpgColor): word; function fpgGetBlue(const AColor: TfpgColor): word; @@ -808,7 +819,7 @@ begin end { if/else } end; -function fpgColorToRGBTriple(const AColor: TfpgColor): TRGBTriple; +function fpgColorToRGBTriple(const AColor: TfpgColor): TRGBTriple; deprecated; begin with Result do begin @@ -819,7 +830,23 @@ begin end end; -function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; +function fpgColorToFPColor(const AColor: TfpgColor): TFPColor; +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; deprecated; +begin + Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16);// or (AColor.Alpha shl 32); +end; + +function FPColorTofpgColor(const AColor: TFPColor): TfpgColor; begin Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16);// or (AColor.Alpha shl 32); end; @@ -862,24 +889,24 @@ end; function fpgGetAvgColor(const AColor1, AColor2: TfpgColor): TfpgColor; var - c1, c2: TRGBTriple; - avg: TRGBTriple; + c1, c2: TFPColor; + avg: TFPColor; begin - c1 := fpgColorToRGBTriple(AColor1); - c2 := fpgColorToRGBTriple(AColor2); + c1 := fpgColorToFPColor(AColor1); + c2 := fpgColorToFPColor(AColor2); avg.Red := c1.Red + (c2.Red - c1.Red) div 2; avg.Green := c1.Green + (c2.Green - c1.Green) div 2; avg.Blue := c1.Blue + (c2.Blue - c1.Blue) div 2; avg.Alpha := c1.Alpha + (c2.Alpha - c1.Alpha) div 2; - Result := RGBTripleTofpgColor(avg); + Result := FPColorTofpgColor(avg); end; function PtInRect(const ARect: TfpgRect; const APoint: TPoint): Boolean; begin Result := (APoint.x >= ARect.Left) and (APoint.y >= ARect.Top) and - (APoint.x < ARect.Right) and - (APoint.y < ARect.Bottom); + (APoint.x <= ARect.Right) and + (APoint.y <= ARect.Bottom); end; procedure SortRect(var ARect: TRect); @@ -1021,6 +1048,8 @@ end; procedure TfpgWindowBase.AllocateWindowHandle; begin DoAllocateWindowHandle(FParent); + if FMouseCursorIsDirty then + DoSetMouseCursor; end; procedure TfpgWindowBase.ReleaseWindowHandle; @@ -1116,6 +1145,7 @@ constructor TfpgWindowBase.Create(AOwner: TComponent); begin inherited Create(AOwner); FMouseCursor := mcDefault; + FMouseCursorIsDirty := False; FPosIsDirty := True; FSizeIsDirty := True; FMaxWidth := 0; @@ -1454,15 +1484,15 @@ end; procedure TfpgCanvasBase.GradientFill(ARect: TfpgRect; AStart, AStop: TfpgColor; ADirection: TGradientDirection); var - RGBStart: TRGBTriple; - RGBStop: TRGBTriple; + RGBStart: TFPColor; + RGBStop: TFPColor; RDiff, GDiff, BDiff: Integer; count: Integer; i: Integer; - newcolor: TRGBTriple; + newcolor: TFPColor; begin - RGBStart := fpgColorToRGBTriple(fpgColorToRGB(AStart)); - RGBStop := fpgColorToRGBTriple(fpgColorToRGB(AStop)); + RGBStart := fpgColorToFPColor(fpgColorToRGB(AStart)); + RGBStop := fpgColorToFPColor(fpgColorToRGB(AStop)); if ADirection = gdVertical then count := ARect.Bottom - ARect.Top @@ -1479,7 +1509,7 @@ begin newcolor.Red := RGBStart.Red + (i * RDiff) div count; newcolor.Green := RGBStart.Green + (i * GDiff) div count; newcolor.Blue := RGBStart.Blue + (i * BDiff) div count; - SetColor(RGBTripleTofpgColor(newcolor)); + SetColor(FPColorTofpgColor(newcolor)); // We have to overshoot by 1 pixel as DrawLine paints 1 pixel short (by design) if ADirection = gdHorizontal then @@ -1558,6 +1588,8 @@ end; procedure TfpgCanvasBase.SetFont(AFont: TfpgFontBase); begin + if AFont = nil then + exit; FFont := AFont; DoSetFontRes(AFont.FFontRes); end; @@ -1616,6 +1648,17 @@ end; { TfpgFontBase } +function TfpgFontBase.GetIsFixedWidth: boolean; +begin + // very crude but handy as a fallback option + if (Pos('mono', Lowercase(FFontDesc)) > 0) or + (Pos('courier', Lowercase(FFontDesc)) > 0) or + (Pos('fixed', Lowercase(FFontDesc)) > 0) then + Result := True + else + Result := False; +end; + function TfpgFontBase.TextWidth(const txt: string): integer; begin if Length(txt) = 0 then @@ -1675,7 +1718,7 @@ var contributions: array[0..10] of TfpgInterpolationContribution; dif, w, gamma, a: double; c: TfpgColor; - rgb: TRGBTriple; + rgb: TFPColor; begin for x := 0 to Width - 1 do begin @@ -1719,7 +1762,7 @@ begin with contributions[r] do begin c := image.colors[place, y]; - rgb := fpgColorToRGBTriple(c); + rgb := fpgColorToFPColor(c); a := weight; // * rgb.Alpha / $FFFF; re := re + a * rgb.Red; gr := gr + a * rgb.Green; @@ -1733,7 +1776,7 @@ begin blue := ColorRound(bl); // alpha := ColorRound(gamma * $FFFF); end; - tempimage.colors[x, y] := RGBTripleTofpgColor(rgb); + tempimage.colors[x, y] := FPColorTofpgColor(rgb); end; end; end; @@ -1746,7 +1789,7 @@ var contributions: array[0..10] of TfpgInterpolationContribution; dif, w, gamma, a: double; c: TfpgColor; - rgb: TRGBTriple; + rgb: TFPColor; begin for y := 0 to Height - 1 do begin @@ -1790,7 +1833,7 @@ begin with contributions[r] do begin c := tempimage.colors[x, place]; - rgb := fpgColorToRGBTriple(c); + rgb := fpgColorToFPColor(c); a := weight;// * rgb.alpha / $FFFF; re := re + a * rgb.red; gr := gr + a * rgb.green; @@ -1804,7 +1847,7 @@ begin blue := ColorRound(bl); // alpha := ColorRound(gamma * $FFFF); end; - Canvas.Pixels[x + dx, y + dy] := RGBTripleTofpgColor(rgb); + Canvas.Pixels[x + dx, y + dy] := FPColorTofpgColor(rgb); end; end; end; @@ -1886,7 +1929,7 @@ var begin p := FImageData; Inc(p, (FWidth * y) + x); - p^ := longword(AValue); + p^ := AValue; // write(IntToHex(AValue, 6) + ' '); end; @@ -1901,6 +1944,7 @@ begin FMaskData := nil; FMaskDataSize := 0; FMasked := False; + FMaskPoint := Point(0, 0); end; destructor TfpgImageBase.Destroy; @@ -1909,7 +1953,7 @@ begin inherited Destroy; end; -procedure TfpgImageBase.Invert; +procedure TfpgImageBase.Invert(IncludeMask: Boolean); var p: ^byte; n: integer; @@ -1924,13 +1968,16 @@ begin Inc(p); end; - if FMaskData <> nil then + if IncludeMask then begin - p := FMaskData; - for n := 1 to FMaskDataSize do + if FMaskData <> nil then begin - p^ := p^ xor $FF; - Inc(p); + p := FMaskData; + for n := 1 to FMaskDataSize do + begin + p^ := p^ xor $FF; + Inc(p); + end; end; end; end; @@ -2006,6 +2053,7 @@ begin Exit; //==> AllocateMask; + FMaskPoint := Point(x, y); p := FImageData; if x < 0 then @@ -2196,21 +2244,27 @@ end; procedure TfpgApplicationBase.InvokeHelp; begin + { TODO -oGraeme -cHelp System : We should probably try ActiveForm and ActiveWidget help first. } if HelpType = htKeyword then - KeywordHelp(HelpWord) + KeywordHelp(HelpKeyword) else ContextHelp(HelpContext); end; -function TfpgApplicationBase.ContextHelp(const HelpContext: THelpContext): Boolean; +function TfpgApplicationBase.ContextHelp(const AHelpContext: THelpContext): Boolean; var p: TProcess; begin - { TODO -oGraeme : Support HelpContext in docview } p := TProcess.Create(nil); try if fpgFileExists(HelpFile) then - p.CommandLine := GetHelpViewer + ' ' + HelpFile + begin + if AHelpContext = 0 then + p.CommandLine := GetHelpViewer + ' ' + HelpFile + else + p.CommandLine := GetHelpViewer + ' ' + HelpFile + ' -n ' + IntToStr(AHelpContext); +//writeln('DEBUG: TfpgApplicationBase.ContextHelp > ', p.CommandLine); + end else p.CommandLine := GetHelpViewer; p.Execute; @@ -2219,15 +2273,17 @@ begin end; end; -function TfpgApplicationBase.KeywordHelp(const HelpKeyword: string): Boolean; +function TfpgApplicationBase.KeywordHelp(const AHelpKeyword: string): Boolean; var p: TProcess; begin - { TODO -oGraeme : Support HelpKeyword in docview } p := TProcess.Create(nil); try if fpgFileExists(HelpFile) then - p.CommandLine := GetHelpViewer + ' ' + HelpFile + begin + p.CommandLine := GetHelpViewer + ' ' + HelpFile + ' -s ' + AHelpKeyword; +//writeln('DEBUG: TfpgApplicationBase.ContextHelp > ', p.CommandLine); + end else p.CommandLine := GetHelpViewer; p.Execute; @@ -2546,5 +2602,33 @@ begin FEntries := newl; end; +{ TfpgComponent } + +procedure TfpgComponent.SetHelpContext(const AValue: THelpContext); +begin + if not (csLoading in ComponentState) then + FHelpType := htContext; + if FHelpContext = AValue then + Exit; //==> + FHelpContext := AValue; +end; + +procedure TfpgComponent.SetHelpKeyword(const AValue: TfpgString); +begin + if not (csLoading in ComponentState) then + FHelpType := htKeyword; + if FHelpKeyword = AValue then + Exit; //==> + FHelpKeyword := AValue; +end; + +constructor TfpgComponent.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FHelpType := htKeyword; + FHelpContext := 0; + FTagPointer := nil; +end; + end. diff --git a/src/corelib/fpg_cmdlineparams.pas b/src/corelib/fpg_cmdlineparams.pas index 10ed9740..07f40c1e 100644 --- a/src/corelib/fpg_cmdlineparams.pas +++ b/src/corelib/fpg_cmdlineparams.pas @@ -1,9 +1,9 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit Unit to handle command line processing - Copyright (C) 2007 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2007 - 2010 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/corelib/fpg_constants.pas b/src/corelib/fpg_constants.pas index 7c4af9b0..d93e5208 100644 --- a/src/corelib/fpg_constants.pas +++ b/src/corelib/fpg_constants.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_extgraphics.pas b/src/corelib/fpg_extgraphics.pas index f0ff7417..f0e4d3d2 100644 --- a/src/corelib/fpg_extgraphics.pas +++ b/src/corelib/fpg_extgraphics.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_extinterpolation.pas b/src/corelib/fpg_extinterpolation.pas index c27b18c9..b08f5817 100644 --- a/src/corelib/fpg_extinterpolation.pas +++ b/src/corelib/fpg_extinterpolation.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_imagelist.pas b/src/corelib/fpg_imagelist.pas index 1150211a..20d34e35 100644 --- a/src/corelib/fpg_imagelist.pas +++ b/src/corelib/fpg_imagelist.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -72,6 +72,7 @@ type procedure AddImage(AImage: TfpgImage; AIndex: integer = -1); procedure RemoveIndex(AIndex: integer); function GetMaxItem: integer; + procedure Clear; property Item[AIndex: integer]: TfpgImageItem read GetItem write SetItem; property Count: integer read GetCount; end; @@ -208,6 +209,11 @@ begin result := TfpgImageItem(FList[i]).Index; end; +procedure TfpgImageList.Clear; +begin + FList.Clear; +end; + { TfpgImageItem } procedure TfpgImageItem.SetImageList(AImageList: TfpgImageList); @@ -276,7 +282,7 @@ end; destructor TfpgImageItem.Destroy; begin if FImage <> nil then - FImage.Destroy; + FImage.Free; inherited Destroy; end; diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas index 11298453..48b25d5b 100644 --- a/src/corelib/fpg_imgfmt_bmp.pas +++ b/src/corelib/fpg_imgfmt_bmp.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -183,13 +183,11 @@ begin pixelcnt := 0; while (p) < (pdata) do begin - pcol^ := Plongword(p)^; - //Writeln('color: ',HexStr(pcol^,8)); + pcol^ := (LongWord(p[3]) shl 24) + (LongWord(p[2]) shl 16) + (LongWord(p[1]) shl 8) + LongWord(p[0]); Inc(pcol); - Inc(Plongword(p)); + inc(p, 4); Inc(pixelcnt); end; - //writeln(pixelcnt,' colors loaded.'); end; pdest := img.ImageData; @@ -219,7 +217,7 @@ begin //Writeln(linecnt,' lines loaded.'); move(img.ImageData^, img.MaskData^, img.ImageDataSize); - img.Invert; + img.Invert(True); end; 4: diff --git a/src/corelib/fpg_imgfmt_jpg.pas b/src/corelib/fpg_imgfmt_jpg.pas new file mode 100644 index 00000000..1a7fce23 --- /dev/null +++ b/src/corelib/fpg_imgfmt_jpg.pas @@ -0,0 +1,382 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + JPEG format image parser +} + + +unit fpg_imgfmt_jpg; + +{$mode objfpc}{$H+} + + +interface + +uses + Classes, + SysUtils, + fpg_main, + fpg_base, + fpg_dialogs; + +type + EJPEG = class(Exception); + +procedure ReadImage_JPG(img: TfpgImage; bmp: TStream; const AScale: integer = 1); +function LoadImage_JPG(const AFileName: String; const AScale: integer = 1): TfpgImage; + +implementation +uses + {PASJPG10 library} + jmorecfg, + jpeglib, + jerror, + jdeferr, + jdmarker, + jdmaster, + jdapimin, + jdapistd; + +type + + my_src_ptr = ^my_source_mgr; + my_source_mgr = record + pub : jpeg_source_mgr; {public fields} + infile : TStream; {source stream} + buffer : JOCTET_FIELD_PTR; {start of buffer} + start_of_file : boolean; {have we gotten any data yet?} + end; + +// my_error_ptr = ^my_error_mgr; + my_error_mgr = record + pub: jpeg_error_mgr; + end; + + bmp_dest_ptr = ^bmp_dest_struct; + bmp_dest_struct = record + {image info} + data_width : JDIMENSION; {JSAMPLEs per row} + row_width : JDIMENSION; {physical width of one row in the BMP file} + pad_bytes : INT; {number of padding bytes needed per row} + grayscale : boolean; {grayscale or quantized color table ?} + {pixelrow buffer} + buffer : JSAMPARRAY; {pixelrow buffer} + buffer_height : JDIMENSION; {normally, we'll use 1} + cur_output_row : JDIMENSION; {next row# to write to virtual array} + end; + + + +const + INPUT_BUF_SIZE = 4096; + +procedure init_source(cinfo : j_decompress_ptr); +var + src : my_src_ptr; +begin + src := my_src_ptr(cinfo^.src); + src^.start_of_file := TRUE; +end; + +function fill_input_buffer(cinfo : j_decompress_ptr) : boolean; +var + src : my_src_ptr; + nbytes : size_t; +begin + src := my_src_ptr(cinfo^.src); + nbytes := src^.infile.Read(src^.buffer^, INPUT_BUF_SIZE); + if (nbytes <= 0) then begin + if (src^.start_of_file) then {Treat empty input file as fatal error} + ERREXIT(j_common_ptr(cinfo), JERR_INPUT_EMPTY); + WARNMS(j_common_ptr(cinfo), JWRN_JPEG_EOF); + {Insert a fake EOI marker} + src^.buffer^[0] := JOCTET ($FF); + src^.buffer^[1] := JOCTET (JPEG_EOI); + nbytes := 2; + end; + src^.pub.next_input_byte := JOCTETptr(src^.buffer); + src^.pub.bytes_in_buffer := nbytes; + src^.start_of_file := FALSE; + fill_input_buffer := TRUE; +end; + +procedure skip_input_data(cinfo : j_decompress_ptr; + num_bytes : long); +var + src : my_src_ptr; +begin + src := my_src_ptr (cinfo^.src); + if (num_bytes > 0) then begin + while (num_bytes > long(src^.pub.bytes_in_buffer)) do begin + Dec(num_bytes, long(src^.pub.bytes_in_buffer)); + fill_input_buffer(cinfo); + { note we assume that fill_input_buffer will never return FALSE, + so suspension need not be handled. } + end; + Inc( src^.pub.next_input_byte, size_t(num_bytes) ); + Dec( src^.pub.bytes_in_buffer, size_t(num_bytes) ); + end; +end; + +procedure term_source(cinfo : j_decompress_ptr); +begin + { no work necessary here } +end; + +procedure jpeg_stream_src(cinfo : j_decompress_ptr; const infile: TStream); +var + src : my_src_ptr; +begin + if (cinfo^.src = nil) then begin {first time for this JPEG object?} + + cinfo^.src := jpeg_source_mgr_ptr( + cinfo^.mem^.alloc_small (j_common_ptr(cinfo), JPOOL_PERMANENT, + SIZEOF(my_source_mgr)) ); + src := my_src_ptr (cinfo^.src); + src^.buffer := JOCTET_FIELD_PTR( + cinfo^.mem^.alloc_small (j_common_ptr(cinfo), JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)) ); + end; + src := my_src_ptr (cinfo^.src); + {override pub's method pointers} + src^.pub.init_source := @init_source; + src^.pub.fill_input_buffer := @fill_input_buffer; + src^.pub.skip_input_data := @skip_input_data; + src^.pub.resync_to_restart := @jpeg_resync_to_restart; {use default method} + src^.pub.term_source := @term_source; + {define our fields} + src^.infile := infile; + src^.pub.bytes_in_buffer := 0; {forces fill_input_buffer on first read} + src^.pub.next_input_byte := nil; {until buffer loaded} +end; + +procedure error_exit (cinfo : j_common_ptr); +var + buffer : string; +begin + buffer := ''; + cinfo^.err^.format_message(cinfo, buffer); + raise EJPEG.Create(buffer); +end; + +procedure emit_message (cinfo : j_common_ptr; msg_level : int); +var + err : jpeg_error_mgr_ptr; +begin + err := cinfo^.err; + if (msg_level < 0) then begin + {It's a warning message. Since corrupt files may generate many warnings,} + {the policy implemented here is to show only the first warning,} + {unless trace_level >= 3} + if (err^.num_warnings = 0) or (err^.trace_level >= 3) then + err^.output_message(cinfo); + {Always count warnings in num_warnings} + Inc( err^.num_warnings ); + end else + {It's a trace message. Show it if trace_level >= msg_level} + if (err^.trace_level >= msg_level) then + err^.output_message (cinfo); +end; + +procedure output_message (cinfo : j_common_ptr); +var + buffer : string; +begin + buffer := ''; + cinfo^.err^.format_message (cinfo, buffer); + {message dialog} + ShowMessage(buffer); +end; + +procedure format_message (cinfo : j_common_ptr; var buffer : string); +begin + buffer := 'JPEG ERROR -- #' + IntToStr(cinfo^.err^.msg_code); +end; + +procedure reset_error_mgr (cinfo : j_common_ptr); +begin + cinfo^.err^.num_warnings := 0; + {trace_level is not reset since it is an application-supplied parameter} + cinfo^.err^.msg_code := 0; {may be useful as a flag for "no error"} +end; + +function jpeg_my_error (var err : my_error_mgr) : jpeg_error_mgr_ptr; +begin + {methods} + err.pub.error_exit := @error_exit; + err.pub.emit_message := @emit_message; + err.pub.output_message := @output_message; + err.pub.format_message := @format_message; + err.pub.reset_error_mgr := @reset_error_mgr; + {fields} + err.pub.trace_level := 0; {default := no tracing} + err.pub.num_warnings := 0; {no warnings emitted yet} + err.pub.msg_code := 0; {may be useful as a flag for "no error"} + {message table(s)} + err.pub.jpeg_message_table := nil; {we don't want to use a static table} + err.pub.last_jpeg_message := pred(JMSG_LASTMSGCODE); + err.pub.addon_message_table := nil; + err.pub.first_addon_message := JMSG_NOMESSAGE; {for safety} + err.pub.last_addon_message := JMSG_NOMESSAGE; + {return result} + jpeg_my_error := @err; +end; + +function jinit_write_bmp (cinfo : j_decompress_ptr) : bmp_dest_ptr; +var + dest : bmp_dest_ptr; +begin + dest := bmp_dest_ptr ( + cinfo^.mem^.alloc_small (j_common_ptr(cinfo), JPOOL_IMAGE, + SIZEOF(bmp_dest_struct)) ); + jpeg_calc_output_dimensions(cinfo); + dest^.data_width := cinfo^.output_width * cinfo^.output_components; + dest^.row_width := dest^.data_width; + while ((dest^.row_width and 3) <> 0) do + Inc(dest^.row_width); + dest^.pad_bytes := int(dest^.row_width-dest^.data_width); + if (cinfo^.out_color_space = JCS_GRAYSCALE) then + dest^.grayscale := True + else if (cinfo^.out_color_space = JCS_RGB) then + if (cinfo^.quantize_colors) then + dest^.grayscale := True + else + dest^.grayscale := False + else + ERREXIT(j_common_ptr(cinfo), JERR_BMP_COLORSPACE); + {decompress buffer} + dest^.buffer := cinfo^.mem^.alloc_sarray + (j_common_ptr(cinfo), JPOOL_IMAGE, dest^.row_width, JDIMENSION (1)); + dest^.buffer_height := 1; + dest^.cur_output_row := 0; + {result} + jinit_write_bmp := dest; +end; + +procedure write_jpeg_pixelrow (cinfo : j_decompress_ptr; + dest : bmp_dest_ptr; + rows_supplied : JDIMENSION; + img : TfpgImage); +var + inptr: JSAMPLE_PTR; + col : JDIMENSION; + // pad : int; + NewBGR: TFPColor; + PDest: PLongWord; +begin + inptr := JSAMPLE_PTR(dest^.buffer^[0]); + + PDest:= img.ImageData; + inc(PDest, img.Width *rows_supplied); + if not dest^.grayscale then + begin + for col := pred(cinfo^.output_width) downto 0 do + begin + fillchar(NewBGR,sizeof(NewBGR),0); + NewBGR.Red:=inptr^; + Inc(inptr); + NewBGR.Green:=inptr^; + Inc(inptr); + NewBGR.Blue:=inptr^; + Inc(inptr); + PDest^ := FPColorTofpgColor(NewBGR); + inc(PDest); + end; + end + else + begin + for col := pred(cinfo^.output_width) downto 0 do + begin + NewBGR.Red:=inptr^; + NewBGR.Green:=inptr^; + NewBGR.Blue:=inptr^; + NewBGR.Alpha:=inptr^; + Inc(inptr); + PDest^ := FPColorTofpgColor(NewBGR); + inc(PDest); + end; + end; +end; + + +procedure ReadImage_JPG(img: TfpgImage; bmp: TStream; const AScale: integer); +var + cinfo : jpeg_decompress_struct; + err : my_error_mgr; + dest : bmp_dest_ptr; +begin + if img = nil then + Exit; //==> + + img.FreeImage; + {initialize the JPEG decompression object with default error handling.} + cinfo.err := jpeg_my_error(err); + jpeg_create_decompress(@cinfo); + try + {specify the source of the compressed data} + jpeg_stream_src(@cinfo, bmp); + {obtain image info from header, set default decompression parameters} + jpeg_read_header(@cinfo, TRUE); + + cinfo.scale_num := 1; + case AScale of + 1: cinfo.scale_denom := 1; // full size + 2: cinfo.scale_denom := 2; // 1/2 size + 3: cinfo.scale_denom := 4; // 1/4 size + 4: cinfo.scale_denom := 8; // 1/8 size + else + cinfo.scale_denom := 1; // defaults to full size + end; + + dest := jinit_write_bmp(@cinfo); + + img.AllocateImage(32, (cinfo.image_width + (cinfo.scale_denom-1)) div cinfo.scale_denom , + (cinfo.image_height+ (cinfo.scale_denom-1)) div cinfo.scale_denom); // color image + {prepare for decompression, initialize internal state} + jpeg_start_decompress(@cinfo) ; + {process data} + while (cinfo.output_scanline < cinfo.output_height) do + begin + jpeg_read_scanlines(@cinfo, dest^.buffer, dest^.buffer_height); + write_jpeg_pixelrow(@cinfo, dest,cinfo.output_scanline-1,img); + end; + {finish} + jpeg_finish_decompress(@cinfo); + finally + {destroy} + jpeg_destroy_decompress(@cinfo); + end; + img.UpdateImage; +end; + +function LoadImage_JPG(const AFileName: String; const AScale: integer): TfpgImage; +var + inFile: TStream; +begin + Result := nil; + if not FileExists(AFileName) then + Exit; //==> + + inFile:=TFileStream.Create(AFileName,fmOpenRead); + try + Result:=TfpgImage.Create; + ReadImage_JPG(Result, inFile, AScale); + finally + inFile.Free; + end; +end; + + +end. + diff --git a/src/corelib/fpg_imgutils.pas b/src/corelib/fpg_imgutils.pas new file mode 100644 index 00000000..afb4d4fe --- /dev/null +++ b/src/corelib/fpg_imgutils.pas @@ -0,0 +1,110 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + Some handly image manipulation functions to use with TfpgImage class. + Included is a gray color conversion matrix. +} + +unit fpg_imgutils; + +{$mode objfpc}{$H+} + +{ TODO : Make the conversion matrix a plugable architecture. Similar to the + interpolation handling in TfpgCanvas. } + +interface + +uses + fpg_base, + fpg_main; + +type + TGrayConvMatrix = record + red: single; + green: single; + blue: single; + end; + +var + GrayConvMatrix: TGrayConvMatrix; + GrayBrightness: Boolean; + GrayBrightnessPercentage: integer; + +const + GCM_NTSC: TGrayConvMatrix = (red:0.299; green:0.587; blue:0.114); // NTSC method + GCM_Mathematical: TGrayConvMatrix = (red:0.334; green:0.333; blue:0.333); // Intensity method + GCM_Photoshop: TGrayConvMatrix = (red:0.212671; green:0.715160; blue:0.072169); // Y of YUV from B/W TV's + + +procedure fpgApplyGreyFilter(var AImg: TfpgImage); +function fpgCalculateGray(const AFrom: TfpgColor; const ABrighter: boolean = False; const APercent: integer = 0): TfpgColor; + + +implementation + + +procedure fpgApplyGreyFilter(var AImg: TfpgImage); +var + x, y: integer; + c: TfpgColor; +begin + for x := 0 to AImg.Width-1 do + begin + for y := 0 to AImg.Height-1 do + begin + c := AImg.Colors[x, y]; + AImg.Colors[x, y] := fpgCalculateGray(c, GrayBrightness, GrayBrightnessPercentage); + end; + end; + AImg.UpdateImage; +end; + + +{ AFrom is the original color we want to change + ABrighter = True goes to direction of White. False goes to direction of Black + APercent = 0 zero is straight conversion to gray. 100% is pure black or + white, depending on ABrighter value. } +function fpgCalculateGray(const AFrom: TfpgColor; const ABrighter: boolean = False; const APercent: integer = 0): TfpgColor; +var + g: integer; + rgb: TFPColor; +begin + with GrayConvMatrix do + begin + rgb := fpgColorToFPColor(AFrom); + g := round(red*rgb.red + green*rgb.green + blue*rgb.blue); + + if ABrighter then + g := trunc(255 - ((255 - g) * (100 - APercent) / 100)) + else + g := trunc(g * (100 - APercent) / 100); + + if (g < 0) then g := 0; + if (g > 255) then g := 255; + + rgb.Red := g; + rgb.Green := g; + rgb.Blue := g; + end; + Result := FPColorTofpgColor(rgb); +end; + + +initialization + GrayConvMatrix := GCM_NTSC; + GrayBrightness := True; + GrayBrightnessPercentage := 20; + +end. + diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index e8c26eae..c8023408 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Description: - The main unit trying everything together in corelib. + The main unit that ties everything together from CoreLib. } unit fpg_main; @@ -21,7 +21,6 @@ unit fpg_main; {.$Define DEBUG} -{ TODO : Remove IFDEF in Interface uses clause } { TODO : Implement font size adjustments for each platform. eg: linux=10pt & windows=8pt } interface @@ -29,16 +28,8 @@ interface uses Classes, SysUtils, - fpg_base - // This is the only place we have such IFDEF!!! Is this ok, or must we - // implement it like we have done for the previous version of fpGFX? - {$IFDEF MSWINDOWS} - ,fpg_gdi - {$ENDIF} - {$IFDEF UNIX} - ,fpg_x11 - {$ENDIF} - ; + fpg_base, + fpg_interface; type TOrientation = (orVertical, orHorizontal); @@ -68,8 +59,9 @@ const cMessageQueueSize = 1024; // version and name constants - fpGUIVersion = '0.6.2'; + {$I VERSION_FILE.inc} // this includes the auto generated: fpGUI_Version = xxx fpGUIName = 'fpGUI Toolkit'; + fpGUIWebsite = 'http://opensoft.homeip.net/fpgui/'; const txtWordDelims: set of char = [' ', #9, #13, #10]; @@ -151,6 +143,8 @@ type TfpgImage = class(TfpgImageImpl) public + function CreateDisabledImage: TfpgImage; + function ImageFromSource: TfpgImage; function ImageFromRect(var ARect: TRect): TfpgImage; overload; function ImageFromRect(var ARect: TfpgRect): TfpgImage; overload; end; @@ -232,7 +226,7 @@ type FHintPos: TPoint; procedure SetHintPause(const AValue: Integer); procedure SetupLocalizationStrings; - procedure InternalMsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE; + procedure InternalMsgFreeMe(var msg: TfpgMessageRec); message FPGM_FREEME; procedure InternalMsgHintTimer(var msg: TfpgMessageRec); message FPGM_HINTTIMER; procedure CreateHintWindow; procedure HintTimerFired(Sender: TObject); @@ -253,6 +247,7 @@ type destructor Destroy; override; function GetFont(const afontdesc: string): TfpgFont; procedure ActivateHint(APos: TPoint; AHint: TfpgString); + procedure RecreateHintWindow; procedure Flush; procedure HandleException(Sender: TObject); procedure HideHint; @@ -321,10 +316,12 @@ type TfpgClipboard = class(TfpgClipboardImpl) end; + TfpgFileList = class(TfpgFileListImpl) end; + var fpgStyle: TfpgStyle; { TODO -ograemeg : move this into fpgApplication } fpgCaret: TfpgCaret; { TODO -ograemeg : move this into fpgApplication } @@ -376,6 +373,7 @@ function fpgRectToRect(const ARect: TfpgRect): TRect; procedure PrintRect(const Rect: TRect); procedure PrintRect(const Rect: TfpgRect); procedure PrintCoord(const x, y: TfpgCoord); +procedure PrintCoord(const pt: TPoint); function PrintCallTrace(const AClassName, AMethodName: string): IInterface; procedure PrintCallTraceDbgLn(const AMessage: string); procedure DumpStack; @@ -403,7 +401,8 @@ uses fpg_hint, fpg_extgraphics, fpg_utils, - fpg_cmdlineparams; + fpg_cmdlineparams, + fpg_imgutils; var fpgTimers: TList; @@ -423,6 +422,8 @@ type constructor Create(AFontID, AFontDesc: string); end; + TWidgetFriend = class(TfpgWidget); // so we can get access to the Protected section + constructor TNamedFontItem.Create(AFontID, AFontDesc: string); begin FontID := AFontID; @@ -692,7 +693,7 @@ begin spacing := ''; inc(iCallTrace); for i := 0 to iCallTrace do - spacing := spacing + ' '; + spacing += ' '; FClassName := AClassName; FMethodName := AMethodName; {$IFDEF DEBUG} @@ -708,7 +709,12 @@ begin dec(iCallTrace); inherited Destroy; end; - + +procedure PrintCoord(const pt: TPoint); +begin + PrintCoord(pt.X, pt.Y); +end; + function PrintCallTrace(const AClassName, AMethodName: string): IInterface; begin Result := TPrintCallTrace.Create(AClassName, AMethodName); @@ -721,14 +727,14 @@ var begin s := ''; for i := 0 to iCallTrace+1 do - s := s + ' '; + s += ' '; writeln(s + AMessage); end; procedure DumpStack; -Var - Message : String; - i : longint; +var + lMessage: String; + i: longint; begin writeln(' Stack trace:'); // Dump_Stack(StdOut, get_frame); @@ -736,15 +742,15 @@ begin Writeln(stdout,'An unhandled exception occurred at $',HexStr(Ptrint(ExceptAddr),sizeof(PtrInt)*2),' :'); if ExceptObject is exception then begin - Message:=Exception(ExceptObject).ClassName+' : '+Exception(ExceptObject).Message; - Writeln(stdout,Message); + lMessage := Exception(ExceptObject).ClassName+' : '+Exception(ExceptObject).Message; + Writeln(stdout,lMessage); end else Writeln(stdout,'Exception object ',ExceptObject.ClassName,' is not of class Exception.'); Writeln(stdout,BackTraceStrFunc(ExceptAddr)); if (ExceptFrameCount>0) then begin - for i:=0 to ExceptFrameCount-1 do + for i := 0 to ExceptFrameCount-1 do Writeln(stdout,BackTraceStrFunc(ExceptFrames[i])); end; Writeln(stdout,''); @@ -788,21 +794,21 @@ end; procedure TfpgTimer.SetEnabled(const AValue: boolean); begin if (not FEnabled) and AValue then - FNextAlarm := now + interval * ONE_MILISEC; + FNextAlarm := now + (interval * ONE_MILISEC); FEnabled := AValue; end; procedure TfpgTimer.SetInterval(const AValue: integer); begin FInterval := AValue; - FNextAlarm := now + FInterval * ONE_MILISEC; + FNextAlarm := now + (FInterval * ONE_MILISEC); end; constructor TfpgTimer.Create(ainterval: integer); begin FInterval := ainterval; - OnTimer := nil; - FEnabled := False; + OnTimer := nil; + FEnabled := False; fpgTimers.Add(self); end; @@ -826,7 +832,7 @@ begin // set the next alarm point if interval > 0 then while FNextAlarm <= ctime do - FNextAlarm := FNextAlarm + (interval * ONE_MILISEC); + FNextAlarm += (interval * ONE_MILISEC); if Assigned(FOnTimer) then FOnTimer(self); @@ -971,8 +977,12 @@ begin begin HideHint; FHintWindow.Free; + FHintWindow := nil; end; - + FHintTimer.Enabled := False; + FHintTimer.OnTimer := nil; + FHintTimer.Free; + DestroyComponents; // while message queue is still active for i := 0 to (fpgNamedFonts.Count - 1) do @@ -1066,11 +1076,30 @@ begin h := wnd.Font.Height + (wnd.Border * 2) + (wnd.Margin * 2); { prevents hint from going off the right screen edge } if (APos.X + w) > ScreenWidth then + begin APos.X:= ScreenWidth - w; + // just a few more sanity checks + if APos.X < 0 then + APos.X := 0; + if w > ScreenWidth then + w := ScreenWidth; + end; wnd.SetPosition(APos.X, APos.Y, w, h); + wnd.UpdateWindowPosition; wnd.Show; end; +procedure TfpgApplication.RecreateHintWindow; +begin + if Assigned(FHintWindow) then + begin + HideHint; + FHintWindow.Free; + FHintWindow := nil; + end; + CreateHintWindow; +end; + procedure TfpgApplication.Initialize; begin { TODO : Remember to process parameters!! } @@ -1140,6 +1169,20 @@ begin SetLength(FalseBoolStrs,1); TrueBoolStrs[0] := rsTrue; FalseBoolStrs[0] := rsFalse; + + // Dialog box button captions + cMsgDlgBtnText[mbOK] := rsOK; + cMsgDlgBtnText[mbCancel] := rsCancel; + cMsgDlgBtnText[mbYes] := rsYes; + cMsgDlgBtnText[mbNo] := rsNo; + cMsgDlgBtnText[mbAbort] := rsAbort; + cMsgDlgBtnText[mbRetry] := rsRetry; + cMsgDlgBtnText[mbIgnore] := rsIgnore; + cMsgDlgBtnText[mbAll] := rsAll; + cMsgDlgBtnText[mbNoToAll] := rsNoToAll; + cMsgDlgBtnText[mbYesToAll] := rsYesToAll; + cMsgDlgBtnText[mbHelp] := rsHelp; + cMsgDlgBtnText[mbClose] := rsClose; end; procedure TfpgApplication.SetHintPause(const AValue: Integer); @@ -1148,7 +1191,7 @@ begin FHintTimer.Interval := FHintPause; end; -procedure TfpgApplication.InternalMsgClose(var msg: TfpgMessageRec); +procedure TfpgApplication.InternalMsgFreeMe(var msg: TfpgMessageRec); begin if Assigned(msg.Sender) then begin @@ -1193,13 +1236,17 @@ end; procedure TfpgApplication.HintTimerFired(Sender: TObject); var w: TfpgWidget; + lHint: TfpgString; begin w := nil; -// writeln('HintTimerFired...'); w := TfpgWidget(FHintWidget); try if Assigned(w) then - ActivateHint(w.WindowToScreen(w, FHintPos), w.Hint); + begin +//writeln('fpgApplication.HintTimerFired w = ', w.ClassName, ' - ', w.Name); + TWidgetFriend(w).DoShowHint(lHint); + ActivateHint(w.WindowToScreen(w, FHintPos), lHint); + end; except // silence it! { TODO : FHintWidget probably went out of scope just as timer fired. Try @@ -1235,8 +1282,9 @@ begin fpgStyle := TfpgStyle.Create; fpgCaret := TfpgCaret.Create; fpgImages := TfpgImages.Create; + fpgCreateStandardImages; - + // This will process Application and fpGUI Toolkit translation (*.po) files TranslateResourceStrings(ApplicationName, ExtractFilePath(ParamStr(0)), ''); SetupLocalizationStrings; @@ -1422,7 +1470,7 @@ begin Result := TrimRight(Result) + sLineBreak; end else Inc(lw, tw); - Result := Result + sub; + Result += sub; end; end; @@ -1623,25 +1671,25 @@ begin {$Note Refactor this so under Windows it can detect the system colors instead. Also under Linux (KDE and Gnome) we should be able to detect the system colors.} - fpgSetNamedColor(clWindowBackground, $D4D0C8); + fpgSetNamedColor(clWindowBackground, $D5D2CD); fpgSetNamedColor(clBoxColor, $FFFFFF); - fpgSetNamedColor(clShadow1, $808080); - fpgSetNamedColor(clShadow2, $404040); - fpgSetNamedColor(clHilite1, $E0E0E0); - fpgSetNamedColor(clHilite2, $FFFFFF); + fpgSetNamedColor(clShadow1, $848284); // medium + fpgSetNamedColor(clShadow2, $424142); // dark + fpgSetNamedColor(clHilite1, $E0E0E0); // light + fpgSetNamedColor(clHilite2, $FFFFFF); // white fpgSetNamedColor(clText1, $000000); fpgSetNamedColor(clText2, $000040); fpgSetNamedColor(clText3, $800000); fpgSetNamedColor(clText4, $404000); - fpgSetNamedColor(clSelection, $0A246A); + fpgSetNamedColor(clSelection, $08246A); fpgSetNamedColor(clSelectionText, $FFFFFF); fpgSetNamedColor(clInactiveSel, $D0D0FF); fpgSetNamedColor(clInactiveSelText, $000000); fpgSetNamedColor(clScrollBar, $E8E4DB); - fpgSetNamedColor(clButtonFace, $D4D0C8); + fpgSetNamedColor(clButtonFace, $D5D2CD); fpgSetNamedColor(clListBox, $FFFFFF); fpgSetNamedColor(clGridLines, $A0A0A0); - fpgSetNamedColor(clGridHeader, $D4D0C8); + fpgSetNamedColor(clGridHeader, $D5D2CD); fpgSetNamedColor(clWidgetFrame, $000000); fpgSetNamedColor(clInactiveWgFrame, $A0A0A0); fpgSetNamedColor(clTextCursor, $000000); @@ -1650,6 +1698,10 @@ begin fpgSetNamedColor(clMenuText, $000000); fpgSetNamedColor(clMenuDisabled, $909090); fpgSetNamedColor(clHintWindow, $FFFFBF); + fpgSetNamedColor(clGridSelection, $08246A); // same as clSelection + fpgSetNamedColor(clGridSelectionText, $FFFFFF); // same as clSelectionText + fpgSetNamedColor(clGridInactiveSel, $D0D0FF); // same as clInactiveSel + fpgSetNamedColor(clGridInactiveSelText, $000000); // same as clInactiveSelText // Global Font Objects @@ -1839,7 +1891,7 @@ begin Exit; //==> if not AEnabled then begin - ACanvas.SetTextColor(clHilite1); + ACanvas.SetTextColor(clHilite2); ACanvas.DrawString(x+1, y+1, AText); ACanvas.SetTextColor(clShadow1); end; @@ -2038,17 +2090,38 @@ end; { TfpgImage } +function TfpgImage.CreateDisabledImage: TfpgImage; +begin + Result := ImageFromSource; + fpgApplyGreyFilter(Result); +end; + +function TfpgImage.ImageFromSource: TfpgImage; +var + x, y: TfpgCoord; +begin + Result := TfpgImage.Create; + Result.AllocateImage(ColorDepth, Width, Height); + for x := 0 to Width-1 do + begin + for y := 0 to Height-1 do + begin + Result.Colors[x, y] := Colors[x, y]; + end; + end; + if Masked then + Result.CreateMaskFromSample(MaskPoint.X, MaskPoint.Y); + Result.UpdateImage; +end; + function TfpgImage.ImageFromRect(var ARect: TRect): TfpgImage; var x, y: TfpgCoord; ix, iy: TfpgCoord; begin SortRect(ARect); - Result := TfpgImage.Create; Result.AllocateImage(ColorDepth, ARect.Right-ARect.Left, ARect.Bottom-ARect.Top); - Result.UpdateImage; - iy := -1; for y := ARect.Top to ARect.Bottom-1 do begin @@ -2060,6 +2133,7 @@ begin Result.Colors[ix, iy] := Colors[x, y]; end; end; + Result.UpdateImage; end; function TfpgImage.ImageFromRect(var ARect: TfpgRect): TfpgImage; @@ -2068,11 +2142,8 @@ var ix, iy: TfpgCoord; begin SortRect(ARect); - Result := TfpgImage.Create; Result.AllocateImage(ColorDepth, ARect.Width, ARect.Height); - Result.UpdateImage; - iy := -1; for y := ARect.Top to ARect.Bottom do begin @@ -2084,6 +2155,7 @@ begin Result.Colors[ix, iy] := Colors[x, y]; end; end; + Result.UpdateImage; end; initialization @@ -2097,7 +2169,7 @@ initialization InitializeDebugOutput; fpgInitMsgQueue; -finalization; +finalization uClipboard.Free; uApplication.Free; FinalizeDebugOutput; diff --git a/src/corelib/fpg_msgqueue.inc b/src/corelib/fpg_msgqueue.inc index 80e0be96..386178d9 100644 --- a/src/corelib/fpg_msgqueue.inc +++ b/src/corelib/fpg_msgqueue.inc @@ -171,12 +171,7 @@ begin m.Dest := Dest; m.Params := aparams; -// try - m.Dest.Dispatch(m) -// except -// on E: Exception do -// {$IFDEF DEBUG}writeln('fpgSendMessage Caught Exception: ' + E.Message){$ENDIF}; -// end; + fpgDeliverMessage(m); end; procedure fpgSendMessage(Sender, Dest: TObject; MsgCode: integer); overload; @@ -190,12 +185,7 @@ begin m.Sender := Sender; m.Dest := Dest; -// try - m.Dest.Dispatch(m) -// except -// on E: Exception do -// {$IFDEF DEBUG}writeln('fpgSendMessage Caught Exception: ' + E.Message){$ENDIF}; -// end; + fpgDeliverMessage(m); end; procedure fpgDeliverMessage(var msg: TfpgMessageRec); @@ -207,21 +197,16 @@ begin msg.Dest.Free else begin -// try - msg.Dest.Dispatch(msg); - if fpgApplication.FMessageHookList.Count > 0 then + msg.Dest.Dispatch(msg); + if fpgApplication.FMessageHookList.Count > 0 then + begin + for i := 0 to fpgApplication.FMessageHookList.Count - 1 do begin - for i := 0 to fpgApplication.FMessageHookList.Count - 1 do - begin - oItem := TMsgHookItem(fpgApplication.FMessageHookList.Items[i]); - if (msg.Dest = oItem.Dest) and (msg.MsgCode = oItem.MsgCode) then - oItem.Listener.Dispatch(msg); - end; + oItem := TMsgHookItem(fpgApplication.FMessageHookList.Items[i]); + if (msg.Dest = oItem.Dest) and (msg.MsgCode = oItem.MsgCode) then + oItem.Listener.Dispatch(msg); end; -// except -// on E: Exception do -// {$IFDEF DEBUG}writeln('fpgDeliverMessage Caught Exception: ' + E.Message){$ENDIF}; -// end; + end; end; end; diff --git a/src/corelib/fpg_pofiles.pas b/src/corelib/fpg_pofiles.pas index 8e683379..5f8ff7bc 100644 --- a/src/corelib/fpg_pofiles.pas +++ b/src/corelib/fpg_pofiles.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_popupwindow.pas b/src/corelib/fpg_popupwindow.pas index fe7ef9d6..fdb78b66 100644 --- a/src/corelib/fpg_popupwindow.pas +++ b/src/corelib/fpg_popupwindow.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -43,15 +43,16 @@ type procedure SetPopupFrame(const AValue: boolean); protected procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE; - procedure AdjustWindowStyle; override; procedure HandleClose; virtual; procedure HandleShow; override; + procedure HandlePaint; override; procedure ProcessPopupFrame; virtual; procedure DoPaintPopupFrame; virtual; procedure DoOnClose; virtual; procedure DoOnShow; virtual; public constructor Create(AOwner: TComponent); override; + procedure AdjustWindowStyle; override; procedure ShowAt(AWidget: TfpgWidget; x, y: TfpgCoord); overload; procedure ShowAt(x, y: TfpgCoord); overload; procedure Close; virtual; @@ -241,6 +242,13 @@ begin DoOnShow; end; +procedure TfpgPopupWindow.HandlePaint; +begin + inherited HandlePaint; + if PopupFrame then + DoPaintPopupFrame; +end; + procedure TfpgPopupWindow.ProcessPopupFrame; var i: integer; @@ -263,10 +271,7 @@ begin end; HandleResize(Width+2, Height+2); UpdateWindowPosition; - - Canvas.BeginDraw; - DoPaintPopupFrame; - Canvas.EndDraw; + Repaint; end; end; @@ -337,11 +342,6 @@ procedure TfpgPopupWindow.Close; begin HandleClose; PopupListRemove(self); - { TODO : Move this out to the GDI specific unit. } - {$IFDEF MSWINDOWS} - if uFirstPopup <> nil then - uFirstPopup^.Widget.CaptureMouse; - {$ENDIF} end; diff --git a/src/corelib/fpg_stdimages.pas b/src/corelib/fpg_stdimages.pas index 07b5f338..2682ce3f 100644 --- a/src/corelib/fpg_stdimages.pas +++ b/src/corelib/fpg_stdimages.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -102,6 +102,11 @@ begin @stdimg_checkboxes, sizeof(stdimg_checkboxes)); + fpgImages.AddMaskedBMP( + 'stdimg.ellipse', + @stdimg_ellipse, + sizeof(stdimg_ellipse), 0,0); + // General purpose images: fpgImages.AddMaskedBMP( @@ -145,6 +150,11 @@ begin sizeof(stdimg_menu_preferences_16), 0,0); fpgImages.AddMaskedBMP( + 'stdimg.check', + @stdimg_menu_check_16, + sizeof(stdimg_menu_check_16), 0,0); + + fpgImages.AddMaskedBMP( 'stdimg.document', @stdimg_document, sizeof(stdimg_document), 0,0); @@ -210,6 +220,11 @@ begin sizeof(stdimg_folder_up_16), 0,0); fpgImages.AddMaskedBMP( + 'stdimg.folderfile', + @stdimg_folder_open_file_16, + sizeof(stdimg_folder_open_file_16), 0,0); + + fpgImages.AddMaskedBMP( 'stdimg.open', @stdimg_folder_open_16, sizeof(stdimg_folder_open_16), 0,0); diff --git a/src/corelib/fpg_stringhashlist.pas b/src/corelib/fpg_stringhashlist.pas index 15bd36fd..21b6af16 100644 --- a/src/corelib/fpg_stringhashlist.pas +++ b/src/corelib/fpg_stringhashlist.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_strings.pas b/src/corelib/fpg_strings.pas index 180910d7..3bb22ec3 100644 --- a/src/corelib/fpg_strings.pas +++ b/src/corelib/fpg_strings.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/fpg_stringutils.pas b/src/corelib/fpg_stringutils.pas index d3f9b9a3..f97f1b61 100644 --- a/src/corelib/fpg_stringutils.pas +++ b/src/corelib/fpg_stringutils.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -46,6 +46,8 @@ procedure Delete8(var S: string; Index, Size: integer); procedure Insert8(const Source: string; var S: string; Index: integer); function fpgCharAt(const s: TfpgString; Index: integer): TfpgChar; +function fpgAppendPathDelim(const Path: TfpgString): TfpgString; +function fpgRemovePathDelim(const Path: TfpgString): TfpgString; implementation @@ -317,6 +319,21 @@ begin Result := UTF8Copy(s, Index, 1); end; +function fpgAppendPathDelim(const Path: TfpgString): TfpgString; +begin + if (Path <> '') and (Path[Length(Path)] <> PathDelim) then + Result := Path + PathDelim + else + Result := Path; +end; + +function fpgRemovePathDelim(const Path: TfpgString): TfpgString; +begin + if (Path <> '') and (Path[Length(Path)] = PathDelim) then + Result := LeftStr(Path, Length(Path)-1) + else + Result := Path; +end; end. diff --git a/src/corelib/fpg_translations.pas b/src/corelib/fpg_translations.pas index b4be413f..996387c7 100644 --- a/src/corelib/fpg_translations.pas +++ b/src/corelib/fpg_translations.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -26,6 +26,7 @@ interface uses Classes ,SysUtils + ,fpg_base ; @@ -57,6 +58,7 @@ type procedure TranslateResourceStrings(const BaseAppName, BaseDirectory, CustomLang: string); +function fpgMatchLocale(const ALanguageID: TfpgString): boolean; implementation @@ -157,15 +159,27 @@ begin end; // Strip the '.' onwards part. eg: en_ZA.UTF-8 -> en_ZA -procedure FixLanguageIDs; +procedure FixLanguageIDs(var ALanguageID: TfpgString); var lpos: integer; begin - lpos := Pos('.', SystemLanguageID1); + lpos := Pos('.', ALanguageID); if lpos > 0 then - SystemLanguageID1 := Copy(SystemLanguageID1, 0, lpos-1); + ALanguageID := Copy(ALanguageID, 0, lpos-1); end; +function fpgMatchLocale(const ALanguageID: TfpgString): boolean; +var + s: TfpgString; +begin + s := ALanguageID; + FixLanguageIDs(s); + Result := s = SystemLanguageID1; + if not Result then + Result := s = SystemLanguageID2; +end; + + { TTranslationList } function TTranslationList.GetItems(Index: integer): TTranslation; @@ -213,7 +227,7 @@ end; initialization TranslationList := nil; GetLanguageIDs(SystemLanguageID1, SystemLanguageID2); - FixLanguageIDs; + FixLanguageIDs(SystemLanguageID1); finalization TranslationList.Free; diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index c583494e..d4d7886c 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -54,6 +54,9 @@ function fpgFileExists(const FileName: TfpgString): Boolean; function fpgDirectoryExists(const ADirectory: TfpgString): Boolean; function fpgExtractFileDir(const FileName: TfpgString): TfpgString; function fpgExtractFilePath(const FileName: TfpgString): TfpgString; +function fpgExtractFileName(const FileName: TfpgString): TfpgString; +function fpgExtractFileExt(const FileName: TfpgString): TfpgString; +function fpgForceDirectories(const ADirectory: TfpgString): Boolean; implementation @@ -132,6 +135,21 @@ begin Result := ExtractFilePath(fpgToOSEncoding(Filename)); end; +function fpgExtractFileName(const FileName: TfpgString): TfpgString; +begin + Result := ExtractFileName(fpgToOSEncoding(Filename)); +end; + +function fpgExtractFileExt(const FileName: TfpgString): TfpgString; +begin + Result := ExtractFileExt(fpgToOSEncoding(Filename)); +end; + +function fpgForceDirectories(const ADirectory: TfpgString): Boolean; +begin + Result := ForceDirectories(fpgToOSEncoding(ADirectory)); +end; + function fpgAppendPathDelim(const Path: TfpgString): TfpgString; begin if (Path <> '') and (Path[length(Path)] <> PathDelim) then @@ -180,12 +198,8 @@ end; function fpgAllFilesMask: TfpgString; begin - {$Note In FPC 2.2.2 onwards we can use AllFilesMask which is part of RTL } - {$IFDEF WINDOWS} - Result := '*.*'; - {$ELSE} - Result := '*'; - {$ENDIF} + { Since FPC 2.2.2 we have the AllFilesMask variable, which is part of the RTL } + Result := AllFilesMask; end; function fpgConvertLineEndings(const s: TfpgString): TfpgString; diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index f844907e..39bb4193 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -32,6 +32,8 @@ uses type TFocusSearchDirection = (fsdFirst, fsdLast, fsdNext, fsdPrev); + THintEvent = procedure(Sender: TObject; var AHint: TfpgString) of object; + TfpgWidget = class(TfpgWindow) private @@ -49,8 +51,10 @@ type FOnKeyPress: TKeyPressEvent; FOnResize: TNotifyEvent; FOnScreen: boolean; + FOnShowHint: THintEvent; procedure SetActiveWidget(const AValue: TfpgWidget); function IsShowHintStored: boolean; + procedure SetFormDesigner(const AValue: TObject); protected procedure MsgPaint(var msg: TfpgMessageRec); message FPGM_PAINT; procedure MsgResize(var msg: TfpgMessageRec); message FPGM_RESIZE; @@ -75,12 +79,14 @@ type FAnchors: TAnchors; FActiveWidget: TfpgWidget; FAlign: TAlign; - FHint: string; + FHint: TfpgString; FShowHint: boolean; FParentShowHint: boolean; FBackgroundColor: TfpgColor; FTextColor: TfpgColor; FIsContainer: Boolean; + function GetOnShowHint: THintEvent; virtual; + procedure SetOnShowHint(const AValue: THintEvent); virtual; procedure SetBackgroundColor(const AValue: TfpgColor); virtual; procedure SetTextColor(const AValue: TfpgColor); virtual; function GetParent: TfpgWidget; reintroduce; @@ -89,9 +95,12 @@ type procedure SetVisible(const AValue: boolean); virtual; procedure SetShowHint(const AValue: boolean); virtual; procedure SetParentShowHint(const AValue: boolean); virtual; + function GetHint: TfpgString; virtual; + procedure SetHint(const AValue: TfpgString); virtual; procedure DoUpdateWindowPosition; override; procedure DoAlign(AAlign: TAlign); procedure DoResize; + procedure DoShowHint(var AHint: TfpgString); procedure HandlePaint; virtual; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); virtual; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); virtual; @@ -127,19 +136,22 @@ type property OnMouseUp: TMouseButtonEvent read FOnMouseUp write FOnMouseUp; property OnPaint: TPaintEvent read FOnPaint write FOnPaint; property OnResize: TNotifyEvent read FOnResize write FOnResize; + property OnShowHint: THintEvent read GetOnShowHint write SetOnShowHint; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + procedure AfterConstruction; override; function GetClientRect: TfpgRect; virtual; function GetBoundsRect: TfpgRect; virtual; function InDesigner: boolean; + procedure InvokeHelp; virtual; procedure Realign; procedure SetFocus; 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???? - property FormDesigner: TObject read FFormDesigner write FFormDesigner; + property FormDesigner: TObject read FFormDesigner write SetFormDesigner; property Parent: TfpgWidget read GetParent write SetParent; property ActiveWidget: TfpgWidget read FActiveWidget write SetActiveWidget; property IsContainer: Boolean read FIsContainer; @@ -151,7 +163,7 @@ type property Focused: boolean read FFocused write FFocused default False; property Anchors: TAnchors read FAnchors write FAnchors; property Align: TAlign read FAlign write FAlign; - property Hint: string read FHint write FHint; + property Hint: TfpgString read GetHint write SetHint; property ShowHint: boolean read FShowHint write SetShowHint stored IsShowHintStored; property ParentShowHint: boolean read FParentShowHint write SetParentShowHint default True; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; @@ -169,7 +181,7 @@ implementation uses fpg_constants, - fpg_hint; + fpg_menu; var @@ -203,7 +215,7 @@ begin for i := 0 to ComponentCount - 1 do begin if Components[i] is TfpgWidget then - TfpgWidget(Components[i]).Enabled := self.Enabled; + TfpgWidget(Components[i]).Enabled := FEnabled; end; RePaint; end; @@ -212,7 +224,7 @@ procedure TfpgWidget.SetActiveWidget(const AValue: TfpgWidget); begin if FActiveWidget = AValue then Exit; //==> - if FFormDesigner <> nil then + if InDesigner then Exit; //==> if FActiveWidget <> nil then @@ -222,11 +234,28 @@ begin FActiveWidget.HandleSetFocus; end; +function TfpgWidget.GetHint: TfpgString; +begin + Result := FHint; +end; + function TfpgWidget.IsShowHintStored: boolean; begin Result := not ParentShowHint; end; +procedure TfpgWidget.SetFormDesigner(const AValue: TObject); +var + i: integer; +begin + FFormDesigner := AValue; + for i := 0 to ComponentCount-1 do + begin + if (Components[i] is TfpgWidget) and (TfpgWidget(Components[i]).Parent = self) then + TfpgWidget(Components[i]).FormDesigner := AValue; + end; +end; + procedure TfpgWidget.SetVisible(const AValue: boolean); begin if FVisible = AValue then @@ -234,9 +263,13 @@ begin FVisible := AValue; if FOnScreen then if FVisible then - HandleShow + begin +// writeln('DEBUG: TfpgWidget.SetVisible - handleshow'); + HandleShow; + end else begin +// writeln('DEBUG: TfpgWidget.SetVisible - handlehide'); HandleHide; FOnScreen := True; end; @@ -258,6 +291,11 @@ begin FShowHint := False; end; +procedure TfpgWidget.SetHint(const AValue: TfpgString); +begin + FHint := AValue; +end; + procedure TfpgWidget.DoUpdateWindowPosition; var dw: integer; @@ -318,6 +356,28 @@ begin Result := (FFormDesigner <> nil) end; +procedure TfpgWidget.InvokeHelp; +begin + case HelpType of + htKeyword: + if HelpKeyword <> '' then + begin + fpgApplication.KeywordHelp(HelpKeyword); + Exit; //==> + end; + htContext: + if HelpContext <> 0 then + begin + fpgApplication.ContextHelp(HelpContext); + Exit; //==> + end; + end; + if Parent <> nil then + Parent.InvokeHelp + else + fpgApplication.InvokeHelp; +end; + procedure TfpgWidget.Realign; begin HandleAlignments(0, 0); @@ -358,6 +418,8 @@ begin FBackgroundColor := clWindowBackground; FTextColor := clText1; + inherited Create(AOwner); + if (AOwner <> nil) and (AOwner is TfpgWidget) then begin Parent := TfpgWidget(AOwner); @@ -371,28 +433,30 @@ begin FWindowType := wtChild; FShowHint := Parent.ShowHint; end; +end; - inherited Create(AOwner); +destructor TfpgWidget.Destroy; +begin + {$IFDEF DEBUG} + writeln('TfpgWidget.Destroy [', Classname, '.', Name, ']'); + {$ENDIF} + HandleHide; + inherited Destroy; +end; +procedure TfpgWidget.AfterConstruction; +begin + inherited AfterConstruction; // This is for components that are created at runtime, after it's // parent has already been shown. if (Parent <> nil) and (Parent.HasHandle) then begin - InternalHandleShow; + HandleShow; end; Loaded; // remove csLoading from ComponentState end; -destructor TfpgWidget.Destroy; -begin - {$IFDEF DEBUG} - writeln('TfpgWidget.Destroy [', Classname, ']'); - {$ENDIF} - HandleHide; - inherited; -end; - procedure TfpgWidget.MsgKeyChar(var msg: TfpgMessageRec); var lChar: TfpgChar; @@ -424,7 +488,7 @@ var consumed: boolean; wg: TfpgWidget; begin - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -454,7 +518,7 @@ var consumed: boolean; wg: TfpgWidget; begin - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -481,7 +545,7 @@ procedure TfpgWidget.MsgMouseDown(var msg: TfpgMessageRec); var mb: TMouseButton; begin - if FFormDesigner <> nil then + if InDesigner then begin // dispatching message to designer FFormDesigner.Dispatch(msg); @@ -521,7 +585,7 @@ var IsDblClick: boolean; begin // writeln('TfpgWidget.MsgMouseUp'); - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -578,7 +642,7 @@ end; procedure TfpgWidget.MsgMouseMove(var msg: TfpgMessageRec); begin - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -611,7 +675,7 @@ begin {$IFDEF DEBUG} writeln('MsgMouseEnter'); {$ENDIF} - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -628,7 +692,7 @@ begin {$IFDEF DEBUG} writeln('MsgMouseExit'); {$ENDIF} - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); if msg.Stop then @@ -646,33 +710,43 @@ begin msg.Params.mouse.shiftstate, msg.Params.mouse.delta); end; +function TfpgWidget.GetOnShowHint: THintEvent; +begin + Result := FOnShowHint; +end; + +procedure TfpgWidget.SetOnShowHint(const AValue: THintEvent); +begin + FOnShowHint := AValue; +end; + procedure TfpgWidget.HandleShow; var n: integer; c: TComponent; begin -// writeln('Widget.HandleShow - ', ClassName, ' x:', Left, ' y:', Top, ' w:', Width, ' h:', Height); FOnScreen := True; -// FVisible := True; - AllocateWindowHandle; DoSetWindowVisible(FVisible); for n := 0 to ComponentCount - 1 do begin c := Components[n]; - if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) and - (TfpgWidget(c).FOnScreen = False) then - TfpgWidget(c).HandleShow; + if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) then + begin + if not (c is TfpgPopupMenu) then // these should not be created yet + begin + TfpgWidget(c).HandleShow; + end; + end; end; end; procedure TfpgWidget.InternalHandleShow; begin FOnScreen := True; - FVisible := False; AllocateWindowHandle; - DoSetWindowVisible(False); + DoSetWindowVisible(FVisible); end; procedure TfpgWidget.HandleHide; @@ -955,8 +1029,8 @@ begin if Components[n] is TfpgWidget then begin w := TfpgWidget(Components[n]); - - if w.Visible and w.Enabled and w.Focusable then + if w.Enabled and w.Visible and w.Focusable then + begin case direction of fsdFirst: if w.TabOrder < lasttaborder then @@ -976,6 +1050,7 @@ begin if startwg = w then FoundIt := True else if w.TabOrder < lasttaborder then + begin if (startwg = nil) or (w.TabOrder > startwg.TabOrder) or (FoundIt and (w.TabOrder = startwg.TabOrder)) then @@ -983,7 +1058,7 @@ begin Result := w; lasttaborder := w.TabOrder; end; - + end; fsdPrev: if startwg = w then FoundIt := True @@ -996,7 +1071,8 @@ begin lasttaborder := w.TabOrder; end; - end; + end; { case } + end; { if w.Enabled... } end; end; @@ -1019,7 +1095,7 @@ begin dh := msg.Params.rect.Height - FHeight; HandleResize(msg.Params.rect.Width, msg.Params.rect.Height); HandleAlignments(dw, dh); - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); end; @@ -1029,7 +1105,7 @@ end; procedure TfpgWidget.MsgMove(var msg: TfpgMessageRec); begin HandleMove(msg.Params.rect.Left, msg.Params.rect.Top); - if FFormDesigner <> nil then + if InDesigner then begin FFormDesigner.Dispatch(msg); end; @@ -1150,7 +1226,7 @@ begin if Components[n] is TfpgWidget then begin w := TfpgWidget(Components[n]); - if w.Align = AAlign then + if (w.Align = AAlign) and (w.Visible) then alist.Add(w); end; @@ -1160,7 +1236,7 @@ begin for n := 0 to alist.Count - 1 do begin w := TfpgWidget(alist[n]); - case aalign of + case AAlign of alTop: begin w.MoveAndResize(FAlignRect.Left, FAlignRect.Top, FAlignRect.Width, w.Height); @@ -1201,6 +1277,15 @@ begin FOnResize(Self); end; +procedure TfpgWidget.DoShowHint(var AHint: TfpgString); +begin + AHint := Hint; + if Assigned(FOnShowHint) then + begin + FOnShowHint(self, AHint); + end; +end; + procedure TfpgWidget.SetPosition(aleft, atop, awidth, aheight: TfpgCoord); begin MoveAndResize(aleft, atop, awidth, aheight); diff --git a/src/corelib/fpg_wuline.pas b/src/corelib/fpg_wuline.pas index 1f159d08..cfed0a73 100644 --- a/src/corelib/fpg_wuline.pas +++ b/src/corelib/fpg_wuline.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -44,7 +44,7 @@ type // Blend a pixel with the current colour procedure AlphaBlendPixel(ACanvas: TfpgCanvas; X, Y: integer; R, G, B: word; ARatio: Double); var - LBack, LNew: TRGBTriple; + LBack, LNew: TFPColor; LMinusRatio: Double; begin if (X < 0) or (X > TCanvasHack(ACanvas).FWindow.Width - 1) or (Y < 0) or @@ -52,11 +52,11 @@ begin Exit; // clipping LMinusRatio := 1 - ARatio; - LBack := fpgColorToRGBTriple(ACanvas.Pixels[X, Y]); + LBack := fpgColorToFPColor(ACanvas.Pixels[X, Y]); LNew.Blue := round(B*ARatio + LBack.Blue*LMinusRatio); LNew.Green := round(G*ARatio + LBack.Green*LMinusRatio); LNew.Red := round(R*ARatio + LBack.Red*LMinusRatio); - ACanvas.Pixels[X, Y] := RGBTripleTofpgColor(LNew); + ACanvas.Pixels[X, Y] := FPColorTofpgColor(LNew); end; // Draw a anti-aliased line diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index fd6aa6d6..e242bfb6 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -13,6 +13,10 @@ Description: This defines the CoreLib backend interface to the Windows GDI API. + + Win32 API Reference - http://msdn.microsoft.com/en-us/library/ff468919(VS.85).aspx + Windows CE 3.0 API Reference - http://msdn.microsoft.com/en-us/library/ms925466.aspx + FPC WinCE information - http://wiki.freepascal.org/WinCE_port } unit fpg_gdi; @@ -44,12 +48,11 @@ var FontSmoothingType: Cardinal; type - // forward declaration - TfpgWindowImpl = class; + TfpgGDIWindow = class; - TfpgFontResourceImpl = class(TfpgFontResourceBase) + TfpgGDIFontResource = class(TfpgFontResourceBase) private FFontData: HFONT; FMetrics: Windows.TEXTMETRIC; @@ -67,11 +70,7 @@ type end; - TfpgFontImpl = class(TfpgFontBase) - end; - - - TfpgImageImpl = class(TfpgImageBase) + TfpgGDIImage = class(TfpgImageBase) private FBMPHandle: HBITMAP; FMaskHandle: HBITMAP; @@ -87,18 +86,16 @@ type end; - { TfpgCanvasImpl } - - TfpgCanvasImpl = class(TfpgCanvasBase) + TfpgGDICanvas = class(TfpgCanvasBase) private FDrawing: boolean; FBufferBitmap: HBitmap; - FDrawWindow: TfpgWindowImpl; + FDrawWindow: TfpgGDIWindow; Fgc: TfpgDCHandle; FBufgc: TfpgDCHandle; FWinGC: TfpgDCHandle; FBackgroundColor: TfpgColor; - FCurFontRes: TfpgFontResourceImpl; + FCurFontRes: TfpgGDIFontResource; FClipRect: TfpgRect; FClipRectSet: Boolean; FWindowsColor: longword; @@ -141,18 +138,18 @@ type end; - TfpgWindowImpl = class(TfpgWindowBase) + TfpgGDIWindow = class(TfpgWindowBase) private FMouseInWindow: boolean; FNonFullscreenRect: TfpgRect; FNonFullscreenStyle: longword; FFullscreenIsSet: boolean; FSkipResizeMessage: boolean; - function DoMouseEnterLeaveCheck(AWindow: TfpgWindowImpl; uMsg, wParam, lParam: Cardinal): Boolean; + function DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean; procedure WindowSetFullscreen(aFullScreen, aUpdate: boolean); protected FWinHandle: TfpgWinHandle; - FModalForWin: TfpgWindowImpl; + FModalForWin: TfpgGDIWindow; FWinStyle: longword; FWinStyleEx: longword; FParentWinHandle: TfpgWinHandle; @@ -177,7 +174,7 @@ type end; - TfpgApplicationImpl = class(TfpgApplicationBase) + TfpgGDIApplication = class(TfpgApplicationBase) protected FDisplay: HDC; WindowClass: TWndClass; @@ -220,7 +217,7 @@ type end; - TfpgClipboardImpl = class(TfpgClipboardBase) + TfpgGDIClipboard = class(TfpgClipboardBase) protected FClipboardText: TfpgString; function DoGetText: TfpgString; override; @@ -229,7 +226,7 @@ type end; - TfpgFileListImpl = class(TfpgFileListBase) + TfpgGDIFileList = class(TfpgFileListBase) function EncodeAttributesString(attrs: longword): TFileModeString; constructor Create; override; function InitializeEntry(sr: TSearchRec): TFileEntry; override; @@ -257,6 +254,37 @@ var // some required keyboard functions {$INCLUDE fpg_keys_gdi.inc} +{$IFDEF wince} +// A few tweaks to get fpGUI working on the Symbol MC1000 WinCE 4.2 +// *** Need to fix the hack in procedure TfpgWindowImpl.DoAllocateWindowHandle + +const + CS_OWNDC = 0; + WS_OVERLAPPEDWINDOW = WS_VISIBLE; + WS_POPUPWINDOW = 0; + WS_EX_APPWINDOW = 0; + +// From Lazarus wince\winext.pas: +function GET_X_LPARAM(lp : Windows.LParam) : longint; + begin + result:=smallint(LOWORD(lp)); + end; +function GET_Y_LPARAM(lp : Windows.LParam) : longint; + begin + result:=smallint(HIWORD(lp)); + end; + +// *** copied from Lazarus +function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; +begin + if nDenominator = 0 then + Result := -1 + else +// Result := MathRound( int64(nNumber) * int64(nNumerator) / nDenominator); + Result := Round( int64(nNumber) * int64(nNumerator) / nDenominator); +end; +{$ENDIF} + function fpgColorToWin(col: TfpgColor): longword; var c: dword; @@ -387,15 +415,23 @@ end; // returns true when the operating system is windows 2000 or newer function IsWin2kOrLater: Boolean; begin + {$IFDEF WinCE} + Result := false; + {$ELSE} Result := (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 5); + {$ENDIF} end; // returns true when the operating system is windows XP or newer function IsWinXPOrLater: Boolean; begin + {$IFDEF WinCE} + Result := false; + {$ELSE} Result := (Win32Platform = VER_PLATFORM_WIN32_NT) and (((Win32MajorVersion = 5) and (Win32MinorVersion >= 1)) or ((Win32MajorVersion >= 6) and (Win32MinorVersion >= 0))); + {$ENDIF} end; function WinkeystateToShiftstate(keystate: cardinal): TShiftState; @@ -412,6 +448,32 @@ begin end; end; +{$IFDEF wince} +procedure WinCESetDibBits(BMP: HBITMAP; awidth, aheight: Integer; aimgdata: Pointer; var bi: TBitmapInfo); +var + hdcSrc, hdcDest: HDC; + hbmSrc: HBITMAP; + bm: BITMAP; +begin + hdcDest:= CreateCompatibleDC(0); + SelectObject(hdcDest, BMP); + if bi.bmiHeader.biBitCount = 1 then + begin + SetDIBitsToDevice(hdcDest, 0, 0, awidth, aheight, 0, 0, 0, aheight, aimgdata, bi, DIB_RGB_COLORS); + end + else + begin + hdcSrc:= CreateCompatibleDC(0); + hbmSrc:= CreateBitmap(awidth, aheight, 1, bi.bmiHeader.biBitCount, aimgdata); + SelectObject(hdcSrc, hbmSrc); + BitBlt(hdcDest, 0, 0, awidth, aheight, hdcSrc, 0, 0, SRCCOPY); + DeleteDC(hdcSrc); + DeleteObject(hbmSrc); + end; + DeleteDC(hdcDest); +end; +{$ENDIF} + procedure GetWindowBorderDimensions(const w: TfpgWindowBase; var dx, dy: integer); var bx: integer; // left/right border width @@ -455,10 +517,10 @@ begin begin // write('Hooked HCBT_ACTIVATE at '+IntToStr(wParam)+': '); if (wapplication.TopModalForm <> nil) and - (wParam <> TfpgWindowImpl(wapplication.TopModalForm).FWinHandle) then + (wParam <> TfpgGDIWindow(wapplication.TopModalForm).FWinHandle) then begin // writeln('stopped'); - SetActiveWindow(TfpgWindowImpl(wapplication.TopModalForm).FWinHandle); + SetActiveWindow(TfpgGDIWindow(wapplication.TopModalForm).FWinHandle); Result := 1; end else begin @@ -471,10 +533,10 @@ end; function fpgWindowProc(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; var - w: TfpgWindowImpl; - pw: TfpgWindowImpl; + w: TfpgGDIWindow; + pw: TfpgGDIWindow; kwg: TfpgWidget; - mw: TfpgWindowImpl; + mw: TfpgGDIWindow; kcode: integer; i: integer; sstate: integer; @@ -487,6 +549,7 @@ var mcode: integer; wmsg: TMsg; PaintStruct: TPaintStruct; + TmpW: widestring; //------------ procedure SetMinMaxInfo(var MinMaxInfo: TMINMAXINFO); @@ -525,7 +588,7 @@ var begin if uMsg = WM_CREATE then begin - w := TfpgWindowImpl(PCreateStruct(lParam)^.lpCreateParams); + w := TfpgGDIWindow(PCreateStruct(lParam)^.lpCreateParams); w.FWinHandle := hwnd; // this is very important, because number of messages sent // before the createwindow returns the window handle Windows.SetWindowLong(hwnd, GWL_USERDATA, longword(w)); @@ -563,10 +626,10 @@ begin Exit; //==> end; - w := TfpgWindowImpl(Windows.GetWindowLong(hwnd, GWL_USERDATA)); + w := TfpgGDIWindow(Windows.GetWindowLong(hwnd, GWL_USERDATA)); Result := 0; - if not (w is TfpgWindowImpl) then + if not (w is TfpgGDIWindow) then begin {$IFDEF DEBUG} writeln('fpGFX/GDI: Unable to detect Window - using DefWindowProc'); {$ENDIF} Result := Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); @@ -621,7 +684,8 @@ begin fpgSendMessage(nil, w, FPGM_KEYRELEASE, msgp) else if uMsg = WM_CHAR then begin - msgp.keyboard.keychar := UTF8Encode(WideChar(wParam)); + tmpW := WideChar(wParam); + msgp.keyboard.keychar := UTF8Encode(tmpW); fpgSendMessage(nil, w, FPGM_KEYCHAR, msgp); end; @@ -692,7 +756,7 @@ begin mw := GetMyWidgetFromHandle(h); pw := mw; while (pw <> nil) and (pw.Parent <> nil) do - pw := TfpgWindowImpl(pw.Parent); + pw := TfpgGDIWindow(pw.Parent); if ((pw = nil) or (PopupListFind(pw.WinHandle) = nil)) and (not PopupDontCloseWidget(TfpgWidget(mw))) and @@ -706,7 +770,7 @@ begin if (wapplication.TopModalForm <> nil) then begin mw := nil; - mw := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w))); + mw := TfpgGDIWindow(WidgetParentForm(TfpgWidget(w))); if (mw <> nil) and (wapplication.TopModalForm <> mw) then blockmsg := True; end; @@ -852,9 +916,9 @@ begin mw := nil; h := WindowFromPoint(pt); if h > 0 then // get window mouse is hovering over - mw := TfpgWindowImpl(Windows.GetWindowLong(h, GWL_USERDATA)); + mw := TfpgGDIWindow(Windows.GetWindowLong(h, GWL_USERDATA)); - if (mw is TfpgWindowImpl) then + if (mw is TfpgGDIWindow) then begin msgp.mouse.x := pt.x; msgp.mouse.y := pt.y; @@ -960,11 +1024,16 @@ begin end; end; -{ TfpgApplicationImpl } +{ TfpgGDIApplication } // helper function for DoGetFontFaceList +{$IFDEF wince} +function MyFontEnumerator(var LogFont: ENUMLOGFONT; var TextMetric: NEWTEXTMETRIC; + FontType: Integer; data: LPARAM): Integer; CDecl; +{$ELSE} function MyFontEnumerator(var LogFont: ENUMLOGFONTEX; var TextMetric: NEWTEXTMETRICEX; FontType: Integer; data: LPARAM): Integer; stdcall; +{$ENDIF} var sl: TStringList; s: string; @@ -976,18 +1045,22 @@ begin Result := 1; end; -function TfpgApplicationImpl.DoGetFontFaceList: TStringList; +function TfpgGDIApplication.DoGetFontFaceList: TStringList; var LFont: TLogFont; begin Result := TStringList.Create; FillChar(LFont, sizeof(LFont), 0); LFont.lfCharset := DEFAULT_CHARSET; + {$IFDEF wince} + EnumFontFamiliesW(Display, @LFont, @MyFontEnumerator, LongInt(result)); + {$ELSE} EnumFontFamiliesEx(Display, @LFont, @MyFontEnumerator, LongInt(result), 0); + {$ENDIF} Result.Sort; end; -function TfpgApplicationImpl.GetHiddenWindow: HWND; +function TfpgGDIApplication.GetHiddenWindow: HWND; begin if (FHiddenWindow = 0) then begin @@ -1004,12 +1077,12 @@ begin Windows.RegisterClass(@HiddenWndClass); FHiddenWindow := CreateWindow('FPGHIDDEN', '', - DWORD(WS_POPUP), 0, 0, 0, 0, TfpgWindowImpl(MainForm).FWinHandle, 0, MainInstance, nil); + DWORD(WS_POPUP), 0, 0, 0, 0, TfpgGDIWindow(MainForm).FWinHandle, 0, MainInstance, nil); end; Result := FHiddenWindow; end; -constructor TfpgApplicationImpl.Create(const AParams: string); +constructor TfpgGDIApplication.Create(const AParams: string); begin inherited Create(AParams); FIsInitialized := False; @@ -1062,20 +1135,20 @@ begin wapplication := TfpgApplication(self); end; -destructor TfpgApplicationImpl.Destroy; +destructor TfpgGDIApplication.Destroy; begin UnhookWindowsHookEx(ActivationHook); inherited Destroy; end; -function TfpgApplicationImpl.DoMessagesPending: boolean; +function TfpgGDIApplication.DoMessagesPending: boolean; var Msg: TMsg; begin Result := Windows.PeekMessageW(@Msg, 0, 0, 0, PM_NOREMOVE); end; -procedure TfpgApplicationImpl.DoWaitWindowMessage(atimeoutms: integer); +procedure TfpgGDIApplication.DoWaitWindowMessage(atimeoutms: integer); var Msg: TMsg; timerid: longword; @@ -1084,7 +1157,7 @@ var begin timerid := 0; if Assigned(wapplication.MainForm) then - ltimerWnd := TfpgWindowImpl(wapplication.MainForm).WinHandle + ltimerWnd := TfpgGDIWindow(wapplication.MainForm).WinHandle else ltimerWnd := 0; @@ -1096,11 +1169,15 @@ begin Exit; // handling waiting timeout end; - {$Note Incorporate Felipe's code from previous fpGUI in here. It handles WinCE and Windows just fine. } + {$IFDEF WinCE} + // No GetVersion + Windows.GetMessageW(@Msg, 0, 0, 0); //NT + {$ELSE} if (GetVersion() < $80000000) then Windows.GetMessageW(@Msg, 0, 0, 0) //NT else Windows.GetMessage(@Msg, 0, 0, 0); //Win98 + {$ENDIF} Windows.DispatchMessage(@msg); @@ -1108,12 +1185,14 @@ begin Windows.KillTimer(ltimerWnd, 1); // same IDEvent as used in SetTimer end; -procedure TfpgApplicationImpl.DoFlush; +procedure TfpgGDIApplication.DoFlush; begin + {$IFNDEF wince} GdiFlush; + {$ENDIF} end; -function TfpgApplicationImpl.GetScreenWidth: TfpgCoord; +function TfpgGDIApplication.GetScreenWidth: TfpgCoord; var r: TRECT; begin @@ -1122,7 +1201,7 @@ begin // Result := Windows.GetSystemMetrics(SM_CXSCREEN); end; -function TfpgApplicationImpl.GetScreenHeight: TfpgCoord; +function TfpgGDIApplication.GetScreenHeight: TfpgCoord; var r: TRECT; begin @@ -1131,35 +1210,35 @@ begin // Result := Windows.GetSystemMetrics(SM_CYSCREEN); end; -function TfpgApplicationImpl.Screen_dpi_x: integer; +function TfpgGDIApplication.Screen_dpi_x: integer; begin Result := GetDeviceCaps(wapplication.display, LOGPIXELSX) end; -function TfpgApplicationImpl.Screen_dpi_y: integer; +function TfpgGDIApplication.Screen_dpi_y: integer; begin Result := GetDeviceCaps(wapplication.display, LOGPIXELSY) end; -function TfpgApplicationImpl.Screen_dpi: integer; +function TfpgGDIApplication.Screen_dpi: integer; begin Result := Screen_dpi_y; end; -{ TfpgWindowImpl } +{ TfpgGDIWindow } var // this are required for Windows MouseEnter & MouseExit detection. uLastWindowHndl: TfpgWinHandle; -function TfpgWindowImpl.DoMouseEnterLeaveCheck(AWindow: TfpgWindowImpl; uMsg, wParam, lParam: Cardinal): Boolean; +function TfpgGDIWindow.DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean; var pt, spt: Windows.POINT; msgp: TfpgMessageParams; CursorInDifferentWindow: boolean; CurrentWindowHndl: TfpgWinHandle; MouseCaptureWHndl: TfpgWinHandle; - LastWindow: TfpgWindowImpl; - CurrentWindow: TfpgWindowImpl; + LastWindow: TfpgGDIWindow; + CurrentWindow: TfpgGDIWindow; begin // vvzh: this method currently cannot receive mouse events when mouse pointer // is outside of the application window. We could try to play with @@ -1209,7 +1288,7 @@ begin uLastWindowHndl := CurrentWindowHndl; end; -procedure TfpgWindowImpl.WindowSetFullscreen(aFullScreen, aUpdate: boolean); +procedure TfpgGDIWindow.WindowSetFullscreen(aFullScreen, aUpdate: boolean); begin if aFullScreen = FFullscreenIsSet then Exit; //==> @@ -1219,7 +1298,7 @@ begin FNonFullscreenStyle := FWinStyle; FNonFullscreenRect.SetRect(Left, Top, Width, Height); // vvzh: the following lines are the workaround for bug. When calling - // WindowSetFullscreen from TfpgWindowImpl.DoAllocateWindowHandle, + // WindowSetFullscreen from TfpgGDIWindow.DoAllocateWindowHandle, // Left and Top are equal to -2147483648. As the result, if // we set FullScreen := True at the form creation time and then // call SetFullScreen(False) the form disappears, because it is moved @@ -1268,10 +1347,15 @@ begin FFullscreenIsSet := aFullScreen; end; -procedure TfpgWindowImpl.DoAllocateWindowHandle(AParent: TfpgWindowBase); +procedure TfpgGDIWindow.DoAllocateWindowHandle(AParent: TfpgWindowBase); var +{$IFDEF wince} + wcname: widestring; + wname: widestring; +{$ELSE} wcname: string; wname: string; +{$ENDIF} mid: dword; rwidth: integer; rheight: integer; @@ -1287,27 +1371,26 @@ begin mid := 0; wcname := 'FPGWIN'; - if aparent <> nil then - FParentWinHandle := TfpgWindowImpl(AParent).WinHandle + if AParent <> nil then + FParentWinHandle := TfpgGDIWindow(AParent).WinHandle else FParentWinHandle := 0; - if FWindowType = wtChild then + if WindowType = wtChild then begin FWinStyle := WS_CHILD; FWinStyleEx := 0; mid := 1; wcname := 'FPGWIDGET'; end - else if FWindowType in [wtPopup] then + else if WindowType in [wtPopup] then begin // This prevents the popup window from stealing the focus. eg: ComboBox dropdown FParentWinHandle := GetDesktopWindow; FWinStyle := WS_CHILD; FWinStyleEx := WS_EX_TOPMOST or WS_EX_TOOLWINDOW; - end; - - if FWindowType = wtModalForm then + end + else if WindowType = wtModalForm then begin // set parent window to special hidden window. It helps to hide window taskbar button. FParentWinHandle := wapplication.GetHiddenWindow; @@ -1317,6 +1400,9 @@ begin FWinStyleEx := 0; end; + if ((WindowType = wtWindow) or (WindowType = wtModalForm)) and (waBorderLess in FWindowAttributes) then + FWinStyle := FWinStyle and WS_POPUP; // this is different to wtPopop (toolwindow, hint window) because it can steal focus like a normal form + AdjustWindowStyle; if waAutoPos in FWindowAttributes then @@ -1325,7 +1411,7 @@ begin FTop := TfpgCoord(CW_USEDEFAULT); end; - if (FWindowType <> wtChild) and not (waSizeable in FWindowAttributes) then + if (WindowType <> wtChild) and not (waSizeable in FWindowAttributes) then FWinStyle := FWinStyle and not (WS_SIZEBOX or WS_MAXIMIZEBOX); FWinStyle := FWinStyle or WS_CLIPCHILDREN or WS_CLIPSIBLINGS; @@ -1345,11 +1431,35 @@ begin r.Top := FTop; r.Right := FLeft + FWidth; r.Bottom := FTop + FHeight; + {$IFDEF wince} + AdjustWindowRectEx(@r, FWinStyle, False, FWinStyleEx); + {$ELSE} AdjustWindowRectEx(r, FWinStyle, False, FWinStyleEx); + {$ENDIF} rwidth := r.Right - r.Left; rheight := r.Bottom - r.Top; end; + {$IFDEF wince} + // required for some WinCE devices + FWinStyleEx := FWinStyleEx or WS_VISIBLE; // or WS_BORDER; + FWinStyle := FWinStyleEx; + + FWinHandle := Windows.CreateWindowExW( + FWinStyleEx, // extended window style + PWideChar(wcname), // registered class name + PWideChar(wname), // window name + FWinStyle, // window style + FLeft, // horizontal position of window + FTop, // vertical position of window + rwidth, // window width + rheight, // window height + FParentWinHandle, // handle to parent or owner window + mid, // menu handle or child identifier + MainInstance, // handle to application instance + Self // window-creation data + ); + {$ELSE} FWinHandle := Windows.CreateWindowEx( FWinStyleEx, // extended window style PChar(wcname), // registered class name @@ -1364,6 +1474,7 @@ begin MainInstance, // handle to application instance Self // window-creation data ); + {$ENDIF} if waScreenCenterPos in FWindowAttributes then begin @@ -1387,7 +1498,7 @@ begin FSkipResizeMessage := False; end; -procedure TfpgWindowImpl.DoReleaseWindowHandle; +procedure TfpgGDIWindow.DoReleaseWindowHandle; begin if FWinHandle <= 0 then Exit; @@ -1395,12 +1506,12 @@ begin FWinHandle := 0; end; -procedure TfpgWindowImpl.DoRemoveWindowLookup; +procedure TfpgGDIWindow.DoRemoveWindowLookup; begin // Nothing to do here end; -procedure TfpgWindowImpl.DoSetWindowVisible(const AValue: Boolean); +procedure TfpgGDIWindow.DoSetWindowVisible(const AValue: Boolean); var r: TRect; begin @@ -1429,7 +1540,7 @@ begin Windows.ShowWindow(FWinHandle, SW_HIDE); end; -procedure TfpgWindowImpl.DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); +procedure TfpgGDIWindow.DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); begin if HandleIsValid then Windows.SetWindowPos( @@ -1438,18 +1549,18 @@ begin SWP_NOZORDER or SWP_NOSIZE);// or SWP_NOREDRAW); end; -function TfpgWindowImpl.DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; +function TfpgGDIWindow.DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; begin - if not TfpgWindowImpl(ASource).HandleIsValid then + if not TfpgGDIWindow(ASource).HandleIsValid then Exit; //==> Result.X := AScreenPos.X; Result.Y := AScreenPos.Y; - ClientToScreen(TfpgWindowImpl(ASource).WinHandle, Result); + ClientToScreen(TfpgGDIWindow(ASource).WinHandle, Result); end; { -procedure TfpgWindowImpl.MoveToScreenCenter; +procedure TfpgGDIWindow.MoveToScreenCenter; var r : TRECT; begin @@ -1460,15 +1571,19 @@ begin end; } -procedure TfpgWindowImpl.DoSetWindowTitle(const atitle: string); +procedure TfpgGDIWindow.DoSetWindowTitle(const atitle: string); begin + {$ifdef wince} + Windows.SetWindowText(WinHandle, PWideChar(Utf8Decode(ATitle))); + {$else} if UnicodeEnabledOS then Windows.SetWindowTextW(WinHandle, PWideChar(Utf8Decode(ATitle))) else Windows.SetWindowText(WinHandle, PChar(Utf8ToAnsi(ATitle))); + {$endif} end; -procedure TfpgWindowImpl.DoSetMouseCursor; +procedure TfpgGDIWindow.DoSetMouseCursor; var hc: HCURSOR; begin @@ -1496,24 +1611,24 @@ begin SetCursor(hc); end; -constructor TfpgWindowImpl.Create(AOwner: TComponent); +constructor TfpgGDIWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); FWinHandle := 0; FFullscreenIsSet := false; end; -procedure TfpgWindowImpl.ActivateWindow; +procedure TfpgGDIWindow.ActivateWindow; begin SetForegroundWindow(FWinHandle); end; -procedure TfpgWindowImpl.CaptureMouse; +procedure TfpgGDIWindow.CaptureMouse; begin Windows.SetCapture(FWinHandle); end; -procedure TfpgWindowImpl.ReleaseMouse; +procedure TfpgGDIWindow.ReleaseMouse; begin Windows.ReleaseCapture; // if PopupListFirst <> nil then @@ -1521,18 +1636,18 @@ begin // if GfxFirstPopup <> nil then SetCapture(GfxFirstPopup^.wg.WinHandle); end; -procedure TfpgWindowImpl.SetFullscreen(AValue: Boolean); +procedure TfpgGDIWindow.SetFullscreen(AValue: Boolean); begin inherited SetFullscreen(AValue); WindowSetFullscreen(AValue, True); end; -function TfpgWindowImpl.HandleIsValid: boolean; +function TfpgGDIWindow.HandleIsValid: boolean; begin Result := FWinHandle > 0; end; -procedure TfpgWindowImpl.DoUpdateWindowPosition; +procedure TfpgGDIWindow.DoUpdateWindowPosition; var bx, by: integer; begin @@ -1546,9 +1661,9 @@ begin FSkipResizeMessage := False; end; -{ TfpgCanvasImpl } +{ TfpgGDICanvas } -constructor TfpgCanvasImpl.Create; +constructor TfpgGDICanvas.Create; begin inherited; FDrawing := False; @@ -1556,7 +1671,7 @@ begin FBufferBitmap := 0; end; -destructor TfpgCanvasImpl.Destroy; +destructor TfpgGDICanvas.Destroy; begin if FDrawing then DoEndDraw; @@ -1564,7 +1679,7 @@ begin inherited; end; -procedure TfpgCanvasImpl.DoBeginDraw(awin: TfpgWindowBase; buffered: boolean); +procedure TfpgGDICanvas.DoBeginDraw(awin: TfpgWindowBase; buffered: boolean); var ARect: TfpgRect; bmsize: Windows.TSIZE; @@ -1572,8 +1687,10 @@ begin if FDrawing and buffered and (FBufferBitmap > 0) then begin // check if the dimensions are ok + {$IFNDEF wince} GetBitmapDimensionEx(FBufferBitmap, bmsize); - FDrawWindow := TfpgWindowImpl(awin); + {$ENDIF} + FDrawWindow := TfpgGDIWindow(awin); DoGetWinRect(ARect); if (bmsize.cx <> (ARect.Right-ARect.Left+1)) or (bmsize.cy <> (ARect.Bottom-ARect.Top+1)) then @@ -1582,7 +1699,7 @@ begin if not FDrawing then begin - FDrawWindow := TfpgWindowImpl(awin); + FDrawWindow := TfpgGDIWindow(awin); FWinGC := Windows.GetDC(FDrawWindow.FWinHandle); if buffered then @@ -1621,7 +1738,7 @@ begin FDrawing := True; end; -procedure TfpgCanvasImpl.DoEndDraw; +procedure TfpgGDICanvas.DoEndDraw; begin if FDrawing then begin @@ -1638,71 +1755,75 @@ begin end; end; -function TfpgCanvasImpl.GetPixel(X, Y: integer): TfpgColor; +function TfpgGDICanvas.GetPixel(X, Y: integer): TfpgColor; var c: longword; begin c := Windows.GetPixel(Fgc, X, Y); if c = CLR_INVALID then - Writeln('fpGFX/GDI: TfpgCanvasImpl.GetPixel returned an invalid color'); + Writeln('fpGFX/GDI: TfpgGDICanvas.GetPixel returned an invalid color'); Result := WinColorTofpgColor(c); end; -procedure TfpgCanvasImpl.SetPixel(X, Y: integer; const AValue: TfpgColor); +procedure TfpgGDICanvas.SetPixel(X, Y: integer; const AValue: TfpgColor); begin Windows.SetPixel(Fgc, X, Y, fpgColorToWin(AValue)); end; -procedure TfpgCanvasImpl.DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended); +procedure TfpgGDICanvas.DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended); var SX, SY, EX, EY: Longint; begin - {Stupid GDI can't tell the difference between 0 and 360°!!} + {Stupid GDI can't tell the difference between 0 and 360 degrees!!} if a2 = 0 then Exit; //==> {Stupid GDI must be told in which direction to draw} + {$IFNDEF wince} if a2 < 0 then Windows.SetArcDirection(FGc, AD_CLOCKWISE) else Windows.SetArcDirection(FGc, AD_COUNTERCLOCKWISE); + {$ENDIF} Angles2Coords(x, y, w, h, a1*16, a2*16, SX, SY, EX, EY); {$IFNDEF wince} Windows.Arc(Fgc, x, y, x+w, y+h, SX, SY, EX, EY); {$ENDIF} end; -procedure TfpgCanvasImpl.DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); +procedure TfpgGDICanvas.DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); var SX, SY, EX, EY: Longint; begin - {Stupid GDI can't tell the difference between 0 and 360°!!} + {Stupid GDI can't tell the difference between 0 and 360 degrees!!} if a2 = 0 then Exit; //==> {Stupid GDI must be told in which direction to draw} + {$IFNDEF wince} if a2 < 0 then Windows.SetArcDirection(FGc, AD_CLOCKWISE) else Windows.SetArcDirection(FGc, AD_COUNTERCLOCKWISE); + {$ENDIF} Angles2Coords(x, y, w, h, a1*16, a2*16, SX, SY, EX, EY); {$IFNDEF wince} Windows.Pie(Fgc, x, y, x+w, y+h, SX, SY, EX, EY); {$ENDIF} end; -procedure TfpgCanvasImpl.DoDrawPolygon(Points: PPoint; NumPts: Integer; Winding: boolean); +procedure TfpgGDICanvas.DoDrawPolygon(Points: PPoint; NumPts: Integer; Winding: boolean); //var // pts: array of TPoint; begin Windows.Polygon(Fgc, Points, NumPts); end; -procedure TfpgCanvasImpl.DoPutBufferToScreen(x, y, w, h: TfpgCoord); +procedure TfpgGDICanvas.DoPutBufferToScreen(x, y, w, h: TfpgCoord); begin if FBufferBitmap > 0 then BitBlt(FWinGC, x, y, w, h, Fgc, x, y, SRCCOPY); end; -procedure TfpgCanvasImpl.DoAddClipRect(const ARect: TfpgRect); +procedure TfpgGDICanvas.DoAddClipRect(const ARect: TfpgRect); var rg: HRGN; begin @@ -1714,22 +1835,32 @@ begin DeleteObject(rg); end; -procedure TfpgCanvasImpl.DoClearClipRect; +procedure TfpgGDICanvas.DoClearClipRect; begin SelectClipRgn(Fgc, 0); FClipRectSet := False; end; -procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord); +procedure TfpgGDICanvas.DoDrawLine(x1, y1, x2, y2: TfpgCoord); begin Windows.MoveToEx(Fgc, x1, y1, nil); Windows.LineTo(Fgc, x2, y2); end; -procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: TfpgCoord); +procedure TfpgGDICanvas.DoDrawRectangle(x, y, w, h: TfpgCoord); var wr: Windows.TRect; r: TfpgRect; + +{$IFDEF WinCE} +// *** copied from Lazarus +function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH) : integer; +begin +//roozbeh....works for now! + Result := Integer(DrawFocusRect(DC,Arect)); +end; +{$ENDIF} + begin if FLineStyle = lsSolid then begin @@ -1737,7 +1868,11 @@ begin wr.Top := y; wr.Right := x + w; wr.Bottom := y + h; - Windows.FrameRect(Fgc, wr, FBrush) // this handles 1x1 rectangles + {$IFDEF WinCE} + FrameRect(Fgc, wr, FBrush); + {$ELSE} + Windows.FrameRect(Fgc, wr, FBrush); // this handles 1x1 rectangles + {$ENDIF} end else begin @@ -1749,7 +1884,7 @@ begin end; end; -procedure TfpgCanvasImpl.DoDrawString(x, y: TfpgCoord; const txt: string); +procedure TfpgGDICanvas.DoDrawString(x, y: TfpgCoord; const txt: string); var WideText: widestring; begin @@ -1764,7 +1899,7 @@ begin {$endif} end; -procedure TfpgCanvasImpl.DoFillRectangle(x, y, w, h: TfpgCoord); +procedure TfpgGDICanvas.DoFillRectangle(x, y, w, h: TfpgCoord); var wr: Windows.TRect; begin @@ -1775,7 +1910,7 @@ begin Windows.FillRect(Fgc, wr, FBrush); end; -procedure TfpgCanvasImpl.DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); +procedure TfpgGDICanvas.DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); var pts: array[1..3] of Windows.TPoint; begin @@ -1788,12 +1923,12 @@ begin Windows.Polygon(Fgc, pts, 3); end; -function TfpgCanvasImpl.DoGetClipRect: TfpgRect; +function TfpgGDICanvas.DoGetClipRect: TfpgRect; begin Result := FClipRect; end; -procedure TfpgCanvasImpl.DoGetWinRect(out r: TfpgRect); +procedure TfpgGDICanvas.DoGetWinRect(out r: TfpgRect); var wr: TRect; begin @@ -1804,7 +1939,7 @@ begin r.Height := wr.Bottom - wr.Top + 1; end; -procedure TfpgCanvasImpl.DoSetClipRect(const ARect: TfpgRect); +procedure TfpgGDICanvas.DoSetClipRect(const ARect: TfpgRect); begin FClipRectSet := True; FClipRect := ARect; @@ -1813,7 +1948,7 @@ begin SelectClipRgn(Fgc, FClipRegion); end; -procedure TfpgCanvasImpl.DoSetColor(cl: TfpgColor); +procedure TfpgGDICanvas.DoSetColor(cl: TfpgColor); begin DeleteObject(FBrush); FWindowsColor := fpgColorToWin(cl); @@ -1822,7 +1957,7 @@ begin SelectObject(Fgc, FBrush); end; -procedure TfpgCanvasImpl.DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); +procedure TfpgGDICanvas.DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); const cDot: array[1..2] of DWORD = (1, 1); cDash: array[1..4] of DWORD = (4, 2, 4, 2); @@ -1838,11 +1973,15 @@ begin case AStyle of lsDot: begin + {$IFNDEF wince} FPen := ExtCreatePen(PS_GEOMETRIC or PS_ENDCAP_FLAT or PS_USERSTYLE, FLineWidth, logBrush, Length(cDot), @cDot); + {$ENDIF} end; lsDash: begin + {$IFNDEF wince} FPen := ExtCreatePen(PS_GEOMETRIC or PS_ENDCAP_FLAT or PS_USERSTYLE, FLineWidth, logBrush, Length(cDash), @cDash); + {$ENDIF} end; lsSolid: begin @@ -1856,12 +1995,12 @@ begin SelectObject(Fgc, FPen); end; -procedure TfpgCanvasImpl.DoSetTextColor(cl: TfpgColor); +procedure TfpgGDICanvas.DoSetTextColor(cl: TfpgColor); begin Windows.SetTextColor(Fgc, fpgColorToWin(cl)); end; -procedure TfpgCanvasImpl.TryFreeBackBuffer; +procedure TfpgGDICanvas.TryFreeBackBuffer; begin if FBufferBitmap > 0 then DeleteObject(FBufferBitmap); @@ -1872,15 +2011,15 @@ begin FBufgc := 0; end; -procedure TfpgCanvasImpl.DoSetFontRes(fntres: TfpgFontResourceBase); +procedure TfpgGDICanvas.DoSetFontRes(fntres: TfpgFontResourceBase); begin if fntres = nil then Exit; //==> - FCurFontRes := TfpgFontResourceImpl(fntres); + FCurFontRes := TfpgGDIFontResource(fntres); Windows.SelectObject(Fgc, FCurFontRes.Handle); end; -procedure TfpgCanvasImpl.DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); +procedure TfpgGDICanvas.DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); const DSTCOPY = $00AA0029; ROP_DSPDxax = $00E20746; @@ -1892,22 +2031,22 @@ begin Exit; //==> tmpdc := CreateCompatibleDC(wapplication.display); - SelectObject(tmpdc, TfpgImageImpl(img).BMPHandle); + SelectObject(tmpdc, TfpgGDIImage(img).BMPHandle); - if TfpgImageImpl(img).FIsTwoColor then + if TfpgGDIImage(img).FIsTwoColor then rop := PATCOPY else rop := SRCCOPY; - if TfpgImageImpl(img).MaskHandle > 0 then - MaskBlt(Fgc, x, y, w, h, tmpdc, xi, yi, TfpgImageImpl(img).MaskHandle, xi, yi, MakeRop4(rop, DSTCOPY)) + if TfpgGDIImage(img).MaskHandle > 0 then + MaskBlt(Fgc, x, y, w, h, tmpdc, xi, yi, TfpgGDIImage(img).MaskHandle, xi, yi, MakeRop4(rop, DSTCOPY)) else BitBlt(Fgc, x, y, w, h, tmpdc, xi, yi, rop); DeleteDC(tmpdc); end; -procedure TfpgCanvasImpl.DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); +procedure TfpgGDICanvas.DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); var hb: HBRUSH; nullpen: HPEN; @@ -1926,9 +2065,9 @@ begin SelectObject(Fgc, FPen); end; -{ TfpgFontResourceImpl } +{ TfpgGDIFontResource } -constructor TfpgFontResourceImpl.Create(const afontdesc: string); +constructor TfpgGDIFontResource.Create(const afontdesc: string); begin FFontData := OpenFontByDesc(afontdesc); @@ -1939,14 +2078,14 @@ begin end; end; -destructor TfpgFontResourceImpl.Destroy; +destructor TfpgGDIFontResource.Destroy; begin if HandleIsValid then Windows.DeleteObject(FFontData); inherited; end; -function TfpgFontResourceImpl.OpenFontByDesc(const desc: string): HFONT; +function TfpgGDIFontResource.OpenFontByDesc(const desc: string): HFONT; var lf: Windows.LOGFONT; facename: string; @@ -2035,30 +2174,34 @@ begin lf.lfQuality := DEFAULT_QUALITY; end; + {$IFDEF wince} + Result := CreateFontIndirectW(@lf); + {$ELSE} Result := CreateFontIndirectA(@lf); + {$ENDIF} end; -function TfpgFontResourceImpl.HandleIsValid: boolean; +function TfpgGDIFontResource.HandleIsValid: boolean; begin Result := FFontData <> 0; end; -function TfpgFontResourceImpl.GetAscent: integer; +function TfpgGDIFontResource.GetAscent: integer; begin Result := FMetrics.tmAscent; end; -function TfpgFontResourceImpl.GetDescent: integer; +function TfpgGDIFontResource.GetDescent: integer; begin Result := FMetrics.tmDescent; end; -function TfpgFontResourceImpl.GetHeight: integer; +function TfpgGDIFontResource.GetHeight: integer; begin Result := FMetrics.tmHeight; end; -function TfpgFontResourceImpl.GetTextWidth(const txt: string): integer; +function TfpgGDIFontResource.GetTextWidth(const txt: string): integer; var ts: Windows.SIZE; WideText: widestring; @@ -2080,16 +2223,16 @@ begin Result := ts.cx; end; -{ TfpgImageImpl } +{ TfpgGDIImage } -constructor TfpgImageImpl.Create; +constructor TfpgGDIImage.Create; begin FBMPHandle := 0; FMaskHandle := 0; FIsTwoColor := False; end; -procedure TfpgImageImpl.DoFreeImage; +procedure TfpgGDIImage.DoFreeImage; begin if FBMPHandle > 0 then DeleteObject(FBMPHandle); @@ -2099,7 +2242,7 @@ begin FMaskHandle := 0; end; -procedure TfpgImageImpl.DoInitImage(acolordepth, awidth, aheight: integer; aimgdata: Pointer); +procedure TfpgGDIImage.DoInitImage(acolordepth, awidth, aheight: integer; aimgdata: Pointer); var bi: TBitmapInfo; begin @@ -2128,7 +2271,11 @@ begin biClrImportant := 0; end; + {$IFNDEF wince} SetDIBits(wapplication.display, FBMPHandle, 0, aheight, aimgdata, bi, DIB_RGB_COLORS); + {$else} + WinCESetDibBits(FBMPHandle, awidth, aheight, aimgdata, bi); + {$ENDIF} FIsTwoColor := (acolordepth = 1); end; @@ -2139,7 +2286,7 @@ type bmColors: array[1..2] of longword; end; -procedure TfpgImageImpl.DoInitImageMask(awidth, aheight: integer; aimgdata: Pointer); +procedure TfpgGDIImage.DoInitImageMask(awidth, aheight: integer; aimgdata: Pointer); var bi: TMyMonoBitmap; pbi: PBitmapInfo; @@ -2167,12 +2314,16 @@ begin bi.bmColors[2] := $FFFFFF; pbi := @bi; + {$IFNDEF wince} SetDIBits(wapplication.display, FMaskHandle, 0, aheight, aimgdata, pbi^, DIB_RGB_COLORS); + {$ELSE} + WinCESetDibBits(FMaskHandle, awidth, aheight, aimgdata, pbi^); + {$ENDIF} end; -{ TfpgClipboardImpl } +{ TfpgGDIClipboard } -function TfpgClipboardImpl.DoGetText: TfpgString; +function TfpgGDIClipboard.DoGetText: TfpgString; var h: THANDLE; p: PChar; @@ -2198,7 +2349,7 @@ begin Result := FClipboardText; end; -procedure TfpgClipboardImpl.DoSetText(const AValue: TfpgString); +procedure TfpgGDIClipboard.DoSetText(const AValue: TfpgString); begin FClipboardText := AValue; if OpenClipboard(FClipboardWndHandle) then @@ -2209,7 +2360,7 @@ begin end; end; -procedure TfpgClipboardImpl.InitClipboard; +procedure TfpgGDIClipboard.InitClipboard; begin {$WARNING This does not work! 'FPGUI' window class was not registered, so CreateWindowEx always returns 0} @@ -2229,9 +2380,9 @@ begin ); end; -{ TfpgFileListImpl } +{ TfpgGDIFileList } -function TfpgFileListImpl.EncodeAttributesString(attrs: longword +function TfpgGDIFileList.EncodeAttributesString(attrs: longword ): TFileModeString; begin Result := ''; @@ -2243,13 +2394,13 @@ begin if (attrs and FILE_ATTRIBUTE_COMPRESSED) <> 0 then Result := Result + 'c'; end; -constructor TfpgFileListImpl.Create; +constructor TfpgGDIFileList.Create; begin inherited Create; FHasFileMode := false; end; -function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry; +function TfpgGDIFileList.InitializeEntry(sr: TSearchRec): TFileEntry; begin Result := inherited InitializeEntry(sr); if Assigned(Result) then @@ -2260,7 +2411,7 @@ begin end; end; -procedure TfpgFileListImpl.PopulateSpecialDirs(const aDirectory: TfpgString); +procedure TfpgGDIFileList.PopulateSpecialDirs(const aDirectory: TfpgString); const MAX_DRIVES = 25; var @@ -2276,10 +2427,12 @@ begin while n <= MAX_DRIVES do begin drvs := chr(n+ord('A'))+':\'; + {$IFNDEF wince} if Windows.GetDriveType(PChar(drvs)) <> 1 then begin FSpecialDirs.Add(drvs); end; + {$ENDIF} inc(n); end; end; diff --git a/src/corelib/gdi/fpg_interface.pas b/src/corelib/gdi/fpg_interface.pas new file mode 100644 index 00000000..c75aaa28 --- /dev/null +++ b/src/corelib/gdi/fpg_interface.pas @@ -0,0 +1,40 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit defines alias types to bind each backend graphics library + to fpg_main without the need for IFDEF's +} + +unit fpg_interface; + +{$mode objfpc}{$H+} + +interface + +uses + fpg_gdi; + +type + TfpgFontResourceImpl = TfpgGDIFontResource; + TfpgImageImpl = TfpgGDIImage; + TfpgCanvasImpl = TfpgGDICanvas; + TfpgWindowImpl = TfpgGDIWindow; + TfpgApplicationImpl = TfpgGDIApplication; + TfpgClipboardImpl = TfpgGDIClipboard; + TfpgFileListImpl = TfpgGDIFileList; + +implementation + +end. + diff --git a/src/corelib/gdi/fpg_keys_gdi.inc b/src/corelib/gdi/fpg_keys_gdi.inc index e7d79f25..914dd5f7 100644 --- a/src/corelib/gdi/fpg_keys_gdi.inc +++ b/src/corelib/gdi/fpg_keys_gdi.inc @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/gdi/fpg_utils_impl.inc b/src/corelib/gdi/fpg_utils_impl.inc index 5d72ca88..d3bb2f0c 100644 --- a/src/corelib/gdi/fpg_utils_impl.inc +++ b/src/corelib/gdi/fpg_utils_impl.inc @@ -1,7 +1,6 @@ {%mainunit fpg_utils.pas} uses - Registry, Shellapi; // GDI specific implementations of encoding functions @@ -19,7 +18,9 @@ end; procedure fpgOpenURL(const aURL: TfpgString); begin try - ShellExecute(0, 'open', PChar(aURL), nil, nil, 0) ; + {$IFNDEF wince} + ShellExecute(0, 'open', PChar(aURL), nil, nil, 1 {SW_SHOWNORMAL}); + {$ENDIF} except // do nothing end; diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk index 265e3292..11731043 100644 --- a/src/corelib/gdi/fpgui_toolkit.lpk +++ b/src/corelib/gdi/fpgui_toolkit.lpk @@ -8,26 +8,30 @@ <Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
+ <IncludeFiles Value="..\..\"/>
<OtherUnitFiles Value="..\;..\..\gui\;..\..\gui\db\"/>
<UnitOutputDirectory Value="..\..\..\lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
- <CStyleOperator Value="False"/>
<AllowLabel Value="False"/>
<CPPInline Value="False"/>
+ <UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
+ <CodeGeneration>
+ <Optimizations>
+ <OptimizationLevel Value="0"/>
+ </Optimizations>
+ </CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
- <Description Value="fpGUI Toolkit -"/>
- <License Value="Modified LGPL -"/>
- <Version Minor="6" Release="3"/>
- <Files Count="73">
+ <Description Value="fpGUI Toolkit"/>
+ <License Value="LGPL 2 with static linking exception."/>
+ <Version Minor="7"/>
+ <Files Count="80">
<Item1>
<Filename Value="..\stdimages.inc"/>
<Type Value="Include"/>
@@ -311,15 +315,43 @@ <Item71>
<Filename Value="..\fpg_extgraphics.pas"/>
<UnitName Value="fpg_extgraphics"/>
- </Item71> - <Item72> - <Filename Value="..\..\gui\fpg_colormapping.pas"/> - <UnitName Value="fpg_ColorMapping"/> - </Item72> - <Item73> - <Filename Value="..\..\gui\fpg_colorwheel.pas"/> - <UnitName Value="fpg_ColorWheel"/> + </Item71>
+ <Item72>
+ <Filename Value="..\..\gui\fpg_colormapping.pas"/>
+ <UnitName Value="fpg_ColorMapping"/>
+ </Item72>
+ <Item73>
+ <Filename Value="..\..\gui\fpg_colorwheel.pas"/>
+ <UnitName Value="fpg_ColorWheel"/>
</Item73>
+ <Item74>
+ <Filename Value="fpg_interface.pas"/>
+ <UnitName Value="fpg_interface"/>
+ </Item74>
+ <Item75>
+ <Filename Value="..\..\gui\fpg_editbtn.pas"/>
+ <UnitName Value="fpg_editbtn"/>
+ </Item75>
+ <Item76>
+ <Filename Value="..\..\gui\colordialog.inc"/>
+ <Type Value="Include"/>
+ </Item76>
+ <Item77>
+ <Filename Value="..\fpg_imgfmt_jpg.pas"/>
+ <UnitName Value="fpg_imgfmt_jpg"/>
+ </Item77>
+ <Item78>
+ <Filename Value="..\..\gui\inputquerydialog.inc"/>
+ <Type Value="Include"/>
+ </Item78>
+ <Item79>
+ <Filename Value="..\fpg_imgutils.pas"/>
+ <UnitName Value="fpg_imgutils"/>
+ </Item79>
+ <Item80>
+ <Filename Value="..\..\VERSION_FILE.inc"/>
+ <Type Value="Include"/>
+ </Item80>
</Files>
<LazDoc Paths="..\..\..\docs\xml\corelib\;..\..\..\docs\xml\corelib\x11\;..\..\..\docs\xml\corelib\gdi\;..\..\..\docs\xml\gui\"/>
<RequiredPkgs Count="1">
@@ -333,7 +365,6 @@ </UsageOptions>
<PublishOptions>
<Version Value="2"/>
- <DestinationDirectory Value="$(TestDir)\publishedpackage\"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
diff --git a/src/corelib/gdi/fpgui_toolkit.pas b/src/corelib/gdi/fpgui_toolkit.pas index 1d63fc3e..2e3e81b6 100644 --- a/src/corelib/gdi/fpgui_toolkit.pas +++ b/src/corelib/gdi/fpgui_toolkit.pas @@ -1,24 +1,25 @@ -{ This file was automatically created by Lazarus. do not edit! - This source is only used to compile and install the package. - } - -unit fpgui_toolkit; - -interface - -uses - fpg_base, fpg_main, fpg_cmdlineparams, fpg_command_intf, fpg_constants, - fpg_extinterpolation, fpg_imagelist, fpg_imgfmt_bmp, fpg_pofiles, - fpg_popupwindow, fpg_stdimages, fpg_stringhashlist, fpg_translations, - fpg_stringutils, fpg_utils, fpg_widget, fpg_wuline, fpg_animation, - fpg_basegrid, fpg_button, fpg_checkbox, fpg_combobox, fpg_customgrid, - fpg_dialogs, fpg_editcombo, fpg_edit, fpg_form, fpg_gauge, fpg_grid, - fpg_hyperlink, fpg_iniutils, fpg_label, fpg_listbox, fpg_listview, fpg_memo, - fpg_menu, fpg_mru, fpg_panel, fpg_popupcalendar, fpg_progressbar, - fpg_radiobutton, fpg_scrollbar, fpg_style, fpg_tab, fpg_trackbar, fpg_tree, - fpgui_db, fpg_gdi, fpg_impl, fpg_splitter, fpg_hint, fpg_spinedit, - fpg_extgraphics, fpg_ColorMapping, fpg_ColorWheel; - -implementation - -end. +{ This file was automatically created by Lazarus. do not edit!
+ This source is only used to compile and install the package.
+ }
+
+unit fpgui_toolkit;
+
+interface
+
+uses
+ fpg_base, fpg_main, fpg_cmdlineparams, fpg_command_intf, fpg_constants,
+ fpg_extinterpolation, fpg_imagelist, fpg_imgfmt_bmp, fpg_pofiles,
+ fpg_popupwindow, fpg_stdimages, fpg_stringhashlist, fpg_translations,
+ fpg_stringutils, fpg_utils, fpg_widget, fpg_wuline, fpg_animation,
+ fpg_basegrid, fpg_button, fpg_checkbox, fpg_combobox, fpg_customgrid,
+ fpg_dialogs, fpg_editcombo, fpg_edit, fpg_form, fpg_gauge, fpg_grid,
+ fpg_hyperlink, fpg_iniutils, fpg_label, fpg_listbox, fpg_listview, fpg_memo,
+ fpg_menu, fpg_mru, fpg_panel, fpg_popupcalendar, fpg_progressbar,
+ fpg_radiobutton, fpg_scrollbar, fpg_style, fpg_tab, fpg_trackbar, fpg_tree,
+ fpgui_db, fpg_gdi, fpg_impl, fpg_splitter, fpg_hint, fpg_spinedit,
+ fpg_extgraphics, fpg_ColorMapping, fpg_ColorWheel, fpg_interface,
+ fpg_editbtn, fpg_imgfmt_jpg, fpg_imgutils;
+
+implementation
+
+end.
diff --git a/src/corelib/lang_af.inc b/src/corelib/lang_af.inc index 5617ef91..70598111 100644 --- a/src/corelib/lang_af.inc +++ b/src/corelib/lang_af.inc @@ -20,6 +20,7 @@ rsbold = 'Vetdruk'; rscancel = 'Kanselleer'; rscannotcreatedir = 'Kan nie die lêergids skep nie'; rschange = 'Verander'; +rscharactermap = 'Character Map'; rsclose = 'Sluit'; rscollection = 'Versameling'; rsconfirm = 'Bevestig'; @@ -60,6 +61,7 @@ rshelp = 'Help'; rsignore = 'Ignoreer'; rsinformation = 'Informasie'; rsinsert = 'Invoeg'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Kursief'; rserritemofwrongtype = 'Die item is nie van <%s> tiepe nie!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Stoor'; rssaveafile = 'Stoor ''n lêer as'; rssearch = 'Soek'; rsselect = 'Kies'; +rsselectadirectory = 'Kies ''n lêergids'; rsselectafont = 'Kies ''n lettertipe'; rsshortsep = 'Sept'; rslongsep = 'September'; @@ -110,6 +113,7 @@ rssize = 'Groote'; rsstyle = 'Steil'; rsshortsun = 'So'; rslongsun = 'Sondag'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Do'; rslongthu = 'Donderdag'; rstoday = 'Vandag'; diff --git a/src/corelib/lang_de.inc b/src/corelib/lang_de.inc index e48739e2..f3f45489 100644 --- a/src/corelib/lang_de.inc +++ b/src/corelib/lang_de.inc @@ -20,6 +20,7 @@ rsbold = 'Fett'; rscancel = 'Abbrechen'; rscannotcreatedir = 'Kann Verzeichnis nicht anlegen'; rschange = 'Ändern'; +rscharactermap = 'Character Map'; rsclose = 'Schließen'; rscollection = 'Sammlung'; rsconfirm = 'Bestätigen'; @@ -60,6 +61,7 @@ rshelp = 'Hilfe'; rsignore = 'Ãœbergehen'; rsinformation = 'Information'; rsinsert = 'Einfügen'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Kursiv'; rserritemofwrongtype = 'Eintrag ist nicht vom Typ <%s>!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Speichern'; rssaveafile = 'Datei speichern unter'; rssearch = 'Suchen'; rsselect = 'Ausgewählte'; +rsselectadirectory = 'Wählen Sie ein Verzeichnis'; rsselectafont = 'Schriftart auswählen'; rsshortsep = 'Sep'; rslongsep = 'September'; @@ -110,6 +113,7 @@ rssize = 'Größe'; rsstyle = 'Stil'; rsshortsun = 'Son'; rslongsun = 'Sonntag'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Don'; rslongthu = 'Donnerstag'; rstoday = 'Heute'; diff --git a/src/corelib/lang_en.inc b/src/corelib/lang_en.inc index 792f3694..a7db8859 100644 --- a/src/corelib/lang_en.inc +++ b/src/corelib/lang_en.inc @@ -20,6 +20,7 @@ rsbold = 'Bold'; rscancel = 'Cancel'; rscannotcreatedir = 'Cannot create directory'; rschange = 'Change'; +rscharactermap = 'Character Map'; rsclose = 'Close'; rscollection = 'Collection'; rsconfirm = 'Confirm'; @@ -60,6 +61,7 @@ rshelp = 'Help'; rsignore = 'Ignore'; rsinformation = 'Information'; rsinsert = 'Insert'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Italic'; rserritemofwrongtype = 'Item is not of <%s> type!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Save'; rssaveafile = 'Save file as'; rssearch = 'Search'; rsselect = 'Select'; +rsselectadirectory = 'Select a Directory'; rsselectafont = 'Select a font'; rsshortsep = 'Sep'; rslongsep = 'September'; @@ -110,6 +113,7 @@ rssize = 'Size'; rsstyle = 'Style'; rsshortsun = 'Sun'; rslongsun = 'Sunday'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Thu'; rslongthu = 'Thursday'; rstoday = 'Today'; diff --git a/src/corelib/lang_es.inc b/src/corelib/lang_es.inc index 37ae2836..099f1939 100644 --- a/src/corelib/lang_es.inc +++ b/src/corelib/lang_es.inc @@ -20,6 +20,7 @@ rsbold = 'Negrita'; rscancel = 'Cancelar'; rscannotcreatedir = 'No se puede crear la carpeta'; rschange = 'Cambiar'; +rscharactermap = 'Character Map'; rsclose = 'Cerrar'; rscollection = 'Colección'; rsconfirm = 'Confirmar'; @@ -60,6 +61,7 @@ rshelp = 'Ayuda'; rsignore = 'Ignorar'; rsinformation = 'Información'; rsinsert = 'Insertar'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Italica'; rserritemofwrongtype = 'El item no es del tipo <%s>!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Guardar'; rssaveafile = 'Guardar como'; rssearch = 'Buscar'; rsselect = 'Seleccionar'; +rsselectadirectory = 'Seleccione un directorio'; rsselectafont = 'Seleccione una fuente'; rsshortsep = 'Sep'; rslongsep = 'September'; @@ -110,6 +113,7 @@ rssize = 'Tamaño'; rsstyle = 'Estilo'; rsshortsun = 'Dom'; rslongsun = 'Domingo'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Jun'; rslongthu = 'Jueves'; rstoday = 'Today'; diff --git a/src/corelib/lang_fr.inc b/src/corelib/lang_fr.inc index bac60936..b75ee215 100644 --- a/src/corelib/lang_fr.inc +++ b/src/corelib/lang_fr.inc @@ -20,6 +20,7 @@ rsbold = 'Gras'; rscancel = 'Annuler'; rscannotcreatedir = 'Impossible de créer le répertoire'; rschange = 'Modifier'; +rscharactermap = 'Character Map'; rsclose = 'Fermer'; rscollection = 'Collection'; rsconfirm = 'Confirmer'; @@ -60,6 +61,7 @@ rshelp = 'Aide'; rsignore = 'Ignorer'; rsinformation = 'Information'; rsinsert = 'Insérer'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Italique'; rserritemofwrongtype = 'L''''item n''''est pas du type <%s>!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Sauver'; rssaveafile = 'Sauver sous'; rssearch = 'Chercher'; rsselect = 'Selectionner'; +rsselectadirectory = 'Sélectionner un répertoire'; rsselectafont = 'Choisir la police'; rsshortsep = 'Sep'; rslongsep = 'Septembre'; @@ -110,6 +113,7 @@ rssize = 'Taille'; rsstyle = 'Style'; rsshortsun = 'Dim'; rslongsun = 'Dimanche'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Jeu'; rslongthu = 'Jeudi'; rstoday = 'Aujourd''''hui'; diff --git a/src/corelib/lang_it.inc b/src/corelib/lang_it.inc index f3223386..ece9f08f 100644 --- a/src/corelib/lang_it.inc +++ b/src/corelib/lang_it.inc @@ -20,6 +20,7 @@ rsbold = 'Grassetto'; rscancel = 'Annulla'; rscannotcreatedir = 'Non riesco a creare la cartella'; rschange = 'Cambia'; +rscharactermap = 'Character Map'; rsclose = 'Chiudi'; rscollection = 'Collezione'; rsconfirm = 'Conferma'; @@ -60,6 +61,7 @@ rshelp = 'Aiuto'; rsignore = 'Ignora'; rsinformation = 'Informazione'; rsinsert = 'Inserisci'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Italico'; rserritemofwrongtype = 'L''''elemento non è del tipo <%s> !'; rsshortjan = 'Gen'; @@ -101,6 +103,7 @@ rssave = 'Salva'; rssaveafile = 'Salva con nome'; rssearch = 'Cerca'; rsselect = 'Seleziona'; +rsselectadirectory = 'Selezionare una directory'; rsselectafont = 'Seleziona un font'; rsshortsep = 'Set'; rslongsep = 'Settembre'; @@ -110,6 +113,7 @@ rssize = 'Dimensione'; rsstyle = 'Stile'; rsshortsun = 'Dom'; rslongsun = 'Domenica'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Gio'; rslongthu = 'Giovedì'; rstoday = 'Oggi'; diff --git a/src/corelib/lang_pt.inc b/src/corelib/lang_pt.inc index 0863168f..b6a2d330 100644 --- a/src/corelib/lang_pt.inc +++ b/src/corelib/lang_pt.inc @@ -20,6 +20,7 @@ rsbold = 'Negrito'; rscancel = 'Cancelar'; rscannotcreatedir = 'Não foi possÃvel criar diretório'; rschange = 'Editar'; +rscharactermap = 'Character Map'; rsclose = 'Fechar'; rscollection = 'Coleção'; rsconfirm = 'Confirmar'; @@ -60,6 +61,7 @@ rshelp = 'Ajuda'; rsignore = 'Ignorar'; rsinformation = 'Informação'; rsinsert = 'Inserir'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'Itálico'; rserritemofwrongtype = 'Item is not of <%s> type!'; rsshortjan = 'Jan'; @@ -101,6 +103,7 @@ rssave = 'Salvar'; rssaveafile = 'Salvar arquivo como'; rssearch = 'Pesquisar'; rsselect = 'Selecionar'; +rsselectadirectory = 'Selecione um diretório'; rsselectafont = 'Selecione a fonte'; rsshortsep = 'Sep'; rslongsep = 'September'; @@ -110,6 +113,7 @@ rssize = 'Tamanho'; rsstyle = 'Estilo'; rsshortsun = 'Sun'; rslongsun = 'Sunday'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Thu'; rslongthu = 'Thursday'; rstoday = 'Today'; diff --git a/src/corelib/lang_ru.inc b/src/corelib/lang_ru.inc index 86ed9478..f1571f0b 100644 --- a/src/corelib/lang_ru.inc +++ b/src/corelib/lang_ru.inc @@ -20,6 +20,7 @@ rsbold = 'Жирный'; rscancel = 'Отмена'; rscannotcreatedir = 'Ðевозможно Ñоздать директорию'; rschange = 'Изменить'; +rscharactermap = 'Character Map'; rsclose = 'Закрыть'; rscollection = 'Группа'; rsconfirm = 'Подтвердить'; @@ -60,6 +61,7 @@ rshelp = 'Справка'; rsignore = 'ПропуÑтить'; rsinformation = 'ИнформациÑ'; rsinsert = 'Ð’Ñтавка'; +rsinsertfromcharactermap = 'Insert from Character Map'; rsitalic = 'КурÑив'; rserritemofwrongtype = 'Тип Ñлемента отличаетÑÑ Ð¾Ñ‚ <%s>!'; rsshortjan = 'Янв'; @@ -101,6 +103,7 @@ rssave = 'Сохранить'; rssaveafile = 'Сохранить файл как'; rssearch = 'ПоиÑк'; rsselect = 'Выбрать'; +rsselectadirectory = 'Выберите директорию'; rsselectafont = 'Выбор шрифта'; rsshortsep = 'Сен'; rslongsep = 'СентÑбрь'; @@ -110,6 +113,7 @@ rssize = 'Размер'; rsstyle = 'Стиль'; rsshortsun = 'Ð’Ñ'; rslongsun = 'ВоÑкреÑенье'; +rstexttoinsert = 'Text to Insert'; rsshortthu = 'Чт'; rslongthu = 'Четверг'; rstoday = 'СегоднÑ'; diff --git a/src/corelib/predefinedcolors.inc b/src/corelib/predefinedcolors.inc index 897a528d..1e6c4b54 100644 --- a/src/corelib/predefinedcolors.inc +++ b/src/corelib/predefinedcolors.inc @@ -1,4 +1,4 @@ -{%mainunit gfxbase.pas} +{%mainunit fpg_base.pas} // The following colors match the predefined Delphi Colors // NOTE: @@ -63,6 +63,10 @@ clMenuText = TfpgColor(cl_BaseNamedColor + 25); // $80000019; clMenuDisabled = TfpgColor(cl_BaseNamedColor + 26); // $8000001A; clHintWindow = TfpgColor(cl_BaseNamedColor + 27); // $8000001B; + clGridSelection = TfpgColor(cl_BaseNamedColor + 28); + clGridSelectionText = TfpgColor(cl_BaseNamedColor + 29); + clGridInactiveSel = TfpgColor(cl_BaseNamedColor + 30); + clGridInactiveSelText = TfpgColor(cl_BaseNamedColor + 31); diff --git a/src/corelib/stdimages.inc b/src/corelib/stdimages.inc index 647d2e3b..0c880278 100644 --- a/src/corelib/stdimages.inc +++ b/src/corelib/stdimages.inc @@ -1,4 +1,4 @@ -{%mainunit gfx_stdimages.pas} +{%mainunit fpg_stdimages.pas} Const stdimg_list_add_16 : Array[0..821] of byte = ( @@ -1018,6 +1018,20 @@ Const 0,224, 0, 0, 0); Const + stdimg_ellipse : Array[0..181] of byte = ( + 66, 77,182, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 10, 0, 0, 0, 4, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, 0, + 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, + 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, + 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0, 0, 0, 0, 0, + 255, 0,229, 0, 0, 0, 0, 0, 0,255, 0,229, 0, 0,255, 0,229, + 255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229, 0, 0); + +Const stdimg_refresh_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, @@ -1957,6 +1971,58 @@ Const 255,255,255,255,255,255); Const + stdimg_folder_open_file_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 165,129,103,139, 82, 41,139, 82, 41,157,108, 74,157,108, 74,157,108, + 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157,108, 74,157, + 108, 74,139, 82, 41,145,110, 84,255,255,255,255,255,255,139, 82, 41, + 209,165,123,210,165,124,210,165,124,210,165,124,210,165,124,210,165, + 124,210,165,124,210,165,124,210,165,124,210,165,124,210,165,124,209, + 165,123,139, 82, 41,255,255,255,255,255,255,157,104, 63,208,161,116, + 207,159,114,207,159,114,207,159,114,207,159,114,207,159,114,207,159, + 114,207,159,114,207,159,114,207,159,114,207,159,114,208,161,116,139, + 82, 41,255,255,255,139, 82, 41,196,151,112,208,162,119,207,160,117, + 207,160,117,207,160,117,207,160,117,207,160,117,207,160,117,207,160, + 117,207,160,117,207,160,117,207,160,117,208,162,119,196,151,112,139, + 82, 41,139, 82, 41,206,164,127,210,165,123,209,164,122,209,164,122, + 209,164,122,209,164,122,209,164,122,209,164,122,209,164,122,209,164, + 122,209,164,122,209,164,122,210,166,124,212,169,129,139, 82, 41,139, + 82, 41,215,180,148,220,186,153,220,186,153,220,186,153,220,185,152, + 216,179,143,212,169,130,211,168,127,211,168,127,211,168,127,211,168, + 127,211,168,127,212,168,128,209,169,133,139, 82, 41,139, 82, 41,139, + 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41, + 210,173,142,218,180,145,217,179,145,217,179,145,217,179,145,217,179, + 145,217,180,145,217,183,152,139, 82, 41,255,255,255,139, 82, 41,127, + 120,111,253,253,253,248,249,249,243,241,240,205,137, 89,139, 82, 41, + 139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, + 41,139, 82, 41,139, 82, 41,255,255,255,139, 82, 41,142,136,127,242, + 242,242,241,242,241,241,241,241,205,137, 89,255,247,240,253,231,214, + 253,230,212,252,228,208,251,227,203,254,243,232,205,136, 88,139, 82, + 41,255,255,255,255,255,255,139, 82, 41,177,154,132,151,138,124,150, + 137,123,148,136,121,205,137, 89,255,247,242, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92,253,242,231,205,137, 89,139, 82, 41,255,255, + 255,255,255,255,139, 82, 41,218,183,153,212,172,137,212,172,137,213, + 174,140,205,136, 88,254,247,241,252,228,209,251,226,204,249,221,196, + 247,218,192,252,242,233,205,137, 89,139, 82, 41,255,255,255,255,255, + 255,157,103, 62,197,159,132,213,181,155,213,181,155,211,179,152,204, + 135, 87,255,247,241, 93, 93, 93, 92, 92, 92, 92, 92, 92,254,249,243, + 255,247,240,205,137, 89,255,255,255,255,255,255,255,255,255,255,255, + 255,139, 82, 41,139, 82, 41,139, 82, 41,139, 82, 41,205,137, 89,255, + 247,240,255,247,240,255,247,240,255,247,240,255,247,240,255,247,240, + 205,137, 89,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,205,137, 89,205,137, 89,205, + 137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89, + 255,255,255,255,255,255); + +Const stdimg_btn_close_16 : Array[0..821] of byte = ( 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, @@ -2624,3 +2690,57 @@ Const 255,221,223,222,145,149,148,162,166,165,255,255,255,255,255,255,255, 255,255,255,255,255,185,187,186,148,152,150,255,255,255,255,255,255, 255,255,255,255,255,255); + +Const + stdimg_menu_check_16 : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0, 0, 0, 0, + 255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + + diff --git a/src/corelib/x11/fpg_impl.pas b/src/corelib/x11/fpg_impl.pas index 81b8012c..c4ebbe8f 100644 --- a/src/corelib/x11/fpg_impl.pas +++ b/src/corelib/x11/fpg_impl.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/x11/fpg_interface.pas b/src/corelib/x11/fpg_interface.pas new file mode 100644 index 00000000..c4adf079 --- /dev/null +++ b/src/corelib/x11/fpg_interface.pas @@ -0,0 +1,40 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit defines alias types to bind each backend graphics library + to fpg_main without the need for IFDEF's +} + +unit fpg_interface; + +{$mode objfpc}{$H+} + +interface + +uses + fpg_x11; + +type + TfpgFontResourceImpl = TfpgX11FontResource; + TfpgImageImpl = TfpgX11Image; + TfpgCanvasImpl = TfpgX11Canvas; + TfpgWindowImpl = TfpgX11Window; + TfpgApplicationImpl = TfpgX11Application; + TfpgClipboardImpl = TfpgX11Clipboard; + TfpgFileListImpl = TfpgX11FileList; + +implementation + +end. + diff --git a/src/corelib/x11/fpg_keyconv_x11.pas b/src/corelib/x11/fpg_keyconv_x11.pas index 80c53417..dce0487c 100644 --- a/src/corelib/x11/fpg_keyconv_x11.pas +++ b/src/corelib/x11/fpg_keyconv_x11.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/x11/fpg_netlayer_x11.pas b/src/corelib/x11/fpg_netlayer_x11.pas index 6a2aeeb6..bd104dae 100644 --- a/src/corelib/x11/fpg_netlayer_x11.pas +++ b/src/corelib/x11/fpg_netlayer_x11.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/corelib/x11/fpg_utils_impl.inc b/src/corelib/x11/fpg_utils_impl.inc index 2099addb..d8625b8c 100644 --- a/src/corelib/x11/fpg_utils_impl.inc +++ b/src/corelib/x11/fpg_utils_impl.inc @@ -23,6 +23,8 @@ begin Helper := ''; if fpsystem('which xdg-open') = 0 then Helper := 'xdg-open' + else if FileExists('/usr/bin/sensible-browser') then + Helper := '/usr/bin/sensible-browser' else if FileExists('/etc/alternatives/x-www-browser') then Helper := '/etc/alternatives/x-www-browser' else if fpsystem('which firefox') = 0 then diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index e6696677..3d832130 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -52,6 +52,7 @@ type PInt = ^integer; + {$HINTS OFF} TXIC = record dummy: Pointer; end; @@ -62,6 +63,7 @@ type dummy: Pointer; end; PXIM = ^TXIM; + {$HINTS ON} TXdbeSwapInfo = record @@ -109,7 +111,6 @@ const PROP_MWM_HINTS_ELEMENTS = 5; type - TXWindowStateFlag = (xwsfMapped); TXWindowStateFlags = set of TXWindowStateFlag; @@ -117,10 +118,10 @@ type TX11EventFilter = function(const AEvent: TXEvent): Boolean of object; // forward declaration - TfpgWindowImpl = class; + TfpgX11Window = class; - TfpgFontResourceImpl = class(TfpgFontResourceBase) + TfpgX11FontResource = class(TfpgFontResourceBase) private FFontData: PXftFont; function DoGetTextWidthClassic(const txt: string): integer; @@ -138,7 +139,7 @@ type end; - TfpgImageImpl = class(TfpgImageBase) + TfpgX11Image = class(TfpgImageBase) private FXimg: TXImage; FXimgmask: TXImage; @@ -153,14 +154,14 @@ type end; - TfpgCanvasImpl = class(TfpgCanvasBase) + TfpgX11Canvas = class(TfpgCanvasBase) private FDrawing: boolean; - FDrawWindow: TfpgWindowImpl; + FDrawWindow: TfpgX11Window; FBufferPixmap: TfpgDCHandle; FDrawHandle: TfpgDCHandle; Fgc: TfpgGContext; - FCurFontRes: TfpgFontResourceImpl; + FCurFontRes: TfpgX11FontResource; FClipRect: TfpgRect; FClipRectSet: boolean; FXftDraw: PXftDraw; @@ -203,12 +204,12 @@ type end; - TfpgWindowImpl = class(TfpgWindowBase) + TfpgX11Window = class(TfpgWindowBase) protected FWinFlags: TXWindowStateFlags; FWinHandle: TfpgWinHandle; FBackupWinHandle: TfpgWinHandle; // Used by DestroyNotify & UnmapNotify events - FModalForWin: TfpgWindowImpl; + FModalForWin: TfpgX11Window; procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); override; procedure DoReleaseWindowHandle; override; procedure DoRemoveWindowLookup; override; @@ -229,9 +230,9 @@ type end; - TfpgApplicationImpl = class(TfpgApplicationBase) + TfpgX11Application = class(TfpgApplicationBase) private - FComposeBuffer: String[32]; + FComposeBuffer: TfpgString; FComposeStatus: TStatus; FEventFilter: TX11EventFilter; function ConvertShiftState(AState: Cardinal): TShiftState; @@ -268,12 +269,12 @@ type function Screen_dpi_y: integer; override; function Screen_dpi: integer; override; property Display: PXDisplay read FDisplay; - property RootWindow: TfpgWinHandle read FRootWindow; - property EventFilter: TX11EventFilter read FEventFilter write FEventFilter; + property RootWindow: TfpgWinHandle read FRootWindow; platform; + property EventFilter: TX11EventFilter read FEventFilter write FEventFilter; platform; end; - TfpgClipboardImpl = class(TfpgClipboardBase) + TfpgX11Clipboard = class(TfpgClipboardBase) private FWaitingForSelection: Boolean; protected @@ -284,11 +285,13 @@ type end; - TfpgFileListImpl = class(TfpgFileListBase) - function EncodeModeString(FileMode: longword): TFileModeString; - constructor Create; override; + TfpgX11FileList = class(TfpgFileListBase) + protected function InitializeEntry(sr: TSearchRec): TFileEntry; override; procedure PopulateSpecialDirs(const aDirectory: TfpgString); override; + public + constructor Create; override; + function EncodeModeString(FileMode: longword): TFileModeString; end; @@ -299,7 +302,9 @@ implementation uses baseunix, - users, { for *nix user and group name support } + {$IFNDEF DARWIN} + users, { For unix user and group name support. Mac+X11 doesn't like this } + {$ENDIF} fpg_main, fpg_widget, fpg_popupwindow, @@ -383,7 +388,7 @@ type // single direction linked list WindowLookupRec = record - w: TfpgWindowImpl; + w: TfpgX11Window; Next: PWindowLookupRec; end; @@ -391,7 +396,7 @@ var FirstWindowLookupRec: PWindowLookupRec; LastWindowLookupRec: PWindowLookupRec; -procedure AddWindowLookup(w: TfpgWindowImpl); +procedure AddWindowLookup(w: TfpgX11Window); var p: PWindowLookupRec; begin @@ -408,7 +413,7 @@ begin LastWindowLookupRec := p; end; -procedure RemoveWindowLookup(w: TfpgWindowImpl); +procedure RemoveWindowLookup(w: TfpgX11Window); var prevp: PWindowLookupRec; p: PWindowLookupRec; @@ -437,7 +442,7 @@ begin end; end; -function FindWindowByHandle(wh: TfpgWinHandle): TfpgWindowImpl; +function FindWindowByHandle(wh: TfpgWinHandle): TfpgX11Window; var p: PWindowLookupRec; begin @@ -457,7 +462,7 @@ begin Result := nil; end; -function FindWindowByBackupHandle(wh: TfpgWinHandle): TfpgWindowImpl; +function FindWindowByBackupHandle(wh: TfpgWinHandle): TfpgX11Window; var p: PWindowLookupRec; begin @@ -534,7 +539,7 @@ begin e._type := SelectionNotify; e.requestor := ev.xselectionrequest.requestor; e.selection := ev.xselectionrequest.selection; - e.selection := xapplication.xia_clipboard; +// e.selection := xapplication.xia_clipboard; e.target := ev.xselectionrequest.target; e.time := ev.xselectionrequest.time; e._property := ev.xselectionrequest._property; @@ -543,7 +548,7 @@ begin begin a := XA_STRING; XChangeProperty(xapplication.Display, e.requestor, e._property, - XA_ATOM, sizeof(TAtom)*8, 0, PByte(@a), sizeof(TAtom)); + XA_ATOM, 32, PropModeReplace, PByte(@a), Sizeof(TAtom)); // I think last parameter is right? end else begin @@ -566,9 +571,9 @@ begin end; -{ TfpgApplicationImpl } +{ TfpgX11Application } -function TfpgApplicationImpl.ConvertShiftState(AState: Cardinal): TShiftState; +function TfpgX11Application.ConvertShiftState(AState: Cardinal): TShiftState; begin Result := []; if (AState and Button1Mask) <> 0 then @@ -595,7 +600,7 @@ begin Include(Result, ssAltGr); end; -function TfpgApplicationImpl.KeySymToKeycode(KeySym: TKeySym): Word; +function TfpgX11Application.KeySymToKeycode(KeySym: TKeySym): Word; const Table_20aX: array[$20a0..$20ac] of Word = (keyEcuSign, keyColonSign, keyCruzeiroSign, keyFFrancSign, keyLiraSign, keyMillSign, keyNairaSign, @@ -664,17 +669,23 @@ begin {$ENDIF} end; -function TfpgApplicationImpl.StartComposing(const Event: TXEvent): TKeySym; +function TfpgX11Application.StartComposing(const Event: TXEvent): TKeySym; var l: integer; begin + SetLength(FComposeBuffer, 20); // buffer set to some default size // Xutf8LookupString returns the size of FComposeBuffer in bytes. l := Xutf8LookupString(InputContext, @Event.xkey, @FComposeBuffer[1], - SizeOf(FComposeBuffer) - 1, @Result, @FComposeStatus); + Length(FComposeBuffer), @Result, @FComposeStatus); SetLength(FComposeBuffer, l); + // if overflow occured, then previous SetLength() would have fixed the buffer + // size, so run Xutf8LookupString again to read correct value. + if FComposeStatus = XBufferOverflow then + Xutf8LookupString(InputContext, @Event.xkey, @FComposeBuffer[1], + Length(FComposeBuffer), @Result, @FComposeStatus); end; -function TfpgApplicationImpl.DoGetFontFaceList: TStringList; +function TfpgX11Application.DoGetFontFaceList: TStringList; var pfs: PFcFontSet; ppat: PPFcPattern; @@ -682,7 +693,8 @@ var s: string; pc: PChar; begin - pfs := XftListFonts(Display, DefaultScreen, [FC_SCALABLE, FcTypeBool, 1, 0, FC_FAMILY, 0]); + // this now even returns non-scaleable fonts which is what we sometimes want. + pfs := XftListFonts(Display, DefaultScreen, [0, FC_FAMILY, 0]); if pfs = nil then Exit; //==> @@ -706,7 +718,7 @@ begin Result.Sort; end; -constructor TfpgApplicationImpl.Create(const AParams: string); +constructor TfpgX11Application.Create(const AParams: string); begin inherited Create(AParams); FIsInitialized := False; @@ -741,15 +753,14 @@ begin if InputMethod = nil then Exit; - InputContext := XCreateIC(InputMethod, [XNInputStyle, XIMPreeditNothing or XIMStatusNothing, 0]); + InputContext := XCreateIC(InputMethod, [XNInputStyle, XIMPreeditNothing or XIMStatusNothing, nil]); if InputContext = nil then Exit; - FIsInitialized := True; xapplication := TfpgApplication(self); end; -destructor TfpgApplicationImpl.Destroy; +destructor TfpgX11Application.Destroy; begin netlayer.Free; XCloseDisplay(FDisplay); @@ -757,7 +768,7 @@ begin inherited Destroy; end; -function TfpgApplicationImpl.DoMessagesPending: boolean; +function TfpgX11Application.DoMessagesPending: boolean; begin Result := (XPending(display) > 0); end; @@ -823,15 +834,15 @@ begin end; end; -procedure TfpgApplicationImpl.DoWaitWindowMessage(atimeoutms: integer); +procedure TfpgX11Application.DoWaitWindowMessage(atimeoutms: integer); var ev: TXEvent; NewEvent: TXevent; i: integer; r: integer; blockmsg: boolean; - w: TfpgWindowImpl; - ew: TfpgWindowImpl; + w: TfpgX11Window; + ew: TfpgX11Window; kwg: TfpgWidget; wh: TfpgWinHandle; wa: TXWindowAttributes; @@ -848,9 +859,9 @@ var procedure PrintKeyEvent(const event: TXEvent); var keysym: TKeySym; - compose_status: TXComposeStatus; - length: integer; - s: string[10]; + icstatus: TStatus; + l: integer; + s: string; begin case event._type of X.KeyPress: @@ -866,10 +877,12 @@ var writeln('not a key event '); end; end; - length := Xutf8LookupString(InputContext, @event.xkey, @s[1], 9, @keysym, @compose_status); - SetLength(s, length); - if((length > 0) and (length <=9)) then - writeln('result of xlookupstring [' + s + ']'); + SetLength(s, 20); + l := Xutf8LookupString(InputContext, @event.xkey, @s[1], Length(s), @keysym, @icstatus); + SetLength(s, l); + if icstatus = XBufferOverflow then + Xutf8LookupString(InputContext, @event.xkey, @s[1], Length(s), @keysym, @icstatus); + writeln('result of xlookupstring [' + s + ']'); writeln(Format('*** keysym [%s] ', [XKeysymToString(keysym)])); end; @@ -1042,7 +1055,7 @@ begin begin ew := w; while (w <> nil) and (w.Parent <> nil) do - w := TfpgWindowImpl(w.Parent); + w := TfpgX11Window(w.Parent); if (w <> nil) and (PopupListFind(w.WinHandle) = nil) and (not PopupDontCloseWidget(TfpgWidget(ew))) then @@ -1055,7 +1068,7 @@ begin w := FindWindowByHandle(ev.xbutton.window); // restore w if xapplication.TopModalForm <> nil then begin - ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w))); + ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then blockmsg := true; end; @@ -1133,7 +1146,7 @@ begin ReportLostWindow(ev); if xapplication.TopModalForm <> nil then begin - ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w))); + ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then blockmsg := true; end; @@ -1168,7 +1181,7 @@ begin if xapplication.TopModalForm <> nil then begin // This is ugly!!!!!!!!!!!!!!! - ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w))); + ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w))); if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then blockmsg := true; end; @@ -1271,7 +1284,7 @@ begin if not Assigned(w) then ReportLostWindow(ev) else - RemoveWindowLookup(TfpgWindowImpl(w)); + RemoveWindowLookup(TfpgX11Window(w)); end; X.GraphicsExpose, @@ -1294,28 +1307,28 @@ begin end; end; -procedure TfpgApplicationImpl.DoFlush; +procedure TfpgX11Application.DoFlush; begin XFlush(FDisplay); end; -function TfpgApplicationImpl.GetScreenWidth: TfpgCoord; +function TfpgX11Application.GetScreenWidth: TfpgCoord; var wa: TXWindowAttributes; begin - XGetWindowAttributes(FDisplay, RootWindow, @wa); + XGetWindowAttributes(FDisplay, FRootWindow, @wa); Result := wa.Width; end; -function TfpgApplicationImpl.GetScreenHeight: TfpgCoord; +function TfpgX11Application.GetScreenHeight: TfpgCoord; var wa: TXWindowAttributes; begin - XGetWindowAttributes(FDisplay, RootWindow, @wa); + XGetWindowAttributes(FDisplay, FRootWindow, @wa); Result := wa.Height; end; -function TfpgApplicationImpl.Screen_dpi_x: integer; +function TfpgX11Application.Screen_dpi_x: integer; var mm: integer; begin @@ -1328,7 +1341,7 @@ begin Result := 96; // seems to be a well known default. :-( end; -function TfpgApplicationImpl.Screen_dpi_y: integer; +function TfpgX11Application.Screen_dpi_y: integer; var mm: integer; begin @@ -1341,7 +1354,7 @@ begin Result := Screen_dpi_x; // same as width end; -function TfpgApplicationImpl.Screen_dpi: integer; +function TfpgX11Application.Screen_dpi: integer; begin Result := Screen_dpi_y; {$IFDEF DEBUG} @@ -1351,9 +1364,9 @@ begin {$ENDIF} end; -{ TfpgWindowImpl } +{ TfpgX11Window } -procedure TfpgWindowImpl.DoAllocateWindowHandle(AParent: TfpgWindowBase); +procedure TfpgX11Window.DoAllocateWindowHandle(AParent: TfpgWindowBase); var pwh: TfpgWinHandle; wh: TfpgWinHandle; @@ -1372,7 +1385,7 @@ begin Exit; //==> if AParent <> nil then - pwh := TfpgWindowImpl(AParent).WinHandle + pwh := TfpgX11Window(AParent).WinHandle else pwh := xapplication.RootWindow; @@ -1385,6 +1398,7 @@ begin end; AdjustWindowStyle; + wh := XCreateWindow(xapplication.Display, pwh, FLeft, FTop, FWidth, FHeight, 0, CopyFromParent, @@ -1461,9 +1475,9 @@ begin begin lmwh := 0; if fpgApplication.PrevModalForm <> nil then - lmwh := TfpgWindowImpl(fpgApplication.PrevModalForm).WinHandle + lmwh := TfpgX11Window(fpgApplication.PrevModalForm).WinHandle else if fpgApplication.MainForm <> nil then - lmwh := TfpgWindowImpl(fpgApplication.MainForm).WinHandle; + lmwh := TfpgX11Window(fpgApplication.MainForm).WinHandle; if lmwh <> 0 then begin XSetTransientForHint(xapplication.display, FWinHandle, lmwh); @@ -1483,7 +1497,7 @@ begin prop := XInternAtom(xapplication.display, '_MOTIF_WM_INFO', longbool(0)); if prop = X.None then begin - writeln('Window Manager does not support MWM hints. Bypassing window manager control for borderless window.'); +// writeln('Window Manager does not support MWM hints. Bypassing window manager control for borderless window.'); // Set Override Redirect here! mwmhints.flags := 0; end @@ -1514,7 +1528,7 @@ begin AddWindowLookup(self); end; -procedure TfpgWindowImpl.DoReleaseWindowHandle; +procedure TfpgX11Window.DoReleaseWindowHandle; //var // lCallTrace: IInterface; begin @@ -1533,13 +1547,13 @@ begin FWinHandle := 0; end; -procedure TfpgWindowImpl.DoRemoveWindowLookup; +procedure TfpgX11Window.DoRemoveWindowLookup; begin // PrintCallTraceDbgLn('RemoveWindowLookup ' + Name + ' [' + Classname + ']'); RemoveWindowLookup(self); end; -procedure TfpgWindowImpl.DoSetWindowVisible(const AValue: Boolean); +procedure TfpgX11Window.DoSetWindowVisible(const AValue: Boolean); begin if AValue then begin @@ -1562,34 +1576,34 @@ begin end; end; -function TfpgWindowImpl.HandleIsValid: boolean; +function TfpgX11Window.HandleIsValid: boolean; begin Result := (FWinHandle > 0); end; -procedure TfpgWindowImpl.DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); +procedure TfpgX11Window.DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); begin if HandleIsValid then XMoveWindow(xapplication.display, FWinHandle, x, y); end; -function TfpgWindowImpl.DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; +function TfpgX11Window.DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; var dx: integer; dy: integer; cw: TfpgWinHandle; begin - if not TfpgWindowImpl(ASource).HandleIsValid then + if not TfpgX11Window(ASource).HandleIsValid then Exit; //==> - XTranslateCoordinates(xapplication.display, TfpgWindowImpl(ASource).WinHandle, + XTranslateCoordinates(xapplication.display, TfpgX11Window(ASource).WinHandle, XDefaultRootWindow(xapplication.display), AScreenPos.X, AScreenPos.Y, @dx, @dy, @cw); Result.X := dx; Result.Y := dy; end; -procedure TfpgWindowImpl.DoUpdateWindowPosition; +procedure TfpgX11Window.DoUpdateWindowPosition; var w: longword; h: longword; @@ -1607,14 +1621,17 @@ begin XMoveResizeWindow(xapplication.display, FWinHandle, FLeft, FTop, w, h); end; -procedure TfpgWindowImpl.DoSetMouseCursor; +procedure TfpgX11Window.DoSetMouseCursor; var xc: TCursor; shape: integer; begin if not HasHandle then + begin + FMouseCursorIsDirty := True; Exit; //==> - + end; + case FMouseCursor of mcSizeEW: shape := XC_sb_h_double_arrow; mcSizeNS: shape := XC_sb_v_double_arrow; @@ -1634,9 +1651,11 @@ begin xc := XCreateFontCursor(xapplication.Display, shape); XDefineCursor(xapplication.Display, FWinHandle, xc); XFreeCursor(xapplication.Display, xc); + + FMouseCursorIsDirty := False; end; -procedure TfpgWindowImpl.DoSetWindowTitle(const ATitle: string); +procedure TfpgX11Window.DoSetWindowTitle(const ATitle: string); var tp: TXTextProperty; begin @@ -1656,19 +1675,19 @@ begin XSetWMIconName(xapplication.Display, FWinHandle, @tp); end; -constructor TfpgWindowImpl.Create(AOwner: TComponent); +constructor TfpgX11Window.Create(AOwner: TComponent); begin inherited Create(AOwner); FWinHandle := 0; FBackupWinHandle := 0; end; -procedure TfpgWindowImpl.ActivateWindow; +procedure TfpgX11Window.ActivateWindow; begin XSetInputFocus(xapplication.Display, FWinHandle, RevertToParent, CurrentTime); end; -procedure TfpgWindowImpl.CaptureMouse; +procedure TfpgX11Window.CaptureMouse; begin XGrabPointer(xapplication.Display, FWinHandle, TBool(False), @@ -1682,20 +1701,20 @@ begin ); end; -procedure TfpgWindowImpl.ReleaseMouse; +procedure TfpgX11Window.ReleaseMouse; begin XUngrabPointer(xapplication.display, CurrentTime); end; -procedure TfpgWindowImpl.SetFullscreen(AValue: Boolean); +procedure TfpgX11Window.SetFullscreen(AValue: Boolean); begin inherited SetFullscreen(AValue); fpgApplication.netlayer.WindowSetFullscreen(FWinHandle, AValue); end; -{ TfpgFontResourceImpl } +{ TfpgX11FontResource } -function TfpgFontResourceImpl.DoGetTextWidthClassic(const txt: string): integer; +function TfpgX11FontResource.DoGetTextWidthClassic(const txt: string): integer; var extents: TXGlyphInfo; begin @@ -1703,7 +1722,7 @@ begin Result := extents.xOff; end; -function TfpgFontResourceImpl.DoGetTextWidthWorkaround(const txt: string): integer; +function TfpgX11FontResource.DoGetTextWidthWorkaround(const txt: string): integer; var extents: TXGlyphInfo; ch: string; @@ -1719,40 +1738,40 @@ begin end; end; -constructor TfpgFontResourceImpl.Create(const afontdesc: string); +constructor TfpgX11FontResource.Create(const afontdesc: string); begin FFontData := XftFontOpenName(xapplication.display, xapplication.DefaultScreen, PChar(afontdesc)); end; -destructor TfpgFontResourceImpl.Destroy; +destructor TfpgX11FontResource.Destroy; begin if HandleIsValid then XftFontClose(xapplication.Display, FFontData); inherited; end; -function TfpgFontResourceImpl.HandleIsValid: boolean; +function TfpgX11FontResource.HandleIsValid: boolean; begin Result := (FFontData <> nil); end; -function TfpgFontResourceImpl.GetAscent: integer; +function TfpgX11FontResource.GetAscent: integer; begin Result := FFontData^.ascent; end; -function TfpgFontResourceImpl.GetDescent: integer; +function TfpgX11FontResource.GetDescent: integer; begin Result := FFontData^.descent; end; -function TfpgFontResourceImpl.GetHeight: integer; +function TfpgX11FontResource.GetHeight: integer; begin // Do NOT use FFontData^.height as it isn't as accurate Result := GetAscent + GetDescent; end; -function TfpgFontResourceImpl.GetTextWidth(const txt: string): integer; +function TfpgX11FontResource.GetTextWidth(const txt: string): integer; begin if length(txt) < 1 then begin @@ -1767,9 +1786,9 @@ begin Result := DoGetTextWidthWorkaround(txt); end; -{ TfpgCanvasImpl } +{ TfpgX11Canvas } -constructor TfpgCanvasImpl.Create; +constructor TfpgX11Canvas.Create; begin inherited; FDrawing := False; @@ -1782,7 +1801,7 @@ begin FClipRegion := nil; end; -destructor TfpgCanvasImpl.Destroy; +destructor TfpgX11Canvas.Destroy; begin if FDrawing then DoEndDraw; @@ -1791,7 +1810,7 @@ begin inherited Destroy; end; -procedure TfpgCanvasImpl.DoBeginDraw(awin: TfpgWindowBase; buffered: boolean); +procedure TfpgX11Canvas.DoBeginDraw(awin: TfpgWindowBase; buffered: boolean); var x: integer; y: integer; @@ -1804,15 +1823,15 @@ var pmh: longword; GcValues: TXGcValues; begin - if Assigned(TfpgWindowImpl(awin)) then + if Assigned(TfpgX11Window(awin)) then begin // This occurs every now and again with TfpgMemo and InvertCaret painting! // Investigate this. - if not TfpgWindowImpl(awin).HasHandle then + if not TfpgX11Window(awin).HasHandle then raise Exception.Create('Window doesn''t have a Handle'); end; - XGetGeometry(xapplication.display, TfpgWindowImpl(awin).FWinHandle, @rw, @x, @y, @w, @h, @bw, @d); + XGetGeometry(xapplication.display, TfpgX11Window(awin).FWinHandle, @rw, @x, @y, @w, @h, @bw, @d); if FDrawing and buffered and (FBufferPixmap > 0) then if FBufferPixmap > 0 then @@ -1825,7 +1844,7 @@ begin if not FDrawing then begin - FDrawWindow := TfpgWindowImpl(awin); + FDrawWindow := TfpgX11Window(awin); if buffered then begin @@ -1881,13 +1900,12 @@ begin XDefaultColormap(xapplication.display, xapplication.DefaultScreen)); FClipRegion := XCreateRegion; - end; FDrawing := True; end; -procedure TfpgCanvasImpl.DoPutBufferToScreen(x, y, w, h: TfpgCoord); +procedure TfpgX11Canvas.DoPutBufferToScreen(x, y, w, h: TfpgCoord); var cgc: TfpgGContext; GcValues: TXGcValues; @@ -1900,7 +1918,7 @@ begin end; end; -procedure TfpgCanvasImpl.DoEndDraw; +procedure TfpgX11Canvas.DoEndDraw; begin if FDrawing then begin @@ -1916,7 +1934,7 @@ begin end; end; -function TfpgCanvasImpl.GetPixel(X, Y: integer): TfpgColor; +function TfpgX11Canvas.GetPixel(X, Y: integer): TfpgColor; var Image: PXImage; Pixel: Cardinal; @@ -1941,7 +1959,7 @@ begin end; end; -procedure TfpgCanvasImpl.SetPixel(X, Y: integer; const AValue: TfpgColor); +procedure TfpgX11Canvas.SetPixel(X, Y: integer; const AValue: TfpgColor); var oldColor: TfpgColor; begin @@ -1951,19 +1969,19 @@ begin SetColor(oldColor); end; -procedure TfpgCanvasImpl.DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended); +procedure TfpgX11Canvas.DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended); begin XDrawArc(xapplication.display, FDrawHandle, Fgc, x, y, w-1, h-1, Trunc(64 * a1), Trunc(64 * a2)); end; -procedure TfpgCanvasImpl.DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); +procedure TfpgX11Canvas.DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); begin XFillArc(xapplication.display, FDrawHandle, Fgc, x, y, w, h, Trunc(64 * a1), Trunc(64 * a2)); end; -procedure TfpgCanvasImpl.DoDrawPolygon(Points: fpg_base.PPoint; NumPts: Integer; Winding: boolean); +procedure TfpgX11Canvas.DoDrawPolygon(Points: fpg_base.PPoint; NumPts: Integer; Winding: boolean); var PointArray: PXPoint; i: integer; @@ -1980,7 +1998,7 @@ begin FreeMem(PointArray); end; -procedure TfpgCanvasImpl.BufferFreeTimer(Sender: TObject); +procedure TfpgX11Canvas.BufferFreeTimer(Sender: TObject); begin {$IFDEF DEBUG} WriteLn('fpGFX/X11: Freeing Buffer w=', FPixWidth, ' h=', FPixHeight); @@ -1989,31 +2007,31 @@ begin FreeAndNil(FBufferFreeTimer); end; -procedure TfpgCanvasImpl.TryFreePixmap; +procedure TfpgX11Canvas.TryFreePixmap; begin if FBufferPixmap > 0 then XFreePixmap(xapplication.Display, FBufferPixmap); FBufferPixmap := 0; end; -procedure TfpgCanvasImpl.DoSetFontRes(fntres: TfpgFontResourceBase); +procedure TfpgX11Canvas.DoSetFontRes(fntres: TfpgFontResourceBase); begin if fntres = nil then Exit; //==> - FCurFontRes := TfpgFontResourceImpl(fntres); + FCurFontRes := TfpgX11FontResource(fntres); end; -procedure TfpgCanvasImpl.DoSetTextColor(cl: TfpgColor); +procedure TfpgX11Canvas.DoSetTextColor(cl: TfpgColor); begin SetXftColor(cl, FColorTextXft); end; -procedure TfpgCanvasImpl.DoSetColor(cl: TfpgColor); +procedure TfpgX11Canvas.DoSetColor(cl: TfpgColor); begin XSetForeGround(xapplication.display, Fgc, fpgColorToX(cl)); end; -procedure TfpgCanvasImpl.DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); +procedure TfpgX11Canvas.DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); const cDot: array[0..1] of Char = #1#1; cDash: array[0..1] of Char = #4#2; @@ -2060,7 +2078,7 @@ begin end; { case } end; -procedure TfpgCanvasImpl.DoDrawString(x, y: TfpgCoord; const txt: string); +procedure TfpgX11Canvas.DoDrawString(x, y: TfpgCoord; const txt: string); begin if Length(txt) < 1 then Exit; //==> @@ -2069,7 +2087,7 @@ begin y + FCurFontRes.GetAscent, PChar(txt), Length(txt)); end; -procedure TfpgCanvasImpl.DoGetWinRect(out r: TfpgRect); +procedure TfpgX11Canvas.DoGetWinRect(out r: TfpgRect); var rw: TfpgWinHandle; x: integer; @@ -2083,12 +2101,12 @@ begin @(r.width), @(r.height), @bw, @d); end; -procedure TfpgCanvasImpl.DoFillRectangle(x, y, w, h: TfpgCoord); +procedure TfpgX11Canvas.DoFillRectangle(x, y, w, h: TfpgCoord); begin XFillRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w, h); end; -procedure TfpgCanvasImpl.DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); +procedure TfpgX11Canvas.DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); begin XSetForeGround(xapplication.display, Fgc, fpgColorToX(fpgColorToRGB(col))); XSetFunction(xapplication.display, Fgc, GXxor); @@ -2097,7 +2115,7 @@ begin XSetFunction(xapplication.display, Fgc, GXcopy); end; -procedure TfpgCanvasImpl.DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); +procedure TfpgX11Canvas.DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); var pts: array[1..3] of TXPoint; begin @@ -2108,20 +2126,23 @@ begin XFillPolygon(xapplication.display, FDrawHandle, Fgc, @pts, 3, CoordModeOrigin, X.Complex); end; -procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: TfpgCoord); +procedure TfpgX11Canvas.DoDrawRectangle(x, y, w, h: TfpgCoord); begin // writeln(Format('DoDrawRectangle x=%d y=%d w=%d h=%d', [x, y, w, h])); // Same behavior as Windows. See documentation for reason. - XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w-1, h-1); + if (w = 1) and (h = 1) then // a dot + DoDrawLine(x, y, x+w, y+w) + else + XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w-1, h-1); end; -procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord); +procedure TfpgX11Canvas.DoDrawLine(x1, y1, x2, y2: TfpgCoord); begin // Same behavior as Windows. See documentation for reason. XDrawLine(xapplication.display, FDrawHandle, Fgc, x1, y1, x2, y2); end; -procedure TfpgCanvasImpl.DoSetClipRect(const ARect: TfpgRect); +procedure TfpgX11Canvas.DoSetClipRect(const ARect: TfpgRect); var r: TXRectangle; rg: TRegion; @@ -2142,12 +2163,12 @@ begin XDestroyRegion(rg); end; -function TfpgCanvasImpl.DoGetClipRect: TfpgRect; +function TfpgX11Canvas.DoGetClipRect: TfpgRect; begin Result := FClipRect; end; -procedure TfpgCanvasImpl.DoAddClipRect(const ARect: TfpgRect); +procedure TfpgX11Canvas.DoAddClipRect(const ARect: TfpgRect); var r: TXRectangle; rg: TRegion; @@ -2169,7 +2190,7 @@ begin XDestroyRegion(rg); end; -procedure TfpgCanvasImpl.DoClearClipRect; +procedure TfpgX11Canvas.DoClearClipRect; var r: TfpgRect; begin @@ -2178,7 +2199,7 @@ begin FClipRectSet := False; end; -procedure TfpgCanvasImpl.DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); +procedure TfpgX11Canvas.DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); var msk: TPixmap; gc2: Tgc; @@ -2201,7 +2222,7 @@ begin XFillRectangle(xapplication.display, msk, gc2, 0, 0, w, h); XSetForeground(xapplication.display, gc2, 1); - XPutImage(xapplication.display, msk, gc2, TfpgImageImpl(img).XImageMask, xi, yi, 0, 0, w, h); + XPutImage(xapplication.display, msk, gc2, TfpgX11Image(img).XImageMask, xi, yi, 0, 0, w, h); drawgc := XCreateGc(xapplication.display, FDrawHandle, 0, @GcValues); XSetClipMask(xapplication.display, drawgc, msk); @@ -2216,19 +2237,19 @@ begin XPutImage(xapplication.display, FDrawHandle, Fgc, TfpgImage(img).XImage, xi, yi, x, y, w, h); end; -{ TfpgImageImpl } +{ TfpgX11Image } -constructor TfpgImageImpl.Create; +constructor TfpgX11Image.Create; begin inherited Create; end; -procedure TfpgImageImpl.DoFreeImage; +procedure TfpgX11Image.DoFreeImage; begin // does nothing on X11 end; -procedure TfpgImageImpl.DoInitImage(acolordepth, awidth, aheight: integer; aimgdata: Pointer); +procedure TfpgX11Image.DoInitImage(acolordepth, awidth, aheight: integer; aimgdata: Pointer); begin FMasked := False; @@ -2275,7 +2296,7 @@ begin XInitImage(@FXimg); end; -procedure TfpgImageImpl.DoInitImageMask(awidth, aheight: integer; aimgdata: Pointer); +procedure TfpgX11Image.DoInitImageMask(awidth, aheight: integer; aimgdata: Pointer); begin FMasked := True; @@ -2305,19 +2326,19 @@ begin XInitImage(@FXimgMask); end; -function TfpgImageImpl.XImage: PXImage; +function TfpgX11Image.XImage: PXImage; begin Result := @FXimg; end; -function TfpgImageImpl.XImageMask: PXImage; +function TfpgX11Image.XImageMask: PXImage; begin Result := @FXimgMask; end; -{ TfpgClipboardImpl } +{ TfpgX11Clipboard } -function TfpgClipboardImpl.DoGetText: TfpgString; +function TfpgX11Clipboard.DoGetText: TfpgString; begin XConvertSelection(xapplication.Display, xapplication.xia_clipboard, XA_STRING, xapplication.xia_clipboard, FClipboardWndHandle, 0); @@ -2333,23 +2354,23 @@ begin Result := FClipboardText; end; -procedure TfpgClipboardImpl.DoSetText(const AValue: TfpgString); +procedure TfpgX11Clipboard.DoSetText(const AValue: TfpgString); begin FClipboardText := AValue; XSetSelectionOwner(xapplication.Display, xapplication.xia_clipboard, FClipboardWndHandle, 0); end; -procedure TfpgClipboardImpl.InitClipboard; +procedure TfpgX11Clipboard.InitClipboard; begin FWaitingForSelection := False; FClipboardWndHandle := XCreateSimpleWindow(xapplication.Display, xapplication.RootWindow, 10, 10, 10, 10, 0, 0, 0); end; -{ TfpgFileListImpl } +{ TfpgX11FileList } -function TfpgFileListImpl.EncodeModeString(FileMode: longword): TFileModeString; +function TfpgX11FileList.EncodeModeString(FileMode: longword): TFileModeString; const modestring: string[9] = 'xwrxwrxwr'; // must be in reverse order var @@ -2372,13 +2393,13 @@ begin end; end; -constructor TfpgFileListImpl.Create; +constructor TfpgX11FileList.Create; begin inherited Create; FHasFileMode := true; end; -function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry; +function TfpgX11FileList.InitializeEntry(sr: TSearchRec): TFileEntry; var info: Tstat; fullname: TfpgString; @@ -2392,14 +2413,29 @@ begin Result.IsExecutable := ((sr.Mode and $40) <> 0); Result.mode := EncodeModeString(sr.Mode); Fpstat(PChar(fullname), info); - {Result.GroupID := info.st_gid; - Result.OwnerID := info.st_uid;} - Result.Owner := GetUserName(TUID(info.st_uid)); - Result.Group := GetGroupName(TGID(info.st_uid)); + // Especially if files are transfered on removable media the host system + // might not have those user or group ids. So name lookups will fail. This + // simply returns the ID's in such cases. + {$IFNDEF DARWIN} + try + Result.Owner := GetUserName(TUID(info.st_uid)); + except + Result.Owner := IntToStr(info.st_uid); + end; + try + Result.Group := GetGroupName(TGID(info.st_gid)); + except + Result.Group := IntToStr(info.st_gid); + end; + {$ELSE} + // Darwin (Mac-OS) can't seem to use users.pp unit from FPC. A bug in FPC? + Result.Owner := IntToStr(info.st_uid); + Result.Group := IntToStr(info.st_gid); + {$ENDIF} end; end; -procedure TfpgFileListImpl.PopulateSpecialDirs(const aDirectory: TfpgString); +procedure TfpgX11FileList.PopulateSpecialDirs(const aDirectory: TfpgString); var ds: string; begin diff --git a/src/corelib/x11/fpg_xft_x11.pas b/src/corelib/x11/fpg_xft_x11.pas index f517ecf9..22bf3aff 100644 --- a/src/corelib/x11/fpg_xft_x11.pas +++ b/src/corelib/x11/fpg_xft_x11.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -28,7 +28,18 @@ uses ,XLib ,Xutil ; - + +const + {$IF Defined(DARWIN)} + libXft = 'libXft.dylib'; + {$LINKLIB libXft} + fclib = 'libfontconfig.dylib'; + {$LINKLIB libfontconfig} + {$ELSE} + libXft = 'libXft.so'; + fclib = 'libfontconfig.so'; + {$IFEND} + type TPicture = longword; @@ -84,9 +95,47 @@ type PFcFontSet = ^TFcFontSet; const - FC_FAMILY : PChar = 'family'; - FC_SIZE : PChar = 'size'; - FC_SCALABLE : PChar = 'scalable'; +// FC_FAMILY : PChar = 'family'; +// FC_SIZE : PChar = 'size'; +// FC_SCALABLE : PChar = 'scalable'; + + FC_FAMILY = 'family'; //* String */ + FC_STYLE = 'style'; //* String */ + FC_SLANT = 'slant'; //* Int */ + FC_WEIGHT = 'weight'; //* Int */ + FC_SIZE = 'size'; //* Double */ + FC_ASPECT = 'aspect'; //* Double */ + FC_PIXEL_SIZE = 'pixelsize'; //* Double */ + FC_SPACING = 'spacing'; //* Int */ + FC_FOUNDRY = 'foundry'; //* String */ + FC_ANTIALIAS = 'antialias'; //* Bool (depends) */ + FC_HINTING = 'hinting'; //* Bool (true) */ + FC_VERTICAL_LAYOUT = 'verticallayout';//* Bool (false) */ + FC_AUTOHINT = 'autohint'; //* Bool (false) */ + FC_GLOBAL_ADVANCE = 'globaladvance'; //* Bool (true) */ + FC_FILE = 'file'; //* String */ + FC_INDEX = 'index'; //* Int */ + FC_FT_FACE = 'ftface'; //* FT_Face */ + FC_RASTERIZER = 'rasterizer'; //* String */ + FC_OUTLINE = 'outline'; //* Bool */ + FC_SCALABLE = 'scalable'; //* Bool */ + FC_SCALE = 'scale'; //* double */ + FC_DPI = 'dpi'; //* double */ + FC_RGBA = 'rgba'; //* Int */ + FC_MINSPACE = 'minspace'; //* Bool use minimum line spacing */ + FC_SOURCE = 'source'; //* String (X11, freetype) */ + FC_CHARSET = 'charset'; //* CharSet */ + FC_LANG = 'lang'; //* String RFC 3066 langs */ + FC_FONTVERSION = 'fontversion'; //* Int from 'head' table */ + + FC_MATRIX = 'matrix'; + FC_CHAR_WIDTH = 'charwidth'; + + FC_WEIGHT_BOLD = 200; + FC_SLANT_ITALIC = 100; + FC_PROPORTIONAL = 0; + FC_MONO = 100; + FcTypeVoid = 0; FcTypeInteger = 1; @@ -98,64 +147,32 @@ const FcTypeFTFace = 7; FcTypeLangSet = 8; -function XftDrawCreate(display : PXDisplay; win : TXID; vis : PVisual; colorm : longint) : PXftDraw; cdecl; -procedure XftDrawChange(xftd : PXftDraw; win : TXID); cdecl; -procedure XftDrawDestroy(draw : PXftDraw); cdecl; - -function XftDrawPicture(draw : PXftDraw) : TPicture; cdecl; - -function XftFontOpenName(display : PXDisplay; scr : integer; par3 : PChar) : PXftFont; cdecl; -procedure XftFontClose(display : PXDisplay; fnt : PXftFont); cdecl; - -procedure XftDrawStringUtf8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; -procedure XftDrawString8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; -procedure XftDrawString16(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; - -procedure XftTextExtentsUtf8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; -procedure XftTextExtents8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; -procedure XftTextExtents16(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; - -//function XftGlyphExists(display : PXDisplay; fnt : PXftFont; ch : integer) : longbool; cdecl; -//procedure XftDrawSetClipRectangles(draw : PXftDraw; xorigin, yorigin : integer; rect : PXRectangle; rnum : integer); cdecl; -procedure XftDrawSetClip(draw : PXftDraw; rg : TRegion); cdecl; +function XftDrawCreate(display : PXDisplay; win : TXID; vis : PVisual; colorm : longint) : PXftDraw; cdecl; external libXft; +procedure XftDrawChange(xftd : PXftDraw; win : TXID); cdecl; external libXft; +procedure XftDrawDestroy(draw : PXftDraw); cdecl; external libXft; +function XftDrawPicture(draw : PXftDraw) : TPicture; cdecl; external libXft; +function XftFontOpenName(display : PXDisplay; scr : integer; par3 : PChar) : PXftFont; cdecl; external libXft; +procedure XftFontClose(display : PXDisplay; fnt : PXftFont); cdecl; external libXft; +procedure XftDrawStringUtf8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft; +procedure XftDrawString8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft; +procedure XftDrawString16(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft; +procedure XftTextExtentsUtf8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft; +procedure XftTextExtents8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft; +procedure XftTextExtents16(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft; +//function XftGlyphExists(display : PXDisplay; fnt : PXftFont; ch : integer) : longbool; cdecl; external libXft; +//procedure XftDrawSetClipRectangles(draw : PXftDraw; xorigin, yorigin : integer; rect : PXRectangle; rnum : integer); cdecl; external libXft; +procedure XftDrawSetClip(draw : PXftDraw; rg : TRegion); cdecl; external libXft; +function XftListFonts(display : PXDisplay; screen : integer; params : array of const) : PFcFontSet; cdecl; external libXft; +function XftNameUnparse(pat : PFcPattern; dest : PChar; destlen : integer) : boolean; cdecl; external libXft; +procedure FcFontSetDestroy(fsp : PFcFontSet); cdecl; external libXft; -function XftListFonts(display : PXDisplay; screen : integer; params : array of const) : PFcFontSet; cdecl; -function XftNameUnparse(pat : PFcPattern; dest : PChar; destlen : integer) : boolean; cdecl; -procedure FcFontSetDestroy(fsp : PFcFontSet); cdecl; +//function FcFontList(config: PFcConfig; p:PFcPattern; os:PFcObjectSet): PFcFontSet;cdecl; external fclib name 'FcFontList'; implementation - -function XftDrawCreate(display : PXDisplay; win : TXID; vis : PVisual; colorm : longint) : PXftDraw; cdecl; external; -procedure XftDrawChange(xftd : PXftDraw; win : TXID); cdecl; external; -procedure XftDrawDestroy(draw : PXftDraw); cdecl; external; - -function XftDrawPicture(draw : PXftDraw) : TPicture; cdecl; external; - -function XftFontOpenName(display : PXDisplay; scr : integer; par3 : PChar) : PXftFont; cdecl; external; -procedure XftFontClose(display : PXDisplay; fnt : PXftFont); cdecl; external; - -procedure XftDrawStringUtf8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external; -procedure XftDrawString8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external; -procedure XftDrawString16(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external; - -procedure XftTextExtentsUtf8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external; -procedure XftTextExtents8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external; -procedure XftTextExtents16(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external; - -//function XftGlyphExists(display : PXDisplay; fnt : PXftFont; ch : integer) : longbool; cdecl; external; - -//procedure XftDrawSetClipRectangles(draw : PXftDraw; xorigin, yorigin : integer; rect : PXRectangle; rnum : integer); cdecl; external; - -procedure XftDrawSetClip(draw : PXftDraw; rg : TRegion); cdecl; external; - -function XftListFonts(display : PXDisplay; screen : integer; params : array of const) : PFcFontSet; cdecl; external; -function XftNameUnparse(pat : PFcPattern; dest : PChar; destlen : integer) : boolean; cdecl; external; -procedure FcFontSetDestroy(fsp : PFcFontSet); cdecl; external; - end. diff --git a/src/corelib/x11/fpgui_toolkit.lpk b/src/corelib/x11/fpgui_toolkit.lpk index 2765e02d..6af40c75 100644 --- a/src/corelib/x11/fpgui_toolkit.lpk +++ b/src/corelib/x11/fpgui_toolkit.lpk @@ -5,20 +5,22 @@ <AddToProjectUsesSection Value="False"/> <Author Value="Graeme Geldenhuys"/> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> <SearchPaths> + <IncludeFiles Value="../../"/> <OtherUnitFiles Value="../;../../gui/;../../gui/db/"/> <UnitOutputDirectory Value="../../../lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> - <CStyleOperator Value="False"/> <AllowLabel Value="False"/> <CPPInline Value="False"/> </SyntaxOptions> </Parsing> <CodeGeneration> - <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="0"/> + </Optimizations> </CodeGeneration> <Other> <CompilerPath Value="$(CompPath)"/> @@ -26,10 +28,10 @@ </CompilerOptions> <Description Value="fpGUI Toolkit "/> - <License Value="Modified LGPL + <License Value="LGPL 2 with static linking exception. "/> - <Version Minor="6" Release="3"/> - <Files Count="77"> + <Version Minor="7"/> + <Files Count="84"> <Item1> <Filename Value="../stdimages.inc"/> <Type Value="Include"/> @@ -338,6 +340,34 @@ <Filename Value="../../gui/fpg_colorwheel.pas"/> <UnitName Value="fpg_ColorWheel"/> </Item77> + <Item78> + <Filename Value="fpg_interface.pas"/> + <UnitName Value="fpg_interface"/> + </Item78> + <Item79> + <Filename Value="../../gui/fpg_editbtn.pas"/> + <UnitName Value="fpg_editbtn"/> + </Item79> + <Item80> + <Filename Value="../../gui/colordialog.inc"/> + <Type Value="Include"/> + </Item80> + <Item81> + <Filename Value="../fpg_imgfmt_jpg.pas"/> + <UnitName Value="fpg_imgfmt_jpg"/> + </Item81> + <Item82> + <Filename Value="../../gui/inputquerydialog.inc"/> + <Type Value="Include"/> + </Item82> + <Item83> + <Filename Value="../fpg_imgutils.pas"/> + <UnitName Value="fpg_imgutils"/> + </Item83> + <Item84> + <Filename Value="../../VERSION_FILE.inc"/> + <Type Value="Include"/> + </Item84> </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 b6e85833..f9ea7c1d 100644 --- a/src/corelib/x11/fpgui_toolkit.pas +++ b/src/corelib/x11/fpgui_toolkit.pas @@ -1,4 +1,4 @@ -{ This file was automatically created by Lazarus. do not edit ! +{ This file was automatically created by Lazarus. Do not edit! This source is only used to compile and install the package. } @@ -10,13 +10,14 @@ uses fpg_base, fpg_main, fpg_cmdlineparams, fpg_command_intf, fpg_constants, fpg_extinterpolation, fpg_imagelist, fpg_imgfmt_bmp, fpg_pofiles, fpg_popupwindow, fpg_stdimages, fpg_stringhashlist, fpg_translations, fpg_stringutils, fpg_utils, - fpg_widget, fpg_wuline, fpg_impl, fpg_x11, fpg_netlayer_x11, fpg_keyconv_x11, fpg_xft_x11, - fpg_animation, fpg_basegrid, fpg_button, fpg_checkbox, fpg_combobox, fpg_customgrid, - fpg_dialogs, fpg_editcombo, fpg_edit, fpg_form, fpg_gauge, fpg_grid, fpg_hyperlink, - fpg_iniutils, fpg_label, fpg_listbox, fpg_listview, fpg_memo, fpg_menu, fpg_mru, fpg_panel, - fpg_popupcalendar, fpg_progressbar, fpg_radiobutton, fpg_scrollbar, fpg_style, fpg_tab, - fpg_trackbar, fpg_tree, fpgui_db, fpg_splitter, fpg_hint, fpg_spinedit, fpg_extgraphics, - fpg_ColorMapping, fpg_ColorWheel; + fpg_widget, fpg_wuline, fpg_impl, fpg_x11, fpg_netlayer_x11, fpg_keyconv_x11, + fpg_xft_x11, fpg_animation, fpg_basegrid, fpg_button, fpg_checkbox, fpg_combobox, + fpg_customgrid, fpg_dialogs, fpg_editcombo, fpg_edit, fpg_form, fpg_gauge, fpg_grid, + fpg_hyperlink, fpg_iniutils, fpg_label, fpg_listbox, fpg_listview, fpg_memo, fpg_menu, + fpg_mru, fpg_panel, fpg_popupcalendar, fpg_progressbar, fpg_radiobutton, + fpg_scrollbar, fpg_style, fpg_tab, fpg_trackbar, fpg_tree, fpgui_db, fpg_splitter, + fpg_hint, fpg_spinedit, fpg_extgraphics, fpg_ColorMapping, fpg_ColorWheel, + fpg_interface, fpg_editbtn, fpg_imgfmt_jpg, fpg_imgutils; implementation diff --git a/src/extrafpc.cfg b/src/extrafpc.cfg index 8757773c..1c17edca 100644 --- a/src/extrafpc.cfg +++ b/src/extrafpc.cfg @@ -43,6 +43,9 @@ # Allow inline and use ansistrings. -Sih +# Allows C-style assignment += -= etc. +-Sc + # Optimize always for Size #-O2s @@ -50,6 +53,7 @@ # Slashes are also allowed under dos # searchpath for includefiles +-Fi. -Ficorelib #IFDEF X11 -Ficorelib/x11/ @@ -99,8 +103,8 @@ #-viwn # # If you don't want so much verbosity use --vw +#-vw # # Show only errors -#-ve +-ve diff --git a/src/fpmake.pas b/src/fpmake.pas index d6f9383d..5afc82ea 100644 --- a/src/fpmake.pas +++ b/src/fpmake.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/charmapdialog.inc b/src/gui/charmapdialog.inc index 5c602627..1eb21b77 100644 --- a/src/gui/charmapdialog.inc +++ b/src/gui/charmapdialog.inc @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -17,8 +17,6 @@ actual character code. } -{ TODO : This unit needs to be localized } -{ TODO : This dialog needs to be incorporated with TfpgEdit popup menu. } {%mainunit fpg_dialogs.pas} @@ -27,27 +25,28 @@ TCharMapForm = class(TfpgForm) private {@VFD_HEAD_BEGIN: CharMapForm} - StringGrid1: TfpgStringGrid; - Button1: TfpgButton; + grdCharacters: TfpgStringGrid; + btnClose: TfpgButton; lblCharInfo: TfpgLabel; edText: TfpgEdit; lblText: TfpgLabel; pnlChar: TfpgPanel; {@VFD_HEAD_END: CharMapForm} - procedure FormShow(Sender: TObject); - procedure StringGrid1FocusChange(Sender: TObject; ARow, ACol: integer); - procedure StringGrid1DrawCell(Sender: TObject; const ARow, ACol: integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); - procedure StringGrid1CanSelectCell(Sender: TObject; const ARow, ACol: integer; var ACanSelect: boolean); - procedure StringGrid1DoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); - procedure FillCharMap; - procedure Button1Clicked(Sender: TObject); - function GetNewText: TfpgString; + procedure FormShow(Sender: TObject); + procedure grdCharactersFocusChange(Sender: TObject; ARow, ACol: integer); + procedure grdCharactersDrawCell(Sender: TObject; const ARow, ACol: integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); + procedure grdCharactersCanSelectCell(Sender: TObject; const ARow, ACol: integer; var ACanSelect: boolean); + procedure grdCharactersDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure grdCharactersKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + procedure FillCharMap; + procedure Button1Clicked(Sender: TObject); + function GetNewText: TfpgString; + procedure SetupCaptions; public - procedure AfterCreate; override; - property NewText: TfpgString read GetNewText; + procedure AfterCreate; override; + property NewText: TfpgString read GetNewText; end; -function fpgShowCharMap: TfpgString; {$ENDIF read_interface} @@ -77,14 +76,14 @@ begin FillCharMap; end; -procedure TCharMapForm.StringGrid1FocusChange(Sender: TObject; ARow, ACol: integer); +procedure TCharMapForm.grdCharactersFocusChange(Sender: TObject; ARow, ACol: integer); var i: integer; tmp, tmp2: TfpgString; begin if (ARow > 0) and (ACol > 0) then begin - tmp := StringGrid1.Cells[ACol, ARow]; + tmp := grdCharacters.Cells[ACol, ARow]; tmp2 := ''; // generate UTF-8 byte representation for i := 1 to Length(tmp) do @@ -99,25 +98,25 @@ begin end; end; -procedure TCharMapForm.StringGrid1DrawCell(Sender: TObject; +procedure TCharMapForm.grdCharactersDrawCell(Sender: TObject; const ARow, ACol: integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); begin if (ARow = 0) or (ACol = 0) then begin ADefaultDrawing := False; - StringGrid1.Canvas.Color := clWindowBackground; - StringGrid1.Canvas.FillRectangle(ARect); - //StringGrid1.Canvas.DrawButtonFace(ARect, []); - StringGrid1.Canvas.TextColor := clText1; //clGray; - StringGrid1.Canvas.DrawText(ARect, StringGrid1.Cells[ACol, ARow], + grdCharacters.Canvas.Color := clWindowBackground; + grdCharacters.Canvas.FillRectangle(ARect); + //grdCharacters.Canvas.DrawButtonFace(ARect, []); + grdCharacters.Canvas.TextColor := clText1; //clGray; + grdCharacters.Canvas.DrawText(ARect, grdCharacters.Cells[ACol, ARow], [txtHCenter, txtVCenter]); end else ADefaultDrawing := True; end; -procedure TCharMapForm.StringGrid1CanSelectCell(Sender: TObject; +procedure TCharMapForm.grdCharactersCanSelectCell(Sender: TObject; const ARow, ACol: integer; var ACanSelect: boolean); begin if (ACol = 0) or (ARow = 0) then @@ -126,10 +125,19 @@ begin ACanSelect := True; end; -procedure TCharMapForm.StringGrid1DoubleClick(Sender: TObject; +procedure TCharMapForm.grdCharactersDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin - edText.Text := edText.Text + StringGrid1.Cells[StringGrid1.FocusCol, StringGrid1.FocusRow]; + edText.Text := edText.Text + grdCharacters.Cells[grdCharacters.FocusCol, grdCharacters.FocusRow]; +end; + +procedure TCharMapForm.grdCharactersKeyPressed(Sender: TObject; var KeyCode: word; + var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEnter then + begin + edText.Text := edText.Text + grdCharacters.Cells[grdCharacters.FocusCol, grdCharacters.FocusRow]; + end; end; procedure TCharMapForm.FillCharMap; @@ -138,33 +146,33 @@ var j: byte; c: byte; begin - StringGrid1.BeginUpdate; + grdCharacters.BeginUpdate; try - StringGrid1.ColumnCount := 17; - StringGrid1.RowCount := 17; - StringGrid1.ShowHeader := False; + grdCharacters.ColumnCount := 17; + grdCharacters.RowCount := 17; + grdCharacters.ShowHeader := False; for i := 0 to 15 do begin for j := 0 to 15 do begin - StringGrid1.ColumnWidth[j] := 20; + grdCharacters.ColumnWidth[j] := 20; c := i shl 4 or j; if (c > 0) and (c < 128) then - StringGrid1.Cells[j + 1, i + 1] := chr(c) + grdCharacters.Cells[j + 1, i + 1] := chr(c) else - StringGrid1.Cells[j + 1, i + 1] := + grdCharacters.Cells[j + 1, i + 1] := chr($C0 or (i div $4)) + chr($80 or c mod $40); end; - StringGrid1.Cells[0, i + 1] := Format('%.2x +', [i]); - StringGrid1.Cells[i + 1, 0] := Format('%.2x', [i]); + grdCharacters.Cells[0, i + 1] := Format('%.2x +', [i]); + grdCharacters.Cells[i + 1, 0] := Format('%.2x', [i]); end; - StringGrid1.ColumnWidth[0] := 30; - StringGrid1.ColumnWidth[16] := 20; - StringGrid1.Cells[0, 0] := '00'; + grdCharacters.ColumnWidth[0] := 30; + grdCharacters.ColumnWidth[16] := 20; + grdCharacters.Cells[0, 0] := '00'; finally - StringGrid1.FocusCol := 1; - StringGrid1.FocusRow := 1; - StringGrid1.EndUpdate; + grdCharacters.FocusCol := 1; + grdCharacters.FocusRow := 1; + grdCharacters.EndUpdate; end; end; @@ -178,6 +186,13 @@ begin Result := edText.Text; end; +procedure TCharMapForm.SetupCaptions; +begin + WindowTitle := rsCharacterMap; + btnClose.Text := rsClose; + lblText.Text := rsTextToInsert; +end; + procedure TCharMapForm.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} @@ -185,33 +200,36 @@ begin Name := 'CharMapForm'; SetPosition(316, 186, 377, 390); WindowTitle := 'Character Map'; + Hint := ''; WindowPosition := wpOneThirdDown; OnShow := @FormShow; - StringGrid1 := TfpgStringGrid.Create(self); - with StringGrid1 do + grdCharacters := TfpgStringGrid.Create(self); + with grdCharacters do begin - Name := 'StringGrid1'; + Name := 'grdCharacters'; SetPosition(4, 4, 368, 296); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#Grid'; HeaderFontDesc := '#GridHeader'; + Hint := ''; RowCount := 0; RowSelect := False; TabOrder := 0; - OnFocusChange := @StringGrid1FocusChange; - OnDrawCell := @StringGrid1DrawCell; - OnCanSelectCell := @StringGrid1CanSelectCell; - OnDoubleClick := @StringGrid1DoubleClick; + OnFocusChange := @grdCharactersFocusChange; + OnDrawCell := @grdCharactersDrawCell; + OnCanSelectCell := @grdCharactersCanSelectCell; + OnDoubleClick := @grdCharactersDoubleClick; + OnKeyPress := @grdCharactersKeyPressed; end; - Button1 := TfpgButton.Create(self); - with Button1 do + btnClose := TfpgButton.Create(self); + with btnClose do begin - Name := 'Button1'; + Name := 'btnClose'; SetPosition(292, 360, 80, 24); Anchors := [anRight,anBottom]; - Text := 'Close'; + Text := 'btnClose'; FontDesc := '#Label1'; Hint := ''; ImageName := ''; @@ -227,7 +245,7 @@ begin Anchors := [anLeft,anBottom]; FontDesc := '#Label1'; Hint := ''; - Text := 'Label'; + Text := 'lblCharInfo'; end; edText := TfpgEdit.Create(self); @@ -236,6 +254,7 @@ begin Name := 'edText'; SetPosition(108, 326, 156, 24); Anchors := [anLeft,anBottom]; + Hint := ''; TabOrder := 3; Text := ''; FontDesc := '#Edit1'; @@ -249,7 +268,7 @@ begin Anchors := [anLeft,anBottom]; FontDesc := '#Label1'; Hint := ''; - Text := 'Text to Insert:'; + Text := 'lblTextToInsert'; end; pnlChar := TfpgPanel.Create(self); @@ -259,12 +278,15 @@ begin SetPosition(292, 304, 60, 48); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := 'Arial-16:antialias=true'; + Hint := ''; Style := bsLowered; Text := ''; end; {@VFD_BODY_END: CharMapForm} {%endregion} + + SetupCaptions; end; diff --git a/src/gui/colordialog.inc b/src/gui/colordialog.inc new file mode 100644 index 00000000..6914257e --- /dev/null +++ b/src/gui/colordialog.inc @@ -0,0 +1,316 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit contains the Color Selection dialog. +} + + +{%mainunit fpg_dialogs.pas} + +{$IFDEF read_interface} + +type + + TfpgColorSelectDialog = class(TfpgBaseDialog) + private + {@VFD_HEAD_BEGIN: ColorSelectDialog} + PageControl1: TfpgPageControl; + TabSheet1: TfpgTabSheet; + TabSheet2: TfpgTabSheet; + ComboBox1: TfpgComboBox; + ColorListBox1: TfpgColorListBox; + Label1: TfpgLabel; + Label2: TfpgLabel; + ColorWheel: TfpgColorWheel; + ValueBar: TfpgValueBar; + edR: TfpgSpinEdit; + edG: TfpgSpinEdit; + edB: TfpgSpinEdit; + Label3: TfpgLabel; + Label4: TfpgLabel; + Label5: TfpgLabel; + pnlColorPreview: TfpgBevel; + {@VFD_HEAD_END: ColorSelectDialog} + FViaRGB: Boolean; // to prevent recursive changes + function GetSelectedColor: TfpgColor; + procedure SetSelectedColor(const AValue: TfpgColor); + procedure ColorChanged(Sender: TObject); + procedure RGBChanged(Sender: TObject); + procedure UpdateRGBComponents; + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + property SelectedColor: TfpgColor read GetSelectedColor write SetSelectedColor; + end; + + +{$ENDIF read_interface} + + + +{$IFDEF read_implementation} + + +function fpgSelectColorDialog(APresetColor: TfpgColor): TfpgColor; +var + frm: TfpgColorSelectDialog; +begin + Result := APresetColor; + frm := TfpgColorSelectDialog.Create(nil); + try + frm.ColorWheel.SetSelectedColor(APresetColor); + if frm.ShowModal = mrOK then + Result := frm.ValueBar.SelectedColor; + finally + frm.Free; + end; +end; + +{ TfpgColorSelectDialog } + +function TfpgColorSelectDialog.GetSelectedColor: TfpgColor; +begin + // +end; + +procedure TfpgColorSelectDialog.SetSelectedColor(const AValue: TfpgColor); +begin + // +end; + +procedure TfpgColorSelectDialog.ColorChanged(Sender: TObject); +begin +// UpdateHSVComponents; + if not FViaRGB then + UpdateRGBComponents; + pnlColorPreview.BackgroundColor := ValueBar.SelectedColor; +end; + +procedure TfpgColorSelectDialog.RGBChanged(Sender: TObject); +var + rgb: TFPColor; + c: TfpgColor; +begin + FViaRGB := True; // prevent recursive updates + rgb.Red := edR.Value; + rgb.Green := edG.Value; + rgb.Blue := edB.Value; + c := FPColorTofpgColor(rgb); + ColorWheel.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event + FViaRGB := False; +end; + +procedure TfpgColorSelectDialog.UpdateRGBComponents; +var + rgb: TFPColor; + c: TfpgColor; +begin + c := ValueBar.SelectedColor; + rgb := fpgColorToFPColor(c); + edR.Value := rgb.Red; + edG.Value := rgb.Green; + edB.Value := rgb.Blue; +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(316, 186, 328, 375); + WindowTitle := 'Color Select Dialog'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + PageControl1 := TfpgPageControl.Create(self); + with PageControl1 do + begin + Name := 'PageControl1'; + SetPosition(4, 4, 320, 332); + Anchors := [anLeft,anRight,anTop,anBottom]; + ActivePageIndex := 0; + Hint := ''; + TabOrder := 1; + end; + + TabSheet1 := TfpgTabSheet.Create(PageControl1); + with TabSheet1 do + begin + Name := 'TabSheet1'; + SetPosition(3, 24, 314, 305); + Text := 'Color Wheel'; + end; + + TabSheet2 := TfpgTabSheet.Create(PageControl1); + with TabSheet2 do + begin + Name := 'TabSheet2'; + SetPosition(3, 24, 314, 305); + Text := 'Predefined'; + end; + + ComboBox1 := TfpgComboBox.Create(TabSheet2); + with ComboBox1 do + begin + Name := 'ComboBox1'; + SetPosition(8, 24, 299, 22); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#List'; + Hint := ''; + TabOrder := 1; + end; + + ColorListBox1 := TfpgColorListBox.Create(TabSheet2); + with ColorListBox1 do + begin + Name := 'ColorListBox1'; + SetPosition(8, 72, 299, 224); + Anchors := [anLeft,anRight,anTop,anBottom]; + ColorPalette := cpStandardColors; + FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; + TabOrder := 2; + end; + + Label1 := TfpgLabel.Create(TabSheet2); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 6, 328, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Select a color palette'; + end; + + Label2 := TfpgLabel.Create(TabSheet2); + with Label2 do + begin + Name := 'Label2'; + SetPosition(8, 54, 328, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Available colors:'; + end; + + ColorWheel := TfpgColorWheel.Create(TabSheet1); + with ColorWheel do + begin + Name := 'ColorWheel'; + SetPosition(8, 8, 204, 204); + end; + + ValueBar := TfpgValueBar.Create(TabSheet1); + with ValueBar do + begin + Name := 'ValueBar'; + SetPosition(240, 8, 64, 204); + OnChange := @ColorChanged; + end; + + edR := TfpgSpinEdit.Create(TabSheet1); + with edR do + begin + Name := 'edR'; + SetPosition(92, 216, 52, 24); + MaxValue := 255; + MinValue := 0; + OnChange := @RGBChanged; + end; + + edG := TfpgSpinEdit.Create(TabSheet1); + with edG do + begin + Name := 'edG'; + SetPosition(92, 244, 52, 24); + MaxValue := 255; + MinValue := 0; + OnChange := @RGBChanged; + end; + + edB := TfpgSpinEdit.Create(TabSheet1); + with edB do + begin + Name := 'edB'; + SetPosition(92, 272, 52, 24); + MaxValue := 255; + MinValue := 0; + OnChange := @RGBChanged; + end; + + Label3 := TfpgLabel.Create(TabSheet1); + with Label3 do + begin + Name := 'Label3'; + SetPosition(8, 220, 80, 16); + Alignment := taRightJustify; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Red'; + end; + + Label4 := TfpgLabel.Create(TabSheet1); + with Label4 do + begin + Name := 'Label4'; + SetPosition(8, 248, 80, 16); + Alignment := taRightJustify; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Green'; + end; + + Label5 := TfpgLabel.Create(TabSheet1); + with Label5 do + begin + Name := 'Label5'; + SetPosition(8, 276, 80, 16); + Alignment := taRightJustify; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Blue'; + end; + + pnlColorPreview := TfpgBevel.Create(TabSheet1); + with pnlColorPreview do + begin + Name := 'pnlColorPreview'; + SetPosition(248, 232, 52, 52); + Hint := ''; + end; + + {@VFD_BODY_END: ColorSelectDialog} + {%endregion} + + // link colorwheel and valuebar + ColorWheel.ValueBar := ValueBar; + + // position standard dialog buttons + btnCancel.Left := Width - FDefaultButtonWidth - FSpacing; + btnCancel.Top := Height - btnCancel.Height - FSpacing; + btnOK.Left := btnCancel.Left - FDefaultButtonWidth - 6; + btnOK.Top := btnCancel.Top; +end; + + +{$ENDIF read_implementation} + diff --git a/src/gui/db/fpgui_db.pas b/src/gui/db/fpgui_db.pas index 1e814ba0..a3530ca7 100644 --- a/src/gui/db/fpgui_db.pas +++ b/src/gui/db/fpgui_db.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/fpg_animation.pas b/src/gui/fpg_animation.pas index b95d83ac..fedfa545 100644 --- a/src/gui/fpg_animation.pas +++ b/src/gui/fpg_animation.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -70,6 +70,7 @@ type property ImageFileName; property IsTransparent; property FrameCount; + property OnShowHint; end; @@ -130,7 +131,8 @@ end; procedure TfpgBaseImgAnim.SetEnabled(const AValue: boolean); begin inherited SetEnabled(AValue); - FTimer.Enabled := FEnabled; + if not (csDesigning in ComponentState) then + FTimer.Enabled := FEnabled; end; procedure TfpgBaseImgAnim.SetImageFilename(const AValue: TfpgString); diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index 7c9e757f..9a29e004 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -30,7 +30,8 @@ uses fpg_base, fpg_main, fpg_widget, - fpg_scrollbar; + fpg_scrollbar, + fpg_menu; type @@ -42,7 +43,7 @@ type TfpgDrawCellEvent = procedure(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean) of object; // widget options - TfpgGridOption = (go_HideFocusRect); + TfpgGridOption = (go_HideFocusRect, go_AlternativeColor, go_SmoothScroll); TfpgGridOptions = set of TfpgGridOption; // Column 2 is special just for testing purposes. Descendant classes will @@ -65,6 +66,7 @@ type FPrevRow: Integer; FFirstRow: Integer; FFirstCol: Integer; + FXOffset: integer; // used for go_SmoothScroll FMargin: integer; FFont: TfpgFont; FHeaderFont: TfpgFont; @@ -77,6 +79,8 @@ type FHScrollBar: TfpgScrollBar; FUpdateCount: integer; FOptions: TfpgGridOptions; + FPopupMenu: TfpgPopupMenu; + FAlternativeBGColor: TfpgColor; function GetFontDesc: string; function GetHeaderFontDesc: string; procedure HScrollBarMove(Sender: TObject; position: integer); @@ -96,12 +100,14 @@ type function VisibleWidth: integer; function VisibleHeight: integer; procedure SetFirstRow(const AValue: Integer); + procedure SetAlternativeBGColor(const AValue: TfpgColor); protected property UpdateCount: integer read FUpdateCount; procedure UpdateScrollBars; virtual; function GetHeaderText(ACol: Integer): string; virtual; function GetColumnWidth(ACol: Integer): integer; virtual; procedure SetColumnWidth(ACol: Integer; const AValue: integer); virtual; + function GetBackgroundColor(ARow: integer; ACol: integer): TfpgColor; virtual; function GetColumnBackgroundColor(ACol: Integer): TfpgColor; virtual; procedure SetColumnBackgroundColor(ACol: Integer; const AValue: TfpgColor); virtual; function GetColumnTextColor(ACol: Integer): TfpgColor; virtual; @@ -122,7 +128,9 @@ type procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure FollowFocus; virtual; + property AlternateBGColor: TfpgColor read FAlternativeBGColor write SetAlternativeBGColor default clHilite1; property DefaultColWidth: integer read FDefaultColWidth write SetDefaultColWidth default 64; property DefaultRowHeight: integer read FDefaultRowHeight write SetDefaultRowHeight; property Font: TfpgFont read FFont; @@ -133,6 +141,7 @@ type property FocusRow: Integer read FFocusRow write SetFocusRow default -1; property RowSelect: boolean read FRowSelect write SetRowSelect; property ColumnCount: Integer read GetColumnCount; + property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; property RowCount: Integer read GetRowCount; property ShowHeader: boolean read FShowHeader write SetShowHeader default True; property ShowGrid: boolean read FShowGrid write SetShowGrid default True; @@ -166,12 +175,25 @@ implementation procedure TfpgBaseGrid.HScrollBarMove(Sender: TObject; position: integer); begin - if FFirstCol <> position then + if go_SmoothScroll in FOptions then begin - if Position < 0 then - Position := 0; - FFirstCol := position; - RePaint; + if FXOffset <> position then + begin + if Position < 0 then + Position := 0; + FXOffset := position; + Repaint; + end; + end + else + begin + if FFirstCol <> position then + begin + if Position < 0 then + Position := 0; + FFirstCol := position; + RePaint; + end; end; end; @@ -260,6 +282,24 @@ begin end; end; +function TfpgBaseGrid.GetBackgroundColor(ARow: integer; ACol: integer): TfpgColor; +begin + if (ARow >= 0) and (ACol >= 0) and (ARow < RowCount) and (ACol < ColumnCount) then + begin + if go_AlternativeColor in Options then + begin + if (ARow mod 2) <> 0 then + Result := AlternateBGColor + else + Result := ColumnBackgroundColor[ACol]; + end + else + Result := ColumnBackgroundColor[ACol]; + end + else + Result := BackgroundColor; +end; + function TfpgBaseGrid.GetColumnBackgroundColor(ACol: Integer): TfpgColor; begin // implemented in descendant @@ -351,8 +391,11 @@ begin Canvas.SetTextColor(clText1); s := GetHeaderText(ACol); x := (ARect.Left + (ARect.Width div 2)) - (FHeaderFont.TextWidth(s) div 2); - if x < 1 then - x := 1; + if not (go_SmoothScroll in FOptions) then + begin + if x < 1 then + x := 1; + end; fpgStyle.DrawString(Canvas, x, ARect.Top+1, s, Enabled); end; @@ -477,6 +520,12 @@ begin RePaint; end; +procedure TfpgBaseGrid.SetAlternativeBGColor(const AValue: TfpgColor); +begin + if FAlternativeBGColor = AValue then exit; + FAlternativeBGColor := AValue; +end; + procedure TfpgBaseGrid.UpdateScrollBars; var HWidth: integer; @@ -484,6 +533,7 @@ var vw: integer; cw: integer; i: integer; + x: integer; begin VHeight := Height - 4; HWidth := Width - 4; @@ -500,6 +550,7 @@ begin begin FHScrollBar.Visible := False; FFirstCol := 0; + FXOffset := 0; end; // This needs improving while resizing @@ -529,8 +580,16 @@ begin Dec(VHeight, FHScrollBar.Height); FHScrollBar.Min := 0; FHScrollBar.SliderSize := 0.2; - FHScrollBar.Max := ColumnCount-1; - FHScrollBar.Position := FFirstCol; + if go_SmoothScroll in FOptions then + begin + FHScrollBar.Max := cw - vw; + FHScrollBar.Position := FXOffset; + end + else + begin + FHScrollBar.Max := ColumnCount-1; + FHScrollBar.Position := FFirstCol; + end; FHScrollBar.RepaintSlider; end; @@ -559,8 +618,9 @@ var row: Integer; clipr: TfpgRect; // clip rectangle drawstate: TfpgGridDrawState; + cLeft: integer; + c: integer; begin - drawstate := []; Canvas.BeginDraw; // inherited HandlePaint; Canvas.ClearClipRect; @@ -576,12 +636,25 @@ begin clipr.SetRect(FMargin, FMargin, VisibleWidth, VisibleHeight); r := clipr; + cLeft := FMargin; // column starting point + if go_SmoothScroll in FOptions then + begin + if FHScrollBar.Visible then + Dec(cLeft, FHScrollBar.Position); + c := 0; + end + else + begin + c := FFirstCol; + end; + if (ColumnCount > 0) and ShowHeader then begin // Drawing horizontal headers + r.Left := cLeft; r.Height := FHeaderHeight; Canvas.SetFont(FHeaderFont); - for col := FFirstCol to ColumnCount-1 do + for col := c to ColumnCount-1 do begin r.Width := ColumnWidth[col]; Canvas.SetClipRect(clipr); @@ -602,9 +675,10 @@ begin for row := FFirstRow to RowCount-1 do begin - r.Left := FMargin; - for col := FFirstCol to ColumnCount-1 do + r.Left := cLeft; + for col := c to ColumnCount-1 do begin + drawstate := []; r.Width := ColumnWidth[col]; Canvas.SetClipRect(clipr); @@ -612,18 +686,18 @@ begin begin if FFocused then begin - Canvas.SetColor(clSelection); - Canvas.SetTextColor(clSelectionText); + Canvas.SetColor(clGridSelection); + Canvas.SetTextColor(clGridSelectionText); end else begin - Canvas.SetColor(clInactiveSel); - Canvas.SetTextColor(clInactiveSelText); + Canvas.SetColor(clGridInactiveSel); + Canvas.SetTextColor(clGridInactiveSelText); end; end else begin - Canvas.SetColor(ColumnBackgroundColor[col]); + Canvas.SetColor(GetBackgroundColor(row, col)); Canvas.SetTextColor(ColumnTextColor[col]); end; Canvas.AddClipRect(r); @@ -898,6 +972,8 @@ var cw: integer; n: integer; colresize: boolean; + cLeft: integer; + c: integer; begin inherited HandleMouseMove(x, y, btnstate, shiftstate); @@ -922,15 +998,27 @@ begin colresize := False; hh := FHeaderHeight; + cLeft := FMargin; // column starting point + if go_SmoothScroll in FOptions then + begin + if FHScrollBar.Visible then + Dec(cLeft, FHScrollBar.Position); + c := 0; + end + else + begin + c := FFirstCol; + end; + if (y <= FMargin + hh) then // we are over the Header row begin cw := 0; - for n := FFirstCol to ColumnCount-1 do + for n := c to ColumnCount-1 do begin inc(cw, ColumnWidth[n]); // Resizing is enabled 4 pixel either way of the cell border - if ((x >= (FMargin+cw - 4)) and (x <= (FMargin+cw+4))) or - (cw > (FMargin + VisibleWidth)) and (x >= FMargin + VisibleWidth-4) then + if ((x >= (cLeft+cw-4)) and (x <= (cLeft+cw+4))) {or + (cw > (cLeft + VisibleWidth)) and (x >= (cLeft + VisibleWidth-4))} then begin colresize := True; Break; @@ -969,6 +1057,8 @@ var nw: integer; prow: Integer; pcol: Integer; + c: integer; + cLeft: integer; begin inherited HandleLMouseDown(x, y, shiftstate); @@ -987,27 +1077,40 @@ begin if ShowHeader and (y <= FMargin+hh) then // inside Header row begin {$IFDEF DEBUG} Writeln('header click...'); {$ENDIF} + + cLeft := FMargin; // column starting point + if go_SmoothScroll in FOptions then + begin + if FHScrollBar.Visible then + Dec(cLeft, FHScrollBar.Position); + c := 0; + end + else + begin + c := FFirstCol; + end; + cw := 0; - for n := FFirstCol to ColumnCount-1 do + for n := c to ColumnCount-1 do begin inc(cw, ColumnWidth[n]); - if (x >= (FMargin+cw - 4)) and (x <= (FMargin+cw + 4)) then + if (x >= (cLeft+cw-4)) and (x <= (cLeft+cw+4)) then begin {$IFDEF DEBUG} Writeln('column resize...'); {$ENDIF} FColResizing := True; FResizedCol := n; FDragPos := x; Break; - end - else if (cw > FMargin+VisibleWidth) and (x >= FMargin+VisibleWidth-4) then - begin - FColResizing := True; - FResizedCol := n; - FDragPos := x; - nw := ColumnWidth[FResizedCol] - (cw+FMargin-x); - if nw > 0 then - SetColumnWidth(FResizedCol, nw ); - Break; + //end + //else if (cw > cLeft+VisibleWidth) and (x >= cLeft+VisibleWidth-4) then + //begin + // FColResizing := True; + // FResizedCol := n; + // FDragPos := x; + // nw := ColumnWidth[FResizedCol] - (cw+cLeft-x); + // if nw > 0 then + // SetColumnWidth(FResizedCol, nw ); + // Break; end; { if/else } if cw > VisibleWidth then @@ -1038,6 +1141,26 @@ begin CheckFocusChange; end; +procedure TfpgBaseGrid.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); +var + hh: integer; +begin + inherited HandleRMouseUp(x, y, shiftstate); + if Assigned(PopupMenu) then + begin + // popup should not appear if you clicked in header - maybe this behaviour should be user-selectable? + if ShowHeader then + hh := FHeaderHeight+1 + else + hh := 0; + + if ShowHeader and (y > FMargin+hh) then // not in Header row + begin + PopupMenu.ShowAt(self, x, y); + end; + end; +end; + procedure TfpgBaseGrid.FollowFocus; var n: Integer; @@ -1084,7 +1207,7 @@ begin end; end; { for } end; { if/else } - + CheckFocusChange; UpdateScrollBars; end; @@ -1117,6 +1240,7 @@ begin FDefaultRowHeight := FFont.Height + 2; FHeaderHeight := FHeaderFont.Height + 2; FBackgroundColor := clBoxColor; + FAlternativeBGColor := clHilite1; FColResizing := False; MinHeight := HeaderHeight + DefaultRowHeight + FMargin; @@ -1182,6 +1306,8 @@ var hh: integer; cw: integer; n: Integer; + cLeft: integer; + c: integer; begin if ShowHeader then hh := FHeaderHeight+1 @@ -1192,11 +1318,23 @@ begin if ARow > RowCount-1 then ARow := RowCount-1; + cLeft := FMargin; // column starting point + if go_SmoothScroll in FOptions then + begin + if FHScrollBar.Visible then + Dec(cLeft, FHScrollBar.Position); + c := 0; + end + else + begin + c := FFirstCol; + end; + cw := 0; - for n := FFirstCol to ColumnCount-1 do + for n := c to ColumnCount-1 do begin inc(cw, ColumnWidth[n]); - if FMargin+cw >= x then + if cLeft+cw >= x then begin ACol := n; Break; diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas index 4600d894..19b31049 100644 --- a/src/gui/fpg_button.pas +++ b/src/gui/fpg_button.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -33,7 +33,6 @@ type TImageLayout = (ilImageLeft, ilImageTop, ilImageRight, ilImageBottom); - { TfpgBaseButton } TfpgBaseButton = class(TfpgWidget, ICommandHolder) private @@ -137,24 +136,33 @@ type property Flat; property FontDesc; property GroupIndex; + property Height; property Hint; property ImageLayout; property ImageMargin; property ImageName; property ImageSpacing; + property Left; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; property ModalResult; property ParentShowHint; property ShowHint; property ShowImage; + property TabOrder; property Text; property TextColor; - property TabOrder; + property Top; + property Width; + property OnClick; property OnMouseDown; property OnMouseExit; property OnMouseEnter; property OnMouseMove; property OnMouseUp; - property OnClick; + property OnShowHint; end; @@ -500,7 +508,7 @@ var pofs: integer; lBtnFlags: TFButtonFlags; clr: TfpgColor; - + img: TfpgImage; begin // inherited HandlePaint; Canvas.ClearClipRect; @@ -559,9 +567,17 @@ begin CalculatePositions (ix, iy, tx, ty); - if FShowImage and assigned (FImage) then - Canvas.DrawImage(ix + pofs, iy + pofs, FImage); - + if FShowImage and Assigned(FImage) then + begin + if Enabled then + Canvas.DrawImage(ix + pofs, iy + pofs, FImage) + else + begin + img := FImage.CreateDisabledImage; + Canvas.DrawImage(ix + pofs, iy + pofs, img); + img.Free; + end; + end; fpgStyle.DrawString(Canvas, tx+pofs, ty+pofs, Text, Enabled); end; @@ -714,7 +730,9 @@ begin if pform <> nil then pform.ModalResult := ModalResult; - if Assigned(OnClick) then + if Assigned(FCommand) then // ICommand takes preference to OnClick + FCommand.Execute + else if Assigned(OnClick) then OnClick(self); end; diff --git a/src/gui/fpg_checkbox.pas b/src/gui/fpg_checkbox.pas index 87a1b4df..a075a4cd 100644 --- a/src/gui/fpg_checkbox.pas +++ b/src/gui/fpg_checkbox.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -69,14 +69,24 @@ type property BoxLayout; property Checked; property FontDesc; + property Height; + property Hint; + property Left; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; property ParentShowHint; property ShowHint; property TabOrder; property Text; property TextColor; + property Top; + property Width; property OnChange; property OnEnter; property OnExit; + property OnShowHint; end; diff --git a/src/gui/fpg_colormapping.pas b/src/gui/fpg_colormapping.pas index 9f486bbf..b915bd93 100644 --- a/src/gui/fpg_colormapping.pas +++ b/src/gui/fpg_colormapping.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -45,9 +45,9 @@ var r, g, b: longint; hi, lo: longint; d: longint; - rgb: TRGBTriple; + rgb: TFPColor; begin - rgb := fpgColorToRGBTriple(C); + rgb := fpgColorToFPColor(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: TRGBTriple; + rgb: TFPColor; 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 := RGBTripleTofpgColor(rgb); + Result := FPColorTofpgColor(rgb); end; diff --git a/src/gui/fpg_colorwheel.pas b/src/gui/fpg_colorwheel.pas index ed90dc79..43ebb8a9 100644 --- a/src/gui/fpg_colorwheel.pas +++ b/src/gui/fpg_colorwheel.pas @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -13,7 +13,7 @@ Description: This unit implements color selectors using a ColorWheel and - a ValueBar. Color results are in HSV format. + a ValueBar. Color results are in HSV or TfpgColor format. } unit fpg_ColorWheel; @@ -213,7 +213,6 @@ begin FImage.Free; FImage := TfpgImage.Create; FImage.AllocateImage(32, DrawWidth, DrawHeight); - FImage.UpdateImage; for X := 0 to DrawWidth - 1 do begin for Y := 0 to DrawHeight - 1 do @@ -232,6 +231,7 @@ begin // point is outside wheel. Also incase color is alias, lookup the RGB values. FImage.Colors[x, y] := fpgColorToRGB(BackgroundColor); end; + FImage.UpdateImage; end; FRecalcWheel := False; end diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index 6e34704e..632a4918 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -83,7 +83,7 @@ type FBtnPressed: Boolean; procedure SetMargin(const AValue: integer); procedure CalculateInternalButtonRect; virtual; - procedure InternalOnClose(Sender: TObject); + procedure InternalOnClose(Sender: TObject); virtual; procedure InternalItemsChanged(Sender: TObject); virtual; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure DoOnChange; virtual; @@ -141,6 +141,7 @@ type property FocusItem; property FontDesc; property Height; + property Hint; property Items; property Margin; property Options; @@ -155,6 +156,7 @@ type property OnDropDown; property OnEnter; property OnExit; + property OnShowHint; end; @@ -405,8 +407,6 @@ end; { TComboboxDropdownWindow } procedure TComboboxDropdownWindow.SetFirstItem; -var - i: integer; begin // If FocusItem is less than DropDownCount FirsItem = 0 if ListBox.FocusItem+1 <= FCallerWidget.DropDownCount then diff --git a/src/gui/fpg_customgrid.pas b/src/gui/fpg_customgrid.pas index b0c2d3ab..4f38f12a 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 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -22,7 +22,6 @@ unit fpg_customgrid; { TODO: * Column text alignment needs to be implemented. Currently always Centre. - * AlternateColor for rows need to be implemented. } {.$Define DEBUG} @@ -259,7 +258,7 @@ begin if (ACol >= 0) and (ACol < ColumnCount) then Result := TfpgGridColumn(FColumns[ACol]).FBackgroundColor else - result := BackgroundColor; + Result := BackgroundColor; end; procedure TfpgCustomGrid.SetColumnBackgroundColor(ACol: Integer; const AValue: TfpgColor); diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 2ffc803b..73c668c3 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -23,7 +23,6 @@ unit fpg_dialogs; TODO: * Try and refactor the code to remove all IFDEF's * Implement MessageDlg with icons and buttons [Work-In-Progress] - * Select Directory dialog (treeview style) } {.$Define DEBUG} @@ -48,7 +47,10 @@ uses fpg_combobox, fpg_panel, fpg_memo, - fpg_tree; + fpg_tree, + fpg_ColorWheel, + fpg_spinedit, + fpg_tab; type TfpgMsgDlgType = (mtAbout, mtWarning, mtError, mtInformation, mtConfirmation, @@ -159,10 +161,12 @@ type FOpenMode: boolean; FFilterList: TStringList; FFilter: string; + FInitialDir: string; procedure SetFilter(const Value: string); function GetFontDesc: string; function GetShowHidden: boolean; procedure SetFontDesc(const AValue: string); + procedure SetInitialDir(const AValue: string); procedure SetShowHidden(const Value: boolean); procedure ListChanged(Sender: TObject; ARow: Integer); procedure GridDblClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -188,6 +192,7 @@ type function RunSaveFile: boolean; property Filter: string read FFilter write SetFilter; property FontDesc: string read GetFontDesc write SetFontDesc; + property InitialDir: string read FInitialDir write SetInitialDir; property ShowHidden: boolean read GetShowHidden write SetShowHidden; end; @@ -203,6 +208,8 @@ type {$I promptuserdialog.inc} {$I selectdirdialog.inc} {$I charmapdialog.inc} +{$I colordialog.inc} +{$I inputquerydialog.inc} @@ -212,6 +219,9 @@ procedure ShowMessage(AMessage: string; ACentreText: Boolean = False); overload; function SelectFontDialog(var FontDesc: string): boolean; function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''): TfpgString; function SelectDirDialog(const AStartDir: TfpgString = ''): TfpgString; +function fpgShowCharMap: TfpgString; +function fpgSelectColorDialog(APresetColor: TfpgColor = clBlack): TfpgColor; +function fpgInputQuery(const ACaption, APrompt: TfpgString; var Value: TfpgString): Boolean; implementation @@ -339,7 +349,7 @@ begin Result := False; frm := TfpgFontSelectDialog.Create(nil); frm.SetFontDesc(FontDesc); - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then begin FontDesc := frm.GetFontDesc; Result := True; @@ -381,6 +391,7 @@ var begin dlg := TfpgSelectDirDialog.Create(nil); try + dlg.SelectedDir := AStartDir; if dlg.ShowModal = mrOK then Result := dlg.SelectedDir else @@ -514,14 +525,14 @@ begin btnCancel := CreateButton(self, Width-FDefaultButtonWidth-FSpacing, 370, FDefaultButtonWidth, rsCancel, @btnCancelClick); btnCancel.Name := 'btnCancel'; - btnCancel.ImageName := 'stdimg.Cancel'; // Do NOT localize + btnCancel.ImageName := 'stdimg.cancel'; // Do NOT localize btnCancel.ShowImage := True; btnCancel.Anchors := [anRight, anBottom]; btnCancel.TabOrder := 2; btnOK := CreateButton(self, btnCancel.Left-FDefaultButtonWidth-FSpacing, 370, FDefaultButtonWidth, rsOK, @btnOKClick); btnOK.Name := 'btnOK'; - btnOK.ImageName := 'stdimg.OK'; // Do NOT localize + btnOK.ImageName := 'stdimg.ok'; // Do NOT localize btnOK.ShowImage := True; btnOK.Anchors := [anRight, anBottom]; btnOK.TabOrder := 1; @@ -986,6 +997,15 @@ begin grid.FontDesc := AValue; end; +procedure TfpgFileDialog.SetInitialDir(const AValue: string); +begin + if FInitialDir <> AValue then + begin + FInitialDir := AValue; + SetCurrentDirectory(FInitialDir); + end; +end; + procedure TfpgFileDialog.SetShowHidden(const Value: boolean); begin btnShowHidden.Down := Value; @@ -1215,7 +1235,7 @@ var begin dlg := TfpgNewDirDialog.Create(nil); try - if dlg.ShowModal = 1 then + if dlg.ShowModal = mrOK then begin if dlg.Directory <> '' then begin @@ -1372,7 +1392,7 @@ begin btnOK.ImageName := 'stdimg.open'; // Do NOT localize btnOK.Text := rsOpen; - if ShowModal = 1 then + if ShowModal = mrOK then Result := True else Result := False; @@ -1396,7 +1416,7 @@ begin btnOK.ImageName := 'stdimg.save'; // Do NOT localize btnOK.Text := rsSave; - if ShowModal = 1 then + if ShowModal = mrOK then Result := True else Result := False; @@ -1414,6 +1434,8 @@ end; {$I promptuserdialog.inc} {$I selectdirdialog.inc} {$I charmapdialog.inc} +{$I colordialog.inc} +{$I inputquerydialog.inc} end. diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas index c7e31225..5dd25fb0 100644 --- a/src/gui/fpg_edit.pas +++ b/src/gui/fpg_edit.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -55,6 +55,8 @@ type FMaxLength: integer; FSelecting: Boolean; FReadOnly: Boolean; + FIgnoreMouseCursor: Boolean; + FAutoSize: Boolean; procedure Adjust(UsePxCursorPos: boolean = false); virtual; procedure AdjustTextOffset(UsePxCursorPos: boolean); virtual; procedure AdjustDrawingInfo; virtual; @@ -75,6 +77,7 @@ type procedure DefaultPopupCopy(Sender: TObject); procedure DefaultPopupPaste(Sender: TObject); procedure DefaultPopupClearAll(Sender: TObject); + procedure DefaultPopupInsertFromCharmap(Sender: TObject); procedure SetDefaultPopupMenuItemsState; procedure SetReadOnly(const AValue: Boolean); protected @@ -111,9 +114,11 @@ type procedure HandleHide; override; function GetDrawText: String; property AutoSelect: Boolean read FAutoSelect write SetAutoSelect default True; + property AutoSize: Boolean read FAutoSize write FAutoSize default True; property BorderStyle: TfpgEditBorderStyle read FBorderStyle write SetBorderStyle default ebsDefault; property FontDesc: String read GetFontDesc write SetFontDesc; property HideSelection: Boolean read FHideSelection write SetHideSelection default True; + property IgnoreMouseCursor: Boolean read FIgnoreMouseCursor write FIgnoreMouseCursor default False; property MaxLength: Integer read FMaxLength write FMaxLength; property PasswordMode: Boolean read FPasswordMode write SetPasswordMode default False; property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu; @@ -155,15 +160,19 @@ type property PopupMenu; // UI Designer doesn't fully support it yet published property AutoSelect; + property AutoSize; property BackgroundColor default clBoxColor; property BorderStyle; property ExtraHint; property FontDesc; property HeightMargin; property HideSelection; + property Hint; + property IgnoreMouseCursor; property MaxLength; property ParentShowHint; property PasswordMode; + property ReadOnly; property ShowHint; property SideMargin; property TabOrder; @@ -176,6 +185,7 @@ type property OnMouseEnter; property OnMouseExit; property OnPaint; + property OnShowHint; end; @@ -223,6 +233,7 @@ type property OnMouseEnter; property OnMouseExit; property OnPaint; + property OnShowHint; public constructor Create(AOwner: TComponent); override; published @@ -244,8 +255,10 @@ type property Text; published property CustomThousandSeparator; + property Hint; property NegativeColor; property ParentShowHint; + property ReadOnly; property ShowHint; property ShowThousand default True; property TabOrder; @@ -258,6 +271,7 @@ type property OnMouseEnter; property OnMouseExit; property OnMouseMove; + property OnShowHint; end; @@ -278,17 +292,19 @@ type property OldColor; property Text; published - property Decimals: integer read FDecimals write SetDecimals default -1; property CustomDecimalSeparator; + property CustomThousandSeparator; + property Decimals: integer read FDecimals write SetDecimals default -1; property FixedDecimals: boolean read FFixedDecimals write SetFixedDecimals default False; + property Hint; property NegativeColor; + property ParentShowHint; + property ReadOnly; + property ShowHint; property ShowThousand default True; property TabOrder; property TextColor; - property CustomThousandSeparator; property Value: extended read GetValue write SetValue; - property ParentShowHint; - property ShowHint; property OnChange; property OnEnter; property OnExit; @@ -296,6 +312,7 @@ type property OnMouseEnter; property OnMouseExit; property OnMouseMove; + property OnShowHint; end; @@ -314,21 +331,24 @@ type property OldColor; property Text; published - property Decimals: integer read FDecimals write SetDecimals default 2; - property NegativeColor; property CustomDecimalSeparator; property CustomThousandSeparator; - property ShowThousand default True; - property Value: Currency read GetValue write SetValue; + property Decimals: integer read FDecimals write SetDecimals default 2; + property Hint; + property NegativeColor; property ParentShowHint; + property ReadOnly; property ShowHint; + property ShowThousand default True; property TabOrder; + property Value: Currency read GetValue write SetValue; property OnChange; property OnEnter; property OnExit; property OnKeyPress; property OnMouseEnter; property OnMouseExit; + property OnShowHint; end; @@ -348,7 +368,8 @@ implementation uses fpg_stringutils, - fpg_constants; + fpg_constants, + fpg_dialogs; const // internal popupmenu item names @@ -356,6 +377,7 @@ const ipmCopy = 'miDefaultCopy'; ipmPaste = 'miDefaultPaste'; ipmClearAll = 'miDefaultClearAll'; + ipmCharmap = 'miDefaultCharmap'; function CreateEdit(AOwner: TComponent; x, y, w, h: TfpgCoord): TfpgEdit; @@ -679,7 +701,7 @@ begin end; Canvas.SetClipRect(r); - if Enabled then + if Enabled and not ReadOnly then Canvas.SetColor(FBackgroundColor) else Canvas.SetColor(clWindowBackground); @@ -703,7 +725,7 @@ begin prevval := Text; s := AText; - if not consumed then + if (not consumed) and (not ReadOnly) then begin // Handle only printable characters // UTF-8 characters beyond ANSI range are supposed to be printable @@ -753,14 +775,18 @@ begin ckPaste: begin DoPaste(fpgClipboard.Text); - hasChanged := True; + if not ReadOnly then + hasChanged := True; end; ckCut: begin DoCopy; DeleteSelection; - Adjust; - hasChanged := True; + if not ReadOnly then + begin + Adjust; + hasChanged := True; + end; end; else Consumed := False; @@ -787,18 +813,20 @@ begin end; keyRight: - if FCursorPos < UTF8Length(FText) then begin consumed := True; - Inc(FCursorPos); + if FCursorPos < UTF8Length(FText) then + begin + Inc(FCursorPos); - if (ssCtrl in shiftstate) then - // word search... - // while (FCursorPos < Length(FText)) and ptkIsAlphaNum(copy(FText,FCursorPos+1,1)) - // do Inc(FCursorPos); - // while (FCursorPos < Length(FText)) and not ptkIsAlphaNum(copy(FText,FCursorPos+1,1)) - // do Inc(FCursorPos); - ; + if (ssCtrl in shiftstate) then + // word search... + // while (FCursorPos < Length(FText)) and ptkIsAlphaNum(copy(FText,FCursorPos+1,1)) + // do Inc(FCursorPos); + // while (FCursorPos < Length(FText)) and not ptkIsAlphaNum(copy(FText,FCursorPos+1,1)) + // do Inc(FCursorPos); + ; + end; end; keyHome: @@ -829,32 +857,32 @@ begin if not Consumed then begin - consumed := True; - - case keycode of - keyBackSpace: - begin - if FSelOffset <> 0 then - DeleteSelection - else if FCursorPos > 0 then + if not ReadOnly then + begin + case keycode of + keyBackSpace: begin - UTF8Delete(FText, FCursorPos, 1); - Dec(FCursorPos); + if FSelOffset <> 0 then + DeleteSelection + else if FCursorPos > 0 then + begin + UTF8Delete(FText, FCursorPos, 1); + Dec(FCursorPos); + hasChanged := True; + end;// backspace + Consumed := True; + end; + + keyDelete: + begin + if FSelOffset <> 0 then + DeleteSelection + else if FCursorPos < UTF8Length(FText) then + UTF8Delete(FText, FCursorPos + 1, 1); hasChanged := True; - end;// backspace - end; - - - keyDelete: - begin - if FSelOffset <> 0 then - DeleteSelection - else if FCursorPos < UTF8Length(FText) then - UTF8Delete(FText, FCursorPos + 1, 1); - hasChanged := True; - end; - else - Consumed := False; + Consumed := True; + end; + end; { case } end; if Consumed then @@ -947,7 +975,7 @@ begin inherited HandleMouseEnter; if (csDesigning in ComponentState) then Exit; - if Enabled then + if Enabled and (not FIgnoreMouseCursor) then MouseCursor := mcIBeam; end; @@ -990,30 +1018,31 @@ end; constructor TfpgBaseEdit.Create(AOwner: TComponent); begin inherited Create(AOwner); - FFont := fpgGetFont('#Edit1'); // owned object ! - Focusable := True; - FHeight := FFont.Height + 8; // (BorderStyle + HeightMargin) * 2 - FWidth := 120; - FTextColor := Parent.TextColor; - FBackgroundColor := clBoxColor; - FAutoSelect := True; - FSelecting := False; - FHideSelection := True; - FReadOnly := False; - FSideMargin := 3; - FHeightMargin := 2; - FMaxLength := 0; // no limit - FText := ''; - FCursorPos := UTF8Length(FText); - FSelStart := FCursorPos; - FSelOffset := 0; - FTextOffset := 0; - FPasswordMode := False; - FBorderStyle := ebsDefault; - FPopupMenu := nil; - FDefaultPopupMenu := nil; - FOnChange := nil; - + FFont := fpgGetFont('#Edit1'); // owned object ! + Focusable := True; + FHeight := FFont.Height + 8; // (BorderStyle + HeightMargin) * 2 + FWidth := 120; + FTextColor := Parent.TextColor; + FBackgroundColor := clBoxColor; + FAutoSelect := True; + FAutoSize := True; + FSelecting := False; + FHideSelection := True; + FReadOnly := False; + FSideMargin := 3; + FHeightMargin := 2; + FMaxLength := 0; // no limit + FText := ''; + FCursorPos := UTF8Length(FText); + FSelStart := FCursorPos; + FSelOffset := 0; + FTextOffset := 0; + FPasswordMode := False; + FBorderStyle := ebsDefault; + FIgnoreMouseCursor := False; + FPopupMenu := nil; + FDefaultPopupMenu := nil; + FOnChange := nil; end; destructor TfpgBaseEdit.Destroy; @@ -1057,16 +1086,19 @@ procedure TfpgBaseEdit.SetFontDesc(const AValue: string); begin FFont.Free; FFont := fpgGetFont(AValue); - case BorderStyle of - ebsNone: - if Height < FFont.Height + (FHeightMargin * 2) then - Height:= FFont.Height + (FHeightMargin * 2); - ebsDefault: - if Height < FFont.Height + 4 + (FHeightMargin * 2) then - Height:= FFont.Height + 4 + (FHeightMargin * 2); - ebsSingle: - if Height < FFont.Height + 2 + (FHeightMargin * 2) then - Height:= FFont.Height + 2 + (FHeightMargin * 2); + if AutoSize then + begin + case BorderStyle of + ebsNone: + if Height < FFont.Height + (FHeightMargin * 2) then + Height:= FFont.Height + (FHeightMargin * 2); + ebsDefault: + if Height < FFont.Height + 4 + (FHeightMargin * 2) then + Height:= FFont.Height + 4 + (FHeightMargin * 2); + ebsSingle: + if Height < FFont.Height + 2 + (FHeightMargin * 2) then + Height:= FFont.Height + 2 + (FHeightMargin * 2); + end; end; Adjust; RePaint; @@ -1130,24 +1162,43 @@ end; procedure TfpgBaseEdit.DefaultPopupCut(Sender: TObject); begin + if ReadOnly then + Exit; CutToClipboard; end; procedure TfpgBaseEdit.DefaultPopupCopy(Sender: TObject); begin + if ReadOnly then + Exit; CopyToClipboard; end; procedure TfpgBaseEdit.DefaultPopupPaste(Sender: TObject); begin + if ReadOnly then + Exit; PasteFromClipboard end; procedure TfpgBaseEdit.DefaultPopupClearAll(Sender: TObject); begin + if ReadOnly then + Exit; Clear; end; +procedure TfpgBaseEdit.DefaultPopupInsertFromCharmap(Sender: TObject); +var + s: TfpgString; +begin + if ReadOnly then + Exit; + s := fpgShowCharMap; + if s <> '' then + DoPaste(s); +end; + procedure TfpgBaseEdit.SetDefaultPopupMenuItemsState; var i: integer; @@ -1160,13 +1211,15 @@ begin itm := TfpgMenuItem(FDefaultPopupMenu.Components[i]); // enabled/disable menu items if itm.Name = ipmCut then - itm.Enabled := FSelOffset <> 0 + itm.Enabled := (not ReadOnly) and (FSelOffset <> 0) else if itm.Name = ipmCopy then itm.Enabled := FSelOffset <> 0 else if itm.Name = ipmPaste then - itm.Enabled := fpgClipboard.Text <> '' + itm.Enabled := (not ReadOnly) and (fpgClipboard.Text <> '') else if itm.Name = ipmClearAll then - itm.Enabled := Text <> ''; + itm.Enabled := (not ReadOnly) and (Text <> '') + else if itm.Name = ipmCharmap then + itm.Enabled := (not ReadOnly); end; end; end; @@ -1175,6 +1228,7 @@ procedure TfpgBaseEdit.SetReadOnly(const AValue: Boolean); begin if FReadOnly = AValue then exit; FReadOnly := AValue; + RePaint; end; function TfpgBaseEdit.GetMarginAdjustment: integer; @@ -1204,6 +1258,10 @@ begin itm.Name := ipmPaste; itm := FDefaultPopupMenu.AddMenuItem(rsDelete, '', @DefaultPopupClearAll); itm.Name := ipmClearAll; + itm := FDefaultPopupMenu.AddMenuItem('-', '', nil); + itm.Name := 'N1'; + itm := FDefaultPopupMenu.AddMenuItem(rsInsertFromCharacterMap, '', @DefaultPopupInsertFromCharmap); + itm.Name := ipmCharmap; end; SetDefaultPopupMenuItemsState; @@ -1214,6 +1272,8 @@ procedure TfpgBaseEdit.DeleteSelection; var prevval: TfpgString; begin + if ReadOnly then + Exit; prevval := FText; if FSelOffset <> 0 then begin @@ -1246,6 +1306,8 @@ var s: string; prevval: TfpgString; begin + if ReadOnly then + Exit; prevval := FText; DeleteSelection; s := AText; @@ -1333,19 +1395,25 @@ end; procedure TfpgBaseTextEdit.HandlePaint; var r: TfpgRect; + flags: TFTextFlags; begin inherited HandlePaint; r := Canvas.GetClipRect; // contains adjusted size based on borders + r.Left := -FDrawOffset + GetMarginAdjustment; - if (FVisibleText = '') and not Focused then + if Enabled and (FVisibleText = '') and (not Focused) then begin Canvas.SetTextColor(clShadow1); - fpgStyle.DrawString(Canvas, -FDrawOffset + GetMarginAdjustment, r.Top + FHeightMargin, FExtraHint, Enabled); + flags := [txtLeft, txtVCenter]; + Canvas.DrawText(r, FExtraHint, flags); // fpgStyle.DrawString is called internally end else begin Canvas.SetTextColor(FTextColor); - fpgStyle.DrawString(Canvas, -FDrawOffset + GetMarginAdjustment, r.Top + FHeightMargin, FVisibleText, Enabled); + flags := [txtLeft, txtVCenter]; + if not Enabled then + flags += [txtDisabled]; + Canvas.DrawText(r, FVisibleText, flags); // fpgStyle.DrawString is called internally end; if Focused then @@ -1692,12 +1760,6 @@ begin r := GetClientRect; Canvas.SetClipRect(r); - if Enabled then - Canvas.SetColor(FBackgroundColor) - else - Canvas.SetColor(clWindowBackground); - Canvas.FillRectangle(r); - Canvas.SetFont(Font); Canvas.SetTextColor(TextColor); x := r.Width - Font.TextWidth(Text) - FSideMargin; diff --git a/src/gui/fpg_editbtn.pas b/src/gui/fpg_editbtn.pas new file mode 100644 index 00000000..70c6da00 --- /dev/null +++ b/src/gui/fpg_editbtn.pas @@ -0,0 +1,435 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit contains various "composite" components. Components that + work together as a single component. +} + +unit fpg_editbtn; + +{$mode objfpc}{$H+} + +interface + +uses + Classes + ,fpg_base + ,fpg_main + ,fpg_widget + ,fpg_edit + ,fpg_button + ,fpg_panel + ; + +type + TfpgBaseEditButton = class(TfpgAbstractPanel) + private + FOnButtonClick: TNotifyEvent; + FReadOnly: Boolean; + procedure SetReadOnly(const AValue: Boolean); + function GetExtraHint: TfpgString; + procedure SetExtraHint(const AValue: TfpgString); + protected + FEdit: TfpgEdit; + FButton: TfpgButton; + function GetOnShowHint: THintEvent; override; + procedure SetOnShowHint(const AValue: THintEvent); override; + procedure SetHint(const AValue: TfpgString); override; + function GetHint: TfpgString; override; + procedure InternalButtonClick(Sender: TObject); virtual; + procedure HandleResize(AWidth, AHeight: TfpgCoord); override; + property ExtraHint: TfpgString read GetExtraHint write SetExtraHint; + property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; + property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick; + public + constructor Create(AOwner: TComponent); override; + end; + + + TfpgFileNameEdit = class(TfpgBaseEditButton) + private + FFilter: TfpgString; + FInitialDir: TfpgString; + procedure SetFilter(const AValue: TfpgString); + procedure SetFileName(const AValue: TfpgString); + function GetFileName: TfpgString; + protected + procedure HandlePaint; override; + procedure InternalButtonClick(Sender: TObject); override; + public + constructor Create(AOwner: TComponent); override; + published + property ExtraHint; + property FileName: TfpgString read GetFileName write SetFileName; + property InitialDir: TfpgString read FInitialDir write FInitialDir; + property Filter: TfpgString read FFilter write SetFilter; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; + end; + + + TfpgDirectoryEdit = class(TfpgBaseEditButton) + private + FRootDirectory: TfpgString; + function GetDirectory: TfpgString; + procedure SetDirectory(const AValue: TfpgString); + protected + procedure HandlePaint; override; + procedure InternalButtonClick(Sender: TObject); override; + public + constructor Create(AOwner: TComponent); override; + published + property Directory: TfpgString read GetDirectory write SetDirectory; + property ExtraHint; + property RootDirectory: TfpgString read FRootDirectory write FRootDirectory; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; + end; + + + TfpgFontEdit = class(TfpgBaseEditButton) + protected + 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 + property FontDesc: TfpgString read GetFontDesc write SetFontDesc; + property ReadOnly; + property TabOrder; + property OnButtonClick; + property OnShowHint; + end; + + +implementation + +uses + fpg_constants + ,fpg_dialogs + ,fpg_utils + ; + + +{ TfpgBaseEditButton } + +procedure TfpgBaseEditButton.SetReadOnly(const AValue: Boolean); +begin + if FReadOnly = AValue then + Exit; + FReadOnly := AValue; + FEdit.ReadOnly := FReadOnly; + FButton.Enabled := not FReadOnly; // Buttons don't have ReadOnly property. +end; + +function TfpgBaseEditButton.GetExtraHint: TfpgString; +begin + Result := FEdit.ExtraHint; +end; + +procedure TfpgBaseEditButton.SetExtraHint(const AValue: TfpgString); +begin + FEdit.ExtraHint := AValue; +end; + +function TfpgBaseEditButton.GetOnShowHint: THintEvent; +begin + // rewire the FEdit event to the parent (composite) component + Result := FEdit.OnShowHint; +end; + +procedure TfpgBaseEditButton.SetOnShowHint(const AValue: THintEvent); +begin + // rewire the FEdit event to the parent (composite) component + FEdit.OnShowHint := AValue; +end; + +procedure TfpgBaseEditButton.SetHint(const AValue: TfpgString); +begin + FEdit.Hint := AValue; +end; + +function TfpgBaseEditButton.GetHint: TfpgString; +begin + Result := FEdit.Hint; +end; + +procedure TfpgBaseEditButton.InternalButtonClick(Sender: TObject); +begin + // do nothing + if Assigned(OnButtonClick) then + OnButtonClick(self); +end; + +procedure TfpgBaseEditButton.HandleResize(AWidth, AHeight: TfpgCoord); +begin + inherited HandleResize(AWidth, AHeight); + if csDesigning in ComponentState then + begin + FEdit.Visible := False; + FButton.Visible := False; + end + else + begin + FEdit.SetPosition(0, 0, AWidth - AHeight, AHeight); + FButton.SetPosition(AWidth - AHeight, 0, AHeight, AHeight); + end; +end; + +constructor TfpgBaseEditButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FWidth := 140; + FHeight := 24; + FReadOnly := False; + + FEdit := TfpgEdit.Create(self); + with FEdit do + begin + Name := 'FEdit'; + Text := ''; + FontDesc := '#Edit1'; + TabOrder := 0; + end; + + FButton := TfpgButton.Create(self); + with FButton do + begin + Name := 'FButton'; + Text := ''; + FontDesc := '#Label1'; + ImageMargin := -1; + ImageName := 'stdimg.elipses'; + ImageSpacing := 0; + TabOrder := 1; + OnClick := @InternalButtonClick; + end; +end; + + + +{ TfpgFileNameEdit } + +constructor TfpgFileNameEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FFilter := ''; + FButton.ImageName := 'stdimg.folderfile'; +end; + +procedure TfpgFileNameEdit.SetFilter(const AValue: TfpgString); +begin + FFilter := AValue; +end; + +procedure TfpgFileNameEdit.SetFileName(const AValue: TfpgString); +begin + FEdit.Text := AValue; +end; + +function TfpgFileNameEdit.GetFileName: TfpgString; +begin + Result := FEdit.Text; +end; + +procedure TfpgFileNameEdit.HandlePaint; +var + img: TfpgImage; +begin + inherited HandlePaint; + // only so that it looks pretty in the UI Designer + if csDesigning in ComponentState then + begin + FEdit.Visible := False; + FButton.Visible := False; + Canvas.Clear(clBoxColor); + fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); + fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); + Canvas.SetFont(fpgApplication.DefaultFont); + if Filename <> '' then + begin + Canvas.TextColor := clText3; + Canvas.DrawText(4, 0, Width - Height, Height, Filename, [txtLeft, txtVCenter]); + end + else + begin + Canvas.TextColor := clShadow1; + Canvas.DrawText(0, 0, Width - Height, Height, ClassName, [txtHCenter, txtVCenter]); + end; + img := fpgImages.GetImage('stdimg.folderfile'); // don't free the img instance - we only got a reference + if img <> nil then + Canvas.DrawImage(Width-Height+((Height-img.Width) div 2), (Height-img.Height) div 2, img); + end; +end; + +procedure TfpgFileNameEdit.InternalButtonClick(Sender: TObject); +var + dlg: TfpgFileDialog; +begin + dlg := TfpgFileDialog.Create(nil); + try + if FileName = '' then + begin + if FInitialDir <> '' then + dlg.InitialDir := FInitialDir; + end + else + begin + // Use path of existing filename + dlg.InitialDir := fpgExtractFilePath(FileName); + if dlg.InitialDir = '' then // FileName had no path + dlg.InitialDir := FInitialDir; + end; + if FFilter = '' then + dlg.Filter := rsAllFiles + ' (' + AllFilesMask + ')' + '|' + AllFilesMask + else + dlg.Filter := FFilter + '|' + rsAllFiles + ' (' + AllFilesMask + ')' + '|' + AllFilesMask; + if dlg.RunOpenFile then + begin + FEdit.Text := dlg.FileName; + end; + finally + dlg.Free; + end; + inherited InternalButtonClick(Sender); +end; + + +{ TfpgDirectoryEdit} + +constructor TfpgDirectoryEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FButton.ImageName := 'stdimg.folder'; +end; + +function TfpgDirectoryEdit.GetDirectory: TfpgString; +begin + Result := FEdit.Text; +end; + +procedure TfpgDirectoryEdit.SetDirectory(const AValue: TfpgString); +begin + FEdit.Text := AValue; +end; + +procedure TfpgDirectoryEdit.HandlePaint; +var + img: TfpgImage; +begin + inherited HandlePaint; + // only so that it looks pretty in the UI Designer + if csDesigning in ComponentState then + begin + FEdit.Visible := False; + FButton.Visible := False; + Canvas.Clear(clBoxColor); + fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); + fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); + Canvas.SetFont(fpgApplication.DefaultFont); + if Directory <> '' then + begin + Canvas.TextColor := clText3; + Canvas.DrawText(4, 0, Width - Height, Height, Directory, [txtLeft, txtVCenter]); + end + else + begin + Canvas.TextColor := clShadow1; + Canvas.DrawText(0, 0, Width - Height, Height, ClassName, [txtHCenter, txtVCenter]); + end; + img := fpgImages.GetImage('stdimg.folder'); // don't free the img instance - we only got a reference + if img <> nil then + Canvas.DrawImage(Width-Height+((Height-img.Width) div 2), (Height-img.Height) div 2, img); + end; +end; + +procedure TfpgDirectoryEdit.InternalButtonClick(Sender: TObject); +var + dlg: TfpgSelectDirDialog; +begin + dlg := TfpgSelectDirDialog.Create(nil); + try + if FRootDirectory <> '' then + dlg.RootDirectory := FRootDirectory; + dlg.SelectedDir := Directory; + if dlg.ShowModal = mrOK then + begin + FEdit.Text:= dlg.SelectedDir; + end; + finally + dlg.Free; + end; + inherited InternalButtonClick(Sender); +end; + + +{ TfpgFontEdit } + +function TfpgFontEdit.GetFontDesc: TfpgString; +begin + Result := FEdit.Text; +end; + +procedure TfpgFontEdit.SetFontDesc(const AValue: TfpgString); +begin + FEdit.Text := AValue; +end; + +procedure TfpgFontEdit.HandlePaint; +var + img: TfpgImage; +begin + inherited HandlePaint; + // only so that it looks pretty in the UI Designer + if csDesigning in ComponentState then + begin + FEdit.Visible := False; + FButton.Visible := False; + Canvas.Clear(clBoxColor); + 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.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 + Canvas.DrawImage(Width-Height+((Height-img.Width) div 2), (Height-img.Height) div 2, img); + end; +end; + +procedure TfpgFontEdit.InternalButtonClick(Sender: TObject); +var + f: TfpgString; +begin + f := FontDesc; + if SelectFontDialog(f) then + FontDesc := f; + inherited InternalButtonClick(Sender); +end; + +constructor TfpgFontEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FButton.ImageName := 'stdimg.font'; +end; + + +end. + diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas index 8d660664..20b6ee8d 100644 --- a/src/gui/fpg_editcombo.pas +++ b/src/gui/fpg_editcombo.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -64,8 +64,6 @@ type TAllowNew = (anNo, anYes, anAsk); - { TfpgBaseEditCombo } - TfpgBaseEditCombo = class(TfpgBaseComboBox) private FAutoCompletion: Boolean; @@ -77,8 +75,7 @@ type procedure SetAllowNew(const AValue: TAllowNew); procedure InternalBtnClick(Sender: TObject); procedure InternalListBoxSelect(Sender: TObject); - procedure InternalListBoxKeyPress(Sender: TObject; var keycode: word; var shiftstate: TShiftState; - var consumed: Boolean); + procedure InternalListBoxKeyPress(Sender: TObject; var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); protected FDropDown: TfpgPopupWindow; FDrawOffset: integer; @@ -120,6 +117,7 @@ type property FocusItem; property FontDesc; property Height; + property Hint; property Items; property Margin; property Text; @@ -131,6 +129,7 @@ type property OnEnter; property OnExit; property OnKeyPress; + property OnShowHint; end; diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas index 8c2545c1..57c156a6 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 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -34,6 +34,9 @@ type TFormCloseEvent = procedure(Sender: TObject; var CloseAction: TCloseAction) of object; TFormCloseQueryEvent = procedure(Sender: TObject; var CanClose: boolean) of object; + TfpgHelpEvent = function(AHelpType: THelpType; AHelpContext: THelpContext; + const AHelpKeyword: String; const AHelpFile: String; + var AHandled: Boolean): Boolean of object; TfpgBaseForm = class(TfpgWidget) @@ -47,14 +50,13 @@ type FOnDestroy: TNotifyEvent; FOnHide: TNotifyEvent; FOnShow: TNotifyEvent; + FOnHelp: TfpgHelpEvent; protected FModalResult: TfpgModalResult; FParentForm: TfpgBaseForm; FWindowPosition: TWindowPosition; FWindowTitle: string; FSizeable: boolean; - procedure AdjustWindowStyle; override; - procedure SetWindowParameters; override; procedure SetWindowTitle(const ATitle: string); override; procedure MsgActivate(var msg: TfpgMessageRec); message FPGM_ACTIVATE; procedure MsgDeActivate(var msg: TfpgMessageRec); message FPGM_DEACTIVATE; @@ -67,6 +69,7 @@ type procedure HandleResize(awidth, aheight: TfpgCoord); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure DoOnClose(var CloseAction: TCloseAction); virtual; + function DoOnHelp(AHelpType: THelpType; AHelpContext: THelpContext; const AHelpKeyword: String; const AHelpFile: String; var AHandled: Boolean): Boolean; virtual; // properties property Sizeable: boolean read FSizeable write FSizeable; property ModalResult: TfpgModalResult read FModalResult write FModalResult; @@ -80,6 +83,7 @@ type property OnCreate: TNotifyEvent read FOnCreate write FOnCreate; property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate; property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + property OnHelp: TfpgHelpEvent read FOnHelp write FOnHelp; property OnHide: TNotifyEvent read FOnHide write FOnHide; property OnShow: TNotifyEvent read FOnShow write FOnShow; public @@ -88,9 +92,12 @@ type procedure AfterConstruction; override; procedure BeforeDestruction; override; procedure AfterCreate; virtual; + procedure AdjustWindowStyle; override; + procedure SetWindowParameters; override; + procedure InvokeHelp; override; procedure Show; procedure Hide; - function ShowModal: integer; + function ShowModal: TfpgModalResult; procedure Close; function CloseQuery: boolean; virtual; end; @@ -100,22 +107,41 @@ type published property BackgroundColor; property FullScreen; + property Height; + property Hint; + property Left; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; property ModalResult; - property Sizeable; property ShowHint; + property Sizeable; property TextColor; + property Top; + property Width; property WindowPosition; property WindowTitle; property OnActivate; + property OnClick; property OnClose; property OnCloseQuery; property OnCreate; property OnDeactivate; property OnDestroy; + property OnDoubleClick; + property OnEnter; + property OnExit; property OnHide; + property OnMouseDown; + property OnMouseEnter; + property OnMouseExit; + property OnMouseMove; + property OnMouseUp; property OnPaint; property OnResize; property OnShow; + property OnShowHint; end; @@ -262,13 +288,25 @@ begin // for the user end; +procedure TfpgBaseForm.InvokeHelp; +var + lEventHandled: Boolean; + lSucceeded: Boolean; +begin + lEventHandled := False; + lSucceeded := False; + lSucceeded := DoOnHelp(HelpType, HelpContext, HelpKeyword, fpgApplication.HelpFile, lEventHandled); + if (not lSucceeded) or (not lEventHandled) then + inherited InvokeHelp; +end; + procedure TfpgBaseForm.Show; begin FVisible := True; HandleShow; end; -function TfpgBaseForm.ShowModal: integer; +function TfpgBaseForm.ShowModal: TfpgModalResult; var lCloseAction: TCloseAction; begin @@ -288,7 +326,6 @@ begin except on E: Exception do begin - ModalResult := -1; Visible := False; fpgApplication.HandleException(self); end; @@ -301,7 +338,7 @@ begin if ModalResult <> mrNone then begin - lCloseAction := caFree; // Dummy variable - we do nothing with it + lCloseAction := caHide; // Dummy variable - we do nothing with it DoOnClose(lCloseAction); // Simply so the OnClose event fires. end; end; @@ -369,8 +406,8 @@ end; procedure TfpgBaseForm.AfterConstruction; begin - inherited AfterConstruction; AfterCreate; + inherited AfterConstruction; if Assigned(FOnCreate) then FOnCreate(self); end; @@ -388,12 +425,16 @@ begin OnClose(self, CloseAction); end; +function TfpgBaseForm.DoOnHelp(AHelpType: THelpType; AHelpContext: THelpContext; + const AHelpKeyword: String; const AHelpFile: String; var AHandled: Boolean): Boolean; +begin + if Assigned(FOnHelp) then + Result := FOnHelp(AHelpType, AHelpContext, AHelpKeyword, AHelpFile, AHandled); +end; + procedure TfpgBaseForm.Hide; begin Visible := False; -// HandleHide; - if ModalResult = mrNone then - ModalResult := -1; end; procedure TfpgBaseForm.Close; @@ -426,7 +467,7 @@ begin fpgApplication.Terminate else // We can't free ourselves, somebody else needs to do it - fpgPostMessage(Self, fpgApplication, FPGM_CLOSE); + fpgPostMessage(Self, fpgApplication, FPGM_FREEME); end; end; { case CloseAction } end; { if CloseQuery } diff --git a/src/gui/fpg_gauge.pas b/src/gui/fpg_gauge.pas index b8678828..37a154c6 100644 --- a/src/gui/fpg_gauge.pas +++ b/src/gui/fpg_gauge.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -87,6 +87,7 @@ type property Color: TfpgColor read FColor write FColor default clButtonFace; property Enabled; property FirstColor: TfpgColor read FFirstColor write SetFirstColor default clBlack; + property Hint; property Kind: TGaugeKind read FKind write SetGaugeKind default gkHorizontalBar; property MaxValue: Longint read FMax write SetMax default 100; property MinValue: Longint read FMin write SetMin default 0; @@ -96,6 +97,7 @@ type property ShowHint; property ShowText: Boolean read FShowText write SetShowText default True; property Visible; + property OnShowHint; end; @@ -113,22 +115,22 @@ uses to be moved in CanvasBase? } procedure FillArcGradient(canvas: TfpgCanvas; X,Y,W,H: TfpgCoord; a1,a2: double; Astart,Astop: TfpgColor); var - RGBStart: TRGBTriple; - RGBStop: TRGBTriple; + RGBStart: TFPColor; + RGBStop: TFPColor; RDiff, GDiff, BDiff: Integer; count: Integer; i: Integer; - newcolor: TRGBTriple; + newcolor: TFPColor; begin - if Astart = Astop then + if Astart = Astop then begin { No gradient, just solid color} canvas.SetColor(Astart); canvas.FillArc(X, Y, W, H, a1, a2); Exit; //==> end; - RGBStart := fpgColorToRGBTriple(fpgColorToRGB(AStart)); - RGBStop := fpgColorToRGBTriple(fpgColorToRGB(AStop)); + RGBStart := fpgColorToFPColor(fpgColorToRGB(AStart)); + RGBStop := fpgColorToFPColor(fpgColorToRGB(AStop)); count := min(H,W); count := count div 2; @@ -154,7 +156,7 @@ begin newcolor.Red := RGBStart.Red + (i * RDiff) div count; newcolor.Green := RGBStart.Green + (i * GDiff) div count; newcolor.Blue := RGBStart.Blue + (i * BDiff) div count; - canvas.SetColor(RGBTripleTofpgColor(newcolor)); + canvas.SetColor(FPColorTofpgColor(newcolor)); canvas.DrawArc(X, Y, W, H, a1, a2); end; end; diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 6d7579a0..112a1f33 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -25,7 +25,6 @@ unit fpg_grid; returning a TStrings with all related text inserted. * File Grid: Introduce support for images based on file types. User must be able to override the default images with their own. - * Remove the usage of libc unit. libc is linux/x86 specific. } interface @@ -57,16 +56,18 @@ type property Font; property HeaderFont; published - property FontDesc; - property HeaderFontDesc; - property RowCount; property ColumnCount; property Columns; property FocusRow; + property FontDesc; + property HeaderFontDesc; + property Options; + property RowCount; property ScrollBarStyle; property TabOrder; property OnRowChange; property OnDoubleClick; + property OnShowHint; end; @@ -121,7 +122,10 @@ type TfpgStringGrid = class(TfpgCustomStringGrid) + public + property Font; published + property AlternateBGColor; property BackgroundColor; // property ColResizing; property ColumnCount; @@ -134,8 +138,10 @@ type property FontDesc; property HeaderFontDesc; property HeaderHeight; + property Hint; property Options; property ParentShowHint; + property PopupMenu; property RowCount; property RowSelect; property ScrollBarStyle; @@ -151,6 +157,7 @@ type property OnFocusChange; property OnKeyPress; property OnRowChange; + property OnShowHint; end; function CreateStringGrid(AOwner: TComponent; x, y, w, h: TfpgCoord; AColumnCount: integer = 0): TfpgStringGrid; @@ -456,6 +463,7 @@ procedure TfpgCustomStringGrid.DrawCell(ARow, ACol: Integer; ARect: TfpgRect; var Flags: TFTextFlags; txt: string; + r: TfpgRect; begin if Cells[ACol, ARow] <> '' then begin @@ -483,7 +491,14 @@ begin end; { case } with ARect,Columns[ACol] do - Canvas.DrawText(Left+HMargin, Top, Right-Left-(HMargin*2), Bottom-Top, txt, Flags); + begin + r := ARect; + // make adjustment for margins + r.Left := r.Left + HMargin; + r.Width := r.Width - (HMargin*2); + // finally paint the text + Canvas.DrawText(r, txt, Flags); + end; end; end; diff --git a/src/gui/fpg_hint.pas b/src/gui/fpg_hint.pas index 34fc7ca2..38fff686 100644 --- a/src/gui/fpg_hint.pas +++ b/src/gui/fpg_hint.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -28,19 +28,19 @@ uses SysUtils, fpg_base, fpg_main, - fpg_form, - fpg_label; + fpg_form; type - TfpgHintWindow = class(TfpgForm) + TfpgHintWindow = class(TfpgBaseForm) private FFont: TfpgFont; FTime: Integer; FShadow: Integer; FBorder: Integer; FMargin: Integer; - L_Hint: TfpgLabel; T_Chrono: TfpgTimer; + FHintTextRec: TfpgRect; + FText: TfpgString; procedure FormShow(Sender: TObject); procedure FormHide(Sender: TObject); function GetText: TfpgString; @@ -49,24 +49,38 @@ type procedure SetShadow(AValue: Integer); procedure SetBorder(AValue: Integer); procedure SetTime(AValue: Integer); - procedure SetLTextColor(AValue: Tfpgcolor); - procedure SetLBackgroundColor(AValue: Tfpgcolor); procedure SetShadowColor(AValue: TfpgColor); + function GetFontDesc: string; + procedure SetFontDesc(const AValue: string); protected procedure HandleShow; override; + procedure HandlePaint; override; + procedure PaintBorder; virtual; + procedure PaintHintText; virtual; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure SetPosition(aleft, atop, awidth, aheight: TfpgCoord); override; property Font: TfpgFont read FFont; property Text: TfpgString read GetText write SetText; property Shadow: Integer read FShadow write SetShadow default 0; property Border: Integer read FBorder write SetBorder default 1; property Margin: Integer read FMargin write FMargin default 3; - property LTextColor: TfpgColor write SetLTextColor default clBlack; - property LBackgroundColor: TfpgColor write SetLBackgroundColor default clHintWindow; property ShadowColor: TfpgColor write SetShadowColor default clGray; - property Time: Integer write SetTime default 5000; + property Time: Integer read FTime write SetTime; + published + property BackgroundColor; + property FontDesc: string read GetFontDesc write SetFontDesc; + property TextColor; + //property OnActivate; + property OnClose; + //property OnCloseQuery; + property OnCreate; + //property OnDeactivate; + property OnDestroy; + property OnHide; + property OnPaint; + property OnResize; + property OnShow; end; @@ -79,6 +93,7 @@ var implementation + type TfpgHintShadow = class(TfpgForm) public @@ -106,18 +121,18 @@ end; function TfpgHintWindow.GetText: TfpgString; begin - Result := L_Hint.Text; + Result := FText; end; procedure TfpgHintWindow.SetText(const AValue: TfpgString); begin - L_Hint.Text := AValue; + FText := AValue; end; procedure TfpgHintWindow.T_ChronoFini(Sender: TObject); begin {$IFDEF DEBUG} - writeln('TF_Hint.T_ChronoFini timer fired'); + writeln('DEBUG: TfpgHintWindow.T_ChronoFini timer fired'); {$ENDIF} Hide; end; @@ -143,22 +158,21 @@ begin end; end; -procedure TfpgHintWindow.SetLTextColor(AValue: Tfpgcolor); +procedure TfpgHintWindow.SetShadowColor(AValue: Tfpgcolor); begin - if L_Hint.TextColor <> AValue then - L_Hint.TextColor := AValue + if uShadowForm.BackgroundColor <> AValue then + uShadowForm.BackgroundColor := AValue; end; -procedure TfpgHintWindow.SetLBackgroundColor(AValue: Tfpgcolor); +function TfpgHintWindow.GetFontDesc: string; begin - if L_Hint.BackgroundColor <> AValue then - L_Hint.BackgroundColor := AValue + Result := FFont.FontDesc; end; -procedure TfpgHintWindow.SetShadowColor(AValue: Tfpgcolor); +procedure TfpgHintWindow.SetFontDesc(const AValue: string); begin - if uShadowForm.BackgroundColor <> AValue then - uShadowForm.BackgroundColor := AValue; + FFont.Free; + FFont := fpgGetFont(AValue); end; procedure TfpgHintWindow.HandleShow; @@ -172,6 +186,38 @@ begin inherited HandleShow; end; +procedure TfpgHintWindow.HandlePaint; +begin + inherited HandlePaint; // background is set + Canvas.ClearClipRect; + Canvas.Font := FFont; + // Do we need to resize? + PaintBorder; + if FBorder > 0 then + Canvas.SetClipRect(fpgRect(FBorder, FBorder, Width-(FBorder*2), Height-(FBorder*2))); + PaintHintText; +end; + +procedure TfpgHintWindow.PaintBorder; +var + i: integer; +begin + if FBorder = 0 then // no border + Exit; + Canvas.Color := clBlack; + for i := 0 to FBorder-1 do + begin + Canvas.DrawRectangle(i, i, Width-(i*2), Height-(i*2)); + end; +end; + +procedure TfpgHintWindow.PaintHintText; +begin + FHintTextRec.SetRect(FBorder, FBorder, Width-(FBorder*2), Height-(FBorder*2)); + Canvas.TextColor := FTextColor; + Canvas.DrawText(FHintTextRec, Text, [txtHCenter, txtVCenter, txtWrap]); +end; + constructor TfpgHintWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -179,34 +225,28 @@ begin WindowPosition := wpUser; WindowType := wtPopup; Sizeable := False; - BackgroundColor:= clBlack; + BackgroundColor:= clHintWindow; //clBlack; // This becomes the hint border so don't set to clHintWindow FFont := fpgGetFont('#Label1'); FMargin := 3; FBorder := 1; FShadow := 0; // no shadow by default - FTime := 5000; - L_Hint := CreateLabel(Self, FBorder, FBorder, '', Width - FBorder * 2, Height - FBorder * 2, taCenter, tlCenter); - L_Hint.BackgroundColor := clHintWindow; - L_Hint.OnClick := @T_ChronoFini; + FTime := 5000; // show hint for 5 seconds then close + FHintTextRec.SetRect(FBorder, FBorder, Width-(FBorder*2), Height-(FBorder*2)); T_Chrono := TfpgTimer.Create(FTime); T_Chrono.OnTimer := @T_ChronoFini; uShadowForm:= TfpgHintShadow.Create(nil); + OnClick := @T_ChronoFini; OnShow := @FormShow; OnHide := @FormHide; end; destructor TfpgHintWindow.Destroy; begin + T_Chrono.Enabled := False; T_Chrono.Free; FFont.Free; inherited Destroy; - uShadowForm.Destroy; -end; - -procedure TfpgHintWindow.SetPosition(aleft, atop, awidth, aheight: TfpgCoord); -begin - inherited SetPosition(aleft, atop, awidth, aheight); - L_Hint.SetPosition(Border, Border, Width - (Border * 2), Height - (Border * 2)); + uShadowForm.Free; end; constructor TfpgHintShadow.Create(AOwner: TComponent); diff --git a/src/gui/fpg_hyperlink.pas b/src/gui/fpg_hyperlink.pas index ffed0bfb..2c850a97 100644 --- a/src/gui/fpg_hyperlink.pas +++ b/src/gui/fpg_hyperlink.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -50,14 +50,18 @@ type constructor Create(AOwner: TComponent); override; procedure GoHyperLink; published + property Alignment; property Autosize; property FontDesc; + property Hint; property HotTrackColor: TfpgColor read fHotTrackColor write SetHotTrackColor; property HotTrackFont: TfpgString read fHTFont write SetHotTrackFont; property Text; property TextColor; + property ShowHint; property URL: TfpgString read FUrl write SetURL; property OnClick; + property OnShowHint; end; diff --git a/src/gui/fpg_iniutils.pas b/src/gui/fpg_iniutils.pas index ef6a7f7d..1c8fe45a 100644 --- a/src/gui/fpg_iniutils.pas +++ b/src/gui/fpg_iniutils.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2007 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -53,7 +53,8 @@ implementation uses fpg_main, - fpg_constants; + fpg_constants, + fpg_utils; var uINI: TfpgINIFile; @@ -89,7 +90,7 @@ begin if lFileName = '' then lFileName := ApplicationName + '.ini' - else if ExtractFileExt(lFileName) = '' then + else if fpgExtractFileExt(lFileName) = '' then lFileName := lFileName + '.ini'; lFileName := lDir + lFileName; diff --git a/src/gui/fpg_label.pas b/src/gui/fpg_label.pas index 94a0df4c..409116b9 100644 --- a/src/gui/fpg_label.pas +++ b/src/gui/fpg_label.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -72,13 +72,21 @@ type property AutoSize; property BackgroundColor; property FontDesc; + property Height; property Hint; property Layout; + property Left; property LineSpace; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; + property Parent; property ParentShowHint; property ShowHint; property Text; property TextColor; + property Top; property Width; property WrapText; property OnClick; @@ -88,6 +96,7 @@ type property OnMouseExit; property OnMouseMove; property OnMouseUp; + property OnShowHint; end; @@ -106,19 +115,19 @@ begin Result.Top := y; Result.Text := AText; Result.LineSpace := ALineSpace; - if w = 0 then - begin - Result.Width := Result.Font.TextWidth(Result.Text); - Result.FAutoSize := True; - end - else - Result.Width := w; if h < Result.Font.Height then Result.Height:= Result.Font.Height else Result.Height:= h; Result.Alignment:= HAlign; Result.Layout:= VAlign; + if w = 0 then + begin + Result.Width := Result.Font.TextWidth(Result.Text); + Result.AutoSize := True; + end + else + Result.Width := w; end; { TfpgCustomLabel } @@ -183,7 +192,7 @@ end; procedure TfpgCustomLabel.ResizeLabel; begin if FAutoSize and not FWrapText then - Width:= FFont.TextWidth(FText); + Width := FFont.TextWidth(FText); UpdateWindowPosition; RePaint; end; diff --git a/src/gui/fpg_listbox.pas b/src/gui/fpg_listbox.pas index 384704bf..4b6d162e 100644 --- a/src/gui/fpg_listbox.pas +++ b/src/gui/fpg_listbox.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -137,6 +137,7 @@ type property DragToReorder; property FocusItem; property FontDesc; + property Hint; property HotTrack; property Items; property ParentShowHint; @@ -144,6 +145,8 @@ type property ShowHint; property TabOrder; property TextColor; + property OnDoubleClick; + property OnShowHint; end; @@ -196,10 +199,13 @@ type property DragToReorder; property FocusItem; property FontDesc; + property Hint; property HotTrack; property Items; + property ParentShowHint; property PopupFrame; property ShowColorNames; + property ShowHint; property TabOrder; property TextColor; end; @@ -216,13 +222,14 @@ type TfpgListBoxStrings = class(TStringList) protected ListBox: TfpgTextListBox; - procedure SetUpdateState(Updating: Boolean); override; public constructor Create(AListBox: TfpgTextListBox); destructor Destroy; override; function Add(const s: String): Integer; override; procedure Delete(Index: Integer); override; procedure Clear; override; + procedure Exchange(Index1, Index2: Integer); override; + procedure Assign(Source: TPersistent); override; end; @@ -239,12 +246,6 @@ end; { TfpgListBoxStrings } -procedure TfpgListBoxStrings.SetUpdateState(Updating: Boolean); -begin - inherited SetUpdateState(Updating); - // do nothing extra for now -end; - constructor TfpgListBoxStrings.Create(AListBox: TfpgTextListBox); begin inherited Create; @@ -260,6 +261,8 @@ end; function TfpgListBoxStrings.Add(const s: String): Integer; begin Result := inherited Add(s); + if UpdateCount > 0 then + Exit; if Assigned(ListBox) and (ListBox.HasHandle) then begin ListBox.UpdateScrollBar; @@ -270,6 +273,8 @@ end; procedure TfpgListBoxStrings.Delete(Index: Integer); begin inherited Delete(Index); + if UpdateCount > 0 then + Exit; if Assigned(ListBox) and (ListBox.HasHandle) then begin ListBox.UpdateScrollBar; @@ -280,11 +285,36 @@ end; procedure TfpgListBoxStrings.Clear; begin inherited Clear; + if UpdateCount > 0 then + Exit; ListBox.FocusItem := -1; ListBox.UpdateScrollBar; ListBox.Invalidate; end; +procedure TfpgListBoxStrings.Exchange(Index1, Index2: Integer); +begin + inherited Exchange(Index1, Index2); + if UpdateCount > 0 then + Exit; + if Assigned(ListBox) and (ListBox.HasHandle) then + begin + ListBox.Invalidate; + end; +end; + +procedure TfpgListBoxStrings.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if UpdateCount > 0 then + Exit; + if Assigned(ListBox) and (ListBox.HasHandle) then + begin + ListBox.UpdateScrollBar; + ListBox.Invalidate; + end; +end; + { TfpgBaseListBox } @@ -622,7 +652,7 @@ var r: TfpgRect; begin //if FUpdateCount > 0 then - //Exit; //==> + // Exit; //==> inherited HandlePaint; Canvas.ClearClipRect; @@ -990,6 +1020,10 @@ begin FItems.Add(TColorItem.Create('clUnset', clUnset)); FItems.Add(TColorItem.Create('clMenuText', clMenuText)); FItems.Add(TColorItem.Create('clMenuDisabled', clMenuDisabled)); + FItems.Add(TColorItem.Create('clGridSelection', clGridSelection)); + FItems.Add(TColorItem.Create('clGridSelectionText', clGridSelectionText)); + FItems.Add(TColorItem.Create('clGridInactiveSel', clGridInactiveSel)); + FItems.Add(TColorItem.Create('clGridInactiveSelText', clGridInactiveSelText)); end; cpWebColors: begin diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index f6688787..12ed4364 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -24,6 +24,7 @@ interface uses Classes, SysUtils, + contnrs, fpg_base, fpg_main, fpg_widget, @@ -80,7 +81,7 @@ type TfpgLVColumns = class(TPersistent) private FListView: TfpgListView; - FColumns: TList; + FColumns: TObjectList; function GetColumn(AIndex: Integer): TfpgLVColumn; procedure SetColumn(AIndex: Integer; const AValue: TfpgLVColumn); public @@ -121,7 +122,7 @@ type FColumns: TfpgLVColumns; FCurrentIndexOf: Integer; FViewers: TList; - FItems: TList; + FItems: TObjectList; function GetCapacity: Integer; function GetItem(AIndex: Integer): TfpgLVItem; procedure SetCapacity(const AValue: Integer); @@ -244,13 +245,16 @@ type procedure BeginUpdate; procedure EndUpdate; procedure MakeItemVisible(AIndex: Integer; PartialOK: Boolean = False); - function ItemAdd: TfpgLVItem; + function ItemAdd: TfpgLVItem; deprecated; + function AddItem: TfpgLVItem; + function NewItem: TfpgLVItem; published property Columns: TfpgLVColumns read FColumns; property HScrollBar: TfpgScrollBar read FHScrollBar; property ItemHeight: Integer read GetItemHeight; property ItemIndex: Integer read FItemIndex write SetItemIndex; property Items: TfpgLVItems read FItems write SetItems; + property Hint; property MultiSelect: Boolean read FMultiSelect write SetMultiSelect; property ParentShowHint; property SelectionFollowsFocus: Boolean read FSelectionFollowsFocus write FSelectionFollowsFocus; @@ -262,6 +266,7 @@ type property OnPaintColumn: TfpgLVPaintColumnEvent read FOnPaintColumn write FOnPaintColumn; property OnPaintItem: TfpgLVPaintItemEvent read FOnPaintItem write FOnPaintItem; property OnSelectionChanged: TfpgLVItemSelectEvent read FOnSelectionChanged write FOnSelectionChanged; + property OnShowHint; end; @@ -387,7 +392,7 @@ end; constructor TfpgLVItems.Create(AViewer: IfpgLVItemViewer); begin - FItems := TList.Create; + FItems := TObjectList.Create; FViewers := TList.Create; AddViewer(AViewer); end; @@ -433,11 +438,11 @@ begin // search significantly when we are using indexof in a for loop if (FCurrentIndexOf > 100) and (FCurrentIndexOf < Count-2) then begin - if FItems.Items[FCurrentIndexOf] = Pointer(AItem) then + if FItems.Items[FCurrentIndexOf] = AItem then Result := FCurrentIndexOf - else if FItems.Items[FCurrentIndexOf+1] = Pointer(AItem) then + else if FItems.Items[FCurrentIndexOf+1] = AItem then Result := FCurrentIndexOf+1 - else if FItems.Items[FCurrentIndexOf-1] = Pointer(AItem) then + else if FItems.Items[FCurrentIndexOf-1] = AItem then Result := FCurrentIndexOf-1 end; if Result = -1 then @@ -800,13 +805,7 @@ begin FOnColumnClick(Self, Column, Button); Column.FDown := True; - - if FUpdateCount = 0 then - begin - Canvas.BeginDraw(False); - PaintHeaders; - Canvas.EndDraw;//(2,2, width-4, Height-4); - end; + Repaint; end; procedure TfpgListView.HandleHeaderMouseMove(x, y: Integer; btnstate: word; @@ -1568,6 +1567,7 @@ begin FItems.DeleteViewer(Self); FSelected.Free; FOldSelected.Free; + FColumns.Free; inherited Destroy; end; @@ -1615,10 +1615,20 @@ end; function TfpgListView.ItemAdd: TfpgLVItem; begin + Result := AddItem; +end; + +function TfpgListView.AddItem: TfpgLVItem; +begin Result := TfpgLVItem.Create(FItems); FItems.Add(Result); end; +function TfpgListView.NewItem: TfpgLVItem; +begin + Result := TfpgLVItem.Create(FItems); +end; + { TfpgLVColumns } function TfpgLVColumns.GetColumn(AIndex: Integer): TfpgLVColumn; @@ -1634,7 +1644,7 @@ end; constructor TfpgLVColumns.Create(AListView: TfpgListView); begin FListView := AListView; - FColumns := TList.Create; + FColumns := TObjectList.Create; end; destructor TfpgLVColumns.Destroy; diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 7b59043f..37f21a42 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -110,6 +110,7 @@ type published property BackgroundColor default clBoxColor; property FontDesc: string read GetFontDesc write SetFontDesc; + property Hint; property Lines: TStringList read FLines; property ParentShowHint; property ShowHint; @@ -119,6 +120,7 @@ type property OnEnter; property OnExit; property OnKeyPress; + property OnShowHint; end; @@ -402,8 +404,9 @@ begin SetLineText(selsl, ls); end; - for n := selsl to selel do - FLines.Delete(n); + //delete moves lines up, so delete same line number over and over. + for n := (selsl+1) to selel do + FLines.Delete(selsl+1); FCursorPos := selsp; FCursorLine := selsl; @@ -864,6 +867,10 @@ begin Break; end; { for } + // Special case because it never entered the for loop above + if (LineCount = 0) and Focused then + fpgCaret.SetCaret(Canvas, FSideMargin, 3, fpgCaret.Width, FFont.Height); + if not Focused then fpgCaret.UnSetCaret(Canvas); diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas index 8031f4f1..06e64b6f 100644 --- a/src/gui/fpg_menu.pas +++ b/src/gui/fpg_menu.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -58,6 +58,7 @@ type private FCommand: ICommand; FEnabled: boolean; + FHint: TfpgString; FHotKeyDef: TfpgHotKeyDef; FOnClick: TNotifyEvent; FSeparator: boolean; @@ -76,11 +77,12 @@ type procedure Click; function Selectable: boolean; function GetAccelChar: string; - procedure DrawText(ACanvas: TfpgCanvas; x, y: TfpgCoord); + procedure DrawText(ACanvas: TfpgCanvas; x, y: TfpgCoord; const AImgWidth: integer); function GetCommand: ICommand; procedure SetCommand(ACommand: ICommand); property Checked: boolean read FChecked write SetChecked; property Text: TfpgString read FText write SetText; + property Hint: TfpgString read FHint write FHint; property HotKeyDef: TfpgHotKeyDef read FHotKeyDef write SetHotKeyDef; property Separator: boolean read FSeparator write SetSeparator; property Visible: boolean read FVisible write SetVisible; @@ -121,8 +123,8 @@ type procedure HandlePaint; override; procedure HandleShow; override; procedure HandleClose; override; - procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect); virtual; - procedure DrawRow(line: integer; focus: boolean); virtual; + procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean); virtual; + procedure DrawRow(line: integer; const AItemFocused: boolean); virtual; function ItemHeight(mi: TfpgMenuItem): integer; virtual; procedure PrepareToShow; public @@ -185,10 +187,14 @@ function CreateMenuBar(AOwner: TfpgWidget): TfpgMenuBar; overload; implementation - + var uFocusedPopupMenu: TfpgPopupMenu; +const + cImgWidth: integer = 16; + + function CreateMenuBar(AOwner: TfpgWidget; x, y, w, h: TfpgCoord): TfpgMenuBar; begin if AOwner = nil then @@ -257,13 +263,16 @@ begin FSeparator := False; FVisible := True; FEnabled := True; + FChecked := False; FSubMenu := nil; FOnClick := nil; end; procedure TfpgMenuItem.Click; begin - if Assigned(FOnClick) then + if Assigned(FCommand) then // ICommand takes preference over OnClick + FCommand.Execute + else if Assigned(FOnClick) then FOnClick(self); end; @@ -285,13 +294,12 @@ begin Result := ''; end; -procedure TfpgMenuItem.DrawText(ACanvas: TfpgCanvas; x, y: TfpgCoord); +procedure TfpgMenuItem.DrawText(ACanvas: TfpgCanvas; x, y: TfpgCoord; const AImgWidth: integer); var s: string; p: integer; achar: string; begin -// writeln('DrawText x:', x, ' y:', y); if not Enabled then ACanvas.SetFont(fpgStyle.MenuDisabledFont) else @@ -305,12 +313,13 @@ begin if p > 0 then begin // first part of text before the & sign - ACanvas.DrawString(x, y, UTF8Copy(s, 1, p-1)); + fpgStyle.DrawString(ACanvas, x, y, UTF8Copy(s, 1, p-1), Enabled); + inc(x, fpgStyle.MenuFont.TextWidth(UTF8Copy(s, 1, p-1))); if UTF8Copy(s, p+1, 1) = achar then begin // Do we need to paint a actual & sign (create via && in item text) - ACanvas.DrawString(x, y, achar); + fpgStyle.DrawString(ACanvas, x, y, achar, Enabled); inc(x, fpgStyle.MenuFont.TextWidth(achar)); end else @@ -318,7 +327,7 @@ begin // Draw the HotKey text if Enabled then ACanvas.SetFont(fpgStyle.MenuAccelFont); - ACanvas.DrawString(x, y, UTF8Copy(s, p+1, 1)); + fpgStyle.DrawString(ACanvas, x, y, UTF8Copy(s, p+1, 1), Enabled); inc(x, ACanvas.Font.TextWidth(UTF8Copy(s, p+1, 1))); if Enabled then ACanvas.SetFont(fpgStyle.MenuFont); @@ -329,7 +338,7 @@ begin // Draw the remaining text after the & sign if UTF8Length(s) > 0 then - ACanvas.DrawString(x, y, s); + fpgStyle.DrawString(ACanvas, x, y, s, Enabled); end; function TfpgMenuItem.GetCommand: ICommand; @@ -507,7 +516,7 @@ begin Canvas.SetColor(clShadow1); Canvas.DrawLine(r.Left, r.Bottom-1, r.Right+1, r.Bottom-1); // bottom // outer bottom line - Canvas.SetColor(clHilite1); + Canvas.SetColor(clWhite); Canvas.DrawLine(r.Left, r.Bottom, r.Right+1, r.Bottom); // bottom for n := 0 to VisibleCount-1 do @@ -590,7 +599,7 @@ begin Canvas.FillRectangle(r); // a possible future theme option // Canvas.GradientFill(r, FLightColor, FDarkColor, gdVertical); - mi.DrawText(Canvas, r.left+4, r.top+1); + mi.DrawText(Canvas, r.left+4, r.top+1, cImgWidth); Canvas.EndDraw(r.Left, r.Top, r.Width, r.Height); Exit; //==> end; { if col=n } @@ -739,7 +748,7 @@ begin begin CloseSubMenus; // showing the submenu - mi.SubMenu.ShowAt(self, Width, GetItemPosY(FFocusItem)); + mi.SubMenu.ShowAt(self, Width-5, GetItemPosY(FFocusItem)); // 5 is the menu overlap in pixels mi.SubMenu.OpenerPopup := self; mi.SubMenu.OpenerMenuBar := OpenerMenuBar; uFocusedPopupMenu := mi.SubMenu; @@ -829,7 +838,6 @@ procedure TfpgPopupMenu.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); var newf: integer; mi: TfpgMenuItem; - r: TfpgRect; begin inherited HandleLMouseUp(x, y, shiftstate); @@ -972,7 +980,7 @@ begin Canvas.BeginDraw; // inherited HandlePaint; Canvas.Clear(BackgroundColor); - Canvas.SetColor(clWidgetFrame); + Canvas.SetColor(clWindowBackground); Canvas.DrawRectangle(0, 0, Width, Height); // black rectangle border Canvas.DrawButtonFace(1, 1, Width-1, Height-1, []); // 3d rectangle inside black border @@ -1009,7 +1017,7 @@ begin Result := TfpgMenuItem(FItems.Items[ind]); end; -procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect); +procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean); var s: string; x: integer; @@ -1017,35 +1025,47 @@ var begin if mi.Separator then begin - Canvas.SetColor(clMenuText); - Canvas.DrawLine(rect.Left, rect.Top+2, rect.Right+1, rect.Top+2); + Canvas.SetColor(clShadow1); + Canvas.DrawLine(rect.Left+1, rect.Top+2, rect.Right, rect.Top+2); + Canvas.SetColor(clHilite2); + Canvas.DrawLine(rect.Left+1, rect.Top+3, rect.Right, rect.Top+3); end else begin - x := rect.Left + FSymbolWidth + FTextMargin; + // process Check mark if needed + if mi.Checked then + begin + img := fpgImages.GetImage('stdimg.check'); // Do NOT localize + if AItemFocused then + img.Invert; + Canvas.DrawImage(rect.Left, rect.Top, img); + if AItemFocused then + img.Invert; // restore image to original state + end; - mi.DrawText(Canvas, x, rect.top); + // process menu item Text + x := rect.Left + FSymbolWidth + FTextMargin; + mi.DrawText(Canvas, x+cImgWidth, rect.top, cImgWidth); + // process menu item Hot Key text if mi.HotKeyDef <> '' then begin s := mi.HotKeyDef; - Canvas.DrawString(rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s); + fpgStyle.DrawString(Canvas, rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled); end; + // process menu item submenu arrow image if mi.SubMenu <> nil then begin - canvas.SetColor(Canvas.TextColor); + Canvas.SetColor(Canvas.TextColor); x := (rect.height div 2) - 3; - img := fpgImages.GetImage('sys.sb.right'); + img := fpgImages.GetImage('sys.sb.right'); // Do NOT localize Canvas.DrawImage(rect.right-x-2, rect.Top + ((rect.Height-img.Height) div 2), img); -// canvas.FillTriangle(rect.right-x-2, rect.top+2, -// rect.right-2, rect.top+2+x, -// rect.right-x-2, rect.top+2+2*x); end; end; end; -procedure TfpgPopupMenu.DrawRow(line: integer; focus: boolean); +procedure TfpgPopupMenu.DrawRow(line: integer; const AItemFocused: boolean); var n: integer; r: TfpgRect; @@ -1062,7 +1082,7 @@ begin if line = n then begin - if focus and (not mi.Separator) then + if AItemFocused and (not mi.Separator) then begin if MenuFocused then begin @@ -1092,7 +1112,7 @@ begin end; end; Canvas.FillRectangle(r); - DrawItem(mi, r); + DrawItem(mi, r, AItemFocused); Canvas.EndDraw(r.Left, r.Top, r.Width, r.Height); Exit; //==> end; @@ -1202,8 +1222,8 @@ begin hkw := hkw + 10; // spacing between text and hotkey text FHeight := FMargin*2 + h; - FWidth := (FMargin+FTextMargin)*2 + FSymbolWidth + tw + hkw; - + FWidth := ((FMargin+FTextMargin)*2) + FSymbolWidth + tw + hkw + (cImgWidth*2); + uFocusedPopupMenu := self; end; diff --git a/src/gui/fpg_mru.pas b/src/gui/fpg_mru.pas index 64feb793..58106e12 100644 --- a/src/gui/fpg_mru.pas +++ b/src/gui/fpg_mru.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/fpg_panel.pas b/src/gui/fpg_panel.pas index 28e2c722..b58b516d 100644 --- a/src/gui/fpg_panel.pas +++ b/src/gui/fpg_panel.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -32,7 +32,7 @@ uses type TPanelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, - bsRightLine, bsSpacer); + bsRightLine, bsSpacer, bsVerDivider); TPanelStyle = (bsLowered, bsRaised); @@ -41,14 +41,17 @@ type TfpgAbstractPanel = class(TfpgWidget) private - FPanelShape: TPanelShape; FPanelStyle: TPanelStyle; FPanelBorder: TPanelBorder; + FParentBackgroundColor: Boolean; procedure SetPanelStyle(const AValue: TPanelStyle); procedure SetPanelBorder(const AValue: TPanelBorder); + procedure SetParentBackgroundColor(const AValue: Boolean); protected + procedure HandlePaint; override; property Style: TPanelStyle read FPanelStyle write SetPanelStyle default bsRaised; property BorderStyle: TPanelBorder read FPanelBorder write SetPanelBorder default bsSingle; + property ParentBackgroundColor: Boolean read FParentBackgroundColor write SetParentBackgroundColor default False; public constructor Create(AOwner: TComponent); override; function GetClientRect: TfpgRect; override; @@ -57,22 +60,42 @@ type TfpgBevel = class(TfpgAbstractPanel) private + FPanelShape: TPanelShape; procedure SetPanelShape(const AValue: TPanelShape); + procedure DrawBox; // bsBox + procedure DrawFrame; // bsFrame + procedure DrawTopLine; // bsTopLine + procedure DrawBottomLine; // bsBottomLine + procedure DrawLeftLine; // bsLeftLine + procedure DrawRightLine; // bsRightLine + procedure DrawSpacer; // bsSpacer + procedure DrawVerDivider; // bsVerDivider protected procedure HandlePaint; override; published property BackgroundColor; property BorderStyle; - property Shape: TPanelShape read FPanelShape write SetPanelShape default bsBox; - property Style; + property Height; + property Hint; + property Left; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; + property ParentBackgroundColor; property ParentShowHint; + property Shape: TPanelShape read FPanelShape write SetPanelShape default bsBox; property ShowHint; + property Style; + property Top; + property Width; property OnClick; property OnDoubleClick; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnPaint; + property OnShowHint; end; @@ -90,8 +113,6 @@ type procedure SetLayout(const AValue: TLayout); function GetText: string; procedure SetText(const AValue: string); - function GetFontDesc: string; - procedure SetFontDesc(const AValue: string); function GetLineSpace: integer; procedure SetLineSpace(const AValue: integer); function GetMargin: integer; @@ -100,6 +121,8 @@ type procedure SetWrapText(const AValue: boolean); protected FFont: TfpgFont; + function GetFontDesc: string; virtual; + procedure SetFontDesc(const AValue: string); virtual; procedure HandlePaint; override; public constructor Create(AOwner: TComponent); override; @@ -110,17 +133,28 @@ type property BackgroundColor; property BorderStyle; property FontDesc: string read GetFontDesc write SetFontDesc; + property Height; + property Hint; property Layout: TLayout read GetLayout write SetLayout default tlCenter; - property Style; - property Text: string read GetText write SetText; - property TextColor; + property Left; property LineSpace: integer read GetLineSpace write SetLineSpace default 2; property Margin: integer read GetMargin write SetMargin default 2; - property WrapText: boolean read GetWrapText write SetWrapText default False; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; + property ParentBackgroundColor; property ParentShowHint; property ShowHint; + property Style; + property Text: string read GetText write SetText; + property TextColor; + property Top; + property Width; + property WrapText: boolean read GetWrapText write SetWrapText default False; property OnClick; property OnDoubleClick; + property OnShowHint; end; @@ -139,24 +173,35 @@ type procedure SetMargin(const AValue: integer); protected FFont: TfpgFont; - function GetClientRect: TfpgRect; override; procedure HandlePaint; override; public constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetClientRect: TfpgRect; override; property Font: TfpgFont read FFont; published property Alignment: TAlignment read GetAlignment write SetAlignment default taLeftJustify; property BackgroundColor; property BorderStyle; property FontDesc: string read GetFontDesc write SetFontDesc; + property Height; + property Hint; + property Left; property Margin: integer read GetMargin write SetMargin default 2; + property MaxHeight; + property MaxWidth; + property MinHeight; + property MinWidth; property ParentShowHint; property ShowHint; property Style; property Text: string read GetText write SetText; property TextColor; + property Top; + property Width; property OnClick; property OnDoubleClick; + property OnShowHint; end; @@ -242,16 +287,31 @@ begin end; end; +procedure TfpgAbstractPanel.SetParentBackgroundColor(const AValue: Boolean); +begin + if FParentBackgroundColor = AValue then exit; + FParentBackgroundColor := AValue; + RePaint; +end; + +procedure TfpgAbstractPanel.HandlePaint; +begin + inherited HandlePaint; + if FParentBackgroundColor then + Canvas.Clear(Parent.BackgroundColor) + else + Canvas.Clear(BackgroundColor); +end; + constructor TfpgAbstractPanel.Create(AOwner: TComponent); begin inherited Create(AOwner); - FPanelShape := bsBox; FPanelStyle := bsRaised; FPanelBorder := bsSingle; FWidth := 80; FHeight := 80; FFocusable := True; // otherwise children can't get focus - FBackgroundColor := Parent.BackgroundColor; + FParentBackgroundColor := False; FIsContainer := True; end; @@ -266,69 +326,160 @@ begin end; end; -procedure TfpgBevel.HandlePaint; +procedure TfpgBevel.DrawBox; begin - inherited HandlePaint; - - Canvas.Clear(BackgroundColor); - - // Canvas.SetLineStyle(2, lsSolid); - // Canvas.SetColor(clWindowBackground); - // Canvas.DrawRectangle(1, 1, Width - 1, Height - 1); if FPanelBorder = bsSingle then Canvas.SetLineStyle(1, lsSolid) else Canvas.SetLineStyle(2, lsSolid); + if FPanelBorder = bsSingle then + Canvas.DrawLine(0, 0, Width - 1, 0) + else + Canvas.DrawLine(0, 1, Width - 1, 1); + + if FPanelBorder = bsSingle then + Canvas.DrawLine(0, 1, 0, Height - 1) + else + Canvas.DrawLine(1, 1, 1, Height - 1); + if Style = bsRaised then - Canvas.SetColor(clHilite2) + Canvas.SetColor(clShadow2) else - Canvas.SetColor(clShadow2); + Canvas.SetColor(clHilite2); - if Shape in [bsBox] then - if FPanelBorder = bsSingle then - Canvas.DrawLine(0, 0, Width - 1, 0) - else - Canvas.DrawLine(0, 1, Width - 1, 1); - if Shape in [bsFrame, bsTopLine] then - Canvas.DrawLine(0, 0, Width - 1, 0); - if Shape in [bsBox] then - if FPanelBorder = bsSingle then - Canvas.DrawLine(0, 1, 0, Height - 1) - else - Canvas.DrawLine(1, 1, 1, Height - 1); - if Shape in [bsFrame, bsLeftLine] then - Canvas.DrawLine(0, 1, 0, Height - 1); - if Shape in [bsFrame, bsRightLine] then - Canvas.DrawLine(Width - 2, 1, Width - 2, Height - 1); - if Shape in [bsFrame, bsBottomLine] then - Canvas.DrawLine(1, Height - 2, Width - 1, Height - 2); + Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); + Canvas.DrawLine(0, Height - 1, Width, Height - 1); +end; + +procedure TfpgBevel.DrawFrame; +begin + Canvas.SetLineStyle(1, lsSolid); + + Canvas.DrawLine(0, 0, Width - 1, 0); + Canvas.DrawLine(0, 1, 0, Height - 1); + Canvas.DrawLine(Width - 2, 1, Width - 2, Height - 1); + Canvas.DrawLine(1, Height - 2, Width - 1, Height - 2); + + if Style = bsRaised then + Canvas.SetColor(clShadow2) + else + Canvas.SetColor(clHilite2); + + Canvas.DrawLine(1, 1, Width - 2, 1); + Canvas.DrawLine(1, 2, 1, Height - 2); + Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); + Canvas.DrawLine(0, Height - 1, Width, Height - 1); +end; + +procedure TfpgBevel.DrawTopLine; +begin + Canvas.SetLineStyle(1, lsSolid); + Canvas.DrawLine(0, 0, Width, 0); if Style = bsRaised then Canvas.SetColor(clShadow2) else Canvas.SetColor(clHilite2); - if Shape in [bsFrame, bsTopLine] then - Canvas.DrawLine(1, 1, Width - 2, 1); - if Shape in [bsFrame, bsLeftLine] then - Canvas.DrawLine(1, 2, 1, Height - 2); - if Shape in [bsBox, bsFrame, bsRightLine] then - Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); - if Shape in [bsBox, bsFrame, bsBottomLine] then - Canvas.DrawLine(0, Height - 1, Width, Height - 1); - + Canvas.DrawLine(0, 1, Width, 1); +end; + +procedure TfpgBevel.DrawBottomLine; +begin + Canvas.SetLineStyle(1, lsSolid); + Canvas.DrawLine(0, Height - 2, Width, Height - 2); + + if Style = bsRaised then + Canvas.SetColor(clShadow2) + else + Canvas.SetColor(clHilite2); + + Canvas.DrawLine(0, Height - 1, Width, Height - 1); +end; + +procedure TfpgBevel.DrawLeftLine; +begin + Canvas.SetLineStyle(1, lsSolid); + Canvas.DrawLine(0, 1, 0, Height - 1); + + if Style = bsRaised then + Canvas.SetColor(clShadow2) + else + Canvas.SetColor(clHilite2); + + Canvas.DrawLine(1, 1, 1, Height - 1); +end; + +procedure TfpgBevel.DrawRightLine; +begin + Canvas.SetLineStyle(1, lsSolid); + Canvas.DrawLine(Width - 2, 0, Width - 2, Height - 1); + + if Style = bsRaised then + Canvas.SetColor(clShadow2) + else + Canvas.SetColor(clHilite2); + + Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); +end; + +procedure TfpgBevel.DrawSpacer; +begin // To make it more visible in the UI Designer if csDesigning in ComponentState then begin - if Shape in [bsSpacer] then - begin - Canvas.SetColor(clInactiveWgFrame); - Canvas.SetLineStyle(1, lsDash); - Canvas.DrawRectangle(0, 0, Width, Height); -// Canvas.SetTextColor(clText1); -// Canvas.DrawString(2, 2, Name + ': ' + Classname); - end; + Canvas.SetColor(clInactiveWgFrame); + Canvas.SetLineStyle(1, lsDash); + Canvas.DrawRectangle(0, 0, Width, Height); + end; +end; + +procedure TfpgBevel.DrawVerDivider; + + procedure PaintLine(px, py: integer); + begin + if Style = bsRaised then + Canvas.SetColor(clHilite2) + else + Canvas.SetColor(clShadow1); + + Canvas.DrawLine(px, py, px+2, py); + Canvas.DrawLine(px, py, px, Height); + + if Style = bsRaised then + Canvas.SetColor(clShadow1) + else + Canvas.SetColor(clHilite2); + + Canvas.DrawLine(px+1, Height - 1, px+3, Height - 1); + Canvas.DrawLine(px+2, py, px+2, Height); + end; + +begin + PaintLine(0, 0); + if FPanelBorder = bsDouble then + PaintLine(3, 0); +end; + +procedure TfpgBevel.HandlePaint; +begin + inherited HandlePaint; + + if Style = bsRaised then + Canvas.SetColor(clHilite2) + else + Canvas.SetColor(clShadow1); + + case Shape of + bsBox: DrawBox; + bsFrame: DrawFrame; + bsTopLine: DrawTopLine; + bsBottomLine: DrawBottomLine; + bsLeftLine: DrawLeftLine; + bsRightLine: DrawRightLine; + bsSpacer: DrawSpacer; + bsVerDivider: DrawVerDivider; end; end; @@ -435,8 +586,6 @@ var begin inherited HandlePaint; - Canvas.Clear(BackgroundColor); - // Canvas.SetLineStyle(2, lsSolid); // Canvas.SetColor(clWindowBackground); // Canvas.DrawRectangle(1, 1, Width - 1, Height - 1); @@ -502,12 +651,9 @@ begin inherited Create(AOwner); FText := 'Panel'; FFont := fpgGetFont('#Label1'); - FPanelShape := bsBox; FPanelStyle := bsRaised; FWidth := 80; FHeight := 80; - FFocusable := True; // otherwise children can't get focus - FBackgroundColor := Parent.BackgroundColor; FAlignment := taCenter; FLayout := tlCenter; FWrapText := False; @@ -743,7 +889,6 @@ begin inherited Create(AOwner); FText := 'Group box'; FFont := fpgGetFont('#Label1'); - FPanelShape := bsBox; FPanelStyle := bsRaised; FWidth := 80; FHeight := 80; @@ -753,5 +898,11 @@ begin FMargin := 2; end; +destructor TfpgGroupBox.Destroy; +begin + FFont.Free; + inherited Destroy; +end; + end. diff --git a/src/gui/fpg_popupcalendar.pas b/src/gui/fpg_popupcalendar.pas index a4c2fe94..af27568b 100644 --- a/src/gui/fpg_popupcalendar.pas +++ b/src/gui/fpg_popupcalendar.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -51,14 +51,52 @@ uses fpg_combobox, fpg_basegrid, fpg_grid, - fpg_dialogs{, - fpg_checkbox}; + fpg_dialogs, + fpg_menu, + fpg_hyperlink, + fpg_panel; type TfpgOnDateSetEvent = procedure(Sender: TObject; const ADate: TDateTime) of object; TfpgOnCheckboxChangedEvent = procedure(Sender: TObject; const AIsChecked: Boolean) of object; + TYearSelectForm = class(TfpgPopupWindow) + private + {@VFD_HEAD_BEGIN: YearSelectForm} + btnMinus10: TfpgButton; + btnPlus10: TfpgButton; + Bevel1: TfpgBevel; + Label1: TfpgHyperlink; + Label2: TfpgHyperlink; + Label3: TfpgHyperlink; + Label4: TfpgHyperlink; + Label5: TfpgHyperlink; + Label6: TfpgHyperlink; + Label7: TfpgHyperlink; + Label8: TfpgHyperlink; + Label9: TfpgHyperlink; + Label10: TfpgHyperlink; + {@VFD_HEAD_END: YearSelectForm} + FYear: Word; + FOriginalYear: Word; + FMinYear: Word; + FMaxYear: Word; + procedure YearClicked(Sender: TObject); + procedure SetYear(const AValue: Word); + procedure Minus10Clicked(Sender: TObject); + procedure Plus10Clicked(Sender: TObject); + protected + procedure HandlePaint; override; + public + constructor CreateCustom(AOwner: TComponent; const MinYear, MaxYear: Word); + procedure AfterConstruction; override; + procedure AfterCreate; + property Year: Word read FYear write SetYear; + property MinYear: Word read FMinYear; + property MaxYear: Word read FMaxYear; + end; + TfpgPopupCalendar = class(TfpgPopupWindow) private @@ -85,6 +123,10 @@ type FDayColor: TfpgColor; FHolidayColor: TfpgColor; FSelectedColor: TfpgColor; + FSingleClickSelect: boolean; + FMonthsPopupMenu: TfpgPopupMenu; + FYearPopupWindow: TYearSelectForm; + procedure YearPopupWindowClose(Sender: TObject); function GetDateElement(Index: integer): Word; procedure PopulateDays; procedure CalculateMonthOffset; @@ -105,10 +147,16 @@ type procedure btnMonthUpClicked(Sender: TObject); procedure btnMonthDownClicked(Sender: TObject); procedure btnTodayClicked(Sender: TObject); + procedure grdName1Clicked(Sender: TObject); procedure grdName1DoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure grdName1KeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); procedure grdName1DrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); + procedure edtMonthClicked(Sender: TObject); + procedure edtYearClicked(Sender: TObject); + procedure miMonthClicked(Sender: TObject); procedure TearDown; + procedure SetSingleClickSelect(const AValue: boolean); + procedure ClosePopupMenusWindows; protected FntNorm, FntBold: TfpgFont; FOrigFocusWin: TfpgWidget; @@ -116,12 +164,14 @@ type procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleShow; override; procedure HandleHide; override; + procedure ShowDefaultPopupMenu; virtual; property CallerWidget: TfpgWidget read FCallerWidget write FCallerWidget; public constructor Create(AOwner: TComponent; AOrigFocusWin: TfpgWidget); reintroduce; destructor Destroy; override; procedure AfterCreate; property CloseOnSelect: boolean read FCloseOnSelect write SetCloseOnSelect default True; + property SingleClickSelect: boolean read FSingleClickSelect write SetSingleClickSelect default False; property Day: Word index 1 read GetDateElement write SetDateElement; property Month: Word index 2 read GetDateElement write SetDateElement; property Year: Word index 3 read GetDateElement write SetDateElement; @@ -150,6 +200,7 @@ type FHolidayColor: TfpgColor; FSelectedColor: TfpgColor; FCloseOnSelect: boolean; + FSingleClickSelect: boolean; procedure SetDateFormat(const AValue: string); procedure SetDateValue(const AValue: TDateTime); procedure SetMaxDate(const AValue: TDateTime); @@ -159,10 +210,11 @@ type procedure SetDayColor(const AValue: TfpgColor); procedure SetHolidayColor(const AValue: TfpgColor); procedure SetSelectedColor(const AValue: TfpgColor); - procedure SetText(const AValue: string); override; - function GetText: string; override; procedure SetCloseOnSelect(const AValue: boolean); + procedure SetSingleClickSelect(const AValue: boolean); protected + function GetText: string; override; + procedure SetText(const AValue: string); override; procedure InternalOnValueSet(Sender: TObject; const ADate: TDateTime); virtual; function HasText: boolean; override; procedure DoDropDown; override; @@ -170,36 +222,37 @@ type constructor Create(AOwner: TComponent); override; published property BackgroundColor; + { Clicking on calendar Today button will close the popup calendar by default } + property CloseOnSelect: boolean read FCloseOnSelect write SetCloseOnSelect default True; property DateFormat: string read FDateFormat write SetDateFormat; property DateValue: TDateTime read FDate write SetDateValue; - property FontDesc; - property MinDate: TDateTime read FMinDate write SetMinDate; - property MaxDate: TDateTime read FMaxDate write SetMaxDate; - property WeekStartDay: integer read FWeekStartDay write SetWeekStartDay default 0; - property WeeklyHoliday: integer read FWeeklyHoliday write SetWeeklyHoliday default -1; property DayColor: TfpgColor read FDayColor write SetDayColor; + property FontDesc; + property Hint; property HolidayColor: TfpgColor read FHolidayColor write SetHolidayColor; - property SelectedColor: TfpgColor read FSelectedColor write SetSelectedColor; + property MaxDate: TDateTime read FMaxDate write SetMaxDate; + property MinDate: TDateTime read FMinDate write SetMinDate; property ParentShowHint; + property SelectedColor: TfpgColor read FSelectedColor write SetSelectedColor; + property SingleClickSelect: boolean read FSingleClickSelect write SetSingleClickSelect default False; property ShowHint; - { Clicking on calendar Today button will close the popup calendar by default } - property CloseOnSelect: boolean read FCloseOnSelect write SetCloseOnSelect default True; + property WeeklyHoliday: integer read FWeeklyHoliday write SetWeeklyHoliday default -1; + property WeekStartDay: integer read FWeekStartDay write SetWeekStartDay default 0; property TabOrder; property OnChange; property OnCloseUp; property OnDropDown; property OnEnter; property OnExit; + property OnShowHint; end; TfpgCalendarCheckCombo = class(TfpgCalendarCombo) private -// FCheckBox: TfpgCheckbox; FChecked: boolean; FCheckBoxRect: TfpgRect; FCheckboxChanged: TfpgOnCheckboxChangedEvent; - procedure InternalCheckBoxChanged(Sender: TObject); procedure SetChecked(const AValue: Boolean); procedure DoCheckboxChanged; protected @@ -221,15 +274,297 @@ type {@VFD_NEWFORM_DECL} + implementation uses + dateutils, fpg_scrollbar, fpg_constants; +type + // friend class to get access to Protected methods + TPopupMenuFriend = class(TfpgPopupMenu); + {@VFD_NEWFORM_IMPL} +procedure TYearSelectForm.YearClicked(Sender: TObject); +begin + FYear := StrToInt(TfpgHyperlink(Sender).Text); + Close; +end; + +procedure TYearSelectForm.SetYear(const AValue: Word); + + function IsInRange(const AYear: word): boolean; + begin + // always one year less on either side (min and max) so we don't go over + // any possible month limits. + Result := (AYear > MinYear) and (AYear < MaxYear); + end; + +begin + if FYear = AValue then exit; + FYear := AValue; + if FOriginalYear = 0 then + FOriginalYear := FYear; + Label1.Text := IntToStr(FYear-4); + Label1.Enabled := IsInRange(FYear-4); + Label2.Text := IntToStr(FYear-3); + Label2.Enabled := IsInRange(FYear-3); + Label3.Text := IntToStr(FYear-2); + Label3.Enabled := IsInRange(FYear-2); + Label4.Text := IntToStr(FYear-1); + Label4.Enabled := IsInRange(FYear-1); + Label5.Text := IntToStr(FYear); + if FYear = FOriginalYear then + Label5.FontDesc := '#Label2' + else + Label5.FontDesc := '#Label1'; + Label5.Enabled := IsInRange(FYear); + Label6.Text := IntToStr(FYear+1); + Label6.Enabled := IsInRange(FYear+1); + Label7.Text := IntToStr(FYear+2); + Label7.Enabled := IsInRange(FYear+2); + Label8.Text := IntToStr(FYear+3); + Label8.Enabled := IsInRange(FYear+3); + Label9.Text := IntToStr(FYear+4); + Label9.Enabled := IsInRange(FYear+4); + Label10.Text := IntToStr(FYear+5); + Label10.Enabled := IsInRange(FYear+5); +end; + +procedure TYearSelectForm.Minus10Clicked(Sender: TObject); +begin + SetYear(FYear-10); +end; + +procedure TYearSelectForm.Plus10Clicked(Sender: TObject); +begin + SetYear(FYear+10); +end; + +procedure TYearSelectForm.HandlePaint; +begin +// inherited HandlePaint; + Canvas.BeginDraw; + Canvas.Clear(BackgroundColor); + Canvas.SetColor(clWindowBackground); + Canvas.DrawRectangle(0, 0, Width, Height); // black rectangle border + Canvas.DrawButtonFace(1, 1, Width-1, Height-1, []); // 3d rectangle inside black border + Canvas.EndDraw; +end; + +constructor TYearSelectForm.CreateCustom(AOwner: TComponent; const MinYear, MaxYear: Word); +begin + Create(AOwner); + FYear := 0; + FOriginalYear := 0; + FMinYear := MinYear; + FMaxYear := MaxYear; +end; + +procedure TYearSelectForm.AfterConstruction; +begin + inherited AfterConstruction; + AfterCreate; +end; + +procedure TYearSelectForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: YearSelectForm} + Name := 'YearSelectForm'; + SetPosition(439, 401, 130, 122); +// WindowTitle := 'YearSelectForm'; +// Hint := ''; +// Sizeable := False; + + btnMinus10 := TfpgButton.Create(self); + with btnMinus10 do + begin + Name := 'btnMinus10'; + SetPosition(4, 4, 24, 24); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'sys.sb.left'; + ImageSpacing := 0; + TabOrder := 1; + OnClick := @Minus10Clicked; + end; + + btnPlus10 := TfpgButton.Create(self); + with btnPlus10 do + begin + Name := 'btnPlus10'; + SetPosition(104, 4, 24, 24); + Text := ''; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'sys.sb.right'; + ImageSpacing := 0; + TabOrder := 2; + OnClick := @Plus10Clicked; + end; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(64, 32, 2, 85); + Hint := ''; + Style := bsLowered; + end; + + Label1 := TfpgHyperlink.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 32, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label2 := TfpgHyperlink.Create(self); + with Label2 do + begin + Name := 'Label2'; + SetPosition(8, 48, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label3 := TfpgHyperlink.Create(self); + with Label3 do + begin + Name := 'Label3'; + SetPosition(8, 64, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label4 := TfpgHyperlink.Create(self); + with Label4 do + begin + Name := 'Label4'; + SetPosition(8, 80, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label5 := TfpgHyperlink.Create(self); + with Label5 do + begin + Name := 'Label5'; + SetPosition(8, 96, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label6 := TfpgHyperlink.Create(self); + with Label6 do + begin + Name := 'Label6'; + SetPosition(76, 32, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label7 := TfpgHyperlink.Create(self); + with Label7 do + begin + Name := 'Label7'; + SetPosition(76, 48, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label8 := TfpgHyperlink.Create(self); + with Label8 do + begin + Name := 'Label8'; + SetPosition(76, 64, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label9 := TfpgHyperlink.Create(self); + with Label9 do + begin + Name := 'Label9'; + SetPosition(76, 80, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + Label10 := TfpgHyperlink.Create(self); + with Label10 do + begin + Name := 'Label10'; + SetPosition(76, 96, 44, 16); + Alignment := taCenter; + FontDesc := '#Label1'; + Hint := ''; + Text := 'Label'; + TextColor := clText1; + HotTrackFont := '#Label1'; + OnClick := @YearClicked; + end; + + {@VFD_BODY_END: YearSelectForm} + {%endregion} +end; + + procedure TfpgPopupCalendar.PopulateDays; var r, c: integer; @@ -253,6 +588,7 @@ end; procedure TfpgPopupCalendar.grdName1DoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin + ClosePopupMenusWindows; TearDown; end; @@ -298,6 +634,33 @@ begin end; end; +procedure TfpgPopupCalendar.edtMonthClicked(Sender: TObject); +begin + ClosePopupMenusWindows; + ShowDefaultPopupMenu; +end; + +procedure TfpgPopupCalendar.edtYearClicked(Sender: TObject); +begin + ClosePopupMenusWindows; + if not Assigned(FYearPopupWindow) then + begin + FYearPopupWindow := TYearSelectForm.CreateCustom(nil, YearOf(MinDate), YearOf(MaxDate)); + FYearPopupWindow.OnClose := @YearPopupWindowClose; + FYearPopupWindow.Year := Year; + end; + + FYearPopupWindow.ShowAt(self, edtYear.Left, edtYear.Bottom); +end; + +procedure TfpgPopupCalendar.miMonthClicked(Sender: TObject); +var + itm: TfpgMenuItem; +begin + itm := Sender as TfpgMenuItem; + SetDateElement(2 {month index}, itm.Tag); +end; + procedure TfpgPopupCalendar.TearDown; var lD: Word; @@ -308,6 +671,10 @@ begin if s = '' then Exit; //==> lD := StrToInt(s); + if (grdName1.FocusRow = 0) and (lD > 7) then + Exit; // clicked in previous month + if (grdName1.FocusRow >= 4) and (lD < 15) then + Exit; // clicked in next month d := EncodeDate(Year, Month, lD); if (d >= FMinDate) and (d <= FMaxDate) then begin @@ -322,6 +689,32 @@ begin end; end; +procedure TfpgPopupCalendar.SetSingleClickSelect(const AValue: boolean); +begin + if FSingleClickSelect = AValue then exit; + FSingleClickSelect := AValue; +end; + +procedure TfpgPopupCalendar.ClosePopupMenusWindows; +begin + if Assigned(FMonthsPopupMenu) then + begin + FMonthsPopupMenu.Close; + FreeAndNil(FMonthsPopupMenu); + end; + + if Assigned(FYearPopupWindow) then + begin + FYearPopupWindow.Close; + FreeAndNil(FYearPopupWindow); + end; +end; + +procedure TfpgPopupCalendar.YearPopupWindowClose(Sender: TObject); +begin + Year := FYearPopupWindow.Year; +end; + function TfpgPopupCalendar.GetDateElement(Index: integer): Word; var lD, lM, lY: Word; @@ -372,14 +765,20 @@ procedure TfpgPopupCalendar.SetDateElement(Index: integer; const AValue: Word); var lD, lM, lY: Word; lDate: TDateTime; + d: Word; begin if AValue > 0 then begin DecodeDate(FDate, lY, lM, lD); case Index of - 1: lD := AValue; - 2: lM := AValue; - 3: lY := AValue; + 1: lD := AValue; + 2: begin + lM := AValue; + d := DaysInAMonth(lY, lM); + if lD > d then // If original day value is larger than days in new month + lD := d; + end; + 3: lY := AValue; end; try lDate := EncodeDate(lY, lM, lD); @@ -395,14 +794,14 @@ begin if FDate = AValue then Exit; //==> - if (trunc(FDate) >= trunc(FMinDate)) then + if (trunc(AValue) >= trunc(FMinDate)) then {$IFDEF DEBUG} writeln('Passed min test') {$ENDIF} else exit; - if (FDate <= FMaxDate) then + if (trunc(AValue) <= trunc(FMaxDate)) then {$IFDEF DEBUG} writeln('Passed max test') {$ENDIF} @@ -514,6 +913,7 @@ procedure TfpgPopupCalendar.btnYearUpClicked(Sender: TObject); var d: TDateTime; begin + ClosePopupMenusWindows; d := IncMonth(FDate, 12); if d <= FMaxDate then DateValue := d; @@ -523,6 +923,7 @@ procedure TfpgPopupCalendar.btnYearDownClicked(Sender: TObject); var d: TDateTime; begin + ClosePopupMenusWindows; d := IncMonth(FDate, -12); if d >= FMinDate then DateValue := d; @@ -532,6 +933,7 @@ procedure TfpgPopupCalendar.btnMonthUpClicked(Sender: TObject); var d: TDateTime; begin + ClosePopupMenusWindows; d := IncMonth(FDate); if d <= FMaxDate then DateValue := d; @@ -541,6 +943,7 @@ procedure TfpgPopupCalendar.btnMonthDownClicked(Sender: TObject); var d: TDateTime; begin + ClosePopupMenusWindows; d := IncMonth(FDate, -1); if d >= FMinDate then DateValue := d; @@ -548,6 +951,7 @@ end; procedure TfpgPopupCalendar.btnTodayClicked(Sender: TObject); begin + ClosePopupMenusWindows; if Now >= FMinDate then begin DateValue := Now; @@ -555,6 +959,13 @@ begin end; end; +procedure TfpgPopupCalendar.grdName1Clicked(Sender: TObject); +begin + ClosePopupMenusWindows; + if FSingleClickSelect then + TearDown; +end; + procedure TfpgPopupCalendar.HandlePaint; begin Canvas.BeginDraw; @@ -657,6 +1068,51 @@ begin FocusRootWidget.SetFocus; end; +procedure TfpgPopupCalendar.ShowDefaultPopupMenu; +var + itm: TfpgMenuItem; + pt: TPoint; +begin + if not Assigned(FMonthsPopupMenu) then + begin + FMonthsPopupMenu := TfpgPopupMenu.Create(nil); + itm := FMonthsPopupMenu.AddMenuItem(rslongjan, '', @miMonthClicked); + itm.Tag := 1; + itm := FMonthsPopupMenu.AddMenuItem(rslongfeb, '', @miMonthClicked); + itm.Tag := 2; + itm := FMonthsPopupMenu.AddMenuItem(rslongmar, '', @miMonthClicked); + itm.Tag := 3; + itm := FMonthsPopupMenu.AddMenuItem(rslongapr, '', @miMonthClicked); + itm.Tag := 4; + itm := FMonthsPopupMenu.AddMenuItem(rsLongMay, '', @miMonthClicked); + itm.Tag := 5; + itm := FMonthsPopupMenu.AddMenuItem(rslongjun, '', @miMonthClicked); + itm.Tag := 6; + itm := FMonthsPopupMenu.AddMenuItem(rslongjul, '', @miMonthClicked); + itm.Tag := 7; + itm := FMonthsPopupMenu.AddMenuItem(rslongaug, '', @miMonthClicked); + itm.Tag := 8; + itm := FMonthsPopupMenu.AddMenuItem(rslongsep, '', @miMonthClicked); + itm.Tag := 9; + itm := FMonthsPopupMenu.AddMenuItem(rslongoct, '', @miMonthClicked); + itm.Tag := 10; + itm := FMonthsPopupMenu.AddMenuItem(rslongnov, '', @miMonthClicked); + itm.Tag := 11; + itm := FMonthsPopupMenu.AddMenuItem(rslongdec, '', @miMonthClicked); + itm.Tag := 12; + end; + + // translate Edit coordinates + pt := WindowToScreen(self, Point(edtMonth.Left, edtMonth.Bottom)); + TPopupMenuFriend(FMonthsPopupMenu).PrepareToShow; // forces height calculation + // If dropdown will not fit below Edit, then we place it above + if (pt.y + FMonthsPopupMenu.Height) > fpgApplication.ScreenHeight then + pt.y := pt.y - edtMonth.Height - FMonthsPopupMenu.Height; + +// SetDefaultPopupMenuItemsState; + FMonthsPopupMenu.ShowAt(nil, pt.x, pt.y); +end; + constructor TfpgPopupCalendar.Create(AOwner: TComponent; AOrigFocusWin: TfpgWidget); begin inherited Create(AOwner); @@ -673,11 +1129,16 @@ begin FSelectedColor := clWhite; FMonthOffset := 0; FCloseOnSelect := True; + FSingleClickSelect := False; UpdateCalendar; end; destructor TfpgPopupCalendar.Destroy; begin + if Assigned(FMonthsPopupMenu) then + FMonthsPopupMenu.Free; + if Assigned(FYearPopupWindow) then + FYearPopupWindow.Free; FntBold.Free; FntNorm.Free; inherited Destroy; @@ -685,22 +1146,26 @@ end; procedure TfpgPopupCalendar.AfterCreate; begin + {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: fpgPopupCalendar} Name := 'fpgPopupCalendar'; - SetPosition(285, 249, 233, 142); -// WindowTitle := 'fpgPopupCalendar'; -// Sizeable := False; -// WindowPosition := wpUser; + SetPosition(370, 182, 233, 142); + Hint := ''; edtYear := TfpgEdit.Create(self); with edtYear do begin Name := 'edtYear'; SetPosition(0, 0, 37, 22); + AutoSize := False; + BorderStyle := ebsSingle; + Hint := ''; + TabOrder := 1; Text := ''; FontDesc := '#Edit1'; + IgnoreMouseCursor := True; Focusable := False; - BorderStyle := ebsSingle; + OnClick := @edtYearClicked; end; btnYearUp := TfpgButton.Create(self); @@ -711,8 +1176,10 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; + Hint := ''; ImageMargin := 0; ImageName := 'sys.sb.up'; + TabOrder := 2; Focusable := False; OnClick := @btnYearUpClicked; end; @@ -725,8 +1192,10 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; + Hint := ''; ImageMargin := 0; ImageName := 'sys.sb.down'; + TabOrder := 3; Focusable := False; OnClick := @btnYearDownClicked; end; @@ -736,10 +1205,15 @@ begin begin Name := 'edtMonth'; SetPosition(50, 0, 100, 22); + AutoSize := False; + BorderStyle := ebsSingle; + Hint := ''; + TabOrder := 4; Text := ''; FontDesc := '#Edit1'; + IgnoreMouseCursor := True; Focusable := False; - BorderStyle := ebsSingle; + OnClick := @edtMonthClicked; end; btnMonthUp := TfpgButton.Create(self); @@ -750,8 +1224,10 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; + Hint := ''; ImageMargin := 0; ImageName := 'sys.sb.up'; + TabOrder := 5; Focusable := False; OnClick := @btnMonthUpClicked; end; @@ -764,12 +1240,14 @@ begin Text := ''; Embedded := True; FontDesc := '#Label1'; + Hint := ''; ImageMargin := 0; ImageName := 'sys.sb.down'; + TabOrder := 6; Focusable := False; OnClick := @btnMonthDownClicked; end; - + btnToday := TfpgButton.Create(self); with btnToday do begin @@ -777,6 +1255,9 @@ begin SetPosition(164, 0, 70, 22); Text := 'Today'; FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 7; Focusable := True; OnClick := @btnTodayClicked; end; @@ -795,25 +1276,20 @@ begin AddColumn('Sat', 33, taCenter); FontDesc := '#Grid'; HeaderFontDesc := '#GridHeader'; + Hint := ''; RowCount := 6; + RowSelect := False; + TabOrder := 8; ScrollBarStyle := ssNone; + OnClick := @grdName1Clicked; OnDoubleClick := @grdName1DoubleClick; OnKeyPress := @grdName1KeyPress; OnDrawCell := @grdName1DrawCell; end; {@VFD_BODY_END: fpgPopupCalendar} -{ - // Setup localization - // UI Designer doesn't support resource strings yet! - grdName1.ColumnTitle[0] := rsShortSun; - grdName1.ColumnTitle[1] := rsShortMon; - grdName1.ColumnTitle[2] := rsShortTue; - grdName1.ColumnTitle[3] := rsShortWed; - grdName1.ColumnTitle[4] := rsShortThu; - grdName1.ColumnTitle[5] := rsShortFri; - grdName1.ColumnTitle[6] := rsShortSat; -} + {%endregion} + btnToday.Text := rsToday; end; @@ -916,6 +1392,12 @@ begin FCloseOnSelect := AValue; end; +procedure TfpgCalendarCombo.SetSingleClickSelect(const AValue: boolean); +begin + if FSingleClickSelect = AValue then exit; + FSingleClickSelect := AValue; +end; + function TfpgCalendarCombo.HasText: boolean; begin Result := FDate >= FMinDate; @@ -929,6 +1411,7 @@ begin FWeeklyHoliday := -1; FDate := Now; FCloseOnSelect := True; + FSingleClickSelect := False; DateFormat := ShortDateFormat; end; @@ -975,6 +1458,7 @@ begin ddw.DontCloseWidget := self; { Set to false CloseOnSelect to leave opened popup calendar menu } ddw.CloseOnSelect := CloseOnSelect; + ddw.SingleClickSelect := SingleClickSelect; ddw.CallerWidget := self; if Assigned(OnDropDown) then @@ -1006,17 +1490,12 @@ end; { TfpgCalendarCheckCombo } -procedure TfpgCalendarCheckCombo.InternalCheckBoxChanged(Sender: TObject); -begin - RePaint; -end; - procedure TfpgCalendarCheckCombo.SetChecked(const AValue: Boolean); begin if AValue = FChecked then Exit; //==> FChecked := Avalue; - InternalCheckBoxChanged(nil); + Repaint; end; procedure TfpgCalendarCheckCombo.DoCheckboxChanged; @@ -1028,13 +1507,10 @@ end; procedure TfpgCalendarCheckCombo.DoDrawText(const ARect: TfpgRect); var lRect: TfpgRect; - flags: TFTextFlags; - lColor: TfpgColor; begin lRect := ARect; lRect.Left := lRect.Left+FCheckBoxRect.Width + 1; lRect.Width := lRect.Width - (FCheckBoxRect.Width + 1) - FMargin; - flags := [txtRight, txtVCenter]; if HasText then begin if not FChecked then @@ -1060,7 +1536,6 @@ procedure TfpgCalendarCheckCombo.InternalOnValueSet(Sender: TObject; begin inherited InternalOnValueSet(Sender, ADate); Checked := True; -// InternalCheckBoxChanged(nil); end; procedure TfpgCalendarCheckCombo.HandleKeyPress(var keycode: word; @@ -1115,6 +1590,7 @@ begin begin Checked := not FChecked; DoCheckboxChanged; + Repaint; end else inherited HandleLMouseUp(x, y, shiftstate); @@ -1127,22 +1603,6 @@ begin FCheckBoxRect.SetRect(2, 0, 17, 17); FCheckboxRect.Top := (FHeight - FCheckBoxRect.Height) div 2; OffsetRect(FCheckboxRect, 2, 3); // frame border must be taken into consideration - -{ - FCheckBox := TfpgCheckBox.Create(self); - with FCheckbox do - begin - Name := '_IntCheckBox'; - SetPosition(2, 2, 18, 17); - Checked := True; - FontDesc := '#Label1'; - Text := ''; -// BackgroundColor := self.BackgroundColor; - BackgroundColor := clMagenta; - Focusable := False; - OnChange := @InternalCheckBoxChanged; - end; -} end; diff --git a/src/gui/fpg_progressbar.pas b/src/gui/fpg_progressbar.pas index 72355493..ee6b2405 100644 --- a/src/gui/fpg_progressbar.pas +++ b/src/gui/fpg_progressbar.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -61,6 +61,7 @@ type TfpgProgressBar = class(TfpgCustomProgressBar) published property BackgroundColor default $c4c4c4; + property Hint; property ShowCaption; property Max; property Min; @@ -69,6 +70,7 @@ type property ShowHint; property Step; property TextColor; + property OnShowHint; end; diff --git a/src/gui/fpg_radiobutton.pas b/src/gui/fpg_radiobutton.pas index 97303bb5..9410a000 100644 --- a/src/gui/fpg_radiobutton.pas +++ b/src/gui/fpg_radiobutton.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -65,6 +65,7 @@ type property BackgroundColor; property Checked: boolean read FChecked write SetChecked default False; property FontDesc: string read GetFontDesc write SetFontDesc; + property Hint; property BoxLayout: TBoxLayout read GetBoxLayout write SetBoxLayout default tbLeftBox; property GroupIndex: integer read FGroupIndex write FGroupIndex; property ParentShowHint; @@ -73,6 +74,7 @@ type property Text: string read FText write SetText; property TextColor; property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnShowHint; end; diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 5d69ced6..55db9f59 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -49,6 +49,7 @@ type private FLargeChange: Integer; FScrollbarDownPart: TfpgScrollBarPart; + FRecalc: Boolean; procedure SetMax(const AValue: integer); procedure SetMin(const AValue: integer); procedure SetSBPosition(const AValue: integer); @@ -78,6 +79,7 @@ type procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override; procedure HandlePaint; override; + procedure HandleResize(AWidth, AHeight: TfpgCoord); override; procedure PositionChange(d: integer); public Orientation: TOrientation; @@ -85,6 +87,10 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure RepaintSlider; + procedure LineUp; + procedure LineDown; + procedure PageUp; + procedure PageDown; property PageSize: integer read FPageSize write FPageSize default 5; property Position: integer read FPosition write SetSBPosition default 10; property ScrollStep: integer read FScrollStep write FScrollStep default 1; @@ -97,6 +103,9 @@ type implementation +const + cMinSliderLength = 20; + { TfpgScrollBar } constructor TfpgScrollBar.Create(AOwner: TComponent); @@ -112,10 +121,11 @@ begin SliderSize := 0.5; FOnScroll := nil; FSliderPos := 0; - FSliderLength := 10; + FSliderLength := cMinSliderLength; FScrollStep := 1; FPageSize := 5; FLargeChange := 0; + FRecalc := True; end; destructor TfpgScrollBar.Destroy; @@ -138,15 +148,43 @@ begin DrawButton(Width-Height, 0, Height, Height, 'sys.sb.right', FScrollbarDownPart = sbpDownForward); end; - DrawSlider(True); + DrawSlider(FRecalc); Canvas.EndDraw; // Do not remove - Scrollbars do painting outside HandlePaint as well! + FRecalc := False; +end; + +procedure TfpgScrollBar.HandleResize(AWidth, AHeight: TfpgCoord); +begin + inherited HandleResize(AWidth, AHeight); + FRecalc := True; end; procedure TfpgScrollBar.RepaintSlider; begin if not HasHandle then Exit; //==> - DrawSlider(True); + FRecalc := True; + Invalidate;// DrawSlider(True); +end; + +procedure TfpgScrollBar.LineUp; +begin + Step(-1); +end; + +procedure TfpgScrollBar.LineDown; +begin + Step(1); +end; + +procedure TfpgScrollBar.PageUp; +begin + StepPage(-1); +end; + +procedure TfpgScrollBar.PageDown; +begin + StepPage(1); end; procedure TfpgScrollBar.SetMax(const AValue: integer); @@ -183,7 +221,7 @@ begin FPosition := AValue; if HasHandle then - DrawSlider(False); + Invalidate;// DrawSlider(False); end; procedure TfpgScrollBar.Step(ASteps: Integer); @@ -284,6 +322,7 @@ begin end; end; +// only called from inside HandlePaint so no need for BeginDraw..EndDraw calls procedure TfpgScrollBar.DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False); var img: TfpgImage; @@ -308,12 +347,13 @@ begin Canvas.DrawImage(x + w div 2 - (img.Width div 2) + dx, y + h div 2 - (img.Height div 2) + dy, img); end; +// only called from inside HandlePaint so no need for BeginDraw..EndDraw calls procedure TfpgScrollBar.DrawSlider(recalc: boolean); var area: TfpgCoord; mm: TfpgCoord; begin - Canvas.BeginDraw; +// Canvas.BeginDraw; if SliderSize > 1 then SliderSize := 1; @@ -340,8 +380,8 @@ begin FSliderLength := Trunc(area * SliderSize); //FSliderLength := Trunc((width/area) * (fmax /area )); - if FSliderLength < 20 then - FSliderLength := 20; + if FSliderLength < cMinSliderLength then + FSliderLength := cMinSliderLength; if FSliderLength > area then FSliderLength := area; area := area - FSliderLength; @@ -388,12 +428,12 @@ begin if Orientation = orVertical then begin Canvas.DrawButtonFace(0, Width + FSliderPos, Width, FSliderLength, [btfIsEmbedded]); - Canvas.EndDraw(0, Width, Width, Height - Width - Width); +// Canvas.EndDraw(0, Width, Width, Height - Width - Width); end else begin Canvas.DrawButtonFace(Height + FSliderPos, 0, FSliderLength, Height, [btfIsEmbedded]); - Canvas.EndDraw(Height, 0, Width - Height - Height, Height); +// Canvas.EndDraw(Height, 0, Width - Height - Height, Height); end; end; @@ -476,14 +516,14 @@ begin if FScrollbarDownPart = sbpSlider then begin FSliderDragStart := FSliderPos; - DrawSlider(False); + Invalidate; //DrawSlider(False); end else if not (FScrollbarDownPart in [sbpNone, sbpSlider]) then begin FScrollTimer.Interval := 300; FScrollTimer.Enabled := True; - HandlePaint; + Invalidate; //HandlePaint; end; end; @@ -500,7 +540,7 @@ begin FScrollbarDownPart := sbpNone; if WasPressed then - HandlePaint; + Invalidate; //HandlePaint; end; procedure TfpgScrollBar.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); @@ -538,7 +578,7 @@ begin FSliderPos := area; if ppos <> FSliderPos then - DrawSlider(False); + Invalidate; // DrawSlider(False); if area <> 0 then newp := FMin + Trunc((FMax - FMin) * (FSliderPos / area)) @@ -569,7 +609,10 @@ begin FPosition := FMax; if Visible then - DrawSlider(True); + begin + FRecalc := True; + Invalidate; // DrawSlider(True); + end; if Assigned(FOnScroll) then FOnScroll(self, FPosition); diff --git a/src/gui/fpg_spinedit.pas b/src/gui/fpg_spinedit.pas index 49f09b96..21548f97 100644 --- a/src/gui/fpg_spinedit.pas +++ b/src/gui/fpg_spinedit.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -53,8 +53,8 @@ type private FButtonUp: TfpgButton; FButtonDown: TfpgButton; - FArrowUpColor: Tfpgcolor; - FArrowDownColor: Tfpgcolor; + FArrowUpColor: TfpgColor; + FArrowDownColor: TfpgColor; FOnChange: TNotifyEvent; FTimer: TfpgTimer; FUp: Boolean; @@ -75,6 +75,7 @@ type procedure SetArrowUpColor(const AValue: Tfpgcolor); procedure SetArrowDownColor(const AValue: Tfpgcolor); procedure SetSpeedUp(const AValue: integer); + procedure DisableTimer; procedure ButtonUpPaint(Sender: TObject); procedure ButtonDownPaint(Sender: TObject); property ButtonsBackgroundColor: Tfpgcolor read GetButtonsBackgroundColor write SetButtonsBackgroundColor default clButtonFace; @@ -119,7 +120,7 @@ type procedure SetValue(const AValue: extended); procedure SetDecimals(const AValue: integer); procedure SetFixedDecimals(const AValue: Boolean); - procedure SetHint(const AValue: string); + procedure SetHint(const AValue: TfpgString); override; procedure ButtonUpClick(Sender: TObject); procedure ButtonDownClick(Sender: TObject); procedure ButtonUpMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -137,6 +138,7 @@ type published property EditBackgroundColor: Tfpgcolor read GetEditBackgroundColor write SetEditBackgroundColor default clBoxColor; property ButtonsBackgroundColor; + property ButtonWidth; property TextColor: Tfpgcolor read GetTextColor write SetTextColor; property NegativeColor: TfpgColor read GetNegativeColor write SetNegativeColor; property ArrowUpColor; @@ -149,7 +151,8 @@ type property Value: extended read FValue write SetValue; property Decimals: integer read GetDecimals write SetDecimals; property FixedDecimals: Boolean read GetFixedDecimals write SetFixedDecimals; - property Hint: string read FHint write SetHint; + property Hint; + property TabOrder; property OnChange; property OnEnter; property OnExit; @@ -157,6 +160,7 @@ type property OnMouseEnter; property OnMouseExit; property OnPaint; + property OnShowHint; end; @@ -187,7 +191,7 @@ type procedure SetIncrement(const AValue: integer); procedure SetLargeIncrement(const AValue: integer); procedure SetValue(const AValue: integer); - procedure SetHint(const AValue: string); + procedure SetHint(const AValue: TfpgString); override; procedure ButtonUpClick(Sender: TObject); procedure ButtonDownClick(Sender: TObject); procedure ButtonUpMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -216,7 +220,8 @@ type property Increment: integer read FIncrement write SetIncrement default 1; property LargeIncrement: integer read FLargeIncrement write SetLargeIncrement default 10; property Value: integer read FValue write SetValue default 0; - property Hint: string read FHint write SetHint; + property Hint; + property TabOrder; property OnChange; property OnEnter; property OnExit; @@ -224,6 +229,7 @@ type property OnMouseEnter; property OnMouseExit; property OnPaint; + property OnShowHint; end; @@ -365,6 +371,14 @@ begin FSpeedUpSteps := AValue; end; +procedure TfpgAbstractSpinEdit.DisableTimer; +begin + FUp:= False; + FDown:= False; + if Assigned(FTimer) then + FTimer.Enabled:= False; +end; + function GetButtonRect(AButton: TfpgButton): TRect; var r: TfpgRect; @@ -450,32 +464,23 @@ end; procedure TfpgSpinEditFloat.EnableButtons; begin - if FValue + FIncrement < FMaxValue then - FButtonUp.Enabled := True + FButtonUp.Enabled := True; + FButtonDown.Enabled := True; + if IsMaxLimitReached then + FButtonUp.Enabled := False else - begin - FUp := False; - if Assigned(FTimer) then - FTimer.Enabled := False; - end; - if FValue - FIncrement > FMinValue then - FButtonDown.Enabled := True - else - begin - FDown := False; - if Assigned(FTimer) then - FTimer.Enabled := False; - end; + if IsMinLimitReached then + FButtonDown.Enabled := False; end; function TfpgSpinEditFloat.IsMinLimitReached: Boolean; begin - Result := Value = MinValue; + Result := FValue = FMinValue; end; function TfpgSpinEditFloat.IsMaxLimitReached: Boolean; begin - Result := Value = MaxValue; + Result := FValue = FMaxValue; end; function TfpgSpinEditFloat.GetEditBackgroundColor: TfpgColor; @@ -557,7 +562,6 @@ begin FValue := FMaxValue; FEdit.Value := FValue; end; - EnableButtons; end; end; @@ -571,7 +575,6 @@ begin FValue := FMinValue; FEdit.Value := FValue; end; - EnableButtons; end; end; @@ -619,32 +622,45 @@ begin end; end; -procedure TfpgSpinEditFloat.SetHint(const AValue: string); +procedure TfpgSpinEditFloat.SetHint(const AValue: TfpgString); begin - if Hint <> AValue then - begin - FEdit.Hint := AValue; - FButtonUp.Hint := AValue; - FButtonDown.Hint := AValue; - end; + inherited SetHint(AValue); + // let child component use the same hint + FEdit.Hint := AValue; + FButtonUp.Hint := AValue; + FButtonDown.Hint := AValue; end; procedure TfpgSpinEditFloat.ButtonUpClick(Sender: TObject); begin if FValue + FIncrement <= FMaxValue then begin - Value := FValue + FIncrement; - DoOnChange; + FValue := FValue + FIncrement; + FEdit.Value := FValue; + end + else if not IsMaxLimitReached then + begin + FValue := FMaxValue; + FEdit.Value := FValue; end; + DoOnChange; + EnableButtons; end; procedure TfpgSpinEditFloat.ButtonDownClick(Sender: TObject); begin if FValue - FIncrement >= FMinValue then begin - Value := FValue - FIncrement; - DoOnChange; + FValue := FValue - FIncrement; + FEdit.Value := FValue; + end + else if not IsMinLimitReached then + begin + FValue := FMinValue; + FEdit.Value := FValue; end; + DoOnChange; + EnableButtons; end; procedure TfpgSpinEditFloat.ButtonUpMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -657,9 +673,7 @@ end; procedure TfpgSpinEditFloat.ButtonUpMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin - FUp := False; - if Assigned(FTimer) then - FTimer.Enabled := False; + DisableTimer; end; procedure TfpgSpinEditFloat.ButtonDownMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -672,9 +686,7 @@ end; procedure TfpgSpinEditFloat.ButtonDownMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin - FDown := False; - if Assigned(FTimer) then - FTimer.Enabled := False; + DisableTimer; end; procedure TfpgSpinEditFloat.EditKeyPress(Sender: TObject; var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); @@ -813,6 +825,15 @@ begin if FSteps > FSpeedUpSteps then FTempIncrement := LargeIncrement; DoOnChange; + if FValue= FMaxValue then + DisableTimer; + end + else if not IsMaxLimitReached then + begin + FValue := FMaxValue; + FEdit.Value := FValue; + DoOnChange; + DisableTimer; end; end else if FDown then @@ -826,9 +847,17 @@ begin if FSteps > FSpeedUpSteps then FTempIncrement := LargeIncrement; DoOnChange; + if FValue= FMinValue then + DisableTimer; + end + else if not IsMinLimitReached then + begin + FValue := FMinValue; + FEdit.Value := FValue; + DoOnChange; + DisableTimer; end; end; - EnableButtons; end; constructor TfpgSpinEditFloat.Create(AOwner: TComponent); @@ -876,34 +905,23 @@ end; procedure TfpgSpinEdit.EnableButtons; begin - if not IsMaxLimitReached then - FButtonUp.Enabled := True - else - begin - FButtonUp.Enabled := False; - FUp := False; - if Assigned(FTimer) then - FTimer.Enabled := False; - end; - if not IsMinLimitReached then - FButtonDown.Enabled := True + FButtonUp.Enabled := True; + FButtonDown.Enabled := True; + if IsMaxLimitReached then + FButtonUp.Enabled := False else - begin - FButtonDown.Enabled := False; - FDown := False; - if Assigned(FTimer) then - FTimer.Enabled := False; - end; + if IsMinLimitReached then + FButtonDown.Enabled := False; end; function TfpgSpinEdit.IsMinLimitReached: Boolean; begin - Result := Value = MinValue; + Result := FValue = FMinValue; end; function TfpgSpinEdit.IsMaxLimitReached: Boolean; begin - Result:= Value = MaxValue; + Result:= FValue = FMaxValue; end; function TfpgSpinEdit.GetEditBackgroundColor: TfpgColor; @@ -975,7 +993,6 @@ begin FValue := FMaxValue; FEdit.Value := FValue; end; - EnableButtons; end; end; @@ -989,7 +1006,6 @@ begin FValue := FMinValue; FEdit.Value := FValue; end; - EnableButtons; end; end; @@ -1020,28 +1036,45 @@ begin end; end; -procedure TfpgSpinEdit.SetHint(const AValue: string); +procedure TfpgSpinEdit.SetHint(const AValue: TfpgString); begin - if FHint <> AValue then - begin - FEdit.Hint := AValue; - FButtonUp.Hint := AValue; - FButtonDown.Hint := AValue; - end; + inherited SetHint(AValue); + // let child component use the same hint + FEdit.Hint := AValue; + FButtonUp.Hint := AValue; + FButtonDown.Hint := AValue; end; procedure TfpgSpinEdit.ButtonUpClick(Sender: TObject); begin if FValue + FIncrement <= FMaxValue then + begin Value := FValue + FIncrement; + FEdit.Value:= FValue; + end + else if not IsMaxLimitReached then + begin + Value := FMaxValue; + FEdit.Value:= FValue; + end; DoOnChange; + EnableButtons; end; procedure TfpgSpinEdit.ButtonDownClick(Sender: TObject); begin if FValue - FIncrement >= FMinValue then + begin Value := FValue - FIncrement; + FEdit.Value:= FValue; + end + else if not IsMinLimitReached then + begin + Value := FMinValue; + FEdit.Value:= FValue; + end; DoOnChange; + EnableButtons; end; procedure TfpgSpinEdit.ButtonUpMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -1054,10 +1087,7 @@ end; procedure TfpgSpinEdit.ButtonUpMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin - FUp := False; - FTempIncrement := Increment; - if Assigned(FTimer) then - FTimer.Enabled := False; + DisableTimer; end; procedure TfpgSpinEdit.ButtonDownMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -1070,10 +1100,7 @@ end; procedure TfpgSpinEdit.ButtonDownMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin - FDown := False; - FTempIncrement := Increment; - if Assigned(FTimer) then - FTimer.Enabled := False; + DisableTimer; end; procedure TfpgSpinEdit.EditKeyPress(Sender: TObject; var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); @@ -1205,29 +1232,46 @@ begin begin if FValue + FTempIncrement <= FMaxValue then begin - Value := FValue + FTempIncrement; + FValue := FValue + FTempIncrement; FEdit.Value := FValue; if FSteps <= FSpeedUpSteps then Inc(FSteps); if FSteps > FSpeedUpSteps then FTempIncrement := LargeIncrement; - DoOnchange; + DoOnChange; + if FValue= FMaxValue then + DisableTimer; + end + else if not IsMaxLimitreached then + begin + FValue := FMaxValue; + FEdit.Value := FValue; + DoOnChange; + DisableTimer; end; end else if FDown then begin if FValue - FTempIncrement >= FMinValue then begin - Value := FValue - FTempIncrement; + FValue := FValue - FTempIncrement; FEdit.Value := FValue; if FSteps <= FSpeedUpSteps then Inc(FSteps); if FSteps > FSpeedUpSteps then FTempIncrement := LargeIncrement; DoOnChange; + if FValue= FMinValue then + DisableTimer; + end + else + begin + FValue := FMinValue; + FEdit.Value := FValue; + DoOnChange; + DisableTimer; end; end; - EnableButtons; end; constructor TfpgSpinEdit.Create(AOwner: TComponent); diff --git a/src/gui/fpg_splitter.pas b/src/gui/fpg_splitter.pas index cf627081..6094656b 100644 --- a/src/gui/fpg_splitter.pas +++ b/src/gui/fpg_splitter.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/fpg_style.pas b/src/gui/fpg_style.pas index b5a799c2..f6538a81 100644 --- a/src/gui/fpg_style.pas +++ b/src/gui/fpg_style.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas index d656ad3a..9999fa83 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 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -22,10 +22,10 @@ unit fpg_tab; { TODO: * Tab Styles (tab, button, flat button, angled) - * Tab Position (top, bottom, left, right) * Better keyboard support * Focus rectangle drawn on tabs itself * FindNextPage() must be implemented + * Popup menu for tab selection. Should occur with RClick on tabs. } interface @@ -36,38 +36,48 @@ uses fpg_base, fpg_main, fpg_widget, - fpg_button; + fpg_button, + fpg_menu; type // forward declaration TfpgPageControl = class; TfpgTabStyle = (tsTabs, tsButtons, tsFlatButtons); - TfpgTabPosition = (tpTop, tpBottom{, tpLeft, tpRight}); + TfpgTabPosition = (tpTop, tpBottom, tpLeft, tpRight, tpNone); + TfpgTabOption = (to_PMenuClose, to_PMenuShowAvailTabs); + + TfpgTabOptions = set of TfpgTabOption; TfpgTabSheet = class(TfpgWidget) private + FPageControl: TfpgPageControl; FText: string; + FTabVisible: boolean; function GetPageControl: TfpgPageControl; function GetPageIndex: Integer; function GetText: string; procedure SetPageIndex(const AValue: Integer); procedure SetText(const AValue: string); + procedure SetPageControl(APageControl: TfpgPageControl); protected procedure HandlePaint; override; + procedure SetName(const NewName: TComponentName); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure AfterConstruction; override; property PageIndex: Integer read GetPageIndex write SetPageIndex; - property PageControl: TfpgPageControl read GetPageControl; + property PageControl: TfpgPageControl read FPageControl write SetPageControl; + property TabVisible: boolean read FTabVisible write FTabVisible; published property Text: string read GetText write SetText; + property OnPaint; end; TTabSheetChange = procedure(Sender: TObject; NewActiveSheet: TfpgTabSheet) of object; + TTabSheetClosing = procedure(Sender: TObject; ATabSheet: TfpgTabSheet) of object; TfpgPageControl = class(TfpgWidget) @@ -76,28 +86,33 @@ type FActivePage: TfpgTabSheet; FMargin: integer; FFixedTabWidth: integer; + FFixedTabHeight: Integer; + FOnClosingTabSheet: TTabSheetClosing; FPages: TList; FActivePageIndex: integer; FOnChange: TTabSheetChange; - FRightButton: TfpgButton; - FLeftButton: TfpgButton; - FFirstTabButton: TfpgTabSheet; + FRightButton: TfpgButton; // bottom/right + FLeftButton: TfpgButton; // left/top + FFirstTabButton: TfpgTabSheet; // when tabs don't fit in screen this is the first button on screen when tabs are scrolled FSortPages: boolean; FStyle: TfpgTabStyle; FTabPosition: TfpgTabPosition; + FPopupMenu: TfpgPopupMenu; + FTabOptions: TfpgTabOptions; function GetActivePageIndex: integer; function GetPage(AIndex: integer): TfpgTabSheet; function GetPageCount: Integer; - procedure InsertPage(const APage: TfpgTabSheet); + procedure InsertPage(const APage: TfpgTabSheet; SuppressOnChangeEvent: boolean = False); procedure RemovePage(const APage: TfpgTabSheet); procedure SetActivePageIndex(const AValue: integer); procedure SetActivePage(const AValue: TfpgTabSheet); function MaxButtonWidthSum: integer; - function MaxButtonHeight: integer; + function MaxButtonHeightSum: integer; function MaxButtonWidth: integer; function ButtonHeight: integer; function ButtonWidth(AText: string): integer; procedure SetFixedTabWidth(const AValue: integer); + procedure SetFixedTabHeight(const AValue: integer); function GetTabText(AText: string): string; procedure LeftButtonClick(Sender: TObject); procedure RightButtonClick(Sender: TObject); @@ -105,14 +120,17 @@ type procedure SetSortPages(const AValue: boolean); procedure SetStyle(const AValue: TfpgTabStyle); procedure SetTabPosition(const AValue: TfpgTabPosition); - procedure DoChange(ATabSheet: TfpgTabSheet); + procedure DoPageChange(ATabSheet: TfpgTabSheet); + procedure DoTabSheetClosing(ATabSheet: TfpgTabSheet); function DrawTab(const rect: TfpgRect; const Selected: Boolean = False; const Mode: Integer = 1): TfpgRect; + procedure pmCloseTab(Sender: TObject); protected procedure OrderSheets; // currently using bubblesort procedure RePaintTitles; virtual; procedure HandlePaint; override; procedure HandleShow; override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; public constructor Create(AOwner: TComponent); override; @@ -123,10 +141,14 @@ type property ActivePage: TfpgTabSheet read FActivePage write SetActivePage; property Pages[AIndex: integer]: TfpgTabSheet read GetPage; property OnChange: TTabSheetChange read FOnChange write FOnChange; + property OnClosingTabSheet: TTabSheetClosing read FOnClosingTabSheet write FOnClosingTabSheet; published property ActivePageIndex: integer read GetActivePageIndex write SetActivePageIndex; property BackgroundColor; property FixedTabWidth: integer read FFixedTabWidth write SetFixedTabWidth default 0; + property FixedTabHeight: integer read FFixedTabHeight write SetFixedTabHeight default 21; + property Hint; + property Options: TfpgTabOptions read FTabOptions write FTabOptions; property ParentShowHint; property ShowHint; property SortPages: boolean read FSortPages write SetSortPages default False; @@ -134,6 +156,7 @@ type property TabOrder; property TabPosition: TfpgTabPosition read FTabPosition write SetTabPosition default tpTop; property TextColor; + property OnShowHint; end; @@ -197,30 +220,50 @@ begin Canvas.Clear(FBackgroundColor); end; +procedure TfpgTabSheet.SetName(const NewName: TComponentName); +var + old: String; +begin + old := NewName; + inherited SetName(NewName); + if (csDesigning in ComponentState) then + begin + if (Text = '') or (Text = old) then + Text := NewName; + end; +end; + constructor TfpgTabSheet.Create(AOwner: TComponent); begin inherited Create(AOwner); FText := ''; + FTabVisible:= True; FFocusable := True; FBackgroundColor := Parent.BackgroundColor; FTextColor := Parent.TextColor; FIsContainer := True; + if (AOwner <> nil) and (AOwner is TfpgPageControl) then + begin + FPageControl:=TfpgPageControl(AOwner); + FPageControl.InsertPage(self, True); + end; end; destructor TfpgTabSheet.Destroy; begin - if Owner is TfpgPageControl then - TfpgPageControl(Owner).RemovePage(self); + if FPageControl <> nil then + FPageControl.RemovePage(self); inherited Destroy; end; -procedure TfpgTabSheet.AfterConstruction; +procedure TfpgTabSheet.SetPageControl(APageControl: TfpgPageControl); begin - inherited AfterConstruction; - if Owner is TfpgPageControl then - TfpgPageControl(Owner).InsertPage(self); + FPageControl := APageControl; + if APageControl <> nil then + FPageControl.InsertPage(Self); end; + { TfpgPageControl } function TfpgPageControl.GetActivePageIndex: integer; @@ -240,27 +283,55 @@ begin Result := FPages.Count; end; -procedure TfpgPageControl.InsertPage(const APage: TfpgTabSheet); +procedure TfpgPageControl.InsertPage(const APage: TfpgTabSheet; SuppressOnChangeEvent: boolean = False); begin if FPages.IndexOf(APage) <> -1 then Exit; //==> The page has already been added. FPages.Add(APage); - ActivePage := APage; + { TODO: This behaviour could maybe be controlled by a Options property } + if FPages.Count=1 then + begin + if SuppressOnChangeEvent then + Loading; + ActivePage := APage; + if SuppressOnChangeEvent then + Loaded; + end; end; procedure TfpgPageControl.RemovePage(const APage: TfpgTabSheet); +var + i: integer; begin if APage = nil then - Exit; - FPages.Remove(APage); - {$Note This still needs to be fixed.} - if APage = FActivePage then + Exit; // ==> + if FPages.Count =0 then + Exit; // ==> + + if FPages.Count > 1 then + begin + i:=FPages.IndexOf(APage); + FPages.Remove(APage); + APage.PageControl:=nil; + APage.Visible:=false; + if i = ActivePageIndex then + begin + if i > FPages.Count-1 then + ActivePage:=TfpgTabSheet(FPages.Last) + else if i = 0 then + ActivePage:= TfpgTabSheet(FPages.First) + else + ActivePage:=TfpgTabSheet(FPages[i]); + end + else if i < ActivePageIndex then + ActivePage:=TfpgTabSheet(Pages[i-1]); + end + else begin -// FActivePage := FindNextPage(APage, True); -// if FPages.Count > 0 then - ActivePage := TfpgTabSheet(FPages.First); -// else -// ActivePage := nil; + FPages.Remove(APage); + APage.PageControl := nil; + APage.Visible := False; + ActivePage := nil; end; end; @@ -278,8 +349,10 @@ begin Exit; //==> FActivePage := AValue; ActiveWidget := AValue; - FActivePageIndex := FPages.IndexOf(AValue); + if AValue <> nil then + FActivePageIndex := FPages.IndexOf(AValue); RePaint; + DoPageChange(FActivePage); end; function TfpgPageControl.MaxButtonWidthSum: integer; @@ -297,28 +370,38 @@ begin end; end; -function TfpgPageControl.MaxButtonHeight: integer; +function TfpgPageControl.MaxButtonHeightSum: integer; begin result := PageCount * ButtonHeight; end; function TfpgPageControl.MaxButtonWidth: integer; var - t: TfpgTabSheet; - i: integer; + t: TfpgTabSheet; + i: integer; begin Result := 0; - for i := 0 to FPages.Count-1 do + if FixedTabWidth > 0 then begin - t := TfpgTabSheet(FPages[i]); - if ButtonWidth(t.Text) > Result then - Result := ButtonWidth(t.Text); + Result := FixedTabWidth; + end + else + begin + for i := 0 to FPages.Count-1 do + begin + t := TfpgTabSheet(FPages[i]); + if ButtonWidth(t.Text) > Result then + Result := ButtonWidth(t.Text); + end; end; end; function TfpgPageControl.ButtonHeight: integer; begin - Result := FRightButton.Height; + if FFixedTabHeight > 0 then + result := FFixedTabHeight + else + result := FFont.Height + 10; { TODO: correct this } end; function TfpgPageControl.ButtonWidth(AText: string): integer; @@ -340,6 +423,17 @@ begin end; end; +procedure TfpgPageControl.SetFixedTabHeight(const AValue: integer); +begin + if FFixedTabHeight = AValue then + Exit; //==> + if AValue > 5 then + begin + FFixedTabHeight := AValue; + RePaint; + end; +end; + function TfpgPageControl.GetTabText(AText: string): string; var s, s1: string; @@ -360,7 +454,7 @@ begin inc(i); end; if FFont.TextWidth(s1) > (FFixedTabWidth-10) then - Delete(s1, length(s1), 1); {$Note This must become a UTF8 function} + UTF8Delete(s1, UTF8Length(s1), 1); if Length(s1) > 0 then s1 := Trim(s1); Result := s1; @@ -424,12 +518,26 @@ begin RePaint; end; -procedure TfpgPageControl.DoChange(ATabSheet: TfpgTabSheet); +procedure TfpgPageControl.DoPageChange(ATabSheet: TfpgTabSheet); begin + if (csLoading in ComponentState) then + Exit; + if (csDesigning in ComponentState) then + Exit; if Assigned(FOnChange) then FOnChange(self, ATabSheet); end; +procedure TfpgPageControl.DoTabSheetClosing(ATabSheet: TfpgTabSheet); +begin + if (csLoading in ComponentState) then + Exit; + if (csDesigning in ComponentState) then + Exit; + if Assigned(FOnClosingTabSheet) then + FOnClosingTabSheet(self, ATabSheet); +end; + function TfpgPageControl.DrawTab(const rect: TfpgRect; const Selected: Boolean = False; const Mode: Integer = 1): TfpgRect; var r: TfpgRect; @@ -443,36 +551,119 @@ begin end; if Mode = 2 then - r.Height := r.Height - 1; + r.Height -= 1; Canvas.SetColor(clWindowBackground); - Canvas.FillRectangle(r.Left, r.Top, r.Width, r.Height-2); - Canvas.SetColor(clHilite2); - Canvas.DrawLine(r.Left, r.Bottom-2, r.Left, r.Top+2); - Canvas.DrawLine(r.Left, r.Top+2, r.Left+2, r.Top); - Canvas.DrawLine(r.Left+2, r.Top, r.Right-1, r.Top); - Canvas.SetColor(clShadow1); - Canvas.DrawLine(r.Right-1, r.Top+1, r.Right-1, r.Bottom-1); - Canvas.SetColor(clShadow2); - Canvas.DrawLine(r.Right-1, r.Top+1, r.Right, r.Top+2); - Canvas.DrawLine(r.Right, r.Top+2, r.Right, r.Bottom-1); + case TabPosition of + tpTop: + begin + Canvas.FillRectangle(r.Left, r.Top, r.Width, r.Height-2); // fill tab background + Canvas.SetColor(clHilite2); + Canvas.DrawLine(r.Left, r.Bottom-2 , r.Left, r.Top+2); // left edge + Canvas.DrawLine(r.Left, r.Top+2 , r.Left+2, r.Top); // left rounder edge + Canvas.DrawLine(r.Left+2, r.Top, r.Right-1, r.Top); // top edge + Canvas.SetColor(clShadow1); + Canvas.DrawLine(r.Right-1, r.Top+1, r.Right-1, r.Bottom-1); // right inner edge + Canvas.SetColor(clShadow2); + Canvas.DrawLine(r.Right-1, r.Top+1, r.Right, r.Top+2); // right rounded edge (1px) + Canvas.DrawLine(r.Right, r.Top+2, r.Right, r.Bottom-1); // right outer edge + end; + + tpBottom: + begin + Canvas.FillRectangle(r.Left, r.Top, r.Width-2, r.Height-2); // fill tab background + Canvas.SetColor(clHilite2); + Canvas.DrawLine(r.Left, r.Top, r.Left, r.Bottom-1); // left edge + Canvas.SetColor(clShadow2); + Canvas.DrawLine(r.Left+2, r.Bottom, r.Right-1, r.Bottom); // bottom outer edge + Canvas.SetColor(clShadow1); + Canvas.DrawLine(r.Right-1, r.Bottom-1, r.Right-1, r.Top+1); // right inner edge + Canvas.DrawLine(r.Left+1, r.Bottom-1, r.Right-1, r.Bottom-1);// bottom inner edge + Canvas.SetColor(clShadow2); + Canvas.DrawLine(r.Right-1, r.Bottom-1, r.Right, r.Bottom-2); // right rounded edge (1px) + Canvas.DrawLine(r.Right, r.Bottom-2, r.Right, r.Top+1); // right outer edge + end; + + tpLeft: + begin + if Mode = 2 then + begin + r.Width := r.Width - 1; + r.Height := r.Height + 2; + end; + with Canvas do + begin + FillRectangle(r.Left, r.Top, r.Width, r.Height-2); + SetColor(clHilite2); + DrawLine(r.Left, r.Bottom-2, r.Left, r.Top+2); + DrawLine(r.Left, r.Top+2, r.Left+2, r.Top); + DrawLine(r.Left+2, r.Top, r.Right-1, r.Top); + SetColor(clShadow1); + DrawLine(r.Left+2, r.Bottom-1, r.Right-1, r.Bottom-1); + SetColor(clShadow2); + DrawLine(r.Left+1, r.Bottom-1, r.Left+3, r.Bottom); + DrawLine(r.Left+2, r.Bottom, r.Right, r.Bottom); + end; + end; + + tpRight: + begin + if Mode = 2 then + begin + r.Width := r.Width + 1; + r.Height := r.Height + 2; + end; + with Canvas do + begin + FillRectangle(r.Left, r.Top, r.Width, r.Height-2); + SetColor(clHilite2); + DrawLine(r.Left+1, r.Top, r.Right-2, r.Top); + SetColor(clShadow1); + DrawLine(r.Right-2,r.Top,r.Right-1,r.Top+1); + DrawLine(r.Left+2, r.Bottom-1, r.Right-2, r.Bottom-1); + DrawLine(r.Right-3, r.Bottom-1, r.Right-1, r.Bottom-3); + DrawLine(r.Right-1, r.Bottom-3, r.Right-1, r.Top); + SetColor(clShadow2); + DrawLine(r.Left+2,r.Bottom,r.Right-3, r.Bottom); + DrawLine(r.Right-3, r.Bottom, r.Right, r.Bottom-3); + DrawLine(r.Right, r.Top+2, r.Right, r.Bottom-2); + end; + end; + end; { case } +end; + +procedure TfpgPageControl.pmCloseTab(Sender: TObject); +var + ts: TfpgTabSheet; +begin + ts := ActivePage; + if ts = nil then + Exit; + RemovePage(ts); + DoTabSheetClosing(ts); + ts.Free; end; procedure TfpgPageControl.OrderSheets; begin FPages.Sort(@SortCompare); + FActivePageIndex := FPages.IndexOf(ActivePage); end; procedure TfpgPageControl.RePaintTitles; +const + TabHeight = 21; var - r: TfpgRect; + TabW, TabH: Integer; r2: TfpgRect; r3: TfpgRect; h: TfpgTabSheet; lp: integer; toffset: integer; + TextLeft, TextTop: Integer; dx: integer; lTxtFlags: TFTextFlags; + ActivePageVisible: Boolean; begin if not HasHandle then Exit; //==> @@ -480,179 +671,285 @@ begin if PageCount = 0 then Exit; //==> + TabW:=FixedTabWidth; + TabH:=FixedTabHeight; + ActivePageVisible := false; + If TabH = 0 then + TabH := TabHeight; h := TfpgTabSheet(FPages.First); if h = nil then - Exit; + Exit; //==> + Canvas.BeginDraw; Canvas.SetTextColor(TextColor); - lTxtFlags := TextFlagsDflt; + lTxtFlags := []; if not Enabled then Include(lTxtFlags, txtDisabled); + + if TabPosition in [tpTop, tpBottom] then + begin + if MaxButtonWidthSum > (Width-(FMargin*2)) then + begin + if FFirstTabButton = nil then + FFirstTabButton := h + else + h := FFirstTabButton; + if TabPosition = tpTop then + begin + FLeftButton.SetPosition(Width - (FRightButton.Width * 2), FMargin, FRightButton.Height, FRightButton.Height); + FRightButton.SetPosition(Width - FRightButton.Width, FMargin, FRightButton.Height, FRightButton.Height); + end + else + begin + FLeftButton.SetPosition(Width - (FRightButton.Width * 2), Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + FRightButton.SetPosition(Width - FRightButton.Width, Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + end; + FLeftButton.Visible := True; + FRightButton.Visible := True; + end + else + begin + FLeftButton.Visible := False; + FRightButton.Visible := False; + end; + end; + + if TabPosition in [tpLeft, tpRight] then + begin + if MaxButtonHeightSum > (Height-(FMargin*2)) then + begin + if FFirstTabButton = nil then + FFirstTabButton := h + else + h := FFirstTabButton; + if TabPosition = tpLeft then + begin + FLeftButton.SetPosition(MaxButtonWidth - (FRightButton.Width * 2), Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + FRightButton.SetPosition(MaxButtonWidth - FRightButton.Width, Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + end + else + begin + FLeftButton.SetPosition(Width - MaxButtonWidth, Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + FRightButton.SetPosition(Width - MaxButtonWidth + FRightButton.Width, Height - ButtonHeight - FMargin, FRightButton.Height, FRightButton.Height); + end; + FLeftButton.Visible := True; + FRightButton.Visible := True; + end + else + begin + FLeftButton.Visible := False; + FRightButton.Visible := False; + end; + end; + case TabPosition of + tpNone: + begin + while h <> nil do + begin + if h <> ActivePage then + h.Visible:=false + else + h.Visible:=True; + h.SetPosition(FMargin+2, FMargin+2 , Width - (FMargin*2) - 4, Height - ((FMargin+2)*2)); + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; + r2.Left := 0; + r2.Top := 0; + r2.Width := Width; + r2.Height := Height; + Canvas.DrawButtonFace(r2, []); + end; + tpBottom: + begin + lTxtFlags += TextFlagsDflt; + lp := 0; + r2.SetRect(2, Height - ButtonHeight-3, 50, 21); + while h <> nil do begin -(* - if MaxButtonWidthSum > (Width-(FMargin*2)) then + if h <> ActivePage then begin - if FFirstTabButton = nil then - FFirstTabButton := h - else - h := FFirstTabButton; - r.SetRect(FMargin, FMargin, Width-(FMargin*2)-(FRightButton.Width*2)-1, FRightButton.Height); - FLeftButton.SetPosition(Width - FMargin * 2 - FRightButton.Width * 2, FMargin, FRightButton.Height, FRightButton.Height); - FRightButton.SetPosition(Width - FMargin * 2 - FrightButton.Width, FMargin, FRightButton.Height, FRightButton.Height); - FLeftButton.Visible := True; - FRightButton.Visible := True; + toffset := 2; + h.Visible := False; end else begin - r.SetRect(FMargin, FMargin, Width-(FMargin*2), ButtonHeight); - FLeftButton.Visible := False; - FRightButton.Visible := False; + toffset := 4; + h.Visible := True; + h.SetPosition(FMargin+2, FMargin+2 , Width - (FMargin*2) - 4, Height - r2.Height - (FMargin+2)*2); end; - // tabsheet area - left outer line - Canvas.SetColor(clHilite1); - Canvas.DrawLine(FMargin, ButtonHeight, FMargin, Height-(FMargin*2)); - // tabsheet area - left inner line - Canvas.SetColor(clHilite2); - Canvas.DrawLine(FMargin+1, ButtonHeight+1, FMargin+1, Height - (FMargin*2) - 1); - // tabsheet area - outer bottom & right line - Canvas.SetColor(clShadow2); - Canvas.DrawLine(FMargin, Height - (FMargin*2), Width - (FMargin*2), Height - (FMargin*2)); - Canvas.DrawLine(Width - (FMargin*2), Height - (FMargin*2), Width - (FMargin*2), FMargin + ButtonHeight - 3); - // tabsheet area - inner bottom & right line - Canvas.SetColor(clShadow1); - Canvas.DrawLine(FMargin + 1, Height - (FMargin*2) - 1, Width - (FMargin*2) - 1, Height - (FMargin*2) - 1); - Canvas.DrawLine(Width - FMargin - 2, Height - FMargin - 2, Width - FMargin - 2, FMargin + ButtonHeight - 2); - Canvas.SetClipRect(r); - lp := 0; - while h <> nil do - begin - if h <> ActivePage then - begin - toffset := 4; - // tabsheet area - top lines under inactive tabs - Canvas.SetColor(clHilite1); - Canvas.DrawLine(FMargin + lp, FMargin + ButtonHeight - 2, FMargin + lp + ButtonWidth(h.Text), FMargin + ButtonHeight - 2); - Canvas.SetColor(clHilite2); - if TfpgTabSheet(FPages.First) = h then - dx := 1 - else - dx := -1; - Canvas.DrawLine(FMargin + lp+dx, FMargin + ButtonHeight - 1, FMargin + lp + ButtonWidth(h.Text) + 1, FMargin + ButtonHeight - 1); - // vertical divider line between inactive tabs - Canvas.SetColor(clShadow1); - Canvas.DrawLine(lp + FMargin + ButtonWidth(h.Text), FMargin, lp + FMargin + ButtonWidth(h.Text), FMargin + ButtonHeight - 2); - h.Visible := False; - end - else - begin - toffset := 2; - h.Visible := True; - h.SetPosition(FMargin+2, FMargin + ButtonHeight, Width - (FMargin*2) - 4, Height - (FMargin*2) - ButtonHeight - 2); - // tab outer left & top line - Canvas.SetColor(clHilite1); - Canvas.DrawLine(lp + FMargin, FMargin + ButtonHeight - 2, lp + FMargin, FMargin); - Canvas.DrawLine(lp + FMargin, FMargin, lp + FMargin + ButtonWidth(h.Text)-1, FMargin); - // tab inner left & top line - Canvas.SetColor(clHilite2); - Canvas.DrawLine(lp + FMargin + 1, FMargin + ButtonHeight - 1, lp + FMargin + 1, FMargin + 1); - Canvas.DrawLine(lp + FMargin + 1, FMargin + 1, lp + FMargin + ButtonWidth(h.Text) - 2, FMargin + 1); - // tab inner right line - Canvas.SetColor(clShadow1); - Canvas.DrawLine(lp + FMargin + ButtonWidth(h.Text) - 2, FMargin + 1, lp + FMargin + ButtonWidth(h.Text) - 2, FMargin + ButtonHeight); - // tab outer right line - Canvas.SetColor(clShadow2); - Canvas.DrawLine(lp + FMargin + ButtonWidth(h.Text) - 1, FMargin, lp + FMargin + ButtonWidth(h.Text) - 1, FMargin + ButtonHeight-1); - end; - // paint text - Canvas.DrawString(lp + (ButtonWidth(h.Text) div 2) - FFont.TextWidth(GetTabText(h.Text)) div 2, FMargin+toffset, GetTabText(h.Text)); - - lp := lp + ButtonWidth(h.Text); - if h <> TfpgTabSheet(FPages.Last) then - h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) - else - h := nil; - end; { while } - // tabsheet area - top lines on right of tabs - Canvas.SetColor(clHilite1); - Canvas.Drawline(lp + 1, FMargin + ButtonHeight - 2, Width - (FMargin*2), FMargin + ButtonHeight - 2); - Canvas.SetColor(clHilite2); - Canvas.Drawline(lp , FMargin + ButtonHeight - 1, Width - (FMargin*2)-1, FMargin + ButtonHeight - 1); -*) + // paint tab button + r2.Width := ButtonWidth(h.Text); + 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, + Height-r2.Height-toffset, GetTabText(h.Text), lTxtFlags); + + r2.Left := r2.Left + r2.Width; + lp := lp + ButtonWidth(h.Text); + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; end; + // Draw Page Control body rectangle (client area) + r2.Left := 0; + r2.Top := 0; + r2.Width := Width; + r2.Height := Height - r2.Height; + Canvas.DrawButtonFace(r2, []); + // Draw text of ActivePage, because we didn't before. + DrawTab(r3, false, 2); + Canvas.DrawText(r3.Left+4, r3.Top+5, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); + end; tpTop: + begin + lTxtFlags += TextFlagsDflt; + lp := 0; + r2.SetRect(2, 2, 50, 21); + while h <> nil do begin - if MaxButtonWidthSum > (Width-(FMargin*2)) then + if h <> ActivePage then begin - if FFirstTabButton = nil then - FFirstTabButton := h - else - h := FFirstTabButton; - r.SetRect(FMargin, FMargin, Width-(FMargin*2)-(FRightButton.Width*2)-1, FRightButton.Height); - FLeftButton.SetPosition(Width - FRightButton.Width * 2, FMargin, FRightButton.Height, FRightButton.Height); - FRightButton.SetPosition(Width - FrightButton.Width, FMargin, FRightButton.Height, FRightButton.Height); - FLeftButton.Visible := True; - FRightButton.Visible := True; + toffset := 4; + h.Visible := False; end else begin - r.SetRect(FMargin, FMargin, Width-(FMargin*2), ButtonHeight); - FLeftButton.Visible := False; - FRightButton.Visible := False; + toffset := 2; + h.Visible := True; + h.SetPosition(FMargin+2, FMargin+2 + r2.Height, Width - (FMargin*2) - 4, Height - r2.Height - ((FMargin+2)*2)); end; - - lp := 0; - r2.SetRect(2, 2, 50, 21); - while h <> nil do + // paint tab button + r2.Width := ButtonWidth(h.Text); + 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, + FMargin+toffset, GetTabText(h.Text), lTxtFlags); + r2.Left := r2.Left + r2.Width; + lp := lp + ButtonWidth(h.Text); + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; + // Draw Page Control body rectangle (client area) + r2.Left := 0; + r2.Top := r2.Top + r2.Height-2; + r2.Width := Width; + r2.Height := Height - r2.Height; + Canvas.DrawButtonFace(r2, []); + + // Draw text of ActivePage, because we didn't before. + DrawTab(r3, false, 2); + Canvas.DrawText(r3.Left+4, r3.Top+3, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); + end; + + tpRight: + begin + lTxtFlags += [txtVCenter, txtLeft]; + lp := 0; + TabW := MaxButtonWidth; + r2.SetRect(Width - 2 - TabW, 2, TabW, 21); + while h <> nil do + begin + if h <> ActivePage then begin - if h <> ActivePage then - begin - toffset := 4; - h.Visible := False; - end - else - begin - toffset := 2; - h.Visible := True; - h.SetPosition(FMargin+2, FMargin+2 + r2.Height, Width - (FMargin*2) - 4, Height - r2.Height - ((FMargin+2)*2)); - end; - // paint tab button - r2.Width := ButtonWidth(h.Text); - 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, FMargin+toffset, GetTabText(h.Text), lTxtFlags); - - r2.Left := r2.Left + r2.Width; - lp := lp + ButtonWidth(h.Text); - if h <> TfpgTabSheet(FPages.Last) then - h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) - else - h := nil; + toffset := 4; + h.Visible := False; + end + else + begin + toffset := 2; + h.Visible := True; + { set tab content page (client area) size } + h.SetPosition(FMargin+2, FMargin+2, Width - ((FMargin+2)*2) - TabW, Height - ((FMargin+2)*2)); end; - // Draw Page Control body rectangle (client area) - r2.Left := 0; - r2.Top := r2.Top + r2.Height-2; - r2.Width := Width; - r2.Height := Height - r2.Height; - Canvas.DrawButtonFace(r2, []); - - // Draw text of ActivePage, because we didn't before. - DrawTab(r3, false, 2); - Canvas.DrawText(r3.Left+4, r3.Top+3, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); + // paint tab button + r3 := DrawTab(r2, h = ActivePage); + + // paint text on non-active tabs + if h <> ActivePage then + Canvas.DrawText(r2.left+toffset, r2.Top, r2.Width, r2.Height, GetTabText(h.Text), lTxtFlags); + r2.Top += r2.Height; + lp := r2.Top; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; end; - end; - + // Draw Page Control body rectangle (client area) + r2.Left := 0; + r2.Top := 0; + r2.Width := Width - TabW; + r2.Height := Height; + Canvas.DrawButtonFace(r2, []); + + // Draw text of ActivePage, because we didn't before. + DrawTab(r3, false, 2); + Canvas.DrawText(r3.left+toffset, r3.Top, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); + end; + + tpLeft: + begin + lTxtFlags += [txtVCenter, txtLeft]; + lp := 0; + TabW := MaxButtonWidth; + r2.SetRect(2, 2, TabW, 21); + while h <> nil do + begin + if h <> ActivePage then + begin + toffset := 4; + h.Visible := False; + end + else + begin + toffset := 2; + h.Visible := True; + { set tab content page (client area) size } + h.SetPosition(FMargin+2+TabW, FMargin+2, Width - ((FMargin+2)*2) - TabW, Height - ((FMargin+2)*2)); + end; + // paint tab button + r3 := DrawTab(r2, h = ActivePage); + + // paint text on non-active tabs + if h <> ActivePage then + Canvas.DrawText(r2.left+toffset, r2.Top, r2.Width, r2.Height, GetTabText(h.Text), lTxtFlags); + r2.Top += r2.Height; + lp := r2.Top; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; + // Draw Page Control body rectangle (client area) + r2.Left := TabW; + r2.Top := 0; + r2.Width := Width - TabW; + r2.Height := Height; + Canvas.DrawButtonFace(r2, []); + + // Draw text of ActivePage, because we didn't before. + DrawTab(r3, false, 2); + Canvas.DrawText(r3.left+toffset, r3.Top, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); + end; + end; { case } + Canvas.EndDraw; end; procedure TfpgPageControl.HandlePaint; begin -// inherited HandlePaint; if SortPages then OrderSheets; Canvas.ClearClipRect; @@ -669,15 +966,6 @@ begin Canvas.DrawString(2, 2, Name + ': ' + Classname); end; end; - - if TabPosition = tpBottom then - begin - if Focused then - Canvas.SetColor(clWidgetFrame) - else - Canvas.SetColor(clInactiveWgFrame); - Canvas.DrawRectangle(0, 0, Width, Height); - end; RePaintTitles; end; @@ -693,8 +981,10 @@ var h: TfpgTabSheet; lp: integer; // left position bw: integer; // button width + bh: integer; // button height + p1, p2: integer; // tab boundaries for mouse click to take affect begin -// writeln('>> TfpgPageControl.HandleLMouseUp'); +// debugln('>> TfpgPageControl.HandleLMouseUp'); h := TfpgTabSheet(FPages.First); if h = nil then Exit; //==> @@ -705,58 +995,92 @@ begin case TabPosition of tpTop: - begin -// writeln(' TabPosition = tpTop'); - if (y > FMargin) and (y < ButtonHeight) then - begin - while h <> nil do - begin - bw := ButtonWidth(h.Text); // initialize button width - if (x > lp) and (x < lp + bw) then - begin - if h <> ActivePage then - begin - ActivePage := h; - DoChange(ActivePage); - end; - exit; - end; { if } - lp := lp + bw; - if h <> TfpgTabSheet(FPages.Last) then - h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) - else - h := nil; - end; { while } - end; { if } - end; - + begin + p1 := FMargin; + p2 := ButtonHeight; + end; + tpBottom: - begin -(* - if (y > Height - FMargin - buttonheight) and (y < height - FMargin) then + begin + p1 := Height - FMargin - ButtonHeight; + p2 := Height - FMargin; + end; + + tpRight: + begin + p1 := Width - MaxButtonWidth; + p2 := Width; + end; + + tpLeft: + begin + p1 := FMargin; + p2 := FMargin + MaxButtonWidth; + end; + end; + + if TabPosition in [tpTop, tpBottom] then + begin + if (y > p1) and (y < p2) then + begin + while h <> nil do + begin + bw := ButtonWidth(h.Text); // initialize button width + if (x > lp) and (x < lp + bw) then begin - while h <> nil do - begin - bw := ButtonWidth(h^.TabSheet.Text); // initialize button width - if (x > lp) and (x < lp + bw) then - begin - if h^.TabSheet <> ActiveTabSheet then - begin - ActiveTabSheet := h^.TabSheet; - DoChange(ActiveTabSheet); - end; - exit; - end; - lp := lp + bw; - h := h^.next; - end; { while } + if h <> ActivePage then + ActivePage := h; + exit; end; { if } -*) - end; - end; { case } + lp := lp + bw; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; { while } + end; { if } + end; + + if TabPosition in [tpLeft, tpRight] then + begin + if (x > p1) and (x < p2) then + begin + while h <> nil do + begin + bh := ButtonHeight; // initialize button height + if (y > lp) and (y < lp + bh) then + begin + if h <> ActivePage then + ActivePage := h; + exit; + end; { if } + lp := lp + bh; + if h <> TfpgTabSheet(FPages.Last) then + h := TfpgTabSheet(FPages[FPages.IndexOf(h)+1]) + else + h := nil; + end; { while } + end; { if } + end; + inherited HandleLMouseUp(x, y, shiftstate); end; +procedure TfpgPageControl.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); +begin + inherited HandleRMouseUp(x, y, shiftstate); +// ShowDefaultPopupMenu(x, y, ShiftState); + if to_PMenuClose in FTabOptions then + begin + if not Assigned(FPopupMenu) then + begin + FPopupMenu := TfpgPopupMenu.Create(self); + FPopupMenu.AddMenuItem('Close Tab', '', @pmCloseTab); + end; + FPopupMenu.ShowAt(self, x, y); + end; +end; + procedure TfpgPageControl.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); var @@ -765,14 +1089,13 @@ begin // writeln(Classname, '.Keypress'); consumed := True; i := ActivePageIndex; - + if ssAlt in shiftstate then case keycode of keyLeft: begin if ActivePage <> TfpgTabSheet(FPages.First) then begin ActivePage := TfpgTabSheet(FPages[i-1]); - DoChange(ActivePage); end; end; @@ -781,7 +1104,6 @@ begin if ActivePage <> TfpgTabSheet(FPages.Last) then begin ActivePage := TfpgTabSheet(FPages[i+1]); - DoChange(ActivePage); end; end; @@ -799,12 +1121,14 @@ begin FWidth := 150; FHeight := 100; FIsContainer := True; + FTabOptions := []; FTextColor := Parent.TextColor; FBackgroundColor := Parent.BackgroundColor; FFocusable := True; FOnChange := nil; FFixedTabWidth := 0; + FFixedTabHeight := 21; FFirstTabButton := nil; FStyle := tsTabs; FTabPosition := tpTop; @@ -825,20 +1149,13 @@ begin end; destructor TfpgPageControl.Destroy; -var - ts: TfpgTabSheet; +var i: integer; begin FOnChange := nil; - if FPages.Count > 0 then - FActivePage := TfpgTabSheet(FPages[0]); - ActiveWidget := nil; - while FPages.Count > 0 do - begin - ts := TfpgTabSheet(FPages.Last); - FPages.Remove(ts); - ts.Free; - end; + for i:=0 to FPages.Count-1 do + TfpgTabSheet(FPages[i]).PageControl:=nil; FPages.Free; + ActiveWidget := nil; FFirstTabButton := nil; inherited Destroy; end; diff --git a/src/gui/fpg_trackbar.pas b/src/gui/fpg_trackbar.pas index 9dc15b95..524a4c4c 100644 --- a/src/gui/fpg_trackbar.pas +++ b/src/gui/fpg_trackbar.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -69,13 +69,16 @@ type constructor Create(AOwner: TComponent); override; published property BackgroundColor; + property Hint; property Min: integer read FMin write SetMin default 0; property Max: integer read FMax write SetMax default 10; property Position: integer read FPosition write SetTBPosition default 0; + property ShowHint; property SliderSize: integer read FSliderSize write SetSliderSize default 11; property Orientation: TOrientation read FOrientation write FOrientation default orHorizontal; property TabOrder; property OnChange: TTrackBarChange read FOnChange write FOnChange; + property OnShowHint; end; @@ -118,6 +121,7 @@ type property Min: integer read FMin write SetMin default 0; property Max: integer read FMax write SetMax default 100; property ParentShowHint; + property Hint; property ShowHint; property ShowPosition: boolean read FShowPosition write SetShowPosition default False; property Orientation: TOrientation read FOrientation write FOrientation default orHorizontal; @@ -126,6 +130,7 @@ type property OnChange: TTrackBarChange read FOnChange write FOnChange; property OnEnter; property OnExit; + property OnShowHint; end; diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index da3e2ddf..b61b0c29 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 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -203,8 +203,12 @@ type procedure DrawHeader(ACol: integer; ARect: TfpgRect; AFlags: integer); virtual; procedure DoChange; virtual; procedure DoExpand(ANode: TfpgTreeNode); virtual; + // only visual (visible) nodes function NextVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; function PrevVisualNode(ANode: TfpgTreeNode): TfpgTreeNode; + // any next node, even if node is collapsed + function NextNode(ANode: TfpgTreeNode): TfpgTreeNode; + function PrevNode(ANode: TfpgTreeNode): TfpgTreeNode; // the nodes between the given node and the direct next node function SpaceToVisibleNext(aNode: TfpgTreeNode): integer; function StepToRoot(aNode: TfpgTreeNode): integer; @@ -214,6 +218,8 @@ type procedure SetColumnWidth(AIndex, AWidth: word); // the width of a column - aIndex of the rootnode = 0 function GetColumnWidth(AIndex: word): word; + procedure GotoNextNodeUp; + procedure GotoNextNodeDown; property Font: TfpgFont read FFont; // Invisible node that starts the tree property RootNode: TfpgTreeNode read GetRootNode; @@ -228,6 +234,7 @@ type property ParentShowHint; property ScrollWheelDelta: integer read FScrollWheelDelta write FScrollWheelDelta default 15; property ShowColumns: boolean read FShowColumns write SetShowColumns default False; + property Hint; property ShowHint; property ShowImages: boolean read FShowImages write SetShowImages default False; property TabOrder; @@ -235,6 +242,8 @@ type 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 OnShowHint; end; @@ -775,13 +784,16 @@ end; procedure TfpgTreeview.SetSelection(const AValue: TfpgTreeNode); var n: TfpgTreeNode; + dy: integer; // y delta - absolute top node + nh: integer; // node height + vh: integer; // visible height begin - if aValue <> FSelection then + if AValue <> FSelection then begin - FSelection := aValue; - if aValue <> nil then + FSelection := AValue; + if AValue <> nil then begin - n := aValue.parent; + n := AValue.Parent; while n <> nil do begin n.Expand; @@ -789,17 +801,28 @@ begin n := n.parent; end; end; - - if GetAbsoluteNodeTop(Selection) + GetNodeHeight - FVScrollbar.Position > VisibleHeight then + + dy := GetAbsoluteNodeTop(FSelection); + nh := GetNodeHeight; + vh := VisibleHeight; + if dy + nh - FVScrollbar.Position > vh then begin - FVScrollbar.Position := GetAbsoluteNodeTop(Selection) + GetNodeHeight - VisibleHeight; + if FVScrollBar.Max = 0 then // the first time and no expansion happened before. + FVScrollBar.Max := dy + Height; + FVScrollbar.Position := dy + nh - vh; FYOffset := FVScrollbar.Position; UpdateScrollBars; + if FHScrollbar.Visible then // HScrollbar appeared so we need to adjust position again + begin + FVScrollbar.Position := FVScrollbar.Position + FHScrollbar.Height; + FYOffset := FVScrollbar.Position; + UpdateScrollBars; + end; end; - if GetAbsoluteNodeTop(Selection) - FVScrollbar.Position < 0 then + if dy - FVScrollbar.Position < 0 then begin - FVScrollbar.Position := GetAbsoluteNodeTop(Selection); + FVScrollbar.Position := dy; FYOffset := FVScrollbar.Position; UpdateScrollbars; end; @@ -853,14 +876,14 @@ end; function TfpgTreeview.VisibleWidth: integer; begin - Result := Width - 2; + Result := Width - 2; // border width = 2 pixels if FVScrollbar.Visible then dec(Result, FVScrollbar.Width); end; function TfpgTreeview.VisibleHeight: integer; begin - Result := Height - 2; + Result := Height - 2; // border width = 2 pixels if FShowColumns then dec(Result, FColumnHeight); if FHScrollbar.Visible then @@ -1051,6 +1074,20 @@ begin result := DefaultColumnWidth; end; +procedure TfpgTreeView.GotoNextNodeUp; +begin + if Selection = RootNode.FirstSubNode then + Exit; + Selection := PrevNode(Selection); +end; + +procedure TfpgTreeView.GotoNextNodeDown; +begin + if Selection = RootNode.LastSubNode then + Exit; + Selection := NextNode(Selection); +end; + procedure TfpgTreeview.PreCalcColumnLeft; var Aleft: TfpgCoord; @@ -1086,9 +1123,9 @@ begin {$IFDEF DEBUG} writeln(Classname, '.UpdateScrollbars'); {$ENDIF} - FVScrollbar.Visible := VisibleHeight < GetNodeHeightSum * GetNodeHeight; + FVScrollbar.Visible := VisibleHeight < (GetNodeHeightSum * GetNodeHeight); FVScrollbar.Min := 0; - FVScrollbar.Max := (GetNodeHeightSum - 1) * GetNodeHeight; + FVScrollbar.Max := (GetNodeHeightSum * GetNodeHeight) - VisibleHeight + FHScrollbar.Height; FHScrollbar.Min := 0; FHScrollbar.Max := MaxNodeWidth - VisibleWidth + FVScrollbar.Width; FHScrollbar.Visible := MaxNodeWidth > Width - 2; @@ -1097,13 +1134,18 @@ begin FVScrollbar.Position := 0; FVScrollBar.RepaintSlider; FYOffset := 0; - end; + end + else + FVScrollBar.RepaintSlider; + if not FHScrollbar.Visible then begin FHScrollbar.Position := 0; FHScrollBar.RepaintSlider; FXOffset := 0; - end; + end + else + FHScrollBar.RepaintSlider; end; procedure TfpgTreeview.ResetScrollbar; @@ -1586,7 +1628,7 @@ begin keyRight: begin Consumed := True; - Selection.Collapsed := false; + Selection.Expand; DoExpand(Selection); ResetScrollbar; RePaint; @@ -1655,21 +1697,27 @@ end; procedure TfpgTreeview.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); +var + i: integer; begin inherited HandleMouseScroll(x, y, shiftstate, delta); if delta > 0 then begin inc(FYOffset, FScrollWheelDelta); - if FYOffset > VisibleHeight then - FYOffset := VisibleHeight; + i := (GetNodeHeightSum * GetNodeHeight) - VisibleHeight + FHScrollbar.Height; + if FYOffset > i then + FYOffset := i; + i := FVScrollbar.Position + FScrollWheelDelta; + FVScrollbar.Position := i; end else begin dec(FYOffset, FScrollWheelDelta); if FYOffset < 0 then FYOffset := 0; + i := FVScrollbar.Position - FScrollWheelDelta; + FVScrollbar.Position := i; end; - UpdateScrollbars; RePaint; end; @@ -1747,6 +1795,58 @@ begin end; end; +function TfpgTreeView.NextNode(ANode: TfpgTreeNode): TfpgTreeNode; + //---------------- + procedure _FindNextNode; + begin + if ANode.Next <> nil then + begin + result := ANode.Next; + end + else + begin + while ANode.Next = nil do + begin + ANode := ANode.Parent; + if ANode = nil then + exit; //==> + end; + result := ANode.Next; + end; + end; + +begin + result := nil; + if ANode.Count > 0 then + result := ANode.FirstSubNode + else + _FindNextNode; +end; + +function TfpgTreeView.PrevNode(ANode: TfpgTreeNode): TfpgTreeNode; +var + n: TfpgTreeNode; +begin + n := ANode; + if ANode.Prev <> nil then + begin + result := ANode.Prev; + ANode := ANode.Prev; + while {(not ANode.Collapsed) and} (ANode.Count > 0) do + begin + result := ANode.LastSubNode; + ANode := ANode.LastSubNode; + end; + end + else + begin + if ANode.Parent <> nil then + result := ANode.Parent + else + result := n; + end; +end; + function TfpgTreeview.SpaceToVisibleNext(aNode: TfpgTreeNode): integer; var h: TfpgTreeNode; @@ -1805,7 +1905,7 @@ begin FHScrollbar.OnScroll := @HScrollbarScroll; FHScrollbar.Visible := False; FHScrollbar.Position := 0; - FHScrollbar.SliderSize := 0.2; + FHScrollbar.SliderSize := 0.5; FVScrollbar := TfpgScrollbar.Create(self); FVScrollbar.Orientation := orVertical; diff --git a/src/gui/inputquerydialog.inc b/src/gui/inputquerydialog.inc new file mode 100644 index 00000000..5b063233 --- /dev/null +++ b/src/gui/inputquerydialog.inc @@ -0,0 +1,134 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This unit contains the Input Query dialogs. +} + +{%mainunit fpg_dialogs.pas} + +{$IFDEF read_interface} + +type + + TfpgQueryDialog = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: fpgQueryDialog} + lblText: TfpgLabel; + edtText: TfpgEdit; + btnOK: TfpgButton; + btnCancel: TfpgButton; + {@VFD_HEAD_END: fpgQueryDialog} + procedure SetupCaptions; + public + procedure AfterCreate; override; + end; + + +{$ENDIF read_interface} + +{$IFDEF read_implementation} + +function fpgInputQuery(const ACaption, APrompt: TfpgString; var Value: TfpgString): Boolean; +var + dlg: TfpgQueryDialog; +begin + dlg := TfpgQueryDialog.Create(nil); + try + dlg.WindowTitle := ACaption; + dlg.lblText.Text := APrompt; + Result := dlg.ShowModal = mrOK; + Value := dlg.edtText.Text; + finally + dlg.Free; + end; +end; + +{ TfpgQueryDialog } + +procedure TfpgQueryDialog.SetupCaptions; +begin + btnOK.Text := rsOK; + btnCancel.Text := rsCancel; +end; + +procedure TfpgQueryDialog.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: fpgQueryDialog} + Name := 'fpgQueryDialog'; + SetPosition(300, 150, 340, 97); + WindowTitle := 'QueryDialog'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + lblText := TfpgLabel.Create(self); + with lblText do + begin + Name := 'lblText'; + SetPosition(8, 8, 324, 16); + Anchors := [anLeft,anRight,anTop]; + FontDesc := '#Label1'; + Hint := ''; + Text := 'lblText'; + end; + + edtText := TfpgEdit.Create(self); + with edtText do + begin + Name := 'edtText'; + SetPosition(8, 26, 324, 24); + Anchors := [anLeft,anRight,anTop]; + ExtraHint := ''; + Hint := ''; + TabOrder := 2; + Text := ''; + FontDesc := '#Edit1'; + end; + + btnOK := TfpgButton.Create(self); + with btnOK do + begin + Name := 'btnOK'; + SetPosition(144, 64, 92, 24); + Anchors := [anRight,anBottom]; + Text := 'OK'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 3; + end; + + btnCancel := TfpgButton.Create(self); + with btnCancel do + begin + Name := 'btnCancel'; + SetPosition(240, 64, 92, 24); + Anchors := [anRight,anBottom]; + Text := 'Cancel'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrCancel; + TabOrder := 4; + end; + + {@VFD_BODY_END: fpgQueryDialog} + {%endregion} + + SetupCaptions; +end; + +{$ENDIF read_implementation} + diff --git a/src/gui/messagedialog.inc b/src/gui/messagedialog.inc index 88a22272..10ffd515 100644 --- a/src/gui/messagedialog.inc +++ b/src/gui/messagedialog.inc @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -44,6 +44,7 @@ type procedure PrepareButtons; protected procedure SetWindowTitle(const ATitle: string); override; + procedure HandleClose; override; procedure HandlePaint; override; procedure HandleShow; override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; @@ -58,10 +59,14 @@ type procedure AfterCreate; override; class procedure About(const ATitle: string; const AText: string); class procedure AboutFPGui(const ATitle: string = ''); - class function Critical(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton): TfpgMsgDlgBtn; - class function Information(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton): TfpgMsgDlgBtn; - class function Question(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbYes, mbNo]; ADefaultButton: TfpgMsgDlgBtn = mbNo): TfpgMsgDlgBtn; - class function Warning(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton): TfpgMsgDlgBtn; + { ACloseButton is when the user cancels the dialog via the Esc key or the X window button } + class function Critical(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton; ACloseButton: TfpgMsgDlgBtn = mbCancel): TfpgMsgDlgBtn; + { ACloseButton is when the user cancels the dialog via the Esc key or the X window button } + class function Information(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton; ACloseButton: TfpgMsgDlgBtn = mbCancel): TfpgMsgDlgBtn; + { ACloseButton is when the user cancels the dialog via the Esc key or the X window button } + class function Question(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbYes, mbNo]; ADefaultButton: TfpgMsgDlgBtn = mbNo; ACloseButton: TfpgMsgDlgBtn = mbCancel): TfpgMsgDlgBtn; + { ACloseButton is when the user cancels the dialog via the Esc key or the X window button } + class function Warning(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons = [mbOK]; ADefaultButton: TfpgMsgDlgBtn = mbNoButton; ACloseButton: TfpgMsgDlgBtn = mbCancel): TfpgMsgDlgBtn; property InformativeText: string read GetInformativeText write SetInformativeText; property Text: string read FText write SetText; property Buttons: TfpgMsgDlgButtons read FButtons write SetButtons; @@ -165,9 +170,9 @@ var { TODO : At some stage the StyleManager can give us the correct button order based on the OS and Window Manager. } Result := 3; - sl.Add(cMsgDlgBtnText[mbYes] + '=' + IntToStr(mrYes)); - sl.Add(cMsgDlgBtnText[mbNo] + '=' + IntToStr(mrNo)); - sl.Add(cMsgDlgBtnText[mbCancel] + '=' + IntToStr(mrCancel)); + sl.Add(cMsgDlgBtnText[mbYes] + '=' + IntToStr(Integer(mrYes))); + sl.Add(cMsgDlgBtnText[mbNo] + '=' + IntToStr(Integer(mrNo))); + sl.Add(cMsgDlgBtnText[mbCancel] + '=' + IntToStr(Integer(mrCancel))); case DefaultButton of mbYes: lDefault := 0; mbNo: lDefault := 1; @@ -202,7 +207,7 @@ begin b := TfpgButton.Create(self); b.Name := 'DlgButton' + IntToStr(i+1); b.Text := sl.Names[i]; - b.ModalResult := StrToInt(sl.ValueFromIndex[i]); + b.ModalResult := TfpgModalResult(StrToInt(sl.ValueFromIndex[i])); if (i = lDefault) or (lcount = 1) then b.Default := True; FButtonList.Add(b); @@ -243,6 +248,13 @@ begin inherited SetWindowTitle(ATitle); end; +procedure TfpgMessageDialog.HandleClose; +begin + if ModalResult = mrNone then // Form was close via the X (window frame) button + ModalResult := mrCancel; + inherited HandleClose; +end; + procedure TfpgMessageDialog.HandlePaint; var logo: TfpgImage; @@ -369,6 +381,20 @@ begin dlg.WindowTitle := ATitle; dlg.Buttons := [mbOK]; dlg.DefaultButton := mbOK; + dlg.Text := dlg.WindowTitle; + dlg.InformativeText := LineEnding + LineEnding + + 'This program uses ' + fpGUIName + ' version ' + fpGUI_Version + '.' + + LineEnding + LineEnding + + fpGUIName + ' is intended for Open Source and Commercial applications. fpGUI' + + ' uses the LGPL 2 license with a static linking exception - the same as the Free' + + ' Pascal Compiler''s RTL.' + + LineEnding + LineEnding + + 'fpGUI is a Object Pascal toolkit for cross-platform application development.' + + ' It provides single-source portability across Linux, MS Windows, *BSD' + + ' and embedded devices like Embedded Linux and Windows CE.' + + LineEnding + LineEnding + + 'For more information, see the ' + fpGUIName + ' website at: ' + + fpGUIWebsite; dlg.PrepareLayout; dlg.ShowModal; finally @@ -378,9 +404,10 @@ end; class function TfpgMessageDialog.Critical(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons; - ADefaultButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; + ADefaultButton: TfpgMsgDlgBtn; ACloseButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; var dlg: TfpgMessageDialog; + mr: TfpgModalResult; begin dlg := TfpgMessageDialog.Create(nil); try @@ -391,7 +418,12 @@ begin dlg.WindowTitle := ATitle; dlg.FDefaultButton := ADefaultButton; dlg.PrepareLayout; - Result := TfpgMsgDlgBtn(dlg.ShowModal); + mr := dlg.ShowModal; + // if there is a Cancel button, ignore ACloseButton. + if (mr = mrCancel) and (not (mbCancel in AButtons)) then + Result := ACloseButton + else + Result := TfpgMsgDlgBtn(mr); finally dlg.Free; end; @@ -399,9 +431,10 @@ end; class function TfpgMessageDialog.Information(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons; - ADefaultButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; + ADefaultButton: TfpgMsgDlgBtn; ACloseButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; var dlg: TfpgMessageDialog; + mr: TfpgModalResult; begin dlg := TfpgMessageDialog.Create(nil); try @@ -412,7 +445,12 @@ begin dlg.WindowTitle := ATitle; dlg.FDefaultButton := ADefaultButton; dlg.PrepareLayout; - Result := TfpgMsgDlgBtn(dlg.ShowModal); + mr := dlg.ShowModal; + // if there is a Cancel button, ignore ACloseButton. + if (mr = mrCancel) and (not (mbCancel in AButtons)) then + Result := ACloseButton + else + Result := TfpgMsgDlgBtn(mr); finally dlg.Free; end; @@ -420,9 +458,10 @@ end; class function TfpgMessageDialog.Question(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons; - ADefaultButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; + ADefaultButton: TfpgMsgDlgBtn; ACloseButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; var dlg: TfpgMessageDialog; + mr: TfpgModalResult; begin dlg := TfpgMessageDialog.Create(nil); try @@ -433,7 +472,12 @@ begin dlg.WindowTitle := ATitle; dlg.FDefaultButton := ADefaultButton; dlg.PrepareLayout; - Result := TfpgMsgDlgBtn(dlg.ShowModal); + mr := dlg.ShowModal; + // if there is a Cancel button, ignore ACloseButton. + if (mr = mrCancel) and (not (mbCancel in AButtons)) then + Result := ACloseButton + else + Result := TfpgMsgDlgBtn(mr); finally dlg.Free; end; @@ -441,9 +485,10 @@ end; class function TfpgMessageDialog.Warning(const ATitle: string; const AText: string; AButtons: TfpgMsgDlgButtons; - ADefaultButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; + ADefaultButton: TfpgMsgDlgBtn; ACloseButton: TfpgMsgDlgBtn): TfpgMsgDlgBtn; var dlg: TfpgMessageDialog; + mr: TfpgModalResult; begin dlg := TfpgMessageDialog.Create(nil); try @@ -454,7 +499,12 @@ begin dlg.WindowTitle := ATitle; dlg.FDefaultButton := ADefaultButton; dlg.PrepareLayout; - Result := TfpgMsgDlgBtn(dlg.ShowModal); + mr := dlg.ShowModal; + // if there is a Cancel button, ignore ACloseButton. + if (mr = mrCancel) and (not (mbCancel in AButtons)) then + Result := ACloseButton + else + Result := TfpgMsgDlgBtn(mr); finally dlg.Free; end; diff --git a/src/gui/newdirdialog.inc b/src/gui/newdirdialog.inc index 62f6b4c0..406b6490 100644 --- a/src/gui/newdirdialog.inc +++ b/src/gui/newdirdialog.inc @@ -1,7 +1,7 @@ { - fpGUI - Free Pascal GUI Library + fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc index 35bafff6..d09f11c8 100644 --- a/src/gui/selectdirdialog.inc +++ b/src/gui/selectdirdialog.inc @@ -2,9 +2,6 @@ {$IFDEF read_interface} - - { TfpgSelectDirDialog } - TfpgSelectDirDialog = class(TfpgBaseDialog) private tv: TfpgTreeView; @@ -15,14 +12,16 @@ procedure SetRootDir(const AValue: TfpgString); procedure AddDirectories(Node: TfpgTreeNode; Dir: TfpgString); procedure NodeExpanded(Sender: TObject; ANode: TfpgTreeNode); + function GetSelectedDir: TfpgString; + procedure SetSelectedDir(const AValue: TfpgString); {$IFDEF MSWINDOWS} procedure AddWindowsDriveLetters; {$ENDIF} public constructor Create(AOwner: TComponent); override; procedure AfterCreate; override; - { return the selected directory } - function SelectedDir: TfpgString; + { return the selected directory or set initial selected dir } + property SelectedDir: TfpgString read GetSelectedDir write SetSelectedDir; { Directory the treeview starts from } property RootDirectory: TfpgString read FRootDir write SetRootDir; end; @@ -35,16 +34,30 @@ {$IFDEF read_implementation} function TfpgSelectDirDialog.GetAbsolutePath(Node: TfpgTreeNode): TfpgString; +var + lResult: TfpgString; begin - Result := ''; + lResult := ''; while Node <> nil do begin - if Node.Text = PathDelim then - Result := Node.Text + Result - else - Result := Node.Text + PathDelim + Result; + {$IFDEF UNIX} + if (Node.Text = PathDelim) then + lResult := Node.Text + lResult + else if (Node.Text <> '') then + lResult := Node.Text + PathDelim + lResult; + {$ENDIF} + {$IFDEF MSWINDOWS} + if (Node.Text <> '') then + begin + if (Node.Text[Length(Node.Text)] = PathDelim) then + lResult := Node.Text + lResult + else + lResult := Node.Text + PathDelim + lResult; + end; + {$ENDIF} Node := Node.Parent; end; + Result := lResult; end; procedure TfpgSelectDirDialog.InitializeTreeview; @@ -168,6 +181,49 @@ begin AddDirectories(ANode, GetAbsolutePath(ANode)); end; +function TfpgSelectDirDialog.GetSelectedDir: TfpgString; +begin + Result := ''; + if tv.Selection <> nil then + Result := GetAbsolutePath(tv.Selection); +end; + +procedure TfpgSelectDirDialog.SetSelectedDir(const AValue: TfpgString); +var + s: TfpgString; + dir: TfpgString; + i: integer; + p: integer; + prevn, nextn: TfpgTreeNode; +begin + if AValue = '' then + Exit; + s := fpgAppendPathDelim(AValue); + prevn := tv.RootNode; + nextn := prevn; + while nextn <> nil do + begin + if s = '' then + break; + i := UTF8Pos(PathDelim, s); + if i = 1 then + dir := PathDelim + else + dir := UTF8Copy(s, 1, i-1); + UTF8Delete(s, 1, i); // delete leading dir + PathDelim + if (prevn = tv.RootNode) and (pos(':', dir) > 0) then + dir += PathDelim; // Windows drive letter. eg: C:\ or D:\ etc. + nextn := prevn.FindSubNode(dir, True); + if Assigned(nextn) then + begin + prevn := nextn; + prevn.Expand; + NodeExpanded(self, prevn); + end; + end; + tv.Selection := prevn; +end; + {$IFDEF MSWINDOWS} procedure TfpgSelectDirDialog.AddWindowsDriveLetters; const @@ -199,7 +255,7 @@ begin inherited AfterCreate; Name := 'fpgSelectDirDialog'; SetPosition(20, 20, 300, 370); - WindowTitle := 'Select a Directory'; { TODO : Localize this!! } + WindowTitle := rsSelectaDirectory; WindowPosition := wpOneThirdDown; tv := TfpgTreeView.Create(self); @@ -224,12 +280,6 @@ begin InitializeTreeview; end; -function TfpgSelectDirDialog.SelectedDir: TfpgString; -begin - Result := ''; - if tv.Selection <> nil then - Result := GetAbsolutePath(tv.Selection); -end; {$ENDIF read_implementation} diff --git a/uidesigner/icon_16.png b/uidesigner/icon_16.png Binary files differnew file mode 100644 index 00000000..d19b0e1b --- /dev/null +++ b/uidesigner/icon_16.png diff --git a/uidesigner/icon_32.png b/uidesigner/icon_32.png Binary files differnew file mode 100644 index 00000000..55ff5268 --- /dev/null +++ b/uidesigner/icon_32.png diff --git a/uidesigner/icons.inc b/uidesigner/icons.inc index b52534f6..20efd4dd 100644 --- a/uidesigner/icons.inc +++ b/uidesigner/icons.inc @@ -1946,9 +1946,9 @@ Const 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, - 255,255, 0, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0, - 255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, - 0,255, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0,221,150,106,221,150,106,221,150,106,221,150,106, + 221,150,106,221,150,106,221,150,106,221,150,106,221,150,106,221,150, + 106,221,150,106, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2679,9 +2679,9 @@ Const 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, - 255,255, 0, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0, - 255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, - 0,255, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0,221,150,106,221,150,106,221,150,106,221,150,106, + 221,150,106,221,150,106,221,150,106,221,150,106,221,150,106,221,150, + 106,221,150,106, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2818,3 +2818,402 @@ Const 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, 255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_vfd_colorlistbox : Array[0..1397] of byte = ( + 66, 77,118, 5, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 21, 0, 0, 0, 21, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 64, 5, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, + 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, + 255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, 0,128, + 128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255, 0,229, 0,128,128,128,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 0, 0, 0,200,208,212,200,208,212,200,208,212,200,208, + 212, 0, 0, 0,255, 0,229, 0,128,128,128,255,255,255, 54,177,119, + 54,177,119, 54,177,119,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, + 0, 0,255,255,255,128,128,128,128,128,128,200,208,212, 0, 0, 0, + 255, 0,229, 0,128,128,128,255,255,255, 54,177,119, 54,177,119, 54, + 177,119,255,255,255,255,255,255, 51, 49, 49, 51, 49, 49, 51, 49, 49, + 51, 49, 49, 51, 49, 49,255,255,255,255,255,255, 0, 0, 0,255,255, + 255, 0, 0, 0, 0, 0, 0,200,208,212, 0, 0, 0,255, 0,229, 0, + 128,128,128,255,255,255, 54,177,119, 54,177,119, 54,177,119,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255, + 255,255,255,200,208,212, 0, 0, 0,255, 0,229, 0,128,128,128,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255, 0,229, 0,128,128,128,188,187,189, 64, 64, + 255, 64, 64,255, 64, 64,255,188,187,189,188,187,189,188,187,189,188, + 187,189,188,187,189,188,187,189,188,187,189,188,187,189,188,187,189, + 0, 0, 0,255,255,255,200,208,212,255,255,255,200,208,212, 0, 0, + 0,255, 0,229, 0,128,128,128,188,187,189, 64, 64,255, 64, 64,255, + 64, 64,255,188,187,189,188,187,189, 51, 49, 49, 51, 49, 49, 51, 49, + 49, 51, 49, 49, 51, 49, 49, 51, 49, 49,188,187,189, 0, 0, 0,200, + 208,212,255,255,255,200,208,212,255,255,255, 0, 0, 0,255, 0,229, + 0,128,128,128,188,187,189, 64, 64,255, 64, 64,255, 64, 64,255,188, + 187,189,188,187,189,188,187,189,188,187,189,188,187,189,188,187,189, + 188,187,189,188,187,189,188,187,189, 0, 0, 0,255,255,255,200,208, + 212,255,255,255,200,208,212, 0, 0, 0,255, 0,229, 0,128,128,128, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255, 0, 0, 0,200,208,212,255,255,255,200,208,212, + 255,255,255, 0, 0, 0,255, 0,229, 0,128,128,128,255,255,255,255, + 74, 74,255, 74, 74,255, 74, 74,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255, 0, 0, 0,255,255,255,200,208,212,255,255,255,200,208,212, 0, + 0, 0,255, 0,229, 0,128,128,128,255,255,255,255, 74, 74,255, 74, + 74,255, 74, 74,255,255,255,255,255,255, 51, 49, 49, 51, 49, 49, 51, + 49, 49, 51, 49, 49,255,255,255,255,255,255,255,255,255, 0, 0, 0, + 200,208,212,255,255,255,200,208,212,255,255,255, 0, 0, 0,255, 0, + 229, 0,128,128,128,255,255,255,255, 74, 74,255, 74, 74,255, 74, 74, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255,200, + 208,212,255,255,255,200,208,212, 0, 0, 0,255, 0,229, 0,128,128, + 128,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255, 0,229, 0,128,128,128,255,255,255, + 115,170,255,115,170,255,115,170,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255, 0, 0, 0,200,208,212,200,208,212,200,208,212,200,208,212, + 0, 0, 0,255, 0,229, 0,128,128,128,255,255,255,115,170,255,115, + 170,255,115,170,255,255,255,255,255,255,255, 51, 49, 49, 51, 49, 49, + 51, 49, 49, 51, 49, 49, 51, 49, 49, 51, 49, 49,255,255,255, 0, 0, + 0,255,255,255, 0, 0, 0, 0, 0, 0,200,208,212, 0, 0, 0,255, + 0,229, 0,128,128,128,255,255,255,115,170,255,115,170,255,115,170, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255, + 128,128,128,128,128,128,200,208,212, 0, 0, 0,255, 0,229, 0,128, + 128,128,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255, + 255,255,200,208,212, 0, 0, 0,255, 0,229, 0,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255, 0,229, 0,255, 0,229,255, 0,229,255, 0,229, + 255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0, + 229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, + 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229,255, 0,229, + 255, 0,229, 0); + +Const + stdimg_vfd_editfilename : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,188,188,188,192,192,192, 0, 0, 0, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128, + 128,128,192,192,192,192,192,192,192,192,192,205,137, 89,205,137, 89, + 205,137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, 89,205,137, + 89,192,192,192,192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128,128,128,192,192,192,192,192,192,192,192,192,205,137, + 89,255,247,240,255,247,240,255,247,240,255,247,240,255,247,240,255, + 247,240,205,137, 89,192,192,192,192,192,192,192,192,192,192,192,192, + 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,192, + 192,192,205,137, 89,255,247,240,255,234,219,255,233,217,255,231,215, + 255,229,210,255,247,241,204,135, 87,192,192,192,192,192,192,192,192, + 192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192, + 192,192,192,192,192,192,205,137, 89,255,247,240,253,231,214,253,230, + 212,252,228,208,251,227,203,254,243,232,205,136, 88,192,192,192,192, + 192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128, + 128,192,192,192,192,192,192,192,192,192,205,137, 89,255,247,242,254, + 231,213,253,229,209,250,224,202,249,222,196,253,242,231,205,137, 89, + 192,192,192,194,194,194,194,194,194,192,192,192, 0, 0, 0, 0, 0, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,128,128,128,192,192,192,192,192,192,192,192,192,205,137, 89, + 254,247,241,252,228,209,251,226,204,249,221,196,246,215,187,250,239, + 228,205,137, 90,192,192,192,192,192,192,192,192,192,192,192,192, 0, + 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,192,192, + 192,205,137, 89,254,245,237,251,224,199,249,220,194,245,211,180,254, + 249,243,236,193,147,205,137, 89,190,190,191,192,192,192,192,192,192, + 192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192, + 192,192,193,193,193,205,137, 89,253,243,234,253,243,234,252,242,232, + 250,239,227,250,242,231,205,137, 89,219,223,223,192,192,192,192,192, + 192,195,195,195,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128, + 192,192,192,192,192,192,192,192,192,205,137, 89,205,137, 89,205,137, + 89,205,137, 89,205,137, 89,205,137, 89,219,223,223,219,223,223,192, + 192,192,192,192,192,197,197,197,192,192,192, 0, 0, 0, 0, 0, 0, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,128,128,128,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, 0, 0, + 0, 0, 0, 0,255, 0,255,128,128,128,255,255,255,255,255,255,255, + 255,255,255,255,255,128,128,128,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0, + 192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, + 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,221,150,106,221,150,106,221,150,106,221,150,106, + 221,150,106,221,150,106,221,150,106,221,150,106,221,150,106,221,150, + 106,221,150,106, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 0,255,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,192,192,192,255,255,255,192,192,192, + 0, 0, 0, 0, 0, 0,192,192,192,128,128,128,192,192,192,255,255, + 255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,192,192,192,255,255, + 255,192,192,192,192,192,192,192,192,192,192,192,192,128,128,128,192, + 192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192, + 192,192,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,192,192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_vfd_editdirectory : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,188,188,188,192,192,192, 0, 0, 0, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128, + 128,128,192,192,192,192,192,192,185,216,243, 59,144,219, 59,144,219, + 59,144,219, 59,144,219, 59,144,219, 59,144,219, 59,144,219, 59,144, + 219,163,203,239,192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128,128,128,192,192,192,192,192,192, 59,144,219,224,242, + 251,158,219,244,150,218,243,134,215,243,127,212,242,121,211,242,108, + 208,241,105,207,241, 59,144,219,192,192,192,192,192,192,192,192,192, + 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, 59, + 144,219,242,250,253,164,233,249,149,230,248,118,222,246,101,219,245, + 87,215,244, 59,209,242, 48,206,241, 59,144,219,192,192,192,192,192, + 192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192, + 192,192,192, 59,144,219,246,252,254,185,239,251,172,236,250,139,227, + 247,124,224,246,108,220,246, 79,214,244, 68,211,243, 59,144,219,192, + 192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128, + 128,192,192,192,192,192,192, 59,144,219,254,255,255, 59,144,219, 59, + 144,219,115,193,233,148,230,248,133,227,247,104,219,245, 92,216,244, + 59,144,219,194,194,194,194,194,194,192,192,192, 0, 0, 0, 0, 0, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,128,128,128,192,192,192,192,192,192, 59,144,219,232,246,251, + 136,206,238,115,193,233, 59,144,219, 59,144,219, 59,144,219, 59,144, + 219, 59,144,219, 59,144,219,192,192,192,192,192,192,192,192,192, 0, + 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, 59,144, + 219,247,252,254,145,222,245,159,224,245,239,251,254,244,253,254,243, + 252,254,239,251,254,238,251,254, 59,144,219,192,192,192,192,192,192, + 192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192, + 192,192, 59,144,219,253,254,254,254,254,255,253,254,255,234,247,251, + 59,144,219, 59,144,219, 59,144,219, 59,144,219,202,235,245,192,192, + 192,195,195,195,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128, + 192,192,192,192,192,192,185,216,243, 59,144,219, 59,144,219, 59,144, + 219, 59,144,219,219,223,223,219,223,223,219,223,223,219,223,223,219, + 223,223,192,192,192,197,197,197,192,192,192, 0, 0, 0, 0, 0, 0, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,128,128,128,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, 0, 0, + 0, 0, 0, 0,255, 0,255,128,128,128,255,255,255,255,255,255,255, + 255,255,255,255,255,128,128,128,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0, + 192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, + 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,221,150,106,221,150,106,221,150,106,221,150,106, + 221,150,106,221,150,106,221,150,106,221,150,106,221,150,106,221,150, + 106,221,150,106, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 0,255,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,192,192,192,255,255,255,192,192,192, + 0, 0, 0, 0, 0, 0,192,192,192,128,128,128,192,192,192,255,255, + 255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,192,192,192,255,255, + 255,192,192,192,192,192,192,192,192,192,192,192,192,128,128,128,192, + 192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192, + 192,192,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,192,192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_vfd_editfont : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,188,188,188,192,192,192, 0, 0, 0, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128, + 128,128,192,192,192,192,192,192,192,192,192,192,192,192,109,109,109, + 85, 85, 85, 88, 88, 88,152,152,152,192,192,192,148,148,148, 55, 55, + 55,145,145,145,192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128,128,128,192,192,192,192,192,192,192,192,192,192,192, + 192,161,161,161, 64, 64, 64,121,121,121,192,192,192,192,192,192,192, + 192,192, 17, 17, 17,192,192,192,192,192,192,192,192,192,192,192,192, + 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,192, + 192,192,192,192,192,163,163,163, 72, 72, 72,126,126,126,192,192,192, + 192,192,192,192,192,192, 24, 24, 24,192,192,192,192,192,192,192,192, + 192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192, + 192,192,192,192,192,192,192,192,192,166,166,166, 80, 80, 80,130,130, + 130,192,192,192,147,147,147,192,192,192, 32, 32, 32,192,192,192,137, + 137,137,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128, + 128,192,192,192,192,192,192,192,192,192,192,192,192,168,168,168, 88, + 88, 88,135,135,135,192,192,192,117,117,117, 94, 94, 94, 41, 41, 41, + 92, 92, 92, 87, 87, 87,194,194,194,192,192,192, 0, 0, 0, 0, 0, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,128,128,128,192,192,192,192,192,192,168,168,168,192,192,192, + 169,169,169, 95, 95, 95,139,139,139,192,192,192,177,177,177,175,175, + 175,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, 0, + 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,132,132, + 132,178,178,178,171,171,171,101,101,101,143,143,143,192,192,192, 99, + 99, 99,161,161,161,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192, + 192,192,137,137,137,137,137,137,149,149,149,130,130,130,136,136,136, + 125,125,125, 93, 93, 93,192,192,192,192,192,192,192,192,192,192,192, + 192,195,195,195,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,197,197,197,192,192,192, 0, 0, 0, 0, 0, 0, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,128,128,128,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, 0, 0, + 0, 0, 0, 0,255, 0,255,128,128,128,255,255,255,255,255,255,255, + 255,255,255,255,255,128,128,128,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0, + 192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, + 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,221,150,106,221,150,106,221,150,106,221,150,106, + 221,150,106,221,150,106,221,150,106,221,150,106,221,150,106,221,150, + 106,221,150,106, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 0,255,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,192,192,192,255,255,255,192,192,192, + 0, 0, 0, 0, 0, 0,192,192,192,128,128,128,192,192,192,255,255, + 255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,192,192,192,255,255, + 255,192,192,192,192,192,192,192,192,192,192,192,192,128,128,128,192, + 192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192, + 192,192,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,192,192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + diff --git a/uidesigner/images/checkdateedit.bmp b/uidesigner/images/checkdateedit.bmp Binary files differnew file mode 100644 index 00000000..1cec0503 --- /dev/null +++ b/uidesigner/images/checkdateedit.bmp diff --git a/uidesigner/images/colorlistbox.bmp b/uidesigner/images/colorlistbox.bmp Binary files differnew file mode 100644 index 00000000..1cd703d7 --- /dev/null +++ b/uidesigner/images/colorlistbox.bmp diff --git a/uidesigner/images/dateedit.bmp b/uidesigner/images/dateedit.bmp Binary files differindex 7e075c10..79cf0234 100644 --- a/uidesigner/images/dateedit.bmp +++ b/uidesigner/images/dateedit.bmp diff --git a/uidesigner/images/editbutton.bmp b/uidesigner/images/editbutton.bmp Binary files differnew file mode 100644 index 00000000..b543260d --- /dev/null +++ b/uidesigner/images/editbutton.bmp diff --git a/uidesigner/images/editdirectory.bmp b/uidesigner/images/editdirectory.bmp Binary files differnew file mode 100644 index 00000000..eaf064e1 --- /dev/null +++ b/uidesigner/images/editdirectory.bmp diff --git a/uidesigner/images/editfilename.bmp b/uidesigner/images/editfilename.bmp Binary files differnew file mode 100644 index 00000000..abdf0c82 --- /dev/null +++ b/uidesigner/images/editfilename.bmp diff --git a/uidesigner/images/editfont.bmp b/uidesigner/images/editfont.bmp Binary files differnew file mode 100644 index 00000000..6fde0715 --- /dev/null +++ b/uidesigner/images/editfont.bmp diff --git a/uidesigner/images/listbox.bmp b/uidesigner/images/listbox.bmp Binary files differnew file mode 100644 index 00000000..f0f2b151 --- /dev/null +++ b/uidesigner/images/listbox.bmp diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index 20324e95..b974d262 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -224,7 +224,7 @@ begin FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.close'; - ModalResult := 1; + ModalResult := mrOK; TabOrder := 2; end; @@ -403,7 +403,7 @@ begin begin Name := 'setmenu'; SetPosition(464, 29, 120, 20); - AddMenuItem('General options ...', '', @(maindsgn.OnOptionsClick)); + AddMenuItem('General options...', '', @(maindsgn.OnOptionsClick)); end; miOpenRecentMenu := TfpgPopupMenu.Create(self); @@ -418,8 +418,8 @@ begin begin Name := 'helpmenu'; SetPosition(328, 52, 120, 20); - AddMenuItem('Product Information', '', @miHelpAboutClick); - AddMenuItem('About fpGUI', '', @miHelpAboutGUI); + AddMenuItem('About fpGUI Toolkit...', '', @miHelpAboutGUI); + AddMenuItem('Product Information...', '', @miHelpAboutClick); end; previewmenu := TfpgPopupMenu.Create(self); @@ -839,6 +839,8 @@ begin NameDrag := False else inherited; + if (Editor <> nil) and (Editor.Visible) then + Editor.SetFocus; end; procedure TwgPropertyList.HandleMouseScroll(x, y: integer; @@ -908,8 +910,7 @@ end; procedure TfrmMain.miHelpAboutGUI(Sender: TObject); begin - ShowMessage('This product was created using ' + fpGUIName + ' v' + - fpGUIVersion, 'About fpGUI'); + TfpgMessageDialog.AboutFPGui; end; procedure TfrmMain.miMRUClick(Sender: TObject; const FileName: string); diff --git a/uidesigner/uidesigner.lpi b/uidesigner/uidesigner.lpi index ec91edc2..597c7e3c 100644 --- a/uidesigner/uidesigner.lpi +++ b/uidesigner/uidesigner.lpi @@ -10,7 +10,6 @@ <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> - <Title Value="uiDesigner"/> </General> <VersionInfo> <ProjectVersion Value=""/> @@ -23,7 +22,7 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication Use="True" PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -114,14 +113,23 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> <Parsing> <SyntaxOptions> <AllowLabel Value="False"/> <CPPInline Value="False"/> + <UseAnsiStrings Value="True"/> </SyntaxOptions> </Parsing> + <CodeGeneration> + <Optimizations> + <OptimizationLevel Value="0"/> + </Optimizations> + </CodeGeneration> <Other> - <CustomOptions Value="-FUunits + <CustomOptions Value=" "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas index 992815cc..5405b9bb 100644 --- a/uidesigner/vfddesigner.pas +++ b/uidesigner/vfddesigner.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -82,9 +82,11 @@ type TFormDesigner = class(TObject) + private + FOneClickMove: boolean; protected FWidgets: TList; - FForm: TDesignedForm; + FForm: TfpgForm; FFormOther: string; FDragging: boolean; FDragPosX, @@ -101,7 +103,6 @@ type procedure MsgActivate(var msg: TfpgMessageRec); message FPGM_ACTIVATE; procedure DesignerKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); public - OneClickMove: boolean; // the widgets can be selected and dragged within one click constructor Create; destructor Destroy; override; procedure ClearForm; @@ -130,7 +131,9 @@ type function GetFormSourceDecl: string; function GetFormSourceImpl: string; function GetWidgetSourceImpl(wd: TWidgetDesigner; ident: string): string; - property Form: TDesignedForm read FForm; + // The widgets can be selected and dragged within one click + property OneClickMove: boolean read FOneClickMove write FOneClickMove; + property Form: TfpgForm read FForm; property FormOther: string read FFormOther write FFormOther; end; @@ -158,6 +161,7 @@ begin Widget.MouseCursor := mcDefault; for n := 1 to 8 do + begin if FSelected then resizer[n] := TwgResizer.Create(self, n) else @@ -166,6 +170,7 @@ begin resizer[n].Free; resizer[n] := nil; end; + end; UpdateResizerPositions; @@ -178,6 +183,7 @@ constructor TWidgetDesigner.Create(AFormDesigner: TFormDesigner; wg: TfpgWidget; var n: integer; begin + inherited Create; FFormDesigner := AFormDesigner; FWidget := wg; FVFDClass := wgc; @@ -450,7 +456,7 @@ begin FWidgets := TList.Create; FWasDrag := False; - OneClickMove := True; + FOneClickMove := True; FForm := TDesignedForm.Create(nil); FForm.FormDesigner := self; @@ -502,9 +508,8 @@ begin // writeln('TFormDesigner.AddWidget'); cd := TWidgetDesigner.Create(self, wg, wgc); FWidgets.Add(cd); - //cd.Selected := true; - if wg is TDesignedForm then - TDesignedForm(wg).FormDesigner := self; + if wg is TfpgForm then + wg.FormDesigner := self; Result := cd; end; @@ -671,7 +676,7 @@ begin if fi <= frm.list.ItemCount then frm.list.FocusItem := fi; - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then begin for n := 0 to FWidgets.Count - 1 do TWidgetDesigner(FWidgets.Items[n]).Widget.Visible := False; @@ -742,7 +747,7 @@ begin if fi <= frm.list.ItemCount then frm.list.FocusItem := fi; - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then begin taborder := 1; for n := 0 to frm.List.Items.Count - 1 do @@ -1046,7 +1051,7 @@ begin end; posval := -9999; - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then posval := StrToIntDef(frm.edPos.Text, -9999); frm.Free; @@ -1149,7 +1154,6 @@ begin Result := newname; end; - procedure TFormDesigner.MsgActivate(var msg: TfpgMessageRec); begin msg.Stop := True; @@ -1219,7 +1223,15 @@ begin } s := s + ' WindowTitle := ' + QuotedStr(FForm.WindowTitle) + ';' + LineEnding; - // ShowHint property - This is ugly, Form's properties or not handled well!! + // Hint property - This is ugly, Form's properties are not handled well!! + PropInfo := GetPropInfo(FForm.ClassType, 'Hint'); + t := GetStrProp(FForm, 'Hint'); + if IsStoredProp(FForm, PropInfo) then + begin + s := s + ' Hint := ' + 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'); if IsStoredProp(FForm, PropInfo) then @@ -1410,7 +1422,7 @@ begin //frmie.Top := ay; frmie.edItems.Lines.Assign(sl); - if frmie.ShowModal = 1 then + if frmie.ShowModal = mrOK then begin // Writeln('OK'); sl.Assign(frmie.edItems.Lines); @@ -1456,7 +1468,7 @@ begin cfrm := TInsertCustomForm.Create(nil); cfrm.edName.Text := GenerateNewName(wgc.NameBase); cfrm.edClass.Text := 'Tfpg'; - if cfrm.ShowModal = 1 then + if cfrm.ShowModal = mrOK then begin newname := cfrm.edName.Text; newClassName := cfrm.edClass.Text; @@ -1476,8 +1488,8 @@ begin if wgc.WidgetClass = TOtherWidget then TOtherWidget(wg).wgClassName := newclassname; wgd := AddWidget(wg, wgc); - wg.Visible := True; wg.SetPosition(x, y, wg.Width, wg.Height); + wg.Visible := True; DeSelectAll; wgd.Selected := True; UpdatePropWin; diff --git a/uidesigner/vfdeditors.pas b/uidesigner/vfdeditors.pas index 9e65245f..50acb0d5 100644 --- a/uidesigner/vfdeditors.pas +++ b/uidesigner/vfdeditors.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -73,8 +73,8 @@ begin btnClear := CreateButton(self, 8, 200, 80, 'Clear', @btnClearClicked); btnClear.Anchors := [anLeft, anBottom]; - btnOK := CreateButton(self, btnClear.Right + 4, 200, 80, 'OK', @OnButtonClick); - btnOK.Anchors := [anLeft, anBottom]; + btnOK := CreateButton(self, Width-168, 200, 80, 'OK', @OnButtonClick); + btnOK.Anchors := [anRight, anBottom]; btnCancel := CreateButton(self, Width-84, 200, 80, 'Cancel', @OnButtonClick); btnCancel.Anchors := [anRight, anBottom]; diff --git a/uidesigner/vfdfile.pas b/uidesigner/vfdfile.pas index 043a7fa1..ea7bf268 100644 --- a/uidesigner/vfdfile.pas +++ b/uidesigner/vfdfile.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -58,7 +58,7 @@ type procedure AddNewFormImpl(formname, formbody: string); function FindFormBlock(blockid, formname: string): TVFDFileBlock; procedure SetFormData(formname, headblock, bodyblock: string); - procedure NewFileSkeleton(unitname: string); + procedure NewFileSkeleton(AUnitname: string); end; @@ -323,10 +323,10 @@ begin Result := rs; end; -procedure TVFDFile.NewFileSkeleton(unitname: string); +procedure TVFDFile.NewFileSkeleton(AUnitname: string); begin FFileData := - 'unit ' + unitname + ';'+ LineEnding + LineEnding + + 'unit ' + AUnitname + ';'+ LineEnding + LineEnding + '{$mode objfpc}{$H+}' + LineEnding + LineEnding + 'interface' + LineEnding + LineEnding + 'uses' + LineEnding + diff --git a/uidesigner/vfdformparser.pas b/uidesigner/vfdformparser.pas index 71de141d..e08d9ce2 100644 --- a/uidesigner/vfdformparser.pas +++ b/uidesigner/vfdformparser.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/uidesigner/vfdforms.pas b/uidesigner/vfdforms.pas index 3fcbc62e..ec60265d 100644 --- a/uidesigner/vfdforms.pas +++ b/uidesigner/vfdforms.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -33,7 +33,8 @@ uses fpg_listbox, fpg_combobox, fpg_trackbar, - fpg_checkbox; + fpg_checkbox, + fpg_panel; type @@ -114,12 +115,16 @@ type btnCancel: TfpgButton; lblRecentFiles: TfpgLabel; tbMRUFileCount: TfpgTrackBar; - cbFullPath: TfpgCheckBox; + chkFullPath: TfpgCheckBox; lblName1: TfpgLabel; lblName2: TfpgLabel; - eDefaultExt: TfpgEdit; + edtDefaultExt: TfpgEdit; lblName3: TfpgLabel; - cbUndoOnExit: TfpgCheckBox; + chkUndoOnExit: TfpgCheckBox; + chkOneClick: TfpgCheckBox; + Bevel1: TfpgBevel; + Bevel2: TfpgBevel; + Bevel3: TfpgBevel; {@VFD_HEAD_END: frmVFDSetup} procedure AfterCreate; override; procedure BeforeDestruction; override; @@ -159,9 +164,9 @@ end; procedure TInsertCustomForm.OnButtonClick(Sender: TObject); begin if Sender = btnOK then - ModalResult := 1 + ModalResult := mrOK else - ModalResult := 2; + ModalResult := mrCancel; end; { TNewFormForm } @@ -191,9 +196,9 @@ end; procedure TNewFormForm.OnButtonClick(Sender: TObject); begin if Sender = btnOK then - ModalResult := 1 + ModalResult := mrOK else - ModalResult := 2; + ModalResult := mrCancel; end; { TEditPositionForm } @@ -224,9 +229,9 @@ end; procedure TEditPositionForm.OnButtonClick(Sender: TObject); begin if Sender = btnOK then - ModalResult := 1 + ModalResult := mrOK else - ModalResult := 2; + ModalResult := mrCancel; end; { TWidgetOrderForm } @@ -251,6 +256,7 @@ begin Name := 'WidgetOrderForm'; SetPosition(534, 173, 312, 258); WindowTitle := 'Widget order'; + Hint := ''; WindowPosition := wpScreenCenter; l1 := TfpgLabel.Create(self); @@ -259,6 +265,7 @@ begin Name := 'l1'; SetPosition(4, 4, 108, 16); FontDesc := '#Label1'; + Hint := ''; Text := 'Form widget order:'; end; @@ -269,6 +276,9 @@ begin SetPosition(4, 24, 220, 228); Anchors := [anLeft,anRight,anTop,anBottom]; FontDesc := '#List'; + Hint := ''; + HotTrack := False; + PopupFrame := False; TabOrder := 1; end; @@ -280,6 +290,7 @@ begin Anchors := [anRight,anTop]; Text := 'OK'; FontDesc := '#Label1'; + Hint := ''; ImageName := 'stdimg.ok'; TabOrder := 2; OnClick := @OnButtonClick; @@ -293,6 +304,7 @@ begin Anchors := [anRight,anTop]; Text := 'Cancel'; FontDesc := '#Label1'; + Hint := ''; ImageName := 'stdimg.cancel'; TabOrder := 3; OnClick := @OnButtonClick; @@ -306,6 +318,7 @@ begin Anchors := [anRight,anTop]; Text := 'Up'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 4; OnClick := @OnButtonClick; @@ -319,6 +332,7 @@ begin Anchors := [anRight,anTop]; Text := 'Down'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 5; OnClick := @OnButtonClick; @@ -350,9 +364,9 @@ var begin if Sender = btnOK then - ModalResult := 1 + ModalResult := mrOK else if Sender = btnCancel then - ModalResult := 2 + ModalResult := mrCancel else begin // up / down @@ -408,8 +422,8 @@ procedure TVFDDialog.HandleKeyPress(var keycode: word; var shiftstate: TShiftSta begin if keycode = keyEscape then begin - ModalResult := 2; consumed := True; + ModalResult := mrCancel; end; inherited HandleKeyPress(keycode, shiftstate, consumed); end; @@ -418,41 +432,45 @@ procedure TfrmVFDSetup.LoadSettings; begin chlGrid.FocusItem := gINI.ReadInteger('Options', 'GridResolution', 2); tbMRUFileCount.Position := gINI.ReadInteger('Options', 'MRUFileCount', 4); - cbFullPath.Checked := gINI.ReadBool('Options', 'ShowFullPath', True); - eDefaultExt.Text := gINI.ReadString('Options', 'DefaultFileExt', '.pas'); - cbUndoOnExit.Checked := gINI.ReadBool('Options', 'UndoOnExit', UndoOnPropExit); + chkFullPath.Checked := gINI.ReadBool('Options', 'ShowFullPath', True); + edtDefaultExt.Text := gINI.ReadString('Options', 'DefaultFileExt', '.pas'); + chkUndoOnExit.Checked := gINI.ReadBool('Options', 'UndoOnExit', UndoOnPropExit); + chkOneClick.Checked := gINI.ReadBool('Options', 'OneClickMove', True); end; procedure TfrmVFDSetup.SaveSettings; begin gINI.WriteInteger('Options', 'GridResolution', chlGrid.FocusItem); gINI.WriteInteger('Options', 'MRUFileCount', tbMRUFileCount.Position); - gINI.WriteBool('Options', 'ShowFullPath', cbFullPath.Checked); - gINI.WriteString('Options', 'DefaultFileExt', eDefaultExt.Text); - gINI.WriteBool('Options', 'UndoOnExit', cbUndoOnExit.Checked); + gINI.WriteBool('Options', 'ShowFullPath', chkFullPath.Checked); + gINI.WriteString('Options', 'DefaultFileExt', edtDefaultExt.Text); + gINI.WriteBool('Options', 'UndoOnExit', chkUndoOnExit.Checked); + gINI.WriteBool('Options', 'OneClickMove', chkOneClick.Checked); end; procedure TfrmVFDSetup.btnOKClick(Sender: TObject); begin SaveSettings; - ModalResult := 1; + ModalResult := mrOK; end; procedure TfrmVFDSetup.AfterCreate; begin {@VFD_BODY_BEGIN: frmVFDSetup} Name := 'frmVFDSetup'; - SetPosition(394, 399, 253, 225); + SetPosition(392, 386, 398, 283); WindowTitle := 'General settings'; + Hint := ''; WindowPosition := wpScreenCenter; - gINI.ReadFormState(self); + gINI.ReadFormState(self); // after form created but before creating widgets lb1 := TfpgLabel.Create(self); with lb1 do begin Name := 'lb1'; - SetPosition(28, 28, 116, 16); + SetPosition(28, 32, 112, 16); FontDesc := '#Label1'; + Hint := ''; Text := 'Grid resolution:'; end; @@ -460,8 +478,9 @@ begin with chlGrid do begin Name := 'chlGrid'; - SetPosition(140, 24, 88, 22); + SetPosition(144, 28, 88, 22); FontDesc := '#List'; + Hint := ''; Items.Add('1'); Items.Add('4'); Items.Add('8'); @@ -473,10 +492,11 @@ begin with btnOK do begin Name := 'btnOK'; - SetPosition(93, 195, 75, 24); + SetPosition(238, 253, 75, 24); Anchors := [anRight,anBottom]; Text := 'OK'; FontDesc := '#Label1'; + Hint := ''; ImageName := 'stdimg.ok'; TabOrder := 6; OnClick := @btnOKClick; @@ -486,12 +506,13 @@ begin with btnCancel do begin Name := 'btnCancel'; - SetPosition(172, 195, 75, 24); + SetPosition(317, 253, 75, 24); Anchors := [anRight,anBottom]; Text := 'Cancel'; FontDesc := '#Label1'; + Hint := ''; ImageName := 'stdimg.cancel'; - ModalResult := -1; + ModalResult := mrCancel; TabOrder := 7; end; @@ -499,8 +520,9 @@ begin with lblRecentFiles do begin Name := 'lblRecentFiles'; - SetPosition(28, 92, 124, 16); + SetPosition(28, 132, 124, 16); FontDesc := '#Label1'; + Hint := ''; Text := 'Recent files count:'; end; @@ -508,7 +530,8 @@ begin with tbMRUFileCount do begin Name := 'tbMRUFileCount'; - SetPosition(156, 84, 76, 30); + SetPosition(156, 124, 76, 30); + Hint := ''; Max := 10; Min := 2; Position := 4; @@ -516,12 +539,13 @@ begin TabOrder := 3; end; - cbFullPath := TfpgCheckBox.Create(self); - with cbFullPath do + chkFullPath := TfpgCheckBox.Create(self); + with chkFullPath do begin - Name := 'cbFullPath'; - SetPosition(24, 112, 204, 20); + Name := 'chkFullPath'; + SetPosition(24, 156, 204, 20); FontDesc := '#Label1'; + Hint := ''; TabOrder := 4; Text := 'Show the full file path'; end; @@ -532,6 +556,7 @@ begin Name := 'lblName1'; SetPosition(8, 8, 176, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Form designer'; end; @@ -539,16 +564,18 @@ begin with lblName2 do begin Name := 'lblName2'; - SetPosition(8, 72, 232, 16); + SetPosition(8, 108, 232, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Open Recent menu settings'; end; - eDefaultExt := TfpgEdit.Create(self); - with eDefaultExt do + edtDefaultExt := TfpgEdit.Create(self); + with edtDefaultExt do begin - Name := 'eDefaultExt'; - SetPosition(28, 160, 68, 22); + Name := 'edtDefaultExt'; + SetPosition(28, 216, 68, 24); + Hint := ''; TabOrder := 5; Text := ''; FontDesc := '#Edit1'; @@ -558,21 +585,65 @@ begin with lblName3 do begin Name := 'lblName3'; - SetPosition(12, 140, 152, 16); + SetPosition(12, 192, 152, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Default file extension'; end; - cbUndoOnExit := TfpgCheckBox.Create(self); - with cbUndoOnExit do + chkUndoOnExit := TfpgCheckBox.Create(self); + with chkUndoOnExit do begin - Name := 'cbUndoOnExit'; - SetPosition(24, 48, 204, 18); + Name := 'chkUndoOnExit'; + SetPosition(24, 56, 204, 18); FontDesc := '#Label1'; + Hint := ''; TabOrder := 2; Text := 'Undo on property editor exit'; end; + chkOneClick := TfpgCheckBox.Create(self); + with chkOneClick do + begin + Name := 'chkOneClick'; + SetPosition(24, 76, 224, 20); + Checked := True; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 12; + Text := 'One click select and move'; + end; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(108, 4, 280, 14); + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + Bevel2 := TfpgBevel.Create(self); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(192, 104, 196, 14); + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + Bevel3 := TfpgBevel.Create(self); + with Bevel3 do + begin + Name := 'Bevel3'; + SetPosition(156, 188, 232, 14); + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + {@VFD_BODY_END: frmVFDSetup} LoadSettings; @@ -580,6 +651,8 @@ end; procedure TfrmVFDSetup.BeforeDestruction; begin + // We don't put this in SaveSettings because it needs to be called even if + // user cancels the dialog with btnCancel or ESC key press. gINI.WriteFormState(self); inherited BeforeDestruction; end; diff --git a/uidesigner/vfdmain.pas b/uidesigner/vfdmain.pas index 043d42ca..a6b8f0b2 100644 --- a/uidesigner/vfdmain.pas +++ b/uidesigner/vfdmain.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -24,6 +24,8 @@ interface uses Classes, SysUtils, + fpg_base, + fpg_main, fpg_widget, fpg_dialogs, vfdprops, @@ -33,7 +35,7 @@ uses newformdesigner; const - program_version = '0.7 beta'; + program_version = FPGUI_VERSION; type @@ -84,11 +86,11 @@ implementation uses vfdformparser, fpg_iniutils, - fpg_utils, - fpg_main; + fpg_utils; -Var +var DefaultPasExt : String = '.pas'; + OneClickMove: Boolean; { TMainDesigner } @@ -277,12 +279,13 @@ var nfrm: TNewFormForm; begin nfrm := TNewFormForm.Create(nil); - if nfrm.ShowModal = 1 then + if nfrm.ShowModal = mrOK then if nfrm.edName.Text <> '' then begin fd := TFormDesigner.Create; fd.Form.Name := nfrm.edName.Text; fd.Form.WindowTitle := nfrm.edName.Text; + fd.OneClickMove := OneClickMove; FDesigners.Add(fd); fd.Show; end; @@ -373,6 +376,7 @@ var begin fp := TVFDFormParser.Create(FormName, FormHead, FormBody); fd := fp.ParseForm; + fd.OneClickMove := OneClickMove; fp.Free; FDesigners.Add(fd); @@ -409,7 +413,7 @@ var begin frm := TfrmVFDSetup.Create(nil); try - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then begin LoadDefaults; frmMain.mru.MaxItems := gINI.ReadInteger('Options', 'MRUFileCount', 4); @@ -440,6 +444,7 @@ begin end; DefaultPasExt := gINI.ReadString('Options', 'DefaultFileExt', '.pas'); UndoOnPropExit := gINI.ReadBool('Options', 'UndoOnExit', DefUndoOnPropExit); + OneClickMove := gINI.ReadBool('Options', 'OneClickMove', True); fpgApplication.HintPause := 1000; end; diff --git a/uidesigner/vfdpropeditgrid.pas b/uidesigner/vfdpropeditgrid.pas index e9f0be4b..1a6944cb 100644 --- a/uidesigner/vfdpropeditgrid.pas +++ b/uidesigner/vfdpropeditgrid.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -227,7 +227,6 @@ begin Text := 'New'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; OnClick := @NewButtonClick; end; @@ -239,7 +238,6 @@ begin Text := 'Delete'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; OnClick := @DeleteButtonClick; end; @@ -251,7 +249,6 @@ begin Text := 'UP'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; OnClick := @UpDownButtonClick; end; @@ -263,7 +260,6 @@ begin Text := 'DOWN'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; OnClick := @UpDownButtonClick; end; @@ -275,7 +271,6 @@ begin Text := 'Close'; FontDesc := '#Label1'; ImageName := 'stdimg.close'; - ModalResult := 0; OnClick := @CloseButtonClick; end; diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas index 90dd29e4..687254ea 100644 --- a/uidesigner/vfdprops.pas +++ b/uidesigner/vfdprops.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -115,6 +115,7 @@ type procedure StoreStrValue(wg: TfpgWidget); procedure LoadFloatValue(wg: TfpgWidget); procedure StoreFloatValue(wg: TfpgWidget); + procedure SetFocus; override; end; @@ -124,6 +125,7 @@ type procedure CreateLayout; override; procedure LoadValue(wg: TfpgWidget); override; procedure StoreValue(wg: TfpgWidget); override; + procedure SetFocus; override; end; @@ -173,7 +175,7 @@ begin frm := TItemEditorForm.Create(nil); try frm.edItems.Lines.Assign(sl); - if frm.ShowModal = 1 then + if frm.ShowModal = mrOK then sl.Assign(frm.edItems.Lines); finally frm.Free; @@ -398,6 +400,11 @@ begin end; end; +procedure TGeneralPropertyEditor.SetFocus; +begin + Edit.SetFocus; +end; + procedure TGeneralPropertyEditor.StoreValue(wg: TfpgWidget); begin case etype of @@ -692,6 +699,11 @@ begin SetEnumProp(wg, prop.Name, chl.Text); end; +procedure TChoicePropertyEditor.SetFocus; +begin + chl.SetFocus; +end; + { TBooleanPropertyEditor } procedure TBooleanPropertyEditor.LoadValue(wg: TfpgWidget); diff --git a/uidesigner/vfdresizer.pas b/uidesigner/vfdresizer.pas index 03e83618..657746b6 100644 --- a/uidesigner/vfdresizer.pas +++ b/uidesigner/vfdresizer.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -98,8 +98,8 @@ begin wgd := TWidgetDesigner(wgdesigner); gridc := maindsgn.GridResolution; - dx := dx - dx mod gridc; - dy := dy - dy mod gridc; + dx := dx - (dx mod gridc); + dy := dy - (dy mod gridc); case direction of 1: wgd.Widget.MoveAndResizeBy(dx, dy, -dx, -dy); @@ -134,7 +134,6 @@ begin 7: MouseCursor := mcSizeNESW; // bottom left 8: MouseCursor := mcSizeEW; // left end; - Visible := True; end; procedure TwgResizer.Show; diff --git a/uidesigner/vfdutils.pas b/uidesigner/vfdutils.pas index 851cd518..14b1c561 100644 --- a/uidesigner/vfdutils.pas +++ b/uidesigner/vfdutils.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/uidesigner/vfdwidgetclass.pas b/uidesigner/vfdwidgetclass.pas index 0fe62171..059aaf79 100644 --- a/uidesigner/vfdwidgetclass.pas +++ b/uidesigner/vfdwidgetclass.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -47,6 +47,7 @@ type procedure CreateLayout; virtual; procedure LoadValue(wg: TfpgWidget); virtual; procedure StoreValue(wg: TfpgWidget); virtual; + procedure SetFocus; virtual; end; @@ -96,7 +97,7 @@ uses type // used to get to SetDesigning() in Form Designer - TComponentFriendClass = class(TComponent); + TWidgetFriendClass = class(TfpgWidget); { TVFDWidgetClass } @@ -122,7 +123,7 @@ end; function TVFDWidgetClass.CreateWidget(AOwner: TComponent): TfpgWidget; begin Result := WidgetClass.Create(AOwner); - TComponentFriendClass(Result).SetDesigning(True); + TWidgetFriendClass(Result).SetDesigning(True); end; function TVFDWidgetClass.CreatePopupMenu(AWidget: TfpgWidget): TfpgPopupMenu; @@ -239,5 +240,10 @@ begin // if PPropInfo^.PropType^.name = end; +procedure TVFDPropertyEditor.SetFocus; +begin + // do nothing +end; + end. diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas index 61b56dec..654abf5f 100644 --- a/uidesigner/vfdwidgets.pas +++ b/uidesigner/vfdwidgets.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2009 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -63,6 +63,7 @@ uses fpg_tab, fpg_popupcalendar, fpg_gauge, + fpg_editbtn, vfdpropeditgrid, vfdmain; @@ -94,7 +95,7 @@ function TVFDPageControlWidgetClass.CreatePopupMenu(AWidget: TfpgWidget): TfpgPo begin FWidget := TfpgPageControl(AWidget); Result := TfpgPopupMenu.Create(nil); - { TODO : These are disabled for now, because a TabSheet component is used + { TODO : These are disabled for now, because a TabSheet component are used instead of a menu item - for adding tabs. } Result.AddMenuItem('Add Tab', '', @AddTabSClicked).Enabled := False; Result.AddMenuItem('Delete Tab', '', @DeleteTabClicked).Enabled := False; @@ -164,6 +165,12 @@ begin 0, 0); fpgImages.AddMaskedBMP( + 'vfd.colorlistbox', @stdimg_vfd_colorlistbox, + sizeof(stdimg_vfd_colorlistbox), + 0, 0); + + + fpgImages.AddMaskedBMP( 'vfd.combobox', @stdimg_vfd_combobox, sizeof(stdimg_vfd_combobox), 0, 0); @@ -273,6 +280,20 @@ begin sizeof(stdimg_vfd_combodatecheckedit), 0, 0); + fpgImages.AddMaskedBMP( + 'vfd.editfilename', @stdimg_vfd_editfilename, + sizeof(stdimg_vfd_editfilename), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.editdirectory', @stdimg_vfd_editdirectory, + sizeof(stdimg_vfd_editdirectory), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.editfont', @stdimg_vfd_editfont, + sizeof(stdimg_vfd_editfont), + 0, 0); end; procedure AddWidgetPosProps(wgc: TVFDWidgetClass); @@ -293,6 +314,7 @@ begin wc.NameBase := 'frm'; wc.AddProperty('WindowTitle', TPropertyString, ''); // wc.AddProperty('WindowPosition', TPropertyEnum, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); FVFDFormWidget := wc; @@ -301,7 +323,7 @@ begin wc.NameBase := 'Label'; wc.AddProperty('Alignment', TPropertyEnum, 'Horizontal text alignment'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the label text'); - wc.AddProperty('Hint', TPropertyString, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Layout', TPropertyEnum, 'Vertical text layout'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); @@ -314,9 +336,15 @@ begin wc := TVFDWidgetClass.Create(TfpgEdit); wc.NameBase := 'Edit'; // wc.AddProperty('Color', TPropertyColor, 'Text color'); + wc.AddProperty('AutoSelect', TPropertyBoolean, 'On receiving focus, auto select text'); + wc.AddProperty('AutoSize', TPropertyBoolean, 'Change Height based on FontDesc being set'); + wc.AddProperty('BorderStyle', TPropertyEnum, ''); + wc.AddProperty('ExtraHint', TPropertyString, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('IgnoreMouseCursor', TPropertyBoolean, 'If True, then mouse pointer doesn''t change'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.WidgetIconName := 'vfd.edit'; @@ -325,6 +353,7 @@ begin // Memo wc := TVFDWidgetClass.Create(TfpgMemo); wc.NameBase := 'Memo'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Lines', TPropertyStringList, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -342,12 +371,12 @@ begin wc.AddProperty('Flat', TPropertyBoolean, 'Only draw button borders when mouse hovers over button'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); - wc.AddProperty('Hint', TPropertyString, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ImageLayout', TPropertyEnum, 'Which side of the button contains the image'); wc.AddProperty('ImageMargin', TPropertyInteger, 'Space between image and border, -1 centers image/text'); wc.AddProperty('ImageName', TPropertyString, ''); wc.AddProperty('ImageSpacing', TPropertyInteger, 'Space between image and text, -1 centers text'); - wc.AddProperty('ModalResult', TPropertyInteger, ''); + wc.AddProperty('ModalResult', TPropertyEnum, 'Modal Result returned and overrides the OnClick event handler'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowImage', TPropertyBoolean, 'Boolean value'); @@ -360,6 +389,7 @@ begin wc.NameBase := 'CheckBox'; wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); 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'); @@ -373,6 +403,7 @@ begin wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); @@ -384,6 +415,7 @@ begin wc := TVFDWidgetClass.Create(TfpgComboBox); wc.NameBase := 'ComboBox'; wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Items', TPropertyStringList, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); @@ -396,6 +428,7 @@ begin wc.NameBase := 'CalendarCombo'; wc.AddProperty('DateFormat', TPropertyString, 'Standard RTL date formatting applies'); 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('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); @@ -409,6 +442,7 @@ begin wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); wc.AddProperty('DateFormat', TPropertyString, 'Standard RTL date formatting applies'); 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('WeekStartDay', TPropertyInteger, '0 = Sun, 1 = Mon, etc.'); @@ -419,7 +453,10 @@ begin // ListBox wc := TVFDWidgetClass.Create(TfpgListBox); wc.NameBase := 'ListBox'; + wc.AddProperty('AutoHeight', TPropertyBoolean, ''); + wc.Addproperty('DragToReorder', TPropertyBoolean, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('HotTrack', TPropertyBoolean, ''); wc.AddProperty('Items', TPropertyStringList, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -429,12 +466,30 @@ begin wc.WidgetIconName := 'vfd.listbox'; RegisterVFDWidget(wc); + // Color ListBox + wc := TVFDWidgetClass.Create(TfpgColorListBox); + wc.NameBase := 'ColorListBox'; + wc.AddProperty('AutoHeight', TPropertyBoolean, ''); + wc.AddProperty('ColorPalette', TPropertyEnum, ''); + wc.Addproperty('DragToReorder', TPropertyBoolean, ''); + wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('HotTrack', TPropertyBoolean, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('PopupFrame', TPropertyBoolean, ''); + wc.AddProperty('ShowColorNames', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.WidgetIconName := 'vfd.colorlistbox'; + RegisterVFDWidget(wc); + // StringGrid wc := TVFDWidgetClass.Create(TfpgStringGrid); wc.NameBase := 'Grid'; wc.AddProperty('Columns', TPropertyDBColumns, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('HeaderFontDesc', TPropertyFontDesc, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('RowCount', TPropertyInteger, ''); wc.AddProperty('RowSelect', TPropertyBoolean, ''); @@ -449,6 +504,8 @@ begin wc := TVFDWidgetClass.Create(TfpgBevel); wc.NameBase := 'Bevel'; wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); + wc.AddProperty('ParentBackgroundColor', TPropertyBoolean, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); wc.AddProperty('Shape', TPropertyEnum, 'Box, Frame, TopLine, Spacer etc..'); @@ -462,9 +519,11 @@ begin wc.NameBase := 'Panel'; wc.AddProperty('Alignment', TPropertyEnum, 'Text alignment'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Layout', TPropertyEnum, 'Layout of the caption'); wc.AddProperty('LineSpace', TPropertyInteger, 'Line spacing between wrapped caption'); wc.AddProperty('Margin', TPropertyInteger, 'Margin of text'); + wc.AddProperty('ParentBackgroundColor', TPropertyBoolean, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); @@ -480,6 +539,7 @@ begin wc.AddProperty('Alignment', TPropertyEnum, 'Text alignment'); wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Margin', TPropertyInteger, 'Margin of text'); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); @@ -492,6 +552,7 @@ begin // ProgressBar wc := TVFDWidgetClass.Create(TfpgProgressBar); wc.NameBase := 'ProgressBar'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Max', TPropertyInteger, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); @@ -504,6 +565,7 @@ begin // TrackBar wc := TVFDWidgetClass.Create(TfpgTrackBar); wc.NameBase := 'TrackBar'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Max', TPropertyInteger, ''); wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Orientation', TPropertyEnum, ''); @@ -518,6 +580,7 @@ begin // ListView wc := TVFDWidgetClass.Create(TfpgListView); wc.NameBase := 'ListView'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('MultiSelect', TPropertyBoolean, ''); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHeaders', TPropertyBoolean, ''); @@ -531,6 +594,7 @@ begin wc.NameBase := 'TreeView'; wc.AddProperty('DefaultColumnWidth',TPropertyInteger, ''); wc.AddProperty('FontDesc',TPropertyFontDesc, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ScrollWheelDelta', TPropertyInteger, 'Scroll amount with mouse wheel'); wc.AddProperty('ShowColumns',TPropertyBoolean, 'Boolean value'); @@ -546,6 +610,7 @@ begin wc.NameBase := 'PageControl'; wc.AddProperty('ActivePageIndex', TPropertyInteger, ''); wc.AddProperty('FixedTabWidth', TPropertyInteger, ''); + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('SortPages', TPropertyBoolean, 'Boolean value'); @@ -568,6 +633,7 @@ begin // Gauge wc := TVFDWidgetClass.Create(TfpgGauge); wc.NameBase := 'Gauge'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('Kind', TPropertyEnum, ''); wc.AddProperty('MinValue', TPropertyInteger, ''); wc.AddProperty('MaxValue', TPropertyInteger, ''); @@ -582,9 +648,11 @@ begin // Integer Edit wc := TVFDWidgetClass.Create(TfpgEditInteger); wc.NameBase := 'EditInteger'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); // wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); @@ -595,9 +663,11 @@ begin // Float Edit wc := TVFDWidgetClass.Create(TfpgEditFloat); wc.NameBase := 'EditFloat'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Value', TPropertyFloat, 'Initial value'); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); @@ -611,9 +681,11 @@ begin // Currency Edit wc := TVFDWidgetClass.Create(TfpgEditCurrency); wc.NameBase := 'EditCurrency'; + wc.AddProperty('Hint', TPropertyString, 'Tooltip hint'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ReadOnly', TPropertyBoolean, ''); wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Value', TPropertyFloat, 'Initial value'); wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); @@ -623,6 +695,72 @@ begin wc.WidgetIconName := 'vfd.editcurrency'; RegisterVFDWidget(wc); + { TODO : UI Designer still has problems with components that have child components. } + // Spin Edit + //wc := TVFDWidgetClass.Create(TfpgSpinEdit); + //wc.NameBase := 'SpinEdit'; + //wc.AddProperty('ButtonWidth', TPropertyInteger, 'Spin button width'); + //wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + //wc.Addproperty('Hint', TPropertyString, ''); + //wc.AddProperty('Increment', TPropertyInteger, 'Increment value on short press'); + //wc.AddProperty('LargeIncrement', TPropertyInteger, 'Large increment value on long press'); + //wc.AddProperty('MaxValue', TPropertyInteger, 'Maximum value'); + //wc.AddProperty('MinValue', TPropertyInteger, 'Minimum value'); + //wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + //wc.AddProperty('ShowHint', TPropertyBoolean, ''); + //wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + //wc.AddProperty('Value', TPropertyInteger, 'Initial value'); + //wc.WidgetIconName := 'vfd.editinteger'; + //RegisterVFDWidget(wc); + + // Spin Edit Float + //wc := TVFDWidgetClass.Create(TfpgSpinEditFloat); + //wc.NameBase := 'SpinEditFloat'; + //wc.AddProperty('ButtonWidth', TPropertyInteger, 'Spin button width'); + //wc.Addproperty('Decimals', TPropertyInteger, ''); + //wc.Addproperty('FixedDecimals', TPropertyBoolean, ''); + //wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + //wc.Addproperty('Hint', TPropertyString, ''); + //wc.AddProperty('Increment', TPropertyFloat, 'Increment value on short press'); + //wc.AddProperty('LargeIncrement', TPropertyFloat, 'Large increment value on long press'); + //wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + //wc.AddProperty('MaxValue', TPropertyFloat, 'Maximum value'); + //wc.AddProperty('MinValue', TPropertyFloat, 'Minimum value'); + //wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + //wc.AddProperty('ShowHint', TPropertyBoolean, ''); + //wc.AddProperty('Value', TPropertyFloat, 'Initial value'); + //wc.WidgetIconName := 'vfd.editfloat'; + //RegisterVFDWidget(wc); + + // Filename Edit + wc := TVFDWidgetClass.Create(TfpgFileNameEdit); + wc.NameBase := 'FilenameEdit'; + wc.AddProperty('ExtraHint', TPropertyString, ''); + wc.AddProperty('FileName', TPropertyString, 'Preset filename in edit component'); + wc.AddProperty('InitialDir', TPropertyString, 'Initial starting directory of the dialog'); + wc.AddProperty('Filter', TPropertyString, 'Filename filters used in the dialog'); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.WidgetIconName := 'vfd.editfilename'; + RegisterVFDWidget(wc); + + // Directory Edit + wc := TVFDWidgetClass.Create(TfpgDirectoryEdit); + wc.NameBase := 'DirectoryEdit'; + wc.AddProperty('ExtraHint', TPropertyString, ''); + wc.AddProperty('Directory', TPropertyString, 'Preset directory name in edit component'); + wc.AddProperty('RootDirectory', TPropertyString, 'Initial starting directory of the dialog'); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.WidgetIconName := 'vfd.editdirectory'; + RegisterVFDWidget(wc); + + // Font Edit + wc := TVFDWidgetClass.Create(TfpgFontEdit); + wc.NameBase := 'DirectoryEdit'; + wc.AddProperty('FontDesc', TPropertyString, 'Specify a preset font description'); + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.WidgetIconName := 'vfd.editfont'; + RegisterVFDWidget(wc); + // Other - do not delete!!! this should be the last... wc := TVFDWidgetClass.Create(TOtherWidget); wc.NameBase := 'Custom'; diff --git a/unittests/manual_tests/test_visible.lpi b/unittests/manual_tests/test_visible.lpi new file mode 100644 index 00000000..2c18ebde --- /dev/null +++ b/unittests/manual_tests/test_visible.lpi @@ -0,0 +1,74 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="None"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <Title Value="test_visible"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="test_visible.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="test_visible"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="True"/> + </SyntaxOptions> + </Parsing> + <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/unittests/manual_tests/test_visible.lpr b/unittests/manual_tests/test_visible.lpr new file mode 100644 index 00000000..6beb20d9 --- /dev/null +++ b/unittests/manual_tests/test_visible.lpr @@ -0,0 +1,291 @@ +{
+ Project to test the .Visible property of components.
+}
+program test_visible;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, SysUtils, fpg_main, fpg_form, fpg_edit, fpg_button, fpg_label,
+ fpg_memo, fpg_checkbox, fpg_radiobutton, fpg_widget, fpg_panel, fpg_menu;
+
+type
+
+ TMainForm = class(TfpgForm)
+ private
+ {@VFD_HEAD_BEGIN: MainForm}
+ Edit1: TfpgEdit;
+ Label1: TfpgLabel;
+ Button1: TfpgButton;
+ Memo1: TfpgMemo;
+ CheckBox1: TfpgCheckBox;
+ RadioButton1: TfpgRadioButton;
+ Panel1: TfpgPanel;
+ Edit2: TfpgEdit;
+ Label2: TfpgLabel;
+ CheckBox2: TfpgCheckBox;
+ Memo2: TfpgMemo;
+ MainMenu: TfpgMenuBar;
+ pmFile: TfpgPopupMenu;
+ {@VFD_HEAD_END: MainForm}
+ procedure FormShow(Sender: TObject);
+ procedure CheckboxChanged(Sender: TObject);
+ procedure miFileQuitClicked(Sender: TObject);
+ public
+ constructor Create(AOwner: TComponent); override;
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+
+
+{@VFD_NEWFORM_IMPL}
+
+var
+ { manage indentation level }
+ indent: integer = 0;
+
+{ Output component hierarchy and status of each component's Visible property }
+procedure PrintVisibleState(AComponent: TfpgWidget);
+var
+ i: integer;
+ { Create string equal to indentation level }
+ function Spaces: string;
+ var
+ j: integer;
+ begin
+ if indent = 0 then
+ exit;
+ for j := 1 to indent do
+ Result := Result + ' ';
+ end;
+
+begin
+ writeln(Spaces + AComponent.ClassName + ' - [parent]: ' + BoolToStr(AComponent.Visible, True));
+ Inc(indent, 2);
+ for i := 0 to AComponent.ComponentCount-1 do
+ begin
+ if AComponent.Components[i].ComponentCount > 0 then
+ PrintVisibleState(TfpgWidget(AComponent.Components[i]))
+ else
+ writeln(Spaces + AComponent.Components[i].ClassName + ': ' + BoolToStr(TfpgWidget(AComponent.Components[i]).Visible, True));
+ end;
+ dec(indent, 2);
+end;
+
+procedure TMainForm.FormShow(Sender: TObject);
+begin
+ writeln('DEBUG: TMainForm.FormShow >>');
+ PrintVisibleState(self);
+ writeln('DEBUG: TMainForm.FormShow <<');
+end;
+
+procedure TMainForm.CheckboxChanged(Sender: TObject);
+begin
+ writeln('Checkbox clicked...');
+ Edit1.Visible := CheckBox1.Checked;
+ Panel1.Visible := CheckBox1.Checked;
+ PrintVisibleState(self);
+end;
+
+procedure TMainForm.miFileQuitClicked(Sender: TObject);
+begin
+ Close;
+end;
+
+constructor TMainForm.Create(AOwner: TComponent);
+begin
+ writeln('DEBUG: TMainForm.Create >>');
+ inherited Create(AOwner);
+ OnShow := @FormShow;
+ writeln('DEBUG: TMainForm.Create <<');
+end;
+
+procedure TMainForm.AfterCreate;
+begin
+ {%region 'Auto-generated GUI code' -fold}
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(316, 186, 591, 250);
+ WindowTitle := 'Test Visible property';
+ Hint := '';
+
+ Edit1 := TfpgEdit.Create(self);
+ with Edit1 do
+ begin
+ Name := 'Edit1';
+ SetPosition(8, 28, 120, 24);
+ Hint := '';
+ TabOrder := 0;
+ Text := '';
+ FontDesc := '#Edit1';
+ Visible := False;
+ end;
+
+ Label1 := TfpgLabel.Create(self);
+ with Label1 do
+ begin
+ Name := 'Label1';
+ SetPosition(140, 152, 80, 16);
+ FontDesc := '#Label1';
+ Hint := '';
+ Text := 'Label';
+ end;
+
+ Button1 := TfpgButton.Create(self);
+ with Button1 do
+ begin
+ Name := 'Button1';
+ SetPosition(140, 28, 80, 24);
+ Text := 'Button';
+ FontDesc := '#Label1';
+ Hint := '';
+ ImageName := '';
+ TabOrder := 2;
+ end;
+
+ Memo1 := TfpgMemo.Create(self);
+ with Memo1 do
+ begin
+ Name := 'Memo1';
+ SetPosition(8, 60, 120, 52);
+ Hint := '';
+ Lines.Add('');
+ FontDesc := '#Edit1';
+ TabOrder := 3;
+ end;
+
+ CheckBox1 := TfpgCheckBox.Create(self);
+ with CheckBox1 do
+ begin
+ Name := 'CheckBox1';
+ SetPosition(144, 64, 84, 20);
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 4;
+ Text := 'Is Visible';
+ OnChange := @CheckboxChanged;
+ end;
+
+ RadioButton1 := TfpgRadioButton.Create(self);
+ with RadioButton1 do
+ begin
+ Name := 'RadioButton1';
+ SetPosition(8, 120, 120, 20);
+ FontDesc := '#Label1';
+ GroupIndex := 0;
+ Hint := '';
+ TabOrder := 5;
+ Text := 'RadioButton';
+ end;
+
+ Panel1 := TfpgPanel.Create(self);
+ with Panel1 do
+ begin
+ Name := 'Panel1';
+ SetPosition(8, 148, 116, 72);
+ FontDesc := '#Label1';
+ Hint := '';
+ Text := '';
+ end;
+
+ Edit2 := TfpgEdit.Create(Panel1);
+ with Edit2 do
+ begin
+ Name := 'Edit2';
+ SetPosition(8, 8, 96, 24);
+ Hint := '';
+ TabOrder := 0;
+ Text := '';
+ FontDesc := '#Edit1';
+ Visible := False;
+ end;
+
+ Label2 := TfpgLabel.Create(Panel1);
+ with Label2 do
+ begin
+ Name := 'Label2';
+ SetPosition(8, 36, 64, 16);
+ FontDesc := '#Label1';
+ Hint := '';
+ Text := 'Label';
+ end;
+
+ CheckBox2 := TfpgCheckBox.Create(Panel1);
+ with CheckBox2 do
+ begin
+ Name := 'CheckBox2';
+ SetPosition(8, 50, 101, 20);
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 2;
+ Text := 'CheckBox';
+ end;
+
+ Memo2 := TfpgMemo.Create(self);
+ with Memo2 do
+ begin
+ Name := 'Memo2';
+ SetPosition(248, 4, 320, 232);
+ Hint := '';
+ Lines.Add('This apps tests the .Visible property of components.');
+ Lines.Add('At startup, all TEdit componts should be invisible.');
+ Lines.Add('When you click the "Is Visible" checkbox for the first');
+ Lines.Add('time, then the Edit1 (top left) should become visible.');
+ Lines.Add('');
+ Lines.Add('All sub-sequent clicks of the "Is Visble" checkbox will');
+ Lines.Add('toggle the Edit1 and Panel1 visibility. Not other');
+ Lines.Add('components like Lable or Checbox inside Panel1');
+ Lines.Add('should always stay Visible = True.');
+ Lines.Add('');
+ Lines.Add('Console output at runtime will show .Visible status of');
+ Lines.Add('each component.');
+ FontDesc := '#Edit1';
+ TabOrder := 7;
+ end;
+
+ MainMenu := TfpgMenuBar.Create(self);
+ with MainMenu do
+ begin
+ Name := 'MainMenu';
+ SetPosition(0, 0, 144, 24);
+ end;
+
+ pmFile := TfpgPopupMenu.Create(self);
+ with pmFile do
+ begin
+ Name := 'pmFile';
+ SetPosition(108, 88, 120, 20);
+ AddMenuItem('Quit', '', @miFileQuitClicked);
+ end;
+
+ {@VFD_BODY_END: MainForm}
+
+ // hook up any sub-menus
+ MainMenu.AddMenuItem('File', nil).SubMenu := pmFile;
+ {%endregion}
+end;
+
+
+procedure MainProc;
+var
+ frm: TMainForm;
+begin
+ fpgApplication.Initialize;
+ frm := TMainForm.Create(nil);
+ try
+ frm.Show;
+ fpgApplication.Run;
+ finally
+ frm.Free;
+ end;
+end;
+
+begin
+ MainProc;
+end.
+
\ No newline at end of file diff --git a/unittests/manual_tests/units/.gitignore b/unittests/manual_tests/units/.gitignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/unittests/manual_tests/units/.gitignore @@ -0,0 +1 @@ +*
\ No newline at end of file |