summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/fpc_lang_ref.ipf1230
-rw-r--r--docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas7
-rw-r--r--docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas8
-rw-r--r--docs/xml/corelib/fpg_base.xml175
-rw-r--r--docs/xml/corelib/fpg_main.xml13
-rw-r--r--docs/xml/gui/fpg_form.xml35
-rw-r--r--docview/src/docview.project38
-rw-r--r--examples/apps/ide/TODO8
-rw-r--r--examples/apps/ide/src/extrafpc.cfg2
-rw-r--r--examples/apps/ide/src/units/i386-freebsd/.gitignore1
-rw-r--r--examples/apps/ide/src/units/i386-linux/.gitignore1
-rw-r--r--examples/apps/ide/src/units/i386-win32/.gitignore1
-rw-r--r--examples/apps/ide/src/units/x86_64-freebsd/.gitignore1
-rw-r--r--examples/apps/ide/src/units/x86_64-linux/.gitignore1
-rw-r--r--examples/gui/customwindow/close.bmpbin0 -> 338 bytes
-rw-r--r--examples/gui/customwindow/custom_window.lpi65
-rw-r--r--examples/gui/customwindow/custom_window.lpr352
-rw-r--r--examples/gui/customwindow/extrafpc.cfg10
-rw-r--r--examples/gui/customwindow/images.inc57
-rw-r--r--examples/gui/customwindow/resize.bmpbin0 -> 474 bytes
-rw-r--r--examples/gui/customwindow/units/.gitignore1
-rw-r--r--examples/gui/filedialog/filedialog.lpi2
-rw-r--r--examples/gui/filedialog/filedialog.lpr2
-rw-r--r--examples/gui/gridtest/gridtest.lpr11
-rw-r--r--examples/gui/modalforms/modalforms.lpi2
-rw-r--r--examples/gui/modalforms/modalforms.lpr5
-rw-r--r--examples/gui/video_vlc/frmvlcplayer.pas4
-rw-r--r--examples/gui/video_vlc/testfpguivlc.lpi6
-rw-r--r--languages/fpgui.af.po32
-rw-r--r--languages/fpgui.de.po32
-rw-r--r--languages/fpgui.en.po32
-rw-r--r--languages/fpgui.es.po32
-rw-r--r--languages/fpgui.fr.po32
-rw-r--r--languages/fpgui.it.po32
-rw-r--r--languages/fpgui.po32
-rw-r--r--languages/fpgui.pt.po32
-rw-r--r--languages/fpgui.ru.po48
-rw-r--r--src/build.bat2
-rwxr-xr-xsrc/build.sh8
-rw-r--r--src/corelib/fpg_base.pas2
-rw-r--r--src/corelib/fpg_main.pas90
-rw-r--r--src/corelib/fpg_stdimages.pas7
-rw-r--r--src/corelib/fpg_widget.pas4
-rw-r--r--src/corelib/lang_af.inc8
-rw-r--r--src/corelib/lang_de.inc8
-rw-r--r--src/corelib/lang_en.inc8
-rw-r--r--src/corelib/lang_es.inc8
-rw-r--r--src/corelib/lang_fr.inc8
-rw-r--r--src/corelib/lang_it.inc8
-rw-r--r--src/corelib/lang_pt.inc8
-rw-r--r--src/corelib/lang_ru.inc8
-rw-r--r--src/corelib/render/software/Agg2D.pas3
-rw-r--r--src/corelib/render/software/agg_blur.pas2
-rw-r--r--src/corelib/stdimages.inc22
-rw-r--r--src/corelib/x11/fpg_x11.pas64
-rw-r--r--src/gui/colordialog.inc286
-rw-r--r--src/gui/fpg_basegrid.pas108
-rw-r--r--src/gui/fpg_dialogs.pas2
-rw-r--r--src/gui/fpg_editcombo.pas2
-rw-r--r--src/gui/fpg_form.pas7
-rw-r--r--src/gui/fpg_grid.pas3
-rw-r--r--src/gui/fpg_menu.pas1
-rw-r--r--src/gui/fpg_scrollbar.pas2
-rw-r--r--src/gui/selectdirdialog.inc5
-rw-r--r--uidesigner/uidesigner.prj1067
-rw-r--r--uidesigner/uidesigner.project36
-rw-r--r--uidesigner/uidesigner_clean.prj361
-rw-r--r--uidesigner/units/i386-freebsd/.gitignore1
-rw-r--r--uidesigner/units/i386-linux/.gitignore1
-rw-r--r--uidesigner/units/i386-win32/.gitignore1
-rw-r--r--uidesigner/units/x86_64-freebsd/.gitignore1
-rw-r--r--uidesigner/units/x86_64-linux/.gitignore1
-rw-r--r--uidesigner/vfddesigner.pas42
-rw-r--r--uidesigner/vfdwidgets.pas1
74 files changed, 3227 insertions, 1311 deletions
diff --git a/docs/fpc_lang_ref.ipf b/docs/fpc_lang_ref.ipf
index abe951e9..366edb3e 100644
--- a/docs/fpc_lang_ref.ipf
+++ b/docs/fpc_lang_ref.ipf
@@ -1,3 +1,5 @@
+.* This file is encoded using IBM850 encoding
+.* :encoding=IBM850:
:userdoc.
:title.Free Pascal&colon. Language Reference guide
:docprof toc=123456.
@@ -9,9 +11,9 @@
.nameit symbol='fpcversion' text='2&per.4'
.nameit symbol='date' text='December 2009'
.nameit symbol='progref' text='Programmer&apos.s Guide [ http://www.freepascal.org/docs.var ]'
-.nameit symbol='ra' text='►'
-.nameit symbol='la' text='◄'
-.nameit symbol='dar' text='▼'
+.nameit symbol='ra' text='>'
+.nameit symbol='la' text='<'
+.nameit symbol='dar' text='v'
.nameit symbol='uar' text='^'
.nameit symbol='linux' text='Linux'
.* ==============================================================
@@ -31,10 +33,6 @@ Document version &fpcversion. (r617)
Written by :hp1.Michael van Canneyt:ehp1.
.br
LaTeX to IPF conversion by :hp1.Graeme Geldenhuys:ehp1.
-:p.
-:p.
-:p.
-:note.:color fc=red.Please switch DocView to using the UTF-8 text encoding for this document.:color fc=default.
.* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
.* % About this guide
@@ -42,33 +40,33 @@ LaTeX to IPF conversion by :hp1.Graeme Geldenhuys:ehp1.
:h2.About this guide
:p.
This document serves as the reference for the Pascal langauge as implemented
-by the &fpc. compiler. It describes all Pascal constructs supported by
-&fpc., and lists all supported data types. It does not, however, give a
-detailed explanation of the Pascal language: it is not a tutorial.
-The aim is to list which Pascal constructs are supported, and to show
+by the &fpc. compiler. It describes all Pascal constructs supported by
+&fpc., and lists all supported data types. It does not, however, give a
+detailed explanation of the Pascal language: it is not a tutorial.
+The aim is to list which Pascal constructs are supported, and to show
where the &fpc. implementation differs from the &tp. or &delphi.
implementations.
:p.
-The &tp. and &delphi. Pascal compilers introduced various features in the
+The &tp. and &delphi. Pascal compilers introduced various features in the
Pascal language. The Free Pascal compiler emulates these compilers in the
appropriate mode of the compiler: certain features are available only
-if the compiler is switched to the appropriate mode. When required for
-a certain feature, the use of the :hp1.-M:ehp1. command-line switch or
+if the compiler is switched to the appropriate mode. When required for
+a certain feature, the use of the :hp1.-M:ehp1. command-line switch or
:hp1.{$MODE}:ehp1. directive will be indicated in the text. More information
about the various modes can be found in the user's manual and the
programmer's manual.
:p.
Earlier versions of this document also contained the reference documentation
-of the :hp1.system:ehp1. unit and :hp1.objpas:ehp1. unit. This has been moved to the
+of the :hp1.system:ehp1. unit and :hp1.objpas:ehp1. unit. This has been moved to the
RTL reference guide.
.* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
.* % Notations
:h3.Notations
:p.
-Throughout this document, we will refer to functions, types and variables
+Throughout this document, we will refer to functions, types and variables
with :font facename=Courier size=16x16.typewriter:font facename='System Proportional'. font.
Files are referred to with a sans font: :font facename=Sans size=16x16.filename:font facename='System Proportional'..
@@ -85,35 +83,35 @@ other, then the diagram is ended.
:p.
Syntactical elements are written like this:
:cgraphic.
-&ra.&ra.─── syntactical elemements are like this ───────────────────────────────────&ra.&la.
+&ra.&ra. syntactical elemements are like this &ra.&la.
:ecgraphic.
:p.
Keywords which must be typed exactly as in the diagram:
:cgraphic.
-&ra.&ra.─── :hp2.keywords are like this:ehp2. ─────────────────────────────────────────────────&ra.&la.
+&ra.&ra. :hp2.keywords are like this:ehp2. &ra.&la.
:ecgraphic.
:p.
When something can be repeated, there is an arrow around it:
:cgraphic.
-&ra.&ra.─────┬─ this can be repeated ─┬─────────────────────────────────────────────&ra.&la.
- ^────────────────────────┘
+&ra.&ra. this can be repeated &ra.&la.
+ ^
:ecgraphic.
:p.
When there are different possibilities, they are listed in rows:
:cgraphic.
-&ra.&ra.─────┬─ First possibility ──┬───────────────────────────────────────────────&ra.&la.
- └─ Second possibility ─┘
+&ra.&ra. First possibility &ra.&la.
+ Second possibility
:ecgraphic.
:p.
Note, that one of the possibilities can be empty:
:cgraphic.
-&ra.&ra.─────┬──────────────────────┬───────────────────────────────────────────────&ra.&la.
- ├─ First possibility ─┤
- └─ Second possibility ─┘
+&ra.&ra.&ra.&la.
+ First possibility Ĵ
+ Second possibility
:ecgraphic.
:p.
@@ -126,7 +124,7 @@ combined and nested.
.* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:h2.About the Pascal Language
:p.
-The language Pascal was originally designed by Niklaus Wirth around 1970. It
+The language Pascal was originally designed by Niklaus Wirth around 1970. It
has evolved significantly since that day, with a lot of contributions by the
various compiler constructors (Notably: Borland). The basic elements have been
kept throughout the years:
@@ -141,13 +139,13 @@ kept throughout the years:
:p.
The &tp. and &delphi. Pascal compilers introduced various features in
-the Pascal language, most notably easier string handling and object
+the Pascal language, most notably easier string handling and object
orientedness. The &fpc. compiler initially emulated most of &tp.
and later on &delphi.. It emulates these compilers in the appropriate mode
-of the compiler: certain features are available only if the compiler is
+of the compiler: certain features are available only if the compiler is
switched to the appropriate mode. When required for a certain feature, the use
of the -M command-line switch or {$MODE } directive will be indicated in the
-text. More information about the various modes can be found in the User's
+text. More information about the various modes can be found in the User's
Manual and the Programmer's Manual.
@@ -156,13 +154,13 @@ Manual and the Programmer's Manual.
.* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:h2.Pascal Tokens
:p.
-Tokens are the basic lexical building blocks of source code: they
+Tokens are the basic lexical building blocks of source code: they
are the 'words' of the language: characters are combined into tokens according
to the rules of the programming language. There are five classes of tokens:
:parml tsize=20 break=none.
:pt.:hp2.reserved words:ehp2.
-:pd. These are words which have a fixed meaning in the language. They cannot
+:pd. These are words which have a fixed meaning in the language. They cannot
be changed or redefined.
:pt.:hp2.identifiers:ehp2.
@@ -178,7 +176,7 @@ so on.
:pt.:hp2.constants:ehp2.
:pd.Numerical or character constants are used to denote actual values in the
-source code, such as 1 (integer constant) or 2.3 (float constant) or
+source code, such as 1 (integer constant) or 2.3 (float constant) or
'String constant' (a string: a piece of text).
:eparml.
@@ -195,18 +193,18 @@ various ways to denote strings&comma. numbers&comma. identifiers etc&per.
symbols in a Pascal source file.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Recognised symbols:ehp2.
-&ra.&ra.─── letter ──┬─ A..Z ─┬─────────────────────────────────────────────────────&ra.&la.
- └─ a..z ─┘
+&ra.&ra. letter A..Z &ra.&la.
+ a..z
-&ra.&ra.─── digit ─ 0..9 ───────────────────────────────────────────────────────────&ra.&la.
+&ra.&ra. digit 0..9 &ra.&la.
-&ra.&ra.─── hex digit ──┬─ 0..9 ─┬──────────────────────────────────────────────────&ra.&la.
- ├─ A..Z ─┤
- └─ a..z ─┘
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. hex digit 0..9 &ra.&la.
+ A..Z Ĵ
+ a..z
+
:ecgraphic.
:p.
@@ -222,11 +220,11 @@ and the following character pairs too:
:exmp.
:p.
-When used in a range specifier, the character pair (. is equivalent to the
-left square bracket [. Likewise, the character pair .) is equivalent to the
+When used in a range specifier, the character pair (. is equivalent to the
+left square bracket [. Likewise, the character pair .) is equivalent to the
right square bracket ]. When used for comment delimiters, the character pair
(* is equivalent to the left brace { and the character pair *) is equivalent
-to the right brace }. These character pairs retain their normal meaning in
+to the right brace }. These character pairs retain their normal meaning in
string expressions.
.* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -235,7 +233,7 @@ string expressions.
:p.
Comments are pieces of the source code which are completely discarded by the
compiler. They exist only for the benefit of the programmer, so he can explain
-certain pieces of code. For the compiler, it is as if the comments were not
+certain pieces of code. For the compiler, it is as if the comments were not
present.
:p.
@@ -247,7 +245,7 @@ Function Beautiful: Integer;
:p.
The use of (* and *) as comment delimiters dates from the very first days of
-the Pascal language. It has been replaced mostly by the use of { and } as
+the Pascal language. It has been replaced mostly by the use of { and } as
comment delimiters, as in the following example:
:xmp.
{ My beautiful function returns an interesting result }
@@ -313,7 +311,7 @@ The compiler will react with a 'invalid character' error when it encounters
such constructs, regardless of the :hp1.-Mturbo:ehp1. switch.
:nt.
-In :hp1.TP:ehp1. and :hp1.Delphi:ehp1. mode, nested comments are not allowed,
+In :hp1.TP:ehp1. and :hp1.Delphi:ehp1. mode, nested comments are not allowed,
for maximum compatibility with existing code for those compilers.
:ent.
@@ -324,12 +322,12 @@ for maximum compatibility with existing code for those compilers.
:h3.Reserved words
:p.
Reserved words are part of the Pascal language, and as such, cannot be
-redefined by the programmer. Throughout the syntax diagrams they will be
+redefined by the programmer. Throughout the syntax diagrams they will be
denoted using a :hp2.bold:ehp2. typeface. Pascal is not case sensitive so the compiler
will accept any combination of upper or lower case letters for reserved words.
:p.
-We make a distinction between &tp. and &delphi. reserved words. In
+We make a distinction between &tp. and &delphi. reserved words. In
:hp2.TP:ehp2. mode, only the &tp. reserved words are recognised, but
the &delphi. ones can be redefined. By default, &fpc. recognises the &delphi.
reserved words.
@@ -357,7 +355,7 @@ end not shl
:h4.&fpc. reserved words
:p.
-On top of the &tp. reserved words, &fpc. also considers the
+On top of the &tp. reserved words, &fpc. also considers the
following as reserved words:
.* * * *
:xmp.
@@ -411,7 +409,7 @@ that these types can be redefined in other units. The programmer is however
:p.
Identifiers denote programmer defined names for specific constants, types,
variables, procedures and functions, units, and programs. All programmer
-defined names in the source code – excluding reserved words – are designated
+defined names in the source code - excluding reserved words - are designated
as identifiers.
:p.
@@ -421,14 +419,14 @@ character, or an underscore (_). The following diagram gives the basic syntax
for identifiers.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Identifiers:ehp2.
-&ra.&ra.─── identifier ──┬─ letter ─┬─┬──────────────┬──────────────────────────────&ra.&la.
- └─── _ ────┘ ^─┬─ letter ─┬─┘
- ├─ digit ──┤
- └─── _ ────┘
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. identifier letter &ra.&la.
+ _ ^ letter
+ digit Ĵ
+ _
+
:ecgraphic.
:p.
@@ -477,15 +475,15 @@ Most identifiers (constants, variables, functions or methods, properties) can
have a hint directive appended to their definition:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Hint directives:ehp2.
-&ra.&ra.─── hint directive ──┬─────────────────┬────────────────────────────────────&ra.&la.
- ├── Deprecated ───┤
- ├─ Experimental ──┤
- ├─── Platform ────┤
- └─ Unimplemented ─┘
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. hint directive &ra.&la.
+ Deprecated Ĵ
+ Experimental Ĵ
+ Platform Ĵ
+ Unimplemented
+
:ecgraphic.
:p.
@@ -567,7 +565,7 @@ Note that case is insignificant when using hexadecimal constants.
:li. As of version 1.0.7, Octal format (base 8) is also supported.
To specify a constant in octal format, prepend it with a ampersand (&amp.).
-For instance 15 is specified in octal notation as &amp.17.
+For instance 15 is specified in octal notation as &amp.17.
:li. Binary notation (base 2). A binary number can be specified
by preceding it with a percent sign (%). Thus, 255 can be
@@ -578,46 +576,46 @@ specified in binary notation as %11111111.
The following diagrams show the syntax for numbers.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Numbers:ehp2.
-&ra.&ra.─── hex digit sequence ──┬── hex digit ──┬──────────────────────────────────&ra.&la.
- &uar.───────────────┘
+&ra.&ra. hex digit sequence hex digit &ra.&la.
+ &uar.
-&ra.&ra.─── octal digit sequence ──┬── octal digit ──┬──────────────────────────────&ra.&la.
- &uar.─────────────────┘
+&ra.&ra. octal digit sequence octal digit &ra.&la.
+ &uar.
-&ra.&ra.─── binary digit sequence ──┬┬─ 1 ─┬┬───────────────────────────────────────&ra.&la.
- │└─ 0 ─┘│
- &uar.───────┘
+&ra.&ra. binary digit sequence 1 &ra.&la.
+ 0 ٳ
+ &uar.
-&ra.&ra.─── digit sequence ──┬── digit ──┬──────────────────────────────────────────&ra.&la.
- ^───────────┘
+&ra.&ra. digit sequence digit &ra.&la.
+ ^
-&ra.&ra.─── unsigned integer ──┬────── digit sequence ───────┬──────────────────────&ra.&la.
- ├─ $ ─ hex digit sequence ────┤
- ├─ & ─ octal digit sequence ──┤
- └─ % ─ binary digit sequence ─┘
+&ra.&ra. unsigned integer digit sequence &ra.&la.
+ $ hex digit sequence Ĵ
+ & octal digit sequence Ĵ
+ % binary digit sequence
-&ra.&ra.─── hex digit sequence ──┬── hex digit ──┬──────────────────────────────────&ra.&la.
- ^───────────────┘
+&ra.&ra. hex digit sequence hex digit &ra.&la.
+ ^
-&ra.&ra.─── sign ──┬── + ──┬────────────────────────────────────────────────────────&ra.&la.
- └── - ──┘
+&ra.&ra. sign + &ra.&la.
+ -
-&ra.&ra.─── unsigned real ─ digit sequence ─┬────────────────────┬┬──────────────┬──&ra.&la.
- └ . ─ digit sequence ┘└ scale factor ┘
+&ra.&ra. unsigned real digit sequence &ra.&la.
+ . digit sequence scale factor
-&ra.&ra.─── scale factor ─┬─ E ─┬┬──────┬─ digit sequence ──────────────────────────&ra.&la.
- └─ e ─┘└ sign ┘
+&ra.&ra. scale factor E digit sequence &ra.&la.
+ e sign
-&ra.&ra.─── unsigned number ──┬─── unsigned real ──┬────────────────────────────────&ra.&la.
- └─ unsigned integer ─┘
+&ra.&ra. unsigned number unsigned real &ra.&la.
+ unsigned integer
-&ra.&ra.─── signed number ──┬────────┬─ unsigned number ────────────────────────────&ra.&la.
- └─ sign ─┘
+&ra.&ra. signed number unsigned number &ra.&la.
+ sign
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:nt.
@@ -630,18 +628,18 @@ Octal and Binary notation are not supported in TP or Delphi compatibility mode.
.* % Labels
:h3.Labels
:p.
-A label is a name for a location in the source code to which can be
+A label is a name for a location in the source code to which can be
jumped to from another location with a :hp2.goto:ehp2. statement. A Label is a
standard identifier with the exception that it can start with a digit.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Label:ehp2.
-&ra.&ra.─── label ──┬─ digit sequence ─┬────────────────────────────────────────────&ra.&la.
- └── identifier ────┘
+&ra.&ra. label digit sequence &ra.&la.
+ identifier
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:nt.
@@ -657,42 +655,42 @@ the goto statement.
:h3.Character strings
:p.
A character string (or string for short) is a sequence of zero or more
-characters (byte sized), enclosed in single quotes, and on a single
-line of the program source code: no literal carriage return or linefeed
+characters (byte sized), enclosed in single quotes, and on a single
+line of the program source code: no literal carriage return or linefeed
characters can appear in the string.
:p.
A character set with nothing between the quotes ('') is an empty string.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Character strings:ehp2.
-&ra.&ra.─── character string ──┬┬─ quoted string ──┬┬───────────────────────────────&ra.&la.
- │└─ control string ─┘│
- ^────────────────────┘
+&ra.&ra. character string quoted string &ra.&la.
+ control string ٳ
+ ^
-&ra.&ra.─── quoted string ─ ' ──┬─ string character ─┬─ ' ──────────────────────────&ra.&la.
- ^────────────────────┘
+&ra.&ra. quoted string ' string character ' &ra.&la.
+ ^
-&ra.&ra.─── string character ──┬─ Any character except ' or CR ─┬───────────────────&ra.&la.
- └────────────── " ───────────────┘
+&ra.&ra. string character Any character except ' or CR &ra.&la.
+ "
-&ra.&ra.─── control string ──┬─ # ─ unsigned integer ─┬─────────────────────────────&ra.&la.
- ^────────────────────────┘
+&ra.&ra. control string # unsigned integer &ra.&la.
+ ^
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
The string consists of standard, 8-bit ASCII characters or Unicode (normally
UTF-8 encoded) characters. The :hp1.control string:ehp1. can be used to specify
characters which cannot be typed on a keyboard, such as :hp1.#27:ehp1. for
-the escape character.
+the escape character.
:p.
-The single quote character can be embedded in the string by typing it twice.
-The C construct of escaping characters in the string (using a backslash)
+The single quote character can be embedded in the string by typing it twice.
+The C construct of escaping characters in the string (using a backslash)
is not supported in Pascal.
:p.
@@ -732,8 +730,8 @@ on unices (including Mac OS X), and as
:exmp.
on a classic Mac-like operating system.
-
-It is possible to use other character sets in strings: in that case the
+
+It is possible to use other character sets in strings: in that case the
codepage of the source file must be specified with the :hp1.{$CODEPAGE XXX}:ehp1.
directive or with the :hp2.-Fc:ehp2. command line option for the compiler. In that
case the characters in a string will be interpreted as characters from the
@@ -759,20 +757,20 @@ Just as in &tp., &fpc. supports both ordinary and typed constants.
.* % Ordinary constants
:h3 name=constants_ordinary.Ordinary constants
:p.
-Ordinary constants declarations are constructed using an identifier name
-followed by an "=" token, and followed by an optional expression consisting
-of legal combinations of numbers, characters, boolean values or enumerated
-values as appropriate. The following syntax diagram shows how to construct
+Ordinary constants declarations are constructed using an identifier name
+followed by an "=" token, and followed by an optional expression consisting
+of legal combinations of numbers, characters, boolean values or enumerated
+values as appropriate. The following syntax diagram shows how to construct
a legal declaration of an ordinary constant.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Constant declaration:ehp2.
-&ra.&ra.─── constant declaration ─┬─ identifier ─ = ─ expression ─ hint directives ─ ; ─┬───&ra.&la.
- ^─────────────────────────────────────────────────────┘
+&ra.&ra. constant declaration identifier = expression hint directives ; &ra.&la.
+ ^
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -783,7 +781,7 @@ declaration.
:p.
Operators such as +, -, *, /, not, and, or, div, mod, ord, chr,
-sizeof, pi, int, trunc, round, frac, odd can be used, however.
+sizeof, pi, int, trunc, round, frac, odd can be used, however.
For more information on expressions, see the section :link reftype=hd refid=expressions.Expressions:elink.&per.
@@ -812,7 +810,7 @@ in a compiler error:
:p.
For string constants, the type of the string is dependent on some compiler
-switches. If a specific type is desired, a typed constant should be used,
+switches. If a specific type is desired, a typed constant should be used,
as explained in the following section.
:p.
@@ -830,37 +828,37 @@ for constants of complex structures (defined later in the manual).
Their definition is quite simple.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Constant declaration:ehp2.
typed
-&ra.&ra.─── constant ───┬─ identifier ─ : ─ type ─ = ─ type constant ─ hint directives ─ ; ─┬───&ra.&la.
- declaration ^───────────────────────────────────────────────────────────────────┘
+&ra.&ra. constant identifier : type = type constant hint directives ; &ra.&la.
+ declaration ^
-&ra.&ra.─── typed constant ──┬────── constant ───────┬──────────────────────────────&ra.&la.
- ├─ address constant ─┤
- ├─ array constant ─┤
- ├─ record constant ─┤
- └─ procedural constant ─┘
+&ra.&ra. typed constant constant &ra.&la.
+ address constant Ĵ
+ array constant Ĵ
+ record constant Ĵ
+ procedural constant
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
-Contrary to ordinary constants, a value can be assigned to them at
-run-time. This is an old concept from &tp., which has been
-replaced with support for initialized variables: For a detailed
+Contrary to ordinary constants, a value can be assigned to them at
+run-time. This is an old concept from &tp., which has been
+replaced with support for initialized variables: For a detailed
description, see :link reftype=hd refid='variables_initializedvars'.Initialized variables:elink..
-Support for assigning values to typed constants is controlled by the
-:hp2.{$J}:ehp2. directive: it can be switched off, but is on by default
+Support for assigning values to typed constants is controlled by the
+:hp2.{$J}:ehp2. directive: it can be switched off, but is on by default
(for &tp. compatibility). Initialized variables are always allowed.
:nt.
It should be stressed that typed constants are automatically initialized at program start.
-This is also true for :hp1.local:ehp1. typed constants and initialized variables.
-Local typed constants are also initialized at program start. If their value was
-changed during previous invocations of the function, they will retain their
+This is also true for :hp1.local:ehp1. typed constants and initialized variables.
+Local typed constants are also initialized at program start. If their value was
+changed during previous invocations of the function, they will retain their
changed value, i.e. they are not initialized each time the function is invoked.
:ent.
@@ -870,8 +868,8 @@ changed value, i.e. they are not initialized each time the function is invoked.
:p.
A special kind of constant declaration block is the :hp1.resourcestring:ehp1.
block. Resourcestring declarations are much like constant string
-declarations: resource strings act as constant strings, but they
-can be localized by means of a set of special routines in the
+declarations: resource strings act as constant strings, but they
+can be localized by means of a set of special routines in the
:hp1.objpas:ehp1. unit. A resource string declaration block
is only allowed in the :hp1.Delphi:ehp1. or :hp1.ObjFPC:ehp1. modes.
@@ -890,13 +888,13 @@ at runtime with some special mechanisms in the :hp1.objpas:ehp1. unit.
:p.
Semantically, the strings act like ordinary constants; It is not allowed
-to assign values to them (except through the special mechanisms in the
-objpas unit). However, they can be used in assignments or expressions as
-ordinary string constants. The main use of the resourcestring section is
+to assign values to them (except through the special mechanisms in the
+objpas unit). However, they can be used in assignments or expressions as
+ordinary string constants. The main use of the resourcestring section is
to provide an easy means of internationalization.
:p.
-More on the subject of resourcestrings can be found in the
+More on the subject of resourcestrings can be found in the
:link reftype=hd database='prog.inf' refid=0.&progref.:elink., and
in the :hp1.objpas:ehp1. unit reference.
@@ -914,7 +912,7 @@ resourcestring
If the localization routines translate :hp1.Part1:ehp1. and :hp1.Part2:ehp1., the
:hp1.Sentence:ehp1. constant will not be translated automatically: it has a
separate entry in the resource string tables, and must therefor be
-translated separately. The above construct simply says that the
+translated separately. The above construct simply says that the
initial value of :hp1.Sentence:ehp1. equals :hp1.Part1+' '+Part2:ehp1..
:ent.
@@ -938,7 +936,7 @@ end.
:exmp.
:p.
-This will print 'Yes.' or 'No.' depending on the value of B, even if the
+This will print 'Yes.' or 'No.' depending on the value of B, even if the
constants Yes and No have been localized by some localization mechanism.
:ent.
@@ -953,31 +951,31 @@ that can be used to denote this custom type when declaring variables further
in the source code.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Type declaration:ehp2.
-&ra.&ra.─── type declaration ─── identifier ─ = ─ type ─ ; ─────────────────────────&ra.&la.
+&ra.&ra. type declaration identifier = type ; &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
There are 7 major type classes:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Types:ehp2.
-&ra.&ra.─── type ──┬─── simple type ────┬──────────────────────────────────────────&ra.&la.
- ├─ string type ─┤
- ├─ structured type ─┤
- ├─ pointer type ─┤
- ├─ procedural type ─┤
- ├─ generic type ─┤
- ├─ specialized type ─┤
- └─ type identifier ─┘
+&ra.&ra. type simple type &ra.&la.
+ string type Ĵ
+ structured type Ĵ
+ pointer type Ĵ
+ procedural type Ĵ
+ generic type Ĵ
+ specialized type Ĵ
+ type identifier
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -985,7 +983,7 @@ The last case, :hp1.type identifier:ehp1., is just a means to give another
name to a type. This presents a way to make types platform independent, by
only using these types, and then defining these types for each platform
individually. Any programmer who then uses these custom types doesn't have to worry
-about the underlying type size: it is opaque to him. It also allows to use shortcut names
+about the underlying type size: it is opaque to him. It also allows to use shortcut names
for fully qualified type names. e.g. define :hp1.system.longint:ehp1. as
:hp1.Olongint:ehp1. and then redefine :hp1.longint:ehp1..
@@ -997,23 +995,23 @@ The base or simple types of &fpc. are the &delphi. types.
We will discuss each type separately.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Simple types:ehp2.
-&ra.&ra.─── simple type ──┬─ ordinal type ─┬───────────────────────────────────────&ra.&la.
- └─ real type ─┘
+&ra.&ra. simple type ordinal type &ra.&la.
+ real type
-&ra.&ra.─── real type ─── real type identifier ─────────────────────────────────────&ra.&la.
+&ra.&ra. real type real type identifier &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
.* ...................................................................
:h4.Ordinal types
:p.
-With the exception of :hp1.int64:ehp1., :hp1.qword:ehp1. and Real types,
-all base types are ordinal types. Ordinal types have the following
+With the exception of :hp1.int64:ehp1., :hp1.qword:ehp1. and Real types,
+all base types are ordinal types. Ordinal types have the following
characteristics:
:ol.
:li. Ordinal types are countable and ordered, i.e. it is, in principle,
@@ -1036,7 +1034,7 @@ A list of pre-defined integer types are presented below.
:lm margin=10.
:cgraphic.
:hp2.Name:ehp2.
-────────────
+
Integer
Shortint
SmallInt
@@ -1052,7 +1050,7 @@ A list of pre-defined integer types are presented below.
WordBool
LongBool
Char
-────────────
+
:ecgraphic.
:lm margin=1.
@@ -1064,7 +1062,7 @@ some Pascal constructs will not work with these two integer types.
:cgraphic.
:hp2.Type Range Size in bytes:ehp2.
-────────────────────────────────────────────────────────────────────
+
Byte 0 .. 255 1
Shortint -128 .. 127 1
Smallint -32768 .. 32767 2
@@ -1075,18 +1073,18 @@ some Pascal constructs will not work with these two integer types.
Longword 0 .. 4294967295 4
Int64 -9223372036854775808 .. 9223372036854775807 8
QWord 0 .. 18446744073709551615 8
-────────────────────────────────────────────────────────────────────
+
:ecgraphic.
:p.
The :hp1.integer:ehp1. type maps to the smallint type in the default
&fpc. mode. It maps to either a longint in either Delphi or ObjFPC
-mode. The :hp1.cardinal:ehp1. type is currently always mapped to the
+mode. The :hp1.cardinal:ehp1. type is currently always mapped to the
longword type.
:nt.
-All decimal constants which do no fit within the -2147483648..2147483647 range
-are silently and automatically parsed as 64-bit integer constants as of version
+All decimal constants which do no fit within the -2147483648..2147483647 range
+are silently and automatically parsed as 64-bit integer constants as of version
1.9.0. Earlier versions would convert it to a real-typed constant.
:ent.
@@ -1103,18 +1101,18 @@ to a boolean value, can also be assigned to a boolean type.
:cgraphic.
:hp2.Name Size Ord(True):ehp2.
-─────────────────────────────────────────────────
+
Boolean 1 1
ByteBool 1 Any nonzero value
WordBool 2 Any nonzero value
LongBool 4 Any nonzero value
-─────────────────────────────────────────────────
+
:ecgraphic.
:p.
&fpc. also supports the :hp1.ByteBool:ehp1., :hp1.WordBool:ehp1. and :hp1.LongBool:ehp1. types.
These are of type :hp1.Byte:ehp1., :hp1.Word:ehp1. or :hp1.Longint:ehp1., but are
-assignment compatible with a :hp1.Boolean:ehp1.: the value :hp1.False:ehp1. is
+assignment compatible with a :hp1.Boolean:ehp1.: the value :hp1.False:ehp1. is
equivalent to 0 (zero) and any nonzero value is considered :hp1.True:ehp1. when
converting to a boolean value. A boolean value of :hp1.True:ehp1. is converted
to -1 in case it is assigned to a variable of type :hp1.LongBool:ehp1..
@@ -1138,7 +1136,7 @@ way that when the result is known, the rest of the expression will no longer
be evaluated: this is called short-cut boolean evaluation.
:p.
-In the following example, the function :hp1.Func:ehp1. will never be called,
+In the following example, the function :hp1.Func:ehp1. will never be called,
which may have strange side-effects.
:xmp.
@@ -1163,20 +1161,20 @@ enumeration type, where a value is assigned to a particular element of
the enumeration list.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Enumeration types:ehp2.
-&ra.&ra.─── enumerated type ─ ( ─┬┬── identifier list ───┬┬─ ) ─────────────────────&ra.&la.
- │└─ assigned enum list ─┘│
- ^────────── , ───────────┘
+&ra.&ra. enumerated type ( identifier list ) &ra.&la.
+ assigned enum list ٳ
+ ^ ,
-&ra.&ra.─── identifier list ──┬─ identifier ─┬──────────────────────────────────────&ra.&la.
- ^────── , ─────┘
+&ra.&ra. identifier list identifier &ra.&la.
+ ^ ,
-&ra.&ra.─── assigned enum list ──┬─ identifier ─ := ─ expression ─┬─────────────────&ra.&la.
- ^─────────────── , ──────────────┘
+&ra.&ra. assigned enum list identifier := expression &ra.&la.
+ ^ ,
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -1226,8 +1224,8 @@ this kind of enumeration types. Trying to do this anyhow will result in a
compiler error.
:li. Enumeration types are stored using a default, independent of the
actual number of values: the compiler does not try to optimize for space.
-This behaviour can be changed with the :hp2.{$PACKENUM n}:ehp2. compiler
-directive, which tells the compiler the minimal number of bytes to be
+This behaviour can be changed with the :hp2.{$PACKENUM n}:ehp2. compiler
+directive, which tells the compiler the minimal number of bytes to be
used for enumeration types. For instance:
:xmp.
@@ -1256,12 +1254,12 @@ A subrange type is a range of values from an ordinal type (the host type). To de
one must specify its limiting values: the highest and lowest value of the type.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Subrange types:ehp2.
-&ra.&ra.─── subrange type ─ constant ─ .. ─ constant ───────────────────────────────&ra.&la.
+&ra.&ra. subrange type constant .. constant &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -1300,7 +1298,7 @@ platform, refer to the &progref..
:cgraphic.
:hp2.Type Range Significant digits Size in bytes:ehp2.
-──────────────────────────────────────────────────────────────────────────
+
Real platform dependent ??? 4 or 8
Single 1.5E-45 .. 3.4E38 7-8 4
Double 5.0E-324 .. 1.7E308 15-16 8
@@ -1308,7 +1306,7 @@ platform, refer to the &progref..
Comp -2E64+1 .. 2E63-1 19-20 8
Currency -922337203685477.5808 .. 19-20 8
922337203685477.5807
-──────────────────────────────────────────────────────────────────────────
+
:ecgraphic.
:p.
@@ -1346,7 +1344,7 @@ quotes, as follows: 'a' or 'A' are both character constants.
:p.
A character can also be specified by its character
-value (commonly an ASCII code), by preceding the ordinal value with the
+value (commonly an ASCII code), by preceding the ordinal value with the
number symbol (#). For example specifying :hp1.#65:ehp1. would be the same as :hp1.'A':ehp1.
:p.
@@ -1370,22 +1368,22 @@ It also supports AnsiStrings (with unlimited length) as in Delphi.
To declare a variable as a string, use the following type specification:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.String Type:ehp2.
-&ra.&ra.─── string type ─ :hp2.string:ehp2. ──┬──────────────────────────────┬─────────────────&ra.&la.
- └─ [ ── unsigned integer ── ] ─┘
+&ra.&ra. string type :hp2.string:ehp2. &ra.&la.
+ [ unsigned integer ]
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
-If there is a size specifier, then its maximum value - indicating the maximum
+If there is a size specifier, then its maximum value - indicating the maximum
size of the string - is 255.
:p.
-The meaning of a string declaration statement without size indicator is
+The meaning of a string declaration statement without size indicator is
interpreted differently depending on the :hp2.{$H}:ehp2. switch. If no size
-indication is present, the above declaration can declare an AnsiString or
+indication is present, the above declaration can declare an AnsiString or
a short string.
:p.
Whatever the actual type, AnsiStrings and short strings can be used
@@ -1439,8 +1437,8 @@ Error: string length must be a value from 1 to 255
:p.
For short strings, the length is stored in the character at index 0. Old
-&tp. code relies on this, and it is implemented similarly in &fpc..
-Despite this, to write portable code, it is best to set the length of a
+&tp. code relies on this, and it is implemented similarly in &fpc..
+Despite this, to write portable code, it is best to set the length of a
shortstring with the :hp1.SetLength():ehp1. call, and to retrieve
it with the :hp1.Length():ehp1. call. These functions will always work, whatever
the internal representation of the short strings or other strings in use:
@@ -1452,16 +1450,16 @@ this allows easy switching between the various string types.
:h4 name=character_types_ansistrings.AnsiStrings
:p.
AnsiStrings are strings that have no length limit. They are reference
-counted and are guaranteed to be null terminated. Internally, an ansistring is treated as
+counted and are guaranteed to be null terminated. Internally, an ansistring is treated as
a pointer: the actual content of the string is stored on the heap, as much
-memory as needed to store the string content is allocated.
+memory as needed to store the string content is allocated.
-This is all handled transparantly, i.e. they can be manipulated as a normal
-short string. Ansistrings can be defined using the predefined :hp2.AnsiString:ehp2.
-type.
+This is all handled transparantly, i.e. they can be manipulated as a normal
+short string. Ansistrings can be defined using the predefined :hp2.AnsiString:ehp2.
+type.
:nt.
-The null-termination does not mean that null characters (char(0) or #0)
+The null-termination does not mean that null characters (char(0) or #0)
cannot be used: the null-termination is not used internally, but is there for
convenience when dealing with external routines that expect a
null-terminated string (as most C routines do).
@@ -1469,19 +1467,19 @@ null-terminated string (as most C routines do).
:p.
If the {$H} switch is on, then a string definition using the
-regular :hp1.String:ehp1. keyword and that doesn't contain a length specifier,
+regular :hp1.String:ehp1. keyword and that doesn't contain a length specifier,
will be regarded as an ansistring as well. If a length specifier is present,
a short string will be used, regardless of the {$H} setting.
:p.
If the string is empty (''), then the internal pointer representation
-of the string pointer is :hp1.Nil:ehp1.. If the string is not empty, then the
+of the string pointer is :hp1.Nil:ehp1.. If the string is not empty, then the
pointer points to a structure in heap memory.
:p.
The internal representation as a pointer, and the automatic null-termination
-make it possible to typecast an ansistring to a pchar. If the string is empty
-(so the pointer is Nil) then the compiler makes sure that the typecasted
+make it possible to typecast an ansistring to a pchar. If the string is empty
+(so the pointer is Nil) then the compiler makes sure that the typecasted
pchar will point to a null byte.
:p.
@@ -1493,13 +1491,13 @@ string. A statement
:exmp.
:p.
-results in the reference count of :hp1.S2:ehp1. being decreased with 1,
+results in the reference count of :hp1.S2:ehp1. being decreased with 1,
the reference count of :hp1.S1:ehp1. is increased by 1, and finally :hp1.S1:ehp1.
(as a pointer) is copied to :hp1.S2:ehp1.. This is a significant speed-up in
the code.
:p.
-If the reference count of a string reaches zero, then the memory occupied
+If the reference count of a string reaches zero, then the memory occupied
by the string is deallocated automatically, and the pointer is set to
:hp1.Nil:ehp1., so no memory leaks arise.
@@ -1507,7 +1505,7 @@ by the string is deallocated automatically, and the pointer is set to
When an ansistring is declared, the &fpc. compiler initially
allocates just memory for a pointer, not more. This pointer is guaranteed
to be :hp1.Nil:ehp1., meaning that the string is initially empty. This is
-true for local and global ansistrings or ansistrings that are part of a
+true for local and global ansistrings or ansistrings that are part of a
structure (arrays, records or objects).
:p.
@@ -1519,16 +1517,16 @@ var
:exmp.
:p.
-will copy the value :hp1.Nil:ehp1. 100,000 times into :hp1.A:ehp1..
-When :hp1.A:ehp1. goes out of scope, then the reference
+will copy the value :hp1.Nil:ehp1. 100,000 times into :hp1.A:ehp1..
+When :hp1.A:ehp1. goes out of scope, then the reference
count of the 100,000 strings will be decreased by 1 for each
-of these strings. All this happens invisible to the programmer,
+of these strings. All this happens invisible to the programmer,
but when considering performance issues, this is important.
:p.
-Memory for the string content will be allocated only when the string is
-assigned a value. If the string goes out of scope, then its reference
-count is automatically decreased by 1. If the reference count reaches
+Memory for the string content will be allocated only when the string is
+assigned a value. If the string goes out of scope, then its reference
+count is automatically decreased by 1. If the reference count reaches
zero, the memory reserved for the string is released.
:p.
@@ -1557,7 +1555,7 @@ and passing it to a C routine that modifies the string.
:p.
The :hp1.Length():ehp1. function must be used to get the length of an
-ansistring: the length is not stored at character 0 of the ansistring.
+ansistring: the length is not stored at character 0 of the ansistring.
The construct
:xmp.
@@ -1618,7 +1616,7 @@ It is therefore :hp2.not:ehp2. advisable to typecast one of the following:
:ol.
:li. Expressions.
:li. Strings that have a reference count larger than 1.
-In this case you should call :hp1.UniqueString():ehp1. to ensure the
+In this case you should call :hp1.UniqueString():ehp1. to ensure the
string has a reference count 1.
:eol.
@@ -1627,18 +1625,18 @@ string has a reference count 1.
.* ...................................................................
:h4 name=character_types_widestrings.WideStrings
:p.
-WideStrings (used to represent Unicode character strings) are implemented in much
-the same way as AnsiStrings: reference counted, null-terminated arrays, only they
+WideStrings (used to represent Unicode character strings) are implemented in much
+the same way as AnsiStrings: reference counted, null-terminated arrays, only they
are implemented as arrays of :hp1.WideChars:ehp1. instead of regular :hp1.Chars:ehp1..
A :hp1.WideChar:ehp1. is a two-byte character (an element of a DBCS: Double Byte
-Character Set). Mostly the same rules apply for WideStrings as for
+Character Set). Mostly the same rules apply for WideStrings as for
AnsiStrings. The compiler transparently converts WideStrings to
AnsiStrings and vice versa.
:p.
Similarly to the typecast of an Ansistring to a PChar null-terminated
array of characters, a WideString can be converted to a PWideChar
-null-terminated array of characters.
+null-terminated array of characters.
Note that the :hp1.PWideChar:ehp1. array is terminated by 2 null bytes instead of
1, so a typecast to a PChar is not automatic.
@@ -1750,20 +1748,20 @@ the unit :hp2.strings:ehp2. must be used.
:p.
However, it is possible to do some pointer arithmetic. The
-operators + and - can be used to do operations
+operators + and - can be used to do operations
on :hp1.PChar:ehp1. pointers.
In the table below, :hp1.P:ehp1. and :hp1.Q:ehp1. are of type :hp1.PChar:ehp1., and
:hp1.I:ehp1. is of type :hp1.Longint:ehp1..
:cgraphic.
:hp2.Operation Result:ehp2.
-────────────────────────────────────────────────────────────────────
+
P + I Adds I to the address pointed to by P.
I + P Adds I to the address pointed to by P.
P - I Substracts I from the address pointed to by P.
P - Q Returns, as an integer, the distance between 2 addresses
(or the number of characters between P and Q)
-────────────────────────────────────────────────────────────────────
+
:ecgraphic.
@@ -1775,25 +1773,25 @@ A structured type is a type that can hold multiple values in one variable.
Stuctured types can be nested to unlimited levels.
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Structured Types:ehp2.
-&ra.&ra.─── structured type ──┬──── array type ────┬───────────────────────────&ra.&la.
- ├──── record type ────┤
- ├──── object type ────┤
- ├──── class type ────┤
- ├─ class reference type ─┤
- ├──── interface type ────┤
- ├──── set type ────┤
- └───── file type ──────┘
+&ra.&ra. structured type array type &ra.&la.
+ record type Ĵ
+ object type Ĵ
+ class type Ĵ
+ class reference type Ĵ
+ interface type Ĵ
+ set type Ĵ
+ file type
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
Unlike Delphi, &fpc. does not support the keyword :hp1.packed:ehp1. for all
-structured types. In the following sections each of the possible
-structured types is discussed. It will be mentioned when a type supports
+structured types. In the following sections each of the possible
+structured types is discussed. It will be mentioned when a type supports
the :hp1.packed:ehp1. keyword.
@@ -1860,15 +1858,15 @@ There are some more restrictions to elements of bitpacked structures:
:li. The address cannot be retrieved, unless the bit size is a multiple of
8 and the element happens to be stored on a byte boundary.
:li. An element of a bitpacked structure cannot be used as a var parameter,
-unless the bit size is a multiple of 8 and the element happens to be stored
+unless the bit size is a multiple of 8 and the element happens to be stored
on a byte boundary.
:eul.
:p.
-To determine the size of an element in a bitpacked structure, there is the
-:hp1.BitSizeOf():ehp1. function. It returns the size - in bits - of the element.
-For other types or elements of structures which are not bitpacked, this will
-simply return the size in bytes multiplied by 8, i.e., the return value is
+To determine the size of an element in a bitpacked structure, there is the
+:hp1.BitSizeOf():ehp1. function. It returns the size - in bits - of the element.
+For other types or elements of structures which are not bitpacked, this will
+simply return the size in bytes multiplied by 8, i.e., the return value is
then the same as :hp1.8*SizeOf:ehp1..
:p.
@@ -1880,25 +1878,25 @@ The size of bitpacked records and arrays is limited:
:eul.
:p.
-The reason is that the offset of an element must be calculated with
+The reason is that the offset of an element must be calculated with
the maximum integer size of the system.
.* ...................................................................
:h4 name=structured_types_arrays.Arrays
:p.
-&fpc. supports arrays as in &tp.. Multi-dimensional arrays and (bit)packed
+&fpc. supports arrays as in &tp.. Multi-dimensional arrays and (bit)packed
arrays are also supported, as well as the dynamic arrays of &delphi.:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Array types:ehp2.
-&ra.&ra.── array type ─┬───────────────┬─ :hp2.array:ehp2. ─┬────────────────────────────┬─ :hp2.of:ehp2. ─ type ──&ra.&la.
- ├─ :hp2.packed:ehp2. ─┤ └─ :hp2.[:ehp2. ─┬─ ordinal type ─┬─ :hp2.]:ehp2. ─┘
- └─ :hp2.bitpacked:ehp2. ─┘ ^────── , ───────┘
+&ra.&ra. array type :hp2.array:ehp2. :hp2.of:ehp2. type &ra.&la.
+ :hp2.packed:ehp2. Ĵ :hp2.[:ehp2. ordinal type :hp2.]:ehp2.
+ :hp2.bitpacked:ehp2. ^ ,
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
@@ -1951,32 +1949,32 @@ program testarray1;
type
TA = Array[0..9, 0..9] of Integer;
-
-var
+
+var
A, B: TA;
I, J: Integer;
begin
for I := 0 to 9 do
- for J := 0 to 9 do
+ for J := 0 to 9 do
A[I,J] := I * J;
for I := 0 to 9 do
begin
- for J := 0 to 9 do
+ for J := 0 to 9 do
Write(A[I, J]:2, ' ');
writeln;
end;
B := A;
writeln;
for I := 0 to 9 do
- for J := 0 to 9 do
+ for J := 0 to 9 do
A[9-I, 9-J] := I * J;
for I := 0 to 9 do
begin
- for J := 0 to 9 do
+ for J := 0 to 9 do
write(B[I, J]:2, ' ');
writeln;
end;
-end.
+end.
:exmp.
:p.
@@ -1997,12 +1995,12 @@ Type
:p.
When declaring a variable of a dynamic array type, the initial length of the
array is zero. The actual length of the array must be set with the standard
-:hp1.SetLength():ehp1. function, which will allocate the necessary memory to contain
+:hp1.SetLength():ehp1. function, which will allocate the necessary memory to contain
the array elements on the heap. The following example will set the length to
1000:
:xmp.
-var
+var
A: TByteArray;
begin
SetLength(A, 1000);
@@ -2013,26 +2011,26 @@ After a call to :hp1.SetLength():ehp1., valid array indexes are 0 to 999: the ar
index is always zero-based.
:p.
-Note that the length of the array is set in elements, not in bytes of
-allocated memory (although these may be the same). The amount of
-memory allocated is the size of the array multiplied by the size of
+Note that the length of the array is set in elements, not in bytes of
+allocated memory (although these may be the same). The amount of
+memory allocated is the size of the array multiplied by the size of
1 element in the array. The memory will be disposed of at the exit of the
-current procedure or function.
+current procedure or function.
:p.
-It is also possible to resize the array: in that case, as much of the
+It is also possible to resize the array: in that case, as much of the
elements in the array as will fit in the new size, will be kept. The array
can be resized to zero, which effectively resets the variable.
:p.
-At all times, trying to access an element of the array with an index
-that is not in the current length of the array will generate a run-time
+At all times, trying to access an element of the array with an index
+that is not in the current length of the array will generate a run-time
error.
:p.
-Dynamic arrays are reference counted: assignment of one dynamic array-type
-variable to another will let both variables point to the same array.
-Contrary to ansistrings, an assignment to an element of one array will
+Dynamic arrays are reference counted: assignment of one dynamic array-type
+variable to another will let both variables point to the same array.
+Contrary to ansistrings, an assignment to an element of one array will
be reflected in the other: there is no copy-on-write. Consider the following
example:
@@ -2057,33 +2055,33 @@ program testarray1;
type
TA = array of array of Integer;
-
-var
+
+var
A, B: TA;
I, J: Integer;
begin
Setlength(A, 10, 10);
for I := 0 to 9 do
- for J := 0 to 9 do
+ for J := 0 to 9 do
A[I, J] := I * J;
for I:=0 to 9 do
begin
- for J := 0 to 9 do
+ for J := 0 to 9 do
Write(A[I, J]:2, ' ');
writeln;
end;
B := A;
writeln;
for I := 0 to 9 do
- for J := 0 to 9 do
+ for J := 0 to 9 do
A[9-I, 9-J] := I * J;
for I := 0 to 9 do
begin
- for J := 0 to 9 do
+ for J := 0 to 9 do
Write(B[I, J]:2, ' ');
writeln;
end;
-end.
+end.
:exmp.
:p.
@@ -2097,7 +2095,7 @@ reference count of A (and B) is decreased with 1. As soon as the reference
count reaches zero the memory, allocated for the contents of the array, is disposed of.
:p.
-It is also possible to copy and/or resize the array with the standard
+It is also possible to copy and/or resize the array with the standard
:hp1.Copy():ehp1. function, which acts as the copy function for strings:
:xmp.
@@ -2105,8 +2103,8 @@ program testarray3;
type
TA = array of Integer;
-
-var
+
+var
A, B: TA;
I: Integer;
@@ -2114,10 +2112,10 @@ begin
Setlength(A, 10);
for I := 0 to 9 do
A[I] := I;
- B := Copy(A, 3, 6);
+ B := Copy(A, 3, 6);
for I := 0 to 5 do
Writeln(B[I]);
-end.
+end.
:exmp.
:p.
@@ -2128,14 +2126,14 @@ Starting at the element at index 3 (i.e. the fourth element) of the array.
The :hp1.Length():ehp1. function will return the number of elements in the array.
The :hp1.Low():ehp1. function on a dynamic array will always return 0, and the
:hp1.High():ehp1. function will return the value :hp1.Length-1:ehp1., i.e., the value of the
-highest allowed array index.
+highest allowed array index.
:h5.Packing and unpacking an array
:p.
Arrays can be packed and bitpacked. Two array types which have the same index
-type and element type, but which are differently packed are not assignment
+type and element type, but which are differently packed are not assignment
compatible.
:p.
@@ -2146,7 +2144,7 @@ routine, as in the following example:
:xmp.
var
- foo: array [ 'a'..'f' ] of Boolean
+ foo: array [ 'a'..'f' ] of Boolean
= ( false, false, true, false, false, false );
bar: packed array [ 42..47 ] of Boolean;
baz: array [ '0'..'5' ] of Boolean;
@@ -2168,27 +2166,27 @@ More information about the pack and unpack routines can be found in the
The syntax diagram for a record type is:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Record types:ehp2.
-&ra.&ra.── record type ─┬───────────────┬─ :hp2.record:ehp2. ─┬──────────────┬─ :hp2.end:ehp2. ───────────&ra.&la.
- ├─ :hp2.packed:ehp2. ─┤ └─ field list ─┘
- └─ :hp2.bitpacked:ehp2. ─┘
+&ra.&ra. record type :hp2.record:ehp2. :hp2.end:ehp2. &ra.&la.
+ :hp2.packed:ehp2. Ĵ field list
+ :hp2.bitpacked:ehp2.
-&ra.&ra.── field list ─┬─── fixed fields ───────────────────────┬─┬─────┬───────────&ra.&la.
- └─┬─────────────────────┬─ variant part ─┘ └─ ; ─┘
- └─ fixed fields ─ ; ─┘
+&ra.&ra. field list fixed fields &ra.&la.
+ variant part ;
+ fixed fields ;
-&ra.&ra.── fixed fields ─┬─ identifier list ─ : ─ type ─┬───────────────────────────&ra.&la.
- └──────────── ; ───────────────┘
+&ra.&ra. fixed fields identifier list : type &ra.&la.
+ ;
-&ra.&ra.── variant part ─ :hp2.case:ehp2. ─┬────────────────┬─ ordinal type identifier ─ :hp2.of:ehp2. ─┬─ variant─┬───&ra.&la.
- └ identifier ─ : ┘ ^──── ; ───┘
+&ra.&ra. variant part :hp2.case:ehp2. ordinal type identifier :hp2.of:ehp2. variant&ra.&la.
+ identifier : ^ ;
-&ra.&ra.── variant ─┬─ constant ─ , ─┬─ : ─ ( ─┬────────────────┬─ ) ───────────────&ra.&la.
- ^────────────────┘ ^── field list ──┘
+&ra.&ra. variant constant , : ( ) &ra.&la.
+ ^ ^ field list
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -2250,7 +2248,7 @@ each part is first rounded up to two. So in the above example:
:ul.
:li. :hp1.SizeOf():ehp1. would return 24 for :hp1.Point:ehp1.
:li. It would result in 24 for :hp1.RPoint}:ehp1.
-:li. Finally, 26 would be the size of :hp1.BetterRPoint:ehp1.
+:li. Finally, 26 would be the size of :hp1.BetterRPoint:ehp1.
:li. For :hp1.MyRec:ehp1., the value would be 12.
:eul.
@@ -2258,9 +2256,9 @@ each part is first rounded up to two. So in the above example:
If a typed file with records, produced by a &tp. program, must be read,
then chances are that attempting to read that file correctly will fail.
The reason for this is that by default, elements of a record are aligned at
-2-byte boundaries, for performance reasons.
+2-byte boundaries, for performance reasons.
:p.
-This default behaviour can be changed with the :hp1.{$PACKRECORDS N}:ehp1.
+This default behaviour can be changed with the :hp1.{$PACKRECORDS N}:ehp1.
switch. Possible values for :hp1.N:ehp1. are 1, 2, 4, 16 or :hp1.Default:ehp1.
This switch tells the compiler to align elements of a record or object or
class that have size larger than :hp1.n:ehp1. on :hp1.n:ehp1. byte boundaries.
@@ -2298,7 +2296,7 @@ type
Trec4 = Record
A,B : Byte;
end;
-
+
{$PackRecords 4}
Trec5 = Record
A : Byte;
@@ -2312,7 +2310,7 @@ type
B : Array[1..3] of byte;
C : byte;
end;
-
+
{$PackRecords 4}
Trec7 = Record
A : Byte;
@@ -2386,10 +2384,10 @@ right after A, hence, the total size of the record is 3.
:li.For Trec3, the sizes of A,B are 1, and hence they are aligned on 1 byte boundaries. The same
is true for Trec4.
-:li.For Trec5, since the size of B – 3 – is smaller than 4, B will be on a 4-byte boundary, as this
+:li.For Trec5, since the size of B - 3 - is smaller than 4, B will be on a 4-byte boundary, as this
is the first power of two that is larger than its size. The same holds for Trec6.
-:li.For Trec7, B is aligned on a 4 byte boundary, since its size – 7 – is larger than 4. However, in
+:li.For Trec7, B is aligned on a 4 byte boundary, since its size - 7 - is larger than 4. However, in
Trec8, it is aligned on a 8-byte boundary, since 8 is the first power of two that is greater than
7, thus making the total size of the record 16.
:eul.
@@ -2427,12 +2425,12 @@ Note the :hp1.{$PackRecords 2}:ehp1. after the first declaration!
&fpc. supports the set types as in &tp.. The prototype of a set declaration is:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Set types:ehp2.
-&ra.&ra.── set type ── :hp2.set:ehp2. ── :hp2.of:ehp2. ── ordinal type ───────────────────────────────────&ra.&la.
+&ra.&ra. set type :hp2.set:ehp2. :hp2.of:ehp2. ordinal type &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -2478,13 +2476,13 @@ its data for instance in memory.
Here is the type declaration for a file type:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.File types:ehp2.
-&ra.&ra.── file type ── :hp2.file:ehp2. ─┬─────────────┬───────────────────────────────────────&ra.&la.
- └─ :hp2.of:ehp2. ─ type ─┘
+&ra.&ra. file type :hp2.file:ehp2. &ra.&la.
+ :hp2.of:ehp2. type
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -2522,12 +2520,12 @@ address in memory, where the data of another variable may be stored. A pointer
type can be defined as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Pointer types:ehp2.
-&ra.&ra.── pointer type ── ^ ── type identifier ────────────────────────────────────&ra.&la.
+&ra.&ra. pointer type ^ type identifier &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -2716,24 +2714,24 @@ types.
syntax diagram:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Procedural types:ehp2.
-&ra.&ra.── procedural type ─┬─ function header ──┬┬───────────────┬┬─────────────────────┬──────&ra.&la.
- └─ procedure header ─┘└─ :hp2.of:ehp2. ─ :hp2.object:ehp2. ─┘└─ ; ─ call modifier ─┘
+&ra.&ra. procedural type function header &ra.&la.
+ procedure header :hp2.of:ehp2. :hp2.object:ehp2. ; call modifier
-&ra.&ra.── function header ── :hp2.function:ehp2. ─ formal parameter list ─ : ─ result type ───────────────&ra.&la.
+&ra.&ra. function header :hp2.function:ehp2. formal parameter list : result type &ra.&la.
-&ra.&ra.── procedure header ── :hp2.procedure:ehp2. ─ formal parameter list ───────────────────────────────&ra.&la.
+&ra.&ra. procedure header :hp2.procedure:ehp2. formal parameter list &ra.&la.
-&ra.&ra.── call modifiers ─┬─ :hp2.register:ehp2. ─┬───────────────────────────────────────────────────────&ra.&la.
- ├─ :hp2.cdecl:ehp2. ─┤
- ├─ :hp2.pascal:ehp2. ─┤
- ├─ :hp2.stdcall:ehp2. ─┤
- ├─ :hp2.safecall:ehp2. ─┤
- └─ :hp2.inline:ehp2. ─┘
+&ra.&ra. call modifiers :hp2.register:ehp2. &ra.&la.
+ :hp2.cdecl:ehp2. Ĵ
+ :hp2.pascal:ehp2. Ĵ
+ :hp2.stdcall:ehp2. Ĵ
+ :hp2.safecall:ehp2. Ĵ
+ :hp2.inline:ehp2.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -3018,27 +3016,27 @@ The variables must be declared in a variable declaration section of a unit or a
It looks as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Variable declaration:ehp2.
-&ra.&ra.── variable declaration ── identifier ── : ── type ─┬──────────────────┬──&ra.
- └─ :hp2.=:ehp2. ─ expression ─┘
+&ra.&ra. variable declaration identifier : type &ra.
+ :hp2.=:ehp2. expression
-&ra.───┬──────────────────────┬─ hintdirective ── :hp2.;:ehp2. ─────────────────────────────&ra.&la.
- └─ variable modifiers ─┘
+&ra. hintdirective :hp2.;:ehp2. &ra.&la.
+ variable modifiers
-&ra.&ra.── variable modifiers ─┬─┬───── :hp2.absolute:ehp2. ─┬─ integer expression ─┬───────────────────────┬┬─&ra.
- ^ │ └─ identifier ─┘ ││
- │ ├────────────────────── :hp2.; export:ehp2. ───────────────────────────────┤│
- │ ├────────────────────── :hp2.; cvar:ehp2. ─────────────────────────────────┤│
- │ ├─ :hp2.; external:ehp2. ─┬───────────────────┬┬──────────────────────────┬┤│
- │ │ └─ string constant ─┘└─ :hp2.name:ehp2. ─ string constant ─┘││
- │ └────────────────────── hintdirective ──────────────────────────┘│
- └──────────────────────────────────────────────────────────────────┘
+&ra.&ra. variable modifiers :hp2.absolute:ehp2. integer expression &ra.
+ ^ identifier
+ :hp2.; export:ehp2. Ĵ
+ :hp2.; cvar:ehp2. Ĵ
+ :hp2.; external:ehp2. ´
+ string constant :hp2.name:ehp2. string constant ٳ
+ hintdirective ٳ
+
-&ra.─────────────────────────────────────────────────────────────────────────────&ra.&la.
+&ra.&ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -3092,7 +3090,7 @@ above case).
:eol.
:p.
-Note that assembler names must be unique. It’s not possible to declare or export 2 variables with the
+Note that assembler names must be unique. It's not possible to declare or export 2 variables with the
same assembler name.
@@ -3133,7 +3131,7 @@ even better way of doing this:
:xmp.
const
SDefault = 'This is an initialized string';
-
+
var
S: String = SDefault;
:exmp.
@@ -3217,39 +3215,39 @@ value on the fly, or to check the values which are written to the property.
The declaration is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Properties:ehp2.
-&ra.&ra.── property definition ── identifier ─┬──────────────────────┬─ property specifiers ──────&ra.&la.
- └─ property interface ─┘
+&ra.&ra. property definition identifier property specifiers &ra.&la.
+ property interface
-&ra.&ra.── property interface ─┬───────────────────────────┬─ : ── type identifier ──&ra.
- └─ property parameter list ─┘
+&ra.&ra. property interface : type identifier &ra.
+ property parameter list
-&ra.───┬───────────────────────────┬─────────────────────────────────────────────&ra.&la.
- └─ :hp2.index:ehp2. ─ integerconstant ─┘
+&ra.&ra.&la.
+ :hp2.index:ehp2. integerconstant
-&ra.&ra.── property parameter list ── :hp2.[:ehp2. ─┬─ parameter declaration ─┬─ :hp2.]:ehp2. ────────────&ra.&la.
- ^─────────── ; ───────────┘
+&ra.&ra. property parameter list :hp2.[:ehp2. parameter declaration :hp2.]:ehp2. &ra.&la.
+ ^ ;
-&ra.&ra.── property specifiers ─┬──────────────────┬┬───────────────────┬┬─────────────────────┬───&ra.&la.
- └─ read specifier ─┘└─ write specifier ─┘└─ default specifier ─┘
+&ra.&ra. property specifiers &ra.&la.
+ read specifier write specifier default specifier
-&ra.&ra.── read specifier ── :hp2.read:ehp2. ── field or function ─────────────────────────────&ra.&la.
+&ra.&ra. read specifier :hp2.read:ehp2. field or function &ra.&la.
-&ra.&ra.── write specifier ── :hp2.write:ehp2. ── field or function ───────────────────────────&ra.&la.
+&ra.&ra. write specifier :hp2.write:ehp2. field or function &ra.&la.
-&ra.&ra.── default specifier ──┬─ :hp2.default:ehp2. ──┬────────────┬┬─────────────────────────&ra.&la.
- │ └─ constant ─┘│
- └──────── :hp2.nodefault:ehp2. ───────┘
+&ra.&ra. default specifier :hp2.default:ehp2. &ra.&la.
+ constant ٳ
+ :hp2.nodefault:ehp2.
-&ra.&ra.── field or procedure ──┬─── field identifier ───┬──────────────────────────&ra.&la.
- └─ procedure identifier ─┘
+&ra.&ra. field or procedure field identifier &ra.&la.
+ procedure identifier
-&ra.&ra.── field or function ──┬─── field identifier ───┬───────────────────────────&ra.&la.
- └─ function identifier ──┘
+&ra.&ra. field or function field identifier &ra.&la.
+ function identifier
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -3266,15 +3264,15 @@ function GetMyInt: Integer;
procedure SetMyInt(AValue: Integer);
property MyProp: Integer read GetMyInt write SetMyInt;
-
+
implementation
uses
sysutils;
var
- FMyInt: Integer;
-
+ FMyInt: Integer;
+
function GetMyInt: Integer;
begin
Result := FMyInt;
@@ -3284,7 +3282,7 @@ procedure SetMyInt(AValue: Integer);
begin
if ((AValue mod 2) = 1) then
raise Exception.Create('MyProp can only contain even value');
- FMyInt := AValue;
+ FMyInt := AValue;
end;
end.
@@ -3312,8 +3310,8 @@ uses
sysutils;
var
- FMyInt: Integer;
-
+ FMyInt: Integer;
+
function GetMyInt: Integer;
begin
Result := FMyInt;
@@ -3323,7 +3321,7 @@ procedure SetMyInt(AValue: Integer);
begin
If ((AValue mod 2) = 1) then
Raise Exception.Create('Only even values are allowed');
- FMyInt := AValue;
+ FMyInt := AValue;
end;
end.
@@ -3346,7 +3344,7 @@ property MyProp: Integer read GetMyInt write SetMyInt;
implementation
-end.
+end.
:exmp.
:p.
@@ -3374,13 +3372,13 @@ objects. Here we present some technical questions regarding object oriented prog
:p.
Objects should be treated as a special kind of record. The record contains all the fields that are
-declared in the objects definition, and pointers to the methods that are associated to the objects’ type.
+declared in the objects definition, and pointers to the methods that are associated to the objects' type.
:p.
An object is declared just as a record would be declared; except that now, procedures and functions
-can be declared as if they were part of the record. Objects can “inherit” fields and methods from
-“parent” objects. This means that these fields and methods can be used as if they were included in
-the objects declared as a “child” object.
+can be declared as if they were part of the record. Objects can "inherit" fields and methods from
+"parent" objects. This means that these fields and methods can be used as if they were included in
+the objects declared as a "child" object.
:p.
Furthermore, a concept of visibility is introduced: fields, procedures and functions can be declared as
@@ -3395,30 +3393,30 @@ limited to the implementation of the current unit.
The prototype declaration of an object is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Object types:ehp2.
-&ra.&ra.───┬──────────┬─ :hp2.object:ehp2. ─┬────────────┬─┬─ component list ─┬─ end ────────────&ra.&la.
- └─ :hp2.packed:ehp2. ─┘ └─ heritage ─┘ ^──────────────────┘
+&ra.&ra. :hp2.object:ehp2. component list end &ra.&la.
+ :hp2.packed:ehp2. heritage ^
-&ra.&ra.─── heritage ── ( ── object type identifier ── ) ─────────────────────────────&ra.&la.
+&ra.&ra. heritage ( object type identifier ) &ra.&la.
-&ra.&ra.─── component list ─┬───────────────────────────────┬┬──────────────────────┬─&ra.
- └─ object visibility specifier ─┘└┬─ field definition ─┬┘
- ^────────────────────┘
+&ra.&ra. component list &ra.
+ object visibility specifier field definition
+ ^
-&ra.───┬───────────────────────┬───────────────────────────────────────────────────&ra.&la.
- └┬─ method definition ─┬┘
- ^─────────────────────┘
+&ra.&ra.&la.
+ method definition
+ ^
-&ra.&ra.─── field definition ── identifier list ── : ── type ── ; ──┬───────────┬─────&ra.&la.
- └─ :hp2.static;:ehp2. ─┘
+&ra.&ra. field definition identifier list : type ; &ra.&la.
+ :hp2.static;:ehp2.
-&ra.&ra.─── object visibility specifier ─┬─ :hp2.private:ehp2. ─┬──────────────────────────────&ra.&la.
- ├─ :hp2.protected:ehp2. ─┤
- └─ :hp2.public:ehp2. ─┘
+&ra.&ra. object visibility specifier :hp2.private:ehp2. &ra.&la.
+ :hp2.protected:ehp2. Ĵ
+ :hp2.public:ehp2.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
.* TODO: The "method definition" is missing from the above graph.
@@ -3449,7 +3447,7 @@ outside the unit in which :hp1.TObj:ehp1. is declared.
:note.
In MacPas mode, the :hp1.Object:ehp1. keyword is replaced by the :hp1.class:ehp1.
-keyword for compatibility with other pascal compilers available on the Mac.
+keyword for compatibility with other pascal compilers available on the Mac.
That means that objects cannot be used in MacPas mode.
:nt.
@@ -3526,7 +3524,7 @@ end;
:p.
One cannot access fields that are in a private or protected sections of an object from
-outside the objects’ methods. If this is attempted anyway, the compiler will complain about
+outside the objects' methods. If this is attempted anyway, the compiler will complain about
an unknown identifier.
:p.
@@ -3586,7 +3584,7 @@ will be the following
:exmp.
:p.
-Note that the last line of code references the object type itself (cl),
+Note that the last line of code references the object type itself (cl),
and not an instance of the object (cl1 or cl2).
@@ -3600,24 +3598,24 @@ constructor and the destructor explicitly when using objects.
The declaration of a constructor or destructor is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Constructors and Destructors:ehp2.
-&ra.&ra.─── constructor declaration ── constructor header ── ; ── subroutine block ──────&ra.&la.
+&ra.&ra. constructor declaration constructor header ; subroutine block &ra.&la.
-&ra.&ra.─── destructor declaration ── destructor header ── ; ── subroutine block ────────&ra.&la.
+&ra.&ra. destructor declaration destructor header ; subroutine block &ra.&la.
-&ra.&ra.─── constructor header ── :hp2.constructor:ehp2. ──┬───────── identifier ──────────┬────────&ra.
- └─ qualified method identifier ─┘
+&ra.&ra. constructor header :hp2.constructor:ehp2. identifier &ra.
+ qualified method identifier
-&ra.──── formal parameter list ───────────────────────────────────────────────────────&ra.&la.
+&ra. formal parameter list &ra.&la.
-&ra.&ra.─── destructor header ── :hp2.destructor:ehp2. ──┬───────── identifier ──────────┬──────────&ra.
- └─ qualified method identifier ─┘
+&ra.&ra. destructor header :hp2.destructor:ehp2. identifier &ra.
+ qualified method identifier
-&ra.──── formal parameter list ───────────────────────────────────────────────────────&ra.&la.
+&ra. formal parameter list &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
@@ -3635,7 +3633,7 @@ i.e. an identifier of the form :hp1.objectidentifier.methodidentifier:ehp1..
:p.
&fpc. supports also the extended syntax of the :hp1.New:ehp1. and :hp1.Dispose:ehp1.
procedures. In case a dynamic variable of an object type must be allocated
-the constructor’s name can be specified in the call to :hp1.New:ehp1..
+the constructor's name can be specified in the call to :hp1.New:ehp1..
The :hp1.New:ehp1. is implemented as a function which returns a pointer to the
instantiated object. Consider the following declarations:
@@ -3676,7 +3674,7 @@ pp^.init;
:p.
In the last case, the compiler will issue a warning that the
extended syntax of :hp1.New:ehp1. and :hp1.Dispose:ehp1. must be used to generate instances of an
-object. It is possible to ignore this warning, but it’s better programming practice to
+object. It is possible to ignore this warning, but it's better programming practice to
use the extended syntax to create instances of an object.
Similarly, the :hp1.Dispose:ehp1. procedure accepts the name of a destructor. The
destructor will then be called, before removing the object from the heap.
@@ -3704,30 +3702,30 @@ declaration, with some additional specifiers, as can be seen from the
following diagram, which is part of the object declaration:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Methods:ehp2.
-&ra.&ra.─── method definition ─┬─ function header ─┬─ ; ── method directives ─────────────&ra.&la.
- ├─ procedure header ─┤
- ├─ constructor header ─┤
- └─ destructor header ─┘
+&ra.&ra. method definition function header ; method directives &ra.&la.
+ procedure header Ĵ
+ constructor header Ĵ
+ destructor header
+
+&ra.&ra. method directives &ra.&la.
+ :hp2.virtual:ehp2. ; call modifier ;
+ :hp2.abstract:ehp2. ;
-&ra.&ra.─── method directives ─┬──────────────────────────────────┬┬─────────────────────┬───&ra.&la.
- └─ :hp2.virtual:ehp2. ─ ; ─┬────────────────┬─┘└─ call modifier ─ ; ─┘
- └─ :hp2.abstract:ehp2. ─ ; ─┘
-
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
-from the point of view of declarations, :hp1.Method definitions:ehp1. are
+from the point of view of declarations, :hp1.Method definitions:ehp1. are
normal function or procedure declarations.
-Contrary to &tp. and &delphi., fields can be declared after methods in the same
+Contrary to &tp. and &delphi., fields can be declared after methods in the same
block, i.e. the following will generate an error when compiling with &delphi.
or &tp., but not with &fpc.:
:xmp.
-type
+type
MyObj = object
procedure Doit;
Field: Longint;
@@ -3842,7 +3840,7 @@ As it is visible, both the parent and child objects have a method called
:hp1.Doit:ehp1.. Consider now the following declarations and calls:
:xmp.
-var
+var
ParentA, ParentB: PParent;
Child: PChild;
begin
@@ -3888,9 +3886,9 @@ static methods, only on virtual methods.
:p.
To be able to do this, the compiler keeps - per object type - a table with
-virtual methods: the VMT (Virtual Method Table). This is simply a table
+virtual methods: the VMT (Virtual Method Table). This is simply a table
with pointers to each of the virtual methods: each virtual method has its
-fixed location in this table (an index). The compiler uses this table to
+fixed location in this table (an index). The compiler uses this table to
look up the actual method that must be used. When a descendent object
overrides a method, the entry of the parent method is overwritten in the
VMT. More information about the VMT can be found in :link reftype=hd database='prog.inf' refid=0.&progref.:elink..
@@ -3904,12 +3902,12 @@ the VMT of the actual type that it was created with.
:h5 name='objects_abstract_methods'.Abstract Methods
:p.
An abstract method is a special kind of virtual method. A method that is
-declared :hp1.abstract:ehp1. does not have an implementation for this method.
+declared :hp1.abstract:ehp1. does not have an implementation for this method.
It is up to inherited objects to override and implement this method.
:p.
-From this it follows that a method can not be abstract if it is not virtual
-(this can be seen from the syntax diagram). A second consequence is that
+From this it follows that a method can not be abstract if it is not virtual
+(this can be seen from the syntax diagram). A second consequence is that
an instance of an object that has an abstract method cannot be created
directly.
@@ -4022,7 +4020,7 @@ var
:exmp.
:p.
-The main difference is that the variable A will take up as much
+The main difference is that the variable A will take up as much
space on the stack as the size of the object (TSomeObject). The
variable B, on the other hand, will always take just the size of
a pointer on the stack. The actual class data is on the heap.
@@ -4031,7 +4029,7 @@ a pointer on the stack. The actual class data is on the heap.
From this, a second difference follows: a class must :hp2.always:ehp2. be initialized
through its constructor, whereas for an object, this is not necessary.
Calling the constructor allocates the necessary memory on the heap for the
-class instance data.
+class instance data.
:nt.
In earlier versions of &fpc. it was necessary, in order to use classes,
@@ -4056,55 +4054,55 @@ In fact, the compiler will give a warning if it encounters the
The prototype declaration of a class is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Class types:ehp2.
-&ra.&ra.───┬──────────┬─ :hp2.class:ehp2. ─┬────────────┬─┬────────────────────┬─ end ──────────────&ra.&la.
- └─ :hp2.packed:ehp2. ─┘ └─ heritage ─┘ └┬ component list ─┬─┘
- ^─────────────────┘
-
-&ra.&ra.─── heritage ── ( ── class type identifier ──┬──────────────────────────┬─ ) ────&ra.&la.
- └─ implemented interfaces ─┘
-
-&ra.&ra.─── implemented interfaces ─┬ , ── interface identifier ──┬──────────────────────&ra.&la.
- ^─────────────────────────────┘
-
-&ra.&ra.─── component list ─┬────────────────────────┬┬──────────────────────┬─&ra.
- └─ visibility specifier ─┘└┬─ field definition ─┬┘
- ^────────────────────┘
-
-&ra.───┬───────────────────────────┬──────────────────────────────────────────────────&ra.&la.
- └┬┬── method definition ──┬┬┘
- │└─ property definition ─┘│
- ^─────────────────────────┘
-
-&ra.&ra.─── field definition ── identifier list ── : ── type ── ; ──┬───────────┬────────&ra.&la.
- └─ :hp2.static;:ehp2. ─┘
-
-&ra.&ra.─── method definition ─┬┬─────────┬┬─ function header ──┬┬── ; ────────&ra.
- │└─ :hp2.class:ehp2. ─┘└─ procedure header ─┘│
- ├───── constructor header ────────┤
- └───── destructor header ─────────┘
-
-&ra.────┬─────────────────────────────────────────┬┬──────────────────────┬───────────&ra.&la.
- └─┬┬─ :hp2.virtual:ehp2. ─┬┬──────────────────┬┬─ ; ─┘└─ call modifiers ─ ; ─┘
- │└─ :hp2.dynamic:ehp2. ─┘└─ ; ── :hp2.abstract:ehp2. ──┘│
- ├──────── :hp2.override:ehp2. ───────────────┤
- └─ :hp2.message:ehp2. ─┬─ integer constant ─┬┘
- └─ string constant ──┘
-
-&ra.&ra.─── class visibility specifier ─┬─ :hp2.private:ehp2. ─┬──────────────────────────────────&ra.&la.
- ├─ :hp2.protected:ehp2. ─┤
- ├─ :hp2.public:ehp2. ─┤
- └─ :hp2.published:ehp2. ─┘
-
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. :hp2.class:ehp2. end &ra.&la.
+ :hp2.packed:ehp2. heritage component list
+ ^
+
+&ra.&ra. heritage ( class type identifier ) &ra.&la.
+ implemented interfaces
+
+&ra.&ra. implemented interfaces , interface identifier &ra.&la.
+ ^
+
+&ra.&ra. component list &ra.
+ visibility specifier field definition
+ ^
+
+&ra.&ra.&la.
+ method definition
+ property definition ٳ
+ ^
+
+&ra.&ra. field definition identifier list : type ; &ra.&la.
+ :hp2.static;:ehp2.
+
+&ra.&ra. method definition function header ; &ra.
+ :hp2.class:ehp2. procedure header ٳ
+ constructor header Ĵ
+ destructor header
+
+&ra.&ra.&la.
+ :hp2.virtual:ehp2. ; call modifiers ;
+ :hp2.dynamic:ehp2. ; :hp2.abstract:ehp2. ٳ
+ :hp2.override:ehp2. Ĵ
+ :hp2.message:ehp2. integer constant
+ string constant
+
+&ra.&ra. class visibility specifier :hp2.private:ehp2. &ra.&la.
+ :hp2.protected:ehp2. Ĵ
+ :hp2.public:ehp2. Ĵ
+ :hp2.published:ehp2.
+
+
:ecgraphic.
:p.
:nt.
In MacPas mode, the :hp1.Object:ehp1. keyword is replaced by the :hp1.class:ehp1.
-keyword for compatibility with other pascal compilers available on the Mac.
+keyword for compatibility with other pascal compilers available on the Mac.
That means that in MacPas mode, the reserved word 'class' in the above
diagram may be replaced by the reserved word 'object'.
:ent.
@@ -4139,7 +4137,7 @@ they are implemented in other modules.
:pt.:hp2.Published:ehp2.
:pd.Is the same as a :hp1.Public:ehp1. section, but the compiler
generates also type information that is needed for automatic streaming of
-these classes if the compiler is in the {$M+} state. Fields defined in
+these classes if the compiler is in the {$M+} state. Fields defined in
a :hp1.published:ehp1. section must be of class type.
Array properties cannot be in a published section.
@@ -4151,8 +4149,8 @@ interfaces. This feature will be discussed in the next chapter.
:p.
Classes can contain :hp1.class:ehp1. methods: these are functions that do not
-require an instance. The :hp1.self:ehp1. identifier is valid in such methods,
-but refers to the class pointer (the VMT).
+require an instance. The :hp1.self:ehp1. identifier is valid in such methods,
+but refers to the class pointer (the VMT).
:p.
Similar to objects, if the {$STATIC ON} directive is active, then a class
@@ -4194,7 +4192,7 @@ will be the following
:exmp.
:p.
-Note that the last line of code references the class type itself (TMyClass),
+Note that the last line of code references the class type itself (TMyClass),
and not an instance of the class (c1 or c2).
:p.
@@ -4202,20 +4200,20 @@ It is also possible to define class reference types:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Class reference type:ehp2.
-&ra.&ra.─── :hp2.class of:ehp2. ── classtype ──────────────────────────────────────────────────&ra.&la.
+&ra.&ra. :hp2.class of:ehp2. classtype &ra.&la.
-└──────────────────────────────────────────────────────────────────────────────┘
+
:ecgraphic.
:p.
Class reference types are used to create instances of a certain class, which
-is not yet known at compile time, but which is specified at run time.
+is not yet known at compile time, but which is specified at run time.
Essentially, a variable of a class reference type contains a pointer to the
-definition of the speficied class. This can be used to construct an instance
-of the class corresponding to the definition, or to check inheritance.
+definition of the speficied class. This can be used to construct an instance
+of the class corresponding to the definition, or to check inheritance.
The following example shows how it works:
:xmp.
@@ -4243,7 +4241,7 @@ end;
:exmp.
:p.
-On return of the :hp1.CreateComponent:ehp1. function, C will contain an
+On return of the :hp1.CreateComponent:ehp1. function, C will contain an
instance of the class TEdit. Note that the following call will fail to
compile:
@@ -4269,7 +4267,7 @@ type
function CheckObjectBetween(Instance: TObject): boolean;
begin
- if not (Instance is TMinClass)
+ if not (Instance is TMinClass)
or ((Instance is TMaxClass) and (Instance.ClassType <> TMaxClass)) then
raise Exception.Create('SomeError')
end;
@@ -4288,7 +4286,7 @@ More about instantiating a class can be found in the next section.
:p.
Classes must be created using one of their constructors (there can be
multiple constructors). Remember that a class is a pointer to an object on
-the heap. When a variable of some class is declared, the compiler just
+the heap. When a variable of some class is declared, the compiler just
allocates room for this pointer, not the entire object. The constructor of
a class returns a pointer to an initialized instance of the object on the
heap. So, to initialize an instance of some class, one would do the following:
@@ -4315,8 +4313,8 @@ value of the {$PackRecords} directive.
:li. Just as for objects and records, a packed class can be declared.
This has the same effect as on an object, or record, namely that the
elements are aligned on 1-byte boundaries. i.e. as close as possible.
-:li. :hp1.SizeOf(class):ehp1. will return the same as :hp1.SizeOf(Pointer):ehp1.,
-since a class is but a pointer to an object. To get the size of the class
+:li. :hp1.SizeOf(class):ehp1. will return the same as :hp1.SizeOf(Pointer):ehp1.,
+since a class is but a pointer to an object. To get the size of the class
instance data, use the :hp1.TObject.InstanceSize:ehp1. method.
:eul.
:ent.
@@ -4341,21 +4339,21 @@ Declaration of methods in classes follows the same rules as method
declarations in objects:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Methods:ehp2.
-&ra.&ra.─── method definition ─┬─ function header ─┬─ ; ── method directives ─────────────────&ra.&la.
- ├─ procedure header ─┤
- ├─ constructor header ─┤
- └─ destructor header ─┘
-
-&ra.&ra.─── method directives ──┬──────────────────────────────────┬┬──────────────────────┬─────&ra.&la.
- ├─ :hp2.virtual:ehp2. ─ ; ─┬─────────────────┬┘└─ call modifiers ─ ; ─┘
- │ └─ :hp2.abstract:ehp2. ─ ; ──┤
- ├──────── :hp2.reintroduce:ehp2. ─ ; ────────┤
- └─ :hp2.message:ehp2. ─ constant expression ─┘
-
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. method definition function header ; method directives &ra.&la.
+ procedure header Ĵ
+ constructor header Ĵ
+ destructor header
+
+&ra.&ra. method directives &ra.&la.
+ :hp2.virtual:ehp2. ; call modifiers ;
+ :hp2.abstract:ehp2. ; Ĵ
+ :hp2.reintroduce:ehp2. ; Ĵ
+ :hp2.message:ehp2. constant expression
+
+
:ecgraphic.
@@ -4379,7 +4377,7 @@ begin
Classes have virtual methods, just as objects do. There is however a
difference between the two. For objects, it is sufficient to redeclare the
same method in a descendent object with the keyword :hp1.virtual:ehp1. to
-override it. For classes, the situation is different: virtual methods
+override it. For classes, the situation is different: virtual methods
:hp2.must:ehp2. be overridden with the :hp1.override:ehp1. keyword. Failing to do so,
will start a :hp2.new:ehp2. batch of virtual methods, hiding the previous
one. The :hp1.Inherited:ehp1. keyword will not jump to the inherited method, if
@@ -4389,11 +4387,11 @@ one. The :hp1.Inherited:ehp1. keyword will not jump to the inherited method, if
The following code is :hp2.wrong:ehp2.:
:xmp.
-type
+type
TObjParent = class
procedure MyProc; virtual;
end;
-
+
ObjChild = class(TObjParent)
procedure MyProc; virtual;
end;
@@ -4414,11 +4412,11 @@ produce strange effects.
The correct declaration is as follows:
:xmp.
-type
+type
TObjParent = class
procedure MyProc; virtual;
end;
-
+
TObjChild = Class(TObjParent)
procedure MyProc; override;
end;
@@ -4428,15 +4426,15 @@ type
This will compile and run without warnings or errors.
:p.
-If the virtual method should really be replaced with a method with the
+If the virtual method should really be replaced with a method with the
same name, then the :hp1.reintroduce:ehp1. keyword can be used:
:xmp.
-type
+type
TObjParent = class
procedure MyProc; virtual;
end;
-
+
TObjChild = Class(TObjParent)
procedure MyProc; reintroduce;
end;
@@ -4447,9 +4445,9 @@ This new method is no longer virtual.
:p.
To be able to do this, the compiler keeps - per class type - a table with
-virtual methods: the VMT (Virtual Method Table). This is simply a table
+virtual methods: the VMT (Virtual Method Table). This is simply a table
with pointers to each of the virtual methods: each virtual method has its
-fixed location in this table (an index). The compiler uses this table to
+fixed location in this table (an index). The compiler uses this table to
look up the actual method that must be used at runtime. When a descendent object
overrides a method, the entry of the parent method is overwritten in the
VMT. More information about the VMT can be found in the &progref..
@@ -4474,13 +4472,13 @@ procedure or function declaration, as in the following example:
:p.
Class methods are methods that do not have an instance (i.e. Self does not
-point to a class instance) but which follow the scoping and inheritance
+point to a class instance) but which follow the scoping and inheritance
rules of a class. They can be used to return information about the current
-class, for instance for registration or use in a class factory. Since no
+class, for instance for registration or use in a class factory. Since no
instance is available, no information available in instances can be used.
:p.
-Class methods can be called from inside a regular method, but can also be called
+Class methods can be called from inside a regular method, but can also be called
using a class identifier:
:xmp.
@@ -4506,10 +4504,10 @@ begin
:exmp.
:p.
-The reverse is not possible: Inside a class method, the Self identifier
-points to the VMT table of the class. No fields, properties or
-regular methods are available inside a class method. Accessing a regular
-property or method will result in a compiler error.
+The reverse is not possible: Inside a class method, the Self identifier
+points to the VMT table of the class. No fields, properties or
+regular methods are available inside a class method. Accessing a regular
+property or method will result in a compiler error.
:p.
Note that class methods can be virtual, and can be overridden.
@@ -4530,7 +4528,7 @@ GTK. In difference with &delphi., &fpc. also accepts strings as message
identifiers. Message methods are always virtual.
:p.
-As can be seen in the class declaration diagram, message methods are
+As can be seen in the class declaration diagram, message methods are
declared with a :hp1.message:ehp1. keyword, followed by an integer constant
expression.
@@ -4560,7 +4558,7 @@ type
MsgID: Cardinal;
Data: Pointer;
end;
-
+
var
Msg: TMSg;
begin
@@ -4570,7 +4568,7 @@ begin
:p.
In this example, the Dispatch() method will look at the object and all
-its ancestors (starting at the object, and searching up the inheritance
+its ancestors (starting at the object, and searching up the inheritance
class tree), to see if a message method with message :hp1.MsgID:ehp1. has been
declared. If such a method is found, it is called, and passed the
Msg parameter.
@@ -4622,7 +4620,7 @@ type
constructor Create(AOwner: TComponent); override;
end;
-constructor TMyClass.Create(AOwner: TComponent);
+constructor TMyClass.Create(AOwner: TComponent);
begin
inherited;
// Do more things
@@ -4646,12 +4644,12 @@ type
constructor CreateNew(AOwner: TComponent; DoExtra: Boolean);
end;
-constructor TMyClass.Create(AOwner: TComponent);
+constructor TMyClass.Create(AOwner: TComponent);
begin
inherited;
end;
-constructor TMyClass.CreateNew(AOwner: TComponent; DoExtra: Boolean);
+constructor TMyClass.CreateNew(AOwner: TComponent; DoExtra: Boolean);
begin
inherited Create(AOwner);
// Do stuff
@@ -4697,52 +4695,52 @@ value on the fly. Moreover, properties can be read-only or write only.
The prototype declaration of a property is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Properties:ehp2.
-&ra.&ra.─── property definition ── :hp2.property:ehp2. ── identifier ─┬──────────────────────┬───&ra.
- └─ property interface ─┘
-
-&ra.──── property specifier ── hint directive ─────────────────────────────────────&ra.&la.
+&ra.&ra. property definition :hp2.property:ehp2. identifier &ra.
+ property interface
+
+&ra. property specifier hint directive &ra.&la.
+
+&ra.&ra. property interface : type identifier &ra.
+ property parameter list
-&ra.&ra.─── property interface ─┬───────────────────────────┬─ : ── type identifier ──&ra.
- └─ property parameter list ─┘
+&ra.&ra.&la.
+ :hp2.index:ehp2. integer constant
-&ra.─────┬─────────────────────────────┬───────────────────────────────────────────&ra.&la.
- └─ :hp2.index:ehp2. ── integer constant ─┘
+&ra.&ra. property parameter list [ parameter declaration &ra.&la.
+ ^ ;
-&ra.&ra.─── property parameter list ── [ ── parameter declaration ─┬──────────────────&ra.&la.
- ^───────── ; ────────────┘
+&ra.&ra. property specifiers &ra.
+ read specifier write specifier Ĵ
+ implements specifier
-&ra.&ra.─── property specifiers ──┬──────────────────┬─┬────────────────────────┬─────&ra.
- └─ read specifier ─┘ ├─── write specifier ────┤
- └─ implements specifier ─┘
+&ra.&ra.
+ default specifier stored specifier
-&ra.─────┬─────────────────────┬┬────────────────────┬─────────────────────────────&ra.
- └─ default specifier ─┘└─ stored specifier ─┘
+&ra.&ra.&la.
+ default array property specifier
-&ra.─────┬────────────────────────────────────┬────────────────────────────────────&ra.&la.
- └─ default array property specifier ─┘
+&ra.&ra. read specifier :hp2.read:ehp2. field or method &ra.&la.
-&ra.&ra.──── read specifier ── :hp2.read:ehp2. ── field or method ───────────────────────────────&ra.&la.
+&ra.&ra. write specifier :hp2.write:ehp2. field or method &ra.&la.
-&ra.&ra.──── write specifier ── :hp2.write:ehp2. ── field or method ─────────────────────────────&ra.&la.
+&ra.&ra. implements specifier :hp2.implements:ehp2. identifier &ra.&la.
-&ra.&ra.──── implements specifier ── :hp2.implements:ehp2. ── identifier ────────────────────────&ra.&la.
+&ra.&ra. default specifier :hp2.default:ehp2. &ra.&la.
+ constant ٳ
+ :hp2.nodefault:ehp2.
-&ra.&ra.──── default specifier ─┬─ :hp2.default:ehp2. ─┬────────────┬┬───────────────────────────&ra.&la.
- │ └─ constant ─┘│
- └───── :hp2.nodefault:ehp2. ─────────┘
+&ra.&ra. stored specifier :hp2.stored:ehp2. constant &ra.&la.
+ identifier
-&ra.&ra.──── stored specifier ── :hp2.stored:ehp2. ─┬─ constant ───┬─────────────────────────────&ra.&la.
- └─ identifier ─┘
-
-&ra.&ra.──── field or method ──┬─ field identifier ──┬────────────────────────────────&ra.&la.
- └─ method identifier ─┘
+&ra.&ra. field or method field identifier &ra.&la.
+ method identifier
-&ra.&ra.──── default array property specifier ── ; ── :hp2.default:ehp2. ────────────────────────&ra.&la.
-
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. default array property specifier ; :hp2.default:ehp2. &ra.&la.
+
+
:ecgraphic.
:p.
@@ -4787,7 +4785,7 @@ type
property Z: Longint read GetZ;
end;
-var
+var
MyClass: TMyClass;
:exmp.
@@ -4834,7 +4832,7 @@ the same type. The following is an example of a property with an index:
:xmp.
{$mode objfpc}
-type
+type
TPoint = class(TObject)
private
FX: Longint;
@@ -4863,7 +4861,7 @@ begin
end;
end;
-var
+var
P: TPoint;
begin
@@ -4902,7 +4900,7 @@ type as the index, and the second argument is a parameter of the same
type as the property type. As an example, see the following declaration:
:xmp.
-type
+type
TIntList = class
private
Function GetInt(I: Longint): Longint;
@@ -4914,7 +4912,7 @@ type
property StrItems[S: String]: String read GetAsString write SetAsstring;
end;
-var
+var
AIntList: TIntList;
:exmp.
@@ -4977,8 +4975,8 @@ The :hp1.stored specifier:ehp1. should be either a boolean constant, a boolean
field of the class, or a parameterless function which returns a boolean
result. This specifier has no result on the class behaviour. It is an aid
for the streaming system: the stored specifier is specified in the RTTI
-generated for a class (it can only be streamed if RTTI is generated),
-and is used to determine whether a property should be streamed or not:
+generated for a class (it can only be streamed if RTTI is generated),
+and is used to determine whether a property should be streamed or not:
it saves space in a stream. It is not possible to specify the 'Stored'
directive for array properties.
@@ -5112,7 +5110,7 @@ identifier.
:p.
When the compiler looks for unit files, it adds the extension :hp1..ppu:ehp1.
-to the name of the unit. On &linux. and in operating systems where filenames
+to the name of the unit. On &linux. and in operating systems where filenames
are case sensitive when looking for a unit, the following mechanism is
used:
@@ -5123,19 +5121,19 @@ used:
:eol.
:p.
-Additionally, If a unit name is longer than 8 characters, the compiler
-will first look for a unit name with this length, and then it will
-truncate the name to 8 characters and look for it again.
-For compatibility reasons, this is also true on platforms that
+Additionally, If a unit name is longer than 8 characters, the compiler
+will first look for a unit name with this length, and then it will
+truncate the name to 8 characters and look for it again.
+For compatibility reasons, this is also true on platforms that
support long file names.
:p.
Note that the above search is performed in each directory in the search
-path.
+path.
:p.
The program block contains the statements that will be executed when the
-program is started. Note that these statements need not necessarily be the
+program is started. Note that these statements need not necessarily be the
first statements that are executed: the initialization code of the units
may also contain statements that are executed prior to the program code.
@@ -5148,38 +5146,38 @@ The structure of a program block is discussed below.
used by a program or another unit. The syntax for a unit is as follows:
:cgraphic.
-┌──────────────────────────────────────────────────────────────────────────────┐
+Ŀ
:hp2.Units:ehp2.
-&ra.&ra.─── unit ── unit header ── interface part ── implementation part ────────────&ra.
-
-&ra.─────┬────────────────────────────────────────────┬─ :hp2.end:ehp2. ── . ─────────────────&ra.&la.
- ├─ initialization part ─┬───────────────────┬┤
- │ └ finalization part ┘│
- └─ :hp2.begin:ehp2. ─┬─ statement ─┬───────────────────┘
- ^───── ; ─────┘
-
-&ra.&ra.─── unit header ── :hp2.unit:ehp2. ── unit identifier ── ; ──────────────────────────────&ra.&la.
-
-&ra.&ra.─── interface part ── :hp2.interface:ehp2. ─┬───────────────┬┬┬─────────────────────────────┬┬──&ra.&la.
- └─ uses clause ─┘│├─ constant declaration part ─┤│
- │├─ type declatation part ─┤│
- │└─ procedure headers part ─┘│
- ^───────────────────────────────┘
-
-&ra.&ra.─── procedure headers part ─┬─ procedure header ─┬─ ; ─┬───────────────────────┬─────&ra.&la.
- └─ function header ─┘ └─ call modifiers ── ; ─┘
-
-&ra.&ra.─── implementation part ── :hp2.implementation:ehp2. ─┬───────────────┬─ declaration part ──────&ra.&la.
- ^─ uses clause ─┘
-
-&ra.&ra.─── initialization part ── :hp2.initialization:ehp2. ─┬─ statement ─┬────────────────────&ra.&la.
- ^───── ; ─────┘
-
-&ra.&ra.─── finalization part ── :hp2.finalization:ehp2. ─┬─ statement ─┬────────────────────────&ra.&la.
- ^───── ; ─────┘
-
-└──────────────────────────────────────────────────────────────────────────────┘
+&ra.&ra. unit unit header interface part implementation part &ra.
+
+&ra. :hp2.end:ehp2. . &ra.&la.
+ initialization part ´
+ finalization part ٳ
+ :hp2.begin:ehp2. statement
+ ^ ;
+
+&ra.&ra. unit header :hp2.unit:ehp2. unit identifier ; &ra.&la.
+
+&ra.&ra. interface part :hp2.interface:ehp2. &ra.&la.
+ uses clause ٳ constant declaration part Ĵ
+ type declatation part Ĵ
+ procedure headers part ٳ
+ ^
+
+&ra.&ra. procedure headers part procedure header ; &ra.&la.
+ function header call modifiers ;
+
+&ra.&ra. implementation part :hp2.implementation:ehp2. declaration part &ra.&la.
+ ^ uses clause
+
+&ra.&ra. initialization part :hp2.initialization:ehp2. statement &ra.&la.
+ ^ ;
+
+&ra.&ra. finalization part :hp2.finalization:ehp2. statement &ra.&la.
+ ^ ;
+
+
:ecgraphic.
:p.
@@ -5228,7 +5226,7 @@ The type :hp1.SomeBType:ehp1. is defined in unit :hp1.b:ehp1..
:p.
All functions and methods that are declared in the interface part must
be implemented in the implementation part of the unit, except for
-declarations of external functions or procedures. If a declared method
+declarations of external functions or procedures. If a declared method
or function is not implemented in the implementation part, the compiler
will give an error, for example the following:
@@ -5254,23 +5252,23 @@ unita.pp(5,10) Error: Forward declaration not solved "MyFunction&colon.SmallInt;
:p.
The implementation part is primarily intended for the implementation of the
functions and procedures declared in the interface part. However, it can
-also contain declarations of it's own: The declarations inside the
-implementation part are :hp2.not:ehp2. accessible outside the unit.
+also contain declarations of it's own: The declarations inside the
+implementation part are :hp2.not:ehp2. accessible outside the unit.
:p.
The initialization and finalization part of a unit are optional:
:p.
-The initialization block is used to initialize certain variables or
-execute code that is necessary for the correct functioning of the unit.
+The initialization block is used to initialize certain variables or
+execute code that is necessary for the correct functioning of the unit.
The initialization parts of the units
-are executed in the order that the compiler loaded the units when compiling
+are executed in the order that the compiler loaded the units when compiling
a program. They are executed before the first statement of the program is
executed.
:p.
The finalization part of the units are executed in the reverse order of the
-initialization execution. They are used for instance to clean up any resources
+initialization execution. They are used for instance to clean up any resources
allocated in the initialization part of the unit, or during the lifetime of
the program. The finalization part is always executed in the case of a
normal program termination: whether it is because the final :hp1.end:ehp1. is
@@ -5292,7 +5290,7 @@ end.
:exmp.
:p.
-An initialization section by itself (i.e. without finalization) may simply be
+An initialization section by itself (i.e. without finalization) may simply be
replaced by a statement block. That is, the following:
:xmp.
@@ -5367,7 +5365,7 @@ on the target processor and emulation options.
:h2.Object Pascal Grammar
:p.This section describes the Object Pascal grammar in a EBNF
-(Extended Backus–Naur Form) like style. The syntax only covers the
+(Extended Backus-Naur Form) like style. The syntax only covers the
:hp1.ObjFPC:ehp1. mode of the &fpc. compiler.
:cgraphic.
diff --git a/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas
new file mode 100644
index 00000000..d85fadf2
--- /dev/null
+++ b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.drawarc.pas
@@ -0,0 +1,7 @@
+{ This will draw a red arc, starting at the 6 o'clock position, and
+ drawing 90 degrees of the arc, ending at the 3 o'clock position. }
+procedure TMainForm.FormPaint; // the forms OnPaint event handler
+begin
+ Canvas.Color := clRed;
+ Canvas.DrawArc(5, 5, 100, 100, 270, 90);
+end;
diff --git a/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas
new file mode 100644
index 00000000..897ac0ec
--- /dev/null
+++ b/docs/xml/corelib/examples/fpg_base.fpgcanvasbase.fillarc.pas
@@ -0,0 +1,8 @@
+{ This will draw a red filled arc, starting at the 6 o'clock position, and
+ drawing 45 degrees of the arc, ending at the half-past-four position. }
+procedure TMainForm.FormPaint; // the form's OnPaint event handler.
+begin
+ Canvas.Color := clRed;
+ Canvas.FillArc(5, 5, 100, 100, 270, 45);
+end;
+
diff --git a/docs/xml/corelib/fpg_base.xml b/docs/xml/corelib/fpg_base.xml
index f052e2f0..32d68ac4 100644
--- a/docs/xml/corelib/fpg_base.xml
+++ b/docs/xml/corelib/fpg_base.xml
@@ -18,75 +18,70 @@ For more information, see the fpGUI Toolkit website at: <url href="http://fpgui.
<descr><p>This unit contains all the abstract classes for the CoreLib code
of fpGUI. It also defines many types and constants used throughout the toolkit.
</p>
- <p>When implementing support for a completely new windowing system
+ <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
+
+<element name="TfpgCoord">
+<short>A custom type used to represent X and Y coordinates.</short>
+<descr>Internally TfpgCoord is actually a Integer type. We created a custom
+alias type for use in fpGUI in the event that we might want to change the
underlying type in the future. Example to floating points.
</descr>
- <seealso/>
- </element>
- <!-- alias type Visibility: default -->
- <element name="TfpgColor">
- <short>Represents a color in integer format.</short>
- <descr>
- <p>TfpgColor is always in RRGGBB (Red, Green, Blue) format, no matter the
+</element>
+
+<element name="TfpgColor">
+<short>Represents a color in integer format.</short>
+<descr>
+<p>TfpgColor is always in AARRGGBB (Alpha, Red, Green, Blue) format, no matter the
operating system.
</p>
- <p>The <var>fpg_base</var> unit also contains definitions of many useful color
-constants. It defines the standard predefined Delphi colors (like clRed,
-clMagenta etc.), the 140 web safe colors using the defacto standard names as
-used by Netscape and Internet Explorer web browsers. As well as some internal
-color constants used by many GUI components (like clText, clWindowBackground
-etc.).
-</p>
- </descr>
- <seealso/>
- </element>
- <!-- record type Visibility: default -->
- <element name="TRGBTriple">
- <short>A record structure holding the RGBA values of a color</short>
- <descr><printshort id="TRGBTriple"/>.</descr>
- <seealso/>
- </element>
- <!-- variable Visibility: default -->
- <element name="TRGBTriple.Alpha">
- <short>Alpha support has not really been implemented in fpGUI yet.</short>
- <descr/>
- <seealso/>
- </element>
- <!-- enumeration type Visibility: default -->
- <element name="TWindowType">
- <short>Enum type defining what types of windows can be created.</short>
- <descr/>
- <seealso/>
- </element>
- <!-- enumeration value Visibility: default -->
- <element name="TWindowType.wtChild">
- <short>The window being created is a child on another window. This normally
+<p>The <var>fpg_base</var> unit also contains definitions of many useful color
+constants. It defines the standard predefined Delphi colors (like clRed,
+clMagenta etc.), the 140 web safe colors using the defacto standard names as
+used by Netscape and Internet Explorer web browsers. As well as some internal
+color constants used by many GUI components (like clText, clWindowBackground
+etc.).</p></descr>
+<seealso>
+<link id="fpg_base.TRGBTriple">TRGBTriple</link>
+</seealso>
+</element>
+
+<element name="TRGBTriple">
+<short>A record structure holding the RGBA values of a color</short>
+<descr><printshort id="TRGBTriple"/>.</descr>
+</element>
+
+<element name="TRGBTriple.Alpha">
+<short>Alpha support has not really been implemented in fpGUI yet.</short>
+</element>
+
+<element name="TWindowType">
+<short>Enum type defining what types of windows can be created.</short>
+</element>
+
+<element name="TWindowType.wtChild">
+<short>The window being created is a child on another window. This normally
means no titlebar or window borders are going to be created.</short>
- </element>
- <!-- enumeration value Visibility: default -->
- <element name="TWindowType.wtWindow">
- <short>This would specify a standard window with titlebar and window borders.</short>
- <descr>This would specify a standard window with titlebar and window borders. It grabs input focus, and appears in the taskbar.</descr>
- </element>
- <!-- enumeration value Visibility: default -->
- <element name="TWindowType.wtModalForm">
- <short>This windows type is similar to wtWindow, but grabs focus.</short>
- <descr>This windows is the same as <link id="#fpgui.fpg_base.TWindowType.wtWindow">wtWindow</link>, but grabs the input focus until it has closed. This window normally doesn't appear in the taskbar.</descr>
- </element>
- <!-- enumeration value Visibility: default -->
- <element name="TWindowType.wtPopup">
- <short>This window will normally not have a titlebar or window borders.</short>
- <descr>This window will normally not have a titlebar or window borders and will appear above other windows. It is used for example in the dropdown window of a ComboBox or a tooltip window or popup menus. This type of window does not steal focus.</descr>
- </element>
+</element>
+
+<element name="TWindowType.wtWindow">
+<short>This would specify a standard window with titlebar and window borders. It grabs input
+focus, and appears in the taskbar.</short>
+</element>
+
+<element name="TWindowType.wtModalForm">
+<short>This windows is similar to <link id="#fpgui.fpg_base.TWindowType.wtWindow">wtWindow</link>, but grabs
+the input focus until it has closed. This window normally doesn't appear in the taskbar.</short>
+</element>
+
+<element name="TWindowType.wtPopup">
+<short>This window will normally not have a titlebar or window borders and will appear above other windows. It
+is used for example in the dropdown window of a ComboBox or a tooltip window or popup menus. This type of
+window does not steal focus.</short>
+</element>
<element name="TWindowAttribute">
<short>An enum types defining extra attributes of a window.</short>
@@ -130,7 +125,7 @@ the first time.</short>
<link id="fpg_base.TWindowAttribute">TWindowAttribute</link>
</seealso>
</element>
-
+
<!-- enumeration type Visibility: default -->
<element name="TMouseCursor">
<short>Enum types of the available mouse cursor shapes.</short>
@@ -371,7 +366,7 @@ the first time.</short>
<element name="TfpgRect">
<short>A graphical (pixel based) rectangle structure used throughout fpGUI.</short>
<descr>
- <p>Note that this structure is not a class, so static allocations are
+ <p>Note that this structure is not a class, so static allocations are
allowed. This makes it much easier to use in Widgets and in fpGUI internal
messages.</p>
<p>Think of the pixel screen/grid like the grid of a spreadsheet (or as a magnified look of the top corner of your screen).
@@ -387,11 +382,11 @@ messages.</p>
+---+---+---
| | |
</pre>
- <p>x is at (0,0). A pixel is always 1x1, you don't get smaller (we are not using sub-pixels like on LCD screens, because they don't apply to all screens).
+ <p>x is at (0,0). A pixel is always 1x1, you don't get smaller (we are not using sub-pixels like on LCD screens, because they don't apply to all screens).
</p>
- <p>So with that example, Width = 1 pixel and Height = 1 pixel. In the case of
-Classes.Bounds() the Right and Bottom values are (1,1) which looking at the
-above image will be wrong, the pixel only covers one block, so in a screen/pixel
+ <p>So with that example, Width = 1 pixel and Height = 1 pixel. In the case of
+Classes.Bounds() the Right and Bottom values are (1,1) which looking at the
+above image will be wrong, the pixel only covers one block, so in a screen/pixel
environment, Right, Bottom is also (0,0), the same as Top/Left. This is what
TfpgRect.Right and TfpgRect.Bottom will report.
</p>
@@ -406,20 +401,20 @@ TfpgRect.Right and TfpgRect.Bottom will report.
+---+---+---
| | |
</pre>
- <p>In this example we have a rectangle. Top/Left = (0,0) and Bottom/Right = (1,1).
-This means Width = 2 pixels and Height = 2 pixels. Clearly visible in the image
+ <p>In this example we have a rectangle. Top/Left = (0,0) and Bottom/Right = (1,1).
+This means Width = 2 pixels and Height = 2 pixels. Clearly visible in the image
above.
</p>
- <p>But if we call Classes.Bounds(0,0,2,2) it reports Bottom/Right as (2,2) which
-is wrong (again looking at the image above as reference). This is my point.
+ <p>But if we call Classes.Bounds(0,0,2,2) it reports Bottom/Right as (2,2) which
+is wrong (again looking at the image above as reference). This is my point.
Bounds() cannot be used in this case in a graphical environment.
</p>
- <p>The reason I don't use a grid layout as shown below, is
-because if the mouse is over the rectangle containing x, the OS (graphics system) reports its
-position as (0,0). You don't have to have the mouse pointer over the intersecting
-lines at (0,0) as indicated in the image below. The whole square containing
+ <p>The reason I don't use a grid layout as shown below, is
+because if the mouse is over the rectangle containing x, the OS (graphics system) reports its
+position as (0,0). You don't have to have the mouse pointer over the intersecting
+lines at (0,0) as indicated in the image below. The whole square containing
the x is referenced as (0,0), hence the grid layout as show in the images above,
-and what fpGUI uses. The same grid layout as used in TfpgStringGrid or any
+and what fpGUI uses. The same grid layout as used in TfpgStringGrid or any
Spreadsheet program etc.
</p>
<pre>.
@@ -646,7 +641,7 @@ redundant calculations, fpGUI allows you to set all the properties,
then act on it once you call <var>UpdateWindowPosition</var>. In most cases fpGUI
can even reduce the API calls needed, because it could pass for
example Width and Height via one API call. In the case of X11, it can actually do all
-four values in a single API call. Thus improving efficiency and reduces resize
+four values in a single API call. Thus improving efficiency and reduces resize
calculations and screen redraws.</p>
</descr>
</element>
@@ -657,7 +652,7 @@ calculations and screen redraws.</p>
of the control begins or to reposition the left side of the control.
</p>
<remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the
-<var>UpdateWindowPosition</var> method is called. For more information on why this is so,
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so,
see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
help.</remark></descr>
<seealso>
@@ -671,7 +666,7 @@ help.</remark></descr>
of the control begins or to reposition the top side of the control.
</p>
<remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the
-<var>UpdateWindowPosition</var> method is called. For more information on why this
+<var>UpdateWindowPosition</var> method is called. For more information on why this
is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
help.</remark></descr>
<seealso>
@@ -687,7 +682,7 @@ controls that have their Align property set to alTop, alBottom or alClient, chan
this property at runtime has no effect.
</p>
<remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the
-<var>UpdateWindowPosition</var> method is called. For more information on why this is so,
+<var>UpdateWindowPosition</var> method is called. For more information on why this is so,
see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
help.</remark></descr>
<seealso>
@@ -703,7 +698,7 @@ controls that have their Align property set to alLeft, alRight or alClient, chan
this property at runtime has no effect.
</p>
<remark>fpGUI delays acting on the Top, Left, Width and Height properties of a control until the
-<var>UpdateWindowPosition</var> method is called. For more information on why this
+<var>UpdateWindowPosition</var> method is called. For more information on why this
is so, see <link id="#fpgui.fpg_base.TfpgWindowBase.UpdateWindowPosition">UpdateWindowPosition</link>
help.</remark></descr>
<seealso>
@@ -807,7 +802,7 @@ you must keep copy of the original image before you call <var>Invert</var>.</des
<element name="TfpgBaseInterpolation">
<short>A abstract class representing a base Interpolation filter.</short>
<descr>This is used as the base class to implement Interpolation filters like
-Gaussian, Sinc etc... These decendant filters are used in the
+Gaussian, Sinc etc... These decendant filters are used in the
<link id="#fpgui.fpg_base.TfpgCanvasBase.StretchDraw">Canvas.StretchDraw</link> function.
</descr>
<seealso>
@@ -823,9 +818,9 @@ Gaussian, Sinc etc... These decendant filters are used in the
<!-- procedure Visibility: public -->
<element name="TfpgCanvasBase.DrawLine">
<short>Draws a line</short>
- <descr><printshort id="#fpgui.fpg_base.TfpgCanvasBase.DrawLine"/>. This method
-draws a line from (x1,y1) to (x2,y2), but does not draw the last pixel. All supported
-backends follow the Microsoft API and doesn't draw the last pixel. This optimises
+ <descr><printshort id="#fpgui.fpg_base.TfpgCanvasBase.DrawLine"/>. This method
+draws a line from (x1,y1) to (x2,y2), but does not draw the last pixel. All supported
+backends follow the Microsoft API and doesn't draw the last pixel. This optimises
consecutive lines being drawn without overlapping pixels.</descr>
</element>
@@ -897,7 +892,7 @@ returns the correct enum type detected.
<!-- function Visibility: default -->
<element name="fpgGetAvgColor">
<short>Calculates the average color using the two supplied</short>
- <descr>This function calculates and returns the average color by using AColor1
+ <descr>This function calculates and returns the average color by using AColor1
and AColor2. The Alpha value also gets taken into account.
</descr>
</element>
@@ -913,7 +908,7 @@ rectangle ARect. If it is, the function returns True, otherwise False.
<!-- procedure Visibility: default -->
<element name="SortRect">
<short>Fixes the Top, Bottom and Left, Right to always represent a valid rectangle</short>
- <descr>This function fixes a rectangle so that the Left point is always smaller than the
+ <descr>This function fixes a rectangle so that the Left point is always smaller than the
Right. And the Top is always smaller than the Bottom.
</descr>
</element>
@@ -929,7 +924,7 @@ Right. And the Top is always smaller than the Bottom.
For a detailed explanation see: http://www.nondot.org/~sabre/graphpro/line6.html
</p></descr>
</element>
-
+
<element name="TfpgCanvasBase.ClipLine">
<short>Clips the line based on AClipRect boundaries.</short>
<descr>This does not do any drawing, in only clips the line coordinates. This method is used internally by <link id="TfpgCanvasBase.DrawLineClipped"/>.</descr>
@@ -958,7 +953,7 @@ value to draw the arc.</p>
<dt>h</dt>
<dd>The height of the whole arc</dd>
<dt>a1</dt>
-<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock
+<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock
position. A value of 270 is the 6 o'clock position. Positive values move
counter-clockwise, and negative values move clockwise.</dd>
<dt>a2</dt>
@@ -974,7 +969,7 @@ goes counter-clockwise, and a negative values goes clockwise.</dd>
<element name="TfpgCanvasBase.FillArc.a1">
-<descr>This is the starting point of the arc. A value of 0 is the 3 o'clock
+<descr>This is the starting point of the arc. A value of 0 is the 3 o'clock
position. A value of 270 is the 6 o'clock position. Positive values move
counter-clockwise, and negative values move clockwise.</descr>
</element>
@@ -994,7 +989,7 @@ value to draw and fill the arc.</p>
<dt>h</dt>
<dd>The height of the whole arc</dd>
<dt>a1</dt>
-<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock
+<dd>This is the starting point of the arc. A value of 0 is the 3 o'clock
position. A value of 270 is the 6 o'clock position. Positive values move
counter-clockwise, and negative values move clockwise.</dd>
<dt>a2</dt>
diff --git a/docs/xml/corelib/fpg_main.xml b/docs/xml/corelib/fpg_main.xml
index 613c0feb..e3945fed 100644
--- a/docs/xml/corelib/fpg_main.xml
+++ b/docs/xml/corelib/fpg_main.xml
@@ -113,6 +113,19 @@ until the timer is disabled when the Enabled property is set to False.</descr>
<descr><printshort id="TfpgWindow"/>.</descr>
</element>
+<element name="TfpgImageBase">
+<short>The base class representing a image</short>
+<descr><printshort id="TfpgImageBase"/>.</descr>
+</element>
+
+<element name="TfpgImageBase.ImageData">
+<short>Contains the pixel data of the image. The data format is in AARRGGBB format.</short>
+<descr><printshort id="TfpgImageBase.ImageData"/>.</descr>
+</element>
+
+
+
+
</module>
<!-- fpg_main -->
</package>
diff --git a/docs/xml/gui/fpg_form.xml b/docs/xml/gui/fpg_form.xml
index 6a3027b1..c6c2e3d7 100644
--- a/docs/xml/gui/fpg_form.xml
+++ b/docs/xml/gui/fpg_form.xml
@@ -25,6 +25,41 @@ horizontally.
</short>
</element>
+<element name="TfpgBaseForm">
+<short>TfpgBaseForm is the base class from which to derive a window such as a form or dialog</short>
+<descr><printshort id="TfpgBaseForm"/>.</descr>
+</element>
+
+<element name="TfpgBaseForm.OnCloseQuery">
+<short>Occurs when close is attempted</short>
+<descr><p><printshort id="TfpgBaseForm.OnCloseQuery"/>. Use OnCloseQuery to specify the conditions
+under which the form can close. An OnCloseQuery event handler returns a Boolean CanClose value
+that determines whether a form is allowed to close. Its default value is True.</p>
+<p>You can use an OnCloseQuery event handler to ask users if they are sure they really want
+the form closed immediately. For example, you can use the handler to display a message box
+that prompts the user to save a file before closing the form.</p></descr>
+<seealso>
+<link id="fpg_form.TfpgBaseForm.OnClose">OnClose</link>
+</seealso>
+</element>
+
+<element name="TfpgBaseForm.OnClose">
+<short>Occurs when the form closes</short>
+<descr><p><printshort id="TfpgBaseForm.OnClose"/>. Use OnClose to perform special processing when
+the form closes. The OnClose event specifies which event handler to call when a form is about
+to close. The handler specified by OnClose might, for example, test to make sure all fields in
+a data-entry form have valid contents before allowing the form to close.</p>
+<p>A form is closed by the Close method or when the user chooses Close from the form's system
+menu.</p>
+<remark>Closing or hiding the main form terminates the application.</remark></descr>
+<seealso>
+<link id="fpg_form.TfpgBaseForm.OnCloseQuery">OnCloseQuery</link>
+</seealso></element>
+
+<!-- inherited docs -->
+<element name="TfpgForm.OnCloseQuery" link="#fpgui.fpg_form.TfpgBaseForm.OnCloseQuery"></element>
+<element name="TfpgForm.OnClose" link="#fpgui.fpg_form.TfpgBaseForm.OnClose"></element>
+
</module>
</package>
</fpdoc-descriptions>
diff --git a/docview/src/docview.project b/docview/src/docview.project
new file mode 100644
index 00000000..df16da93
--- /dev/null
+++ b/docview/src/docview.project
@@ -0,0 +1,38 @@
+[ProjectOptions]
+ProjectDir=/home/graemeg/devel/fpgui/example/apps/ide/src/
+ProjectName=docview.project
+MainUnit=docview.lpr
+TargetFile=docview${EXEEXT}
+DefaultMake=0
+UnitOutputDir=units/${TARGET}/
+MakeOptionsCount=4
+MakeOptionEnabled1=1,1,1,1,1,1
+MakeOptionEnabled2=1,1,1,1,1,0
+MakeOptionEnabled3=0,1,0,0,0,1
+MakeOptionEnabled4=0,0,0,0,0,1
+MacroCount=3
+Macro1=TargetCPU=i386
+Macro2=TargetOS=win32
+Macro3=tiOPF_fpGUI_Dir=/home/graemeg/devel/tiopf/
+UnitDirsCount=7
+UnitDirEnabled1=1,1,1,1,0,1,0,1,0,0
+UnitDirEnabled2=1,1,1,1,0,1,1,1,0,0
+UnitDirEnabled3=1,1,1,0,0,1,1,1,0,0
+UnitDirEnabled4=0,0,0,1,0,0,1,1,0,0
+UnitDirEnabled5=1,1,1,1,0,1,1,0,0,0
+UnitDirEnabled6=1,1,1,1,0,1,1,0,0,0
+UnitDirEnabled7=1,1,1,1,0,1,1,0,0,0
+MakeOption1=-l -Mobjfpc -Sch
+MakeOption2=-gl -O-
+MakeOption3=-B
+MakeOption4=-O2 -XX -Xs -CX
+UnitDir1=${FPGUIDIR}/src/
+UnitDir2=${FPGUIDIR}/src/corelib/
+UnitDir3=${FPGUIDIR}/src/corelib/x11/
+UnitDir4=${FPGUIDIR}/src/corelib/gdi/
+UnitDir5=${FPGUIDIR}/src/gui/
+UnitDir6=${FPGUIDIR}/src/gui/db/
+UnitDir7=../components/richtext/
+
+[Units]
+UnitCount=0
diff --git a/examples/apps/ide/TODO b/examples/apps/ide/TODO
index 9a90c33e..72b9f0db 100644
--- a/examples/apps/ide/TODO
+++ b/examples/apps/ide/TODO
@@ -1,6 +1,6 @@
Personal todo list for fpGUI IDE project
-
+
Legend
======
@@ -22,8 +22,8 @@ fpGUI IDE
[ ] Assembly window
[ ] CPU window
[x] Syntax highlighting with descent speed.
-[ ] Basic Search dialog
-[x] Find in Files dialog
+[x] Basic Search dialog
+[ ] Find in Files dialog
[ ] Regex support in all search dialogs
[ ] External Tools setup and usage
[ ] Keyboard Shortcuts dialog
@@ -36,7 +36,7 @@ fpGUI IDE
[ ] Unit Testing framework integration (with DUnit2 project)
[ ] Code Templates support
[o] File Browser tabsheet implementation. File navigation and opening of files.
-[ ] GoTo Line Number dialog
+[x] GoTo Line Number dialog
[ ] Converting all UI to MiG Layout Manager based dialogs.
[ ] TextEdit: enable line drawing functionality. eg: some key combination with
the cursor (arrow) keys allows line drawing. Double and single line
diff --git a/examples/apps/ide/src/extrafpc.cfg b/examples/apps/ide/src/extrafpc.cfg
index 2132065d..3622b5cf 100644
--- a/examples/apps/ide/src/extrafpc.cfg
+++ b/examples/apps/ide/src/extrafpc.cfg
@@ -1,4 +1,4 @@
--FUunits
+-FUunits/$fpctarget
-Fu../../../../lib/$fpctarget
-Fi.
-Xs
diff --git a/examples/apps/ide/src/units/i386-freebsd/.gitignore b/examples/apps/ide/src/units/i386-freebsd/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/apps/ide/src/units/i386-freebsd/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/apps/ide/src/units/i386-linux/.gitignore b/examples/apps/ide/src/units/i386-linux/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/apps/ide/src/units/i386-linux/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/apps/ide/src/units/i386-win32/.gitignore b/examples/apps/ide/src/units/i386-win32/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/apps/ide/src/units/i386-win32/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/apps/ide/src/units/x86_64-freebsd/.gitignore b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/apps/ide/src/units/x86_64-linux/.gitignore b/examples/apps/ide/src/units/x86_64-linux/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/apps/ide/src/units/x86_64-linux/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/gui/customwindow/close.bmp b/examples/gui/customwindow/close.bmp
new file mode 100644
index 00000000..af6745a5
--- /dev/null
+++ b/examples/gui/customwindow/close.bmp
Binary files differ
diff --git a/examples/gui/customwindow/custom_window.lpi b/examples/gui/customwindow/custom_window.lpi
new file mode 100644
index 00000000..2059fa29
--- /dev/null
+++ b/examples/gui/customwindow/custom_window.lpi
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+ <ProjectOptions>
+ <Version Value="9"/>
+ <General>
+ <SessionStorage Value="InProjectDir"/>
+ <MainUnit Value="0"/>
+ <Title Value="custom_window"/>
+ <UseAppBundle Value="False"/>
+ <ResourceType Value="res"/>
+ </General>
+ <i18n>
+ <EnableI18N LFM="False"/>
+ </i18n>
+ <VersionInfo>
+ <StringTable ProductVersion=""/>
+ </VersionInfo>
+ <BuildModes Count="1">
+ <Item1 Name="Default" Default="True"/>
+ </BuildModes>
+ <PublishOptions>
+ <Version Value="2"/>
+ </PublishOptions>
+ <RunParams>
+ <local>
+ <FormatVersion Value="1"/>
+ </local>
+ </RunParams>
+ <RequiredPackages Count="1">
+ <Item1>
+ <PackageName Value="fpgui_toolkit"/>
+ </Item1>
+ </RequiredPackages>
+ <Units Count="2">
+ <Unit0>
+ <Filename Value="custom_window.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="custom_window"/>
+ </Unit0>
+ <Unit1>
+ <Filename Value="images.inc"/>
+ <IsPartOfProject Value="True"/>
+ </Unit1>
+ </Units>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="11"/>
+ <SearchPaths>
+ <IncludeFiles Value="$(ProjOutDir)"/>
+ </SearchPaths>
+ </CompilerOptions>
+ <Debugging>
+ <Exceptions Count="3">
+ <Item1>
+ <Name Value="EAbort"/>
+ </Item1>
+ <Item2>
+ <Name Value="ECodetoolError"/>
+ </Item2>
+ <Item3>
+ <Name Value="EFOpenError"/>
+ </Item3>
+ </Exceptions>
+ </Debugging>
+</CONFIG>
diff --git a/examples/gui/customwindow/custom_window.lpr b/examples/gui/customwindow/custom_window.lpr
new file mode 100644
index 00000000..eab06e5d
--- /dev/null
+++ b/examples/gui/customwindow/custom_window.lpr
@@ -0,0 +1,352 @@
+{ This was a very quick and dirty demo to show how custom windows with your
+ own style of borders (eg: like Chrome or elementryOS) can be implement.
+ There is obviously lots of scope for improving this code and creating
+ custom widgets to make better use of code reuse and abstraction. }
+program custom_window;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, SysUtils,
+ fpg_base, fpg_main, fpg_form, fpg_button,
+ fpg_stylemanager, fpg_cmdlineparams, fpg_grid,
+ fpg_StringGridBuilder, fpg_editbtn, fpg_checkbox,
+ fpg_panel, fpg_dialogs;
+
+type
+
+ TMainForm = class(TfpgForm)
+ procedure ResizeClicked(Sender: TObject);
+ private
+ {@VFD_HEAD_BEGIN: MainForm}
+ btnQuit: TfpgButton;
+ Grid1: TfpgStringGrid;
+ FilenameEdit1: TfpgFileNameEdit;
+ btnGo: TfpgButton;
+ CheckBox1: TfpgCheckBox;
+ bvlTitle: TfpgBevel;
+ btnClose: TfpgImagePanel;
+ btnResize: TfpgImagePanel;
+ bvlTasks: TfpgBevel;
+ {@VFD_HEAD_END: MainForm}
+ FLastPos: TPoint;
+ FMouseTracked: Boolean;
+ procedure TitleMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
+ procedure TitleMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
+ procedure TitleMouseMoved(Sender: TObject; AShift: TShiftState; const AMousePos: TPoint);
+ procedure btnCloseClicked(Sender: TObject);
+ procedure PaintTasksPanel(Sender: TObject);
+ procedure PaintTitle(Sender: TObject);
+ procedure FormPaint(Sender: TObject);
+ procedure btnQuitClicked(Sender: TObject);
+ procedure btnGoClicked(Sender: TObject);
+ public
+ constructor Create(AOwner: TComponent); override;
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+const
+ cBackground = TfpgColor($FFf5f5f5);
+ cGradientTop = TfpgColor($FFe5e5e5);
+ cGradientBottom = TfpgColor($FFbcbcbc);
+ cBorder = TfpgColor($FF7c7c7c);
+ cGrayPanel = TfpgColor($FFdedede);
+
+ { tip: probably best to use specific fonts for specific OSes }
+ cHeader1 = 'Arial-11:bold:antialias=true';
+ cHeader2 = 'Arial-10:antialias=true';
+
+{$I images.inc}
+
+{@VFD_NEWFORM_IMPL}
+
+procedure TMainForm.ResizeClicked(Sender: TObject);
+begin
+ ShowMessage('I''ll leave this one up to you to implement and experiment with. ;-)', 'Hint');
+end;
+
+procedure TMainForm.TitleMouseDown(Sender: TObject; AButton: TMouseButton;
+ AShift: TShiftState; const AMousePos: TPoint);
+begin
+ FMouseTracked := True;
+ FLastPos := bvlTitle.WindowToScreen(self, AMousePos);
+ bvlTitle.CaptureMouse;
+end;
+
+procedure TMainForm.TitleMouseUp(Sender: TObject; AButton: TMouseButton;
+ AShift: TShiftState; const AMousePos: TPoint);
+begin
+ FMouseTracked := False;
+ bvlTitle.ReleaseMouse;
+end;
+
+procedure TMainForm.TitleMouseMoved(Sender: TObject; AShift: TShiftState;
+ const AMousePos: TPoint);
+var
+ dx, dy: integer;
+ pt: TPoint;
+begin
+ pt := WindowToScreen(self, AMousePos);
+ if not FMouseTracked then
+ begin
+ FLastPos := pt;
+ Exit;
+ end;
+
+ dx := pt.X - FLastPos.X;
+ dy := pt.Y - FLastPos.Y;
+ Left := Left + dx;
+ Top := Top + dy;
+ FLastPos := pt;
+ UpdateWindowPosition;
+end;
+
+procedure TMainForm.btnCloseClicked(Sender: TObject);
+begin
+ btnQuit.Click;
+end;
+
+procedure TMainForm.PaintTasksPanel(Sender: TObject);
+begin
+ with bvlTasks do
+ begin
+ Canvas.Clear(cGrayPanel);
+
+ Canvas.Color := cBorder;
+ Canvas.DrawRectangle(0, 0, Width, Height);
+
+ Canvas.TextColor := cBorder;
+ // Output some sample text
+ Canvas.Font := fpgGetFont(cHeader1);
+ Canvas.DrawText(8, 10, 'Personal');
+ Canvas.Font := fpgGetFont(cHeader2);
+ Canvas.DrawText(20, 30, 'Home');
+ Canvas.DrawText(20, 50, 'Documents');
+ Canvas.DrawText(20, 70, 'Music');
+ Canvas.DrawText(20, 90, 'Pictures');
+ Canvas.Font := fpgGetFont(cHeader1);
+ Canvas.DrawText(8, 110, 'Network');
+ Canvas.Font := fpgGetFont(cHeader2);
+ Canvas.DrawText(20, 130, 'Entire network');
+ end;
+end;
+
+procedure TMainForm.PaintTitle(Sender: TObject);
+var
+ r: TfpgRect;
+begin
+ r.SetRect(0, 1, Width, 46);
+ with bvlTitle do
+ begin
+ Canvas.GradientFill(r, cGradientTop, cGradientBottom, gdVertical);
+
+ Canvas.Color := TfpgColor($FFc9c9c9);
+ Canvas.DrawLine(0, Height-2, Width, Height-2);
+
+ Canvas.Color := cBorder;
+ Canvas.DrawRectangle(0, 0, Width, Height);
+
+ Canvas.TextColor := cBorder;
+ Canvas.Font := fpgGetFont(cHeader1);
+ Canvas.DrawText(30, 8, Width-60, 20, WindowTitle, [txtHCenter, txtTop]);
+ end;
+end;
+
+procedure TMainForm.FormPaint(Sender: TObject);
+begin
+ Canvas.Color := cBorder;
+ Canvas.DrawRectangle(0, 0, Width, Height);
+end;
+
+procedure TMainForm.btnQuitClicked(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TMainForm.btnGoClicked(Sender: TObject);
+var
+ sgb: TStringGridBuilder;
+begin
+ try
+ sgb := TStringGridBuilder.CreateCustom(Grid1, FilenameEdit1.FileName, CheckBox1.Checked);
+ sgb.Run;
+ finally
+ sgb.Free;
+ end;
+end;
+
+constructor TMainForm.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ Include(FWindowAttributes, waBorderLess); // borderless and steals focus like a normal form
+ FMouseTracked := False;
+
+ fpgSetNamedColor(clWindowBackground, cBackground);
+
+ fpgImages.AddBMP( // 8x9 pixels.
+ 'my.close',
+ @img_close,
+ sizeof(img_close));
+
+ fpgImages.AddBMP( // 10x11 pixels.
+ 'my.resize',
+ @img_resize,
+ sizeof(img_resize));
+end;
+
+procedure TMainForm.AfterCreate;
+begin
+ {%region 'Auto-generated GUI code' -fold}
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(464, 271, 866, 473);
+ WindowTitle := 'fpGUI Custom Window Demo';
+ Hint := '';
+ OnPaint := @FormPaint;
+
+ btnQuit := TfpgButton.Create(self);
+ with btnQuit do
+ begin
+ Name := 'btnQuit';
+ SetPosition(772, 436, 80, 23);
+ Text := 'Quit';
+ FontDesc := '#Label1';
+ Hint := '';
+ ImageName := '';
+ TabOrder := 1;
+ OnClick := @btnQuitClicked;
+ end;
+
+ Grid1 := TfpgStringGrid.Create(self);
+ with Grid1 do
+ begin
+ Name := 'Grid1';
+ SetPosition(182, 120, 666, 276);
+ BackgroundColor := TfpgColor($80000002);
+ FontDesc := '#Grid';
+ HeaderFontDesc := '#GridHeader';
+ Hint := '';
+ RowCount := 0;
+ RowSelect := False;
+ TabOrder := 2;
+ end;
+
+ FilenameEdit1 := TfpgFileNameEdit.Create(self);
+ with FilenameEdit1 do
+ begin
+ Name := 'FilenameEdit1';
+ SetPosition(182, 92, 510, 24);
+ ExtraHint := '';
+ FileName := '';
+ Filter := 'CSV Files (*.csv)|*.csv';
+ InitialDir := '';
+ TabOrder := 3;
+ end;
+
+ btnGo := TfpgButton.Create(self);
+ with btnGo do
+ begin
+ Name := 'btnGo';
+ SetPosition(768, 92, 80, 23);
+ Text := 'GO';
+ FontDesc := '#Label1';
+ Hint := '';
+ ImageName := '';
+ TabOrder := 4;
+ OnClick := @btnGoClicked;
+ end;
+
+ CheckBox1 := TfpgCheckBox.Create(self);
+ with CheckBox1 do
+ begin
+ Name := 'CheckBox1';
+ SetPosition(184, 68, 120, 19);
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 5;
+ Text := 'Has Header';
+ end;
+
+ bvlTitle := TfpgBevel.Create(self);
+ with bvlTitle do
+ begin
+ Name := 'bvlTitle';
+ SetPosition(0, 0, 866, 48);
+ Anchors := [anLeft,anRight,anTop];
+ Hint := '';
+ Shape := bsSpacer;
+ OnPaint := @PaintTitle;
+ OnMouseMove := @TitleMouseMoved;
+ OnMouseDown := @TitleMouseDown;
+ OnMouseUp := @TitleMouseUp;
+ end;
+
+ btnClose := TfpgImagePanel.Create(bvlTitle);
+ with btnClose do
+ begin
+ Name := 'btnClose';
+ SetPosition(9, 8, 8, 9);
+ OwnsImage := False;
+ OnClick := @btnCloseClicked;
+ end;
+
+ btnResize := TfpgImagePanel.Create(bvlTitle);
+ with btnResize do
+ begin
+ Name := 'btnResize';
+ SetPosition(849, 8, 10, 11);
+ OwnsImage := False;
+ OnClick := @ResizeClicked;
+ end;
+
+ bvlTasks := TfpgBevel.Create(self);
+ with bvlTasks do
+ begin
+ Name := 'bvlTasks';
+ SetPosition(0, 47, 170, 426);
+ Anchors := [anLeft,anTop,anBottom];
+ Hint := '';
+ Shape := bsSpacer;
+ OnPaint := @PaintTasksPanel;
+ end;
+
+ {@VFD_BODY_END: MainForm}
+ {%endregion}
+
+ btnClose.Image := fpgImages.GetImage('my.close');
+ btnResize.Image := fpgImages.GetImage('my.resize');
+end;
+
+
+procedure MainProc;
+var
+ frm: TMainForm;
+begin
+ fpgApplication.Initialize;
+
+ { Set our new style as the default (before we create any forms), unless
+ a the end-user specified a different style via the command line. }
+ if not gCommandLineParams.IsParam('style') then
+ begin
+ if fpgStyleManager.SetStyle('Plastic Light Gray') then
+ fpgStyle := fpgStyleManager.Style;
+ end;
+
+ frm := TMainForm.Create(nil);
+ try
+ frm.Show;
+ fpgApplication.Run;
+ finally
+ frm.Free;
+ end;
+end;
+
+begin
+ MainProc;
+end.
+
diff --git a/examples/gui/customwindow/extrafpc.cfg b/examples/gui/customwindow/extrafpc.cfg
new file mode 100644
index 00000000..89eafa99
--- /dev/null
+++ b/examples/gui/customwindow/extrafpc.cfg
@@ -0,0 +1,10 @@
+-FUunits
+-Fu../../../lib/$fpctarget
+-Fu../common/
+-Xs
+-XX
+-CX
+#ifdef mswindows
+-WG
+#endif
+
diff --git a/examples/gui/customwindow/images.inc b/examples/gui/customwindow/images.inc
new file mode 100644
index 00000000..79663a24
--- /dev/null
+++ b/examples/gui/customwindow/images.inc
@@ -0,0 +1,57 @@
+
+const
+ img_close: array[0..337] of byte = (
+ 66, 77, 82, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0,
+ 0, 8, 0, 0, 0, 9, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 216, 0, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,226,226,226,238,238,238,225,225,225,223,223,223,223,223,
+ 223,226,226,226,238,238,238,226,226,226,228,228,228,184,184,184,231,
+ 231,231,226,226,226,226,226,226,230,230,230,184,184,184,228,228,228,
+ 172,172,172,160,160,160,173,173,173,231,231,231,231,231,231,173,173,
+ 173,160,160,160,172,172,172,216,216,216,159,159,159,153,153,153,170,
+ 170,170,168,168,168,153,153,153,157,157,157,215,215,215,225,225,225,
+ 219,219,219,165,165,165,149,149,149,149,149,149,162,162,162,218,218,
+ 218,225,225,225,227,227,227,229,229,229,158,158,158,141,141,141,142,
+ 142,142,163,163,163,232,232,232,227,227,227,227,227,227,152,152,152,
+ 136,136,136,146,146,146,144,144,144,136,136,136,154,154,154,228,228,
+ 228,149,149,149,128,128,128,140,140,140,217,217,217,215,215,215,138,
+ 138,138,128,128,128,150,150,150,213,213,213,147,147,147,214,214,214,
+ 226,226,226,226,226,226,214,214,214,146,146,146,213,213,213);
+
+
+const
+ img_resize: array[0..473] of byte = (
+ 66, 77,218, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0,
+ 0, 10, 0, 0, 0, 11, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 96, 1, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,242,242,242,242,242,242,242,242,242,242,242,242,233,233,
+ 233,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0,
+ 0,167,167,167,167,167,167,167,167,167,162,162,162,189,189,189,223,
+ 223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0, 0,157,
+ 157,157,157,157,157,157,157,157,193,193,193,226,226,226,224,224,224,
+ 224,224,224,224,224,224,224,224,224,224,224,224, 0, 0,146,146,146,
+ 141,141,141,144,144,144,164,164,164,229,229,229,224,224,224,224,224,
+ 224,224,224,224,224,224,224,224,224,224, 0, 0,131,131,131,175,175,
+ 175,146,146,146,133,133,133,153,153,153,224,224,224,224,224,224,224,
+ 224,224,224,224,224,224,224,224, 0, 0,174,174,174,225,225,225,215,
+ 215,215,146,146,146,208,208,208,228,228,228,239,239,239,227,227,227,
+ 225,225,225,235,235,235, 0, 0,225,225,225,225,225,225,225,225,225,
+ 225,225,225,225,225,225,225,225,225,183,183,183,232,232,232,235,235,
+ 235,201,201,201, 0, 0,226,226,226,226,226,226,226,226,226,226,226,
+ 226,226,226,226,167,167,167,153,153,153,167,167,167,193,193,193,154,
+ 154,154, 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226,
+ 226,226,215,215,215,152,152,152,144,144,144,144,144,144,144,144,144,
+ 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,
+ 235,235,235,184,184,184,134,134,134,134,134,134,134,134,134, 0, 0,
+ 227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,168,168,
+ 168,115,115,115,115,115,115,115,115,115,115,115,115, 0, 0);
+
+
diff --git a/examples/gui/customwindow/resize.bmp b/examples/gui/customwindow/resize.bmp
new file mode 100644
index 00000000..8bb264cf
--- /dev/null
+++ b/examples/gui/customwindow/resize.bmp
Binary files differ
diff --git a/examples/gui/customwindow/units/.gitignore b/examples/gui/customwindow/units/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/examples/gui/customwindow/units/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi
index 872cf6e3..f6efbd83 100644
--- a/examples/gui/filedialog/filedialog.lpi
+++ b/examples/gui/filedialog/filedialog.lpi
@@ -36,7 +36,6 @@
<Unit0>
<Filename Value="filedialog.lpr"/>
<IsPartOfProject Value="True"/>
- <UnitName Value="filedialog"/>
</Unit0>
</Units>
</ProjectOptions>
@@ -54,6 +53,7 @@
</SyntaxOptions>
</Parsing>
<Other>
+ <CustomOptions Value="-FUunits"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr
index 315b7885..1294ac06 100644
--- a/examples/gui/filedialog/filedialog.lpr
+++ b/examples/gui/filedialog/filedialog.lpr
@@ -119,7 +119,7 @@ procedure TMainForm.btnOpenFileClick(Sender: TObject);
var
dlg: TfpgFileDialog;
begin
- dlg := TfpgFileDialog.Create(nil);
+ dlg := TfpgFileDialog.Create(Self);
try
// defines 3 filters (All Files, Object Pascal and Lazarus Project)
dlg.Filter := 'All Files (*)|*|Object Pascal (*.pas;*.lpr;*.pp)|*.pas;*.lpr;*.pp|Lazarus Project (*.lpi)|*.lpi';
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr
index 173806e9..4b53f260 100644
--- a/examples/gui/gridtest/gridtest.lpr
+++ b/examples/gui/gridtest/gridtest.lpr
@@ -17,7 +17,8 @@ uses
fpg_checkbox,
fpg_tab,
fpg_edit,
- fpg_dialogs;
+ fpg_dialogs,
+ fpg_scrollbar;
type
@@ -256,6 +257,14 @@ begin
OnDrawCell := @StringGridDrawCell;
OnDoubleClick := @StringGridDoubleClicked;
OnHeaderClick := @StringGridHeaderClicked;
+ // Testing various scrollbar styles
+// ScrollBarStyle:= ssNone;
+// ScrollBarStyle:= ssHorizontal;
+// ScrollBarStyle:= ssVertical;
+ ScrollBarStyle:= ssAutoBoth;
+// ScrollBarStyle:= ssHorizVisible;
+// ScrollBarStyle:= ssVertiVisible;
+// ScrollBarStyle:= ssBothVisible;
end;
chkShowHeader := TfpgCheckBox.Create(self);
diff --git a/examples/gui/modalforms/modalforms.lpi b/examples/gui/modalforms/modalforms.lpi
index cc8137c8..2f25e23a 100644
--- a/examples/gui/modalforms/modalforms.lpi
+++ b/examples/gui/modalforms/modalforms.lpi
@@ -36,7 +36,6 @@
<Unit0>
<Filename Value="modalforms.lpr"/>
<IsPartOfProject Value="True"/>
- <UnitName Value="modalforms"/>
</Unit0>
</Units>
</ProjectOptions>
@@ -54,6 +53,7 @@
</SyntaxOptions>
</Parsing>
<Other>
+ <CustomOptions Value="-FUunits"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr
index 99f53ab3..bac0af81 100644
--- a/examples/gui/modalforms/modalforms.lpr
+++ b/examples/gui/modalforms/modalforms.lpr
@@ -99,7 +99,7 @@ procedure TForm1.btnOpenForm2Click(Sender: TObject);
var
frm: TForm2;
begin
- frm := TForm2.Create(nil);
+ frm := TForm2.Create(Self);
try
frm.ShowModal;
writeln('Form2: This should only appear after the form closes.');
@@ -113,6 +113,7 @@ end;
constructor TForm1.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
+ Visible:=False;
WindowTitle := 'Form1';
Sizeable := False;
SetPosition(150, 150, 200, 200);
@@ -144,7 +145,7 @@ procedure TMainForm.btnOpenForm1Click(Sender: TObject);
var
frm: TForm1;
begin
- frm := TForm1.Create(nil);
+ frm := TForm1.Create(Self);
try
frm.ShowModal;
writeln('Form1: This should only appear after the form closes.');
diff --git a/examples/gui/video_vlc/frmvlcplayer.pas b/examples/gui/video_vlc/frmvlcplayer.pas
index 7b44c1e1..aeea3e0c 100644
--- a/examples/gui/video_vlc/frmvlcplayer.pas
+++ b/examples/gui/video_vlc/frmvlcplayer.pas
@@ -6,7 +6,7 @@ interface
uses
SysUtils, Classes, fpg_base, fpg_panel, fpg_button, fpg_main, fpg_form,
- fpg_editbtn, fpg_memo, fpg_label, libvlc, vlc, fpg_vlc;
+ fpg_editbtn, fpg_memo, fpg_label, vlc, fpg_vlc;
type
@@ -23,8 +23,8 @@ type
Button3: TfpgButton;
Button4: TfpgButton;
Memo1: TfpgMemo;
- procedure Sync;
{@VFD_HEAD_END: VLCPlayerDemo}
+ procedure Sync;
public
P : TFpgVLCPlayer;
FMsg: String;
diff --git a/examples/gui/video_vlc/testfpguivlc.lpi b/examples/gui/video_vlc/testfpguivlc.lpi
index d7a4ad2a..7839f71a 100644
--- a/examples/gui/video_vlc/testfpguivlc.lpi
+++ b/examples/gui/video_vlc/testfpguivlc.lpi
@@ -50,17 +50,17 @@
<UnitName Value="frmvlcplayer"/>
</Unit1>
<Unit2>
- <Filename Value="../fpg_vlc.pas"/>
+ <Filename Value="../../../src/3rdparty/libvlc/fpg_vlc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="fpg_vlc"/>
</Unit2>
<Unit3>
- <Filename Value="../../libvlc/libvlc.pp"/>
+ <Filename Value="../../../src/3rdparty/libvlc/libvlc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="libvlc"/>
</Unit3>
<Unit4>
- <Filename Value="../../libvlc/vlc.pas"/>
+ <Filename Value="../../../src/3rdparty/libvlc/vlc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="vlc"/>
</Unit4>
diff --git a/languages/fpgui.af.po b/languages/fpgui.af.po
index 7a6bb628..98ac495d 100644
--- a/languages/fpgui.af.po
+++ b/languages/fpgui.af.po
@@ -76,6 +76,10 @@ msgstr "Augustus"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Vetdruk"
@@ -100,6 +104,10 @@ msgstr "Verander Titel"
msgid "Character Map"
msgstr "Karakter Kaart"
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Sluit"
@@ -108,6 +116,10 @@ msgstr "Sluit"
msgid "Collection"
msgstr "Versameling"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr "Instel Boekmerke"
@@ -120,6 +132,10 @@ msgstr "Bevestig"
msgid "Confirmation"
msgstr "Bevestiging"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Kopieer"
@@ -280,6 +296,10 @@ msgstr "Vr"
msgid "Friday"
msgstr "Vrydag"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Groep"
@@ -288,6 +308,10 @@ msgstr "Groep"
msgid "Help"
msgstr "Help"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr "Voorskou"
@@ -472,6 +500,10 @@ msgstr "Voorskou"
msgid "Recently Used"
msgstr "Onlangs gebruik"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Vervang"
diff --git a/languages/fpgui.de.po b/languages/fpgui.de.po
index e079f440..09e4ae1a 100644
--- a/languages/fpgui.de.po
+++ b/languages/fpgui.de.po
@@ -75,6 +75,10 @@ msgstr "August"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Fett"
@@ -99,6 +103,10 @@ msgstr ""
msgid "Character Map"
msgstr ""
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Schließen"
@@ -107,6 +115,10 @@ msgstr "Schließen"
msgid "Collection"
msgstr "Sammlung"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr ""
@@ -119,6 +131,10 @@ msgstr "Bestätigen"
msgid "Confirmation"
msgstr "Bestätigung"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Kopieren"
@@ -279,6 +295,10 @@ msgstr "Fre"
msgid "Friday"
msgstr "Freitag"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Gruppe"
@@ -287,6 +307,10 @@ msgstr "Gruppe"
msgid "Help"
msgstr "Hilfe"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -463,6 +487,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -471,6 +499,10 @@ msgstr ""
msgid "Recently Used"
msgstr "Zuletzt verwendet"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Ersetzen"
diff --git a/languages/fpgui.en.po b/languages/fpgui.en.po
index fe4e5c70..20f85e86 100644
--- a/languages/fpgui.en.po
+++ b/languages/fpgui.en.po
@@ -76,6 +76,10 @@ msgstr ""
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr ""
@@ -100,6 +104,10 @@ msgstr ""
msgid "Character Map"
msgstr ""
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr ""
@@ -108,6 +116,10 @@ msgstr ""
msgid "Collection"
msgstr ""
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr ""
@@ -120,6 +132,10 @@ msgstr ""
msgid "Confirmation"
msgstr ""
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr ""
@@ -280,6 +296,10 @@ msgstr ""
msgid "Friday"
msgstr ""
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr ""
@@ -288,6 +308,10 @@ msgstr ""
msgid "Help"
msgstr ""
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -472,6 +500,10 @@ msgstr ""
msgid "Recently Used"
msgstr ""
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr ""
diff --git a/languages/fpgui.es.po b/languages/fpgui.es.po
index c33ce8af..181fa6a3 100644
--- a/languages/fpgui.es.po
+++ b/languages/fpgui.es.po
@@ -76,6 +76,10 @@ msgstr ""
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Negrita"
@@ -100,6 +104,10 @@ msgstr ""
msgid "Character Map"
msgstr ""
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Cerrar"
@@ -108,6 +116,10 @@ msgstr "Cerrar"
msgid "Collection"
msgstr "Colección"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr ""
@@ -120,6 +132,10 @@ msgstr "Confirmar"
msgid "Confirmation"
msgstr "Confirmación"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Copiar"
@@ -280,6 +296,10 @@ msgstr "Vie"
msgid "Friday"
msgstr "Viernes"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Grupo"
@@ -288,6 +308,10 @@ msgstr "Grupo"
msgid "Help"
msgstr "Ayuda"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -472,6 +500,10 @@ msgstr ""
msgid "Recently Used"
msgstr "Usados Recientemente"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Reemplazar"
diff --git a/languages/fpgui.fr.po b/languages/fpgui.fr.po
index 9bbc641c..303891bb 100644
--- a/languages/fpgui.fr.po
+++ b/languages/fpgui.fr.po
@@ -76,6 +76,10 @@ msgstr "Août"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Gras"
@@ -100,6 +104,10 @@ msgstr "Changer le titre"
msgid "Character Map"
msgstr "Table de caractères"
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Fermer"
@@ -108,6 +116,10 @@ msgstr "Fermer"
msgid "Collection"
msgstr "Collection"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr "Configurer les signets"
@@ -120,6 +132,10 @@ msgstr "Confirmer"
msgid "Confirmation"
msgstr "Confirmation"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Copier"
@@ -280,6 +296,10 @@ msgstr "Ven"
msgid "Friday"
msgstr "Vendredi"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Groupe"
@@ -288,6 +308,10 @@ msgstr "Groupe"
msgid "Help"
msgstr "Aide"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr "Prévisualisation"
@@ -472,6 +500,10 @@ msgstr "Prévisualisation"
msgid "Recently Used"
msgstr "Récemment utilisé"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Remplacer"
diff --git a/languages/fpgui.it.po b/languages/fpgui.it.po
index 9231802a..795ed273 100644
--- a/languages/fpgui.it.po
+++ b/languages/fpgui.it.po
@@ -76,6 +76,10 @@ msgstr "Agosto"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Grassetto"
@@ -100,6 +104,10 @@ msgstr ""
msgid "Character Map"
msgstr ""
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Chiudi"
@@ -108,6 +116,10 @@ msgstr "Chiudi"
msgid "Collection"
msgstr "Collezione"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr ""
@@ -120,6 +132,10 @@ msgstr "Conferma"
msgid "Confirmation"
msgstr "Conferma"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Copia"
@@ -280,6 +296,10 @@ msgstr "Ven"
msgid "Friday"
msgstr "Venerdì"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Gruppo"
@@ -288,6 +308,10 @@ msgstr "Gruppo"
msgid "Help"
msgstr "Aiuto"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -472,6 +500,10 @@ msgstr ""
msgid "Recently Used"
msgstr "Usati Recentemente"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Sostituisci"
diff --git a/languages/fpgui.po b/languages/fpgui.po
index 4c6a64ef..7ecf17b4 100644
--- a/languages/fpgui.po
+++ b/languages/fpgui.po
@@ -642,3 +642,35 @@ msgstr ""
msgid "of"
msgstr ""
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
diff --git a/languages/fpgui.pt.po b/languages/fpgui.pt.po
index ab5cddb2..e3ea6725 100644
--- a/languages/fpgui.pt.po
+++ b/languages/fpgui.pt.po
@@ -76,6 +76,10 @@ msgstr "Agosto"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr ""
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Negrito"
@@ -100,6 +104,10 @@ msgstr "Mudar Título"
msgid "Character Map"
msgstr "Mapa de Caracteres"
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Fechar"
@@ -108,6 +116,10 @@ msgstr "Fechar"
msgid "Collection"
msgstr "Coleção"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
msgstr ""
@@ -120,6 +132,10 @@ msgstr "Confirmar"
msgid "Confirmation"
msgstr "Confirmação"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Copiar"
@@ -280,6 +296,10 @@ msgstr "Sex"
msgid "Friday"
msgstr "Sexta-feira"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Grupo"
@@ -288,6 +308,10 @@ msgstr "Grupo"
msgid "Help"
msgstr "Ajuda"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -472,6 +500,10 @@ msgstr ""
msgid "Recently Used"
msgstr "Recentemente Usado"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Substituir"
diff --git a/languages/fpgui.ru.po b/languages/fpgui.ru.po
index 7cf1cc80..2b501756 100644
--- a/languages/fpgui.ru.po
+++ b/languages/fpgui.ru.po
@@ -30,7 +30,7 @@ msgstr "Информация о %s"
#: fpg_constants:rsaddcurrentdirectory
msgid "Add current directory"
-msgstr ""
+msgstr "Добавить текущую директорию"
#: fpg_constants:rsall
msgid "All"
@@ -76,6 +76,10 @@ msgstr "Август"
msgid "BkSp"
msgstr ""
+#: fpg_constants:rscolorblue
+msgid "Blue"
+msgstr "Синий"
+
#: fpg_constants:rsbold
msgid "Bold"
msgstr "Жирный"
@@ -94,12 +98,16 @@ msgstr "Изменить"
#: fpg_constants:rschangetitle
msgid "Change Title"
-msgstr ""
+msgstr "Изменить Заголовок"
#: fpg_constants:rscharactermap
msgid "Character Map"
msgstr ""
+#: fpg_constants:rscolorpickerhint
+msgid "Click on Picker and maintain click => release to get the color"
+msgstr ""
+
#: fpg_constants:rsclose
msgid "Close"
msgstr "Закрыть"
@@ -108,9 +116,13 @@ msgstr "Закрыть"
msgid "Collection"
msgstr "Группа"
+#: fpg_constants:rstabsheetcolorwheel
+msgid "Color Wheel"
+msgstr ""
+
#: fpg_constants:rsconfigurebookmarks
msgid "Configure Bookmarks"
-msgstr ""
+msgstr "Настроить Закладки"
#: fpg_constants:rsconfirm
msgid "Confirm"
@@ -120,6 +132,10 @@ msgstr "Подтвердить"
msgid "Confirmation"
msgstr "Подтверждение"
+#: fpg_constants:rscontinuous
+msgid "Continuous"
+msgstr ""
+
#: fpg_constants:rscopy
msgid "Copy"
msgstr "Копировать"
@@ -174,7 +190,7 @@ msgstr "Директории"
#: fpg_constants:rsdirectory
msgid "Directory"
-msgstr ""
+msgstr "Директория"
#: fpg_constants:rskeydown
msgid "Down"
@@ -270,7 +286,7 @@ msgstr "Псевдонимы шрифтов"
#: fpg_constants:rserrreportfontfilemissing
msgid "Font file <%s.fnt> not found"
-msgstr ""
+msgstr "Файл шрифта <%s.fnt> не найден"
#: fpg_constants:rsshortfri
msgid "Fri"
@@ -280,6 +296,10 @@ msgstr "Пт"
msgid "Friday"
msgstr "Пятница"
+#: fpg_constants:rscolorgreen
+msgid "Green"
+msgstr ""
+
#: fpg_constants:rsfilegroup
msgid "Group"
msgstr "Группа"
@@ -288,6 +308,10 @@ msgstr "Группа"
msgid "Help"
msgstr "Справка"
+#: fpg_constants:rshexadecimal
+msgid "Hexadecimal"
+msgstr ""
+
#: fpg_constants:rskeyhome
msgid "Home"
msgstr ""
@@ -298,7 +322,7 @@ msgstr "Пропустить"
#: fpg_constants:rserrreportimagefilemissing
msgid "Image <%s> is missing"
-msgstr ""
+msgstr "Изображение <%s> не найдено"
#: fpg_constants:rsinformation
msgid "Information"
@@ -442,7 +466,7 @@ msgstr "Владелец"
#: fpg_constants:rsfiletypepdf
msgid "PDF Documents"
-msgstr ""
+msgstr "PDF Документы"
#: fpg_constants:rsreportpage
msgid "Page"
@@ -464,6 +488,10 @@ msgstr ""
msgid "PgUp"
msgstr ""
+#: fpg_constants:rstabpredefined
+msgid "Predefined"
+msgstr ""
+
#: fpg_constants:rsreportpreview
msgid "Preview"
msgstr ""
@@ -472,6 +500,10 @@ msgstr ""
msgid "Recently Used"
msgstr "Ранее использованные"
+#: fpg_constants:rscolorred
+msgid "Red"
+msgstr ""
+
#: fpg_constants:rsreplace
msgid "Replace"
msgstr "Заменить"
@@ -578,7 +610,7 @@ msgstr ""
#: fpg_constants:rserrreportnopagestoprint
msgid "There are no pages to print"
-msgstr ""
+msgstr "Нет страниц для печати"
#: fpg_constants:rsshortthu
msgid "Thu"
diff --git a/src/build.bat b/src/build.bat
index 6928adfe..741048db 100644
--- a/src/build.bat
+++ b/src/build.bat
@@ -18,5 +18,5 @@ echo "You've got the correct output lib directory"
:end
-fpc -dRELEASE -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas
+fpc -dDEBUG -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas
diff --git a/src/build.sh b/src/build.sh
index 8f90fdae..8a180ceb 100755
--- a/src/build.sh
+++ b/src/build.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-fpctarget=`fpc -iTP`-`fpc -iTO`
+fpcbin=fpc
+fpctarget=`$fpcbin -iTP`-`$fpcbin -iTO`
#echo $fpctarget
libpath='../lib/'$fpctarget
@@ -12,7 +13,8 @@ if [ ! -d $libpath ]; then
fi
# Default build
-fpc -dRELEASE -dX11 @extrafpc.cfg corelib/x11/fpgui_toolkit.pas
+$fpcbin -dDEBUG -dX11 @extrafpc.cfg corelib/x11/fpgui_toolkit.pas
+
# experimental AggPas-enabled Canvas under X11
-#fpc -dRELEASE -dX11 -dAGGCanvas @extrafpc.cfg corelib/x11/fpgui_toolkit.pas
+#$fpcbin -dDEBUG -dX11 -dAGGCanvas @extrafpc.cfg corelib/x11/fpgui_toolkit.pas
diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas
index eb7136b8..e6e3ab7e 100644
--- a/src/corelib/fpg_base.pas
+++ b/src/corelib/fpg_base.pas
@@ -2187,7 +2187,7 @@ begin
p := FImageData;
Inc(p, (FWidth * y) + x);
p^ := AValue;
-// write(IntToHex(AValue, 6) + ' ');
+// write(IntToHex(AValue, 8) + ' ');
end;
constructor TfpgImageBase.Create;
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas
index 8bdb33bd..d74a9be4 100644
--- a/src/corelib/fpg_main.pas
+++ b/src/corelib/fpg_main.pas
@@ -191,14 +191,26 @@ type
will rework this to use a Style Manager like the previous fpGUI.
Also support Bitmap based styles for easier theme implementations. }
TfpgStyle = class(TObject)
+ protected
+ FDefaultFont: TfpgFont;
+ FFixedFont: TfpgFont;
+ FMenuAccelFont: TfpgFont;
+ FMenuDisabledFont: TfpgFont;
+ FMenuFont: TfpgFont;
+ procedure SetDefaultFont(AValue: TfpgFont);
+ procedure SetFixedFont(AValue: TfpgFont);
+ procedure SetMenuAccelFont(AValue: TfpgFont);
+ procedure SetMenuDisabledFont(AValue: TfpgFont);
+ procedure SetMenuFont(AValue: TfpgFont);
public
- DefaultFont: TfpgFont;
- FixedFont: TfpgFont;
- MenuFont: TfpgFont;
- MenuAccelFont: TfpgFont;
- MenuDisabledFont: TfpgFont;
constructor Create; virtual;
destructor Destroy; override;
+ { font objects }
+ property DefaultFont: TfpgFont read FDefaultFont write SetDefaultFont;
+ property FixedFont: TfpgFont read FFixedFont write SetFixedFont;
+ property MenuFont: TfpgFont read FMenuFont write SetMenuFont;
+ property MenuAccelFont: TfpgFont read FMenuAccelFont write SetMenuAccelFont;
+ property MenuDisabledFont: TfpgFont read FMenuDisabledFont write SetMenuDisabledFont;
{ General }
procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); virtual; overload;
procedure DrawControlFrame(ACanvas: TfpgCanvas; r: TfpgRect); overload;
@@ -510,7 +522,7 @@ type
end;
- TNamedFontItem = class
+ TNamedFontItem = class(TObject)
public
FontID: string;
FontDesc: string;
@@ -2017,10 +2029,13 @@ begin
FModalForWin := nil;
- if (AOwner <> nil) and (AOwner is TfpgWindow) then
- FWindowType := wtChild
- else
- FWindowType := wtWindow;
+ if not (FWindowType in [wtModalForm, wtPopup]) then
+ begin
+ if (AOwner <> nil) and (AOwner is TfpgWindow) then
+ FWindowType := wtChild
+ else
+ FWindowType := wtWindow;
+ end;
FCanvas := CreateCanvas;
end;
@@ -2049,6 +2064,41 @@ end;
{ TfpgStyle }
+procedure TfpgStyle.SetDefaultFont(AValue: TfpgFont);
+begin
+ if FDefaultFont = AValue then Exit;
+ FDefaultFont.Free;
+ FDefaultFont := AValue;
+end;
+
+procedure TfpgStyle.SetFixedFont(AValue: TfpgFont);
+begin
+ if FFixedFont = AValue then Exit;
+ FFixedFont.Free;
+ FFixedFont := AValue;
+end;
+
+procedure TfpgStyle.SetMenuAccelFont(AValue: TfpgFont);
+begin
+ if FMenuAccelFont = AValue then Exit;
+ FMenuAccelFont.Free;
+ FMenuAccelFont := AValue;
+end;
+
+procedure TfpgStyle.SetMenuDisabledFont(AValue: TfpgFont);
+begin
+ if FMenuDisabledFont = AValue then Exit;
+ FMenuDisabledFont.Free;
+ FMenuDisabledFont := AValue;
+end;
+
+procedure TfpgStyle.SetMenuFont(AValue: TfpgFont);
+begin
+ if FMenuFont = AValue then Exit;
+ FMenuFont.Free;
+ FMenuFont := AValue;
+end;
+
constructor TfpgStyle.Create;
begin
// Setup font aliases
@@ -2101,20 +2151,20 @@ begin
// Global Font Objects
- DefaultFont := fpgGetFont(fpgGetNamedFontDesc('Label1'));
- FixedFont := fpgGetFont(fpgGetNamedFontDesc('Edit2'));
- MenuFont := fpgGetFont(fpgGetNamedFontDesc('Menu'));
- MenuAccelFont := fpgGetFont(fpgGetNamedFontDesc('MenuAccel'));
- MenuDisabledFont := fpgGetFont(fpgGetNamedFontDesc('MenuDisabled'));
+ FDefaultFont := fpgGetFont(fpgGetNamedFontDesc('Label1'));
+ FFixedFont := fpgGetFont(fpgGetNamedFontDesc('Edit2'));
+ FMenuFont := fpgGetFont(fpgGetNamedFontDesc('Menu'));
+ FMenuAccelFont := fpgGetFont(fpgGetNamedFontDesc('MenuAccel'));
+ FMenuDisabledFont := fpgGetFont(fpgGetNamedFontDesc('MenuDisabled'));
end;
destructor TfpgStyle.Destroy;
begin
- DefaultFont.Free;
- FixedFont.Free;
- MenuFont.Free;
- MenuAccelFont.Free;
- MenuDisabledFont.Free;
+ FDefaultFont.Free;
+ FFixedFont.Free;
+ FMenuFont.Free;
+ FMenuAccelFont.Free;
+ FMenuDisabledFont.Free;
inherited Destroy;
end;
diff --git a/src/corelib/fpg_stdimages.pas b/src/corelib/fpg_stdimages.pas
index b02331aa..a641fa32 100644
--- a/src/corelib/fpg_stdimages.pas
+++ b/src/corelib/fpg_stdimages.pas
@@ -288,7 +288,12 @@ begin
'stdimg.executable',
@stdimg_executable_16,
sizeof(stdimg_executable_16), 0,0);
-
+
+ fpgImages.AddMaskedBMP(
+ 'stdimg.colpicker',
+ @stdimg_colpicker,
+ sizeof(stdimg_colpicker), 0,0);
+
// Dialog icons
fpgImages.AddMaskedBMP(
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas
index 872ac2c8..150a8284 100644
--- a/src/corelib/fpg_widget.pas
+++ b/src/corelib/fpg_widget.pas
@@ -39,8 +39,6 @@ type
TfpgDragDropEvent = procedure(Sender, Source: TObject; X, Y: integer; AData: variant) of object;
- { TfpgWidget }
-
TfpgWidget = class(TfpgWindow)
private
FAcceptDrops: boolean;
@@ -509,7 +507,7 @@ begin
inherited Create(AOwner);
- if (AOwner <> nil) and (AOwner is TfpgWidget) then
+ if (AOwner <> nil) and (AOwner is TfpgWidget) and (not (WindowType in [wtModalForm, wtPopup])) {and not InheritsFrom(TfpgForm)} then
begin
Parent := TfpgWidget(AOwner);
FTabOrder := AOwner.ComponentCount;
diff --git a/src/corelib/lang_af.inc b/src/corelib/lang_af.inc
index 9a97a50d..173dd6b2 100644
--- a/src/corelib/lang_af.inc
+++ b/src/corelib/lang_af.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Eienskape';
rsshortaug = 'Aug';
rslongaug = 'Augustus';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Vetdruk';
rscancel = 'Kanselleer';
rscannotcreatedir = 'Kan nie die lêergids skep nie';
rschange = 'Verander';
rschangetitle = 'Verander Titel';
rscharactermap = 'Karakter Kaart';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Sluit';
rscollection = 'Versameling';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Instel Boekmerke';
rsconfirm = 'Bevestig';
rsconfirmation = 'Bevestiging';
+rscontinuous = 'Continuous';
rscopy = 'Kopieer';
rserrcouldnotopendir = 'Kon nie die lêergids <%s> oop maak nie';
rscreate = 'Skep';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Kenname';
rserrreportfontfilemissing = 'Font lêer" <%s.fnt> is nie gevind nie';
rsshortfri = 'Vr';
rslongfri = 'Vrydag';
+rscolorgreen = 'Green';
rsfilegroup = 'Groep';
rshelp = 'Help';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignoreer';
rserrreportimagefilemissing = 'Beeld-lêer <%s> is vermis';
@@ -117,8 +123,10 @@ rspassword = 'Wagwoord';
rspaste = 'Plak';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Voorskou';
rscollectionrecentlyused = 'Onlangs gebruik';
+rscolorred = 'Red';
rsreplace = 'Vervang';
rsretry = 'Herprobeer';
rskeyright = 'Right';
diff --git a/src/corelib/lang_de.inc b/src/corelib/lang_de.inc
index e8fe0a9a..a261926f 100644
--- a/src/corelib/lang_de.inc
+++ b/src/corelib/lang_de.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Attribute';
rsshortaug = 'Aug';
rslongaug = 'August';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Fett';
rscancel = 'Abbrechen';
rscannotcreatedir = 'Kann Verzeichnis nicht anlegen';
rschange = 'Ändern';
rschangetitle = 'Change Title';
rscharactermap = 'Character Map';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Schließen';
rscollection = 'Sammlung';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Bestätigen';
rsconfirmation = 'Bestätigung';
+rscontinuous = 'Continuous';
rscopy = 'Kopieren';
rserrcouldnotopendir = 'Konnte Verzeichnis <%> nicht anlegen';
rscreate = 'Anlegen';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font-Aliase';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Fre';
rslongfri = 'Freitag';
+rscolorgreen = 'Green';
rsfilegroup = 'Gruppe';
rshelp = 'Hilfe';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Übergehen';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Passwort';
rspaste = 'Einfügen';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Zuletzt verwendet';
+rscolorred = 'Red';
rsreplace = 'Ersetzen';
rsretry = 'Wiederholen';
rskeyright = 'Right';
diff --git a/src/corelib/lang_en.inc b/src/corelib/lang_en.inc
index 6a681932..aec26b22 100644
--- a/src/corelib/lang_en.inc
+++ b/src/corelib/lang_en.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Attributes';
rsshortaug = 'Aug';
rslongaug = 'August';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Bold';
rscancel = 'Cancel';
rscannotcreatedir = 'Cannot create directory';
rschange = 'Change';
rschangetitle = 'Change Title';
rscharactermap = 'Character Map';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Close';
rscollection = 'Collection';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Confirm';
rsconfirmation = 'Confirmation';
+rscontinuous = 'Continuous';
rscopy = 'Copy';
rserrcouldnotopendir = 'Could not open the directory <%s>';
rscreate = 'Create';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Fri';
rslongfri = 'Friday';
+rscolorgreen = 'Green';
rsfilegroup = 'Group';
rshelp = 'Help';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignore';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Password';
rspaste = 'Paste';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Recently Used';
+rscolorred = 'Red';
rsreplace = 'Replace';
rsretry = 'Retry';
rskeyright = 'Right';
diff --git a/src/corelib/lang_es.inc b/src/corelib/lang_es.inc
index 780af188..f53ccb76 100644
--- a/src/corelib/lang_es.inc
+++ b/src/corelib/lang_es.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Atributos';
rsshortaug = 'Aug';
rslongaug = 'August';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Negrita';
rscancel = 'Cancelar';
rscannotcreatedir = 'No se puede crear la carpeta';
rschange = 'Cambiar';
rschangetitle = 'Change Title';
rscharactermap = 'Character Map';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Cerrar';
rscollection = 'Colección';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Confirmar';
rsconfirmation = 'Confirmación';
+rscontinuous = 'Continuous';
rscopy = 'Copiar';
rserrcouldnotopendir = 'No se puede abrir la carpeta <%s>';
rscreate = 'Create';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Aliases de Fuentes';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Vie';
rslongfri = 'Viernes';
+rscolorgreen = 'Green';
rsfilegroup = 'Grupo';
rshelp = 'Ayuda';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignorar';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Contraseña';
rspaste = 'Pegar';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Usados Recientemente';
+rscolorred = 'Red';
rsreplace = 'Reemplazar';
rsretry = 'Reintentar';
rskeyright = 'Right';
diff --git a/src/corelib/lang_fr.inc b/src/corelib/lang_fr.inc
index f111a2ea..0a9a8e21 100644
--- a/src/corelib/lang_fr.inc
+++ b/src/corelib/lang_fr.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Attributs';
rsshortaug = 'Aoû';
rslongaug = 'Août';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Gras';
rscancel = 'Annuler';
rscannotcreatedir = 'Impossible de créer le répertoire';
rschange = 'Modifier';
rschangetitle = 'Changer le titre';
rscharactermap = 'Table de caractères';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Fermer';
rscollection = 'Collection';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configurer les signets';
rsconfirm = 'Confirmer';
rsconfirmation = 'Confirmation';
+rscontinuous = 'Continuous';
rscopy = 'Copier';
rserrcouldnotopendir = 'Le répertoire <%s> n''''a pas pu être ouvert';
rscreate = 'Créer';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Alias';
rserrreportfontfilemissing = 'Fichier de police <%s.fnt> non trouvé';
rsshortfri = 'Ven';
rslongfri = 'Vendredi';
+rscolorgreen = 'Green';
rsfilegroup = 'Groupe';
rshelp = 'Aide';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignorer';
rserrreportimagefilemissing = 'Image <%s> introuvable';
@@ -117,8 +123,10 @@ rspassword = 'Mot de passe';
rspaste = 'Coller';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Prévisualisation';
rscollectionrecentlyused = 'Récemment utilisé';
+rscolorred = 'Red';
rsreplace = 'Remplacer';
rsretry = 'Retenter';
rskeyright = 'Right';
diff --git a/src/corelib/lang_it.inc b/src/corelib/lang_it.inc
index 2ab860ad..26eb36d8 100644
--- a/src/corelib/lang_it.inc
+++ b/src/corelib/lang_it.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Attributi';
rsshortaug = 'Ago';
rslongaug = 'Agosto';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Grassetto';
rscancel = 'Annulla';
rscannotcreatedir = 'Non riesco a creare la cartella';
rschange = 'Cambia';
rschangetitle = 'Change Title';
rscharactermap = 'Character Map';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Chiudi';
rscollection = 'Collezione';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Conferma';
rsconfirmation = 'Conferma';
+rscontinuous = 'Continuous';
rscopy = 'Copia';
rserrcouldnotopendir = 'Impossibile aprire la cartella <%s>';
rscreate = 'Crea';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Ven';
rslongfri = 'Venerdì';
+rscolorgreen = 'Green';
rsfilegroup = 'Gruppo';
rshelp = 'Aiuto';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignora';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Password';
rspaste = 'Incolla';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Usati Recentemente';
+rscolorred = 'Red';
rsreplace = 'Sostituisci';
rsretry = 'Riprova';
rskeyright = 'Right';
diff --git a/src/corelib/lang_pt.inc b/src/corelib/lang_pt.inc
index f9c4aa13..fb3dd92b 100644
--- a/src/corelib/lang_pt.inc
+++ b/src/corelib/lang_pt.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Atributos';
rsshortaug = 'Ago';
rslongaug = 'Agosto';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Negrito';
rscancel = 'Cancelar';
rscannotcreatedir = 'Não foi possível criar diretório';
rschange = 'Editar';
rschangetitle = 'Mudar Título';
rscharactermap = 'Mapa de Caracteres';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Fechar';
rscollection = 'Coleção';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Confirmar';
rsconfirmation = 'Confirmação';
+rscontinuous = 'Continuous';
rscopy = 'Copiar';
rserrcouldnotopendir = 'Não pode abrir o diretório <%s>';
rscreate = 'Criar';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Font Aliases';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Sex';
rslongfri = 'Sexta-feira';
+rscolorgreen = 'Green';
rsfilegroup = 'Grupo';
rshelp = 'Ajuda';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Ignorar';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Senha';
rspaste = 'Colar';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Recentemente Usado';
+rscolorred = 'Red';
rsreplace = 'Substituir';
rsretry = 'Retentar';
rskeyright = 'Right';
diff --git a/src/corelib/lang_ru.inc b/src/corelib/lang_ru.inc
index a6d8a46e..d3f35c2f 100644
--- a/src/corelib/lang_ru.inc
+++ b/src/corelib/lang_ru.inc
@@ -19,17 +19,21 @@ rsfileattributes = 'Атрибуты';
rsshortaug = 'Авг';
rslongaug = 'Август';
rskeybksp = 'BkSp';
+rscolorblue = 'Blue';
rsbold = 'Жирный';
rscancel = 'Отмена';
rscannotcreatedir = 'Невозможно создать директорию';
rschange = 'Изменить';
rschangetitle = 'Change Title';
rscharactermap = 'Character Map';
+rscolorpickerhint = 'Click on Picker and maintain click => release to get the color';
rsclose = 'Закрыть';
rscollection = 'Группа';
+rstabsheetcolorwheel = 'Color Wheel';
rsconfigurebookmarks = 'Configure Bookmarks';
rsconfirm = 'Подтвердить';
rsconfirmation = 'Подтверждение';
+rscontinuous = 'Continuous';
rscopy = 'Копировать';
rserrcouldnotopendir = 'Невозможно открыть директорию <%s>';
rscreate = 'Создать';
@@ -70,8 +74,10 @@ rscollectionfontaliases = 'Псевдонимы шрифтов';
rserrreportfontfilemissing = 'Font file <%s.fnt> not found';
rsshortfri = 'Пт';
rslongfri = 'Пятница';
+rscolorgreen = 'Green';
rsfilegroup = 'Группа';
rshelp = 'Справка';
+rshexadecimal = 'Hexadecimal';
rskeyhome = 'Home';
rsignore = 'Пропустить';
rserrreportimagefilemissing = 'Image <%s> is missing';
@@ -117,8 +123,10 @@ rspassword = 'Пароль';
rspaste = 'Вставить';
rskeypgdn = 'PgDn';
rskeypgup = 'PgUp';
+rstabpredefined = 'Predefined';
rsreportpreview = 'Preview';
rscollectionrecentlyused = 'Ранее использованные';
+rscolorred = 'Red';
rsreplace = 'Заменить';
rsretry = 'Повторить';
rskeyright = 'Right';
diff --git a/src/corelib/render/software/Agg2D.pas b/src/corelib/render/software/Agg2D.pas
index 333e37ea..b77b9ce9 100644
--- a/src/corelib/render/software/Agg2D.pas
+++ b/src/corelib/render/software/Agg2D.pas
@@ -2653,9 +2653,10 @@ procedure TAgg2D.Font(
italic : boolean = false;
cache : TAggFontCacheType = AGG_VectorFontCache;
angle : double = 0.0 );
+{$IFDEF AGG2D_USE_WINFONTS}
var
b : int;
-
+{$ENDIF}
begin
m_textAngle :=angle;
m_fontHeight :=height;
diff --git a/src/corelib/render/software/agg_blur.pas b/src/corelib/render/software/agg_blur.pas
index 5ddda2bc..78e6df72 100644
--- a/src/corelib/render/software/agg_blur.pas
+++ b/src/corelib/render/software/agg_blur.pas
@@ -25,7 +25,7 @@
// http://incubator.quasimondo.com/processing/fast_blur_deluxe.php
// (search phrase "Stackblur: Fast But Goodlooking").
// The major improvement is that there's no more division table
-// that was very expensive to create for large blur radii. Insted,
+// that was very expensive to create for large blur radii. Instead,
// for 8-bit per channel and radius not exceeding 254 the division is
// replaced by multiplication and shift.
//
diff --git a/src/corelib/stdimages.inc b/src/corelib/stdimages.inc
index 36255154..510a1ce6 100644
--- a/src/corelib/stdimages.inc
+++ b/src/corelib/stdimages.inc
@@ -3222,4 +3222,26 @@ Const
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255);
+const
+ stdimg_colpicker: array[0..333] of byte = (
+ 66, 77, 78, 1, 0, 0, 0, 0, 0, 0,118, 0, 0, 0, 40, 0, 0,
+ 0, 18, 0, 0, 0, 18, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0,
+ 216, 0, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 16, 0, 0, 0, 16,
+ 0, 0, 0, 0, 0, 0, 0,132,132, 0, 0,255,255, 0, 0, 0, 0,
+ 132, 0,132,132,132, 0,206,214,214, 0, 0, 0,255, 0,255,255,255,
+ 0,255,255,255, 0,255,255,255, 0,255,255,255, 0,255,255,255, 0,
+ 255,255,255, 0,255,255,255, 0,255,255,255, 0,255,255,255, 0, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0, 85, 34, 34, 37, 85, 85,
+ 85, 85, 85, 0, 0, 0, 82, 34, 34, 34, 37, 85, 85, 85, 85, 0, 0,
+ 0, 85, 80, 5, 85, 85, 85, 85, 85, 85, 0, 0, 0, 85, 80, 32, 5,
+ 85, 85, 85, 85, 85, 0, 0, 0, 85, 85, 1, 64, 85, 85, 85, 85, 85,
+ 0, 0, 0, 85, 85, 2, 20, 5, 85, 85, 85, 85, 0, 0, 0, 85, 85,
+ 80, 33, 64, 85, 85, 85, 85, 0, 0, 0, 85, 85, 85, 5,116, 5, 85,
+ 85, 85, 0, 0, 0, 85, 85, 85, 80, 87, 64, 85, 85, 85, 0, 0, 0,
+ 85, 85, 85, 85, 5,116, 3, 85, 85, 0, 0, 0, 85, 85, 85, 85, 80,
+ 83, 48, 69, 85, 0, 0, 0, 85, 85, 85, 85, 85, 54, 3, 52, 85, 0,
+ 0, 0, 85, 85, 85, 85, 85, 99, 99, 51, 69, 0, 0, 0, 85, 85, 85,
+ 85, 85, 85, 54, 99, 53, 0, 0, 0, 85, 85, 85, 85, 85, 85, 55, 99,
+ 53, 0, 0, 0, 85, 85, 85, 85, 85, 85, 83, 51, 69, 0, 0, 0, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0);
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index f98e8198..381b81a3 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -222,6 +222,7 @@ type
TfpgX11Window = class(TfpgWindowBase)
private
QueueEnabledDrops: boolean;
+ procedure ApplyFormIcon;
protected
FWinFlags: TXWindowStateFlags;
FWinHandle: TfpgWinHandle;
@@ -315,6 +316,7 @@ type
xia_wm_protocols: TAtom;
xia_wm_delete_window: TAtom;
xia_wm_state: TAtom;
+ xia_net_wm_icon: TAtom;
xia_targets: TAtom;
xia_save_targets: TAtom;
netlayer: TNETWindowLayer;
@@ -1484,6 +1486,7 @@ begin
xia_wm_protocols := XInternAtom(FDisplay, 'WM_PROTOCOLS', TBool(False));
xia_wm_delete_window := XInternAtom(FDisplay, 'WM_DELETE_WINDOW', TBool(False));
xia_wm_state := XInternAtom(FDisplay, 'WM_STATE', TBool(False));
+ xia_net_wm_icon := XInternAtom(FDisplay, '_NET_WM_ICON', TBool(False));
{ initializa the XDND atoms }
FDNDTypeList := TObjectList.Create;
@@ -2301,6 +2304,45 @@ end;
{ TfpgX11Window }
+procedure TfpgX11Window.ApplyFormIcon;
+var
+ ico: TfpgImage;
+ ar1: array of longword; // 32 bit CPU's
+ ar2: array of qword; // 64 bit CPU's
+ ps: pbyte;
+ pd: ^TRGBTriple;
+ i: integer;
+ iconName: string;
+begin
+ if self is TfpgForm then
+ iconName := TfpgForm(self).IconName;
+ if iconName = '' then
+ Exit;
+ ico := fpgImages.GetImage(iconName);
+ if Assigned(ico) then
+ begin
+ SetLength(ar1, 2 + (ico.Width * ico.Height));
+ ar1[0] := ico.Width;
+ ar1[1] := ico.Height;
+ pd := @ar1[2];
+ ps := ico.ImageData;
+ move(ps^,pd^, ico.ImageDataSize);
+ end
+ else
+ exit; // we don't have a icon to set
+
+ {$ifdef cpu64}
+ setlength(ar2,length(ar1));
+ for i := low(ar2) to high(ar2) do
+ ar2[i] := ar1[i]; // copy array data over
+ XChangeProperty(xapplication.display, FWinHandle, xapplication.xia_net_wm_icon,
+ XA_CARDINAL, 32, PropModeReplace, @ar2[0], Length(ar2));
+ {$else}
+ XChangeProperty(xapplication.display, FWinHandle, xapplication.xia_net_wm_icon,
+ XA_CARDINAL, 32, PropModeReplace, @ar1[0], Length(ar1));
+ {$endif}
+end;
+
procedure TfpgX11Window.DoAllocateWindowHandle(AParent: TfpgWindowBase);
var
pwh: TfpgWinHandle;
@@ -2313,11 +2355,13 @@ var
WMHints: PXWMHints;
prop: TAtom;
mwmhints: TMWMHints;
+ IsToplevel: Boolean;
begin
if HandleIsValid then
Exit; //==>
- if AParent <> nil then
+ IsToplevel := (AParent = nil) or (FWindowType in [wtModalForm, wtPopup]);
+ if not IsToplevel then
pwh := TfpgX11Window(AParent).WinHandle
else
pwh := xapplication.RootWindow;
@@ -2356,16 +2400,16 @@ begin
FWinHandle := wh;
FBackupWinHandle := wh;
- if AParent = nil then // is a toplevel window
+ if IsToplevel then // is a toplevel window
begin
{ setup a window icon }
- IconPixMap := XCreateBitmapFromData(fpgApplication.Display, FWinHandle,
+
+ IconPixMap := XCreateBitmapFromData(xapplication.display, FWinHandle,
@IconBitmapBits, IconBitmapWidth, IconBitmapHeight);
WMHints := XAllocWMHints;
WMHints^.icon_pixmap := IconPixmap;
WMHints^.flags := IconPixmapHint;
-
{ setup window grouping posibilities }
if (not (waX11SkipWMHints in FWindowAttributes)) and (FWindowType = wtWindow) then
begin
@@ -2373,8 +2417,7 @@ begin
WMHints^.window_group := xapplication.FLeaderWindow;
end;
-
- XSetWMProperties(fpgApplication.Display, FWinHandle, nil, nil, nil, 0, nil, WMHints, nil);
+ XSetWMProperties(xapplication.display, FWinHandle, nil, nil, nil, 0, nil, WMHints, nil);
if (not (waX11SkipWMHints in FWindowAttributes)) and (FWindowType = wtWindow) then
begin
@@ -2395,6 +2438,9 @@ begin
begin
DoDNDEnabled(True);
end;
+
+ if xapplication.xia_net_wm_icon <> 0 then
+ ApplyFormIcon;
end;
FillChar(hints, sizeof(hints), 0);
@@ -2450,11 +2496,13 @@ begin
// for modal windows, this is necessary
if FWindowType = wtModalForm then
begin
- if Parent = nil then
+ if IsToplevel then
begin
lmwh := 0;
if fpgApplication.PrevModalForm <> nil then
lmwh := TfpgX11Window(fpgApplication.PrevModalForm).WinHandle
+ {else if AParent <> nil then
+ lmwh := TfpgX11Window(AParent).WinHandle}
{ 2011-03-24: Graeme Geldenhuys
I commented code this code because it caused more problems that it solved
when multiple modal dialogs or prompts are shown in succession.
diff --git a/src/gui/colordialog.inc b/src/gui/colordialog.inc
index 93d8d731..0ef8c3bb 100644
--- a/src/gui/colordialog.inc
+++ b/src/gui/colordialog.inc
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -22,6 +22,28 @@
type
+ TColorPickedEvent = procedure(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor) of object;
+
+ TPickerButton = class(TfpgButton)
+ private
+ FContinuousResults: Boolean;
+ FOnColorPicked: TColorPickedEvent;
+ FColorPos: TPoint;
+ FColor: TfpgColor;
+ FColorPicking: Boolean;
+ private
+ procedure DoColorPicked;
+ protected
+ procedure HandleLMouseDown(X, Y: integer; ShiftState: TShiftState); override;
+ procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
+ procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
+ public
+ constructor Create(AOwner: TComponent); override;
+ published
+ property ContinuousResults: Boolean read FContinuousResults write FContinuousResults;
+ property OnColorPicked: TColorPickedEvent read FOnColorPicked write FOnColorPicked;
+ end;
+
TfpgColorSelectDialog = class(TfpgBaseDialog)
private
{@VFD_HEAD_BEGIN: ColorSelectDialog}
@@ -37,19 +59,29 @@ type
edR: TfpgSpinEdit;
edG: TfpgSpinEdit;
edB: TfpgSpinEdit;
- Label3: TfpgLabel;
- Label4: TfpgLabel;
- Label5: TfpgLabel;
- pnlColorPreview: TfpgBevel;
+ lblRed: TfpgLabel;
+ lblGreen: TfpgLabel;
+ lblBlue: TfpgLabel;
+ btnPicker: TPickerButton;
+ chkContinuous: TfpgCheckBox;
+ lblHex: TfpgLabel;
+ edHex: TfpgEdit;
{@VFD_HEAD_END: ColorSelectDialog}
FViaRGB: Boolean; // to prevent recursive changes
+ FColorPicking: Boolean;
+ procedure btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor);
+ procedure chkContinuousChanged(Sender: TObject);
function GetSelectedColor: TfpgColor;
procedure SetSelectedColor(const AValue: TfpgColor);
procedure ColorChanged(Sender: TObject);
+ procedure NamedColorChanged(Sender: TObject);
procedure RGBChanged(Sender: TObject);
procedure UpdateRGBComponents;
procedure PopulatePaletteColorCombo;
procedure cbColorPaletteChange(Sender: TObject);
+ procedure OnTabChange(Sender: TObject; tab:TfpgTabSheet);
+ protected
+ procedure SetupCaptions; override;
public
constructor Create(AOwner: TComponent); override;
procedure AfterCreate; override;
@@ -79,8 +111,120 @@ begin
end;
end;
+
+function ConvertToHex(Value: integer): string;
+var
+ ValH, ValL: integer;
+begin
+ ValH := Value div 16;
+ ValL := Value mod 16;
+ case ValH of
+ 15:
+ Result := 'F';
+ 14:
+ Result := 'E';
+ 13:
+ Result := 'D';
+ 12:
+ Result := 'C';
+ 11:
+ Result := 'B';
+ 10:
+ Result := 'A';
+ else
+ Result := IntToStr(ValH);
+ end;
+ case ValL of
+ 15:
+ Result := Result + 'F';
+ 14:
+ Result := Result + 'E';
+ 13:
+ Result := Result + 'D';
+ 12:
+ Result := Result + 'C';
+ 11:
+ Result := Result + 'B';
+ 10:
+ Result := Result + 'A';
+ else
+ Result := Result + IntToStr(ValL);
+ end;
+end;
+
+function Hex(Red, Green, Blue: integer): string;
+begin
+ Result := '$' + ConvertToHex(Red) + ConvertToHex(Green) + ConvertToHex(Blue);
+end;
+
+{ TPickerButton }
+
+procedure TPickerButton.DoColorPicked;
+var
+ pt: TPoint;
+begin
+ pt := WindowToScreen(self, FColorPos);
+ FColor := fpgApplication.GetScreenPixelColor(pt);
+ if Assigned(FOnColorPicked) then
+ FOnColorPicked(self, FColorPos, FColor);
+end;
+
+procedure TPickerButton.HandleLMouseDown(X, Y: integer; ShiftState: TShiftState);
+begin
+ inherited HandleLMouseDown(X, Y, ShiftState);
+ MouseCursor := mcCross;
+ FColorPicking := True;
+ CaptureMouse;
+end;
+
+procedure TPickerButton.HandleLMouseUp(x, y: integer; shiftstate: TShiftState);
+begin
+ inherited HandleLMouseUp(x, y, shiftstate);
+ ReleaseMouse;
+ FColorPicking := False;
+ MouseCursor := mcDefault;
+ DoColorPicked;
+end;
+
+procedure TPickerButton.HandleMouseMove(x, y: integer; btnstate: word;
+ shiftstate: TShiftState);
+begin
+ //inherited HandleMouseMove(x, y, btnstate, shiftstate);
+ if not FColorPicking then
+ Exit;
+ FColorPos.x := x;
+ FColorPos.y := y;
+ if FContinuousResults then
+ DoColorPicked;
+end;
+
+constructor TPickerButton.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ FColorPicking := False;
+ FContinuousResults := False;
+end;
+
{ TfpgColorSelectDialog }
+procedure TfpgColorSelectDialog.OnTabChange(Sender: TObject; tab:TfpgTabSheet);
+begin
+ if pcColorSelect.ActivePageIndex = 0 then
+ RGBChanged(sender)
+ else
+ NamedColorChanged(sender) ;
+end;
+
+procedure TfpgColorSelectDialog.btnColorPicked(Sender: TObject; const AMousePos: TPoint; const AColor: TfpgColor);
+begin
+ ColorWheel.SetSelectedColor(AColor);
+end;
+
+procedure TfpgColorSelectDialog.chkContinuousChanged(Sender: TObject);
+begin
+ btnPicker.ContinuousResults := chkContinuous.Checked;
+end;
+
function TfpgColorSelectDialog.GetSelectedColor: TfpgColor;
begin
if pcColorSelect.ActivePageIndex = 0 then
@@ -99,7 +243,24 @@ begin
// UpdateHSVComponents;
if not FViaRGB then
UpdateRGBComponents;
- pnlColorPreview.BackgroundColor := ValueBar.SelectedColor;
+end;
+
+procedure TfpgColorSelectDialog.NamedColorChanged(Sender: TObject);
+var
+ tred, tgreen, tblue: Byte;
+begin
+ tred := fpgGetRed(ColorListBox1.Color);
+ tgreen := fpgGetGreen(ColorListBox1.Color);
+ tblue := fpgGetBlue(ColorListBox1.Color);
+
+ // keep text readable based on background color
+ if (tred + tgreen + tblue) / (256*3) >0.60 then
+ edHex.TextColor := clBlack
+ else
+ edHex.TextColor := clWhite ;
+
+ edHex.BackgroundColor:=ColorListBox1.Color;
+ edHex.Text := Hex(tred,tgreen,tblue);
end;
procedure TfpgColorSelectDialog.RGBChanged(Sender: TObject);
@@ -114,6 +275,13 @@ begin
c := FPColorTofpgColor(rgb);
ColorWheel.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event
FViaRGB := False;
+ // keep text readable based on background color
+ if ValueBar.Value > 0.75 then
+ edHex.TextColor := clBlack
+ else
+ edHex.TextColor := clWhite;
+ edHex.BackgroundColor := c;
+ edHex.Text := Hex(rgb.Red, rgb.Green, rgb.Blue);
end;
procedure TfpgColorSelectDialog.UpdateRGBComponents;
@@ -126,6 +294,13 @@ begin
edR.Value := rgb.Red;
edG.Value := rgb.Green;
edB.Value := rgb.Blue;
+ // keep text readable based on background color
+ if ValueBar.Value > 0.75 then
+ edHex.TextColor := clBlack
+ else
+ edHex.TextColor := clWhite;
+ edHex.BackgroundColor := c;
+ edHex.Text := Hex(rgb.Red, rgb.Green, rgb.Blue);
end;
procedure TfpgColorSelectDialog.PopulatePaletteColorCombo;
@@ -149,21 +324,34 @@ begin
ColorListBox1.SetFocus;
end;
+procedure TfpgColorSelectDialog.SetupCaptions;
+begin
+ inherited SetupCaptions;
+ tsColorWheel.Text := rsTabsheetColorWheel;
+ tsColorNames.Text := rsTabPredefined;
+ lblRed.Text := rsColorRed;
+ lblGreen.Text := rsColorGreen;
+ lblBlue.Text := rsColorBlue;
+ chkContinuous.Text := rsContinuous;
+ btnPicker.Hint := rsColorPickerHint;
+ lblHex.Text := rsHexadecimal;
+end;
+
constructor TfpgColorSelectDialog.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FViaRGB := false;
end;
-
procedure TfpgColorSelectDialog.AfterCreate;
begin
{%region 'Auto-generated GUI code' -fold}
{@VFD_BODY_BEGIN: ColorSelectDialog}
Name := 'ColorSelectDialog';
- SetPosition(340, 164, 328, 375);
+ SetPosition(340, 164, 328, 385);
WindowTitle := 'Color Select Dialog';
Hint := '';
+ IconName := '';
WindowPosition := wpOneThirdDown;
pcColorSelect := TfpgPageControl.Create(self);
@@ -172,9 +360,9 @@ begin
Name := 'pcColorSelect';
SetPosition(4, 4, 320, 332);
Anchors := [anLeft,anRight,anTop,anBottom];
- ActivePageIndex := 0;
Hint := '';
TabOrder := 1;
+ OnChange := @OnTabChange;
end;
tsColorWheel := TfpgTabSheet.Create(pcColorSelect);
@@ -182,6 +370,7 @@ begin
begin
Name := 'tsColorWheel';
SetPosition(3, 24, 314, 305);
+ Anchors := [anLeft,anRight,anTop,anBottom];
Text := 'Color Wheel';
end;
@@ -190,7 +379,8 @@ begin
begin
Name := 'tsColorNames';
SetPosition(3, 24, 314, 305);
- Text := 'Predefined';
+ Anchors := [anLeft,anRight,anTop,anBottom];
+ Text := rsTabPredefined;
end;
cbColorPalette := TfpgComboBox.Create(tsColorNames);
@@ -199,9 +389,12 @@ begin
Name := 'cbColorPalette';
SetPosition(8, 24, 299, 22);
Anchors := [anLeft,anRight,anTop];
+ ExtraHint := '';
FontDesc := '#List';
Hint := '';
+ FocusItem := -1;
TabOrder := 1;
+ OnChange:= @NamedColorChanged;
end;
ColorListBox1 := TfpgColorListBox.Create(tsColorNames);
@@ -210,10 +403,11 @@ begin
Name := 'ColorListBox1';
SetPosition(8, 72, 299, 224);
Anchors := [anLeft,anRight,anTop,anBottom];
- Color := TfpgColor($00FFFF);
+ Color := TfpgColor($FF00FFFF);
FontDesc := '#List';
Hint := '';
TabOrder := 2;
+ OnChange:= @NamedColorChanged;
end;
Label1 := TfpgLabel.Create(tsColorNames);
@@ -282,10 +476,10 @@ begin
OnChange := @RGBChanged;
end;
- Label3 := TfpgLabel.Create(tsColorWheel);
- with Label3 do
+ lblRed := TfpgLabel.Create(tsColorWheel);
+ with lblRed do
begin
- Name := 'Label3';
+ Name := 'lblRed';
SetPosition(8, 220, 80, 16);
Alignment := taRightJustify;
FontDesc := '#Label1';
@@ -293,10 +487,10 @@ begin
Text := 'Red';
end;
- Label4 := TfpgLabel.Create(tsColorWheel);
- with Label4 do
+ lblGreen := TfpgLabel.Create(tsColorWheel);
+ with lblGreen do
begin
- Name := 'Label4';
+ Name := 'lblGreen';
SetPosition(8, 248, 80, 16);
Alignment := taRightJustify;
FontDesc := '#Label1';
@@ -304,10 +498,10 @@ begin
Text := 'Green';
end;
- Label5 := TfpgLabel.Create(tsColorWheel);
- with Label5 do
+ lblBlue := TfpgLabel.Create(tsColorWheel);
+ with lblBlue do
begin
- Name := 'Label5';
+ Name := 'lblBlue';
SetPosition(8, 276, 80, 16);
Alignment := taRightJustify;
FontDesc := '#Label1';
@@ -315,17 +509,61 @@ begin
Text := 'Blue';
end;
- pnlColorPreview := TfpgBevel.Create(tsColorWheel);
- with pnlColorPreview do
+ btnPicker := TPickerButton.Create(tsColorWheel);
+ with btnPicker do
+ begin
+ Name := 'btnPicker';
+ SetPosition(167, 230, 23, 23);
+ Text := '';
+ FontDesc := '#Label1';
+ Hint := '';
+ ImageMargin := -1;
+ ImageName := 'stdimg.colpicker';
+ FShowHint := True;
+ TabOrder := 24;
+ OnColorPicked := @btnColorPicked;
+ end;
+
+ chkContinuous := TfpgCheckBox.Create(tsColorWheel);
+ with chkContinuous do
begin
- Name := 'pnlColorPreview';
- SetPosition(248, 232, 52, 52);
+ Name := 'chkContinuous';
+ SetPosition(167, 258, 130, 20);
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 25;
+ Text := 'Continuous';
+ OnChange := @chkContinuousChanged;
+ end;
+
+ lblHex := TfpgLabel.Create(self);
+ with lblHex do
+ begin
+ Name := 'lblHex';
+ SetPosition(25, 340, 100, 15);
+ Alignment := taCenter;
+ FontDesc := '#Label1';
+ Hint := '';
+ Text := 'Hexadecimal';
+ end;
+
+ edHex := TfpgEdit.Create(self);
+ with edHex do
+ begin
+ Name := 'edHex';
+ SetPosition(25, 356, 100, 23);
+ ExtraHint := '';
+ FontDesc := '#Label1';
Hint := '';
+ TabOrder := 3;
+ Text := '';
+ MaxLength:= 7;
end;
{@VFD_BODY_END: ColorSelectDialog}
{%endregion}
+ FColorPicking := False;
// link colorwheel and valuebar
ColorWheel.ValueBar := ValueBar;
diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas
index 6bd90cfd..2df7b414 100644
--- a/src/gui/fpg_basegrid.pas
+++ b/src/gui/fpg_basegrid.pas
@@ -79,6 +79,7 @@ type
FScrollBarStyle: TfpgScrollStyle;
FShowGrid: boolean;
FShowHeader: boolean;
+ FAutoHeight: boolean;
FTemp: integer;
FVScrollBar: TfpgScrollBar;
FHScrollBar: TfpgScrollBar;
@@ -89,6 +90,7 @@ type
FBorderStyle: TfpgEditBorderStyle;
function GetFontDesc: string;
function GetHeaderFontDesc: string;
+ function GetScrollBarWidth: Integer;
function GetTotalColumnWidth: integer;
function GetAdjustedBorderSizes: TRect;
procedure HScrollBarMove(Sender: TObject; position: integer);
@@ -98,6 +100,9 @@ type
procedure SetHeaderStyle(const AValue: TfpgGridHeaderStyle);
procedure SetRowSelect(const AValue: boolean);
procedure SetScrollBarStyle(const AValue: TfpgScrollStyle);
+ function GetScrollBarPage: integer;
+ procedure SetScrollBarPage(const AValue: integer);
+ procedure SetScrollBarWidth(const AValue: integer);
procedure VScrollBarMove(Sender: TObject; position: integer);
procedure SetDefaultColWidth(const AValue: integer);
procedure SetDefaultRowHeight(const AValue: integer);
@@ -106,10 +111,12 @@ type
procedure CheckFocusChange;
procedure SetShowGrid(const AValue: boolean);
procedure SetShowHeader(const AValue: boolean);
+ procedure SetAutoHeight(const AValue: boolean);
function VisibleLines: Integer;
procedure SetFirstRow(const AValue: Integer);
procedure SetAlternativeBGColor(const AValue: TfpgColor);
procedure SetBorderStyle(AValue: TfpgEditBorderStyle);
+ function AdjustHeight: Integer;
protected
property UpdateCount: integer read FUpdateCount;
procedure UpdateScrollBars; virtual;
@@ -158,7 +165,10 @@ type
property RowCount: Integer read GetRowCount;
property ShowHeader: boolean read FShowHeader write SetShowHeader default True;
property ShowGrid: boolean read FShowGrid write SetShowGrid default True;
+ property AutoHeight: boolean read FAutoHeight write SetAutoHeight default False;
property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth;
+ property ScrollBarPage: Integer read GetScrollBarPage write SetScrollBarPage;
+ property ScrollBarWidth: Integer read GetScrollBarWidth write SetScrollBarWidth;
property HeaderHeight: integer read FHeaderHeight write SetHeaderHeight;
property TotalColumnWidth: integer read GetTotalColumnWidth;
// property ColResizing: boolean read FColResizing write FColResizing;
@@ -225,6 +235,11 @@ begin
Result := FHeaderFont.FontDesc;
end;
+function TfpgBaseGrid.GetScrollBarWidth: Integer;
+begin
+ Result := FVScrollBar.Width;
+end;
+
function TfpgBaseGrid.GetTotalColumnWidth: integer;
var
i: integer;
@@ -308,6 +323,28 @@ begin
FScrollBarStyle := AValue;
end;
+function TfpgBaseGrid.GetScrollBarPage: integer;
+begin
+ Result:= FVScrollBar.PageSize;
+end;
+
+procedure TfpgBaseGrid.SetScrollBarPage(const AValue: integer);
+begin
+ if AValue= FVScrollBar.PageSize then
+ Exit; //==>
+ FVScrollBar.PageSize:= AValue;
+end;
+
+procedure TfpgBaseGrid.SetScrollBarWidth(const AValue: integer);
+begin
+ if FVScrollBar.Width = AValue then
+ Exit; //==>
+ FVScrollBar.Width := AValue;
+ FHScrollBar.Height:= AValue;
+ if FAutoHeight then
+ Height := AdjustHeight;
+end;
+
procedure TfpgBaseGrid.VScrollBarMove(Sender: TObject; position: integer);
begin
if FFirstRow <> position then
@@ -558,6 +595,15 @@ begin
RePaint;
end;
+procedure TfpgBaseGrid.SetAutoHeight(const AValue: boolean);
+begin
+ if FAutoHeight= AValue then
+ Exit; //==>
+ FAutoHeight := AValue;
+ if FAutoHeight then
+ Height := AdjustHeight;
+end;
+
// Return the fully visible lines only. Partial lines not counted
function TfpgBaseGrid.VisibleLines: Integer;
var
@@ -620,6 +666,28 @@ begin
Repaint;
end;
+function TfpgBaseGrid.AdjustHeight: Integer;
+var
+ r: TRect;
+begin
+ if FAutoHeight then
+ begin
+ r := GetAdjustedBorderSizes;
+ if FShowHeader then
+ if (FScrollBarStyle = ssHorizontal) or (FScrollBarStyle = ssAutoBoth) then
+ Result := Succ(((Height - r.Bottom * 2 - HeaderHeight - FHScrollBar.Height) div DefaultRowHeight) * DefaultRowHeight + HeaderHeight + FHScrollBar.Height + r.Bottom * 2)
+ else
+ Result := Succ(((Height - r.Bottom * 2 - HeaderHeight) div DefaultRowHeight) * DefaultRowHeight + HeaderHeight + r.Bottom * 2)
+ else
+ if (FScrollBarStyle = ssHorizontal) or (FScrollBarStyle = ssAutoBoth) then
+ Result := Succ(((Height - r.Bottom * 2 - FHScrollBar.Height) div DefaultRowHeight) * DefaultRowHeight + FHScrollBar.Height + r.Bottom * 2)
+ else
+ Result := Succ(((Height - r.Bottom * 2) div DefaultRowHeight) * DefaultRowHeight + r.Bottom * 2);
+ if Align = alBottom then
+ Top := Top + Height - result;
+ end;
+end;
+
procedure TfpgBaseGrid.UpdateScrollBars;
var
HWidth: integer;
@@ -668,6 +736,22 @@ var
Vfits := vl >= RowCount;
end;
+ function ColMax: integer;
+ var
+ i: integer;
+ w: integer;
+ begin
+ w := 0;
+ Result := 0;
+ for i := 0 to ColumnCount-1 do
+ begin
+ w := w + ColumnWidth[i];
+ if w > Width then
+ inc(Result);
+ end;
+ inc(Result);
+ end;
+
begin
// if we don't want any scrollbars, hide them and exit
if FScrollBarStyle = ssNone then
@@ -733,6 +817,25 @@ begin
getVisLines;
end;
end;
+ ssHorizVisible:
+ begin
+ hideScrollbar (FVScrollBar);
+ showH := true;
+ getVisLines;
+ end;
+ ssVertiVisible:
+ begin
+ hideScrollbar (FHScrollBar);
+ showV := true;
+ getVisWidth;
+ end;
+ ssBothVisible:
+ begin
+ showV := true;
+ showH := true;
+ getVisLines;
+ getVisWidth;
+ end;
end;
// set the scrollbar width/height space
@@ -780,16 +883,15 @@ begin
if FXOffset>hmax then
FXOffset:=hmax;
FHScrollBar.Position := FXOffset;
- FHScrollBar.SliderSize := HWidth / TotalColumnWidth;
FHScrollBar.PageSize := 5;
end
else
begin
- FHScrollBar.Max := ColumnCount-1;
+ FHScrollBar.Max := ColMax;
FHScrollBar.Position := FFirstCol;
- FHScrollBar.SliderSize := 1 / ColumnCount;
FHScrollBar.PageSize := 1;
end;
+ FHScrollBar.SliderSize := HWidth / TotalColumnWidth;
FHScrollBar.RepaintSlider;
FHScrollBar.Top := Height - FHScrollBar.Height - borders.Bottom;
FHScrollBar.Left := borders.Left;
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas
index 781c0745..7cb1ee20 100644
--- a/src/gui/fpg_dialogs.pas
+++ b/src/gui/fpg_dialogs.pas
@@ -579,6 +579,8 @@ end;
constructor TfpgBaseDialog.Create(AOwner: TComponent);
begin
+ // WindowType must be set before inherited or our parent property will be set
+ WindowType:=wtModalForm;
inherited Create(AOwner);
Width := 500;
Height := 400;
diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas
index 62ca79d2..12773d9b 100644
--- a/src/gui/fpg_editcombo.pas
+++ b/src/gui/fpg_editcombo.pas
@@ -367,7 +367,7 @@ begin
begin
if Items[i]= TDropDownWindow(FDropDown).ListBox.Items[TDropDownWindow(FDropDown).ListBox.FocusItem] then
begin
- FocusItem := i;
+ FNewItem := False;
FSelectedItem:= i;
FText:= Items[i];
Break;
diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas
index 7d5fe042..3f1f2558 100644
--- a/src/gui/fpg_form.pas
+++ b/src/gui/fpg_form.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2011 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -44,6 +44,7 @@ type
TfpgBaseForm = class(TfpgWidget)
private
FFullScreen: boolean;
+ FIconName: TfpgString;
FOnActivate: TNotifyEvent;
FOnClose: TFormCloseEvent;
FOnCloseQuery: TFormCloseQueryEvent;
@@ -76,6 +77,7 @@ type
procedure DoKeyShortcut(const AOrigin: TfpgWidget; const keycode: word; const shiftstate: TShiftState; var consumed: boolean; const IsChildOfOrigin: boolean = False); override;
{ -- properties -- }
property DNDEnabled: boolean read FDNDEnabled write SetDNDEnabled default False;
+ property IconName: string read FIconName write FIconName;
property Sizeable: boolean read FSizeable write FSizeable;
property ModalResult: TfpgModalResult read FModalResult write FModalResult;
property FullScreen: boolean read FFullScreen write FFullScreen default False;
@@ -115,6 +117,7 @@ type
property FullScreen;
property Height;
property Hint;
+ property IconName;
property Left;
property MaxHeight;
property MaxWidth;
@@ -342,6 +345,8 @@ function TfpgBaseForm.ShowModal: TfpgModalResult;
var
lCloseAction: TCloseAction;
begin
+ if HasHandle and (FWindowType <> wtModalForm) then
+ HandleHide;
FWindowType := wtModalForm;
fpgApplication.PushModalForm(self);
ModalResult := mrNone;
diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas
index 3f8b52fb..1f7e0f54 100644
--- a/src/gui/fpg_grid.pas
+++ b/src/gui/fpg_grid.pas
@@ -136,6 +136,7 @@ type
published
property Align;
property AlternateBGColor;
+ property AutoHeight;
property BackgroundColor;
property BorderStyle;
// property ColResizing;
@@ -158,6 +159,8 @@ type
property RowCount;
property RowSelect;
property ScrollBarStyle;
+ property ScrollBarPage;
+ property ScrollBarWidth;
property ShowGrid;
property ShowHeader;
property ShowHint;
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 3f634c02..7b93be06 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -1342,6 +1342,7 @@ end;
constructor TfpgPopupMenu.Create(AOwner: TComponent);
begin
+ FWindowType:=wtPopup;
inherited Create(AOwner);
FMargin := 3;
FTextMargin := 3;
diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas
index 1ec78952..fbe20006 100644
--- a/src/gui/fpg_scrollbar.pas
+++ b/src/gui/fpg_scrollbar.pas
@@ -36,7 +36,7 @@ uses
type
TScrollNotifyEvent = procedure(Sender: TObject; position: integer) of object;
- TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssBothVisible);
+ TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssHorizVisible, ssVertiVisible, ssBothVisible);
TfpgScrollBarPart = (sbpNone, sbpUpBack, sbpPageUpBack, sbpSlider, sbpDownForward, sbpPageDownForward);
diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc
index 6a96d046..063c7972 100644
--- a/src/gui/selectdirdialog.inc
+++ b/src/gui/selectdirdialog.inc
@@ -135,7 +135,6 @@ begin
begin
try
SortList := TStringList.Create;
- SortList.Sorted := True;
repeat
// check if special file
if (FileInfo.Name = '.') or (FileInfo.Name = '..') or (FileInfo.Name = '') then
@@ -153,10 +152,12 @@ begin
hidden files then do not add it to the list. }
//if ((faHidden and FileInfo.Attr) > 0) and not FShowHidden then
//continue;
-
SortList.Add(FileInfo.Name);
end;
until fpgFindNext(FileInfo) <> 0;
+
+ SortList.Sort;
+
for i := 0 to SortList.Count - 1 do
begin
NewNode := Node.AppendText(SortList[i]);
diff --git a/uidesigner/uidesigner.prj b/uidesigner/uidesigner.prj
index 2523d8ce..26cfb3fd 100644
--- a/uidesigner/uidesigner.prj
+++ b/uidesigner/uidesigner.prj
@@ -15,9 +15,48 @@ order12=0
order13=0
order14=0
order15=0
+order16=0
[projectoptions]
-projectdir=/home/graemeg/programming/fpgui/uidesigner
-projectfilename=/home/graemeg/programming/fpgui/uidesigner/uidesigner.prj
+projectdir=/data/devel/fpgui/uidesigner
+projectfilename=/data/devel/fpgui/uidesigner/uidesigner.prj
+findinfiledialog=37
+ [findinfileadialogfo.subdirs]
+ value=1
+ [findinfileadialogfo.inopenfiles]
+ value=0
+ [findinfileadialogfo.wholeword]
+ value=0
+ [findinfileadialogfo.casesensitive]
+ value=0
+ [findinfileadialogfo.indirectories]
+ value=1
+ [findinfileadialogfo.mask]
+ value="*.pas" "*.pp" "*.inc"
+ history=1
+ "*.pas" "*.pp" "*.inc"
+ [findinfileadialogfo.dir]
+ filenames=1
+ /data/devel/fpgui/src/
+ filehistory=1
+ /data/devel/fpgui/src/
+ filefilterindex=0
+ filefilter="*.pas" "*.pp" "*.inc"
+ filecolwidth=174
+ x=0
+ y=0
+ cx=0
+ cy=0
+ [findinfileadialogfo.findtext]
+ value=MenuFont
+ history=2
+ MenuFont
+
+ [findinfileadialogfo]
+ stackedunder=
+ x=268
+ y=415
+ cx=339
+ cy=251
finddialog=8
[finddialogfo.selectedonly]
value=0
@@ -45,98 +84,98 @@ replacedialog=15
cy=171
options=99
[projectoptionsfo.twidgetgrid3]
- propcolwidthref=666
- sortdescent0=0
- sortdescent1=0
- sortdescent2=0
- width3=102
- sortdescent3=0
- width4=310
- sortdescent4=0
- width5=204
- sortdescent5=0
+ propcolwidthref=653
+ sortdescend0=0
+ sortdescend1=0
+ sortdescend2=0
+ sortdescend3=0
+ width4=190
+ sortdescend4=0
+ width5=185
+ sortdescend5=0
+ width6=227
+ sortdescend6=0
[projectoptionsfo.twidgetgrid4]
propcolwidthref=477
width0=96
- sortdescent0=0
- width1=13
- sortdescent1=0
+ sortdescend0=0
+ sortdescend1=0
width2=73
- sortdescent2=0
+ sortdescend2=0
width3=229
- sortdescent3=0
+ sortdescend3=0
width4=238
- sortdescent4=0
+ sortdescend4=0
sorted=0
col=0
row=0
- rowheight=17
+ rowheight=16
[projectoptionsfo.newfile]
firsttab=0
index=0
[projectoptionsfo.fontaliasgrid]
propcolwidthref=336
width0=98
- sortdescent0=0
+ sortdescend0=0
width1=325
- sortdescent1=0
+ sortdescend1=0
width2=30
- sortdescent2=0
+ sortdescend2=0
width3=50
- sortdescent3=0
+ sortdescend3=0
width4=50
- sortdescent4=0
+ sortdescend4=0
width5=50
- sortdescent5=0
+ sortdescend5=0
width6=70
- sortdescent6=0
+ sortdescend6=0
[projectoptionsfo.macrosplitter]
x=0
- y=143
+ y=144
xprop=1
yprop=0.32808988764045
[projectoptionsfo.macrogrid]
propcolwidthref=460
- sortdescent0=0
- sortdescent1=0
- sortdescent2=0
- sortdescent3=0
- sortdescent4=0
- sortdescent5=0
+ sortdescend0=0
+ sortdescend1=0
+ sortdescend2=0
+ sortdescend3=0
+ sortdescend4=0
+ sortdescend5=0
width6=146
- sortdescent6=0
+ sortdescend6=0
width7=448
- sortdescent7=0
+ sortdescend7=0
[projectoptionsfo.makegroupbox]
firsttab=0
index=2
[projectoptionsfo.exceptionsgrid]
- propcolwidthref=637
+ propcolwidthref=694
width0=47
- sortdescent0=0
- width1=631
- sortdescent1=0
+ sortdescend0=0
+ width1=688
+ sortdescend1=0
[projectoptionsfo.ttabwidget1]
firsttab=0
- index=1
+ index=0
[projectoptionsfo.grid]
propcolwidthref=438
width0=219
- sortdescent0=0
+ sortdescend0=0
width1=431
- sortdescent1=0
+ sortdescend1=0
[projectoptionsfo.filefiltergrid]
propcolwidthref=545
width0=112
- sortdescent0=0
+ sortdescend0=0
width1=538
- sortdescent1=0
+ sortdescend1=0
[projectoptionsfo.ttabwidget2]
firsttab=0
index=0
[projectoptionsfo.tabwidget]
firsttab=0
- index=3
+ index=9
[projectoptionsfo]
stackedunder=
x=263
@@ -162,7 +201,12 @@ programparameters=18
y=243
cx=328
cy=348
-settings=8
+settings=13
+ [settingsfo.tsplitter2]
+ x=223
+ y=16
+ xprop=0.57879656160458
+ yprop=1
[settingsfo]
x=88
y=108
@@ -171,35 +215,96 @@ settings=8
wsize=0
active=1
visible=1
+mainfile=${PROJECTNAME}.lpr
+targetfile=units/${TARGET}/${PROJECTNAME}${EXEEXT}
+messageoutputfile=
+makecommand=${COMPILER}
+makedir=
+unitdirs=7
+ ${FPGUI}/lib/${TARGET}
+ ${FPGUI}/src/reportengine
+ ${FPGUI}/src/corelib/render/software
+ ${FPGUI}/src
+ ${FPGUI}/src/corelib/${FPG_GFX}
+ ${FPGUI}/src/gui
+ ${FPGUI}/src/corelib
+unitpref=-Fu
+incpref=-Fi
+libpref=-Fl
+objpref=-Fo
+targpref=-o
+befcommand=0
+aftcommand=0
+makeoptions=6
+ -l -Mobjfpc -Sh
+ -gl -O-
+ -B
+ -O2 -XX -Xs -CX
+ -vewinh
+ -FEunits/${TARGET}/
+codetemplatedirs=1
+ ${TEMPLATEDIR}
+toolmenus=3
+ fpGUI &DocView
+ UI Designer
+ Image Converter
+toolfiles=3
+ ${FPGUI}/docview/src/units/${TARGET}/docview${EXEEXT}
+ ${FPGUI}/uidesigner/units/${TARGET}/uidesigner${EXEEXT}
+ ${FPGUI}/tools/imageconvert/imgcnv${EXEEXT}
+toolparams=3
+ fpgui+rtl+fcl -k ${cursword}
+ ${CURSOURCEFILE}
+
+fontnames=0
+scriptbeforecopy=
+scriptaftercopy=
+newprojectfiles=4
+ ${TEMPLATEDIR}/fpgui_single_unit/project.pas
+ ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt
+ ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt
+ ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt
+newprojectfilesdest=4
+ ${%PROJECTNAME%}.pas
+ ${%PROJECTDIR%}units/i386-linux/placeholder.txt
+ ${%PROJECTDIR%}units/i386-win32/placeholder.txt
+ ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt
+newfinames=3
+ Program
+ Unit
+ Textfile
+newfifilters=3
+ "*.pas" "*.pp"
+ "*.pas" "*.pp"
+
+newfiexts=3
+ pas
+ pas
+
+newfisources=3
+ ${TEMPLATEDIR}default/program.pas
+ ${TEMPLATEDIR}default/unit.pas
+
+newfonames=2
+ Mainform
+ Simple Form
+newfonamebases=2
+
+
+newfosources=2
+ ${TEMPLATEDIR}fpgui/mainform.pas
+ ${TEMPLATEDIR}fpgui/simpleform.pas
+newfoforms=2
+
+
+forcezorder=0
+stripmessageesc=0
copymessages=0
closemessages=0
checkmethods=1
-showgrid=1
-snaptogrid=1
-moveonfirstclick=1
-gridsizex=8
-gridsizey=8
-autoindent=1
-blockindent=2
-rightmarginon=1
-rightmarginchars=80
-scrollheight=0
-tabstops=2
-spacetabs=1
-tabindent=0
-editfontname=DeJaVu Sans Mono
-editfontheight=13
-editfontwidth=0
-editfontextraspace=0
-editfontcolor=-1879048183
-editbkcolor=-1879048186
-statementcolor=14745599
-editfontantialiased=1
-editmarkbrackets=1
-backupfilecount=0
-encoding=0
-codetemplatedirs=1
- ${TEMPLATEDIR}
+colorerror=-1610612712
+colorwarning=-1610612717
+colornote=-1610612716
usercolors=30
0
0
@@ -262,24 +367,185 @@ usercolorcomment=30
+formatmacronames=0
+formatmacrovalues=0
+settingsfile=uidesigner_clean.prj
+settingseditor=1
+settingsdebugger=1
+settingsstorage=1
+settingsprojecttree=0
+settingsautoload=0
+settingsautosave=0
+modulenames=0
+moduletypes=0
+modulefiles=0
+befcommandon=0
+makeoptionson=6
+ 39
+ 3
+ 6
+ 4
+ 39
+ 39
+aftcommandon=0
+unitdirson=7
+ 65568
+ 65543
+ 196615
+ 131079
+ 196615
+ 65543
+ 65543
+macroon=0
+macronames=0
+macrovalues=0
+macrogroup=0
+groupcomments=6
+
+
+
+
+
+
+toolsave=3
+ 0
+ 0
+ 0
+toolhide=3
+ 0
+ 0
+ 0
+toolparse=3
+ 0
+ 0
+ 0
+toolmessages=3
+ 0
+ 0
+ 0
+fontalias=0
+fontancestors=0
+fontheights=0
+fontwidths=0
+fontoptions=0
+fontxscales=0
+expandprojectfilemacros=4
+ 1
+ -1
+ -1
+ -1
+loadprojectfile=4
+ 1
+ 0
+ 0
+ 0
+newinheritedforms=2
+ 0
+ 0
+uid=0
+sourcefilemasks=5
+ "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr"
+ "*.c" "*.cc" "*.h"
+ "*.mfm"
+ "*.ipf"
+ "*.sql"
+syntaxdeffiles=5
+ ${SYNTAXDEFDIR}pascal_dark.sdef
+ ${SYNTAXDEFDIR}cpp.sdef
+ ${SYNTAXDEFDIR}objecttext.sdef
+ ${SYNTAXDEFDIR}ipf2.sdef
+ ${SYNTAXDEFDIR}sql.sdef
+filemasknames=5
+ Source
+ Forms
+ Text
+ IPF help
+ All Files
+filemasks=5
+ "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr"
+ *.mfm
+ *.txt
+ *.ipf
+ *
+showgrid=1
+snaptogrid=1
+moveonfirstclick=1
+noformdesignerdocking=0
+gridsizex=8
+gridsizey=8
+autoindent=1
+blockindent=2
+linenumberson=0
+rightmarginon=1
+rightmarginchars=80
+scrollheight=0
+tabstops=2
+spacetabs=1
+showtabs=0
+tabindent=0
+editfontname=Raize
+editfontheight=16
+editfontwidth=0
+editfontextraspace=0
+editfontcolor=-1879048183
+editbkcolor=-1879048186
+statementcolor=14745599
+editfontantialiased=1
+editmarkbrackets=1
+backupfilecount=0
+encoding=0
+codetemplatedirs=1
+ ${TEMPLATEDIR}
+debugcommand=${DEBUGGER}
+debugoptions=
+debugtarget=
+runcommand=
+xtermcommand=xterm -S${PTSN}/${PTSH}
+remoteconnection=
+uploadcommand=
+gdbprocessor=i386
+gdbservercommand=
+gdbservercommandattach=
+beforeconnect=
+afterconnect=
+beforeload=
+afterload=
+beforerun=
+sourcedirs=7
+ ${FPGUI}/src/reportengine/
+ ${FPGUI}/src/corelib/render/software/
+ ${FPGUI}/src/
+ ${FPGUI}/src/corelib/${FPG_GFX}/
+ ${FPGUI}/src/gui/
+ ${FPGUI}/src/corelib/
+ ./
+defines=0
+progparameters=
+progworkingdirectory=
+envvarnames=0
+envvarvalues=0
+defineson=0
stoponexception=0
valuehints=1
activateonbreak=1
+raiseonbreak=1
showconsole=1
externalconsole=0
+settty=1
gdbdownload=0
downloadalways=0
startupbkpt=0
startupbkpton=0
gdbsimulator=0
+gdbserverstartonce=0
gdbserverwait=0
nogdbserverexit=0
+gdbservertty=0
exceptclassnames=1
EconvertError
exceptignore=1
0
-settingsfile=
-settingseditor=0
+nodebugbeginend=0
sigsettings=27
1,1,T,F
3,3,T,F
@@ -308,197 +574,7 @@ sigsettings=27
28,28,T,F
29,29,T,F
30,30,T,F
-modulenames=0
-moduletypes=0
-modulefiles=0
-mainfile=${PROJECTNAME}.lpr
-targetfile=units/${TargetCPU}-${TargetOS}/${PROJECTNAME}${EXEEXT}
-messageoutputfile=
-makecommand=${COMPILER}
-makedir=
-debugcommand=${DEBUGGER}
-debugoptions=
-debugtarget=
-runcommand=
-remoteconnection=
-uploadcommand=
-gdbprocessor=i386
-gdbservercommand=
-gdbservercommandattach=
-beforeload=
-afterload=
-beforerun=
defaultmake=4
-befcommand=0
-befcommandon=0
-aftcommand=0
-aftcommandon=0
-makeoptions=6
- -l -Mobjfpc -Sh
- -gl -O-
- -B
- -O2 -XX -Xs -CX
- -vewinh
- -FEunits/${TargetCPU}-${TargetOS}/
-makeoptionson=6
- 63
- 31
- 34
- 32
- 63
- 63
-macroon=6
- 1
- 3
- 6
- 4
- 63
- 63
-macronames=6
- TargetCPU
- TargetOS
- TargetCPU
- TargetOS
- FPGUI_DIR
- HelpPath
-macrovalues=6
- x86_64
- linux
- i386
- win32
- /home/graemeg/programming/fpgui
- /opt/FPC_Docs/inf/
-macrogroup=0
-groupcomments=6
- Linux 64-bit
- Linux 32-bit
- Windows 32-bit
-
-
-
-sourcedirs=5
- ${FPGUI_DIR}/src/gui/
- ${FPGUI_DIR}/src/corelib/gdi/X/
- ${FPGUI_DIR}/src/corelib/x11/
- ${FPGUI_DIR}/src/corelib/
- ./
-defines=0
-defineson=0
-unitdirs=6
- ${FPGUI_DIR}/lib/${TargetCPU}-${TargetOS}/
- ${FPGUI_DIR}/
- ${FPGUI_DIR}/src/corelib/gdi/
- ${FPGUI_DIR}/src/corelib/x11/
- ${FPGUI_DIR}/src/gui/
- ${FPGUI_DIR}/src/corelib/
-unitdirson=6
- 65539
- 131100
- 196616
- 196612
- 65564
- 65564
-unitpref=-Fu
-incpref=-Fi
-libpref=-Fl
-objpref=-Fo
-targpref=-o
-sourcefilemasks=5
- "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr"
- "*.c" "*.cc" "*.h"
- "*.mfm"
- "*.ipf"
- "*.sql"
-syntaxdeffiles=5
- ${SYNTAXDEFDIR}pascal_dark.sdef
- ${SYNTAXDEFDIR}cpp.sdef
- ${SYNTAXDEFDIR}objecttext.sdef
- ${SYNTAXDEFDIR}ipf2.sdef
- ${SYNTAXDEFDIR}sql.sdef
-filemasknames=5
- Source
- Forms
- Text
- IPF help
- All Files
-filemasks=5
- "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr"
- *.mfm
- *.txt
- *.ipf
- *
-toolsave=1
- 0
-toolhide=1
- 0
-toolparse=1
- 0
-toolmenus=1
- fpGUI &DocView
-toolfiles=1
- /home/graemeg/bin/docview
-toolparams=1
- FPCHELP -k ${cursword}
-fontalias=0
-fontancestors=0
-fontnames=0
-fontheights=0
-fontwidths=0
-fontoptions=0
-fontxscales=0
-scriptbeforecopy=
-scriptaftercopy=
-newprojectfiles=4
- ${TEMPLATEDIR}/fpgui_single_unit/project.pas
- ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt
- ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt
- ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt
-newprojectfilesdest=4
- ${%PROJECTNAME%}.pas
- ${%PROJECTDIR%}units/i386-linux/placeholder.txt
- ${%PROJECTDIR%}units/i386-win32/placeholder.txt
- ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt
-expandprojectfilemacros=4
- 1
- -1
- -1
- -1
-loadprojectfile=4
- 1
- 0
- 0
- 0
-newfinames=3
- Program
- Unit
- Textfile
-newfinfilters=3
- "*.pas" "*.pp"
- "*.pas" "*.pp"
-
-newfiexts=3
- pas
- pas
-
-newfisources=3
- ${TEMPLATEDIR}default/program.pas
- ${TEMPLATEDIR}default/unit.pas
-
-newfonames=2
- Mainform
- Simple Form
-newfonamebases=2
-
-
-newinheritedforms=2
- 0
- 0
-newfosources=2
- ${TEMPLATEDIR}fpgui/mainform.pas
- ${TEMPLATEDIR}fpgui/simpleform.pas
-newfoforms=2
-
-
[breakpoints]
on=0
path=0
@@ -511,126 +587,171 @@ panels=1
panel1
units=
(
- modulefilenames=0
- modulenames=0
- moduleclassnames=0
- a=0,4149,0,Pascal Units
- c=16
- (
- file=/home/graemeg/programming/fpgui/uidesigner/anchors.inc
- kind=1
- a=0,4100,0,anchors.inc
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/icons.inc
- kind=1
- a=0,4100,0,icons.inc
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas
- kind=1
- a=0,4100,0,newformdesigner.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/uidesigner.lpr
- kind=1
- a=0,4100,0,uidesigner.lpr
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfddesigner.pas
- kind=1
- a=0,4100,0,vfddesigner.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdeditors.pas
- kind=1
- a=0,4100,0,vfdeditors.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdfile.pas
- kind=1
- a=0,4100,0,vfdfile.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdformparser.pas
- kind=1
- a=0,4100,0,vfdformparser.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdforms.pas
- kind=1
- a=0,4100,0,vfdforms.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdmain.pas
- kind=1
- a=0,4100,0,vfdmain.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdpropeditgrid.pas
- kind=1
- a=0,4100,0,vfdpropeditgrid.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdprops.pas
- kind=1
- a=0,4100,0,vfdprops.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdresizer.pas
- kind=1
- a=0,4100,0,vfdresizer.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdutils.pas
- kind=1
- a=0,4100,0,vfdutils.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdwidgetclass.pas
- kind=1
- a=0,4100,0,vfdwidgetclass.pas
- )
- (
- file=/home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas
- kind=1
- a=0,4100,0,vfdwidgets.pas
- )
+ a=0,4133,6,Pascal Units
)
cmodules=
(
- a=0,4132,0,C Modules
+ a=0,4132,6,C Modules
)
files=
(
- a=0,4149,0,Text Files
- c=1
- (
- file=/home/graemeg/programming/fpgui/uidesigner/extrafpc.cfg
- kind=1
- a=0,4100,0,extrafpc.cfg
- )
+ a=0,4133,6,Text Files
)
[componentstore]
-storedir=/opt/msegui/apps/ide/compstore/
+storedir=/data/devel/msegui/apps/ide/compstore/
filename=
+[components]
+[selecteditpage]
+colwidth=100
+x=160
+y=124
+cx=704
+cy=473
+[progparams]
+progparamhistory=0
+envvarons=0
+[edit]
+hintwidth=462
+hintheight=214
+finddtext=fpg_dialog
+findhistory=9
+ fpg_dialog
+ fpgSetNamedFont(
+ res=
+ 30005
+ NewView
+ images
+ Sort
+ sort
+ uses
+findoptions=1
+editpos=14
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 6,27
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+ 0,-1073741823
+bookmarks0=0
+bookmarks1=0
+bookmarks2=0
+bookmarks3=0
+bookmarks4=0
+bookmarks5=0
+bookmarks6=0
+bookmarks7=0
+bookmarks8=0
+bookmarks9=0
+bookmarks10=1
+ 568,1
+bookmarks11=0
+bookmarks12=0
+bookmarks13=0
+sourcefiles=14
+ /home/graemeg/programming/fpgui/uidesigner/vfdforms.pas
+ /home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas
+ /home/graemeg/programming/fpgui/uidesigner/vfdmain.pas
+ /home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas
+ /data/devel/fpgui/uidesigner/vfddesigner.pas
+ /data/devel/fpgui/src/gui/fpg_dialogs.pas
+ /data/devel/fpgui/src/corelib/fpg_base.pas
+ /data/devel/fpgui/src/corelib/fpg_main.pas
+ /data/devel/fpgui/src/gui/fpg_menu.pas
+ /data/devel/fpgui/uidesigner/uidesigner.lpr
+ /data/devel/fpgui/src/gui/messagedialog.inc
+ /data/devel/fpgui/src/corelib/fpg_stdimages.pas
+ /data/devel/fpgui/src/corelib/stdimages.inc
+ /data/devel/fpgui/src/corelib/fpg_imgfmt_png.pas
+relpaths=14
+ vfdforms.pas
+ vfdwidgets.pas
+ vfdmain.pas
+ newformdesigner.pas
+ vfddesigner.pas
+ ../src/gui/fpg_dialogs.pas
+ ../src/corelib/fpg_base.pas
+ ../src/corelib/fpg_main.pas
+ ../src/gui/fpg_menu.pas
+ uidesigner.lpr
+ ../src/gui/messagedialog.inc
+ ../src/corelib/fpg_stdimages.pas
+ ../src/corelib/stdimages.inc
+ ../src/corelib/fpg_imgfmt_png.pas
+ismoduletexts=14
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+modules=0
+moduleoptions=0
+visiblemodules=0
+nomenumodules=0
+[sourcefo.tabwidget]
+order=14
+ 0
+ 1
+ 2
+ 3
+ 4
+ 6
+ 7
+ 11
+ 12
+ 5
+ 13
+ 10
+ 8
+ 9
+tabsize=152
+firsttab=0
+index=13
[layout]
-windowlayout=539
+windowlayout=543
+ [mainfo.openform]
+ filenames=1
+ /data/devel/msegui/apps/ide/componentpaletteform.mfm
+ filehistory=1
+ /data/devel/msegui/apps/ide/componentpaletteform.mfm
+ filefilterindex=0
+ filefilter=*.mfm
+ filecolwidth=174
+ x=0
+ y=0
+ cx=0
+ cy=0
[mainfo.projectfiledia]
filenames=1
- /home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/sqleditor.prj
- lastdir=/home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/
+ /data/devel/fpgui/uidesigner/uidesigner_clean.prj
+ lastdir=/data/devel/fpgui/uidesigner/
filehistory=10
- /home/graemeg/programming/MasterMaths/m2_system/Source/tools/script_runner/sqleditor.prj
- /home/graemeg/programming/fpgui/uidesigner/uidesigner.prj
- /home/graemeg/programming/MasterMaths/m2_system/Source/tutoradmin/tutoradmin.prj
- /opt/git/fpgui_opengl.git/examples/corelib/helloworld/helloworld.prj
- /home/graemeg/programming/tests/gridspeed/fpgui/test.prj
- /home/graemeg/programming/tests/gridspeed/fpgui/columns/test.prj
- /home/graemeg/programming/fpgui/docview/src/docview.prj
- /home/graemeg/programming/MasterMaths/m2_system/Source/tutoradmin/tutoradmin_clean.prj
- /home/graemeg/programming/tests/dndtest4/project1.prj
- /home/graemeg/programming/tests/gridspeed/msegui/test.prj
+ /data/devel/fpgui/uidesigner/uidesigner_clean.prj
+ /data/devel/fpgui/uidesigner/uidesigner.prj
+ /data/devel/opensource/mseuniverse/tools/msegit/msegit.prj
+ /data/devel/QTS/csvimporter/src/csvimporter.prj
+ /data/devel/MasterMaths/m2_system/Source/tools/script_runner/sqleditor_clean.prj
+ /data/devel/MasterMaths/m2_system/Source/tutoradmin/tutoradmin.prj
+ /data/devel/msegui/apps/facedemo/facedemo.prj
+ /data/devel/opensoft/bugcollector/src/bugcollector.prj
+ /data/devel/msegui/apps/ide/mseide_gg.prj
+ /data/devel/msegui/apps/ide/mseide.prj
filefilterindex=0
filefilter=*.prj
filecolwidth=174
@@ -641,6 +762,9 @@ windowlayout=539
[mainfo.openfile]
filenames=0
filehistory=10
+ /data/devel/fpgui/src/gui/messagedialog.inc
+ /data/devel/fpgui/src/gui/fpg_style.pas
+ /data/devel/fpgui/src/gui/colordialog.inc
/home/graemeg/programming/fpgui/docview/docs/docview.ipf
/home/graemeg/kylix3/examples/delphi/threads/SortThds.pas
/home/graemeg/kylix3/source/clx/QComCtrls.pas
@@ -648,9 +772,6 @@ windowlayout=539
/home/graemeg/programming/fpgui/src/gui/fpg_tree.pas
/home/graemeg/programming/fpgui/uidesigner/tests/test_widget_order.pas
/opt/msegui_svn/apps/ide/sourcepage.pas
- /home/graemeg/programming/fpgui/uidesigner/extrafpc.cfg
- /home/graemeg/programming/fpgui/uidesigner/uidesigner.lpr
- /home/mse/proj/msegui/testcase/jean-pierre/Demo/main.pas
filefilterindex=4
filefilter="*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr"
filecolwidth=174
@@ -663,7 +784,7 @@ windowlayout=539
useroptions=15488
[mainfo]
splitdir=0
- useroptions=33554559
+ useroptions=33554555
stackedunder=
parent=
mdistate=0
@@ -671,15 +792,12 @@ windowlayout=539
ny=0
ncx=0
ncy=0
- x=27
- y=52
- cx=1086
- cy=809
+ x=384
+ y=49
+ cx=1266
+ cy=1250
rcx=0
rcy=0
- children=2
- container,0,17,1076,792
- ,0,0,1076,17
wsize=0
active=1
visible=1
@@ -710,10 +828,10 @@ windowlayout=539
ny=0
ncx=0
ncy=0
- x=37
- y=270
- cx=349
- cy=276
+ x=0
+ y=0
+ cx=0
+ cy=0
rcx=0
rcy=0
wsize=0
@@ -722,7 +840,7 @@ windowlayout=539
[memoryfo]
splitdir=0
useroptions=16507
- stackedunder=threadsfo
+ stackedunder=cpui386fo
parent=
mdistate=0
nx=0
@@ -768,15 +886,15 @@ windowlayout=539
[findinfilefo]
splitdir=0
useroptions=16491
- stackedunder=componentstorefo
+ stackedunder=mainfo
parent=
mdistate=0
nx=0
ny=0
ncx=0
ncy=0
- x=239
- y=115
+ x=1700
+ y=107
cx=678
cy=414
rcx=0
@@ -785,7 +903,7 @@ windowlayout=539
splitdir=0
useroptions=49259
parent=mainfo.panel1.container
- visible=1
+ visible=0
mdistate=0
nx=0
ny=0
@@ -794,32 +912,32 @@ windowlayout=539
x=0
y=0
cx=205
- cy=604
- rcx=0
- rcy=0
+ cy=987
+ rcx=1246
+ rcy=987
[projecttreefo.grid]
propcolwidthref=35
width0=170
- sortdescent0=0
+ sortdescend0=0
width1=29
- sortdescent1=0
+ sortdescend1=0
sorted=0
col=0
- row=9
- rowheight=17
+ row=1
+ rowheight=16
[stackfo]
splitdir=0
- useroptions=16489
+ useroptions=24681
parent=
mdistate=0
nx=0
ny=0
ncx=0
ncy=0
- x=407
- y=349
- cx=254
- cy=180
+ x=0
+ y=0
+ cx=0
+ cy=0
rcx=0
rcy=0
wsize=0
@@ -845,28 +963,27 @@ windowlayout=539
visible=0
[watchpointsfo.grid]
propcolwidthref=352
- width0=16
- sortdescent0=0
+ sortdescend0=0
values1=0
values1_ci=-1
width1=33
- sortdescent1=0
+ sortdescend1=0
values2=0
width2=158
- sortdescent2=0
+ sortdescend2=0
width4=34
- sortdescent4=0
+ sortdescend4=0
values5=0
values5_ci=-1
width5=38
- sortdescent5=0
+ sortdescend5=0
values6=0
width6=184
- sortdescent6=0
+ sortdescend6=0
[breakpointsfo]
splitdir=0
useroptions=16491
- stackedunder=watchpointsfo
+ stackedunder=componentpalettefo
parent=
mdistate=0
nx=0
@@ -906,13 +1023,13 @@ windowlayout=539
[objectinspectorfo.grid]
propcolwidthref=306
width0=73
- sortdescent0=0
+ sortdescend0=0
width1=227
- sortdescent1=0
+ sortdescend1=0
[symbolfo]
splitdir=0
- useroptions=16511
- stackedunder=findinfilefo
+ useroptions=16507
+ stackedunder=breakpointsfo
parent=
mdistate=0
nx=0
@@ -925,8 +1042,6 @@ windowlayout=539
cy=137
rcx=0
rcy=0
- children=1
- container,0,0,351,137
wsize=0
active=0
visible=0
@@ -934,9 +1049,9 @@ windowlayout=539
propcolwidthref=222
values0=0
width0=111
- sortdescent0=0
+ sortdescend0=0
width1=135
- sortdescent1=0
+ sortdescend1=0
[symbolfo.symbol]
[watchfo]
splitdir=0
@@ -952,33 +1067,31 @@ windowlayout=539
y=0
cx=247
cy=44
- rcx=1235
- rcy=782
+ rcx=1256
+ rcy=1214
[watchfo.grid]
propcolwidthref=123
values0=2
-1
-1
values0_ci=-1
- width0=13
- sortdescent0=0
+ sortdescend0=0
values1=2
po2^
test
width1=66
- sortdescent1=0
+ sortdescend1=0
values3=2
0
0
values3_ci=-1
- width3=12
- sortdescent3=0
+ sortdescend3=0
values4=2
0
0
values4_ci=-1
width4=13
- sortdescent4=0
+ sortdescend4=0
[watchfo.watchon]
[watchfo.expression]
[watchfo.watcheson]
@@ -994,14 +1107,14 @@ windowlayout=539
ncx=0
ncy=0
x=0
- y=641
- cx=1076
- cy=130
+ y=1025
+ cx=1256
+ cy=189
rcx=0
rcy=0
[componentstorefo]
splitdir=0
- useroptions=24675
+ useroptions=24699
stackedunder=memoryfo
parent=
mdistate=0
@@ -1021,12 +1134,12 @@ windowlayout=539
[componentstorefo.grid]
propcolwidthref=435
width0=111
- sortdescent0=0
- sortdescent1=0
+ sortdescend0=0
+ sortdescend1=0
width2=160
- sortdescent2=0
+ sortdescend2=0
width3=185
- sortdescent3=0
+ sortdescend3=0
[componentstorefo.storefiledialog]
filenames=1
/home/mse/test/msegui/apps/ide/compstore/
@@ -1065,7 +1178,7 @@ windowlayout=539
[componentpalettefo]
splitdir=0
useroptions=24683
- stackedunder=disassfo
+ stackedunder=componentstorefo
parent=
mdistate=0
nx=0
@@ -1095,8 +1208,8 @@ windowlayout=539
ncy=0
x=0
y=0
- cx=1076
- cy=31
+ cx=1256
+ cy=32
rcx=0
rcy=0
[sourcefo]
@@ -1109,10 +1222,10 @@ windowlayout=539
ny=0
ncx=0
ncy=0
- x=208
+ x=0
y=0
- cx=868
- cy=604
+ cx=1256
+ cy=987
rcx=0
rcy=0
[actionsmo.watchesonact]
@@ -1130,16 +1243,16 @@ windowlayout=539
ncx=0
ncy=0
x=0
- y=34
- cx=1076
- cy=604
+ y=35
+ cx=1256
+ cy=987
rcx=0
rcy=0
[cpui386fo]
irqoff=0
splitdir=0
useroptions=16491
- stackedunder=mainfo
+ stackedunder=findinfilefo
parent=
mdistate=0
nx=0
@@ -1155,65 +1268,7 @@ windowlayout=539
wsize=0
active=0
visible=0
-[edit]
-hintwidth=462
-hintheight=214
-finddtext=res=
-findhistory=7
- res=
- 30005
- NewView
- images
- Sort
- sort
- uses
+[targetconsole]
+finddtext=
+findhistory=0
findoptions=1
-editpos=5
- 0,-1073741823
- 0,-1073741823
- 0,-1073741823
- 0,-1073741823
- 23,73
-bookmarks0=0
-bookmarks1=0
-bookmarks2=0
-bookmarks3=0
-bookmarks4=0
-sourcefiles=5
- /home/graemeg/programming/fpgui/uidesigner/vfdforms.pas
- /home/graemeg/programming/fpgui/uidesigner/vfdwidgets.pas
- /home/graemeg/programming/fpgui/uidesigner/vfdmain.pas
- /home/graemeg/programming/fpgui/uidesigner/newformdesigner.pas
- /home/graemeg/programming/fpgui/uidesigner/vfddesigner.pas
-relpaths=5
- vfdforms.pas
- vfdwidgets.pas
- vfdmain.pas
- newformdesigner.pas
- vfddesigner.pas
-ismoduletexts=5
- 0
- 0
- 0
- 0
- 0
-modules=0
-visiblemodules=0
-[sourcefo.tabwidget]
-tabsize=152
-firsttab=0
-index=4
-[components]
-[selecteditpage]
-colwidth=100
-x=160
-y=124
-cx=704
-cy=473
-[progparams]
-parameters=
-progparamhistory=0
-workingdirectory=
-envvarons=0
-envvarnames=0
-envvarvalues=0
diff --git a/uidesigner/uidesigner.project b/uidesigner/uidesigner.project
new file mode 100644
index 00000000..3ec67e19
--- /dev/null
+++ b/uidesigner/uidesigner.project
@@ -0,0 +1,36 @@
+[ProjectOptions]
+ProjectDir=/home/graemeg/devel/fpgui/uidesigner/
+ProjectName=uidesigner.project
+MainUnit=uidesigner.lpr
+TargetFile=uidesigner${EXEEXT}
+DefaultMake=0
+UnitOutputDir=units/${TARGET}/
+MakeOptionsCount=4
+MakeOptionEnabled1=1,1,1,1,1,1
+MakeOptionEnabled2=1,1,1,1,1,0
+MakeOptionEnabled3=0,1,0,0,0,1
+MakeOptionEnabled4=0,0,0,0,0,1
+MacroCount=3
+Macro1=TargetCPU=i386
+Macro2=TargetOS=win32
+Macro3=tiOPF_fpGUI_Dir=/home/graemeg/devel/tiopf/
+UnitDirsCount=6
+UnitDirEnabled1=1,1,1,1,0,0,0,1,0,0
+UnitDirEnabled2=1,1,1,1,0,0,1,1,0,0
+UnitDirEnabled3=1,1,1,0,0,0,1,1,0,0
+UnitDirEnabled4=0,0,0,1,0,0,1,1,0,0
+UnitDirEnabled5=1,1,1,1,0,0,1,0,0,0
+UnitDirEnabled6=1,1,1,1,0,0,1,0,0,0
+MakeOption1=-l -Mobjfpc -Sch
+MakeOption2=-gl -O-
+MakeOption3=-B
+MakeOption4=-O2 -XX -Xs -CX
+UnitDir1=${FPGUIDIR}/src/
+UnitDir2=${FPGUIDIR}/src/corelib/
+UnitDir3=${FPGUIDIR}/src/corelib/x11/
+UnitDir4=${FPGUIDIR}/src/corelib/gdi/
+UnitDir5=${FPGUIDIR}/src/gui/
+UnitDir6=${FPGUIDIR}/src/gui/db/
+
+[Units]
+UnitCount=0
diff --git a/uidesigner/uidesigner_clean.prj b/uidesigner/uidesigner_clean.prj
new file mode 100644
index 00000000..bb71809f
--- /dev/null
+++ b/uidesigner/uidesigner_clean.prj
@@ -0,0 +1,361 @@
+[projectoptions]
+mainfile=${PROJECTNAME}.lpr
+targetfile=units/${TARGET}/${PROJECTNAME}${EXEEXT}
+messageoutputfile=
+makecommand=${COMPILER}
+makedir=
+unitdirs=7
+ ${FPGUI}/lib/${TARGET}
+ ${FPGUI}/src/reportengine
+ ${FPGUI}/src/corelib/render/software
+ ${FPGUI}/src
+ ${FPGUI}/src/corelib/${FPG_GFX}
+ ${FPGUI}/src/gui
+ ${FPGUI}/src/corelib
+unitpref=-Fu
+incpref=-Fi
+libpref=-Fl
+objpref=-Fo
+targpref=-o
+befcommand=0
+aftcommand=0
+makeoptions=6
+ -l -Mobjfpc -Sh
+ -gl -O-
+ -B
+ -O2 -XX -Xs -CX
+ -vewinh
+ -FEunits/${TARGET}/
+codetemplatedirs=1
+ ${TEMPLATEDIR}
+toolmenus=3
+ fpGUI &DocView
+ UI Designer
+ Image Converter
+toolfiles=3
+ ${FPGUI}/docview/src/units/${TARGET}/docview${EXEEXT}
+ ${FPGUI}/uidesigner/units/${TARGET}/uidesigner${EXEEXT}
+ ${FPGUI}/tools/imageconvert/imgcnv${EXEEXT}
+toolparams=3
+ fpgui+rtl+fcl -k ${cursword}
+ ${CURSOURCEFILE}
+
+fontnames=0
+scriptbeforecopy=
+scriptaftercopy=
+newprojectfiles=4
+ ${TEMPLATEDIR}/fpgui_single_unit/project.pas
+ ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt
+ ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt
+ ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt
+newprojectfilesdest=4
+ ${%PROJECTNAME%}.pas
+ ${%PROJECTDIR%}units/i386-linux/placeholder.txt
+ ${%PROJECTDIR%}units/i386-win32/placeholder.txt
+ ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt
+newfinames=3
+ Program
+ Unit
+ Textfile
+newfifilters=3
+ "*.pas" "*.pp"
+ "*.pas" "*.pp"
+
+newfiexts=3
+ pas
+ pas
+
+newfisources=3
+ ${TEMPLATEDIR}default/program.pas
+ ${TEMPLATEDIR}default/unit.pas
+
+newfonames=2
+ Mainform
+ Simple Form
+newfonamebases=2
+
+
+newfosources=2
+ ${TEMPLATEDIR}fpgui/mainform.pas
+ ${TEMPLATEDIR}fpgui/simpleform.pas
+newfoforms=2
+
+
+forcezorder=0
+stripmessageesc=0
+copymessages=0
+closemessages=0
+checkmethods=1
+colorerror=-1610612712
+colorwarning=-1610612717
+colornote=-1610612716
+usercolors=30
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+usercolorcomment=30
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+formatmacronames=0
+formatmacrovalues=0
+settingsfile=uidesigner_clean.prj
+settingseditor=1
+settingsdebugger=1
+settingsstorage=1
+settingsprojecttree=0
+settingsautoload=0
+settingsautosave=0
+modulenames=0
+moduletypes=0
+modulefiles=0
+befcommandon=0
+makeoptionson=6
+ 39
+ 3
+ 6
+ 4
+ 39
+ 39
+aftcommandon=0
+unitdirson=7
+ 65568
+ 65543
+ 196615
+ 131079
+ 196615
+ 65543
+ 65543
+macroon=0
+macronames=0
+macrovalues=0
+macrogroup=0
+groupcomments=6
+
+
+
+
+
+
+toolsave=3
+ 0
+ 0
+ 0
+toolhide=3
+ 0
+ 0
+ 0
+toolparse=3
+ 0
+ 0
+ 0
+toolmessages=3
+ 0
+ 0
+ 0
+fontalias=0
+fontancestors=0
+fontheights=0
+fontwidths=0
+fontoptions=0
+fontxscales=0
+expandprojectfilemacros=4
+ 1
+ -1
+ -1
+ -1
+loadprojectfile=4
+ 1
+ 0
+ 0
+ 0
+newinheritedforms=2
+ 0
+ 0
+uid=0
+sourcefilemasks=5
+ "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr"
+ "*.c" "*.cc" "*.h"
+ "*.mfm"
+ "*.ipf"
+ "*.sql"
+syntaxdeffiles=5
+ ${SYNTAXDEFDIR}pascal_dark.sdef
+ ${SYNTAXDEFDIR}cpp.sdef
+ ${SYNTAXDEFDIR}objecttext.sdef
+ ${SYNTAXDEFDIR}ipf2.sdef
+ ${SYNTAXDEFDIR}sql.sdef
+filemasknames=5
+ Source
+ Forms
+ Text
+ IPF help
+ All Files
+filemasks=5
+ "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr"
+ *.mfm
+ *.txt
+ *.ipf
+ *
+showgrid=1
+snaptogrid=1
+moveonfirstclick=1
+noformdesignerdocking=0
+gridsizex=8
+gridsizey=8
+autoindent=1
+blockindent=2
+linenumberson=0
+rightmarginon=1
+rightmarginchars=80
+scrollheight=0
+tabstops=2
+spacetabs=1
+showtabs=0
+tabindent=0
+editfontname=Raize
+editfontheight=16
+editfontwidth=0
+editfontextraspace=0
+editfontcolor=-1879048183
+editbkcolor=-1879048186
+statementcolor=14745599
+editfontantialiased=1
+editmarkbrackets=1
+backupfilecount=0
+encoding=0
+codetemplatedirs=1
+ ${TEMPLATEDIR}
+debugcommand=${DEBUGGER}
+debugoptions=
+debugtarget=
+runcommand=
+xtermcommand=xterm -S${PTSN}/${PTSH}
+remoteconnection=
+uploadcommand=
+gdbprocessor=i386
+gdbservercommand=
+gdbservercommandattach=
+beforeconnect=
+afterconnect=
+beforeload=
+afterload=
+beforerun=
+sourcedirs=7
+ ${FPGUI}/src/reportengine/
+ ${FPGUI}/src/corelib/render/software/
+ ${FPGUI}/src/
+ ${FPGUI}/src/corelib/${FPG_GFX}/
+ ${FPGUI}/src/gui/
+ ${FPGUI}/src/corelib/
+ ./
+defines=0
+progparameters=
+progworkingdirectory=
+envvarnames=0
+envvarvalues=0
+defineson=0
+stoponexception=0
+valuehints=1
+activateonbreak=1
+raiseonbreak=1
+showconsole=1
+externalconsole=0
+settty=1
+gdbdownload=0
+downloadalways=0
+startupbkpt=0
+startupbkpton=0
+gdbsimulator=0
+gdbserverstartonce=0
+gdbserverwait=0
+nogdbserverexit=0
+gdbservertty=0
+exceptclassnames=1
+ EconvertError
+exceptignore=1
+ 0
+nodebugbeginend=0
+sigsettings=27
+ 1,1,T,F
+ 3,3,T,F
+ 4,4,T,F
+ 6,6,T,F
+ 7,7,T,F
+ 8,8,T,F
+ 9,9,T,F
+ 10,10,T,F
+ 11,11,T,F
+ 12,12,T,F
+ 13,13,T,F
+ 15,15,T,F
+ 16,16,T,F
+ 17,17,F,F
+ 18,18,T,F
+ 19,19,T,F
+ 20,20,T,F
+ 21,21,T,F
+ 22,22,T,F
+ 23,23,T,F
+ 24,24,T,F
+ 25,25,T,F
+ 26,26,T,F
+ 27,27,T,F
+ 28,28,T,F
+ 29,29,T,F
+ 30,30,T,F
+defaultmake=4
diff --git a/uidesigner/units/i386-freebsd/.gitignore b/uidesigner/units/i386-freebsd/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/uidesigner/units/i386-freebsd/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/uidesigner/units/i386-linux/.gitignore b/uidesigner/units/i386-linux/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/uidesigner/units/i386-linux/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/uidesigner/units/i386-win32/.gitignore b/uidesigner/units/i386-win32/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/uidesigner/units/i386-win32/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/uidesigner/units/x86_64-freebsd/.gitignore b/uidesigner/units/x86_64-freebsd/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/uidesigner/units/x86_64-freebsd/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/uidesigner/units/x86_64-linux/.gitignore b/uidesigner/units/x86_64-linux/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/uidesigner/units/x86_64-linux/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas
index 0de305cb..a3b60597 100644
--- a/uidesigner/vfddesigner.pas
+++ b/uidesigner/vfddesigner.pas
@@ -81,11 +81,12 @@ type
FSelected: boolean;
resizer: array[1..8] of TwgResizer;
other: TStringList;
+ MarkForDeletion: Boolean;
constructor Create(AFormDesigner: TFormDesigner; wg: TfpgWidget; wgc: TVFDWidgetClass);
destructor Destroy; override;
+ procedure UpdateResizerPositions;
property Selected: boolean read FSelected write SetSelected;
property Widget: TfpgWidget read FWidget;
- procedure UpdateResizerPositions;
property FormDesigner: TFormDesigner read FFormDesigner;
end;
@@ -205,6 +206,7 @@ begin
FSelected := False;
wg.MouseCursor := mcDefault;
other := TStringList.Create;
+ MarkForDeletion := False;
end;
destructor TWidgetDesigner.Destroy;
@@ -630,20 +632,44 @@ procedure TFormDesigner.DeleteWidgets;
var
n: integer;
cd: TWidgetDesigner;
+
+ procedure DeleteChildWidget(ADesignWidget: TWidgetDesigner);
+ var
+ i: integer;
+ begin
+ if not Assigned(ADesignWidget.Widget) then // safety check
+ Exit;
+ if ADesignWidget.Widget.IsContainer and (ADesignWidget.Widget.ComponentCount > 0) then
+ begin
+ for i := ADesignWidget.Widget.ComponentCount - 1 downto 0 do
+ DeleteChildWidget(WidgetDesigner(TfpgWidget(ADesignWidget.Widget.Components[i])));
+ end;
+ ADesignWidget.MarkForDeletion := True;
+ end;
+
begin
n := 0;
+ // Pass 1: Mark widgets and children than need deletion
while n < FWidgets.Count do
begin
cd := TWidgetDesigner(FWidgets.Items[n]);
if cd.Selected then
+ DeleteChildWidget(cd);
+ Inc(n);
+ end;
+
+ // Pass 2: free TWidgetDesigner instances that have no more Widget instances
+ for n := FWidgets.Count-1 downto 0 do
+ begin
+ cd := TWidgetDesigner(FWidgets.Items[n]);
+ if cd.MarkForDeletion then
begin
cd.Widget.Free;
cd.Free;
FWidgets.Delete(n);
- end
- else
- Inc(n);
+ end;
end;
+
UpdatePropWin;
end;
@@ -1185,6 +1211,14 @@ begin
s := s + Ind(1) + 'Hint := ' + QuotedStr(t) + ';' + LineEnding;
end;
+ // IconName property - This is ugly, Form's properties are not handled well!!
+ PropInfo := GetPropInfo(FForm.ClassType, 'IconName');
+ t := GetStrProp(FForm, 'IconName');
+ if IsStoredProp(FForm, PropInfo) then
+ begin
+ s := s + Ind(1) + 'IconName := ' + QuotedStr(t) + ';' + LineEnding;
+ end;
+
// ShowHint property - This is ugly, Form's properties are not handled well!!
PropInfo := GetPropInfo(FForm.ClassType, 'ShowHint');
i := GetOrdProp(FForm, 'ShowHint');
diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas
index 7362b8d2..f0a9d62e 100644
--- a/uidesigner/vfdwidgets.pas
+++ b/uidesigner/vfdwidgets.pas
@@ -351,6 +351,7 @@ begin
wc := TVFDWidgetClass.Create(TfpgForm);
wc.NameBase := 'frm';
wc.AddProperty('WindowTitle', TPropertyString, '');
+ wc.AddProperty('IconName', TPropertyString, 'Image name to change window icon');
wc.AddProperty('Hint', TPropertyString, 'Tooltip hint');
wc.AddProperty('ShowHint', TPropertyBoolean, '');
wc.AddProperty('Sizeable', TPropertyBoolean, 'Can the form be resized at runtime');