Difference between revisions of "Reference: MSEgui"

From Lazarus wiki
Jump to navigationJump to search
 
(43 intermediate revisions by 3 users not shown)
Line 10: Line 10:
 
=== TMseFormWidget ===
 
=== TMseFormWidget ===
 
Use it in order to insert a tcustomform descendant into another widget at designtime. Does not try to load resources in "create".
 
Use it in order to insert a tcustomform descendant into another widget at designtime. Does not try to load resources in "create".
 +
<pre>
 +
        tmseform descendants ( MainForm, SimpleForm,.. )
  
=== TDockFormWidget ===
+
Client area of the form & parent of its widgets ( against which the widgets
=== TPaintbox ===
+
are placed and colored ) is presented by the "container" property
 +
not "container.frame.clientarea"
 +
 
 +
CanClose is called :
 +
 
 +
- on receiving "ek_close" by window
 +
- for modal window, on focus change
  
How to draw line (or circle) on tpaintbox? In event onpaint:
+
- within parent window's "CanClose" where all nested windows are 
 +
checked for OnCloseQuery & OnClose - if any sets "mr_none" then the parent window
 +
can't close as well
 +
 +
- from nested window's "CanParentClose"
 +
- from own "CanParentClose"
  
<syntaxhighlight lang=pascal>
+
- some componnets build oneself in own "Loaded" procedure :
procedure tmainfo.paintboxonpaint(const sender: twidget; const canvas: tcanvas);
+
= widget grids
begin
+
= database access components
  with sender,canvas do begin
+
= ...
  drawline(nullpoint,pointty(size),cl_yellow); 
 
  //diagonal line across widget  
 
  drawellipse(makerect(makepoint(bounds_cx div 2,bounds_cy div 2), size),cl_red);
 
  //circle (or ellipse) centered in widget                           
 
  end;
 
end;
 
</syntaxhighlight>
 
 
Makepoint and makerect are in msegraphutils.
 
  
=== TEventWidget ===
+
The "form.show" has parameter "transientfor".
A widget which publishes all possible events of a twidget. Normally it is better to implement your own specialized descendant of an existing widget instead to use teventwidget.
+
The window Z-order is above the "transientfor" window. The exact behaviour
 +
depends on the window manager.
 +
       
 +
        caption
 +
- run-time caption on the title bar
  
=== TButton ===
+
color
* A rectangular clickable area that can show text/bitmap.
+
- color behind the client ( contaner ) area
- Main properties:
 
Caption: read/write the text that appear on top of it.
 
onexecute: read/write the address of a procedure (event handler) to be executed when clicked.
 
  
=== TStockGlyphButton ===
+
container
=== TRichButton ===
+
- the real parent of form's widgets, <see "tformscrollbox">
=== TLabel ===
 
* Draws a piece of text on the given surface (canvas: screen/printer/bitmap).
 
- Main properties:
 
Caption: read/write the piece of text.
 
  
See also [[Reference:_MSEgui/TLabel|TLabel]]
+
cursor
 +
- the mouse over cursor shape
  
=== TGroupBox ===
+
enabled - "false" disables all child widgets
=== TStepBox ===
 
=== TStringDisp ===
 
*A read only version of TStringEdit, difference from TLabel: has a frame around it.
 
-Main properties:
 
Value: read/write the text that are showed.
 
Caption: A label normally describing the purpose or meaning of the presented text, it can be positioned around the frame.
 
  
=== TByteStringDisp ===
+
face
=== TIntegerDisp ===
+
<see "tfacecomp"> + some more options
=== TRealDisp ===
 
=== TDateTimeDisp ===
 
=== TBooleanDisp ===
 
=== TToolBar ===
 
=== TDrawGrid ===
 
=== TStringGrid ===
 
=== TTabBar ===
 
=== TTabPage ===
 
=== TTabWidget ===
 
=== TDockHandle ===
 
=== TDockPanel ===
 
=== TSpliter ===
 
<pre>
 
      A widget very similar to "tspacer" but :
 
- designed to rearrange areas occupied by adjacent widgets
 
- a linked widget may only enlarge by "eating" the opposite one,
 
so the summary area of both widgets don't change
 
- has GUI look ( hatched grip, color etc) switched on by default
 
- facilitates run-time repositioning oneself and linked widgets
 
- linked widgets may even be other splitters, spacers (with their linked widgets ),..
 
 
        Properties:
 
  
- color
+
font
= see {any_widget.color}
+
<see "tfont">
  
- cursor
+
frame
= see {any_widget.cursor}
+
<see "tframecomp"> + some more options
 +
 +
icon
 +
<see "timage">
 +
 
 +
mainmenu
 +
<see tmainmenu>
  
- enabled
+
name
= "false" stops user interaction
+
- name to refer when programming
  
- face
+
options:
= see {any_face}
 
  
- frame
+
fo_main
= see {any_frame}
+
- assigns this from as the aplication GUI-face & event receiver
 +
- causes the icon of this form to be icon of the application
  
- colorgrip
+
fo_terminateonclose
= color of grip hatching
+
- causes the application to terminate once the form has closed ( doesn't depend on "fo_main" )
  
- grip
 
= defines hatching pattern of the grip
 
  
* stb_dens(N) : the pattern is of rhombuses, the painted rhombs occupy "N" persents of the grip
+
fo_freeonclose
 +
- causes the form (even being modal) to release its memory on closure or OK-return from "CanClose"
  
* stb_block(N) : the pattern is of squares, painted & unpainted squares are equally sized and
+
fo_defaultpos
both have "N" pixels sides
+
- lets the WM to position the form initially
 
* stb_hatchup(N) : the pattern is of right-tilted lines of 1 pixel width,
 
each "N"-th pixel forms these lines
 
  
* stb_hatchdown(N) : the pattern is of left-tilted lines of 1 pixel width,
+
fo_screencentered
each "N"-th pixel forms these lines
+
- causes the form initially to show in center of the apllication work area
  
* stb_crosshatch(N) : the pattern is of crossing (left & right) tilted lines of 1 pixel width,
+
fo_closeonesc
each "N"-th pixel forms these lines
+
- causes the form to close on "Esc" key pressed ( with MR_ESCAPE & "OnCloseQuery" firing )
  
 +
fo_cancelonesc
 +
- causes the form to close on "Esc" key pressed ( with MR_CANCEL & "OnCloseQuery" firing )
  
- linkbottom/linkleft/linkright/linktop
+
fo_closeonenter
= see {tspacer.*}
+
- causes the form to close on "Enter" key pressed ( with MR_OK & "OnCloseQuery" firing )
  
- options
+
fo_closeonf10
 +
- causes the form to close on "F10" key pressed ( with MR_F10 & "OnCloseQuery" firing )
  
= spo_hmove
+
fo_globalshortcuts
* "true" allows the spliter to move horizontally
+
- allows on-this-form "ao_globalshortcut" actions to trigger
  
= spo_hprop
+
  Notes :
* "true" : keep the left position proportional ( on the ratio of creation time )
+
= shortcuts for modal not "fo_localshortcut" forms are processed by app
to weigth of the client area of parent
+
= shortcuts for "fo_globalshorcut" forms are processed by the owning window
  
= spo_hsizeprop
+
fo_localshortcuts
* "true" : keep width of the spacer proportional ( on the ratio of creation time )
+
- disables triggering shortcuts of on-this-form actions
to weigth of the client area of parent
 
* the width stops shrinking on one set in design time
 
  
= spo_vmove
+
fo_autoreadstat
* "true" allows the spliter to move vertically
+
- for "cs_ismodule" forms, before "OnLoaded" fires, rereads all statvars from the bound stafile/memorystream
  
= spo_vprop
+
fo_autowritestat
* "true" : keep the top position proportional ( on the ratio of creation time )
+
- in "CanClose", after "OnClose" fires [ and before app termination for "fo_terminateonlose" form ],
to height of the client area of parent
+
rewrites all statvars to the stafile/memorystream
 +
- for datamodules, does this before "OnDestroy" fires
  
= spo_vsizeprop
+
fo_savepos
* "true" : keep height of the spacer proportional ( on the ratio of creation time )
+
- saves/restores Z-order, size & scree coordinates of the form
to height of the client area of parent
+
as soon as the stat data are ready
* the height stops shrinking on one set in design time
 
  
= spo_dockleft
+
fo_savestate
* causes the "linkleft" widget to dock to the left border of splitter
+
- for top-level form, saves/restores "VSize", "Active" & "Visible"  
* make sence only if linkleft "widget.bounds_x" less than "splitter.bounds_x"
+
as soon as the stat data are ready
  
= spo_docktop
+
optionswidget
* causes the "linktop" widget to dock to the top border of splitter
+
<see "any widget">
* make sence only if linktop "widget.bounds_y" less than "splitter.bounds_y"
+
optionswindow
 +
<see "any window">
 +
popupmenu
 +
<see "tpopupmenu">
 +
stafile
 +
<see "tstafile">
 +
stavarname
 +
taborder
 +
tag
  
= spo_dockright
+
visible - for a form, only affects its childs widgets
* causes the "linkright" widget to dock to the right border of splitter
 
* make sence only if linkright "widget.(bounds_x+bounds_cx)" more than "splitter.(bounds_x+bounds_cx)"
 
  
= spo_dockbottom
+
Events:
* causes the "linkbottom" widget to dock to the bottom border of splitter
 
* make sence only if linkbottom "widget.(bounds_y+bounds_cy)" more than "splitter.(bounds_y+bounds_cy)"
 
  
!!! Two special cases :
+
activate = to set focused & redraw the invalidated area
  
1. (spo_dockleft = spo_dockright = TRUE) && (linkleft = linkright = the_same_widget) :
+
oncreate
causes the "linkleft" widget to adjust to h-positiion & width of the splitter,
+
- fires before "Loaded" procedure is called
it's even possible that the widget doesn't touch the splitter
+
- fires after creating the widget & its subwidgets but before the final arrangement
 +
- forms arent' yet visible on return
  
(spo_docktop = spo_dockbottom = TRUE) && (linktop = linkbottom = the_same_widget) :
+
  Since "Loaded" procedure hasn't yet worked at this point then
causes the "linktop" widget to adjust to v-position & height of the splitter,
+
database contents, values of widget grid's subwidgets
 +
are invalid in this event ***
  
It's even possible in these cases that the widget doesn't touch the splitter
+
onloaded
 +
- fires once "Loaded" procedure of owns & all form's widgets finishes
 +
- processed  after "OnCreate"
 +
- on finishing, forms aren't yet visible
  
- optionsscale
+
oneventloopstart ( main forms only )
= see {tscalingwidget.optionsscale}
+
- only applicable to main forms
 +
- fires once all application GUI is built and shown
 +
( and ready to user's interaction )
 +
 +
onactivate
 +
- see {any_widget.OnActivate}
  
- optionswidget
+
onenter
= see {anywidget.optionswidget}
+
= see {any_widget.OnEnter}
  
- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus,
+
onfocus
  onfontheightdelta, onmove, onpopup, onresize, onshowhint
+
- see {any_widget.OnFocus}
= see "tspacer"
+
 +
 
 +
onwindowactivechanged
 +
- fires on :
 +
= touching another window even on clicking in a behind-modal window ( or its title bar )
 +
= 1-st showing the window
 +
- reactivating the window
 +
 
 +
onbeforepaint
 +
- fires at the very beginning of "paint", before drawing canvas
 +
 
 +
onpaint
 +
- fires in "paint" procedure, between drawing canvas and contained widgets
  
- onupdatelayout
+
onafterpaint (doafterpaint)
fires :
+
- fires just on return from "paint" procedure
 
= on creating the splitter
 
= on any reposition of the linked widgets
 
( due to moving the splitter, resizing the parent,.. )
 
</pre>
 
  
=== TSpacer ===
+
        onapplicationactivechanged
* a regular widget which creates a kind of positional link between surrounding widgets
+
- fires :
* designed to maintain distances between widgets
+
= if the application gets/looses input focus
* may have GUI look, caption etc switched off by default
 
* resizing a spacer repositions its linked widgets
 
  
Properties:
+
onasyncevent (doasyncevent)
 +
- fires on calling {this_form}.asyncevent(atag) from any place of the application
 +
once delivered by the app even queue
  
- anchors
+
"atag" set by caller(s) helps to branch within "onasyncevent", to identify the caller, etc ***
= see {any_widget.anchors}
+
generally, doesn't fire instantly because these events are delivered through the app event queue ***
  
- bounds
 
= see {any_widget.bounds}
 
  
- color
+
onchildmouseevent
= see {any_widget.color}
+
- fires on any mouse activity over its child widget(s) not the (containing) widget oneself
  
- enabled
+
      for forms, it even fires on enetering "container" therefore it appears as if to be the form itself ***
= "false" turns color of the caption to gray
 
  
- visible
+
onchildscaled
= "true" allows displayable settings (caption text, face, frame etc) to take
+
- see {any_widget.OnChildScaled}
effect in run-time as well
 
 
- <face>
 
= see {any face}
 
  
- <frame>
+
onclientmouseevent
= see {any frame}
+
- fires on any mouse activity over areas expecting user's mouse input (not titlebars/frames/...)
  
- linkbottom
+
onclose
= widget linked down to most outer edge (incl. frame[.caption]) of the spacer
+
- fires in "CanClose" if "modalresult <> mr_none"
- linkleft
+
 
= widget linked left to most outer edge of the spacer
+
onclosequery
- linkright
+
- fires in "CanClose" before "OnClose"
= widget linked right to most outer edge of the spacer
+
- "mr_none" set on return prevents the window (and its parent) from closing
- linktop
+
( "OnClose" is also bypassed )
= widget linked up to most outer edge of the spacer
 
  
- dist_bottom, dist_left, dist_right, dist_top :
 
= margins between most outer edge the spacer
 
and the corresponding linked widget
 
  
- options :
+
ondeactivate
 +
- see {any_widget.OnDeactivate}
  
= spao_glueright
+
ondefocus
 +
- see {any_widget.OnDeFocus}
 +
 +
ondestroy
 +
- fires on in-code calling "BeforeDestruction"
  
  - if "false"
+
ondestroyed
 +
- fires on return from the form's destructor ( when all resources are freed )
  
h-repositioning or h-resizing the linkleft widget shifts
+
onterminatequery
the whole linked construction, it becomes the only way to h-shift
+
- fires on an attempt to terminate the app
 +
- by setting "var terminate:= false", allows to cancel termination
  
if {an_right IN linkright_widget.anchors} then the spacer
+
Termination by debugger/OS facilities can't be blocked this way ( win32 )***
may be right-resized with auto h-resizing the linkright widget
 
so that the right margin of that widget is kept
 
  
if NOT {an_right IN linkright_widget.anchors} then the spacer
+
onterminated
may be right-resized with auto h-shifting the linkright widget
+
- fires for not-yet-destroyed forms, once the app event loop finishes
so that width of that widget is kept
+
- may be caused by any closure of the main app form
 +
( app termination, WM/OS facilities, )
  
- if "true"
 
  
h-repositioning or h-resizing the linkright widget shifts
+
onwindowdestroyed
the whole linked construction, it becomes the only way to h-shift
+
- fires once a descendant window is destroyed
 +
( for a main form, when a modal simple form is closed by any way,.. )
  
if {an_left IN linkleft_widget.anchors} then the spacer
+
onevent
may be h-resized with auto h-resizing the linkleft widget
+
- fires on receiving an event
so that the left margin of that widget is kept
+
= for simple forms, it's only "ek_loaded"
  
if NOT {an_left IN linkleft_widget.anchors} then the spacer
+
There can be more if the form is connected to object_event sending
may be h-resized with auto h-shifting the linkleft widget
+
components or if the application uses object events, for example by calling
so that width of that widget is kept
+
tguicomponent.postcomponentevent. ****
  
= spao_gluebottom
+
onexit
 +
- see {any_widget.OnExit}
  
- if "false"  
+
onfocusedwidgetchanged
 +
- for a "prev-new" parent-wide focused wigdets pair, fires once installing new focus has finished,
 +
after "OnFocus"
 +
- resends for all contained widgets
 +
- doesn't fire if the "prev-new" pair don't really change
  
v-repositioning or v-resizing the linktop widget shifts
+
onfontheightdelta
the whole linked construction, it becomes the only way to v-shift
+
- see {any_widget.OnFontHeightDelta}
  
if {an_bottom IN linkbottom_widget.anchors} then the spacer
+
onhide
may be v-resized with auto v-resizing the linkbottom widget
+
- fires at beginnig of own/parent's
so that the bottom margin of that widget is kept
+
= hide
 +
= hidden
 +
= destroying
 +
= setting "visible:= false"
 +
= closing the window ( receiving event "ek_close",.. )
 +
= calling "window.close"
 +
 +
onidle
 +
- fires everytime when the app GUI event queue gets empty
 +
- to stop calling for a while, set "again" parameter to "false" (the initial value );
 +
 +
DON'T DO ANYTHING AFFECTING THE APP EVENT QUEUE ( MODAL WINDOWS, "ShowMessage", Sleep(N),... ) IN THIS HANDLER.
 +
MODAL WINDOWS CAUSE RECURSION !
 +
 +
A code fragment:
 +
 
 +
again:= i < 5;
 +
if not again then exit;
  
if NOT {an_bottom IN linkbottom_widget.anchors} then the spacer
+
onkeydown
may be v-resized with auto v-shifting the linkbottom widget
+
- fires on pressing down a keyboard key over the client area when none of child widgets is focused
so that height of that widget is kept
 
  
- if "true"
+
onkeyup
 +
- fires on releasing a keyboard key over the client area when none of child widgets is focused
  
        v-repositioning or v-resizing the linkbottom widget shifts
+
onmouseevent
the whole linked construction, it becomes the only way to v-shift
+
- fires on any mouse activity over the client area
  
if {an_top IN linktop_widget.anchors} then the spacer
+
onmove
may be v-resized with auto v-resizing the linktop widget
+
- see {any_window.OnMove}
so that the top margin of that widget is kept
 
  
if NOT {an_top IN linktop_widget.anchors} then the spacer
+
onpopup
may be v-resized with auto v-shifting the linktop widget
+
- see {any_widget.OnPopup}
so that height of that widget is kept
 
  
- optionsscale
+
onresize
= see {tscalingwidget.optionsscale}
+
- see {any_widget.OnResize}
  
- optionswidget
+
onshortcut
= see {anywidget.optionswidget}
+
- fires before built-in shorcut processing
 +
- "info.eventstate=es_processed" set in "OnShortcut" prevents
 +
the event from further auto-processing
  
- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus,
+
The app
  onfontheightdelta, onpopup, onresize, onshowhint
+
- recognizes & takes registered shortcuts from app event queue
= see {any_widget.*}
+
- passes the shocrcut event to each of its windows until the event
 +
is processed otherwise processes it by oneself
 +
  
- onmove
+
onshow
= see {any_window.OnMove}
+
- fires if the widget is visible:
 +
= on calling "Show" method
 +
= on return from "Loaded" procedure
 +
= on showing the parent widget
 +
- since called at end, allows to adjust the default behavior
  
any "link*" option set disables the spacer to reposition solely,
+
onshowhint
repositioning is only controlled by a "glued" widget since then
+
- see {any_widget.OnShowHint}
  
=== TLayouter ===
+
onstatbeforeread
* a tspacer descendant designed to (auto)resize or/and move its contained widgets acc to some size/positon dependencies
+
- fires before loading statvars  from the disk file
* may have GUI look, frame caption etc switched off by default
 
* layouters may be nested to achieve complex layouts
 
  
Each layout change/assignment is divided into performing 3 consequent stages :
+
onstatafterread
 +
- fires once statvars are loaded from the disk file
  
==== Stage 1 ====
+
onstatupdate
 +
- fires at 1-st stage before updating GUI "state/pos" for read statvars
 +
or
 +
- fires at pre-last stage before saving GUI "state/pos"
  
Widgets auto resized using the following options:
+
onstatread
 +
- fires at 2-nd stage before updating GUI "state/pos" for read statvars
  
<pre>
+
onstatwrite
- if {lao_placex OR lao_placey} :
+
- fires at last stage before saving GUI "state/pos"
  
= if {plo_scalesize in optionslayout}  then
+
pon stat reading, non-minimized visible windows are shown,
* widgets with "osk_nopropwith" unset in their "optionsskin" are h-scaled
+
the active window is activated
    in the proportion of change of tlayouter's clientwidth
 
* widgets with "osk_nopropheight" unset in their "optionsskin" are v-scaled
 
    in the proportion  of change of tlayouter's clientheight
 
  
For h-resized layouter, the effect looks like :
+
</pre>
 +
=== TDockFormWidget ===
 +
=== TPaintbox ===
  
|--Widget__1---Widget__2--| => the initial look
+
How to draw line (or circle) on tpaintbox? In event onpaint:
  
  |--Widget_1--Widget_2--| => the layouter gets narrower
+
<syntaxhighlight lang=pascal>  
 +
procedure tmainfo.paintboxonpaint(const sender: twidget; const canvas: tcanvas);
 +
begin
 +
  with sender,canvas do begin
 +
  drawline(nullpoint,pointty(size),cl_yellow); 
 +
  //diagonal line across widget
 +
  drawellipse(makerect(makepoint(bounds_cx div 2,bounds_cy div 2), size),cl_red);
 +
  //circle (or ellipse) centered in widget                           
 +
  end;
 +
end;
 +
</syntaxhighlight>
 +
 +
Makepoint and makerect are in msegraphutils.
  
  |---Widget___1---Widget___2---| => the layouter gets wider
+
=== TEventWidget ===
 +
A widget which publishes all possible events of a twidget. Normally it is better to implement your own specialized descendant of an existing widget instead to use teventwidget.
  
*** both widget sizes & margins are affected ***
+
=== TButton ===
*** Widget_N may generally situate on different y-levels ***
+
* A rectangular clickable area that can show text/bitmap.
 
+
- Main properties:
otherwise :
+
Caption: read/write the text that appear on top of it.
 +
onexecute: read/write the address of a procedure (event handler) to be executed when clicked.
  
= if lao_scalewidth in optionslayout :
+
=== TStockGlyphButton ===
* widgets with "osk_nopropwith" unset in their "optionsskin" enters in the mode
+
=== TRichButton ===
  ( not applied until the layouter resizes! ) when they are h-scaled in the proportion
+
=== TLabel ===
  as far as clientwidth of the tlayouter changes, then stages 2 & 3 are reapplied
+
* Draws a piece of text on the given surface (canvas: screen/printer/bitmap).
 +
- Main properties:
 +
Caption: read/write the piece of text.
  
For h-resized layouter, the effect looks like :
+
See also [[Reference:_MSEgui/TLabel|TLabel]]
  
  |--Single____widget????| => the initial look
+
=== TGroupBox ===
 +
=== TStepBox ===
 +
=== TStringDisp ===
 +
*A read only version of TStringEdit, difference from TLabel: has a frame around it.
 +
-Main properties:
 +
Value: read/write the text that are showed.
 +
Caption: A label normally describing the purpose or meaning of the presented text, it can be positioned around the frame.
  
  |--Single__widget???| => the layouter gets narrower
+
=== TByteStringDisp ===
 
+
=== TIntegerDisp ===
  |--Single_______widget?????| => the layouter gets wider
+
=== TRealDisp ===
 
+
=== TDateTimeDisp ===
* also, if {lao_scaleleft in optionslayout} then left margins of the widgets  
+
=== TBooleanDisp ===
  with unset "optionsskin.osk_nopropleft" resize too otherwise retain
+
=== TToolBar ===
 +
=== TDrawGrid ===
 +
=== TStringGrid ===
 +
=== TTabBar ===
 +
=== TTabPage ===
 +
=== TTabWidget ===
 +
=== TDockHandle ===
 +
=== TDockPanel ===
 +
=== TSpliter ===
 +
<pre>
 +
      A widget very similar to "tspacer" but :
 +
- designed to rearrange areas occupied by adjacent widgets
 +
- a linked widget may only enlarge by "eating" the opposite one,
 +
so the summary area of both widgets don't change
 +
- has GUI look ( hatched grip, color etc) switched on by default
 +
- facilitates run-time repositioning oneself and linked widgets
 +
- linked widgets may even be other splitters, spacers (with their linked widgets ),..
 +
 +
        Properties:
  
= if lao_scaleheight in optionslayout :
+
- color
* widgets with "osk_nopropheight" unset in their "optionsskin" enters in the mode
+
= see {any_widget.color}
  ( not applied until the layouter resizes! ) when they are v-scaled in the proportion
 
    as far as clientheight of the tlayouter changes, then stages 2 & 3 are reapplied
 
  
* also, if {lao_scaletop in optionslayout} then top margins of the widgets
+
- cursor
  with unset "optionsskin.osk_noproptop" resize too otherwise retain
+
= see {any_widget.cursor}
  
*** only widget sizes & margins not distances between them are affected ***
+
- enabled
 +
= "false" stops user interaction
  
</pre>
+
- face
 +
= see {any_face}
  
==== Stage 2 ====
+
- frame
 +
= see {any_frame}
  
Widgets may be auto resized in 5 consequent steps using the following options:
+
- colorgrip
 +
= color of grip hatching
 +
 
 +
- grip
 +
= defines hatching pattern of the grip
  
<pre>
+
* stb_dens(N) : the pattern is of rhombuses, the painted rhombs occupy "N" persents of the grip
  
1. if plo_syncmaxautosize in place_options :
+
* stb_block(N) : the pattern is of squares, painted & unpainted squares are equally sized and  
  = all widgets are autosized then their client areas are synchronised to the
+
both have "N" pixels sides
    clientareas of the highest and the widest of the widget
+
  * calls "msegui.syncmaxautosize"
+
* stb_hatchup(N) : the pattern is of right-tilted lines of 1 pixel width,
 +
each "N"-th pixel forms these lines
  
2. if plo_syncpaintwidth in place_options :
+
* stb_hatchdown(N) : the pattern is of left-tilted lines of 1 pixel width,
  = the paintwidths of all widgets are synchronized to the widget with the
+
each "N"-th pixel forms these lines
    widest outer frame width ( ex. width of "frame.caption" )
 
  * mainly makes sense if "lao_alignx" set and {align_glue = wam_start or wam_end}
 
    ( see below ) when the widgets will be adjusted in order to fit into the
 
    inner client width of tlayouter:
 
  
                                  x-align level         
+
* stb_crosshatch(N) : the pattern is of crossing (left & right) tilted lines of 1 pixel width,
                                        V               
+
each "N"-th pixel forms these lines
                        +----------------------------------+
 
                        | Widget_1 the_widest_frame_caption|
 
                        | Widget_2 frame_caption2          |
 
                        | Widget_N wider_frame_captionN    |
 
                        +----------------------------------+
 
  
  here, the effect is shown for "cp_right" frame captions
 
    // otherwise syncronizes to the outer ( of the frame except its caption ) width
 
    // of the Z-top widget
 
  * calls "msegui.syncpaintwidth"
 
  * paintwidth is the outer width
 
  
3. if plo_syncpaintheight in place_options :
+
- linkbottom/linkleft/linkright/linktop
  = the paintheights of all widgets are synchronized to the widget with the
+
= see {tspacer.*}
    highest outer frame width ( ex. width of "frame.caption" ).
 
  * mainly makes sense if lao_aligny set and {align_glue = wam_start or wam_end}
 
    ( see below ) the widgets will be adjusted in order to fit into the inner
 
    client height of tlayouter :
 
  
                        +------------------------------+
+
- options
                        | The_                        |
 
                        | tallest_            taller_  |
 
                        | frame_    frame_    frame_  |
 
                        | caption  caption2  captionN | 
 
                        |                              |
 
                        | Widget1  Widget_2  Widget_N |<== y-align level
 
                        +------------------------------+   
 
  
  here, the effect is shown for "cp_topleft" frame captions
+
= spo_hmove
    // otherwise syncronizes to the outer ( of the frame except its caption )
+
* "true" allows the spliter to move horizontally
    // height of the Z-top widget
 
  * calls "msegui.syncpaintheight"
 
 
4. plo_synccaptiondistx in place_options :
 
  = causes all widgets to have the widest common room for their cp_(left/right)* frame captions
 
  * calls "msegui.synccaptiondistx"
 
 
5. plo_synccaptiondisty in place_options :
 
  = causes all widgets to have the highest common room for their cp_(top/bottom)* frame captions
 
  * calls "msegui.synccaptiondisty"
 
</pre>
 
  
==== Stage 3 ====
+
= spo_hprop
 +
* "true" : keep the left position proportional ( on the ratio of creation time )
 +
to weigth of the client area of parent
 +
 
 +
= spo_hsizeprop
 +
* "true" : keep width of the spacer proportional ( on the ratio of creation time )
 +
to weigth of the client area of parent
 +
* the width stops shrinking on one set in design time
  
The widgets may be (re)arranged within the layouter.
+
= spo_vmove
 +
* "true" allows the spliter to move vertically
  
<pre>
+
= spo_vprop
There're 2 modes of such (re)arrangement which can be partially (orthogonally)
+
* "true" : keep the top position proportional ( on the ratio of creation time )  
combined (see later):
+
to height of the client area of parent
  
1) The place(ment) mode ( lao_place* in optionslayout ) :
+
= spo_vsizeprop
 +
* "true" : keep height of the spacer proportional ( on the ratio of creation time )  
 +
to height of the client area of parent
 +
* the height stops shrinking on one set in design time
  
- widgets are placed at some distances between each other, possibly with some
+
= spo_dockleft
  margins, rooms of invisible widgets ( having visible=false) are also allocated
+
* causes the "linkleft" widget to dock to the left border of splitter
  unless "plo_noinvisible in place_options"
+
* make sence only if linkleft "widget.bounds_x" less than "splitter.bounds_x"
  
  * the widgets are placed in the order of decreasing their "widgetrect.x"
+
= spo_docktop
coordinates before alignment
+
* causes the "linktop" widget to dock to the top border of splitter
 
+
* make sence only if linktop "widget.bounds_y" less than "splitter.bounds_y"
  * the inter-widget distances and the side margins ( if apllied ) in both
+
 
dimentions are identical and limited between "place_mindist" and
+
= spo_dockright
"place_maxdist"
+
* causes the "linkright" widget to dock to the right border of splitter
 
+
* make sence only if linkright "widget.(bounds_x+bounds_cx)" more than "splitter.(bounds_x+bounds_cx)"
  = if {lao_placex in optionslayout} and {place_mode <> wam_none} then the
+
 
following relevant settings apply:
+
= spo_dockbottom
 
+
* causes the "linkbottom" widget to dock to the bottom border of splitter
* non-limiting value of "place_maxdist" :
+
* make sence only if linkbottom "widget.(bounds_y+bounds_cy)" more than "splitter.(bounds_y+bounds_cy)"
+
 
# |Widget_1------Widget_2------Widget_3|
+
!!! Two special cases :
+
 
* non-limiting value of "place_maxdist" and {plo_propmargin in place_options} :
+
1. (spo_dockleft = spo_dockright = TRUE) && (linkleft = linkright = the_same_widget) :
+
causes the "linkleft" widget to adjust to h-positiion & width of the splitter,
# |---Widget_1---Widget_2---Widget_3---|
+
it's even possible that the widget doesn't touch the splitter
+
 
* limiting value of "place_maxdist" and {place_mode = wam_start} :
+
(spo_docktop = spo_dockbottom = TRUE) && (linktop = linkbottom = the_same_widget) :  
+
causes the "linktop" widget to adjust to v-position & height of the splitter,
# |Widget_1----Widget_2----Widget_3????|
+
 
+
It's even possible in these cases that the widget doesn't touch the splitter
* limiting value of "place_maxdist" and {place_mode = wam_start} and
+
 
  {plo_propmargin in place_options} :
+
- optionsscale
+
= see {tscalingwidget.optionsscale}
# |---Widget_1---Widget_2---Widget_3???|
+
 
 +
- optionswidget
 +
= see {anywidget.optionswidget}
 +
 
 +
- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus,
 +
  onfontheightdelta, onmove, onpopup, onresize, onshowhint
 +
= see "tspacer"
 +
 
 +
- onupdatelayout
 +
fires :
 
 
* limiting value of "place_maxdist" and {place_mode = wam_end} :
+
= on creating the splitter
+
= on any reposition of the linked widgets  
# |??????Widget_1---Widget_2---Widget_3|
+
( due to moving the splitter, resizing the parent,.. )
+
</pre>
* limiting value of "place_maxdist" and {place_mode = wam_end} and
+
 
  {plo_propmargin in place_options} :
+
=== TSpacer ===
+
* a regular widget which creates a kind of positional link between surrounding widgets
# |???Widget_1---Widget_2---Widget_3---|
+
* designed to maintain distances between widgets
+
* may have GUI look, caption etc switched off by default
* limiting value of "place_maxdist" and {place_mode = wam_center} :
+
* resizing a spacer repositions its linked widgets
 
# |???Widget_1---Widget_2---Widget_3???|
 
 
* limiting value of "place_maxdist" and {plo_endmargin in place_options} :
 
 
# |Widget_1----Widget_2----Widget_____3|, or
 
 
# |Widget_1----Widget_____2----Widget_3|, or
 
 
# |Widget_____1----Widget_2----Widget_3|, here, the most left amongst
 
widgets having both [an_left,an_right] set is expanded otherwise the most
 
right widget ( Widget_3 in the example )
 
 
* limiting value of "place_maxdist" and {place_mode = wam_end} and
 
  {plo_propmargin in place_options} and {plo_endmargin in place_options} :
 
 
 
# |--Widget_1--Widget_____2--Widget_3--|,
 
 
 
The Legend:
 
===========
 
limiting value of "place_maxdist" : such value which produce some visual
 
effect on the layouter
 
 
  "----" :          distance ( = number of minuses, limited by place_maxdis )
 
  "????" :          some remaining space ( = number of questmarks )
 
  "Widget_1" :      widget of the original size
 
  "Widget__..__1" : (auto)resized widget
 
 
 
  = if {lao_placey in optionslayout} and {place_mode <> wam_none} then the things
 
are handled in the same manner as with "lao_placex" but for the vertical
 
"top2bottom" direction of placement instead of the horizontal "left2right" one.
 
  
2) the align(ment) mode ( optionslayout.lao_align* ) :
+
Properties:
  
- widgets are gathered into a visual group to a dedicated "leader" widget of
+
- anchors
  the layout ( set by "align_leader" and defaults to the lowest in
+
= see {any_widget.anchors}
  Z-Order = twidget.widgets[0] ) the leader stays in place while the others :
+
 
 +
- bounds
 +
= see {any_widget.bounds}
  
  = if lao_alignx in optionslayout ( the hor alignment mode ):
+
- color
  * if align_mode = wam_start :
+
= see {any_widget.color}
snap their left borders to the left border of leader
 
  * else if align_mode = wam_end :
 
snap their right borders to the right border of leader
 
  * else if align_mode = wam_center :
 
snap their v-axes to the v-axis of leader after that,
 
  = if lao_aligny in optionslayout ( the vert alignment mode ):
 
  * if align_mode = wam_start :
 
snap their top borders to the top border of leader
 
  * else if align_mode = wam_end :
 
snap their bottom borders to the bottom border of leader
 
  * else if align_mode = wam_center :
 
snap their h-axes to the h-axis of leader
 
  
- after that, the whole widget group can be aligned within the layouter:
+
- enabled
 +
= "false" turns color of the caption to gray
  
  = if align_glue =  wam_start
+
- visible
  * if lao_alignx in optionslayout:
+
= "true" allows displayable settings (caption text, face, frame etc) to take
the left extent of group snaps to the left border of layouter
+
effect in run-time as well
  * if lao_aligny in optionslayout:
+
the top extent of group snaps to the top border of layouter
+
- <face>
  = else if align_glue = wam_end
+
= see {any face}
  * if lao_alignx in optionslayout:
 
the right extent of group snaps to the right border of layouter
 
  * if lao_aligny in optionslayout:
 
the bottom extent of group snaps to the bottom border of layouter
 
  = else if align_glue =  wam_center
 
  * if lao_alignx in optionslayout:
 
the v-axis of group snaps to the v-axis of layouter
 
  * if lao_aligny in optionslayout:
 
the h-axis of group snaps to the h-axis of layouter
 
  
Mutually exclusive settings:
+
- <frame>
* only one of "align_mode" can be choosen
+
= see {any frame}
* only one of  "glue_mode" can be choosen
 
* "optionslayout.lao_alignx" & "optionslayout.lao_placex"
 
* "optionslayout.lao_aligny" & "optionslayout.lao_placey"
 
  
V-alignment ( optionslayout.lao_aligny ) may be combined with h-placement
+
- linkbottom
( optionslayout.lao_placex ), and h-alignment ( optionslayout.lao_alignx ) may
+
= widget linked down to most outer edge (incl. frame[.caption]) of the spacer
be combined with v-placement ( optionslayout.lao_placey )
+
- linkleft
 +
= widget linked left to most outer edge of the spacer
 +
- linkright
 +
= widget linked right to most outer edge of the spacer
 +
- linktop
 +
= widget linked up to most outer edge of the spacer
  
NOTE:
+
- dist_bottom, dist_left, dist_right, dist_top :
  The effects of the above described { resizing / placement / alignment } are
+
= margins between most outer edge the spacer
  irreversible. So, the only way to revert is to set "wan_none" then to revert
+
and the corresponding linked widget
  manually.
 
</pre>
 
  
=== TListView ===
+
- options :
=== TImage ===
 
<pre>
 
<any image>
 
  
*** Note that switch to the monochrome mode is irerreversible ! ***
+
= spao_glueright
  
alignment:
+
  - if "false"
  
By default, images are top-left aligned, with the original size preserved.
+
h-repositioning or h-resizing the linkleft widget shifts
 +
the whole linked construction, it becomes the only way to h-shift
  
al_xcentered = centers the image horizontally
+
if {an_right IN linkright_widget.anchors} then the spacer
al_ycentered = centers the image vertically
+
may be right-resized with auto h-resizing the linkright widget
 +
so that the right margin of that widget is kept
  
al_right = docks the image to the right border of placeholder
+
if NOT {an_right IN linkright_widget.anchors} then the spacer
al_bottom = docks the image to the bottom border of placeholder
+
may be right-resized with auto h-shifting the linkright widget
 +
so that width of that widget is kept
  
al_grayed = fills non-transparent areas with the selected color
+
- if "true"
  
al_stretchx = adjusts size so that to fill the placeholder in width
+
h-repositioning or h-resizing the linkright widget shifts
al_stretchy = adjusts size so that to fill the placeholder in height
+
the whole linked construction, it becomes the only way to h-shift
al_fit = adjusts size so that to fill the placeholder in both width & height
 
  
al_tiled = spawns the image & tile the whole  placeholder with the copies
+
if {an_left IN linkleft_widget.anchors} then the spacer
 +
may be h-resized with auto h-resizing the linkleft widget
 +
so that the left margin of that widget is kept
  
Interpolation mode while stretching
+
if NOT {an_left IN linkleft_widget.anchors} then the spacer
 +
may be h-resized with auto h-shifting the linkleft widget
 +
so that width of that widget is kept
  
al_intpol = antialiases as far as the size changes
+
= spao_gluebottom
(the only working in Linux)
 
al_or = interpolation pixel operation is "or" -> 1's are extended
 
al_and = interpolation pixel operation is "and" -> 0's are extended
 
( al_or and al_and only on win32, mainly useful for stretching of monochrome bitmaps) :
 
  
colorbackground = color of image transparent ( masked ) areas in monochrome
+
- if "false"
non-masked mode
 
colorforeground = color of non-transparent areas in monochrome mode 
 
  
options:
+
v-repositioning or v-resizing the linktop widget shifts
 +
the whole linked construction, it becomes the only way to v-shift
  
bmo_monochrome = fills non-transparent areas with "colorforeground",
+
if {an_bottom IN linkbottom_widget.anchors} then the spacer
also, in non-masked mode, fills transparent areas
+
may be v-resized with auto v-resizing the linkbottom widget
with "colorbackground"
+
so that the bottom margin of that widget is kept
  
bmo_masked = activates built-in image transparency {it "hides" transparent (masked) areas}
+
if NOT {an_bottom IN linkbottom_widget.anchors} then the spacer
bmo_colormask = applies faded edge transparency on the color masked areas in the image
+
may be v-resized with auto v-shifting the linkbottom widget
 +
so that height of that widget is kept
  
transparency = makes the image transparent as long as enlights areas behind
+
-  if "true"
the image with the selected color
 
  
transparentcolor = for a non-masked image, assigns a color indicate transparency areas
+
        v-repositioning or v-resizing the linkbottom widget shifts
( on matching areas, the image will be seen through )
+
the whole linked construction, it becomes the only way to v-shift
<pre/>
 
  
=== TDial ===
+
if {an_top IN linktop_widget.anchors} then the spacer
=== TChart ===
+
may be v-resized with auto v-resizing the linktop widget
=== TChartRecorder ===
+
so that the top margin of that widget is kept
=== TPolygon ===
+
 
=== TPickWidget ===
+
if NOT {an_top IN linktop_widget.anchors} then the spacer
=== TOpenglWidget ===
+
may be v-resized with auto v-shifting the linktop widget
 +
so that height of that widget is kept
 +
 
 +
- optionsscale
 +
= see {tscalingwidget.optionsscale}
 +
 
 +
- optionswidget
 +
= see {anywidget.optionswidget}
 +
 
 +
- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus,
 +
  onfontheightdelta, onpopup, onresize, onshowhint
 +
= see {any_widget.*}
 +
 
 +
- onmove
 +
= see {any_window.OnMove}
 +
 
 +
any "link*" option set disables the spacer to reposition solely,
 +
repositioning is only controlled by a "glued" widget since then
 +
 
 +
=== TLayouter ===
 +
* a tspacer descendant designed to (auto)resize or/and move its contained widgets acc to some size/positon dependencies
 +
* may have GUI look, frame caption etc switched off by default
 +
* layouters may be nested to achieve complex layouts
 +
 
 +
Each layout change/assignment is divided into performing 3 consequent stages :
 +
 
 +
==== Stage 1 ====  
 +
 
 +
Widgets auto resized using the following options:
  
== TWidget stuff ==
 
 
<pre>
 
<pre>
  Properties:  
+
- if {lao_placex OR lao_placey} :
- name
+
 
- anchors
+
= if {plo_scalesize in optionslayout}  then
- bounds
+
* widgets with "osk_nopropwith" unset in their "optionsskin" are h-scaled
- color
+
    in the proportion of change of tlayouter's clientwidth
- enabled
+
* widgets with "osk_nopropheight" unset in their "optionsskin" are v-scaled
- visible
+
    in the proportion  of change of tlayouter's clientheight
- <face> : see {any face}
+
 
- <frame> : see {any frame}
+
For h-resized layouter, the effect looks like :
    - hint
+
 
    - helpcontext
+
|--Widget__1---Widget__2--| => the initial look
    - tag
+
 
    - taborder
+
  |--Widget_1--Widget_2--| => the layouter gets narrower
    - cursor
+
 
    - optionswidget
+
  |---Widget___1---Widget___2---| => the layouter gets wider
    - optionsskin
+
 
    - popupmenu
+
*** both widget sizes & margins are affected ***
   
+
*** Widget_N may generally situate on different y-levels ***
twidget's event handlers:
+
 
   
+
otherwise :
- on(de)activate
 
- onbeforeupdateskin
 
- onafterupdateskin
 
- onchildscaled
 
- onfontheightdelta
 
- on(de)focus
 
- onenter
 
- onmove
 
- onpopup
 
- onresize
 
- onshowhint
 
     
 
align_glue :  
 
  ( outer anchoring mode for widget group, in the align mode )
 
- wam_none
 
- wam_start
 
- wan_center
 
- wm_end
 
  
align_leader :  
+
= if lao_scalewidth in optionslayout :
the widget ( incl another spacer, splitter or layouter ) against which the aligment applies ( the reference widget )
+
* widgets with "osk_nopropwith" unset in their "optionsskin" enters in the mode
 +
  ( not applied until the layouter resizes! ) when they are h-scaled in the proportion
 +
  as far as clientwidth of the tlayouter changes, then stages 2 & 3 are reapplied
  
align_mode :
+
For h-resized layouter, the effect looks like :
  ( inner anchoring mode within widget group, in the align mode )
 
- wam_none
 
- wam_start
 
- wan_center
 
- wm_end
 
  
// Place mode:
+
  |--Single____widget????| => the initial look
  
     
+
  |--Single__widget???| => the layouter gets narrower
place_mindist, place_maxdist:
 
- in the place(ment) mode, limits distance between widgets
 
  ( these distance once calclated also define side margins if aplicable )
 
  
place_mode:
+
  |--Single_______widget?????| => the layouter gets wider
  ( outer anchoring mode for widget group, in the place mode )
 
- wam_none
 
- wam_start
 
- wan_center
 
- wm_end
 
  
place_options:
+
* also, if {lao_scaleleft in optionslayout} then left margins of the widgets
- plo_endmargin
+
  with unset "optionsskin.osk_nopropleft" resize too otherwise retain
= to resize a widget so that it "eats" extra space if it occurs
 
 
* only applicable in the place mode, with a limiting value of "place_maxdist" and:
 
  
  1) {place_mode <> wam_none}
+
= if lao_scaleheight in optionslayout :
or
+
* widgets with "osk_nopropheight" unset in their "optionsskin" enters in the mode
  2) {place_mode = wam_end} and {plo_propmargin in place_options}
+
  ( not applied until the layouter resizes! ) when they are v-scaled in the proportion
 +
    as far as clientheight of the tlayouter changes, then stages 2 & 3 are reapplied
  
For the exact look, see above
+
* also, if {lao_scaletop in optionslayout} then top margins of the widgets
 +
  with unset "optionsskin.osk_noproptop" resize too otherwise retain
  
 +
*** only widget sizes & margins not distances between them are affected ***
  
- plo_propmargin
+
</pre>
= виджеты расставляются теснее так, чтобы образовались отступы перед и после,
 
  причем расстояние между центрами виджетов было бы таким же,
 
  как и растояние между серединами крайних виджетов и соотв. границами зоны расстановки
 
  
- plo_syncmaxautosize
+
==== Stage 2 ====
= see above
 
  
- plo_synccaptiondistx
+
Widgets may be auto resized in 5 consequent steps using the following options:
= see above
 
  
  * affects widgets with opposite cp_left/right set as well
+
<pre>
  * the minimal before-adjustment "captiondist" amongst all widgets limits "captiondist" for each of the widget
 
              * don't set cfo_captiondistouter here !
 
  
- plo_synccaptiondisty
+
1. if plo_syncmaxautosize in place_options :
= see above
+
  = all widgets are autosized then their client areas are synchronised to the
 +
    clientareas of the highest and the widest of the widget
 +
  * calls "msegui.syncmaxautosize"
  
  * affects also widgets with opposite cp_top/bottom set
+
2. if plo_syncpaintwidth in place_options :
  * the minimal before-adjustment "captiondist" amongst all widgets limits "captiondist" for each of the widget
+
  = the paintwidths of all widgets are synchronized to the widget with the
 +
    widest outer frame width ( ex. width of "frame.caption" )
 +
  * mainly makes sense if "lao_alignx" set and {align_glue = wam_start or wam_end}
 +
    ( see below ) when the widgets will be adjusted in order to fit into the
 +
    inner client width of tlayouter:
  
              ! here, don't set "cfo_captiondistouter" for affected widgets !
+
                                  x-align level         
 +
                                        V               
 +
                        +----------------------------------+
 +
                        | Widget_1 the_widest_frame_caption|
 +
                        | Widget_2 frame_caption2          |
 +
                        | Widget_N wider_frame_captionN    |
 +
                        +----------------------------------+
  
- plo_syncpaintwidth
+
  here, the effect is shown for "cp_right" frame captions
= see above
+
    // otherwise syncronizes to the outer ( of the frame except its caption ) width
 
+
    // of the Z-top widget
- plo_syncpaintheight
+
  * calls "msegui.syncpaintwidth"
= see above
+
  * paintwidth is the outer width
  
- plo_scalesize
+
3. if plo_syncpaintheight in place_options :
= see above
+
  = the paintheights of all widgets are synchronized to the widget with the
 +
    highest outer frame width ( ex. width of "frame.caption" ).
 +
  * mainly makes sense if lao_aligny set and {align_glue = wam_start or wam_end}
 +
    ( see below ) the widgets will be adjusted in order to fit into the inner
 +
    client height of tlayouter :
  
 +
                        +------------------------------+
 +
                        | The_                        |
 +
                        | tallest_            taller_  |
 +
                        | frame_    frame_    frame_  |
 +
                        | caption  caption2  captionN | 
 +
                        |                              |
 +
                        | Widget1  Widget_2  Widget_N |<== y-align level
 +
                        +------------------------------+   
  
dist_left, dist_right, dist_top, dist_bottom :  
+
  here, the effect is shown for "cp_topleft" frame captions
= margins between most outer edge the layouter and
+
    // otherwise syncronizes to the outer ( of the frame except its caption )
  the corresponding linked widget
+
    // height of the Z-top widget
 +
  * calls "msegui.syncpaintheight"
 +
 +
4. plo_synccaptiondistx in place_options :
 +
  = causes all widgets to have the widest common room for their cp_(left/right)* frame captions
 +
  * calls "msegui.synccaptiondistx"
 +
 +
5. plo_synccaptiondisty in place_options :
 +
  = causes all widgets to have the highest common room for their cp_(top/bottom)* frame captions
 +
  * calls "msegui.synccaptiondisty"
 +
</pre>
  
* see "tspacer" for detail
+
==== Stage 3 ====
  
linkleft,linkright,linktop,linkbottom : see "tspacer"
+
The widgets may be (re)arranged within the layouter.
  
options:
+
<pre>
- spao_glueright, spao_gluebottom:  
+
There're 2 modes of such (re)arrangement which can be partially (orthogonally)
= set the adjustment dependencies between the layouter an its link_* widgets
+
combined (see later):
  
* see "tspacer" for more details
+
1) The place(ment) mode ( lao_place* in optionslayout ) :
  
// which mode of widget placement to apply - see above
+
- widgets are placed at some distances between each other, possibly with some
optionslayout:
+
  margins, rooms of invisible widgets ( having visible=false) are also allocated
- lao_alignx
+
  unless "plo_noinvisible in place_options"
- lao_aligny
 
- lao_placex
 
- lao_placey
 
- lao_scalewidth
 
- lao_scaleheight
 
- lao_scaleleft
 
- lao_scaletop
 
 
* lao_place* & lao_align* can't be combined for one direction
 
  
optionsscale:
+
  * the widgets are placed in the order of decreasing their "widgetrect.x"
 
+
coordinates before alignment
  * cause the layouter to provide full space for the widgets as long as they expand/shrink/move
+
 
 
+
  * the inter-widget distances and the side margins ( if apllied ) in both
- osc_expandx
+
dimentions are identical and limited between "place_mindist" and
= allocates more h-space if needed
+
"place_maxdist"
 
+
 
- osc_shrinkx
+
  = if {lao_placex in optionslayout} and {place_mode <> wam_none} then the
= removes extra h-space if occured
+
following relevant settings apply:
 
+
 
- osc_expandy
+
* non-limiting value of "place_maxdist" :
= allocates more v-space if needed
+
 
+
# |Widget_1------Widget_2------Widget_3|
- osc_shrinky
+
= removes extra v-space if occured
+
* non-limiting value of "place_maxdist" and {plo_propmargin in place_options} :
 
+
- osc_invisishrinkx
+
# |---Widget_1---Widget_2---Widget_3---|
= fully h-collapses the layouter if "visible=false" ( run-time only )
 
 
 
- osc_invisishrinky
 
= fully v-collapses the layoter if "visible=false" ( run-time only )
 
 
 
optionsskin:
 
= see <any widget>
 
 
 
 
 
Methods:
 
 
 
constructor create(aowner: tcomponent); override;
 
 
 
== Public stuff ==
 
<pre/> (f)window:
 
the OS-allocated ( root = toplevel ) window common for all widgets of this window
 
 
 
* "widget.fwindow.fowner = widget.self" in case of the widget present the root "fwindow"  
+
* limiting value of "place_maxdist" and {place_mode = wam_start} :
  ( owns the window )
+
 
+
# |Widget_1----Widget_2----Widget_3????|
(f)rootpos:  
+
position of the widget in the coord of toplevel window not the nearest parent widget alone,
+
* limiting value of "place_maxdist" and {place_mode = wam_start} and
calculated as sum of such positions ( fwidgetrect.pos ) starting from the toplevel through the chain of all parents
+
  {plo_propmargin in place_options} :
up to the current widget;
+
"nullpoint" (0,0) for toplevel widgets ( window-owning forms,..)
+
# |---Widget_1---Widget_2---Widget_3???|
 
+
screenpos:
+
* limiting value of "place_maxdist" and {place_mode = wam_end} :
- coord aginst the top-left corner of screen
+
- WM decoration & title aren't parts of the widget !
+
# |??????Widget_1---Widget_2---Widget_3|
 
+
widgetrect:  
+
* limiting value of "place_maxdist" and {place_mode = wam_end} and
the widget on-screen area including its frame & frame caption
+
  {plo_propmargin in place_options} :
 
+
paintrect:  
+
# |???Widget_1---Widget_2---Widget_3---|
the widget on-screen area except its frame & frame caption
+
 
+
* limiting value of "place_maxdist" and {place_mode = wam_center} :
clientrect:
+
virtual area which
+
# |???Widget_1---Widget_2---Widget_3???|
- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
+
- for scrolling widgets, may be bigger than "paintrect",
+
* limiting value of "place_maxdist" and {plo_endmargin in place_options} :
  also may shift ( change its "pos" ) when scrolling
+
 +
# |Widget_1----Widget_2----Widget_____3|, or
 +
 +
# |Widget_1----Widget_____2----Widget_3|, or
 +
 +
# |Widget_____1----Widget_2----Widget_3|, here, the most left amongst
 +
widgets having both [an_left,an_right] set is expanded otherwise the most
 +
right widget ( Widget_3 in the example )
 +
 +
* limiting value of "place_maxdist" and {place_mode = wam_end} and
 +
  {plo_propmargin in place_options} and {plo_endmargin in place_options} :
 +
 
 +
# |--Widget_1--Widget_____2--Widget_3--|,
 +
 
 +
The Legend:
 +
===========
 +
limiting value of "place_maxdist" : such value which produce some visual
 +
effect on the layouter
 +
 +
  "----" :          distance ( = number of minuses, limited by place_maxdis )
 +
  "????" :          some remaining space ( = number of questmarks )
 +
  "Widget_1" :      widget of the original size
 +
  "Widget__..__1" : (auto)resized widget
 +
 
 +
  = if {lao_placey in optionslayout} and {place_mode <> wam_none} then the things
 +
are handled in the same manner as with "lao_placex" but for the vertical
 +
"top2bottom" direction of placement instead of the horizontal "left2right" one.
  
* "t*grid" aren't such scrollable widgets since their virtual height would be limited by
+
2) the align(ment) mode ( optionslayout.lao_align* ) :
  the X11 "+-32000" limitation,
 
  so example of such widgets are tscrollbox, "tform.container" etc
 
  
framerect:
+
- widgets are gathered into a visual group to a dedicated "leader" widget of
the widget on-screen area except its frame caption but including inner & outer frame
+
  the layout ( set by "align_leader" and defaults to the lowest in
 +
  Z-Order = twidget.widgets[0] ) the leader stays in place while the others :
  
****************
+
  = if lao_alignx in optionslayout ( the hor alignment mode ):
 +
  * if align_mode = wam_start :
 +
snap their left borders to the left border of leader
 +
  * else if align_mode = wam_end :
 +
snap their right borders to the right border of leader
 +
  * else if align_mode = wam_center :
 +
snap their v-axes to the v-axis of leader after that,
 +
  = if lao_aligny in optionslayout ( the vert alignment mode ):
 +
  * if align_mode = wam_start :
 +
snap their top borders to the top border of leader
 +
  * else if align_mode = wam_end :
 +
snap their bottom borders to the bottom border of leader
 +
  * else if align_mode = wam_center :
 +
snap their h-axes to the h-axis of leader
  
// releases all thread locks then post the event to the app event queue and
+
- after that, the whole widget group can be aligned within the layouter:
// waits for the event handler finishes ( signalled by "sye_ok on a semaphore )
 
// finally restores the locks
 
    // true if the handler is not aborted
 
function synchronizeevent(const aevent: tsynchronizeevent): boolean;
 
  
    // translates "point" coord against "source" widgetrect to "dest" widgetrect
+
  = if align_glue =  wam_start
//
+
  * if lao_alignx in optionslayout:
//   * nil "source" = from screen coord
+
the left extent of group snaps to the left border of layouter
//  * nil "dest" = to screen coord
+
  * if lao_aligny in optionslayout:
procedure translatewidgetpoint1(var point: pointty; const source,dest: twidget);
+
the top extent of group snaps to the top border of layouter
 +
   = else if align_glue = wam_end
 +
  * if lao_alignx in optionslayout:
 +
the right extent of group snaps to the right border of layouter
 +
  * if lao_aligny in optionslayout:
 +
the bottom extent of group snaps to the bottom border of layouter
 +
  = else if align_glue = wam_center
 +
  * if lao_alignx in optionslayout:
 +
the v-axis of group snaps to the v-axis of layouter
 +
  * if lao_aligny in optionslayout:
 +
the h-axis of group snaps to the h-axis of layouter
  
// the function-framed version of "translatewidgetpoint1"
+
Mutually exclusive settings:
function translatewidgetpoint(const point: pointty; const source,dest: twidget): pointty;
+
* only one of "align_mode" can be choosen
 +
* only one of  "glue_mode" can be choosen
 +
* "optionslayout.lao_alignx" & "optionslayout.lao_placex"
 +
* "optionslayout.lao_aligny" & "optionslayout.lao_placey"
  
// rect isntead of point,
+
V-alignment ( optionslayout.lao_aligny ) may be combined with h-placement
// if dest = nil then to screen
+
( optionslayout.lao_placex ), and h-alignment ( optionslayout.lao_alignx ) may
    // if source = nil then against screen
+
be combined with v-placement ( optionslayout.lao_placey )
function translatewidgetrect(const rect: rectty; const source,dest: twidget): rectty;
 
//-----------------
 
    // translates "point" coord against "source" paintrect to "dest" paintrect
 
//  * nil "source" = from screen coord
 
//  * nil "dest" = to screen coord
 
procedure translatepaintpoint1(var point: pointty; const source,dest: twidget);
 
  
// the function-framed version of "translatepaintpoint1"
+
NOTE:
function translatepaintpoint(const point: pointty; const source,dest: twidget): pointty;
+
  The effects of the above described { resizing / placement / alignment } are
 +
  irreversible. So, the only way to revert is to set "wan_none" then to revert
 +
  manually.
 +
</pre>
  
// rect isntead of point,
+
=== TListView ===
// if dest = nil then to screen
+
=== TImage ===
    // if source = nil then against screen
+
<pre>
function translatepaintrect(const rect: rectty;const source,dest: twidget): rectty;
+
<any image>
    //-----------------
 
    // translates "point" coord against "source" clientrect to "dest" clienttrect
 
//  * nil "source" = from screen coord
 
//  * nil "dest" = to screen coord
 
procedure translateclientpoint1(var point: pointty;
 
                    const source,dest: twidget);
 
  
// the function-framed version of "translateclientpoint1"
+
*** Note that switch to the monochrome mode is irerreversible ! ***
function translateclientpoint(const point: pointty; const source,dest: twidget): pointty;
 
  
// rect isntead of point,
+
alignment:
// if dest = nil then to screen
 
    // if source = nil then against screen
 
function translateclientrect(const rect: rectty; const source,dest: twidget): rectty;
 
    //-----------------
 
  
// (re)sorts "awidgets" in order of increasing their "widgetrect.x" coords
+
By default, images are top-left aligned, with the original size preserved.
//  - if parent = nil then the coords are against individual parent of each of "awidgets"
 
//  - if parent is supplied then the coords are against this parent
 
procedure sortwidgetsxorder(var awidgets: widgetarty; const parent: twidget = nil);
 
  
// (re)sorts "awidgets" in order of increasing their "widgetrect.y" coords
+
al_xcentered = centers the image horizontally
//  - if parent = nil then the coords are against individual parent of each of "awidgets"
+
al_ycentered = centers the image vertically
//  - if parent is supplied then the coords are against this parent
+
 
procedure sortwidgetsyorder(var awidgets: widgetarty; const parent: twidget = nil);
+
al_right = docks the image to the right border of placeholder
 +
al_bottom = docks the image to the bottom border of placeholder
  
// for each  of "widgets", calculates its autosized client area ( min size rect to fit the caption, etc )
+
al_grayed = fills non-transparent areas with the selected color
    //  - both hor & ver sizes of client area of each of "widgets" are adjusted to the max of the above calculated areas,
 
//   as the result - client areas of all widgets become identically v+h sized
 
    //
 
    //  * right & bottom anchored margins of each widget are preserved
 
procedure syncmaxautosize(const widgets: array of twidget);
 
  
// for each  of "widgets", width of client area of each of "widgets" is adjusted so that  
+
al_stretchx = adjusts size so that to fill the placeholder in width
    // external ( by the outer border of frame ) widths of all widgets become identical
+
al_stretchy = adjusts size so that to fill the placeholder in height
    // to the external widht of the widest widget
+
al_fit = adjusts size so that to fill the placeholder in both width & height
    //   
 
    //  * if "awidth" >= 0 then no determining the widest widget is taken and
 
    //    "awidth" is adjusted to instead, for all widgets
 
    //  * right anchored margins of each widget are lost
 
procedure syncminframewidth(const awidgets: array of twidget;
 
                              const awidth: integer = -1);
 
  
// for each  of "widgets", height of client area of each of "widgets" is adjusted so that
+
al_tiled = spawns the image & tile the whole  placeholder with the copies
    // external ( by the outer border of frame ) heights of all widgets become identical
 
    // to the external height of the highest widget
 
    //   
 
    //  * if "aheight" >= 0 then no determining the highest widget is taken and
 
    //    "aheight" is adjusted to instead, for all widgets
 
    //  * bottom anchored margins of each widget are lost
 
procedure syncminframeheight(const awidgets: array of twidget; const aheight: integer = -1);
 
<pre/>
 
  
== Edit ==
+
Interpolation mode while stretching
=== TStringEdit ===
 
=== TMemoEdit ===
 
=== THexStringEdit ===
 
=== TDropdownListEdit ===
 
A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
 
- deo_autodropdown dropdown on keypress
 
- deo_selectonly don't allow entering arbitrary text.
 
- deo_forceselect don't allow entering empty text.
 
  
=== THistoryEdit ===
+
al_intpol = antialiases as far as the size changes
A tstringedit which shows the previously entered values in a dropdownlist for selection.
+
(the only working in Linux)
 +
al_or = interpolation pixel operation is "or" -> 1's are extended
 +
al_and = interpolation pixel operation is "and" -> 0's are extended
 +
( al_or and al_and only on win32, mainly useful for stretching of monochrome bitmaps) :
  
=== TIntegerEdit ===
+
colorbackground = color of image transparent ( masked ) areas in monochrome
=== TKeyStringEdit ===
+
non-masked mode
  Maps string to string.
+
colorforeground = color of non-transparent areas in monochrome mode  
  
=== TEnumEdit ===
+
options:
Maps integer to string, zero based and sequencial (first item 0, next 1, ...).
 
  
=== TEnumTypeEdit ===
+
bmo_monochrome = fills non-transparent areas with "colorforeground",
A tenumedit which maps Pascal enums to their names. Use oninit to store the typeinfo pointer of the enum type into sender.typeinfopo.
+
also, in non-masked mode, fills transparent areas
 +
with "colorbackground"
  
=== TSelector ===
+
bmo_masked = activates built-in image transparency {it "hides" transparent (masked) areas}
TSelector  is the most specialized widget of the dropdown editwidget group, it is based on tenumedit (tenumedit maps an integer to a string) and uses for the dropdownlist a second map which must be created on the fly in ongetdropdowninfo. An example is tcommselector where the enumedit maps commnrty to commname and the dropdownlist shows the available RS232 ports
+
bmo_colormask = applies faded edge transparency on the color masked areas in the image
only.
 
  
=== TRealEdit ===
+
transparency = makes the image transparent as long as enlights areas behind
=== TRealSpinEdit ===
+
the image with the selected color
=== TDateTimeEdit ===
+
 
=== TCalendarDateTimeEdit ===
+
transparentcolor = for a non-masked image, assigns a color indicate transparency areas
=== TEdit ===
+
( on matching areas, the image will be seen through )
MSEgui counterpart of Delphi TEdit. You will never use it.
+
</pre>
 +
 
 +
=== TDial ===
 +
=== TChart ===
 +
 
 +
There are demos here:
 +
 
 +
https://github.com/mse-org/mseuniverse/tree/master/attic/msedocumenting/mse/trunk/help/tutorials/widgets/charts
 +
 
 +
=== TChartRecorder ===
 +
=== TPolygon ===
 +
=== TPickWidget ===
 +
=== TOpenglWidget ===
  
=== TWidgetGrid ===
+
== Edit ==
=== TItemEdit ===
+
=== TStringEdit ===
=== TDropDownItemEdit ===
+
=== TMemoEdit ===
 +
=== THexStringEdit ===
 +
=== TDropdownListEdit ===
 
  A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
 
  A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
 
  - deo_autodropdown dropdown on keypress
 
  - deo_autodropdown dropdown on keypress
Line 962: Line 983:
 
  - deo_forceselect don't allow entering empty text.
 
  - deo_forceselect don't allow entering empty text.
  
=== TMBDropDownItemEdit ===
+
=== THistoryEdit ===
=== TTreeItemEdit ===
+
  A tstringedit which shows the previously entered values in a dropdownlist for selection.
=== TRecordFieldEdit ===
 
  Used in twidgetgrid in order to edit fields of a ttreeitemedit. Example is MSEide projecttreeform.pas.
 
  
=== TDialogStringEdit ===
+
=== TIntegerEdit ===
A tstringedit with an ellipse button. Use "onexecute" to show the dialog.
+
=== TKeyStringEdit ===
 +
Maps string to string.
  
=== TPointerEdit ===
+
=== TEnumEdit ===
=== TSlider ===
+
Maps integer to string, zero based and sequencial (first item 0, next 1, ...).
=== TProgressBar ===
 
=== TBooleanEdit ===
 
=== TBooleanEditRadio ===
 
=== TDataButton ===
 
A button with an integer value. Clicking increments the value until "max", then it restarts with "min". Can be inserted into a twidgetgrid. The current value selects the showed image and face by the items of "imagenums" and "valuefaces".
 
  
=== TStockGlyphDataButton ===
+
=== TEnumTypeEdit ===
=== TDataIcon ===
 
Shows an imagelist item by lookup from "value" to "imagenums". Clicking increments value until "max" then it restarts with "min". Can be inserted into a twidgetgrid.
 
  
=== TTextEdit ===
+
A TEnumEdit which maps Pascal enums to their names. Use OnInit event to store the typeinfo pointer of the enum type into '''sender.typeinfopo'''.
Only useful if inserted into a twidgetgrid, builds a text editor, used in MSEide source editor.
 
  
=== TDataImage ===
+
<syntaxhighlight lang=pascal>
A pixmap display widget which can be inserted into twidgetgrid.
+
procedure tmainfo.enumtypeeditinit(const sender: tenumtypeedit);
 +
begin
 +
  sender.typeinfopo := PTypeInfo(TypeInfo(TMyEnumeratedType));
 +
end;
 +
</syntaxhighlight>
  
=== TTerminal ===
+
=== TSelector ===
Only useful if inserted into a twidgetgrid, builds a very simple terminal emulator. Used in MSEide target console.
+
TSelector  is the most specialized widget of the dropdown editwidget group, it is based on tenumedit (tenumedit maps an integer to a string) and uses for the dropdownlist a second map which must be created on the fly in ongetdropdowninfo. An example is tcommselector where the enumedit maps commnrty to commname and the dropdownlist shows the available RS232 ports
 +
only.
  
== Properties for all widgets ==
+
=== TRealEdit ===
<pre>
+
=== TRealSpinEdit ===
 +
=== TDateTimeEdit ===
 +
=== TCalendarDateTimeEdit ===
 +
=== TEdit ===
 +
MSEgui counterpart of Delphi TEdit. You will never use it.
  
name
+
=== TWidgetGrid ===
 
+
=== TItemEdit ===
anchors
+
=== TDropDownItemEdit ===
 +
A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
 +
- deo_autodropdown dropdown on keypress
 +
- deo_selectonly don't allow entering arbitrary text.
 +
- deo_forceselect don't allow entering empty text.
  
-----------
+
=== TMBDropDownItemEdit ===
 +
=== TTreeItemEdit ===
 +
=== TRecordFieldEdit ===
 +
Used in twidgetgrid in order to edit fields of a ttreeitemedit. Example is MSEide projecttreeform.pas.
  
- they control of design/runtime sticking widgets to their parents
+
=== TDialogStringEdit ===
 +
A tstringedit with an ellipse button. Use "onexecute" to show the dialog.
  
- dimention pair ( top/bottom or left/right ) both set to "false" cause
+
=== TPointerEdit ===
the widget to fit the parent's client area in that dimention;
+
=== TSlider ===
this effect may be partial in case of "bounds_c*max" settings limit the extents
+
=== TProgressBar ===
 +
=== TBooleanEdit ===
 +
=== TBooleanEditRadio ===
 +
=== TDataButton ===
 +
A button with an integer value. Clicking increments the value until "max", then it restarts with "min". Can be inserted into a twidgetgrid. The current value selects the showed image and face by the items of "imagenums" and "valuefaces".
  
*** Return to the look "before dimention fit" is only possible by manual resizing or setting "bounds_*"
+
=== TStockGlyphDataButton ===
-----------
+
=== TDataIcon ===
an_left
+
Shows an imagelist item by lookup from "value" to "imagenums". Clicking increments value until "max" then it restarts with "min". Can be inserted into a twidgetgrid.
- on run-time, resizes/shifts left the widget to keep the design-set distance
 
between the widget's left border and the left side of parent's client area
 
as the parent resizes, until scrolling begins
 
  
an_top
+
=== TTextEdit ===
- on run-time, resizes/shifts up the widget to keep the design-set distance
+
Only useful if inserted into a twidgetgrid, builds a text editor, used in MSEide source editor.
between the widget's top border and the upper side of parent's client area
 
as the parent resizes, until scrolling begins
 
  
an_right
+
=== TDataImage ===
- on run-time, resizes/shifts right the widget to keep the design-set distance
+
A pixmap display widget which can be inserted into twidgetgrid.
between the widget's right border and the right side of parent's client area
 
as the parent resizes, until scrolling begins
 
  
an_bottom
+
=== TTerminal ===
- on run-time, resizes/shifts down the widget to keep the design-set distance
+
Only useful if inserted into a twidgetgrid, builds a very simple terminal emulator. Used in MSEide target console.
between the widget's bottom border and the lower side of parent's client area
 
as the parent resizes, until scrolling begins
 
  
bounds
+
== NoGui ==
 +
=== TAction ===
 +
<pre>
 +
Shortcut processing order :
  
cx - width of the widget
+
- the smallest piece of processing is "doshortcut" procedure which
cxmax, cxmin - design/runtime width of the widget is enforced between "cxmax" and "cxmin"
+
is called until processed:
cy - height of the widget
+
= starting from the sender up to the toplevel widget
cymax, cymin - design/runtime height of the widget is enforced between "cymax" and "cymin"
+
= then by all child widgets with non-set "ow_noparentshortcut"  
x - distance between the widget's left border and the left side of parent's client area
+
= then, if "ow_nochildshortcut" isn't set, by the parent widget
y - distance between the widget's top border and the upper side of parent's client area
+
= then by the widget oneself
 
+
 
+
- "doshortcut" is checked in the following order:
autosize
+
= starting from form's main menu
 +
= then from the owning window ( the widget oneself )
 +
= then from the application
  
-----------
 
- only appliable to widgets with "ow_autosize" set
 
- the effect may be partial in case when "bounds_c*max" settings limit the extents
 
-----------
 
  
cx - addition to width of the widget (with h-centering post applied)
+
*** A shortcut is bound to a widget by :
cy - addition to height of the widget (with v-centering post applied)
+
- placing an action component on the widget ***
 +
- direct assigning the shortcut to the widget (menus,..)
 +
---------------------------
  
- color
+
caption, color, colorglyph, helpcontext, hint, imagecheckedoffset,
= the default color of client area & caption text background
+
imagelist <see "timagelist">, imagenr, imagenrdisabled
= may be overwtitten:
 
* the client area - with "frame.colorclient"
 
* the caption BG - with "frame.font.colorbackground"
 
  
- font
+
- sets look of "clients" (buttons, menu/toolbar items,..), unless
= see {any font}
+
these clients have "state.as_local*" set :
  
- frame
+
*** For meaning of these options, see help on the "client" widgets ***
= see {any frame}
 
  
- face
+
group
= see {any face}
+
- default value for one-named property of the bound widgets
 +
( menu items,... )
  
- hint
+
options :
= descriptive text appearing when mouse pointer enters the widget
+
ao_updateonidle
 +
- runs this action in cycle, waiting for no gui events everytime
  
- cursor
+
ao_globalshortcut
= shape of the mouse pointer over the client area of widget (run-time only)
+
- allows the action to trigger on a non-main form
 +
  (the shortcut is triggered whatever form of the applicatin it was pressed on,
 +
  otherwise only when the form where the aption is placed on is focused )
  
- visible
+
ao_nocandefocus
= "true" allow the widget to appear ( run-time only )
+
- causes the action not to call "CanDefocus" for focused edit widget of active form
 +
  before executing own code
 +
  ( it helps to avoid the effect of cancelling changes in these widgets
 +
  on activating the bound shortcut )
  
- enabled
+
shortcut
= "true" allows the widget to participate in GUI interaction
+
- keyboard combination triggering the action
= "false" disallows the widget & its childs :
 
* processing all events & shortcuts & menu calls
 
* auto "CanClose" check
 
  
Also "false" usually aints the widget in color marking
+
shortcut
the "disabled" state ( usually light gray font color )
+
- alternative "shortcut" and handled identically
  
- popupmenu
+
state :
= reference to a preset tpopupmenu widget serving the right-click menu
 
  
- taborder
+
as_disabled
- {0..N} order number when TAB-key cycling through widgets in the container
+
- prevents the action from triggering, also puts the bound widgets to "disabled" look
  
- tag
+
as_invisible
- an integer value bound to this widget instance
+
- in run-time, hides the bound widget, still reacting on the shortcut or direct call
  
- helpcontext
+
as_checked
= a string returned by "(active/mouse)helpcontext" methods of the owning form
+
- selects the bound menu item if it has "mao_checkbox" option set
  when this widget is focued or under mouse in the active window
 
  
- zorder
+
as_default
= reading: finds the current Z-order of the widget's window
+
as_local*
= setting: if the value = 0 then lowers the widget's window in the stacking hierarchy, otherwise rises
 
  
 +
statfile
 +
<see "tstatfile">
  
optionswidget:
+
stavarname
  
ow_background
+
- keeps the window/widget on bottom of the Z-order stack.
+
tagaction
 +
onasyncevent
 +
onchange
 +
onexecute
 +
onupdate
 +
</pre>
  
ow_top
+
=== TActivator ===
- keeps the window/widget in foreground
+
=== TCustomLookupbuffer ===
 +
<pre>
 +
- provides a group of parallel arrays of float(=datetime), integer and widestring types,
 +
and facilities to :
 +
= search in any array
 +
= on found position, quickly obtain corresponding value in another array
 +
- for each type, several arrays  may be kept
 +
- each array is integer-indexed, even string ones ( case[in]sensitive )
 +
- uses two way of accessing arrays data, through :
 +
= physic : array storage index ( row number ) directly
 +
= logical : the integer index ( see above ):
 +
first, physic row number is known for the logical index then the data
 +
are accessed with the found number
  
ow_noautosizing
+
*** logical index values are built automatically based on array values,
- when docking, not to resize for the docking area
+
on updating its data ***
 +
- dont' have interface to load data ( see its descendants for that )
 +
 +
fieldcountfloat - number of float arrays
 +
fieldcountinteger - number of integer arrays
 +
fieldcounttext - number of widestring arrays
  
ow_mousefocus
+
Event handlers:
- "false" here disables focusing the widget with mouse
+
- onchange
  ( and "OnFocus" doesn't fire on mouse clicks )
 
  
ow_tabfocus
+
Public interface:
- "false" here disables focusing the widget with "TAB" key
 
  ( and "OnFocus" doesn't fire on TAB pressed )
 
  
ow_parenttabfocus
+
  procedure beginupdate; - marks beginning of "update"
- enters the childs on TAB-focusing then returns to the widget after
+
  procedure endupdate; - if all "update" finished, fires "onchange" event
sequential TAB-ing through its child widgets,
+
procedure clearbuffer; - clears all arrays then fires "onchange"
otherwise TAB-ing cycles on the childs if entered
 
  
ow_arrowfocus
+
  procedure checkbuffer;
- allows the widget ( and its childs in turn ) to be focused with
+
  - [re]loads the arrays with most actual data
the arrow keys
+
  - just a stub here since doesn't have a data source
 +
 
 +
  function find(const fieldno: integer; const avalue: integer/realty/msestring;
 +
        out aindex: integer; const filter: lbfiltereventty = nil): boolean;
 +
- applies external filtering ("filter" procedure) then incrementally searches integer/realty(datetime) array "fieldno"
 +
for value "avalue" starting from logical index "aindex", returns "true" and the updated logical index
 +
if found else next bigger;
  
ow_subfocus, ow_arrowfocusin, ow_arrowfocusout
+
  function find(const fieldno: integer; const avalue: msestring;
- in case of arrow keys focusing enabled for child-containing widget,  
+
                out aindex: integer;
determine behaviour on entering & leaving the widget, see the below table:
+
                const caseinsensitive: boolean;
 +
                const filter: lbfiltereventty = nil): boolean; overload;
 +
- applies external filtering ("filter" procedure) then incrementally searches widestring array "fieldno" for value "avalue",  
 +
in "caseinsensitive" manner, starting from logical index "aindex", returns "true" and the updated logical index
 +
if found else next bigger;
  
ow_subfocus | ow_arrowfocusin | ow_arrowfocusout | effect
+
  function findphys(const fieldno: integer; const avalue: integer;
 +
        out aindex: integer; const filter: lbfiltereventty = nil): boolean; overload;
 +
- applies external filtering ("filter" procedure) then incrementally searches integer/realty(datetime) array "fieldno"
 +
for value "avalue" starting from row number "aindex", returns "true" and the updated row number
 +
if found else next bigger;
  
  FALSE          FALSE            FALSE        entering-/leaving-
+
function findphys(const fieldno: integer; const avalue: msestring;  out aindex: integer; const caseinsensitive: boolean;
  FALSE          FALSE            TRUE          entering-/leaving+
+
                const filter: lbfiltereventty = nil): boolean; overload;
  FALSE          TRUE              FALSE        entering(nearest)+/leaving-
+
- applies external filtering ("filter" procedure) then incrementally searches widestring array "fieldno" for value "avalue",
  FALSE          TRUE              TRUE          entering(nearest)+/leaving+
+
in "caseinsensitive" manner, starting from row number "aindex", returns "true" and the updated row number 
  TRUE            FALSE            FALSE        entering(last focused)+/leaving-
+
if found else next bigger;
  TRUE            FALSE            TRUE          entering(last focused)+/leaving+
 
  TRUE            TRUE              FALSE        entering(nearest)+/leaving-
 
  TRUE            TRUE              TRUE          entering(nearest)+/leaving+
 
  
- "entering" is focusing on a child within the widget
+
The external filtering ("filter") procedure takes the arguments of the caller
- "leaving"  is return from last child onto the widget's level
+
togehther with physical row number found in the caller which allows
- "nearest" is the child closest on the arrow direction
+
to check several values at once for that number, within the filter
- "last focused" is the child focused on last leaving the widget
+
+
function integervaluephys(const fieldno,aindex: integer): integer;
*** The Up/Down arrow keys can leave from the childs circle,  
+
- returns value of integer array "fieldno" at row number "aindex"  
but Left/Right can only toggle between the childs ***
+
             
 +
function integervaluelog(const fieldno,aindex: integer): integer;
 +
-  returns value of integer array "fieldno" where the array index equals to "aindex"
  
*** mouse entering/leaving isn't controllable by these options
+
function integerindex(const fieldno,aindex: integer): integer;
 +
- returns row number of integer array "fieldno" where the array index equals to "aindex"
  
 +
function integerindexar(const fieldno: integer): integerarty;
 +
- returns all bunch of indexes of integer array "fiedlno"
  
ow_focusbackonesc
+
function integerar(const fieldno: integer): integerarty;
- on pressing "Esc", returns input focus to the previously focused widget
+
- returns all bunch of data of integer array "fiedlno"
 +
 
 +
function floatvaluephys(const fieldno,aindex: integer): realty;
 +
returns value of real/datetime array "fieldno" at row number "aindex"
  
ow_noparentshortcut
+
function floatvaluelog(const fieldno,aindex: integer): realty;
 +
-  returns value of real/datetime array "fieldno" where the array index equals to "aindex"
  
*** disables processing of delegated ( from the parent ) shortcuts ***
+
function floatindex(const fieldno,aindex: integer): integer;
 +
- returns row number of real/datetime array "fieldno" where the array index equals to "aindex"
  
- "true" here disables processing shortcuts if they're delegated
+
function floatindexar(const fieldno: integer): integerarty;
from the parent widget ( obviously, not processed by the parent )
+
- returns all bunch of indexes of real/datetime array "fiedlno"
  
ow_nochildshortcut
+
function floatar(const fieldno: integer): realarty;
 +
- returns all bunch of data of real/datetime array "fiedlno" 
  
*** disables delegating shortcuts to the parent for taking desision ***
+
function textvaluephys(const fieldno,aindex: integer): msestring;
 +
-  returns value of widestring array "fieldno" at row number "aindex"
  
- if "true" then the widget tries to process it by oneself
+
function textvaluelog(const fieldno,aindex: integer;
otherwise it's passed to the parent widget for further chaining
+
                      const caseinsensitive: boolean): msestring;
 +
- returns value of widestring array "fieldno" where the array index equals to "aindex"
  
*** A shortcut can only be processed once ( by one widget ) ***
+
function textindex(const fieldno,aindex: integer;
 +
                      const caseinsensitive: boolean): integer;
 +
- returns row number of widestring array "fieldno" where the array index equals to "aindex"
  
ow_canclosenil
+
function textindexar(const fieldno: integer;
- "true" here allows to continue even if there's contained widget(s)  
+
                            const caseinsensitive: boolean): integerarty;
not passing "CanClose" check
+
- returns all bunch of indexes of widestring array "fiedlno"
  
ow_mousetransparent
+
function textar(const fieldno: integer): msestringarty;
- "true" here causes the widget oneself ( not its contained ones )
+
- returns all bunch of data of widestring array "fiedlno"  
not to react to mouse events ( just allow them through to the childs )
 
  
ow_mousewheel
+
 
- enables/disables {scrolling/navigating} with wheel of ImPS/2 etc mouse
+
function lookupinteger(const integerkeyfieldno,integerfieldno,
 +
                                keyvalue: integer): integer; overload;
 +
- returns value of integer array "integerfieldno" at position where
 +
value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
 +
                ( 0 if not found )
  
ow_noscroll
+
function lookupinteger(const stringkeyfieldno,integerfieldno: integer;
- don't use screen image scrolling for twidget.scrollrect,
+
                        const keyvalue: msestring): integer; overload;
redraw the whole scrolled widget rectangle instead;
+
- returns value of integer array "integerfieldno" at position where
sometimes needed with background fades.
+
value of parallel widestring array "stringkeyfieldno" equals to "keyvalue"
 +
                ( 0 if not found )
  
ow_nochildpaintclip
+
function lookuptext(const integerkeyfieldno,textfieldno,
-  
+
                                keyvalue: integer): msestring; overload;
 +
- returns value of integer array "textfieldno" at position where
 +
value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
 +
                ( '' if not found )
  
ow_destroywidgets
+
function lookuptext(const stringkeyfieldno,textfieldno: integer;
- "true" here causes calling "free" for all containing widgets as well
+
                      const keyvalue: msestring): msestring; overload;
 +
- returns value of integer array "textfieldno" at position where
 +
value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
 +
                ( '' if not found )
  
ow_hinton
 
- to show the hint even in case of hinting is disabled on the parent
 
( "parent.ow_hintoff= true & parent.ow_hinton= false" )
 
  
ow_hintoff
+
function lookupfloat(const integerkeyfieldno,floatfieldno,
- "true" here combined with "ow_hinton=false" fully disables displaying the hint
+
                                keyvalue: integer): realty; overload;
 +
- returns value of real/datetime array "floatfieldno" at position where
 +
value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
 +
                ( emptyreal if not found )
  
ow_multiplehint
+
function lookupfloat(const stringkeyfieldno,floatfieldno: integer;
- "true" here causes the widget to redisplay its hint on each {>3px} move within the widget oneself
+
                                keyvalue: msestring): realty; overload;
  
*mse ow_timedhint
+
- returns value of real/datetime array "floatfieldno" at position where
- "true" here causes hint of the widget to disappear after a timed inteval (about 2 secs by default)
+
value of parallel widestring array "stringkeyfieldno" equals to "keyvalue"
 +
                ( emptyreal if not found )
  
ow_fontlineheight (design-time only)
+
function count: integer; - returns number of data rows
- causes "extraspace" of the last text line to be drawn,
 
in turn it causes adjustment of widget height if "ow_autoscale" is set
 
 
*** makes sence only if "ow_autoscale=true" & ow_autosize=false & "extraspace <> 0" ***
 
  
ow_fontglyphheight (design-time only)
+
property fieldcounttext: integer; - returns/sets number of widestring arrays
- causes only interline "extraspace"-s to be drawn, opposite to "ow_fontlineheight"
+
property fieldcountfloat: integer; - returns/sets number of real/datetime arrays
 +
property fieldcountinteger: integer; - returns/sets number of integer arrays
  
ow_autoscale (design-time only)
+
the above "fieldcount*" props clear the buffer on setting a value
- causes that if the contents change (design OR run-time) so that its' height changes
 
then the widget will be v-scaled as well
 
  
ow_autosize (design-time only)
+
property integervalue[const fieldno,aindex: integer]: integer; - a shortcut to "integervaluephys"
- causes that widget's heigh & width & client area adjust so that to provide space for contents of the client area
+
property floatvalue[const fieldno,aindex: integer]: realty; - a shortcut to "floatvaluephys"
- no desing-time change of height/width are possible as long as this option is in effect
+
property textvalue[const fieldno,aindex: integer]: msestring; - a shortcut to "textvaluephys"
  
ow_autosizeanright
+
property onchange: notifyeventty;
- when autosizing & {an_right isn't set}, the design-set right margin against the parent is preserved
+
- called in "changed" wich in turn is called in :
 +
= clearbuffer
 +
= endupdate
 +
= doasyncevent
 +
= loaded
 +
= tlookupbuffer.addrow
  
ow_autosizeanbottom
+
</pre>
- when autosizing & {an_bottom isn't set}, the design-set bottom margin against the parent is preserved
 
  
optionsskin:
+
=== TLookupBuffer ===
 +
<pre>
 +
tlookupbuffer = class(tcustomlookupbuffer)
  
- osc_noskin
+
- extends "tcustomlookupbuffer" with methods of run-time data filling
- osc_framebuttononly
 
- osc_container
 
  
 +
- see <tcustomlookupbuffer>
  
Methods:
+
+= Extentions to the public interface:
  
  // tmsecomponent
+
procedure addrow(const integervalues: array of integer;
 +
                    const textvalues: array of msestring;
 +
                    const floatvalues: array of realty);
  
// (re)draws the widget according to the related skin if apllicable;
+
- adds one row to each of widestring arrays, integer arrays and real/datetime arrays,
//
+
array size of  "{type}values" equals to number of {type} arrays
// also called internally by "loaded" procedure ( before "OnLoaded" code ),
 
// by ShowMessage ( for the internal widgets of the message dialogue ),
 
// when creating tab & form & menu widgets
 
procedure updateskin(const recursive: boolean = false);
 
  
// TRUE if the instance is created but not yet ready
+
  procedure addrows(const integervalues: array of integerarty;
// for interaction & accessing data & appearance change & receiving events etc
+
                    const textvalues: array of msestringarty;
// ( the stage between firing "OnCreate" & "OnLoaded" )
+
                    const floatvalues: array of realarty);
function loading: boolean;
 
 
{$ifdef FPC}
 
procedure setinline(value: boolean); // ?
 
procedure setancestor(value: boolean); // ?
 
{$endif}
 
  
// TRUE if all conditios are OK for executing the code of "event" ( a handler must be assigned to the event )
+
- adds many data rows  to each of widestring arrays, integer arrays and real/datetime arrays,
function canevent(const event: tmethod): boolean;
+
only min length of the input data arrays are inserted, longer data are truncated
 +
array size of  "{type}values" equals to number of {type} arrays and the size of "{type}values[i]"
 +
describes number od data elements in the array
 +
 +
</pre>
  
 +
=== TDBLookupBuffer ===
 +
<pre>
 +
tdblookupbuffer = class(tcustomdblookupbuffer -> tcustomlookupbuffer)
  
// Shortly, replaces the persistent storage of the widget
+
- extends "tcustomlookupbuffer" with interface to fill arrays with DB-data
//
+
- see <tcustomlookupbuffer> & <tcustomdblookupbuffer>
// if {value <> nil} then
 
// - if "instance" is nil then calls "createproc" to create the instance,
 
//    then assigns the instance's value:= "value"
 
// otherwise frees "instance"
 
procedure setoptionalobject(const value: tpersistent; var instance;
 
                        createproc: createprocty);
 
  
// creates the persistent storage of the widget via calling "createproc"
+
Extentions to the public interface:
procedure getoptionalobject(const instance: tobject; createproc: createprocty);
 
  
// obtains & puts to "obj" a CORBA interface entry for "aintf" (GUID,...)
+
  procedure checkbuffer; - if data obsolete ("invalid") then reloads them from "datasource"
function getcorbainterface(const aintf: ptypeinfo; out obj) : boolean;
+
 
 +
property datasource: tdatasource; - sets/returns DB data source where to load data from
 +
property textfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of widestring arrays
 +
property integerfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of integer arrays
 +
property floatfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of real/datetime arrays
  
        // TRUE if the widget is owned, or "self" otherwise
+
property optionsdb: lbdboptionsty; - tunes some DB behaviour apects
function checkowned(component: tcomponent): boolean;
+
- olbdb_closedataset :
 +
= once data obsolete, opens (if needed) the supplier dataset (disabling its bound controls)  
 +
then [re]loads data from it then closes it
  
        // TRUE if the widget is owner, or "self" otherwise
+
- olbdb_invalidateifmodified :
function checkowner(component: tcomponent): boolean;
+
= gets marked "invalid" once contents of the bound dataset change,  
 +
it signals to reload the buffer with the new data just before next accessing
 +
( for any purpose - searching, lookuping, getting value/(array of values),..)
  
// return the top-most widget in owner chain starting from this widget
+
</pre>
function rootowner: tcomponent;
 
  
// return the array of owning widgets starting from this widget
+
=== TDBmemoLookupbuffer ===
// componentarty[0] is the widget oneself
+
<pre>
function getrootcomponentpath: componentarty;
+
- allows to use  for lookup-ing any text-convertable DB-fields
 +
- an analog of tdblookupbuffer, but :
 +
- "integerfields" may be names of any integer-convertable DB-fields
 +
- "floatfields" may be names of any (real/datetime)-convertable DB-fields
 +
- "textfields"  may be names of any text-presentable DB-fields
  
        // returns items of objeclinker ( which notify this widget )
+
- each DB-field value ( presenting a memo generally of many lines ) may supply many data rows at once
        // and free notify list ( which are notified by this widget ),
+
to the bound array of the buffer, since this value will be internally splitted & turned into native array values,
        // duplicates are removed.
+
and the resulting "count" (arrays row count) of the whole buffer will be the minimal rows count amongst arrays
        //
+
of the buffer, the rest data are truncated
        // Notifies mainly relate to insertion/removal operation on widgets
 
        // The notify list is maintained by FreeNotification & RemoveFreeNotification
 
function linkedobjects: objectarty;
 
  
// sends "event" recursively to child widgets until no more childs or
+
- when loading widestring arrays, also checks for & performs "utf8-to-widestring" conversion of values of
// the event is processed ( cea_processed ) by one of the childs,
+
the bound DB-fields so that these arrays always store widestrings
// "event" will be destroyed if destroyevent= true and not async
+
</pre>
procedure sendcomponentevent(const event: tcomponentevent;
 
                                        const destroyevent: boolean = true);
 
  
// sends "event" to each of owning widgets downward from the root owner,
+
=== TThreadComp ===
// "event" will be destroyed if destroyevent= true and not async
+
=== TStatFile ===
procedure sendrootcomponentevent(const event: tcomponentevent;
+
<pre>
                                        const destroyevent: boolean = true);
+
- so that to be in effect, it should also be assigned to the form where the widget using the stafile is placed on
 +
- in design, if "onstatwrite" is set and "filedir" is not yet created, deactivate exception "ECreateError" in project settings ( "Debugger" tab )
 +
- "filedir" may contain "~/" indicating the user's home directory
 +
- options "oe_savestate" & "oe_savevalue" of "client" widgets define what to store to the file
 +
- position etc changes or/and value changes
 +
- in case when a main form shares its stafile with non-main forms, on creating non-main ones, just edited not saved data of the main form ( bound to vars of the statfile) are reset to values read from the statfile upon creating the form; for "sfo_memory", this effect absents unless widgets on the concurring forms share same variable[s]; to avoid this behaviour, disable "fo_autoreadstat" & "fo_autowritestat" of the non-main forms
 +
- each "tstafile" owns:
 +
= tstatwriter:
 +
* provides methods of writing sections & statvars to a memory/file stream
 +
- tstatreader:
 +
* holds list of sections with statvars each
 +
* provides search & check & reading interface to the statvars
 +
* provides reading statvars from a memory/file stream
  
// posts an async "atag"-ged event to be handled by oneself
+
Positioning to a section speeds up accessing its statvars
procedure asyncevent(atag: integer = 0);
 
  
// posts a "tcomponentevent" instance from sender=self,
+
- there also is "tstatfiler" ( exposed by some "tstatfile" events ) which:
// "kind" is defined when creating the event,
+
= may present or "tstatwriter" or "tstatreader" ( there's a check method )
// and "tag" may be adjusted after creation
+
= provides directionless "update" methods with internal switch to needed direction of processing
procedure postcomponentevent(const event: tcomponentevent);
+
- "reading" or "writing" statvars on per-section basis
  
// returns the classname of the widget if the widget is toplevel,
 
// and "tmsecomponent" otherwise )
 
property moduleclassname: string read getmoduleclassname;
 
  
// returns the classname of the widget as the entry of its constructor
+
activator :
// ( button => tbutton, datamodule => tdm1mo, form => ttstfo, dbstringedit => tdbstringedit,.. )
+
<see tactivator> : NOT YET DONE
property actualclassname: string read getactualclassname;
 
  
// returns "fmsecomponentstate"
+
encoding = "en_utf8" selected here, allows to store non-Latin text in the file
// ( a set of cs_ismodule,cs_endreadproc,cs_loadedproc,cs_noload, cs_hasskin,cs_noskin )
+
      filedir = directory where to keep the file ( by default - the current working directory )
property msecomponentstate: msecomponentstatesty read fmsecomponentstate;
+
filename = name of the file
  
// returns/sets a pointer associated with the widget
+
options:
// ( contrary to the integer "tag", allows to use an arbitary data type
+
sfo_memory = reads & writes not from a disk file but from a named memory stream
// for associating data )
+
( there's an exclusion - see below "sfo_savedata" ),
property tagpo: pointer read ftagpo write ftagpo;
+
mostly useful for presenting last used values on recalling
 +
non-main forms etc ( data even survive recreating forms),
 +
or even for data "exchange" between non-main modal( non-concurring ) forms
 +
in case of the target widgets share same statvarnames
  
// returns/sets a string identifying the widget in the help system
+
sfo_createpath = creates "filedir" if necessary
property helpcontext: msestring read gethelpcontext write fhelpcontext;
+
sfo_savedata = used only with "sfo_memory", commands to save
 +
the memory data to the master statfile (see below)
  
// twidget
+
sfo_activatorread = activator activate triggers reading ???
 +
sfo_activatorwrite = activator deactivate triggers writing ???
  
// creates an instance of the widget, owned by "aowner" if not NIL
+
statfile = a master statfile
constructor create(aowner: tcomponent); override;
+
statvarname = name of section of this file in the upper statfile
 +
Tag = an integer property for misc purposes
  
destructor destroy; override;
+
Event handlers:
 +
onstatafterread - fires on return from "readstat"
 +
onstatafterwrite - fires on return from "writestat"
 +
onstatbeforeread - fires on beginning of "readstat"
 +
onstatbeforewrite - fires on beginning of "writestat"
 +
onstatread = fires after reading state data
 +
onstatwrite = fires after writing state data
 +
onstatupdate = fires after reading/writing state data just before
 +
"onstatread" & "onstatwrite"
  
// ??
+
Public methods:
procedure afterconstruction; override;
 
  
// rescales the widget frame ( if assigned ) then owned widgets ( if exist, recursively ) then bounds_* then the font ( if assigned )
+
  procedure initnewcomponent(const ascale: real); override;
// called before inserting in parentwidget,
+
  - does nothing but fixes the default file name as the statfile default
// calls "scale(ascale)",
+
 
// no visual repainting
+
  procedure readstat(stream: ttextstream = nil); overload;
procedure initnewcomponent(const ascale: real); virtual;
+
  - rereads all statvars of the stafile/memorystream
 +
 
 +
  procedure readstat(const aname: msestring; const statreader: tstatreader); overload;
 +
  - rereads "aname" statvar of the statfile
  
// restores the "fontheight" to "font.glyphheight" if "ow_fontglyphheight" or
+
  procedure writestat(const stream: ttextstream = nil); overload;
// to "font.lineheight" if "ow_fontlineheight" otherwise,
+
  - rewrites all statvars to the stafile/memorystream
// ascale is ignored ?
+
  (if neccessary, prepares to writting - creates "filedir", stafile,...)
// calls "synctofontheight->setfontheight",
+
 
// called after inserting in parentwidget,
+
  procedure writestat(const aname: msestring; const statwriter: tstatwriter); overload;
// no visual repainting
+
  - overwrites "aname" statvar of the statfile
procedure initnewwidget(const ascale: real); virtual;
+
 
 +
  procedure updatestat(const aname: msestring; const statfiler: tstatfiler);
 +
  - depending on kind of "statfiler" ( writer/reader ), writes/reads
 +
    the most up-to-date stat data
 +
</pre>
  
// creates the widget frame if not yet created
+
=== TTimer ===
procedure createframe;
+
=== TNoGuiAction ===
 
+
=== TPipeReadercomp ===
// creates the widget face if not yet  created
+
=== TSysEnvManager ===
procedure createface;
+
=== TProcessMonitor ===
 +
=== TFilechangeNotifier ===
 +
=== TShortCutController ===
 +
=== TPostscriptPrinter ===
 +
=== TGdiPrinter ===
 +
=== TWmfPrinter ===
 +
=== TSkinController ===
 +
=== TGuiThreadComp ===
  
// creates the widget font if not yet  created
+
== Font ==
procedure createfont;
+
See also : [[Reference:_MSEgui/TFont]]
  
// checks ws_loadlock and csdestroing too
+
=== Any Font ===
function isloading: boolean;
+
<pre>
 
+
    charset { ANSI/ DEFAULT/ SYMBOL /SHIFTJIS /HANGEUL /GB2312 /CHINESEBIG5 /OEM
// returns "widgetstatety" - a set of (
+
/JOHAB / HEBREW/ ARABIC/ GREEK/ TURKISH/ VIETNAMESE/ THAI/ EASTEUROPE/
// ws_visible,ws_enabled,ws_active,ws_entered,ws_entering,ws_exiting,
+
RUSSIAN/ MAC/ BALTIC }
// ws_focused,ws_mouseinclient,ws_wantmousebutton,ws_wantmousemove,
+
- changes the font to the nearest containing the selected encoding(charset)
// ws_wantmousefocus,ws_iswidget,ws_opaque,ws_nopaint,
+
- no font change made if the supplied encoding doesn't match any font
// ws_clicked,ws_mousecaptured,ws_clientmousecaptured,
+
color
// ws_loadlock,ws_loadedproc,ws_showproc,ws_minclientsizevalid,
+
- color of the glyphs contours
// ws_showed,ws_hidden, //used in tcustomeventwidget
+
colorbackground
// ws_destroying,ws_staticframe,ws_staticface,ws_isvisible
+
- fill color of the glyph cells ( not including extraspace )
//
+
colorshadow
// iframe
+
- color of SE glyph "edges" ( if not "cl_none", deactivates "colorbackground" )
function widgetstate: widgetstatesty;
+
extraspace
 
+
- v-space between glyph cells of adjacent text rows (negative values cause the cells to overlap )
// returns "widgetstate1ty" - a set of (
+
height
// (ws1_childscaled,ws1_fontheightlock,
+
- v-size of glyph cells, in pixels
// ws1_widgetregionvalid,ws1_rootvalid,
+
name
// ws1_anchorsizing,ws1_isstreamed,
+
- initially, font is choosen by { "family" = this name }
// ws1_scaled, //used in tcustomscalingwidget
+
options:
// ws1_noclipchildren,
+
foo_fixed
// ws1_nodesignvisible,ws1_nodesignframe,ws1_nodesignhandles,
+
- changes the font to the nearest "mono" spaced (usually = Courier)
// ws1_nodesigndelete,ws1_designactive,
+
foo_proportional
// ws1_fakevisible,ws1_nominsize //used for report size calculations
+
- changes the font to the nearest "proportionally" spaced (usually = Helvetica)
// )
+
foo_helvetica
property widgetstate1: widgetstates1ty read fwidgetstate1;
+
- changes the font to the nearest in "sans" category (usually = Helvetica)
+
foo_roman
* this set of states is needed because the max FPC set size is 32
+
- changes the font to the nearest in "serif" category (usually = Times[ New Roman])
  thus "widgetstate1ty" can't fit all states
+
foo_script
 
+
- Win32 only, changes the font to the nearest in "script" category
// TRUE if the widget is contained within another widget
+
foo_decorative
// ( tcomponent stuff )
+
- Win32 only, changes the font to the nearest in "decorative" category
function hasparent: boolean; override;             
+
foo_antialiased
 +
- Linux-only, enables antialiasing (if disabled by Xft globally)
 +
foo_nonantialiased
 +
- Linux-only, disables antialiasing (if enabled by Xft globally)
 +
usually making glyph extents (not cells !) a bit wider
 +
style:
 +
fs_bold
 +
- gives the font a "bold" look
 +
fs_italic
 +
- gives the font an "italic" look
 +
fs_underline
 +
- gives the font an "underlined" look
 +
fs_strikeout
 +
- gives the font a "striked out" look
 +
fs_selected
 +
- "TRUE" here combined with {tf_noselect:=FALSE}, causes the text described by this font
 +
to be initially selected ( with the clipboard operations available ),
 +
currently applicable only to richstrings
 +
 
 +
width
 +
- 10*{ glyph cell width, average in pixels }, 0 = {font default}
  
// returns the parent component if it's a widget or the grandparent otherwise
+
xscale
function getparentcomponent: tcomponent; override;  //tcomponent
+
- width ratio of each glyph {cell & contour}, the effect is similar to "width"
  
// TRUE if "awidget" is an ascendant or the widget or they are the same widget
+
*** "foo_*" font selection overrides one made with "name"  
function checkdescendent(awidget: twidget): boolean;
 
 
// TRUE if app is running and the widget owns the caret or the caret widget
 
function hascaret: boolean;
 
  
        // TRUE if "winid" allocated and not loading and not destroying,
+
*** if change with "foo_*" is unsuccessful then the nearest "sans" font is usually chosen
        // all widgets on a form have "winid" of this form ( a real window allocated by the OS )
 
        // thus have this function TRUE
 
function windowallocated: boolean;
 
  
// TRUE if presents a valid toplevelwindow with assigned "winid"
+
*** The categories :
function ownswindow: boolean;
 
  
// invalidated area of the widget, the origin is "clientpos" against the roor widget
+
sans => have no serifs and have strokes of even thickness
function updaterect: rectty;
+
serif => have serifs at glyph contours and made up of strokes of varying thickness
 +
script => resemble handwriting
 +
decorative => flashy styles to be used sparingly in headlines or posters
  
// calls recursively "canclose" for all contained widgets ( the widget oneself excluded! ),
+
</pre>
// TRUE if none of the widgets return FALSE
 
//
 
// more specialized widgets may have "canclose" overridden
 
// to perform more work than just this call recursion
 
// ( not null or range check,.. )
 
//
 
// "onclosequery" must also pass the check if assigned, for the function to succeed
 
function canclose(const newfocus: twidget = nil): boolean; virtual;
 
  
        // checks "canclose" first for focused widget of the window ( form,.. )
+
== GUI ==
        // if it is a descendant of the widget or the widget oneself,
+
=== TWindow ===
        // then continues with subwidgets of the widget;
+
<pre>
        // also - finishes editing ( snapshots "value" ) in the focused widget before checking
+
twindow = class(teventobject,icanvas)
function canparentclose(const newfocus: twidget): boolean; overload;
+
  public
  
// the above function but with the preserved focus
+
// releases mouse, unlinks from the canvas, processes all pending events of the window
function canparentclose: boolean; overload;
+
// if called from within main thread then destroys the window directly
                  //newfocus = window.focusedwidget     
+
// otherwise posts a window destroy event for oneself and waits for it to be processed
 +
procedure destroywindow;
  
function canfocus: boolean; virtual;
+
// registers the instance of onself in the "owner" widget, allocates the canvas,
function setfocus(aactivate: boolean = true): boolean; virtual;//true if ok
+
// adds a reference to oneself,
procedure nextfocus; //sets inputfocus to then next appropriate widget
+
// then prepares the "owner" hierarchy to be invalidated ( "owner.rootchanged" )
 +
// since now, the window is allocated and belongs to the "aowner" widget  
 +
constructor create(aowner: twidget);
  
function findtabfocus(const ataborder: integer): twidget;
+
destructor destroy; override;
                      //nil if can not focus
 
  
function firsttabfocus: twidget;
+
// adds "method" to the internal list of scroll dependants
function lasttabfocus: twidget;
+
procedure registeronscroll(const method: notifyeventty);
function nexttaborder(const down: boolean = false): twidget;
 
  
function focusback(const aactivate: boolean = true): boolean;
+
// removes "method" from the internal list of scroll dependants
                              //false if focus not changed
+
procedure unregisteronscroll(const method: notifyeventty);
  
function parentcolor: colorty;
+
// releases mouse if captured, resets the cursor, then enters an event loop for the window,
function actualcolor: colorty; virtual;
+
// TRUE on return if the window is destroyed
function actualopaquecolor: colorty;
+
function beginmodal: boolean;
function backgroundcolor: colorty;
+
function translatecolor(const acolor: colorty): colorty;
+
  * checks if the "sender" window is already modal to avoid circularity,
 +
    if not then starts an event loop  for the "sender" where the "sender" is a receiver of GUI events,
 +
      once the loop is terminated reactivates the previously active window if it was,
 +
    TRUE if modalwindow destroyed 
  
procedure widgetevent(const event: twidgetevent); virtual;
+
  function tinternalapplication.beginmodal(const sender: twindow): boolean;
  
procedure sendwidgetevent(const event: twidgetevent);
+
// removes the internal stuff which indicates the modal state
                              //event will be destroyed
+
procedure endmodal;
  
procedure release; override;
+
// if the window is visible,
 +
// deactivates the previously active window, shows the window (see below),
 +
// if no active window in the app or the window or its Z-predecessor is modal and
 +
// the app has no focused widget then prepares the bound widget to be focused,
 +
// then addresses the WM to put the window to foreground
 +
procedure activate;
  
function show(const modal: boolean = false;
+
  // if the bound widget has visible=true then:
            const transientfor: twindow = nil): modalresultty; virtual;
+
  //  - if NOT windowevent then :
 +
  //    = address the WM to set size of the window acc to window opts
 +
  //      wp_maximized, wp_fullscreen or normal size otherwise
 +
  // = if the window is normally sized, moves it to its default position is specified ( screen centered etc )
 +
  // - unhides/unminimizes the window if needed
 +
  // - shows other windows of the applications acc to state of the window group
 +
  // ( in normal size or minimized )
  
procedure hide;
+
  private
procedure activate(const abringtofront: boolean = true); virtual;
+
procedure twindow.show(windowevent: boolean);
                            //show and setfocus
 
  
procedure bringtofront;
+
// TRUE if this window currently grabs user input
procedure sendtoback;
+
( a widget drawn within the window(=form) is in focus,.. )
procedure stackunder(const predecessor: twidget);
+
function active: boolean;
  
procedure paint(const canvas: tcanvas); virtual;
+
// if the window was active then deactivates the window  & remembers it as the previous active ( to restore leater if requested ),
procedure update; virtual;
+
// returns TRUE if that storage occurred
procedure scrollwidgets(const dist: pointty);
+
function deactivateintermediate: boolean;  
  
procedure scrollrect(const dist: pointty; const rect: rectty; scrollcaret: boolean);
+
// makes the window active & clears the above app reference to it ( "active before deactivating" )
                            //origin = paintrect.pos
+
procedure reactivate; //clears app.finactivewindow
  
procedure scroll(const dist: pointty);
+
// scans the app event queue for "ek_expose" event[s] addressed to the window,
                            //scrolls paintrect and widgets
+
// if found then redraws that part of the window which the event describes
 +
// ( processed events are then deleted )
 +
procedure update;
  
procedure getcaret;
+
// TRUE if the window :
procedure scrollcaret(const dist: pointty);
+
// 1) doesn't have an inner widget grabbing input focus
function mousecaptured: boolean;
+
// or
procedure capturemouse(grab: boolean = true);
+
// 2) has such widget, and this widget ( and all its descendants )  
procedure releasemouse;
+
//    pass "CanClose" check
procedure capturekeyboard;
+
//
procedure releasekeyboard;
+
// *** see also "twidget.CanClose" ***
procedure synctofontheight; virtual;
+
//
 +
function candefocus: boolean;
  
procedure dragevent(var info: draginfoty); virtual;
+
// tries to defocus the currently focused widget if it belongs to the window,
procedure dochildscaled(const sender: twidget); virtual;
+
// if succeeds then executes code of virtual "DoDefocus" of the widget descessor
 
+
// ( this code defines behaviour & look of the widget on defocusing );
procedure invalidatewidget;     //invalidates whole widget
+
//
procedure invalidate;           //invalidates clientrect
+
// no defocusing is done if the focused widget ( or its descendants )
procedure invalidaterect(const rect: rectty; org: originty = org_client);
+
// doesn't pass "CanClose" check
procedure invalidateframestate;
+
//
 +
procedure nofocus;
 +
 
 +
  // setfocusedwidget(widget)
 +
 
 +
  property focuscount: cardinal read ffocuscount;
 +
  function close: boolean; //true if ok
 +
  procedure beginmoving; //lock window rect modification
 +
  procedure endmoving;
 +
  procedure bringtofront;
 +
  procedure sendtoback;
 +
  procedure stackunder(const predecessor: twindow);
 +
      //stacking is performed in mainloop idle, nil means top
 +
  procedure stackover(const predecessor: twindow);
 +
      //stacking is performed in mainloop idle, nil means bottom
 +
  function stackedunder: twindow; //nil if top
 +
  function stackedover: twindow; //nil if bottom
 +
  function hastransientfor: boolean;
  
procedure invalidateframestaterect(const rect: rectty;  
+
  procedure capturemouse;
                                        const org: originty = org_client);  
+
  procedure releasemouse;
function hasoverlappingsiblings(arect: rectty): boolean; //origin = pos
+
  procedure postkeyevent(const akey: keyty;  
 +
        const ashiftstate: shiftstatesty = []; const release: boolean = false;
 +
                  const achars: msestring = '');
  
function window: twindow;
+
  function winid: winidty;
function rootwidget: twidget;
+
  function haswinid: boolean;
 +
  function state: windowstatesty;
 +
  function visible: boolean;
 +
  function activating: boolean; //in internalactivate proc
 +
  function normalwindowrect: rectty;
 +
  property updateregion: regionty read fupdateregion;
 +
  function updaterect: rectty;
  
function parentofcontainer: twidget;
+
  procedure registermovenotification(sender: iobjectlink);
            //parentwidget.parentwidget if parentwidget has not ws_iswidget,
+
  procedure unregistermovenotification(sender: iobjectlink);
            //parentwidget otherwise
 
  
property parentwidget: twidget read fparentwidget write setparentwidget;
+
  property options: windowoptionsty read foptions;
function getrootwidgetpath: widgetarty; //root widget is last
 
  
// number of contained widgets ( the widget oneself excluded ! )
+
// widget  
function widgetcount: integer;
+
property owner: twidget read fowner;
  
function parentwidgetindex: integer; //index in parentwidget.widgets, -1 if none
+
  property focusedwidget: twidget read ffocusedwidget;
property widgets[const index: integer]: twidget read getwidgets;
+
  property transientfor: twindow read ftransientfor;
function widgetatpos(var info: widgetatposinfoty): twidget; overload;
+
  property modalresult: modalresultty read fmodalresult write setmodalresult;
function widgetatpos(const pos: pointty): twidget; overload;
+
  property buttonendmodal: boolean read getbuttonendmodal write setbuttonendmodal;
 +
  property globalshortcuts: boolean read getglobalshortcuts write setglobalshortcuts;
 +
  property localshortcuts: boolean read getlocalshortcuts write setlocalshortcuts;
 +
  property windowpos: windowposty read getwindowpos write setwindowpos;
 +
  property caption: msestring read fcaption write setcaption;
  
function widgetatpos(const pos: pointty;
 
                  const state: widgetstatesty): twidget; overload;
 
  
property taborderedwidgets: widgetarty read gettaborderedwidgets;
+
windowoptionty = (wo_popup,wo_message,wo_buttonendmodal,wo_groupleader,
 +
                  wo_windowcentermessage); //showmessage centered in window
  
function findtagwidget(const atag: integer; const aclass: widgetclassty): twidget;
 
              //returns first matching descendent
 
  
property container: twidget read getcontainer;
+
optionswindow:
function containeroffset: pointty;
+
wo_popup
function childrencount: integer; virtual;
+
- in run-time, hides all OS windows-manager ( WM ) decorations (title bar, buttons "Close/Resize,Min/Max" etc),
property children[const index: integer]: twidget read getchildwidgets; default;
+
letting only its client area to appear
 +
so :
 +
= the window should have own facilities to replace the deactivated WM functionality if needed
 +
= can't be resized/maximize/minimized/moved
 +
wo_message
 +
- similar to "wo_popup" but allows WM to close ( with "Close" button ) & move the window
  
function childatpos(const pos: pointty;
+
wo_groupleader
                  const clientorigin: boolean = true): twidget; virtual;
+
- keeps on the WM taskbar a shortcut to the window
 +
( if the parent window is a groupleader too then displays a step upper in its group )
  
function getsortxchildren: widgetarty;
+
Event handlers:
function getsortychildren: widgetarty;
 
property focusedchild: twidget read ffocusedchild;
 
property focusedchildbefore: twidget read ffocusedchildbefore;
 
  
function mouseeventwidget(const info: mouseeventinfoty): twidget;
+
- onmove
 +
= fires once the (window/widget) is created/moved ( with check if really moved by a distance)
  
function checkdescendent(widget: twidget): boolean;
+
</pre>
                    //true if widget is descendent or self
 
  
function checkancestor(widget: twidget): boolean;
+
=== TFormScrollbox ===
                    //true if widget is ancestor or self
+
<pre>
 +
- presents client area of form & parent of its widgets,
 +
initially stretched to fit the form & bound with anchoring
 +
but may be adjusted with "bounds" & "anchors"
 +
 
 +
    Properties:
 +
               
 +
anchors
 +
bounds
 +
 +
color
 +
- color of the whole container area ( except its frame ) & form widgets
 +
if their color is "cl_parent"
  
function containswidget(awidget: twidget): boolean;
+
name = container
  
procedure insertwidget(const awidget: twidget); overload;
+
cursor, enabled, face, frame, helpcontext, hint, optionswidget, popupmenu,
 +
taborder, tag, visible, onactivate, onafterpaint, onbeforepaint,
 +
onchildmouseevent, onclientmouseevent, ondeativate, ondefocus, onenter,
 +
onexit, onfocus, onfontheightdelta, onmouseevent, onpaint, onpopup
 +
onresize, onshowhint
 +
- the same meaning as for the served form
  
procedure insertwidget(const awidget: twidget; const apos: pointty); overload; virtual;
 
                //widget can be child
 
  
function iswidgetclick(const info: mouseeventinfoty; const caption: boolean = false): boolean;
+
oncalcminscrollsize
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
+
onscroll
//or in frame.caption if caption = true, origin = pos
+
onchildscaled
 +
</pre>
  
function isclick(const info: mouseeventinfoty): boolean;
+
=== TFaceList ===
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
+
=== TFrameComp ===
  
 +
See also here: [[Reference:_MSEgui/TFrame]].
  
function isdblclick(const info: mouseeventinfoty): boolean;
+
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
+
<pre>
// and timedlay to last buttonpress is short
+
Terminology :
  
function isdblclicked(const info: mouseeventinfoty): boolean;
+
{client area = area of the widget which interacts with a user}
//true if eventtype in [et_buttonpress,et_butonrelease], button is mb_left,
 
// and timedlay to last same buttonevent is short
 
  
function isleftbuttondown(const info: mouseeventinfoty): boolean;
+
{bevelling = additional facets rising/sinking frame & client area,
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
+
constists of two parts -
//origin = paintrect.pos
+
- external: between frame and widget
 +
- internal: between frame and client area
 +
}
  
//======================
+
{frame= flat space between external & internal facets,
 +
floats at the inner level of the external facet
 +
}
  
widgetrect: the widget on-screen area including its frame & frame caption
+
*** Both frame & bevelling affect the client area ***
  
paintrect: the widget on-screen area except its frame & frame caption
+
--------------------------
 +
template:
  
clientrect: virtual area which
+
colorclient = color of the client area
- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
 
- for scrolling widgets, may be bigger than "paintrect",
 
  also may shift ( change its "pos" ) when scrolling
 
  
//======================
+
colorframe = color of the frame
 +
colorframeactive = used instead of colorframe if the widget is
 +
active; "cl_default" means same as colorframe.
  
 +
works if (leveli/levelo <> 0 that's the facets exist :
  
 +
colorshadow = color of facets screened from the NW light source
 +
colordkshadow = color of shadows dropped by the NW light source
 +
                colordkwidth = width of the shadows in pixel, -1=default
  
// the coord of outer top-left corner against the toplevel form = the window owner,
+
colorlight = color of facets exposed to the NW light source
// including the frame & frame caption
+
colorhighlight = color of brighter edges of the facets
function rootpos: pointty;
+
                colorhlwidth = width of the brighter edges in pixel, -1=default
  
// the coord of the outer top-left corner against the screen ( the WM decorations aren't counted in )
+
        extraspace = if applied to menu items, adds more space between these items
// includes the frame & frame caption
 
property screenpos: pointty;
 
  
//  the coord of the outer top-left corner against the parent widget,
+
framei_:
// including the frame & frame caption
+
(for extendable widgets like menus, these settings widen the widget,
property widgetrect: rectty;
+
for non-extendable like buttons - they squeeze the text area )
property pos: pointty; // =widgetrect.pos
 
property size: sizety; // =widgetrect.size
 
property left: integer; // =bounds_x
 
property right: integer; //widgetrect.x + widgetrect.cx, sets cx;
 
property top: integer;  // =bounds_y
 
property bottom: integer; //widgetrect.y + widgetrect.cy, sets cy;
 
property width: integer; // =bounds_cx
 
property height: integer; // =bounds_cy
 
function widgetsizerect: rectty;          //pos = nullpoint
 
  
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
+
bottom= lower margin of text to the client area
    //  except the frame & frame caption
+
left = left margin of text to the client area
function paintrect: rectty;
+
right = margin of text to the client area
function paintpos: pointty;
+
top = upper margin of text to the client area
function paintsize: sizety;
 
function innerpaintrect: rectty; // mainly equals to paintrect
 
function clientwidgetrect: rectty; // mainly equals to paintrect
 
function clientwidgetpos: pointty;
 
function clippedpaintrect: rectty; // mainly equals to  but clipped by all parentpaintrects
 
function innerwidgetrect: rectty;    // mainly equals to paintrect
 
function innerclientwidgetpos: pointty;
 
  
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
+
framewidth= width of the frame
    //  except the frame caption
+
leveli = {width=height} of the internal facet, positive -> raised, negative -> sunken
function framerect: rectty; // =paintrect except the frame caption area
+
levelo = {width=height} of the external facet, positive -> raised, negative -> sunken
function framepos: pointty;
 
function framesize: sizety;
 
  
    // the coord of the client area ( clientrect )  against the paint area ( paintrect )
+
<any frame>
    //  usually these areas match
 
function clientrect: rectty;
 
property clientsize: sizety;
 
property clientwidth: integer;
 
property clientheight: integer;
 
property clientpos: pointty;
 
  
    // the coord of the paint area of the parent against the paint area of this widget
+
*** extends & customizes "tframecomp" ***
function paintrectparent: rectty; //nullrect if parent = nil,
 
  
    // the coord of the client area of the parent against the paint area of this widget
+
template
function clientrectparent: rectty; //nullrect if parent = nil,
+
- "tframecomp" supplying the initial settings
  
// the coord of the inner area against the client area ( clientrect )
+
colorclient,colordkshadow,colordkwidth,colorframe,colorframeactive,
function innerclientrect: rectty;  // mainly equals to clientrect
+
colorhighlight,colorhlwidth,colorlight,colorshadow,framewidth,
function innerclientsize: sizety;
+
leveli, levelo, framei_*,
function innerclientpos: pointty;
 
  
function framewidth: sizety;              //widgetrect.size - paintrect.size
+
<see "tframecomp">
function clientframewidth: sizety;        //widgetrect.size - clientrect.size
 
function innerclientframewidth: sizety;  //widgetrect.size - innerclientrect.size
 
function innerframewidth: sizety;        //clientrect.size - innerclientrect.size 
 
  
    // the coord of the paint area against the widgetrect(pos) of the parent
+
font
function paintparentpos: pointty;    //origin = parentwidget.pos
+
<see "tfont">
  
    // the coord of the client area against the widgetrect(pos) of the parent
+
caption
function clientparentpos: pointty;  //origin = parentwidget.pos
+
- some descriptive text( function name, user prompt,...) placed
 +
in a N/W/S/E-combination to the widget's client area
  
    // the coord of the widgetrect(pos) against the client area of parent
+
***
property parentclientpos: pointty;
+
non-empty caption if (captionpos <> cp_center) & (captiondistouter=false & captiondist>0) enlarges the framed widget
 +
by the corresponding size of caption
  
 +
***
  
function clientpostowidgetpos(const apos: pointty): pointty;
+
captiondist - margin between the caption & the client area
function widgetpostoclientpos(const apos: pointty): pointty;
 
function widgetpostopaintpos(const apos: pointty): pointty;
 
function paintpostowidgetpos(const apos: pointty): pointty;
 
procedure scale(const ascale: real); virtual;
 
  
 +
captiondistouter :
  
property minsize: sizety read fminsize write setminsize;
+
- if "false"(by default), the distance is measured between
property maxsize: sizety read fmaxsize write setmaxsize;
+
the inner (facing the client area) extent of the caption
function maxclientsize: sizety; virtual;
+
and the client area outward the area,
 +
the caption is placed outside of the client area
  
 +
- if "true", the caption is mirrored against the edge of client area as
 +
to the position when "false"
  
property anchors: anchorsty read fanchors write setanchors default defaultanchors;
+
*** nagative values of "captiondist" visually inverse "out of" and within ***
property defaultfocuschild: twidget read getdefaultfocuschild write setdefaultfocuschild;
 
  
 +
      captionnoclip - do not clip frame and client area for caption background
 +
( the client area preserves own background under the caption text)
  
procedure changeclientsize(const delta: sizety); //asynchronous
+
captionnooffset - shift orthogonal to "captiondist"
  
function getcanvas(aorigin: originty = org_client): tcanvas;
+
captionpos - "corner" where to place the caption
  
function showing: boolean;
+
localprops :
              //true if self and all ancestors visible and window allocated
 
  
function isenabled: boolean;
+
frl_levelo - "levelo" overrides "template.levelo"
              //true if self and all ancestors enabled
+
frl_leveli - "leveli" overrides "template.leveli"
 +
frl_framewidth - "framewidth" overrides "template.framewidth"
 +
frl_colorclient - "colorclient" overrides "template.colorclient"
 +
frl_colorframe - "colorframe" overrides "template.colorframe"
 +
frl_colorframeactive - "colorframeactive" overrides "template.colorframeactive"
 +
frl_colordkshadow - "colordkshadow" overrides "template.colordkshadow"
 +
frl_colorshadow - "colorshadow" overrides "template.colorshadow"
 +
frl_colorlight - "colorlight" overrides "template.colorlight"
 +
frl_colorhighlight - "colorhighlight" overrides "template.colorhighlight"
 +
frl_colordkwidth - "colordkwidth" overrides "template.colordkwidth"
 +
frl_colorhlwidth - "colorhlwidth" overrides "template.colorhlwidth"
 +
frl_fileft - "framei_left" overrides "template.framei_left"
 +
frl_firight - "framei_right" overrides "template.framei_right"
 +
frl_fitop - "framei_top" overrides "template.framei_top"
 +
frl_fibottom - "framei_bottom" overrides "template.framei_bottom"
  
function active: boolean;
+
frl_nodisable
function entered: boolean;
+
</pre>
  
function activeentered: boolean;
+
=== TFaceComp ===
//true if entered and window is regularactivewindow or inactivated
 
  
function focused: boolean;
+
See also here: https://wiki.freepascal.org/Reference:_MSEgui/TFace
function clicked: boolean;
 
  
function indexofwidget(const awidget: twidget): integer;
+
<pre>
 +
- doesn't affect the widget frame but client area of the frame
  
procedure changedirection(const avalue: graphicdirectionty;
 
                                            var dest: graphicdirectionty); virtual;
 
  
// (re)arranges "awidgets" horizontally within the parent's client area
+
template:
// so that awidget[i] were placed next each other
+
fade:
// at h-space dist[i], starting from "startx" with the right margin "endmargin";
+
color[i]: = colors forming the fade
//
+
direction: = direction where the fade grows to
// if the number of "dist" is fewer than the number of "awidgets" then the remaining h-spaces are taken
+
gd_(right/up/left/down)
// as the last "dist[i]" or "0" if none;
 
// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
 
//
 
// non-zero "endmargin" causes one of awdidget[i] to h-resize to provide the margin :
 
// - if one or more of awidgets[i] have [an_left,an_right] set then the first of such is resized
 
//    otherwise the last awidgets[i] is h-resized
 
//
 
procedure placexorder(
 
const startx: integer;
 
const dist: array of integer;
 
                const awidgets: array of twidget;
 
                const endmargin: integer = minint);
 
  
// (re)arranges "awidgets" vertically within the parent's client area
+
pos[i]: = relational position of color[i] on the direction (0.0..1.0) extent
// so that awidget[i] were placed upper/lower each other
 
// at v-space dist[i], starting from "starty" with the bottom margin "endmargin";
 
//
 
// if the number of "dist" is fewer than the number of "awidgets" then the remaining v-spaces are taken
 
// as the last "dist[i]" or "0" if none;
 
// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
 
//
 
// non-zero "endmargin" causes one of awdidget[i] to v-resize to provide the margin :
 
//  - if one or more of awidgets[i] have [an_top,an_bottom] set then the first of such is resized
 
//    otherwise the last awidgets[i] is v-resized
 
//
 
procedure placeyorder(
 
const starty: integer;
 
const dist: array of integer;
 
                const awidgets: array of twidget;
 
                const endmargin: integer = minint);
 
              //origin = clientpos, endmargin by size adjust of widgets
 
              //with [an_top,an_bottom], minint -> no change
 
  
// if {mode <> wam_none} then (re)arranges "awidgets" horizontally  within the parent's client area so that
+
transparency = makes the face half-transparent and enlighten the underlying widget 
// awidgets[0] stays on its place but awidgets[1..N] :
+
with a light source of the selected color
// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_left" set ) so that they right borders match the right border of awidgets[0]
+
( in this case, colors of the face & the widget & the light source
// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_right" set ) so that they left borders match the left border of awidgets[0]
+
simply summarize to higher brightness )
// - if {mode = wam_center} then awidgets[i>=1] move so that they Y-axes match the Y-axe of awidgets[0]
 
//
 
// mainly applicable for v-stacked widgets since h-stacked may overlap after such alignment
 
//
 
        // returns the reference point ( the coord of awidgets[0] )
 
function alignx(const mode: widgetalignmodety;
 
                        const awidgets: array of twidget): integer;
 
  
 +
image:
 +
see <any image>
  
// if {mode <> wam_none} then (re)arranges "awidgets" vertically within the parent's client area so that
+
options:
// awidgets[0] stays on its place but awidgets[1..N] :  
 
// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_top" set ) so that they bottom borders match the bottom border of awidgets[0]
 
// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_bottom" set ) so that they top borders match the top border of awidgets[0]
 
// - if {mode = wam_center} then awidgets[i>=1] move so that they X-axes match the X-axe of awidgets[0]
 
//
 
// mainly applicable for h-stacked widgets since v-stacked may overlap after such alignment
 
//
 
        // returns the reference point ( the coord of awidgets[0] )
 
function aligny(const mode: widgetalignmodety;
 
                        const awidgets: array of twidget): integer;
 
  
function actualcursor: cursorshapety; virtual;
+
        *** The fade colors are used not as colors but RGB alpha values ($00 -> opaque, $ff -> transparent)
 +
if fao_alpha* are set *** :
  
 +
fao_alphafadeall = applies blending to the widget & all its children
 +
fao_alphafadenochildren = preserves child widgets from blending
 +
                fao_alphafadeimage = applies blending to "face.image"
  
Event handlers:
 
  
- onactivate
+
<any face>
  
fires :
+
*** extends & customizes "tfacecomp" ***
  
= on receiving input focus, just before "OnFocus"
+
fade, image, option
+
- see "tfacecomp"
= forms specific :
+
* on 1-st display of the form after "OnLoaded" ( from "Loaded" procedure)
+
template
* on switch back from another apllication/WM ( "oe_activate" event )
+
- "tfacecomp" supplying the initial settings
* after closure of a descendant form
 
* on minimizing/maximizing the form
 
  
- onchildscaled
+
localprops :
 
+
fal_options - "options" overrides "template.options"
fires :
+
fal_fadirection - "fade.direction" overrides "template.fade.direction"
 +
fal_image - "image" overrides "template.image"
 +
fal_fapos - "fade.pos[i]" overrides "template.fade.pos[i]"
 +
fal_facolor - "fade.color[i]" overrides "template.fade.color[i]"
 +
fal_fatransparency - "fade.transparency" overrides "template.fade.transparency"
 +
</pre>
  
= on child(s) resizing due to font height change
+
=== TBitmapComp ===
 +
=== TScalingwidget ===
 +
<pre>
 +
  optionsscale :
 +
autosizing to provide room for :
 +
= {"frame.caption" + "offset_*"}
 +
= "offset_*" if "frame.caption" is unset and "osc_shrink*" is set
 +
 +
= osc_expandx
 +
- makes the widget wider to fit the caption if needed
  
= form widget: once "form.container" {scrolling widget} is loaded
+
= osc_shrinkx
 +
- makes the widget narrower to have no space left & right to the "frame.caption"
  
- ondeactivate
+
= osc_expandy
fires
+
- makes the widget taller to fit the caption if needed
= form widget: when the form looses input focus
 
= non-form widget: when the widget looses input focus
 
  
- ondefocus
+
= osc_shrinky
 +
- makes the widget lower to have no space up & down to the "frame.caption"
  
fires
+
= osc_invisishrinkx
= on disabling the widget
+
- fully h-collapses if "visible=false" ( run-time only )
  
*mse = form widget: if another form is focused
+
= osc_invisishrinky
= non-form widget: if another widget is focused
+
- fully v-collapses if "visible=false" ( run-time only )
  
- onenter
+
</pre>
= fires on any way of taking parent-wide focus as soon as
 
the parent stores the new child's order, before "OnActivate" & "OnFocus"
 
  
- onexit
+
=== TImageList ===
= fires last on parent-wide lossing focus, after "OnDefocus" & "OnDeactivate"
+
=== TPopupMenu ===
= for top-level ( not in a container ) forms, doesn't fire
+
=== TMainMenu ===
  
- onfocus
+
== Dialog ==
fires
+
=== TFileListview ===
= once the existing widget takes the focus
+
=== TFileDialog ===
= on showing the widget's form if the widget has the lowest "TabOrder"
+
=== TFaceComp ===
 +
=== TFileNameEdit ===
 +
=== TDirDropdownEdit ===
 +
=== TColorEdit ===
 +
=== TMemoDialogEdit ===
 +
=== TPageSizeSelector ===
 +
=== TPageOrientationSelector ===
  
- onfontheightdelta
+
== Application ==
fires
+
=== TGuiApplication ===
= if [ow_fontglyphheight OR ow_fontlineheight ] AND {the
+
<pre>
new font height differs from the previos one}
+
tguiapplication = class(tcustomapplication)
= before the parent redraws this widget
+
  public
  
- onpopup
+
  // [re]starts the system timer with the new period and
fires :
+
  // subscribes the application to be a receiver of the modified "ek_timer" event
= on calling a popup-menu ( with "RightClick" ), once the menu items of the current level are loaded
+
  // ( can check for it in the event queue )
( before building the submenus )  
+
  procedure settimer(const us: integer);
  
- onresize
+
  // finds a window by its winID
 +
  function findwindow(id: winidty; out window: twindow): boolean;
  
= fires on creating/(changing size)/(min-max restoring) of widget,
+
  // finds a window by its ID & adjusts "rect" so that it
before actual redrawing
+
  // fits "bounds_minc*" & "bounds_maxc*" of the found window
 +
  procedure checkwindowrect(winid: winidty; var rect: rectty);
  
= rechecks if there's real work to do
+
  // initialises the timer and "megraphics"
 +
  procedure initialize;
  
- onshowhint
+
  // frees the allocated system resources (GDI, event subscription, the timer)
= fires when a installed hint is activated or on "aplication.showint" called
+
  procedure deinitialize;
= since called last, allows to adjust the default behavior
 
  
- onbeforeupdateskin
+
  // creates a form instance, it will be shown in "application.run"
= fires in "updateskin" ( the widget is loaded etc ) before applying the skin
+
  procedure createform(instanceclass: widgetclassty; var reference);
  
- onafterupdateskin
+
  // invalidates all registered forms ( all their widgets will be redrawn )
= fires in "updateskin" ( the widget is loaded etc ) once the skin is applied
+
  procedure invalidate;
 +
 
 +
  // calls a nested main event loop, forces processing any pending messages,
 +
  procedure processmessages; override; //handle with care!
  
<pre/>
+
  // TRUE if no pending events to process for the application
 +
  function idle: boolean; override;
 +
 
 +
  // requests to indicate waiting ( to show the "watches" cursors )
 +
  procedure beginwait; override;
  
== NoGui ==
+
  // removes the "watches" if no unclosed requests for displaying them,
=== TAction ===
+
  // otherwise closes the currently active request
<pre>
+
  procedure endwait; override;
Shortcut processing order :
 
  
- the smallest piece of processing is "doshortcut" procedure which
+
  // TRUE if there are unclosed requests for displaying "watches"
is called until processed:
+
  function waiting: boolean;
= starting from the sender up to the toplevel widget
 
= then by all child widgets with non-set "ow_noparentshortcut"
 
= then, if "ow_nochildshortcut" isn't set, by the parent widget
 
= then by the widget oneself
 
 
- "doshortcut" is checked in the following order:
 
= starting from form's main menu
 
= then from the owning window ( the widget oneself )
 
= then from the application
 
  
 +
  // TRUE if ESC has just been pressed
 +
  //  - if all requests for displaying "watches" are closed then refreshes
 +
  //    the internal list of events ( the GUI-queue -> the app event list)
 +
  function waitescaped: boolean; //true if escape pressed while waiting
  
*** A shortcut is bound to a widget by :
+
  // sets state of the current wait dialogue ( but doesn't close one ) to undefined
- placing an action component on the widget ***
+
  procedure resetwaitdialog; 
- direct assigning the shortcut to the widget (menus,..)  
 
---------------------------
 
  
caption, color, colorglyph, helpcontext, hint, imagecheckedoffset,
+
  // runs "aexecuteaction" in the main thread in OnIdle mode,
imagelist <see "timagelist">, imagenr, imagenrdisabled
+
  // then shows a cancellable message,
 +
  // if the one is cancelled then runs "acancelaction" then
 +
  // either fully clears (if exceptions occur )
 +
  // or terminates the execution otherwise,
 +
  // true if not cancelled;
 +
  // "application.processmessages" must be called regularly if "aexecuteaction" is used here,
 +
  // alternatively "aidleaction" can be used, call sleep ( some time ) in order to minimize
 +
  // processor load.
 +
  // If athread <> nil the function starts and terminates the thread   
 +
  function waitdialog(const athread: tthreadcomp = nil; const atext: msestring = '';
 +
                  const caption: msestring = '';
 +
                  const acancelaction: notifyeventty = nil;
 +
                  const aexecuteaction: notifyeventty = nil): boolean; override;
  
- sets look of "clients" (buttons, menu/toolbar items,..), unless
+
  // closes the currently modal waitdialogue with "cancelled" state
these clients have "state.as_local*" set :
+
  procedure cancelwait;
  
*** For meaning of these options, see help on the "client" widgets ***
+
  // closes the currently modal waitdialogue with "ok" state
 +
  procedure terminatewait;
  
group
+
  function waitstarted: boolean;  // the last waitdialogue is currently showing for some requests
- default value for one-named property of the bound widgets
+
  function waitcanceled: boolean;  // the last waitdialogue has been cancelled for some request (but can be shown fot others ?)
( menu items,... )
+
  function waitterminated: boolean; // the last waitdialogue has been terminated for some request (but can be shown fot others ?)  
  
options :
+
  // if called from the main app thread then shows as a modal message describing the exception
ao_updateonidle
+
  // otherwise posts an async event for which the message will be called
- runs this action in cycle, waiting for no gui events everytime
+
  procedure showexception(e: exception; const leadingtext: string = ''); override;
  
ao_globalshortcut
+
  // posts an async event for which the message describing the exception will be called
- allows the action to trigger on a non-main form
+
  procedure showasyncexception(e: exception; const leadingtext: string = '');
  (the shortcut is triggered whatever form of the applicatin it was pressed on,
 
  otherwise only when the form where the aption is placed on is focused )
 
  
ao_nocandefocus
+
  // "application.errormessage" shows standard error message ( with "ERROR" title )
- causes the action not to call "CanDefocus" for focused edit widget of active form
+
  procedure errormessage(const amessage: msestring); override;
  before executing own code
 
  ( it helps to avoid the effect of cancelling changes in these widgets
 
  on activating the bound shortcut )
 
  
shortcut
+
  // [re]calculates timings & position of hint for "ahintedwidget"
- keyboard combination triggering the action
+
  // if "ow_timedhint" in "ahintedwidget.foptionswidget" then iys showtime will be
 +
  // "defaulthintshowtime" ( an app wide setting, 3sec by default) 
 +
  procedure inithintinfo(var info: hintinfoty; const ahintedwidget: twidget);
  
shortcut
 
- alternative "shortcut" and handled identically
 
  
state :
+
  // shows the supplied hint text within "aposrect" with alignment "aplacement" during "ashowtime",
 
+
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
as_disabled
+
  procedure showhint(const sender: twidget; const hint: msestring;
- prevents the action from triggering, also puts the bound widgets to "disabled" look
+
              const aposrect: rectty; const aplacement: captionposty = cp_bottomleft;
 +
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
 +
                // -1 defaultshowtime if ow_timedhint in sender.optionswidget
 +
              const aflags: hintflagsty = defaulthintflags
 +
                      ); overload;
 +
 
 +
  // shows the supplied hint text at left-top position"apos" during "ashowtime",
 +
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
 +
  procedure showhint(const sender: twidget; const hint: msestring;
 +
              const apos: pointty;
 +
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
 +
                // -1 defaultshowtime if ow_timedhint in sender.optionswidget
 +
              const aflags: hintflagsty = defaulthintflags
 +
                      ); overload;
  
as_invisible
+
  // shows the hint fully defined in "info" for the widget "sender"
- in run-time, hides the bound widget, still reacting on the shortcut or direct call
+
  procedure showhint(const sender: twidget; const info: hintinfoty); overload;
  
as_checked
+
  // removes the current hint widget & frees its resources & stops its stop timer
- selects the bound menu item if it has "mao_checkbox" option set
+
  procedure hidehint;
  
as_default
+
  // restarts the current hint and its stop timer
as_local*
+
  procedure restarthint(const sender: twidget);
  
statfile
+
  function hintedwidget: twidget; //last hinted widget
<see "tstatfile">
+
  function activehintedwidget: twidget; //nil if no hint active
  
stavarname
+
  // returns helpcontext of active widget, '' if none; 
 +
  function activehelpcontext: msestring;
  
+
  // returns helpcontext of the widget under mouse, '' if none;
tagaction
+
  function mousehelpcontext: msestring;
onasyncevent
 
onchange
 
onexecute
 
onupdate
 
<pre/>
 
  
=== TActivator ===
+
  // TRUE if one of the app's window/console is in input focus
=== TThreadComp ===
+
  function active: boolean;
=== TStatFile ===
 
- so that to be in effect, it should also be assigned to the form where the widget using the stafile is placed on
 
- in design, if "onstatwrite" is set and "filedir" is not yet created, deactivate exception "ECreateError" in project settings ( "Debugger" tab )
 
- "filedir" may contain "~/" indicating the user's home directory
 
- options "oe_savestate" & "oe_savevalue" of "client" widgets define what to store to the file
 
- position etc changes or/and value changes
 
- in case when a main form shares its stafile with non-main forms, on creating non-main ones, just edited not saved data of the main form ( bound to vars of the statfile) are reset to values read from the statfile upon creating the form; for "sfo_memory", this effect absents unless widgets on the concurring forms share same variable[s]; to avoid this behaviour, disable "fo_autoreadstat" & "fo_autowritestat" of the non-main forms
 
- each "tstafile" owns:
 
= tstatwriter:
 
* provides methods of writing sections & statvars to a memory/file stream
 
- tstatreader:
 
* holds list of sections with statvars each
 
* provides search & check & reading interface to the statvars
 
* provides reading statvars from a memory/file stream
 
  
Positioning to a section speeds up accessing its statvars
+
  // returns the desktop resolution ( or the virtual one if used )
 +
  function screensize: sizety;
  
- there also is "tstatfiler" ( exposed by some "tstatfile" events ) which:
+
  // returns the (virtual) desktop resolution except the tray area,
= may present or "tstatwriter" or "tstatreader" ( there's a check method )
+
  // nil -> current active window
= provides directionless "update" methods with internal switch to needed direction of processing
+
  function workarea(const awindow: twindow = nil): rectty;
- "reading" or "writing" statvars on per-section basis
 
  
=== TTimer ===
+
  // returns which application window ( a form not an eventwidget, an openglwidget or a windowwidget !)
=== TNoGuiAction ===
+
  // is active ( provides the input focus ),
=== TPipeReadercomp ===
+
  // it's same for all widgets of the form served by this window
=== TSysEnvManager ===
+
  function activewindow: twindow;
=== TProcessMonitor ===
+
 
=== TFilechangeNotifier ===
+
/ * A transient window is a descendant of ( "transientfor" ) another window in the stacking order hierarchy */
=== TShortCutController ===
+
 
=== TPostscriptPrinter ===
+
  // returns a first non-transient ( on top of the app stacking order ) window upward
=== TGdiPrinter ===
+
  // from the currently active window of the application.
=== TWmfPrinter ===
+
  // or that active window if no such
=== TSkinController ===
+
  function regularactivewindow: twindow;
=== TGuiThreadComp ===
+
 
 +
  // same as "activewindow" but the window must not be released (?)
 +
  function unreleasedactivewindow: twindow;
  
== Font ==
+
  // returns the focused widget of the currently active window if one exists
=== Any Font ===
+
  function activewidget: twidget;
<pre>
+
 
    charset { ANSI/ DEFAULT/ SYMBOL /SHIFTJIS /HANGEUL /GB2312 /CHINESEBIG5 /OEM
+
  // returns the widget presenteing the currently active window
/JOHAB / HEBREW/ ARABIC/ GREEK/ TURKISH/ VIETNAMESE/ THAI/ EASTEUROPE/
+
  function activerootwidget: twidget;
RUSSIAN/ MAC/ BALTIC }
+
 
- changes the font to the nearest containing the selected encoding(charset)
+
  // returns the window ( not hidden or disabled !) under the screen point "pos"
- no font change made if the supplied encoding doesn't match any font
+
  function windowatpos(const pos: pointty): twindow;
color
+
 
- color of the glyphs contours
+
  // puts to "awidget" the container of widget pointed by "namepath"
colorbackground
+
  // ( finalizing "." is discarded if found ) ,
- fill color of the glyph cells ( not including extraspace )
+
  // FALSE if not found, and NIL and TRUE if "namepath" = ''
colorshadow
+
  function findwidget(const namepath: string; out awidget: twidget): boolean;
- color of SE glyph "edges" ( if not "cl_none", deactivates "colorbackground" )
+
 
extraspace
+
  // rebuilds the application's window list accorrding to the current on-screen Z-order of its windows;
- v-space between glyph cells of adjacent text rows (negative values cause the cells to overlap )
+
  // window list is ordered by "z" - bottom first & top last;
height
+
  // invisibles first
- v-size of glyph cells, in pixels
+
  procedure sortzorder;
name
+
 
- initially, font is choosen by { "family" = this name }
+
  // returns a copy of the internal window list of application
options:
+
  function windowar: windowarty;
foo_fixed
 
- changes the font to the nearest "mono" spaced (usually = Courier)
 
foo_proportional
 
- changes the font to the nearest "proportionally" spaced (usually = Helvetica)
 
foo_helvetica
 
- changes the font to the nearest in "sans" category (usually = Helvetica)
 
foo_roman
 
- changes the font to the nearest in "serif" category (usually = Times[ New Roman])
 
foo_script
 
- Win32 only, changes the font to the nearest in "script" category
 
foo_decorative
 
- Win32 only, changes the font to the nearest in "decorative" category
 
foo_antialiased
 
- Linux-only, enables antialiasing (if disabled by Xft globally)
 
foo_nonantialiased
 
- Linux-only, disables antialiasing (if enabled by Xft globally)
 
usually making glyph extents (not cells !) a bit wider
 
style:
 
fs_bold
 
- gives the font a "bold" look
 
fs_italic
 
- gives the font an "italic" look
 
fs_underline
 
- gives the font an "underlined" look
 
fs_strikeout
 
- gives the font a "striked out" look
 
fs_selected
 
- "TRUE" here combined with {tf_noselect:=FALSE}, causes the text described by this font
 
to be initially selected ( with the clipboard operations available ),
 
currently applicable only to richstrings
 
  
width
+
  // returns the list of application window winIDs
- 10*{ glyph cell width, average in pixels }, 0 = {font default}
+
  function winidar: winidarty;
  
xscale
+
  // returns the count of the application windows   
- width ratio of each glyph {cell & contour}, the effect is similar to "width"
+
  function windowcount: integer;
  
*** "foo_*" font selection overrides one made with "name"  
+
  // returns the window by its number ( "index" >= 0) in the application window list
 +
  property windows[const index: integer]: twindow read getwindows;
  
*** if change with "foo_*" is usuccessful then the nearest "sans" font is usually choosen
+
  // returns the lowest visible window in stackorder,
 +
  // calls "sortzorder" within
 +
  function bottomwindow: twindow;
  
*** The categories :
+
  // returns the highest visible window in stackorder,
 +
  // calls "sortzorder" within
 +
  function topwindow: twindow;
  
sans => have no serifs and have strokes of even thickness
 
serif => have serifs at glyph contours and made up of strokes of varying thickness
 
script => resemble handwriting
 
decorative => flashy styles to be used sparingly in headlines or posters
 
  
<pre/>
+
  // TRUE if all owned windows pass "CanClose" check or
 +
  // don't have focused widgets
 +
  function candefocus: boolean;
  
== GUI ==
+
  // subscribes the handler "method" to receive keyboard events
=== TWindow ===
+
  procedure registeronkeypress(const method: keyeventty);
<pre>
 
twindow = class(teventobject,icanvas)
 
  public
 
  
// releases mouse, unlinks from the canvas, processes all pending events of the window
+
  // unsubscribes the handler "method" from receiving keyboard events
// if called from within main thead then destroys the window directly
+
  procedure unregisteronkeypress(const method: keyeventty);
// otherwise posts a window destroy event for oneself and waits for it to be processed
 
procedure destroywindow;
 
  
// registers the instance of onself in the "owner" widget, allocates the canvas,
+
  // subscribes the handler "method" to receive shortcut events
// adds a reference to oneself,
+
  procedure registeronshortcut(const method: keyeventty);
// then prepares the "owner" hierarchy to be invalidated ( "owner.rootchanged" )
 
// since now, the window is allocated and belongs to the "aowner" widget
 
constructor create(aowner: twidget);
 
  
destructor destroy; override;
+
  // unsubscribes the handler "method" from receiving shortcut events
 +
  procedure unregisteronshortcut(const method: keyeventty);
  
// adds "method" to the internal list of scroll dependants
+
  // subscribes the handler "method" to receive "OnWindowActiveChanged" event ( form-wide )
procedure registeronscroll(const method: notifyeventty);
+
  procedure registeronactivechanged(const method: activechangeeventty);
 +
 
 +
  // unsubscribes the handler "method" from receiving "OnWindowActiveChanged" event ( form-wide )
 +
  procedure unregisteronactivechanged(const method: activechangeeventty);
  
// removes "method" from the internal list of scroll dependants
+
  // subscribes the handler "method" to receive "OnDestroyed" events ( form-wide )
procedure unregisteronscroll(const method: notifyeventty);
+
  procedure registeronwindowdestroyed(const method: windoweventty);
  
// releases mouse if captured, resets the cursor, then enters an event loop for the window,
+
  // unsubscribes the handler "method" from receiving "OnDestroyed" events ( form-wide )
// TRUE on return if the window is destroyed
+
  procedure unregisteronwindowdestroyed(const method: windoweventty);
function beginmodal: boolean;
 
 
  * checks if the "sender" window is already modal to avoid circularity,
 
    if not then starts an event loop  for the "sender" where the "sender" is a receiver of GUI events,
 
      once the loop is terminated reactivates the previously active window if it was,
 
    TRUE if modalwindow destroyed 
 
  
  function tinternalapplication.beginmodal(const sender: twindow): boolean;
+
  // subscribes the handler "method" to receive "OnWindowDestroyed" events ( form-wide )
 +
  procedure registeronwiniddestroyed(const method: winideventty);
  
// removes the internal stuff which indicates the modal state
+
  // unsubscribes the handler "method" form receiving "OnWindowDestroyed" events ( form-wide )
procedure endmodal;
+
  procedure unregisteronwiniddestroyed(const method: winideventty);
  
// if the window is visible,
+
  // subscribes the handler "method" to receive "ApplicationActiveChanged" events ( form-wide )
// deactivates the previously active window, shows the window (see below),
+
  procedure registeronapplicationactivechanged(const method: booleaneventty);
// if no active window in the app or the window or its Z-predescessor is modal and
 
// the app has no focused widget then prepares the bound widget to be focused,
 
// then addresses the WM to put the window to foreground
 
procedure activate;
 
  
  // if the bound widget has visible=true then:
+
  // unsubscribes the handler "method" from receiving "ApplicationActiveChanged" events ( form-wide )
  //  - if NOT windowevent then :
+
   procedure unregisteronapplicationactivechanged(const method: booleaneventty);
  //   = address the WM to set size of the window acc to window opts
+
 
  //      wp_maximized, wp_fullscreen or normal size otherwise
+
// tcustomapplication
  // = if the window is normally sized, moves it to its default position is specified ( screen centered etc )
 
  // - unhides/unminimizes the window if needed
 
  // - shows other windows of the applications acc to state of the window group
 
  // ( in normal size or minimized )
 
  
  private
+
  // subscribes the handler "method" to receive "OnTerminated" event ( form-wide )
procedure twindow.show(windowevent: boolean);
+
  procedure registeronterminated(const method: notifyeventty);
  
// TRUE if this window currently grabs user input
+
  // unsubscribes the handler "method" from receiving "OnTerminated" events ( form-wide )
( a widget drawn within the window(=form) is in focus,.. )
+
  procedure unregisteronterminated(const method: notifyeventty);
function active: boolean;
 
  
// if the window was active then deactivates the window  & remembers it as the previous active ( to restore leater if requested ),
+
  // subscribes the handler "method" to receive "OnTerminateQuery" event ( form-wide )
// returns TRUE if that storage occured
+
  procedure registeronterminate(const method: terminatequeryeventty);
function deactivateintermediate: boolean;  
 
  
// makes the window active & clears the above app reference to it ( "active before deactivating" )
+
  // unsubscribes the handler "method" from receiving "OnTerminateQuery" event ( form-wide )
procedure reactivate; //clears app.finactivewindow
+
  procedure unregisteronterminate(const method: terminatequeryeventty);
  
// scans the app event queue for "ek_expose" event[s] addressed to the window,
+
  // subscribes the handler "method" to receive "OnIdle" event ( form-wide )
// if found then redraws that part of the window which the event describes
+
  procedure registeronidle(const method: idleeventty);
// ( processed events are then deleted )
 
procedure update;
 
  
// TRUE if the window :
+
  // unsubscribes the handler "method" from receiving "OnIdle" events ( form-wide )
// 1) doesn't have an inner widget grabbing input focus
+
  procedure unregisteronidle(const method: idleeventty);
// or
+
 
// 2) has such widget, and this widget ( and all its descendants )  
+
  // calls "canclose" of all application windows except the "sender" window
//   pass "CanClose" check
+
  // if all "canclose"are TRUE then checks "OnTerminateQuery"
//
+
  // for all its subscribers ( usually forms of the application )
// *** see also "twidget.CanClose" ***
+
   procedure terminate(const sender: twindow = nil);
//
+
 
function candefocus: boolean;
+
  // TRUE as long as a "terminate" call is in progress
 +
  function terminating: boolean;
  
// tries to defocus the currently focused widget if it belongs to the window,
+
  // TRUE as long as a "deinitialize" call is in progress
// if succeeds then executes code of virtual "DoDefocus" of the widget descessor
+
  function deinitializing: boolean;
// ( this code defines behaviour & look of the widget on defocusing );
 
//
 
// no defocusing is done if the focused widget ( or its descendants )
 
// doesn't pass "CanClose" check
 
//
 
procedure nofocus;
 
 
    
 
    
  // setfocusedwidget(widget)
+
  // returns the current caret object ( the text input focus indicator ) of the application
    
+
   / ( this object provides facilities to control position & appearance & visibility & timings of the caret )
   property focuscount: cardinal read ffocuscount;
+
   property caret: tcaret read fcaret;
  function close: boolean; //true if ok
+
 
   procedure beginmoving; //lock window rect modification
+
   // returns the current mouse object of the application
   procedure endmoving;
+
   / ( this object provides facitities to control position & appearance of the mouse )  
  procedure bringtofront;
+
   property mouse: tmouse read fmouse;
  procedure sendtoback;
 
  procedure stackunder(const predecessor: twindow);
 
      //stacking is performed in mainloop idle, nil means top
 
  procedure stackover(const predecessor: twindow);
 
      //stacking is performed in mainloop idle, nil means bottom
 
   function stackedunder: twindow; //nil if top
 
  function stackedover: twindow;  //nil if bottom
 
  function hastransientfor: boolean;
 
  
   procedure capturemouse;
+
   // simulates mouseparkevent
   procedure releasemouse;
+
   // ( an adjusting mouse movement without user intervention - grid snapping, docking etc ?)
   procedure postkeyevent(const akey: keyty;
+
   procedure mouseparkevent;
        const ashiftstate: shiftstatesty = []; const release: boolean = false;
 
                  const achars: msestring = '');
 
  
   function winid: winidty;
+
   // sets mouse position correction for further mouse events,
  function haswinid: boolean;
+
   // the real position is less the visual one by the supplied shift
   function state: windowstatesty;
+
   procedure delayedmouseshift(const ashift: pointty);
  function visible: boolean;
 
  function activating: boolean; //in internalactivate proc
 
  function normalwindowrect: rectty;
 
  property updateregion: regionty read fupdateregion;
 
   function updaterect: rectty;
 
  
   procedure registermovenotification(sender: iobjectlink);
+
   // returns/sets a cursor shape used for widgets having their cursor shape set to "cr_default";
   procedure unregistermovenotification(sender: iobjectlink);
+
  // setting it to "cr_default" restores the individual widget cursor(s)
 +
   property widgetcursorshape: cursorshapety read fwidgetcursorshape write
 +
                                        fwidgetcursorshape;
  
   property options: windowoptionsty read foptions;
+
  // returns/sets the current application-wide cursor shape ( not "watches" if a waiting dialog is currently displayed ! )
 +
  // or request to set a new cursor shape ( app-wide );
 +
  // doesn't change when changing mouse widgets
 +
  //
 +
  // if called from a non-main app thread & no waiting dialogue displayed then redraws
 +
  // the cursor immediately;
 +
  // set it to "cr_default" to restore the shape to one set by "widgetcursorshape"
 +
  //
 +
   property cursorshape: cursorshapety; // cr_arrow, cr_*
  
// widget  
+
  // assures the displayed mouse cursor shape to be the shape assigned to the currently under-mouse widget,
property owner: twidget read fowner;
+
  // otherwise "cr_default"
 +
  procedure updatecursorshape; //restores cursorshape of mousewidget
  
   property focusedwidget: twidget read ffocusedwidget;
+
   // returns a widget of the application where the mouse is currently positioned over
   property transientfor: twindow read ftransientfor;
+
   property mousewidget: twidget read fmousewidget;
  property modalresult: modalresultty read fmodalresult write setmodalresult;
 
  property buttonendmodal: boolean read getbuttonendmodal write setbuttonendmodal;
 
  property globalshortcuts: boolean read getglobalshortcuts write setglobalshortcuts;
 
  property localshortcuts: boolean read getlocalshortcuts write setlocalshortcuts;
 
  property windowpos: windowposty read getwindowpos write setwindowpos;
 
  property caption: msestring read fcaption write setcaption;
 
  
 +
  // returns a widget of the application currently "owning" the mouse ( grabbing all mouse input )
 +
  property mousecapturewidget: twidget read fmousecapturewidget;
  
windowoptionty = (wo_popup,wo_message,wo_buttonendmodal,wo_groupleader,
 
                  wo_windowcentermessage); //showmessage centered in window
 
  
 +
  // returns/sets a window to become the main window of the application
 +
  // then resets all other application windows to the window group it belongs to ( Linux only );
 +
  //
 +
  // the main window minimizes all windows if minimized;
 +
  property mainwindow: twindow read fmainwindow write setmainwindow;
  
optionswindow:
+
  // returns which system thread was allocated to the application on its start
wo_popup
+
  // ( the main thread )
- in run-time, hides all OS windows-manager ( WM ) decorations (title bar, buttons "Close/Resize,Min/Max" etc),
+
  property thread: threadty read fthread;
letting only its client area to appear
+
 
so :
+
  // returns teh widget where a mouse button click occured last time
= the window should have own facilities to replace the deactivated WM functionality if needed
+
  // ( to compare with when determinibg whether another widget is clicked )
= can't be resized/maximize/minimized/moved
+
  property buttonpresswidgetbefore: twidget read fbuttonpresswidgetbefore;
wo_message
 
- similar to "wo_popup" but allows WM to close ( with "Close" button ) & move the window
 
  
wo_groupleader
+
  // returns teh widget where a mouse button release occured last time
- keeps on the WM taskbar a shortcut to the window
+
  // ( to compare with when determinibg whether another widget is clicked )
( if the parent window is a groupleader too then dislpays a step upper in its group )
+
  property buttonreleasewidgetbefore: twidget read fbuttonreleasewidgetbefore;
  
Event handlers:
 
  
- onmove
+
  // returns/sets the interval of mouse double click recognition ( in microsecs ),
= fires once the (window/widget) is created/moved ( with check if really moved by a distance)
+
  // defaults to 0.4 sec
 +
  property dblclicktime: integer read fdblclicktime write fdblclicktime default
 +
                defaultdblclicktime; //us
  
<pre/>
+
// tcustomapplication
=== TFaceList ===
 
=== TFrameComp ===
 
 
Terminilogy :
 
  
{client area = area of the widget which interacts with a user}
+
  // creates a datamodule instance ( its startup code including "OnLoaded" is executed )
 +
  procedure createdatamodule(instanceclass: msecomponentclassty; var reference);
  
{bevelling = additional facets rising/sinking frame & client area,
 
constists of two parts -
 
- external: between frame and widget
 
- internal: between frame and client area
 
}
 
  
{frame= flat space between external & internal facets,
+
  // enters the application event loop;
floats at the inner level of the external facet
+
  //
}
+
  // once the loop finishes, performs "OnTerminated" for all its subscribers,
 +
  // destroys all application forms ( components & windows )
 +
  procedure run;
  
*** Both frame & bevelling affect the client area ***
+
  // TRUE if the eventloop is entered
 +
  function running: boolean;
  
--------------------------
+
  // returns/sets the application name
template:
+
  // ( defaults to the full path to application executable in the native OS format );
 +
  // currently, only for informatiion query purposes
 +
  property applicationname: msestring read fapplicationname write fapplicationname;
 +
 
  
colorclient = color of the client area
+
  // if exclusive "rights" are satisfied for the main thread ( a mutex lock is OK )  & the event loop is in progress
 +
  // then posts the "event" to the main application thread for asyc processing,
 +
  // otherwise adds the event to the internal list for further handling as soon as the above conditions meet
 +
  procedure postevent(event: tevent);
  
colorframe = color of the frame
+
  // TRUE if never idle since last call,
colorframeactive = used instead of colorframe if the widget is
+
  // unlocks the application and calls sleep if not mainthread and asleepus >= 0
active; "cl_default" means same as colorframe.
+
  function checkoverload(const asleepus: integer = 100000): boolean;
  
works if (leveli/levelo <> 0 that's the facets exist :
+
  // returns/sets the application exception handler
 +
  property onexception: exceptioneventty read fonexception write fonexception;
  
colorshadow = color of facets screened from the NW light source
+
  // if not "eabort" & no unhandled exceptions,
colordkshadow = color of shadows dropped by the NW light source
+
  // executes the above "OnException" code if assigned
                colordkwidth = width of the shadows in pixel, -1=default
+
  // or shows an exception message otherwise;
 +
  procedure handleexception(sender: tobject = nil;
 +
                                      const leadingtext: string = '');
  
colorlight = color of facets exposed to the NW light source
+
  // synchronizes the calling thread with the main event loop ( via a mutex),
colorhighlight = color of brighter edges of the facets
+
  // TRUE if the calling thread allready holds the mutex,
                colorhlwidth = width of the brighter edges in pixel, -1=default
+
  // the mutex is recursive
 +
  function lock: boolean;
  
        extraspace = if applied to menu items, adds more space between these items
+
  // tries to synchronize the calling thread with the main event loop ( via a mutex)
 +
  function trylock: boolean;
  
framei_:
+
  // releases the mutex if the calling thread holds the mutex,
(for extendable widgets like menus, these settings widen the widget,
+
  // TRUE if no unlock done
for non-extendable like buttons - they squeeze the text area )
+
  function unlock: boolean;
  
bottom= lower margin of text to the client area
+
  // releases the mutex recursively if the calling thread holds the mutex,
left = left margin of text to the client area
+
  // returns "count" for the below "relockall"
right = margin of text to the client area
+
  function unlockall: integer;
top = upper margin of text to the client area
 
  
framewidth= width of the frame
+
  // regains the mutex to serve "count" locks
leveli = {width=height} of the internal facet, positive -> raised, negative -> sunken
+
  procedure relockall(count: integer);
levelo = {width=height} of the external facet, positive -> raised, negative -> sunken
 
  
<any frame>
+
  // creates a syncronize event ( which will fire asyncronously then waits for another thread will allow it to finish ), assigns "proc" to it as the event handler,
 
+
  // then frees all locks temporarily then posts the event to the app event queue & waits fot it to be processed the resores the locks;
*** extends & customizes "tframecomp" ***
+
  //
 +
  // TRUE if not aborted, quiet -> shows no exceptions if occurs
 +
  //
 +
  // the "syncronize event" is an event owning a semaphore which can be touched by another thread
 +
  // thus causing "event.waitfo" to return & to exec the event handler code
 +
  //
 +
  function synchronize(const proc: objectprocty;
 +
                      const quite: boolean = false): boolean;
  
template
+
  // TRUE if the calling ( this function ) thread is the application main thread
- "tframecomp" supplying the initial settings
+
  function ismainthread: boolean;
  
colorclient,colordkshadow,colordkwidth,colorframe,colorframeactive,
+
  // TRUE if the currently locked thread is the application main thread
colorhighlight,colorhlwidth,colorlight,colorshadow,framewidth,
+
  function islockthread: boolean;
leveli, levelo, framei_*,
 
  
<see "tframecomp">
+
  // waith for "athread" to terminate,
 +
  // does "unlock-relock" around waiting
 +
  procedure waitforthread(athread: tmsethread);
  
font
+
  // post a "nothing-to-do" event for asynchronous processing in the main thread
<see "tfont">
+
  procedure wakeupmainthread;
  
caption
+
  // invalidates all registered forms of the application so that their widgets redraw land-specific captions
- some descriptive text( function name, user prompt,...) placed
+
  // ( changed by "mseconsts.setlangconsts" ),
in a N/W/S/E-combination to the widget's client area
+
  // called internally in "setlangconsts" before return
 +
  procedure langchanged; virtual;
  
***
+
  // returns/sets "aps_terminated" state flag ( no actions ? )
non-empty caption if (captionpos <> cp_center) & (captiondistouter=false & captiondist>0) enlarges the framed widget
+
  // this flag is also set internally by "terminate" if not cancelled
by the corresponding size of caption
+
  property terminated: boolean read getterminated write setterminated;
  
***
+
  // returns the number of "handleexception" calls having an effect ( a message or the handler code )
 +
  property exceptioncount: longword read fexceptioncount;
  
captiondist - margin between the caption & the client area
 
  
captiondistouter :
+
private
 +
// function tinternalapplication.beginmodal(const sender: twindow): boolean;
  
- if "false"(by default), the distance is measured between
+
</pre>
the inner (facing the client area) extent of the caption
 
and the client area outward the area,
 
the caption is placed outside of the client area
 
  
- if "true", the caption is mirrored against the edge of client area as
+
== DB ==
to the position when "false"
 
  
*** nagative values of "captiondist" visually inverse "out of" and within ***
+
=== DBedit ===
 +
=== DBfields ===
 +
=== TDBwidgetgrid ===
 +
<pre>
 +
  Properties:
  
      captionnoclip - do not clip frame and client area for caption background
+
        anchors - ...
( the client area preserves own background under the caption text)
+
bounds - ...
  
captionnooffset - shift orthogonal to "captiondist"
+
color
 +
- color of the grid's client area
 +
cursor
 +
- cursor shape when the mouse is over the client area
  
captionpos - "corner" where to place the caption
+
datacols
 +
colorselect
 +
linecolor
 +
linecolorfix
 +
linewidth
 +
newrowcol
  
localprops :
+
options
 +
co_readonly
 +
co_nofocus
 +
co_invisible
 +
co_disabled
 +
co_drawfocus
 +
co_mousemovefocus
 +
co_lefbuttonfocusonly
 +
co_focusselect
 +
co_mouseselect
 +
co_keyselect
 +
co_multiselect
 +
co_resetselectionexit
 +
co_rowselect
 +
co_fixwidth
 +
co_fixpos
 +
co_fill
 +
co_proportional
 +
co_nohscroll
 +
co_savevalue
 +
co_savestate
 +
co_rowfont
 +
co_rowcolor
 +
co_zebracolor
 +
co_nosort
 +
co_sortdescent
 +
co_norearrange
 +
co_cancopy
 +
co_canpaste
 +
co_mousescrollrow
 +
co_rowdatachange
  
frl_levelo - "levelo" overrides "template.levelo"
+
sortcol
frl_leveli - "leveli" overrides "template.leveli"
+
width
frl_framewidth - "framewidth" overrides "template.framewidth"
 
frl_colorclient - "colorclient" overrides "template.colorclient"
 
frl_colorframe - "colorframe" overrides "template.colorframe"
 
frl_colorframeactive - "colorframeactive" overrides "template.colorframeactive"
 
frl_colordkshadow - "colordkshadow" overrides "template.colordkshadow"
 
frl_colorshadow - "colorshadow" overrides "template.colorshadow"
 
frl_colorlight - "colorlight" overrides "template.colorlight"
 
frl_colorhighlight - "colorhighlight" overrides "template.colorhighlight"
 
frl_colordkwidth - "colordkwidth" overrides "template.colordkwidth"
 
frl_colorhlwidth - "colorhlwidth" overrides "template.colorhlwidth"
 
frl_fileft - "framei_left" overrides "template.framei_left"
 
frl_firight - "framei_right" overrides "template.framei_right"
 
frl_fitop - "framei_top" overrides "template.framei_top"
 
frl_fibottom - "framei_bottom" overrides "template.framei_bottom"
 
  
frl_nodisable
+
items[N]
 +
color
 +
colorselect
 +
datalist - ???
 +
face - see <any face>
 +
fontselect - see <any font>
 +
frame - see <any frame>
 +
linecolor
 +
linecolorfix
 +
linewidth
 +
name
 +
 +
options
 +
 +
</pre>
  
=== TFaceComp ===
+
=== Report ===
- doesn't affect the widget frame but client area of the frame
 
  
 +
==== TRepSpacer ====
 +
==== TRecordBand ====
 +
==== TrepValueDisp ====
 +
==== TRepPageNumdisp ====
 +
==== TRepPrintDateDisp ====
 +
==== TBandGroup ====
 +
==== TTileArea ====
  
template:
+
== Design ==
fade:
 
color[i]: = colors forming the fade
 
direction: = direction where the fade grows to
 
gd_(right/up/left/down)
 
  
pos[i]: = relational position of color[i] on the direction (0.0..1.0) extent
+
=== TGdbMi ===
 +
=== TSyntaxEdit ===
 +
=== TSyntaxPainter ===
  
transparency = makes the face half-transparent and enlight the underlying widget 
+
== Comm ==
with a light source of the selected color
 
( in this case, colors of the face & the widget & the light source
 
simply summarize to higher brightness )
 
  
image:
+
=== TCommPort ===
see <any image>
+
=== TAsciiCommPort ===
 +
=== TAsciiProtPort ===
 +
=== TCommSelector ===
  
options:
+
== General stuff==
  
        *** The fade colors are used not as colors but RGB alpha values ($00 -> opaque, $ff -> transparent)
+
=== Properties for all widgets ===
if fao_alpha* are set *** :
+
<pre>
  
fao_alphafadeall = applies blending to the widget & all its childs
+
name
fao_alphafadenochildren = preserves child widgets from blending
 
                fao_alphafadeimage = applies blending to "face.image"
 
  
 +
anchors
  
<any face>
+
-----------
  
*** extends & customizes "tfacecomp" ***
+
- they control of design/runtime sticking widgets to their parents
  
fade, image, option
+
- dimention pair ( top/bottom or left/right ) both set to "false" cause
- see "tfacecomp"
+
the widget to fit the parent's client area in that dimention;
+
this effect may be partial in case of "bounds_c*max" settings limit the extents
template
 
- "tfacecomp" supplying the initial settings
 
  
localprops :
+
*** Return to the look "before dimention fit" is only possible by manual resizing or setting "bounds_*"
fal_options - "options" overrides "template.options"
+
-----------
fal_fadirection - "fade.direction" overrides "template.fade.direction"
+
an_left
fal_image - "image" overrides "template.image"
+
- on run-time, resizes/shifts left the widget to keep the design-set distance
fal_fapos - "fade.pos[i]" overrides "template.fade.pos[i]"
+
between the widget's left border and the left side of parent's client area
fal_facolor - "fade.color[i]" overrides "template.fade.color[i]"
+
as the parent resizes, until scrolling begins
fal_fatransparency - "fade.transparency" overrides "template.fade.transparency"
 
  
=== TBitmapComp ===
+
an_top
=== TImageList ===
+
- on run-time, resizes/shifts up the widget to keep the design-set distance
=== TPopupMenu ===
+
between the widget's top border and the upper side of parent's client area
=== TMainMenu ===
+
as the parent resizes, until scrolling begins
  
== Dialog ==
+
an_right
=== TFileListview ===
+
- on run-time, resizes/shifts right the widget to keep the design-set distance
=== TFileDialog ===
+
between the widget's right border and the right side of parent's client area
=== TFaceComp ===
+
as the parent resizes, until scrolling begins
=== TFileNameEdit ===
 
=== TDirDropdownEdit ===
 
=== TColorEdit ===
 
=== TMemoDialogEdit ===
 
=== TPageSizeSelector ===
 
=== TPageOrientationSelector ===
 
  
== Application ==
+
an_bottom
=== TGuiApplication ===
+
- on run-time, resizes/shifts down the widget to keep the design-set distance
<pre>
+
between the widget's bottom border and the lower side of parent's client area
tguiapplication = class(tcustomapplication)
+
as the parent resizes, until scrolling begins
  public
 
  
  // [re]starts the system timer with the new period and
+
bounds
  // subscribes the application to be a receiver of the modified "ek_timer" event
 
  // ( can check for it in the event queue )
 
  procedure settimer(const us: integer);
 
  
  // finds a window by its winID
+
cx - width of the widget
  function findwindow(id: winidty; out window: twindow): boolean;
+
cxmax, cxmin - design/runtime width of the widget is enforced between "cxmax" and "cxmin"
 +
cy - height of the widget
 +
cymax, cymin - design/runtime height of the widget is enforced between "cymax" and "cymin"
 +
x - distance between the widget's left border and the left side of parent's client area
 +
y - distance between the widget's top border and the upper side of parent's client area
  
  // finds a window by its ID & adjusts "rect" so that it
 
  // fits "bounds_minc*" & "bounds_maxc*" of the found window
 
  procedure checkwindowrect(winid: winidty; var rect: rectty);
 
  
  // inits the timer and "megraphics"
+
autosize
  procedure initialize;
 
  
  // frees the allocated system resources (GDI, event subsription, the timer)
+
-----------
  procedure deinitialize;
+
- only applicable to widgets with "ow_autosize" set
 +
- the effect may be partial in case when "bounds_c*max" settings limit the extents
 +
-----------
  
  // creates a form instance, it will be shown in "application.run"
+
cx - addition to width of the widget (with h-centering post applied)
  procedure createform(instanceclass: widgetclassty; var reference);
+
cy - addition to height of the widget (with v-centering post applied)
  
  // invalidates all registered forms ( all their widgets will be redrawn )
+
- color
  procedure invalidate;
+
= the default color of client area & caption text background
 
+
= may be overwritten:
  // calls a nested main eventloop, forces processing any pending messages,
+
* the client area - with "frame.colorclient"
  procedure processmessages; override; //handle with care!
+
* the caption BG - with "frame.font.colorbackground"
  
  // TRUE if no pending events to process for the application
+
- font
  function idle: boolean; override;
+
= see {any font}
 
 
  // requests to indicate waiting ( to show the "watches" cursos )
 
  procedure beginwait; override;
 
  
  // removes the "watches" if no unclosed requests for displaying them,
+
- frame
  // otherwise closes the currently active request
+
= see {any frame}
  procedure endwait; override;
 
  
  // TRUE if there're unclosed requests for displaying "watches"
+
- face
  function waiting: boolean;
+
= see {any face}
  
  // TRUE if ESC has just been pressed
+
- hint
  //  - if all requests for displaying "watches" are closed then refreshes
+
= descriptive text appearing when mouse pointer enters the widget
  //    the internal list of events ( the GUI-queue -> the app event list)
 
  function waitescaped: boolean; //true if escape pressed while waiting
 
  
  // sets state of the current wait dialogue ( but doesn't close one ) to undefined
+
- cursor
  procedure resetwaitdialog; 
+
= shape of the mouse pointer over the client area of widget (run-time only)
  
  // runs "aexecuteaction" in the main thread in OnIdle mode,
+
- visible
  // then shows a cancellable message,
+
= "true" allow the widget to appear ( run-time only )
  // if the one is cancelled then runs "acancelaction" then
 
  // either fully clears (if exceptions occur )
 
  // or terminates the execution otherwise,
 
  // true if not cancelled;
 
  // "application.processmessages" must be called regularly if "aexecuteaction" is used here,
 
  // alternatively "aidleaction" can be used, call sleep ( some time ) in order to minimize
 
  // processor load.
 
  // If athread <> nil the function starts and terminates the thread   
 
  function waitdialog(const athread: tthreadcomp = nil; const atext: msestring = '';
 
                  const caption: msestring = '';
 
                  const acancelaction: notifyeventty = nil;
 
                  const aexecuteaction: notifyeventty = nil): boolean; override;
 
  
  // closes the currently modal waitdialogue with "cancelled" state
+
- enabled
  procedure cancelwait;
+
= "true" allows the widget to participate in GUI interaction
 +
= "false" disallows the widget & its children :
 +
* processing all events & shortcuts & menu calls
 +
* auto "CanClose" check
  
  // closes the currently modal waitdialogue with "ok" state
+
Also "false" usually paints the widget in color marking
  procedure terminatewait;
+
the "disabled" state ( usually light gray font color )
  
  function waitstarted: boolean;  // the last waitdialogue is currently showing for some requests
+
- popupmenu
  function waitcanceled: boolean;  // the last waitdialogue has been cancelled for some request (but can be shown fot others ?)
+
= reference to a preset tpopupmenu widget serving the right-click menu
  function waitterminated: boolean; // the last waitdialogue has been terminated for some request (but can be shown fot others ?)
 
  
  // if called from the main app thread then shows as a modal message describing the exception
+
- taborder
  // otherwise posts an async event for which the message will be called
+
- {0..N} order number when TAB-key cycling through widgets in the container
  procedure showexception(e: exception; const leadingtext: string = ''); override;
+
 
 +
- tag
 +
- an integer value bound to this widget instance
  
  // posts an async event for which the message describing the exception will be called
+
- helpcontext
  procedure showasyncexception(e: exception; const leadingtext: string = '');
+
= a string returned by "(active/mouse)helpcontext" methods of the owning form
 +
  when this widget is focused or under mouse in the active window
  
  // "application.errormessage" shows standard error message ( with "ERROR" title )
+
- zorder
  procedure errormessage(const amessage: msestring); override;
+
= reading: finds the current Z-order of the widget's window
 +
= setting: if the value = 0 then lowers the widget's window in the stacking hierarchy, otherwise rises
  
  // [re]calculates timings & position of hint for "ahintedwidget"
 
  // if "ow_timedhint" in "ahintedwidget.foptionswidget" then iys showtime will be
 
  // "defaulthintshowtime" ( an app wide setting, 3sec by default) 
 
  procedure inithintinfo(var info: hintinfoty; const ahintedwidget: twidget);
 
  
 +
optionswidget:
  
  // shows the supplied hint text within "aposrect" with alignment "aplacement" during "ashowtime",
+
ow_background
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
+
- keeps the window/widget on bottom of the Z-order stack.
  procedure showhint(const sender: twidget; const hint: msestring;
 
              const aposrect: rectty; const aplacement: captionposty = cp_bottomleft;
 
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
 
                // -1 defaultshowtime if ow_timedhint in sender.optionswidget
 
              const aflags: hintflagsty = defaulthintflags
 
                      ); overload;
 
  
  // shows the supplied hint text at left-top position"apos" during "ashowtime",
+
ow_top
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
+
- keeps the window/widget in foreground
  procedure showhint(const sender: twidget; const hint: msestring;
 
              const apos: pointty;
 
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
 
                // -1 defaultshowtime if ow_timedhint in sender.optionswidget
 
              const aflags: hintflagsty = defaulthintflags
 
                      ); overload;
 
  
  // shows the hint fully defined in "info" for the widget "sender"
+
ow_noautosizing
  procedure showhint(const sender: twidget; const info: hintinfoty); overload;
+
- when docking, not to resize for the docking area
  
  // removes the current hint widget & frees its resources & stops its stop timer
+
ow_mousefocus
  procedure hidehint;
+
- "false" here disables focusing the widget with mouse
 +
  ( and "OnFocus" doesn't fire on mouse clicks )
  
  // restarts the current hint and its stop timer
+
ow_tabfocus
  procedure restarthint(const sender: twidget);
+
- "false" here disables focusing the widget with "TAB" key
 +
  ( and "OnFocus" doesn't fire on TAB pressed )
  
  function hintedwidget: twidget; //last hinted widget
+
ow_parenttabfocus
  function activehintedwidget: twidget; //nil if no hint active
+
- enters the childs on TAB-focusing then returns to the widget after
 +
sequential TAB-ing through its child widgets,
 +
otherwise TAB-ing cycles on the children if entered
  
  // returns helpcontext of active widget, '' if none; 
+
ow_arrowfocus
  function activehelpcontext: msestring;
+
- allows the widget ( and its children in turn ) to be focused with
 +
the arrow keys
  
  // returns helpcontext of the widget under mouse, '' if none;
+
ow_subfocus, ow_arrowfocusin, ow_arrowfocusout
  function mousehelpcontext: msestring;
+
- in case of arrow keys focusing enabled for child-containing widget,
 +
determine behaviour on entering & leaving the widget, see the below table:
  
  // TRUE if one of the app's window/console is in input focus
+
ow_subfocus | ow_arrowfocusin | ow_arrowfocusout | effect
  function active: boolean;
 
  
  // returns the desktop resolution ( or the virtual one if used )
+
  FALSE          FALSE            FALSE        entering-/leaving-
  function screensize: sizety;
+
  FALSE          FALSE            TRUE          entering-/leaving+
 +
  FALSE          TRUE              FALSE        entering(nearest)+/leaving-
 +
  FALSE          TRUE              TRUE          entering(nearest)+/leaving+
 +
  TRUE            FALSE            FALSE        entering(last focused)+/leaving-
 +
  TRUE            FALSE            TRUE          entering(last focused)+/leaving+
 +
  TRUE            TRUE              FALSE        entering(nearest)+/leaving-
 +
  TRUE            TRUE              TRUE          entering(nearest)+/leaving+
  
  // returns the (virtual) desktop resolution except the tray area,
+
- "entering" is focusing on a child within the widget
  // nil -> current active window
+
- "leaving"  is return from last child onto the widget's level
  function workarea(const awindow: twindow = nil): rectty;
+
- "nearest" is the child closest on the arrow direction
 +
- "last focused" is the child focused on last leaving the widget
 +
 +
*** The Up/Down arrow keys can leave from the children circle,  
 +
but Left/Right can only toggle between the children ***
  
  // returns which application window ( a form not an eventwidget, an openglwidget or a windowwidget !)
+
*** mouse entering/leaving isn't controllable by these options
  // is active ( provides the input focus ),
 
  // it's same for all widgets of the form served by this window
 
  function activewindow: twindow;
 
  
/ * A transient window is a descendant of ( "transientfor" ) another window in the stacking order hierarchy */
 
  
  // returns a first non-transient ( on top of the app stacking order ) window upward
+
ow_focusbackonesc
  // from the currently active window of the application.
+
- on pressing "Esc", returns input focus to the previously focused widget
  // or that active window if no such
 
  function regularactivewindow: twindow;
 
  
  // same as "activewindow" but the window must not be released (?)
+
ow_noparentshortcut
  function unreleasedactivewindow: twindow;
 
  
  // returns the focused widget of the currently active window if one exists
+
*** disables processing of delegated ( from the parent ) shortcuts ***
  function activewidget: twidget;
 
  
  // returns the widget presenteing the currently active window
+
- "true" here disables processing shortcuts if they're delegated
  function activerootwidget: twidget;
+
from the parent widget ( obviously, not processed by the parent )
 
 
  // returns the window ( not hidden or disabled !) under the screen point "pos"
 
  function windowatpos(const pos: pointty): twindow;
 
  
  // puts to "awidget" the container of widget pointed by "namepath"
+
ow_nochildshortcut
  // ( finalizing "." is discarded if found ) ,
 
  // FALSE if not found, and NIL and TRUE if "namepath" = ''
 
  function findwidget(const namepath: string; out awidget: twidget): boolean;
 
  
  // rebuilds the application's window list accorrding to the current on-screen Z-order of its windows;
+
*** disables delegating shortcuts to the parent for taking decision ***
  // window list is ordered by "z" - bottom first & top last;
 
  // invisibles first
 
  procedure sortzorder;
 
  
  // returns a copy of the internal window list of application
+
- if "true" then the widget tries to process it by oneself
  function windowar: windowarty;
+
otherwise it's passed to the parent widget for further chaining
  
  // returns the list of application window winIDs
+
*** A shortcut can only be processed once ( by one widget ) ***
  function winidar: winidarty;
 
  
  // returns the count of the application windows   
+
ow_canclosenil
  function windowcount: integer;
+
- "true" here allows to continue even if there's contained widget(s)
 +
not passing "CanClose" check
  
  // returns the window by its number ( "index" >= 0) in the application window list
+
ow_mousetransparent
  property windows[const index: integer]: twindow read getwindows;
+
- "true" here causes the widget oneself ( not its contained ones )
 +
not to react to mouse events ( just allow them through to the children )
  
  // returns the lowest visible window in stackorder,
+
ow_mousewheel
  // calls "sortzorder" within
+
- enables/disables {scrolling/navigating} with wheel of ImPS/2 etc mouse
  function bottomwindow: twindow;
 
  
  // returns the highest visible window in stackorder,  
+
ow_noscroll
  // calls "sortzorder" within
+
- don't use screen image scrolling for twidget.scrollrect,  
  function topwindow: twindow;
+
redraw the whole scrolled widget rectangle instead;
 +
sometimes needed with background fades.
  
 +
ow_nochildpaintclip
 +
-
  
  // TRUE if all owned windows pass "CanClose" check or
+
ow_destroywidgets
  // don't have focused widgets
+
- "true" here causes calling "free" for all containing widgets as well
  function candefocus: boolean;
 
  
  // subscribes the handler "method" to receive keyboard events
+
ow_hinton
  procedure registeronkeypress(const method: keyeventty);
+
- to show the hint even in case of hinting is disabled on the parent
 +
( "parent.ow_hintoff= true & parent.ow_hinton= false" )
  
  // unsubscribes the handler "method" from receiving keyboard events
+
ow_hintoff
  procedure unregisteronkeypress(const method: keyeventty);
+
- "true" here combined with "ow_hinton=false" fully disables displaying the hint
  
  // subscribes the handler "method" to receive shortcut events
+
ow_multiplehint
  procedure registeronshortcut(const method: keyeventty);
+
- "true" here causes the widget to redisplay its hint on each {>3px} move within the widget oneself
  
  // unsubscribes the handler "method" from receiving shortcut events
+
        ow_timedhint
  procedure unregisteronshortcut(const method: keyeventty);
+
- "true" here causes hint of the widget to disappear after a timed inteval (about 2 secs by default)
  
  // subscribes the handler "method" to receive "OnWindowActiveChanged" event ( form-wide )
+
ow_fontlineheight (design-time only)
  procedure registeronactivechanged(const method: activechangeeventty);
+
- causes "extraspace" of the last text line to be drawn,
 +
in turn it causes adjustment of widget height if "ow_autoscale" is set
 +
 +
*** makes sence only if "ow_autoscale=true" & ow_autosize=false & "extraspace <> 0" ***
  
  // unsubscribes the handler "method" from receiving "OnWindowActiveChanged" event ( form-wide )
+
ow_fontglyphheight (design-time only)
  procedure unregisteronactivechanged(const method: activechangeeventty);
+
- causes only interline "extraspace"-s to be drawn, opposite to "ow_fontlineheight"  
  
  // subscribes the handler "method" to receive "OnDestroyed" events ( form-wide )
+
ow_autoscale (design-time only)
  procedure registeronwindowdestroyed(const method: windoweventty);
+
- causes that if the contents change (design OR run-time) so that its' height changes
 +
then the widget will be v-scaled as well
  
  // unsubscribes the handler "method" from receiving "OnDestroyed" events ( form-wide )
+
ow_autosize (design-time only)
  procedure unregisteronwindowdestroyed(const method: windoweventty);
+
- causes that widget's height & width & client area adjust so that to provide space for contents of the client area
 +
- no design-time change of height/width are possible as long as this option is in effect
  
  // subscribes the handler "method" to receive "OnWindowDestroyed" events ( form-wide )
+
ow_autosizeanright
  procedure registeronwiniddestroyed(const method: winideventty);
+
- when autosizing & {an_right isn't set}, the design-set right margin against the parent is preserved
  
  // unsubscribes the handler "method" form receiving "OnWindowDestroyed" events ( form-wide )
+
ow_autosizeanbottom
  procedure unregisteronwiniddestroyed(const method: winideventty);
+
- when autosizing & {an_bottom isn't set}, the design-set bottom margin against the parent is preserved
  
  // subscribes the handler "method" to receive "ApplicationActiveChanged" events ( form-wide )
+
optionsskin:
  procedure registeronapplicationactivechanged(const method: booleaneventty);
 
  
  // unsubscribes the handler "method" from receiving "ApplicationActiveChanged" events ( form-wide )
+
- osc_noskin
  procedure unregisteronapplicationactivechanged(const method: booleaneventty);
+
- osc_framebuttononly
 +
- osc_container
  
// tcustomapplication
 
  
  // subscribes the handler "method" to receive "OnTerminated" event ( form-wide )
+
Methods:
  procedure registeronterminated(const method: notifyeventty);
 
  
  // unsubscribes the handler "method" from receiving "OnTerminated" events ( form-wide )
+
  // tmsecomponent
  procedure unregisteronterminated(const method: notifyeventty);
 
  
  // subscribes the handler "method" to receive "OnTerminateQuery" event ( form-wide )
+
// (re)draws the widget according to the related skin if apllicable;
  procedure registeronterminate(const method: terminatequeryeventty);
+
//
 +
// also called internally by "loaded" procedure ( before "OnLoaded" code ),
 +
// by ShowMessage ( for the internal widgets of the message dialogue ),
 +
// when creating tab & form & menu widgets
 +
procedure updateskin(const recursive: boolean = false);
  
  // unsubscribes the handler "method" from receiving "OnTerminateQuery" event ( form-wide )
+
// TRUE if the instance is created but not yet ready
  procedure unregisteronterminate(const method: terminatequeryeventty);
+
// for interaction & accessing data & appearance change & receiving events etc
 +
// ( the stage between firing "OnCreate" & "OnLoaded" )
 +
function loading: boolean;
 +
 +
{$ifdef FPC}
 +
procedure setinline(value: boolean); // ?
 +
procedure setancestor(value: boolean); // ?
 +
{$endif}
  
  // subscribes the handler "method" to receive "OnIdle" event ( form-wide )
+
// TRUE if all conditios are OK for executing the code of "event" ( a handler must be assigned to the event )
  procedure registeronidle(const method: idleeventty);
+
function canevent(const event: tmethod): boolean;
  
  // unsubscribes the handler "method" from receiving "OnIdle" events ( form-wide )
 
  procedure unregisteronidle(const method: idleeventty);
 
  
  // calls "canclose" of all application windows except the "sender" window
+
// Shortly, replaces the persistent storage of the widget
  // if all "canclose"are TRUE then checks "OnTerminateQuery"  
+
//
   // for all its subscribers ( usually forms of the application )
+
// if {value <> nil} then
  procedure terminate(const sender: twindow = nil);  
+
// - if "instance" is nil then calls "createproc" to create the instance,
 +
//   then assigns the instance's value:= "value"
 +
// otherwise frees "instance"
 +
procedure setoptionalobject(const value: tpersistent; var instance;
 +
                        createproc: createprocty);
  
  // TRUE as long as a "terminate" call is in progress
+
// creates the persistent storage of the widget via calling "createproc"
  function terminating: boolean;
+
procedure getoptionalobject(const instance: tobject; createproc: createprocty);
  
  // TRUE as long as a "deinitialize" call is in progress
+
// obtains & puts to "obj" a CORBA interface entry for "aintf" (GUID,...)
  function deinitializing: boolean;
+
function getcorbainterface(const aintf: ptypeinfo; out obj) : boolean;
 
 
  // returns the current caret object ( the text input focus indicator ) of the application
 
  / ( this object provides facitities to control position & appearance & visibility & timings of the caret )
 
  property caret: tcaret read fcaret;
 
  
  // returns the current mouse object of the application
+
        // TRUE if the widget is owned, or "self" otherwise
  / ( this object provides facitities to control position & appearance of the mouse )  
+
function checkowned(component: tcomponent): boolean;  
  property mouse: tmouse read fmouse;
 
  
  // simulates mouseparkevent
+
        // TRUE if the widget is owner, or "self" otherwise
  // ( an adjusting mouse movement without user intervention - grid snapping, docking etc ?)
+
function checkowner(component: tcomponent): boolean;  
  procedure mouseparkevent;
 
  
  // sets mouse position correction for further mouse events,
+
// return the top-most widget in owner chain starting from this widget
  // the real position is less the visual one by the supplied shift
+
function rootowner: tcomponent;
  procedure delayedmouseshift(const ashift: pointty);
 
  
  // returns/sets a cursor shape used for widgets having their cursor shape set to "cr_default";
+
// return the array of owning widgets starting from this widget
  // setting it to "cr_default" restores the individual widget cursor(s)
+
// componentarty[0] is the widget oneself
  property widgetcursorshape: cursorshapety read fwidgetcursorshape write
+
function getrootcomponentpath: componentarty;
                                        fwidgetcursorshape;
 
  
  // returns/sets the current application-wide cursor shape ( not "watches" if a waiting dialogue is curerntly displayed ! )
+
        // returns items of objeclinker ( which notify this widget )
  // or request to set a new cursor shape ( app-wide );
+
        // and free notify list ( which are notified by this widget ),
  // doesn't change when changing mouse widgets
+
        // duplicates are removed.
  //  
+
        //
  // if called from a non-main app thread & no waiting dialogue displayed then redraws
+
        // Notifies mainly relate to insertion/removal operation on widgets
  // the cursor immediately;
+
        // The notify list is maintained by FreeNotification & RemoveFreeNotification
  // set it to "cr_default" to restore the shape to one set by "widgetcursorshape"
+
function linkedobjects: objectarty;
  //
 
  property cursorshape: cursorshapety; // cr_arrow, cr_*
 
  
  // assures the displayed mouse cursor shape to be the shape assigned to the currently under-mouse widget,
+
// sends "event" recursively to child widgets until no more children or
  // otherwise "cr_default"  
+
// the event is processed ( cea_processed ) by one of the children,
  procedure updatecursorshape; //restores cursorshape of mousewidget
+
// "event" will be destroyed if destroyevent= true and not async
 +
procedure sendcomponentevent(const event: tcomponentevent;
 +
                                        const destroyevent: boolean = true);
  
  // returns a widget of the application where the mouse is currently positioned over
+
// sends "event" to each of owning widgets downward from the root owner,
  property mousewidget: twidget read fmousewidget;
+
// "event" will be destroyed if destroyevent= true and not async
 +
procedure sendrootcomponentevent(const event: tcomponentevent;
 +
                                        const destroyevent: boolean = true);
  
  // returns a widget of the application currently "owning" the mouse ( grabbing all mouse input )
+
// posts an async "atag"-ged event to be handled by oneself
  property mousecapturewidget: twidget read fmousecapturewidget;
+
procedure asyncevent(atag: integer = 0);
  
 +
// posts a "tcomponentevent" instance from sender=self,
 +
// "kind" is defined when creating the event,
 +
// and "tag" may be adjusted after creation
 +
procedure postcomponentevent(const event: tcomponentevent);
  
  // returns/sets a window to become the main window of the application
+
// returns the classname of the widget if the widget is toplevel,
  // then resets all other application windows to the window group it belongs to ( Linux only );
+
// and "tmsecomponent" otherwise )
  //
+
property moduleclassname: string read getmoduleclassname;
  // the main window minimizes all windows if minimized;
 
  property mainwindow: twindow read fmainwindow write setmainwindow;
 
  
  // returns which system thread was allocated to the application on its start
+
// returns the classname of the widget as the entry of its constructor
  // ( the main thread )
+
// ( button => tbutton, datamodule => tdm1mo, form => ttstfo, dbstringedit => tdbstringedit,.. )
  property thread: threadty read fthread;
+
property actualclassname: string read getactualclassname;
  
  // returns teh widget where a mouse button click occured last time
+
// returns "fmsecomponentstate"
  // ( to compare with when determinibg whether another widget is clicked )
+
// ( a set of cs_ismodule,cs_endreadproc,cs_loadedproc,cs_noload, cs_hasskin,cs_noskin )
  property buttonpresswidgetbefore: twidget read fbuttonpresswidgetbefore;
+
property msecomponentstate: msecomponentstatesty read fmsecomponentstate;
  
  // returns teh widget where a mouse button release occured last time
+
// returns/sets a pointer associated with the widget
  // ( to compare with when determinibg whether another widget is clicked )
+
// ( contrary to the integer "tag", allows to use an arbitary data type
  property buttonreleasewidgetbefore: twidget read fbuttonreleasewidgetbefore;
+
// for associating data )
 +
property tagpo: pointer read ftagpo write ftagpo;
  
 +
// returns/sets a string identifying the widget in the help system
 +
property helpcontext: msestring read gethelpcontext write fhelpcontext;
  
  // returns/sets the interval of mouse double click recognition ( in microsecs),
+
// twidget
  // defaults to 0.4 sec
 
  property dblclicktime: integer read fdblclicktime write fdblclicktime default
 
                defaultdblclicktime; //us
 
  
// tcustomapplication
+
// creates an instance of the widget, owned by "aowner" if not NIL
 +
constructor create(aowner: tcomponent); override;
  
  // creates a datamodule instance ( its startup code including "OnLoaded" is executed )
+
destructor destroy; override;
  procedure createdatamodule(instanceclass: msecomponentclassty; var reference);
 
  
 +
// ??
 +
procedure afterconstruction; override;
  
  // enters the application event loop;
+
// rescales the widget frame ( if assigned ) then owned widgets ( if exist, recursively ) then bounds_* then the font ( if assigned )
  //
+
// called before inserting in parentwidget,
  // once the loop finishes, performs "OnTerminated" for all its subscribers,
+
// calls "scale(ascale)",
  // destroys all application forms ( components & windows )
+
// no visual repainting
  procedure run;
+
procedure initnewcomponent(const ascale: real); virtual;
  
  // TRUE if the eventloop is entered
+
// restores the "fontheight" to "font.glyphheight" if "ow_fontglyphheight" or
  function running: boolean;
+
// to "font.lineheight" if "ow_fontlineheight" otherwise,
 +
// ascale is ignored ?
 +
// calls "synctofontheight->setfontheight",
 +
// called after inserting in parentwidget,
 +
// no visual repainting
 +
procedure initnewwidget(const ascale: real); virtual;
  
  // returns/sets the application name
+
// creates the widget frame if not yet created
  // ( defaults to the full path to application executable in the native OS format );
+
procedure createframe;
  // currently, only for informatiion query purposes
 
  property applicationname: msestring read fapplicationname write fapplicationname;
 
 
 
  
  // if exclusive "rights" are satisfied for the main thread ( a mutex lock is OK ) & the event loop is in progress
+
// creates the widget face if not yet created
  // then posts the "event" to the main application thread for asyc processing,
+
procedure createface;
  // otherwise adds the event to the internal list for further handling as soon as the above conditions meet
 
  procedure postevent(event: tevent);
 
  
  // TRUE if never idle since last call,
+
// creates the widget font if not yet  created
  // unlocks the application and calls sleep if not mainthread and asleepus >= 0
+
procedure createfont;
  function checkoverload(const asleepus: integer = 100000): boolean;
 
  
  // returns/sets the application exception handler
+
// checks ws_loadlock and csdestroing too
  property onexception: exceptioneventty read fonexception write fonexception;
+
function isloading: boolean;
  
  // if not "eabort" & no unhandled exceptions,  
+
// returns "widgetstatety" - a set of (
  // executes the above "OnException" code if assigned
+
// ws_visible,ws_enabled,ws_active,ws_entered,ws_entering,ws_exiting,
  // or shows an exception message otherwise;
+
// ws_focused,ws_mouseinclient,ws_wantmousebutton,ws_wantmousemove,
  procedure handleexception(sender: tobject = nil;
+
// ws_wantmousefocus,ws_iswidget,ws_opaque,ws_nopaint,
                                      const leadingtext: string = '');
+
// ws_clicked,ws_mousecaptured,ws_clientmousecaptured,
 +
// ws_loadlock,ws_loadedproc,ws_showproc,ws_minclientsizevalid,
 +
// ws_showed,ws_hidden, //used in tcustomeventwidget
 +
// ws_destroying,ws_staticframe,ws_staticface,ws_isvisible
 +
//
 +
// iframe
 +
function widgetstate: widgetstatesty;
  
  // synchronizes the calling thread with the main event loop ( via a mutex),
+
// returns "widgetstate1ty" - a set of (
  // TRUE if the calling thread allready holds the mutex,
+
// (ws1_childscaled,ws1_fontheightlock,
  // the mutex is recursive
+
// ws1_widgetregionvalid,ws1_rootvalid,
  function lock: boolean;
+
// ws1_anchorsizing,ws1_isstreamed,
 
+
// ws1_scaled, //used in tcustomscalingwidget
  // tries to synchronize the calling thread with the main event loop ( via a mutex)
+
// ws1_noclipchildren,
  function trylock: boolean;
+
// ws1_nodesignvisible,ws1_nodesignframe,ws1_nodesignhandles,
 +
// ws1_nodesigndelete,ws1_designactive,
 +
// ws1_fakevisible,ws1_nominsize //used for report size calculations
 +
// )
 +
property widgetstate1: widgetstates1ty read fwidgetstate1;
 +
 +
* this set of states is needed because the max FPC set size is 32
 +
  thus "widgetstate1ty" can't fit all states
 +
 
 +
// TRUE if the widget is contained within another widget
 +
// ( tcomponent stuff )
 +
function hasparent: boolean; override;             
  
  // releases the mutex if the calling thread holds the mutex,
+
// returns the parent component if it's a widget or the grandparent otherwise
  // TRUE if no unlock done
+
function getparentcomponent: tcomponent; override;   // tcomponent
  function unlock: boolean;
 
  
  // releases the mutex recursively if the calling thread holds the mutex,
+
// TRUE if "awidget" is an ascendant or the widget or they are the same widget
  // returns "count" for the below "relockall"
+
function checkdescendent(awidget: twidget): boolean;
  function unlockall: integer;
+
 +
// TRUE if app is running and the widget owns the caret or the caret widget
 +
function hascaret: boolean;
  
  // regains the mutex to serve "count" locks
+
        // TRUE if "winid" allocated and not loading and not destroying,
  procedure relockall(count: integer);
+
        // all widgets on a form have "winid" of this form ( a real window allocated by the OS )
 +
        // thus have this function TRUE
 +
function windowallocated: boolean;
  
  // creates a syncronize event ( which will fire asyncronously then waits for another thread will allow it to finish ), assigns "proc" to it as the event handler,
+
// TRUE if presents a valid toplevelwindow with assigned "winid"
  // then frees all locks temporarily then posts the event to the app event queue & waits fot it to be processed the resores the locks;
+
function ownswindow: boolean;
  //
 
  // TRUE if not aborted, quiet -> shows no exceptions if occurs
 
  //
 
  // the "syncronize event" is an event owning a semaphore which can be touched by another thread
 
  // thus causing "event.waitfo" to return & to exec the event handler code
 
  //
 
  function synchronize(const proc: objectprocty;
 
                      const quite: boolean = false): boolean;
 
  
  // TRUE if the calling ( this function ) thread is the application main thread
+
// invalidated area of the widget, the origin is "clientpos" against the roor widget
  function ismainthread: boolean;
+
function updaterect: rectty;  
  
  // TRUE if the currently locked thread is the application main thread
+
// calls recursively "canclose" for all contained widgets ( the widget oneself excluded! ),
  function islockthread: boolean;
+
// TRUE if none of the widgets return FALSE
 +
//
 +
// more specialized widgets may have "canclose" overridden
 +
// to perform more work than just this call recursion
 +
// ( not null or range check,.. )
 +
//
 +
// "onclosequery" must also pass the check if assigned, for the function to succeed
 +
function canclose(const newfocus: twidget = nil): boolean; virtual;
  
  // waith for "athread" to terminate,
+
        // checks "canclose" first for focused widget of the window ( form,.. )
  // does "unlock-relock" around waiting
+
        // if it is a descendant of the widget or the widget oneself,
  procedure waitforthread(athread: tmsethread);
+
        // then continues with subwidgets of the widget;
 +
        // also - finishes editing ( snapshots "value" ) in the focused widget before checking
 +
function canparentclose(const newfocus: twidget): boolean; overload;
  
  // post a "nothing-to-do" event for asynchronous processing in the main thread
+
// the above function but with the preserved focus
  procedure wakeupmainthread;
+
function canparentclose: boolean; overload;
 +
                  //newfocus = window.focusedwidget     
  
  // invalidates all registered forms of the application so that their widgets redraw land-specific captions
+
function canfocus: boolean; virtual;
  // ( changed by "mseconsts.setlangconsts" ),
+
function setfocus(aactivate: boolean = true): boolean; virtual;//true if ok
  // called internally in "setlangconsts" before return
+
procedure nextfocus; //sets inputfocus to then next appropriate widget
  procedure langchanged; virtual;
+
 
 +
function findtabfocus(const ataborder: integer): twidget;
 +
                      //nil if cannot focus
  
  // returns/sets "aps_terminated" state flag ( no actions ? )
+
function firsttabfocus: twidget;
  // this flag is also set internally by "terminate" if not cancelled
+
function lasttabfocus: twidget;
  property terminated: boolean read getterminated write setterminated;
+
function nexttaborder(const down: boolean = false): twidget;
  
  // returns the number of "handleexception" calls having an effect ( a message or the handler code )
+
function focusback(const aactivate: boolean = true): boolean;
  property exceptioncount: longword read fexceptioncount;
+
                              //false if focus not changed
  
 +
function parentcolor: colorty;
 +
function actualcolor: colorty; virtual;
 +
function actualopaquecolor: colorty;
 +
function backgroundcolor: colorty;
 +
function translatecolor(const acolor: colorty): colorty;
  
private
+
procedure widgetevent(const event: twidgetevent); virtual;
// function tinternalapplication.beginmodal(const sender: twindow): boolean;
 
  
<pre/>
+
procedure sendwidgetevent(const event: twidgetevent);
 +
                              //event will be destroyed
  
== DB ==
+
procedure release; override;
  
=== DBedit ===
+
function show(const modal: boolean = false; const transientfor: twindow = nil): modalresultty; virtual;
=== DBfields ===
 
=== TDBwidgetgrid ===
 
<pre>
 
  Properties:
 
  
        anchors - ...
+
procedure hide;
bounds - ...
+
procedure activate(const abringtofront: boolean = true); virtual;
 +
                            //show and setfocus
 +
 
 +
procedure bringtofront;
 +
procedure sendtoback;
 +
procedure stackunder(const predecessor: twidget);
 +
 
 +
procedure paint(const canvas: tcanvas); virtual;
 +
procedure update; virtual;
 +
procedure scrollwidgets(const dist: pointty);
  
color
+
procedure scrollrect(const dist: pointty; const rect: rectty; scrollcaret: boolean);
- color of the grid's client area
+
                            //origin = paintrect.pos
cursor
 
- cursor shape when the mouse is over the client area
 
  
datacols
+
procedure scroll(const dist: pointty);
colorselect
+
                            //scrolls paintrect and widgets
linecolor
 
linecolorfix
 
linewidth
 
newrowcol
 
  
options
+
procedure getcaret;
co_readonly
+
procedure scrollcaret(const dist: pointty);
co_nofocus
+
function mousecaptured: boolean;
co_invisible
+
procedure capturemouse(grab: boolean = true);
co_disabled
+
procedure releasemouse;
co_drawfocus
+
procedure capturekeyboard;
co_mousemovefocus
+
procedure releasekeyboard;
co_lefbuttonfocusonly
+
procedure synctofontheight; virtual;
co_focusselect
+
 
co_mouseselect
+
procedure dragevent(var info: draginfoty); virtual;
co_keyselect
+
procedure dochildscaled(const sender: twidget); virtual;
co_multiselect
 
co_resetselectionexit
 
co_rowselect
 
co_fixwidth
 
co_fixpos
 
co_fill
 
co_proportional
 
co_nohscroll
 
co_savevalue
 
co_savestate
 
co_rowfont
 
co_rowcolor
 
co_zebracolor
 
co_nosort
 
co_sortdescent
 
co_norearrange
 
co_cancopy
 
co_canpaste
 
co_mousescrollrow
 
co_rowdatachange
 
  
sortcol
+
procedure invalidatewidget;    //invalidates whole widget
width
+
procedure invalidate;          //invalidates clientrect
 
+
procedure invalidaterect(const rect: rectty; org: originty = org_client);
items[N]
+
procedure invalidateframestate;
color
+
 
colorselect
+
procedure invalidateframestaterect(const rect: rectty;
datalist - ???
+
                                        const org: originty = org_client); 
face - see <any face>
+
function hasoverlappingsiblings(arect: rectty): boolean; //origin = pos
fontselect - see <any font>
+
 
frame - see <any frame>
+
function window: twindow;
linecolor
+
function rootwidget: twidget;
linecolorfix
+
 
linewidth
+
function parentofcontainer: twidget;
name
+
            //parentwidget.parentwidget if parentwidget has not ws_iswidget,
+
            //parentwidget otherwise
options
+
 
+
property parentwidget: twidget read fparentwidget write setparentwidget;
<pre/>
+
function getrootwidgetpath: widgetarty; //root widget is last
=== Report ===
+
 
 
+
// number of contained widgets ( the widget oneself excluded ! )
==== TRepSpacer ====
+
function widgetcount: integer;
==== TRecordBand ====
+
 
==== TrepValueDisp ====
+
function parentwidgetindex: integer; //index in parentwidget.widgets, -1 if none
==== TRepPageNumdisp ====
+
property widgets[const index: integer]: twidget read getwidgets;
==== TRepPrintDateDisp ====
+
function widgetatpos(var info: widgetatposinfoty): twidget; overload;
==== TBandGroup ====
+
function widgetatpos(const pos: pointty): twidget; overload;
==== TTileArea ====
+
 
 
+
function widgetatpos(const pos: pointty;
== Design ==
+
                  const state: widgetstatesty): twidget; overload;
 +
 
 +
property taborderedwidgets: widgetarty read gettaborderedwidgets;
 +
 
 +
function findtagwidget(const atag: integer; const aclass: widgetclassty): twidget;
 +
              //returns first matching descendent
 +
 
 +
property container: twidget read getcontainer;
 +
function containeroffset: pointty;
 +
function childrencount: integer; virtual;
 +
property children[const index: integer]: twidget read getchildwidgets; default;
 +
 
 +
function childatpos(const pos: pointty;
 +
                  const clientorigin: boolean = true): twidget; virtual;
 +
 
 +
function getsortxchildren: widgetarty;
 +
function getsortychildren: widgetarty;
 +
property focusedchild: twidget read ffocusedchild;
 +
property focusedchildbefore: twidget read ffocusedchildbefore;
 +
 
 +
function mouseeventwidget(const info: mouseeventinfoty): twidget;
 +
 
 +
function checkdescendent(widget: twidget): boolean;
 +
                    //true if widget is descendent or self
 +
 
 +
function checkancestor(widget: twidget): boolean;
 +
                    //true if widget is ancestor or self
 +
 
 +
function containswidget(awidget: twidget): boolean;
 +
 
 +
procedure insertwidget(const awidget: twidget); overload;
 +
 
 +
procedure insertwidget(const awidget: twidget; const apos: pointty); overload; virtual;
 +
                //widget can be child
 +
 
 +
function iswidgetclick(const info: mouseeventinfoty; const caption: boolean = false): boolean;
 +
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
 +
//or in frame.caption if caption = true, origin = pos
 +
 
 +
function isclick(const info: mouseeventinfoty): boolean;
 +
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
 +
 
 +
function isdblclick(const info: mouseeventinfoty): boolean;
 +
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
 +
// and timedlay to last buttonpress is short
 +
 
 +
function isdblclicked(const info: mouseeventinfoty): boolean;
 +
//true if eventtype in [et_buttonpress,et_butonrelease], button is mb_left,
 +
// and timedlay to last same buttonevent is short
 +
 
 +
function isleftbuttondown(const info: mouseeventinfoty): boolean;
 +
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
 +
//origin = paintrect.pos
 +
 
 +
widgetrect: the widget on-screen area including its frame & frame caption
 +
 
 +
paintrect: the widget on-screen area except its frame & frame caption
 +
 
 +
clientrect: virtual area which
 +
- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
 +
- for scrolling widgets, may be bigger than "paintrect",
 +
  also may shift ( change its "pos" ) when scrolling
 +
 +
// the coord of outer top-left corner against the toplevel form = the window owner,
 +
// including the frame & frame caption
 +
function rootpos: pointty;
 +
 
 +
// the coord of the outer top-left corner against the screen ( the WM decorations aren't counted in )
 +
// includes the frame & frame caption
 +
property screenpos: pointty;
 +
 
 +
//  the coord of the outer top-left corner against the parent widget,
 +
// including the frame & frame caption
 +
property widgetrect: rectty;
 +
property pos: pointty; // =widgetrect.pos
 +
property size: sizety; // =widgetrect.size
 +
property left: integer; // =bounds_x
 +
property right: integer; //widgetrect.x + widgetrect.cx, sets cx;
 +
property top: integer;  // =bounds_y
 +
property bottom: integer; //widgetrect.y + widgetrect.cy, sets cy;
 +
property width: integer; // =bounds_cx
 +
property height: integer; // =bounds_cy
 +
function widgetsizerect: rectty;          //pos = nullpoint
 +
 
 +
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
 +
    //  except the frame & frame caption
 +
function paintrect: rectty;
 +
function paintpos: pointty;
 +
function paintsize: sizety;
 +
function innerpaintrect: rectty; // mainly equals to paintrect
 +
function clientwidgetrect: rectty; // mainly equals to paintrect
 +
function clientwidgetpos: pointty;
 +
function clippedpaintrect: rectty; // mainly equals to  but clipped by all parentpaintrects
 +
function innerwidgetrect: rectty;    // mainly equals to paintrect
 +
function innerclientwidgetpos: pointty;
 +
 
 +
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
 +
    //  except the frame caption
 +
function framerect: rectty; // =paintrect except the frame caption area
 +
function framepos: pointty;
 +
function framesize: sizety;
 +
 
 +
    // the coord of the client area ( clientrect )  against the paint area ( paintrect )
 +
    //  usually these areas match
 +
function clientrect: rectty;
 +
property clientsize: sizety;
 +
property clientwidth: integer;
 +
property clientheight: integer;
 +
property clientpos: pointty;
 +
 
 +
    // the coord of the paint area of the parent against the paint area of this widget
 +
function paintrectparent: rectty; //nullrect if parent = nil,
 +
 
 +
    // the coord of the client area of the parent against the paint area of this widget
 +
function clientrectparent: rectty; //nullrect if parent = nil,
 +
 
 +
// the coord of the inner area against the client area ( clientrect )
 +
function innerclientrect: rectty;  // mainly equals to clientrect
 +
function innerclientsize: sizety;
 +
function innerclientpos: pointty;
 +
 
 +
function framewidth: sizety;              //widgetrect.size - paintrect.size
 +
function clientframewidth: sizety;        //widgetrect.size - clientrect.size
 +
function innerclientframewidth: sizety;  //widgetrect.size - innerclientrect.size
 +
function innerframewidth: sizety;        //clientrect.size - innerclientrect.size 
 +
 
 +
    // the coord of the paint area against the widgetrect(pos) of the parent
 +
function paintparentpos: pointty;    //origin = parentwidget.pos
 +
 
 +
    // the coord of the client area against the widgetrect(pos) of the parent
 +
function clientparentpos: pointty;  //origin = parentwidget.pos
 +
 
 +
    // the coord of the widgetrect(pos) against the client area of parent
 +
property parentclientpos: pointty;
 +
 
 +
 
 +
function clientpostowidgetpos(const apos: pointty): pointty;
 +
function widgetpostoclientpos(const apos: pointty): pointty;
 +
function widgetpostopaintpos(const apos: pointty): pointty;
 +
function paintpostowidgetpos(const apos: pointty): pointty;
 +
procedure scale(const ascale: real); virtual;
 +
 
 +
 
 +
property minsize: sizety read fminsize write setminsize;
 +
property maxsize: sizety read fmaxsize write setmaxsize;
 +
function maxclientsize: sizety; virtual;
 +
 
 +
 
 +
property anchors: anchorsty read fanchors write setanchors default defaultanchors;
 +
property defaultfocuschild: twidget read getdefaultfocuschild write setdefaultfocuschild;
 +
 
 +
 
 +
procedure changeclientsize(const delta: sizety); //asynchronous
 +
 
 +
function getcanvas(aorigin: originty = org_client): tcanvas;
 +
 
 +
function showing: boolean;
 +
              //true if self and all ancestors visible and window allocated
 +
 
 +
function isenabled: boolean;
 +
              //true if self and all ancestors enabled
 +
 
 +
function active: boolean;
 +
function entered: boolean;
 +
 
 +
function activeentered: boolean;
 +
//true if entered and window is regularactivewindow or inactivated
 +
 
 +
function focused: boolean;
 +
function clicked: boolean;
 +
 
 +
function indexofwidget(const awidget: twidget): integer;
 +
 
 +
procedure changedirection(const avalue: graphicdirectionty;
 +
                                            var dest: graphicdirectionty); virtual;
 +
 
 +
// (re)arranges "awidgets" horizontally within the parent's client area
 +
// so that awidget[i] were placed next each other
 +
// at h-space dist[i], starting from "startx" with the right margin "endmargin";
 +
//
 +
// if the number of "dist" is fewer than the number of "awidgets" then the remaining h-spaces are taken
 +
// as the last "dist[i]" or "0" if none;
 +
// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
 +
//
 +
// non-zero "endmargin" causes one of awdidget[i] to h-resize to provide the margin :
 +
//  - if one or more of awidgets[i] have [an_left,an_right] set then the first of such is resized
 +
//    otherwise the last awidgets[i] is h-resized
 +
//
 +
procedure placexorder(
 +
const startx: integer;
 +
const dist: array of integer;
 +
                const awidgets: array of twidget;
 +
                const endmargin: integer = minint);
 +
 
 +
// (re)arranges "awidgets" vertically within the parent's client area
 +
// so that awidget[i] were placed upper/lower each other
 +
// at v-space dist[i], starting from "starty" with the bottom margin "endmargin";
 +
//
 +
// if the number of "dist" is fewer than the number of "awidgets" then the remaining v-spaces are taken
 +
// as the last "dist[i]" or "0" if none;
 +
// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
 +
//
 +
// non-zero "endmargin" causes one of awdidget[i] to v-resize to provide the margin :
 +
//  - if one or more of awidgets[i] have [an_top,an_bottom] set then the first of such is resized
 +
//    otherwise the last awidgets[i] is v-resized
 +
//
 +
procedure placeyorder(
 +
const starty: integer;
 +
const dist: array of integer;
 +
                const awidgets: array of twidget;
 +
                const endmargin: integer = minint);
 +
              //origin = clientpos, endmargin by size adjust of widgets
 +
              //with [an_top,an_bottom], minint -> no change
 +
 
 +
// if {mode <> wam_none} then (re)arranges "awidgets" horizontally  within the parent's client area so that
 +
// awidgets[0] stays on its place but awidgets[1..N] :
 +
// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_left" set ) so that they right borders match the right border of awidgets[0]
 +
// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_right" set ) so that they left borders match the left border of awidgets[0]
 +
// - if {mode = wam_center} then awidgets[i>=1] move so that they Y-axes match the Y-axe of awidgets[0]
 +
//
 +
// mainly applicable for v-stacked widgets since h-stacked may overlap after such alignment
 +
//
 +
        // returns the reference point ( the coord of awidgets[0] )
 +
function alignx(const mode: widgetalignmodety;
 +
                        const awidgets: array of twidget): integer;
 +
 
 +
 
 +
// if {mode <> wam_none} then (re)arranges "awidgets" vertically within the parent's client area so that
 +
// awidgets[0] stays on its place but awidgets[1..N] :
 +
// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_top" set ) so that they bottom borders match the bottom border of awidgets[0]
 +
// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_bottom" set ) so that they top borders match the top border of awidgets[0]
 +
// - if {mode = wam_center} then awidgets[i>=1] move so that they X-axes match the X-axe of awidgets[0]
 +
//
 +
// mainly applicable for h-stacked widgets since v-stacked may overlap after such alignment
 +
//
 +
        // returns the reference point ( the coord of awidgets[0] )
 +
function aligny(const mode: widgetalignmodety;
 +
                        const awidgets: array of twidget): integer;
 +
 
 +
function actualcursor: cursorshapety; virtual;
 +
 
 +
 
 +
Event handlers:
 +
 
 +
- onactivate
 +
 
 +
fires :
 +
 
 +
= on receiving input focus, just before "OnFocus"
 +
 +
= forms specific :
 +
* on 1-st display of the form after "OnLoaded" ( from "Loaded" procedure)
 +
* on switch back from another apllication/WM ( "oe_activate" event )
 +
* after closure of a descendant form
 +
* on minimizing/maximizing the form
 +
 
 +
- onchildscaled
 +
 
 +
fires :
 +
 
 +
= on child/children resizing due to font height change
 +
 
 +
= form widget: once "form.container" {scrolling widget} is loaded
 +
 
 +
- ondeactivate
 +
fires
 +
= form widget: when the form looses input focus
 +
= non-form widget: when the widget looses input focus
 +
 
 +
- ondefocus
 +
 
 +
fires
 +
= on disabling the widget
 +
 
 +
= form widget: if another form is focused
 +
= non-form widget: if another widget is focused
 +
 
 +
- onenter
 +
= fires on any way of taking parent-wide focus as soon as
 +
the parent stores the new child's order, before "OnActivate" & "OnFocus"
 +
 
 +
- onexit
 +
= fires last on parent-wide lossing focus, after "OnDefocus" & "OnDeactivate"
 +
= for top-level ( not in a container ) forms, doesn't fire
 +
 
 +
- onfocus
 +
fires
 +
= once the existing widget takes the focus
 +
= on showing the widget's form if the widget has the lowest "TabOrder"
 +
 
 +
- onfontheightdelta
 +
fires
 +
= if [ow_fontglyphheight OR ow_fontlineheight ] AND {the
 +
new font height differs from the previos one}
 +
= before the parent redraws this widget
 +
 
 +
- onpopup
 +
fires :
 +
= on calling a popup-menu ( with "RightClick" ), once the menu items of the current level are loaded
 +
( before building the submenus )
 +
 
 +
- onresize
 +
 
 +
= fires on creating/(changing size)/(min-max restoring) of widget,
 +
before actual redrawing
 +
 
 +
= rechecks if there's real work to do
 +
 
 +
- onshowhint
 +
= fires when a installed hint is activated or on "aplication.showint" called
 +
= since called last, allows to adjust the default behavior
 +
 
 +
- onbeforeupdateskin
 +
= fires in "updateskin" ( the widget is loaded etc ) before applying the skin
 +
 
 +
- onafterupdateskin
 +
= fires in "updateskin" ( the widget is loaded etc ) once the skin is applied
 +
 
 +
</pre>
 +
 
 +
=== TWidget stuff ===
 +
<pre>
 +
  Properties:   
 +
- name
 +
- anchors
 +
- bounds
 +
- color
 +
- enabled
 +
- visible
 +
- <face> : see {any face}
 +
- <frame> : see {any frame}
 +
    - hint
 +
    - helpcontext
 +
    - tag
 +
    - taborder
 +
    - cursor
 +
    - optionswidget
 +
    - optionsskin
 +
    - popupmenu
 +
   
 +
twidget's event handlers:
 +
   
 +
- on(de)activate
 +
- onbeforeupdateskin
 +
- onafterupdateskin
 +
- onchildscaled
 +
- onfontheightdelta
 +
- on(de)focus
 +
- onenter
 +
- onmove
 +
- onpopup
 +
- onresize
 +
- onshowhint
 +
     
 +
align_glue :
 +
  ( outer anchoring mode for widget group, in the align mode )
 +
- wam_none
 +
- wam_start
 +
- wan_center
 +
- wm_end
 +
 
 +
align_leader :
 +
the widget ( incl another spacer, splitter or layouter ) against which the alignment applies ( the reference widget )
 +
 
 +
align_mode :
 +
  ( inner anchoring mode within widget group, in the align mode )
 +
- wam_none
 +
- wam_start
 +
- wan_center
 +
- wm_end
 +
 
 +
// Place mode:
 +
 
 +
     
 +
place_mindist, place_maxdist:
 +
- in the place(ment) mode, limits distance between widgets
 +
  ( these distance once calculated also define side margins if applicable )
 +
 
 +
place_mode:
 +
  ( outer anchoring mode for widget group, in the place mode )
 +
- wam_none
 +
- wam_start
 +
- wan_center
 +
- wm_end
 +
 
 +
place_options:
 +
- plo_endmargin
 +
= to resize a widget so that it "eats" extra space if it occurs
 +
 +
* only applicable in the place mode, with a limiting value of "place_maxdist" and:
 +
 
 +
  1) {place_mode <> wam_none}
 +
or
 +
  2) {place_mode = wam_end} and {plo_propmargin in place_options}
 +
 
 +
For the exact look, see above
 +
 
 +
 
 +
- plo_propmargin
 +
= виджеты расставляются теснее так, чтобы образовались отступы перед и после,
 +
  причем расстояние между центрами виджетов было бы таким же,
 +
  как и растояние между серединами крайних виджетов и соотв. границами зоны расстановки
 +
 
 +
- plo_syncmaxautosize
 +
= see above
 +
 
 +
- plo_synccaptiondistx
 +
= see above
 +
 
 +
  * affects widgets with opposite cp_left/right set as well
 +
  * the minimal before-adjustment "captiondist" among all widgets limits "captiondist" for each of the widget
 +
              * don't set cfo_captiondistouter here !
 +
 
 +
- plo_synccaptiondisty
 +
= see above
 +
 
 +
  * affects also widgets with opposite cp_top/bottom set
 +
  * the minimal before-adjustment "captiondist" amongst all widgets limits "captiondist" for each of the widget
 +
 
 +
              ! here, don't set "cfo_captiondistouter" for affected widgets !
 +
 
 +
- plo_syncpaintwidth
 +
= see above
 +
 
 +
- plo_syncpaintheight
 +
= see above
 +
 
 +
- plo_scalesize
 +
= see above
 +
 
 +
 
 +
dist_left, dist_right, dist_top, dist_bottom :
 +
= margins between most outer edge the layouter and
 +
  the corresponding linked widget
 +
 
 +
* see "tspacer" for detail
 +
 
 +
linkleft,linkright,linktop,linkbottom : see "tspacer"
 +
 
 +
options:
 +
- spao_glueright, spao_gluebottom:
 +
= set the adjustment dependencies between the layouter and its link_* widgets
 +
 
 +
* see "tspacer" for more details
 +
 
 +
// which mode of widget placement to apply - see above
 +
optionslayout:
 +
- lao_alignx
 +
- lao_aligny
 +
- lao_placex
 +
- lao_placey
 +
- lao_scalewidth
 +
- lao_scaleheight
 +
- lao_scaleleft
 +
- lao_scaletop
 +
 +
* lao_place* & lao_align* can't be combined for one direction
 +
 
 +
optionsscale:
 +
 
 +
  * cause the layouter to provide full space for the widgets as long as they expand/shrink/move
 +
 
 +
- osc_expandx
 +
= allocates more h-space if needed
 +
 
 +
- osc_shrinkx
 +
= removes extra h-space if occurred
 +
 
 +
- osc_expandy
 +
= allocates more v-space if needed
 +
 
 +
- osc_shrinky
 +
= removes extra v-space if occurred
 +
 
 +
- osc_invisishrinkx
 +
= fully h-collapses the layouter if "visible=false" ( run-time only )
 +
 
 +
- osc_invisishrinky
 +
= fully v-collapses the layoter if "visible=false" ( run-time only )
 +
 
 +
optionsskin:
 +
= see <any widget>
 +
 
 +
 
 +
Methods:
 +
 
 +
constructor create(aowner: tcomponent); override;
 +
</pre>
 +
 
 +
=== Public stuff ===
 +
<pre>
 +
(f)window:
 +
the OS-allocated ( root = toplevel ) window common for all widgets of this window
 +
 +
* "widget.fwindow.fowner = widget.self" in case of the widget present the root "fwindow"
 +
  ( owns the window )
 +
 
 +
(f)rootpos:
 +
position of the widget in the coord of toplevel window not the nearest parent widget alone,
 +
calculated as sum of such positions ( fwidgetrect.pos ) starting from the toplevel through the
 +
                chain of all parents up to the current widget;
 +
"nullpoint" (0,0) for toplevel widgets ( window-owning forms,..)
 +
 
 +
screenpos:
 +
- coord aginst the top-left corner of screen
 +
- WM decoration & title aren't parts of the widget !
 +
 
 +
widgetrect:
 +
the widget on-screen area including its frame & frame caption
 +
 
 +
paintrect:
 +
the widget on-screen area except its frame & frame caption
 +
 
 +
clientrect:
 +
virtual area which
 +
- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
 +
- for scrolling widgets, may be bigger than "paintrect",
 +
  also may shift ( change its "pos" ) when scrolling
 +
 
 +
* "t*grid" aren't such scrollable widgets since their virtual height would be limited by
 +
  the X11 "+-32000" limitation,
 +
  so example of such widgets are tscrollbox, "tform.container" etc
 +
 
 +
framerect:
 +
the widget on-screen area except its frame caption but including inner & outer frame
 +
 
 +
****************
 +
 
 +
// releases all thread locks then post the event to the app event queue and
 +
// waits for the event handler finishes ( signalled by "sye_ok on a semaphore )
 +
// finally restores the locks
 +
    // true if the handler is not aborted
 +
function synchronizeevent(const aevent: tsynchronizeevent): boolean;
 +
 
 +
    // translates "point" coord against "source" widgetrect to "dest" widgetrect
 +
//
 +
//  * nil "source" = from screen coord
 +
//  * nil "dest" = to screen coord
 +
procedure translatewidgetpoint1(var point: pointty; const source,dest: twidget);
 +
 
 +
// the function-framed version of "translatewidgetpoint1"
 +
function translatewidgetpoint(const point: pointty; const source,dest: twidget): pointty;
 +
 
 +
// rect isntead of point,
 +
// if dest = nil then to screen
 +
    // if source = nil then against screen
 +
function translatewidgetrect(const rect: rectty; const source,dest: twidget): rectty;
 +
//-----------------
 +
    // translates "point" coord against "source" paintrect to "dest" paintrect
 +
//  * nil "source" = from screen coord
 +
//  * nil "dest" = to screen coord
 +
procedure translatepaintpoint1(var point: pointty; const source,dest: twidget);
 +
 
 +
// the function-framed version of "translatepaintpoint1"
 +
function translatepaintpoint(const point: pointty; const source,dest: twidget): pointty;
 +
 
 +
// rect isntead of point,
 +
// if dest = nil then to screen
 +
    // if source = nil then against screen
 +
function translatepaintrect(const rect: rectty;const source,dest: twidget): rectty;
 +
    //-----------------
 +
    // translates "point" coord against "source" clientrect to "dest" clienttrect
 +
//  * nil "source" = from screen coord
 +
//  * nil "dest" = to screen coord
 +
procedure translateclientpoint1(var point: pointty;
 +
                    const source,dest: twidget);
 +
 
 +
// the function-framed version of "translateclientpoint1"
 +
function translateclientpoint(const point: pointty; const source,dest: twidget): pointty;
 +
 
 +
// rect isntead of point,
 +
// if dest = nil then to screen
 +
    // if source = nil then against screen
 +
function translateclientrect(const rect: rectty; const source,dest: twidget): rectty;
 +
    //-----------------
 +
 
 +
// (re)sorts "awidgets" in order of increasing their "widgetrect.x" coords
 +
//  - if parent = nil then the coords are against individual parent of each of "awidgets"
 +
//  - if parent is supplied then the coords are against this parent
 +
procedure sortwidgetsxorder(var awidgets: widgetarty; const parent: twidget = nil);
 +
 
 +
// (re)sorts "awidgets" in order of increasing their "widgetrect.y" coords
 +
//  - if parent = nil then the coords are against individual parent of each of "awidgets"
 +
//  - if parent is supplied then the coords are against this parent
 +
procedure sortwidgetsyorder(var awidgets: widgetarty; const parent: twidget = nil);
 +
 
 +
// for each  of "widgets", calculates its autosized client area ( min size rect to fit the caption, etc )
 +
    //  - both hor & ver sizes of client area of each of "widgets" are adjusted to the max of the above calculated areas,
 +
//   as the result - client areas of all widgets become identically v+h sized
 +
    //
 +
    //  * right & bottom anchored margins of each widget are preserved
 +
procedure syncmaxautosize(const widgets: array of twidget);
 +
 
 +
// for each  of "widgets", width of client area of each of "widgets" is adjusted so that
 +
    // external ( by the outer border of frame ) widths of all widgets become identical
 +
    // to the external widht of the widest widget
 +
    //   
 +
    //  * if "awidth" >= 0 then no determining the widest widget is taken and
 +
    //    "awidth" is adjusted to instead, for all widgets
 +
    //  * right anchored margins of each widget are lost
 +
procedure syncminframewidth(const awidgets: array of twidget;
 +
                              const awidth: integer = -1);
 +
 
 +
// for each  of "widgets", height of client area of each of "widgets" is adjusted so that
 +
    // external ( by the outer border of frame ) heights of all widgets become identical
 +
    // to the external height of the highest widget
 +
    //   
 +
    //  * if "aheight" >= 0 then no determining the highest widget is taken and
 +
    //    "aheight" is adjusted to instead, for all widgets
 +
    //  * bottom anchored margins of each widget are lost
 +
procedure syncminframeheight(const awidgets: array of twidget; const aheight: integer = -1);
 +
</pre>
  
=== TGdbMi ===
+
== Projects using MSEgui ==
=== TSyntaxEdit ===
 
=== TSyntaxPainter ===
 
  
== Comm ==
+
* [[Projects using MSEgui]]
 
 
=== TCommPort ===
 
=== TAsciiCommPort ===
 
=== TAsciiProtPort ===
 
=== TCommSelector ===
 

Latest revision as of 23:07, 9 April 2021

English (en)

Widgets

TSimpleWidget

see also Reference:_MSEgui/TSimpleWidget

TMainMenuWidget

TSimpleWidget

TMseFormWidget

Use it in order to insert a tcustomform descendant into another widget at designtime. Does not try to load resources in "create".

        tmseform descendants ( MainForm, SimpleForm,.. )

	Client area of the form & parent of its widgets ( against which the widgets 
	are placed and colored ) is presented by the "container" property 
	not "container.frame.clientarea"

	CanClose is called :

		- on receiving "ek_close" by window
		- for modal window, on focus change

		- within parent window's "CanClose"	where all nested windows are  
		checked for OnCloseQuery & OnClose - if any sets "mr_none" then the parent window 
		can't close as well
			
		- from nested window's "CanParentClose"
		- from own "CanParentClose"

		- some componnets build oneself in own "Loaded" procedure :
			= widget grids
			= database access components
			= ...

	The "form.show" has parameter "transientfor".
	The window Z-order is above the "transientfor" window. The exact behaviour
	depends on the window manager.
        
        caption
		- run-time caption on the title bar

	color
		- color behind the client ( contaner ) area

	container
		- the real parent of form's widgets, <see "tformscrollbox">

	cursor
		- the mouse over cursor shape

	enabled - "false" disables all child widgets

	face
		<see "tfacecomp"> + some more options

	font
		<see "tfont">

	frame
		<see "tframecomp"> + some more options
		
	icon 
		<see "timage">

	mainmenu
		<see tmainmenu>

	name
		- name to refer when programming

	options:

		fo_main 
			- assigns this from as the aplication GUI-face & event receiver
			- causes the icon of this form to be icon of the application 

		fo_terminateonclose
			- causes the application to terminate once the form has closed ( doesn't depend on "fo_main" )


		fo_freeonclose
			- causes the form (even being modal) to release its memory on closure or OK-return from "CanClose"

		fo_defaultpos
			- lets the WM to position the form initially

		fo_screencentered
			- causes the form initially to show in center of the apllication work area

		fo_closeonesc
			- causes the form to close on "Esc" key pressed ( with MR_ESCAPE & "OnCloseQuery" firing )

		fo_cancelonesc
			- causes the form to close on "Esc" key pressed ( with MR_CANCEL & "OnCloseQuery" firing )

		fo_closeonenter
			- causes the form to close on "Enter" key pressed ( with MR_OK & "OnCloseQuery" firing )

		fo_closeonf10
			- causes the form to close on "F10" key pressed ( with MR_F10 & "OnCloseQuery" firing )

		fo_globalshortcuts
			- allows on-this-form "ao_globalshortcut" actions to trigger

			  Notes :
				= shortcuts for modal not "fo_localshortcut" forms are processed by app
				= shortcuts for "fo_globalshorcut" forms are processed by the owning window 

		fo_localshortcuts
			- disables triggering shortcuts of on-this-form actions

		fo_autoreadstat
			- for "cs_ismodule" forms, before "OnLoaded" fires, rereads all statvars from the bound stafile/memorystream

		fo_autowritestat
			- in "CanClose", after "OnClose" fires [ and before app termination for "fo_terminateonlose" form ], 
			rewrites all statvars to the stafile/memorystream
			- for datamodules, does this before "OnDestroy" fires

		fo_savepos
			- saves/restores Z-order, size & scree coordinates of the form 
			as soon as the stat data are ready

		fo_savestate
			- for top-level form, saves/restores "VSize", "Active" & "Visible" 
			as soon as the stat data are ready

	optionswidget
		<see "any widget">
	optionswindow
		<see "any window">
	popupmenu
		<see "tpopupmenu">
	stafile
		<see "tstafile">
	stavarname
	taborder
	tag

	visible - for a form, only affects its childs widgets

	Events:

		activate = to set focused & redraw the invalidated area

		oncreate
			- fires before "Loaded" procedure is called
			- fires after creating the widget & its subwidgets but before the final arrangement
			- forms arent' yet visible on return

		  Since "Loaded" procedure hasn't yet worked at this point then 
			database contents, values of widget grid's subwidgets 
			are invalid in this event ***

		onloaded
			- fires once "Loaded" procedure of owns & all form's widgets finishes
			- processed  after "OnCreate"
			- on finishing, forms aren't yet visible

		oneventloopstart ( main forms only )
			- only applicable to main forms
			- fires once all application GUI is built and shown 
			( and ready to user's interaction )
			
		onactivate 
			- see {any_widget.OnActivate}

		onenter
			= see {any_widget.OnEnter}

		onfocus
			- see {any_widget.OnFocus}
			

		onwindowactivechanged
			- fires on :
				= touching another window even on clicking in a behind-modal window ( or its title bar )
				= 1-st showing the window
				- reactivating the window

		onbeforepaint
			- fires at the very beginning of "paint", before drawing canvas

		onpaint
			- fires in "paint" procedure, between drawing canvas and contained widgets

		onafterpaint (doafterpaint)
			- fires just on return from "paint" procedure

        	onapplicationactivechanged 
			- fires :
				= if the application gets/looses input focus

		onasyncevent (doasyncevent)
			- fires on calling {this_form}.asyncevent(atag) from any place of the application
			once delivered by the app even queue

			 "atag" set by caller(s) helps to branch within "onasyncevent", to identify the caller, etc ***
			 generally, doesn't fire instantly because these events are delivered through the app event queue ***


		onchildmouseevent
			- fires on any mouse activity over its child widget(s) not the (containing) widget oneself

		      for forms, it even fires on enetering "container" therefore it appears as if to be the form itself ***

		onchildscaled
			- see {any_widget.OnChildScaled}

		onclientmouseevent
			- fires on any mouse activity over areas expecting user's mouse input (not titlebars/frames/...)

		onclose
			- fires in "CanClose" if "modalresult <> mr_none"

		onclosequery
			- fires in "CanClose" before "OnClose"
			- "mr_none" set on return prevents the window (and its parent) from closing 
			( "OnClose" is also bypassed )


		ondeactivate
			- see {any_widget.OnDeactivate}

		ondefocus
			- see {any_widget.OnDeFocus}
			
		ondestroy
			- fires on in-code calling "BeforeDestruction"

		ondestroyed
			- fires on return from the form's destructor ( when all resources are freed )

		onterminatequery
			- fires on an attempt to terminate the app
			- by setting "var terminate:= false", allows to cancel termination 

			 Termination by debugger/OS facilities can't be blocked this way ( win32 )***

		onterminated
			- fires for not-yet-destroyed forms, once the app event loop finishes 
			- may be caused by any closure of the main app form 
			( app termination, WM/OS facilities, )


		onwindowdestroyed
			- fires once a descendant window is destroyed 
			( for a main form, when a modal simple form is closed by any way,.. )

		onevent
			- fires on receiving an event 
				= for simple forms, it's only "ek_loaded"

			There can be more if the form is connected to object_event sending
			components or if the application uses object events, for example by calling
			tguicomponent.postcomponentevent. ****

		onexit
			- see {any_widget.OnExit}

		onfocusedwidgetchanged
			- for a "prev-new" parent-wide focused wigdets pair, fires once installing new focus has finished, 
			after "OnFocus"
			- resends for all contained widgets
			- doesn't fire if the "prev-new" pair don't really change

		onfontheightdelta
			- see {any_widget.OnFontHeightDelta}

		onhide
			- fires at beginnig of own/parent's 
				= hide
				= hidden
				= destroying
				= setting "visible:= false"
				= closing the window ( receiving event "ek_close",.. )
				= calling "window.close" 
				
		onidle
			- fires everytime when the app GUI event queue gets empty
			- to stop calling for a while, set "again" parameter to "false" (the initial value );
			
			 DON'T DO ANYTHING AFFECTING THE APP EVENT QUEUE ( MODAL WINDOWS, "ShowMessage", Sleep(N),... ) IN THIS HANDLER. 
				MODAL WINDOWS CAUSE RECURSION ! 
			
			A code fragment:

				again:= i < 5;
				if not again then exit;

		onkeydown
			- fires on pressing down a keyboard key over the client area when none of child widgets is focused

		onkeyup
			- fires on releasing a keyboard key over the client area when none of child widgets is focused

		onmouseevent
			- fires on any mouse activity over the client area

		onmove
			- see {any_window.OnMove}

		onpopup
			- see {any_widget.OnPopup}

		onresize
			- see {any_widget.OnResize}

		onshortcut
			- fires before built-in shorcut processing
			- "info.eventstate=es_processed" set in "OnShortcut" prevents 
			the event from further auto-processing

			The app 
				- recognizes & takes registered shortcuts from app event queue
				- passes the shocrcut event to each of its windows until the event 
				is processed otherwise processes it by oneself 
			

		onshow
			- fires if the widget is visible:
				= on calling "Show" method
				= on return from "Loaded" procedure
				= on showing the parent widget
			- since called at end, allows to adjust the default behavior

		onshowhint
			- see {any_widget.OnShowHint}

		onstatbeforeread 
			- fires before loading statvars  from the disk file

		onstatafterread
			- fires once statvars are loaded from the disk file

		onstatupdate 
			- fires at 1-st stage before updating GUI "state/pos" for read statvars
			or 
			- fires at pre-last stage before saving GUI "state/pos"

		onstatread 
			- fires at 2-nd stage before updating GUI "state/pos" for read statvars

		onstatwrite
			- fires at last stage before saving GUI "state/pos"

		pon stat reading, non-minimized visible windows are shown, 
		the active window is activated 

TDockFormWidget

TPaintbox

How to draw line (or circle) on tpaintbox? In event onpaint:

 
 procedure tmainfo.paintboxonpaint(const sender: twidget; const canvas: tcanvas); 
 begin 
  with sender,canvas do begin 
   drawline(nullpoint,pointty(size),cl_yellow);  
   //diagonal line across widget 
   drawellipse(makerect(makepoint(bounds_cx div 2,bounds_cy div 2), size),cl_red); 
   //circle (or ellipse) centered in widget                             
  end; 
 end;

Makepoint and makerect are in msegraphutils.

TEventWidget

A widget which publishes all possible events of a twidget. Normally it is better to implement your own specialized descendant of an existing widget instead to use teventwidget.

TButton

  • A rectangular clickable area that can show text/bitmap.

- Main properties:

Caption: read/write the text that appear on top of it.
onexecute: read/write the address of a procedure (event handler) to be executed when clicked.

TStockGlyphButton

TRichButton

TLabel

  • Draws a piece of text on the given surface (canvas: screen/printer/bitmap).

- Main properties:

Caption: read/write the piece of text.

See also TLabel

TGroupBox

TStepBox

TStringDisp

  • A read only version of TStringEdit, difference from TLabel: has a frame around it.

-Main properties:

Value: read/write the text that are showed.
Caption: A label normally describing the purpose or meaning of the presented text, it can be positioned around the frame.

TByteStringDisp

TIntegerDisp

TRealDisp

TDateTimeDisp

TBooleanDisp

TToolBar

TDrawGrid

TStringGrid

TTabBar

TTabPage

TTabWidget

TDockHandle

TDockPanel

TSpliter

	       A widget very similar to "tspacer" but :
		- designed to rearrange areas occupied by adjacent widgets
		- a linked widget may only enlarge by "eating" the opposite one, 
		so the summary area of both widgets don't change
		- has GUI look ( hatched grip, color etc) switched on by default
		- facilitates run-time repositioning oneself and linked widgets
		- linked widgets may even be other splitters, spacers (with their linked widgets ),..
	
        Properties:

	- color
		= see {any_widget.color}

	- cursor
		= see {any_widget.cursor}

	- enabled
		= "false" stops user interaction

	- face
		= see {any_face}

	- frame
		= see {any_frame}

	- colorgrip
		= color of grip hatching

	- grip
		= defines hatching pattern of the grip

			* stb_dens(N) : the pattern is of rhombuses, the painted rhombs occupy "N" persents of the grip

			* stb_block(N) : the pattern is of squares, painted & unpainted squares are equally sized and 
			both have "N" pixels sides
			
			* stb_hatchup(N) : the pattern is of right-tilted lines of 1 pixel width,
			each "N"-th pixel forms these lines

			* stb_hatchdown(N) : the pattern is of left-tilted lines of 1 pixel width,
			each "N"-th pixel forms these lines

			* stb_crosshatch(N) : the pattern is of crossing (left & right) tilted lines of 1 pixel width,
			each "N"-th pixel forms these lines


	- linkbottom/linkleft/linkright/linktop 
		= see {tspacer.*}

	- options

		= spo_hmove
			* "true" allows the spliter to move horizontally

		= spo_hprop
			* "true" : keep the left position proportional ( on the ratio of creation time ) 
			to weigth of the client area of parent

		= spo_hsizeprop
			* "true" : keep width of the spacer proportional ( on the ratio of creation time ) 
			to weigth of the client area of parent
			* the width stops shrinking on one set in design time

		= spo_vmove
			* "true" allows the spliter to move vertically

		= spo_vprop
			* "true" : keep the top position proportional ( on the ratio of creation time ) 
			to height of the client area of parent

		= spo_vsizeprop
			* "true" : keep height of the spacer proportional ( on the ratio of creation time ) 
			to height of the client area of parent
			* the height stops shrinking on one set in design time

		= spo_dockleft
			* causes the "linkleft" widget to dock to the left border of splitter
			* make sence only if linkleft "widget.bounds_x" less than "splitter.bounds_x"

		= spo_docktop
			* causes the "linktop" widget to dock to the top border of splitter
			* make sence only if linktop "widget.bounds_y" less than "splitter.bounds_y"

		= spo_dockright
			* causes the "linkright" widget to dock to the right border of splitter
			* make sence only if linkright "widget.(bounds_x+bounds_cx)" more than "splitter.(bounds_x+bounds_cx)"

		= spo_dockbottom
			* causes the "linkbottom" widget to dock to the bottom border of splitter
			* make sence only if linkbottom "widget.(bounds_y+bounds_cy)" more than "splitter.(bounds_y+bounds_cy)"

		!!! Two special cases :

		1. (spo_dockleft = spo_dockright = TRUE) && (linkleft = linkright = the_same_widget) : 
			causes the "linkleft" widget to adjust to h-positiion & width of the splitter, 
			it's even possible that the widget doesn't touch the splitter

			(spo_docktop = spo_dockbottom = TRUE) && (linktop = linkbottom = the_same_widget) : 
			causes the "linktop" widget to adjust to v-position & height of the splitter, 

			It's even possible in these cases that the widget doesn't touch the splitter

	- optionsscale
		= see {tscalingwidget.optionsscale}

	- optionswidget
		= see {anywidget.optionswidget}

	- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus,
	  onfontheightdelta, onmove, onpopup, onresize, onshowhint
		= see "tspacer"

	- onupdatelayout
		fires :
		
		= on creating the splitter
		= on any reposition of the linked widgets 
		( due to moving the splitter, resizing the parent,.. )

TSpacer

* a regular widget which creates a kind of positional link between surrounding widgets
* designed to maintain distances between widgets
* may have GUI look, caption etc switched off by default
* resizing a spacer repositions its linked widgets

Properties:

- anchors = see {any_widget.anchors}

- bounds = see {any_widget.bounds}

- color = see {any_widget.color}

- enabled = "false" turns color of the caption to gray

- visible = "true" allows displayable settings (caption text, face, frame etc) to take effect in run-time as well

- <face> = see {any face}

- <frame> = see {any frame}

- linkbottom = widget linked down to most outer edge (incl. frame[.caption]) of the spacer - linkleft = widget linked left to most outer edge of the spacer - linkright = widget linked right to most outer edge of the spacer - linktop = widget linked up to most outer edge of the spacer

- dist_bottom, dist_left, dist_right, dist_top : = margins between most outer edge the spacer and the corresponding linked widget

- options :

= spao_glueright

- if "false"

h-repositioning or h-resizing the linkleft widget shifts the whole linked construction, it becomes the only way to h-shift

if {an_right IN linkright_widget.anchors} then the spacer may be right-resized with auto h-resizing the linkright widget so that the right margin of that widget is kept

if NOT {an_right IN linkright_widget.anchors} then the spacer may be right-resized with auto h-shifting the linkright widget so that width of that widget is kept

- if "true"

h-repositioning or h-resizing the linkright widget shifts the whole linked construction, it becomes the only way to h-shift

if {an_left IN linkleft_widget.anchors} then the spacer may be h-resized with auto h-resizing the linkleft widget so that the left margin of that widget is kept

if NOT {an_left IN linkleft_widget.anchors} then the spacer may be h-resized with auto h-shifting the linkleft widget so that width of that widget is kept

= spao_gluebottom

- if "false"

v-repositioning or v-resizing the linktop widget shifts the whole linked construction, it becomes the only way to v-shift

if {an_bottom IN linkbottom_widget.anchors} then the spacer may be v-resized with auto v-resizing the linkbottom widget so that the bottom margin of that widget is kept

if NOT {an_bottom IN linkbottom_widget.anchors} then the spacer may be v-resized with auto v-shifting the linkbottom widget so that height of that widget is kept

- if "true"

v-repositioning or v-resizing the linkbottom widget shifts the whole linked construction, it becomes the only way to v-shift

if {an_top IN linktop_widget.anchors} then the spacer may be v-resized with auto v-resizing the linktop widget so that the top margin of that widget is kept

if NOT {an_top IN linktop_widget.anchors} then the spacer may be v-resized with auto v-shifting the linktop widget so that height of that widget is kept

- optionsscale = see {tscalingwidget.optionsscale}

- optionswidget = see {anywidget.optionswidget}

- onactivate, onchildscaled, ondeactivate, ondefocus, onenter, onexit, onfocus, onfontheightdelta, onpopup, onresize, onshowhint = see {any_widget.*}

- onmove = see {any_window.OnMove}

any "link*" option set disables the spacer to reposition solely, repositioning is only controlled by a "glued" widget since then

TLayouter

  • a tspacer descendant designed to (auto)resize or/and move its contained widgets acc to some size/positon dependencies
  • may have GUI look, frame caption etc switched off by default
  • layouters may be nested to achieve complex layouts

Each layout change/assignment is divided into performing 3 consequent stages :

Stage 1

Widgets auto resized using the following options:

- if {lao_placex OR lao_placey} :

		= if {plo_scalesize in optionslayout}  then
			* widgets with "osk_nopropwith" unset in their "optionsskin" are h-scaled 
		  	  in the proportion of change of tlayouter's clientwidth
			* widgets with "osk_nopropheight" unset in their "optionsskin" are v-scaled 
		  	  in the proportion  of change of tlayouter's clientheight

			For h-resized layouter, the effect looks like :

		 	 |--Widget__1---Widget__2--|		=> the initial look

		  	 |--Widget_1--Widget_2--|			=> the layouter gets narrower

		  	 |---Widget___1---Widget___2---|	=> the layouter gets wider

			*** both widget sizes & margins are affected ***
			*** Widget_N may generally situate on different y-levels *** 
		  	
	otherwise :

		= if lao_scalewidth in optionslayout :
			* widgets with "osk_nopropwith" unset in their "optionsskin" enters in the mode 
		 	  ( not applied until the layouter resizes! ) when they are h-scaled in the proportion 
		 	  as far as clientwidth of the tlayouter changes, then stages 2 & 3 are reapplied

			For h-resized layouter, the effect looks like :

			  |--Single____widget????|		=> the initial look

			  |--Single__widget???|			=> the layouter gets narrower

			  |--Single_______widget?????|	=> the layouter gets wider

			* also, if {lao_scaleleft in optionslayout} then left margins of the widgets 
			  with unset "optionsskin.osk_nopropleft" resize too otherwise retain

		= if lao_scaleheight in optionslayout :
			* widgets with "osk_nopropheight" unset in their "optionsskin" enters in the mode 
		 	  ( not applied until the layouter resizes! ) when they are v-scaled in the proportion 
		  	  as far as clientheight of the tlayouter changes, then stages 2 & 3 are reapplied

			* also, if {lao_scaletop in optionslayout} then top margins of the widgets 
			  with unset "optionsskin.osk_noproptop" resize too otherwise retain

			*** only widget sizes & margins not distances between them are affected ***

Stage 2

Widgets may be auto resized in 5 consequent steps using the following options:


1. if plo_syncmaxautosize in place_options :
   = all widgets are autosized then their client areas are synchronised to the
     clientareas of the highest and the widest of the widget
   * calls "msegui.syncmaxautosize"

2. if plo_syncpaintwidth in place_options :
   = the paintwidths of all widgets are synchronized to the widget with the
     widest outer frame width ( ex. width of "frame.caption" )
   * mainly makes sense if "lao_alignx" set and {align_glue = wam_start or wam_end}
     ( see below ) when the widgets will be adjusted in order to fit into the
     inner client width of tlayouter:

                                   x-align level           
                                         V                 
                        +----------------------------------+
                        | Widget_1 the_widest_frame_caption|
                        | Widget_2 frame_caption2          |
                        | Widget_N wider_frame_captionN    |
                        +----------------------------------+

   here, the effect is shown for "cp_right" frame captions
     // otherwise syncronizes to the outer ( of the frame except its caption ) width 
     // of the Z-top widget
   * calls "msegui.syncpaintwidth"
   * paintwidth is the outer width

3. if plo_syncpaintheight in place_options :
   = the paintheights of all widgets are synchronized to the widget with the
     highest outer frame width ( ex. width of "frame.caption" ).
   * mainly makes sense if lao_aligny set and {align_glue = wam_start or wam_end}
     ( see below ) the widgets will be adjusted in order to fit into the inner
     client height of tlayouter :

                        +------------------------------+
                        | The_                         |
                        | tallest_            taller_  |
                        | frame_    frame_    frame_   |
                        | caption   caption2  captionN |  
                        |                              |
                        | Widget1   Widget_2  Widget_N |<== y-align level 
                        +------------------------------+     		

  here, the effect is shown for "cp_topleft" frame captions
    // otherwise syncronizes to the outer ( of the frame except its caption ) 
    // height of the Z-top widget
  * calls "msegui.syncpaintheight"
 
4. plo_synccaptiondistx in place_options :
   = causes all widgets to have the widest common room for their cp_(left/right)* frame captions
   * calls "msegui.synccaptiondistx"
 
5. plo_synccaptiondisty in place_options :
   = causes all widgets to have the highest common room for their cp_(top/bottom)* frame captions
   * calls "msegui.synccaptiondisty"

Stage 3

The widgets may be (re)arranged within the layouter.

There're 2 modes of such (re)arrangement which can be partially (orthogonally)
combined (see later):

1) The place(ment) mode ( lao_place* in optionslayout ) :

- widgets are placed at some distances between each other, possibly with some
  margins, rooms of invisible widgets ( having visible=false) are also allocated
  unless "plo_noinvisible in place_options"

  * the widgets are placed in the order of decreasing their "widgetrect.x"
	coordinates before alignment
  
  * the inter-widget distances and the side margins ( if apllied ) in both
	dimentions are identical and limited between "place_mindist" and
	"place_maxdist"
  
  = if {lao_placex in optionslayout} and {place_mode <> wam_none} then the
	following relevant settings apply:
  
	* non-limiting value of "place_maxdist" :
	
		# |Widget_1------Widget_2------Widget_3| 
	
	* non-limiting value of "place_maxdist" and {plo_propmargin in place_options} :
	
		# |---Widget_1---Widget_2---Widget_3---|
		
	* limiting value of "place_maxdist" and {place_mode = wam_start} :
	
		# |Widget_1----Widget_2----Widget_3????|
		
	* limiting value of "place_maxdist" and {place_mode = wam_start} and
	  {plo_propmargin in place_options} :
	
		# |---Widget_1---Widget_2---Widget_3???|
		
	* limiting value of "place_maxdist" and {place_mode = wam_end} :
	
		# |??????Widget_1---Widget_2---Widget_3|
		
	* limiting value of "place_maxdist" and {place_mode = wam_end} and
	  {plo_propmargin in place_options} :
	
		# |???Widget_1---Widget_2---Widget_3---|
		
	* limiting value of "place_maxdist" and {place_mode = wam_center} :
	
		# |???Widget_1---Widget_2---Widget_3???|
		
	* limiting value of "place_maxdist" and {plo_endmargin in place_options} :
	
		# |Widget_1----Widget_2----Widget_____3|, or
		
		# |Widget_1----Widget_____2----Widget_3|, or
		
		# |Widget_____1----Widget_2----Widget_3|, here, the most left amongst
		widgets having both [an_left,an_right] set is expanded otherwise the most
		right widget ( Widget_3 in the example )
		
	* limiting value of "place_maxdist" and {place_mode = wam_end} and
	  {plo_propmargin in place_options} and {plo_endmargin in place_options} :
	  
		# |--Widget_1--Widget_____2--Widget_3--|,
		  
	The Legend:
	===========
	limiting value of "place_maxdist" : such value which produce some visual
	effect on the layouter
	
	  "----" :           distance ( = number of minuses, limited by place_maxdis )
	  "????" :           some remaining space ( = number of questmarks )
	  "Widget_1" :       widget of the original size
	  "Widget__..__1" : (auto)resized widget
  
  = if {lao_placey in optionslayout} and {place_mode <> wam_none} then the things
	are handled in the same manner as with "lao_placex" but for the vertical
	"top2bottom" direction of placement instead of the horizontal "left2right" one.

2) the align(ment) mode ( optionslayout.lao_align* ) :

- widgets are gathered into a visual group to a dedicated "leader" widget of
  the layout ( set by "align_leader" and defaults to the lowest in
  Z-Order = twidget.widgets[0] ) the leader stays in place while the others :

  = if lao_alignx in optionslayout ( the hor alignment mode ):
	  * if align_mode = wam_start :
		snap their left borders to the left border of leader
	  * else if align_mode = wam_end :
		snap their right borders to the right border of leader
	  * else if align_mode = wam_center :
		snap their v-axes to the v-axis of leader after that,
  = if lao_aligny in optionslayout ( the vert alignment mode ):
	  * if align_mode = wam_start :
		snap their top borders to the top border of leader
	  * else if align_mode = wam_end :
		snap their bottom borders to the bottom border of leader
	  * else if align_mode = wam_center :
		snap their h-axes to the h-axis of leader

- after that, the whole widget group can be aligned within the layouter:

  = if align_glue =  wam_start
	  * if lao_alignx in optionslayout:
		the left extent of group snaps to the left border of layouter
	  * if lao_aligny in optionslayout:
		the top extent of group snaps to the top border of layouter
  = else if align_glue = wam_end
	  * if lao_alignx in optionslayout:
		the right extent of group snaps to the right border of layouter
	  * if lao_aligny in optionslayout:
		the bottom extent of group snaps to the bottom border of layouter
  = else if align_glue =  wam_center
	  * if lao_alignx in optionslayout:
		the v-axis of group snaps to the v-axis of layouter
	  * if lao_aligny in optionslayout:
		the h-axis of group snaps to the h-axis of layouter

Mutually exclusive settings:
* only one of "align_mode" can be choosen
* only one of  "glue_mode" can be choosen
* "optionslayout.lao_alignx" & 	"optionslayout.lao_placex"
* "optionslayout.lao_aligny" & 	"optionslayout.lao_placey"

V-alignment ( optionslayout.lao_aligny ) may be combined with h-placement
( optionslayout.lao_placex ), and h-alignment ( optionslayout.lao_alignx ) may
be combined with v-placement ( optionslayout.lao_placey )

NOTE:
  The effects of the above described { resizing / placement / alignment } are
  irreversible. So, the only way to revert is to set "wan_none" then to revert
  manually.

TListView

TImage

<any image>

	*** Note that switch to the monochrome mode is irerreversible ! ***

	alignment:

		By default, images are top-left aligned, with the original size preserved.

		al_xcentered = centers the image horizontally
		al_ycentered = centers the image vertically

		al_right = docks the image to the right border of placeholder
		al_bottom = docks the image to the bottom border of placeholder

		al_grayed = fills non-transparent areas with the selected color

		al_stretchx = adjusts size so that to fill the placeholder in width
		al_stretchy = adjusts size so that to fill the placeholder in height
		al_fit = adjusts size so that to fill the placeholder in both width & height

		al_tiled = spawns the image & tile the whole  placeholder with the copies 

		Interpolation mode while stretching

			al_intpol =	antialiases as far as the size changes 
						(the only working in Linux)
			al_or = interpolation pixel operation is "or" -> 1's are extended
			al_and = interpolation pixel operation is "and" -> 0's are extended
		( al_or and al_and only on win32, mainly useful for stretching of monochrome bitmaps) :

	colorbackground = color of image transparent ( masked ) areas in monochrome 
						non-masked mode 
	colorforeground = color of non-transparent areas in monochrome mode  

	options:

		bmo_monochrome = fills non-transparent areas with "colorforeground", 
						also, in non-masked mode, fills transparent areas 
						with "colorbackground"

		bmo_masked = activates built-in image transparency {it "hides" transparent (masked) areas}
		bmo_colormask = applies faded edge transparency on the color masked areas in the image

	transparency = makes the image transparent as long as enlights areas behind 
					the image with the selected color

	transparentcolor = for a non-masked image, assigns a color indicate transparency areas
					( on matching areas, the image will be seen through )

TDial

TChart

There are demos here:

https://github.com/mse-org/mseuniverse/tree/master/attic/msedocumenting/mse/trunk/help/tutorials/widgets/charts

TChartRecorder

TPolygon

TPickWidget

TOpenglWidget

Edit

TStringEdit

TMemoEdit

THexStringEdit

TDropdownListEdit

A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
- deo_autodropdown dropdown on keypress
- deo_selectonly don't allow entering arbitrary text.
- deo_forceselect don't allow entering empty text.

THistoryEdit

A tstringedit which shows the previously entered values in a dropdownlist for selection.

TIntegerEdit

TKeyStringEdit

Maps string to string.

TEnumEdit

Maps integer to string, zero based and sequencial (first item 0, next 1, ...).

TEnumTypeEdit

A TEnumEdit which maps Pascal enums to their names. Use OnInit event to store the typeinfo pointer of the enum type into sender.typeinfopo.

 
procedure tmainfo.enumtypeeditinit(const sender: tenumtypeedit);
begin
  sender.typeinfopo := PTypeInfo(TypeInfo(TMyEnumeratedType));
end;

TSelector

TSelector is the most specialized widget of the dropdown editwidget group, it is based on tenumedit (tenumedit maps an integer to a string) and uses for the dropdownlist a second map which must be created on the fly in ongetdropdowninfo. An example is tcommselector where the enumedit maps commnrty to commname and the dropdownlist shows the available RS232 ports only.

TRealEdit

TRealSpinEdit

TDateTimeEdit

TCalendarDateTimeEdit

TEdit

MSEgui counterpart of Delphi TEdit. You will never use it.

TWidgetGrid

TItemEdit

TDropDownItemEdit

A tstringedit with a dropdownlist to choose text values. Important dropdown.options members:
- deo_autodropdown dropdown on keypress
- deo_selectonly don't allow entering arbitrary text.
- deo_forceselect don't allow entering empty text.

TMBDropDownItemEdit

TTreeItemEdit

TRecordFieldEdit

Used in twidgetgrid in order to edit fields of a ttreeitemedit. Example is MSEide projecttreeform.pas.

TDialogStringEdit

A tstringedit with an ellipse button. Use "onexecute" to show the dialog.

TPointerEdit

TSlider

TProgressBar

TBooleanEdit

TBooleanEditRadio

TDataButton

A button with an integer value. Clicking increments the value until "max", then it restarts with "min". Can be inserted into a twidgetgrid. The current value selects the showed image and face by the items of "imagenums" and "valuefaces".

TStockGlyphDataButton

TDataIcon

Shows an imagelist item by lookup from "value" to "imagenums". Clicking increments value until "max" then it restarts with "min". Can be inserted into a twidgetgrid.

TTextEdit

Only useful if inserted into a twidgetgrid, builds a text editor, used in MSEide source editor.

TDataImage

A pixmap display widget which can be inserted into twidgetgrid.

TTerminal

Only useful if inserted into a twidgetgrid, builds a very simple terminal emulator. Used in MSEide target console.

NoGui

TAction

	Shortcut processing order :

	- the smallest piece of processing is "doshortcut" procedure which 
	is called until processed:
		= starting from the sender up to the toplevel widget
		= then by all child widgets with non-set "ow_noparentshortcut" 
		= then, if "ow_nochildshortcut" isn't set, by the parent widget
		= then by the widget oneself
	
	- "doshortcut" is checked in the following order:
		= starting from form's main menu
		= then from the owning window ( the widget oneself ) 
		= then from the application


		*** A shortcut is bound to a widget by :
			- placing an action component on the widget ***
			- direct assigning the shortcut to the widget (menus,..) 
	---------------------------

		caption, color, colorglyph, helpcontext, hint, imagecheckedoffset,
		imagelist <see "timagelist">, imagenr, imagenrdisabled

			- sets look of "clients" (buttons, menu/toolbar items,..), unless 
			these clients have "state.as_local*" set :

		*** For meaning of these options, see help on the "client" widgets ***

	group
		- default value for one-named property of the bound widgets
		( menu items,... )

	options :
		ao_updateonidle
			- runs this action in cycle, waiting for no gui events everytime

		ao_globalshortcut 
			- allows the action to trigger on a non-main form
			  (the shortcut is triggered whatever form of the applicatin it was pressed on, 
			  otherwise only when the form where the aption is placed on is focused )

		ao_nocandefocus 
			- causes the action not to call "CanDefocus" for focused edit widget of active form
			  before executing own code
			  ( it helps to avoid the effect of cancelling changes in these widgets 
			  on activating the bound shortcut )

	shortcut
		- keyboard combination triggering the action

	shortcut
		- alternative "shortcut" and handled identically

	state :

		as_disabled
			- prevents the action from triggering, also puts the bound widgets to "disabled" look

		as_invisible
			- in run-time, hides the bound widget, still reacting on the shortcut or direct call

		as_checked
			- selects the bound menu item if it has "mao_checkbox" option set

		as_default
		as_local*

	statfile	
		<see "tstatfile">

	stavarname

	
	tagaction
	onasyncevent
	onchange
	onexecute
	onupdate

TActivator

TCustomLookupbuffer

	-	provides a group of parallel arrays of float(=datetime), integer and widestring types,
		and facilities to :
			= search in any array
			= on found position, quickly obtain corresponding value in another array
	-	for each type, several arrays  may be kept
	- 	each array is integer-indexed, even string ones ( case[in]sensitive )
	-	uses two way of accessing arrays data, through :
			= physic : array storage index ( row number ) directly
			= logical : the integer index ( see above ):
				first, physic row number is known for the logical index then the data 
				are accessed with the found number

			*** logical index values are built automatically based on array values, 
			on updating its data ***
	- dont' have interface to load data ( see its descendants for that )
	
	fieldcountfloat - number of float arrays
	fieldcountinteger - number of integer arrays
	fieldcounttext - number of widestring arrays

	Event handlers:
		- onchange

	Public interface:

   		procedure beginupdate; - marks beginning of "update"
   		procedure endupdate; - if all "update" finished, fires "onchange" event
	 	procedure clearbuffer; - clears all arrays then fires "onchange"

   		procedure checkbuffer; 
   			- [re]loads the arrays with most actual data
   			- just a stub here since doesn't have a data source

   		function find(const fieldno: integer; const avalue: integer/realty/msestring;
         	out aindex: integer; const filter: lbfiltereventty = nil): boolean;
			- applies external filtering ("filter" procedure) then incrementally searches integer/realty(datetime) array "fieldno" 
			for value "avalue" starting from logical index "aindex", returns "true" and the updated logical index 
			if found else next bigger; 

   		function find(const fieldno: integer; const avalue: msestring;
                 out aindex: integer;
                 const caseinsensitive: boolean;
                 const filter: lbfiltereventty = nil): boolean; overload;
			- applies external filtering ("filter" procedure) then incrementally searches widestring array "fieldno" for value "avalue", 
			in "caseinsensitive" manner, starting from logical index "aindex", returns "true" and the updated logical index 
			if found else next bigger;

   		function findphys(const fieldno: integer; const avalue: integer;
         	out aindex: integer; const filter: lbfiltereventty = nil): boolean; overload;
			- applies external filtering ("filter" procedure) then incrementally searches integer/realty(datetime) array "fieldno" 
			for value "avalue" starting from row number "aindex", returns "true" and the updated row number 
			if found else next bigger; 

		function findphys(const fieldno: integer; const avalue: msestring;  out aindex: integer; const caseinsensitive: boolean;
                 const filter: lbfiltereventty = nil): boolean; overload;
			- applies external filtering ("filter" procedure) then incrementally searches widestring array "fieldno" for value "avalue", 
			in "caseinsensitive" manner, starting from row number "aindex", returns "true" and the updated row number  
			if found else next bigger;

			The external filtering ("filter") procedure takes the arguments of the caller 
			togehther with physical row number found in the caller which allows 
			to check several values at once for that number, within the filter
			
		function integervaluephys(const fieldno,aindex: integer): integer;
			-  returns value of integer array "fieldno" at row number "aindex" 
              
		function integervaluelog(const fieldno,aindex: integer): integer;
			-  returns value of integer array "fieldno" where the array index equals to "aindex" 

		function integerindex(const fieldno,aindex: integer): integer;
			- returns row number of integer array "fieldno" where the array index equals to "aindex"

		function integerindexar(const fieldno: integer): integerarty;
			- returns all bunch of indexes of integer array "fiedlno"

		function integerar(const fieldno: integer): integerarty;
			- returns all bunch of data of integer array "fiedlno"
   
		function floatvaluephys(const fieldno,aindex: integer): realty;
			-  returns value of real/datetime array "fieldno" at row number "aindex" 

		function floatvaluelog(const fieldno,aindex: integer): realty;
			-  returns value of real/datetime array "fieldno" where the array index equals to "aindex" 

		function floatindex(const fieldno,aindex: integer): integer;
			- returns row number of real/datetime array "fieldno" where the array index equals to "aindex"

		function floatindexar(const fieldno: integer): integerarty;
			- returns all bunch of indexes of real/datetime array "fiedlno"

		function floatar(const fieldno: integer): realarty;
			- returns all bunch of data of real/datetime array "fiedlno"   

		function textvaluephys(const fieldno,aindex: integer): msestring;
			-  returns value of widestring array "fieldno" at row number "aindex" 

		function textvaluelog(const fieldno,aindex: integer;
                       const caseinsensitive: boolean): msestring;
			-  returns value of widestring array "fieldno" where the array index equals to "aindex" 

		function textindex(const fieldno,aindex: integer;
                      const caseinsensitive: boolean): integer;
			- returns row number of widestring array "fieldno" where the array index equals to "aindex"

		function textindexar(const fieldno: integer;
                            const caseinsensitive: boolean): integerarty;
			- returns all bunch of indexes of widestring array "fiedlno"

		function textar(const fieldno: integer): msestringarty;
			- returns all bunch of data of widestring array "fiedlno"   

   
		function lookupinteger(const integerkeyfieldno,integerfieldno,
                                keyvalue: integer): integer; overload;
			- returns value of integer array "integerfieldno" at position where
				value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
                ( 0 if not found )

		function lookupinteger(const stringkeyfieldno,integerfieldno: integer;
                         const keyvalue: msestring): integer; overload;
			- returns value of integer array "integerfieldno" at position where
				value of parallel widestring array "stringkeyfieldno" equals to "keyvalue"
                ( 0 if not found )

		function lookuptext(const integerkeyfieldno,textfieldno,
                                keyvalue: integer): msestring; overload;
			- returns value of integer array "textfieldno" at position where
				value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
                ( '' if not found )

		function lookuptext(const stringkeyfieldno,textfieldno: integer;
                      const keyvalue: msestring): msestring; overload;
			- returns value of integer array "textfieldno" at position where
				value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
                ( '' if not found )


		function lookupfloat(const integerkeyfieldno,floatfieldno,
                                keyvalue: integer): realty; overload;
			- returns value of real/datetime array "floatfieldno" at position where
				value of parallel integer array "integerkeyfieldno" equals to "keyvalue"
                ( emptyreal if not found )

		function lookupfloat(const stringkeyfieldno,floatfieldno: integer;
                                keyvalue: msestring): realty; overload;

			- returns value of real/datetime array "floatfieldno" at position where
				value of parallel widestring array "stringkeyfieldno" equals to "keyvalue"
                ( emptyreal if not found )

		function count: integer; - returns number of data rows

		property fieldcounttext: integer; -  returns/sets number of widestring arrays
		property fieldcountfloat: integer; - returns/sets number of real/datetime arrays
		property fieldcountinteger: integer; - returns/sets number of integer arrays

		 the above "fieldcount*" props clear the buffer on setting a value 

		property integervalue[const fieldno,aindex: integer]: integer; - a shortcut to "integervaluephys"
		property floatvalue[const fieldno,aindex: integer]: realty; - a shortcut to "floatvaluephys"
		property textvalue[const fieldno,aindex: integer]: msestring; - a shortcut to "textvaluephys"

		property onchange: notifyeventty; 
			- called in "changed" wich in turn is called in :
				= clearbuffer
				= endupdate
				= doasyncevent
				= loaded
				= tlookupbuffer.addrow

TLookupBuffer

tlookupbuffer = class(tcustomlookupbuffer)

	- extends "tcustomlookupbuffer" with methods of run-time data filling

	- see <tcustomlookupbuffer>

	+= Extentions to the public interface:

		procedure addrow(const integervalues: array of integer;
                    const textvalues: array of msestring;
                    const floatvalues: array of realty);

			- adds one row to each of widestring arrays, integer arrays and real/datetime arrays,
			array size of  "{type}values" equals to number of {type} arrays

   		procedure addrows(const integervalues: array of integerarty;
                    const textvalues: array of msestringarty;
                    const floatvalues: array of realarty);

			- adds many data rows  to each of widestring arrays, integer arrays and real/datetime arrays, 
			only min length of the input data arrays are inserted, longer data are truncated
			array size of  "{type}values" equals to number of {type} arrays and the size of "{type}values[i]"
			describes number od data elements in the array
		

TDBLookupBuffer

tdblookupbuffer = class(tcustomdblookupbuffer -> tcustomlookupbuffer)

	- extends "tcustomlookupbuffer" with interface to fill arrays with DB-data
	- see <tcustomlookupbuffer> & <tcustomdblookupbuffer>

	 Extentions to the public interface:

   		procedure checkbuffer; - if data obsolete ("invalid") then reloads them from "datasource"
   
		property datasource: tdatasource; - sets/returns DB data source where to load data from
		property textfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of widestring arrays
		property integerfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of integer arrays
		property floatfields: tdbfieldnamearrayprop; - allows to assign a {datasource:datafield} to each of real/datetime arrays

		property optionsdb: lbdboptionsty; - tunes some DB behaviour apects
			-	olbdb_closedataset : 
				= once data obsolete, opens (if needed) the supplier dataset (disabling its bound controls) 
				then [re]loads data from it then closes it

			-	olbdb_invalidateifmodified :
				= gets marked "invalid" once contents of the bound dataset change, 
				it signals to reload the buffer with the new data just before next accessing 
				( for any purpose - searching, lookuping, getting value/(array of values),..)

TDBmemoLookupbuffer

- allows to use  for lookup-ing any text-convertable DB-fields
	- an analog of tdblookupbuffer, but :
		- "integerfields" may be names of any integer-convertable DB-fields
		- "floatfields" may be names of any (real/datetime)-convertable DB-fields
		- "textfields"  may be names of any text-presentable DB-fields

		- each DB-field value ( presenting a memo generally of many lines ) may supply many data rows at once 
		to the bound array of the buffer, since this value will be internally splitted & turned into native array values,
		and the resulting "count" (arrays row count) of the whole buffer will be the minimal rows count amongst arrays 
		of the buffer, the rest data are truncated 

		- when loading widestring arrays, also checks for & performs "utf8-to-widestring" conversion of values of 
		the bound DB-fields so that these arrays always store widestrings

TThreadComp

TStatFile

- so that to be in effect, it should also be assigned to the form where the widget using the stafile is placed on
- in design, if "onstatwrite" is set and "filedir" is not yet created,	deactivate exception "ECreateError" in project settings ( "Debugger" tab )
- "filedir" may contain "~/" indicating the user's home directory
- options "oe_savestate" & "oe_savevalue" of "client" widgets define what to store to the file 
- position etc changes or/and value changes 
- in case when a main form shares its stafile with non-main forms, on creating non-main ones, just edited not saved data of the main form ( bound to vars of the statfile) are reset to values read from the statfile upon creating the form; for "sfo_memory", this effect absents unless widgets on the concurring forms share same variable[s]; to avoid this behaviour, disable "fo_autoreadstat" & "fo_autowritestat" of the non-main forms
- each "tstafile" owns:
 = tstatwriter:
* provides methods of writing sections & statvars to a memory/file stream
- tstatreader:
* holds list of sections with statvars each
* provides search & check & reading interface to the statvars
* provides reading statvars from a memory/file stream

Positioning to a section speeds up accessing its statvars

- there also is "tstatfiler" ( exposed by some "tstatfile" events ) which:
= may present or "tstatwriter" or "tstatreader" ( there's a check method )
= provides directionless "update" methods with internal switch to needed direction of processing 
- "reading" or "writing" statvars on per-section basis


	activator :
		<see tactivator> : NOT YET DONE		

	encoding = "en_utf8" selected here, allows to store non-Latin text in the file
       filedir = directory where to keep the file ( by default - the current working directory )
	filename = name of the file

	options:
		sfo_memory = reads & writes not from a disk file but from a named memory stream 
					( there's an exclusion - see below "sfo_savedata" ),
					mostly useful for presenting last used values on recalling 
					non-main forms etc ( data even survive recreating forms),
					or even for data "exchange" between non-main modal( non-concurring ) forms 
					in case of the target widgets share same statvarnames

		sfo_createpath = creates "filedir" if necessary
		sfo_savedata =	used only with "sfo_memory", commands to save 
						the memory data to the master statfile (see below)						

	sfo_activatorread = activator activate triggers reading ???
	sfo_activatorwrite = activator deactivate triggers writing ???

	statfile = a master statfile
	statvarname = name of section of this file in the upper statfile
	Tag = an integer property for misc purposes

	Event handlers:
		onstatafterread - fires on return from "readstat"
		onstatafterwrite - fires on return from "writestat"
		onstatbeforeread - fires on beginning of "readstat"
		onstatbeforewrite - fires on beginning of "writestat"
		onstatread = fires after reading state data
		onstatwrite = fires after writing state data
		onstatupdate = fires after reading/writing state data just before 
					"onstatread" & "onstatwrite"

	Public methods:

   		procedure initnewcomponent(const ascale: real); override;
   			- does nothing but fixes the default file name as the statfile default
   
   		procedure readstat(stream: ttextstream = nil); overload;
   			- rereads all statvars of the stafile/memorystream
   
   		procedure readstat(const aname: msestring; const statreader: tstatreader); overload;
   			- rereads "aname" statvar of the statfile

   		procedure writestat(const stream: ttextstream = nil); overload;
		   	- rewrites all statvars to the stafile/memorystream
			  (if neccessary, prepares to writting - creates "filedir", stafile,...)
   
   		procedure writestat(const aname: msestring; const statwriter: tstatwriter); overload;
   			- overwrites "aname" statvar of the statfile
   		
   		procedure updatestat(const aname: msestring; const statfiler: tstatfiler);
   			- depending on kind of "statfiler" ( writer/reader ), writes/reads 
   			  the most up-to-date stat data

TTimer

TNoGuiAction

TPipeReadercomp

TSysEnvManager

TProcessMonitor

TFilechangeNotifier

TShortCutController

TPostscriptPrinter

TGdiPrinter

TWmfPrinter

TSkinController

TGuiThreadComp

Font

See also : Reference:_MSEgui/TFont

Any Font

    	charset { ANSI/ DEFAULT/ SYMBOL /SHIFTJIS /HANGEUL /GB2312 /CHINESEBIG5 /OEM 
		/JOHAB / HEBREW/ ARABIC/ GREEK/ TURKISH/ VIETNAMESE/ THAI/ EASTEUROPE/
		RUSSIAN/ MAC/ BALTIC }
		- changes the font to the nearest containing the selected encoding(charset)
		- no font change made if the supplied encoding doesn't match any font
	color
		- color of the glyphs contours
	colorbackground
		- fill color of the glyph cells ( not including extraspace )
	colorshadow
		- color of SE glyph "edges" ( if not "cl_none", deactivates "colorbackground" )
	extraspace
		- v-space between glyph cells of adjacent text rows (negative values cause the cells to overlap )
	height
		- v-size of glyph cells, in pixels
	name
		- initially, font is choosen by { "family" = this name }
	options:
		foo_fixed
			- changes the font to the nearest "mono" spaced (usually = Courier)
		foo_proportional
			- changes the font to the nearest "proportionally" spaced (usually = Helvetica)
		foo_helvetica
			- changes the font to the nearest in "sans" category (usually = Helvetica)
		foo_roman
			- changes the font to the nearest in "serif" category (usually = Times[ New Roman])
		foo_script
			- Win32 only, changes the font to the nearest in "script" category
		foo_decorative
			- Win32 only, changes the font to the nearest in "decorative" category
		foo_antialiased
			- Linux-only, enables antialiasing (if disabled by Xft globally)
		foo_nonantialiased
			- Linux-only, disables antialiasing (if enabled by Xft globally) 
			usually making glyph extents (not cells !) a bit wider
	style:
		fs_bold
			- gives the font a "bold" look
		fs_italic
			- gives the font an "italic" look
		fs_underline
			- gives the font an "underlined" look
		fs_strikeout
			- gives the font a "striked out" look
		fs_selected
			- "TRUE" here combined with {tf_noselect:=FALSE}, causes the text described by this font 
			to be initially selected ( with the clipboard operations available ), 
			currently applicable only to richstrings

	width
		- 10*{ glyph cell width, average in pixels }, 0 = {font default}

	xscale
		- width ratio of each glyph {cell & contour}, the effect is similar to "width"

		*** "foo_*" font selection overrides one made with "name" 

		*** if change with "foo_*" is unsuccessful then the nearest "sans" font is usually chosen

		*** The categories :

			sans		=> have no serifs and have strokes of even thickness
			serif		=> have serifs at glyph contours and made up of strokes of varying thickness
			script		=> resemble handwriting
			decorative	=> flashy styles to be used sparingly in headlines or posters

GUI

TWindow

twindow = class(teventobject,icanvas)
  public

	// releases mouse, unlinks from the canvas, processes all pending events of the window
	// if called from within main thread then destroys the window directly
	// otherwise posts a window destroy event for oneself and waits for it to be processed
	procedure destroywindow;

	// registers the instance of onself in the "owner" widget, allocates the canvas, 
	// adds a reference to oneself,
	// then prepares the "owner" hierarchy to be invalidated ( "owner.rootchanged" )
	// since now, the window is allocated and belongs to the "aowner" widget 
	constructor create(aowner: twidget);

	destructor destroy; override;

	// adds "method" to the internal list of scroll dependants
	procedure registeronscroll(const method: notifyeventty);

	// removes "method" from the internal list of scroll dependants
	procedure unregisteronscroll(const method: notifyeventty);

	// releases mouse if captured, resets the cursor, then enters an event loop for the window,
	// TRUE on return if the window is destroyed
	function beginmodal: boolean;
 
	  * checks if the "sender" window is already modal to avoid circularity, 
	    if not then starts an event loop  for the "sender" where the "sender" is a receiver of GUI events,
   	    once the loop is terminated reactivates the previously active window if it was,
	    TRUE if modalwindow destroyed  

	  function tinternalapplication.beginmodal(const sender: twindow): boolean;

	// removes the internal stuff which indicates the modal state
	procedure endmodal;

	// if the window is visible, 
	// deactivates the previously active window, shows the window (see below),
	// if no active window in the app or the window or its Z-predecessor is modal and 
	// the app has no focused widget then prepares the bound widget to be focused,
	// then addresses the WM to put the window to foreground
	procedure activate;

	  // if the bound widget has visible=true then:
	  //  - if NOT windowevent then :
	  //    = address the WM to set size of the window acc to window opts 
	  //      wp_maximized, wp_fullscreen or normal size otherwise
	  //	= if the window is normally sized, moves it to its default position is specified ( screen centered etc )
	  // - unhides/unminimizes the window if needed
	  // - shows other windows of the applications acc to state of the window group 
	  // ( in normal size or minimized )

	  private 
		procedure twindow.show(windowevent: boolean);

	// TRUE if this window currently grabs user input
	( a widget drawn within the window(=form) is in focus,.. )
	function active: boolean;

	// if the window was active then deactivates the window  & remembers it as the previous active ( to restore leater if requested ),
	// returns TRUE if that storage occurred
	function deactivateintermediate: boolean; 

	// makes the window active & clears the above app reference to it ( "active before deactivating" )
	procedure reactivate; //clears app.finactivewindow

	// scans the app event queue for "ek_expose" event[s] addressed to the window,
	// if found then redraws that part of the window which the event describes
	// ( processed events are then deleted )
	procedure update;

	// TRUE if the window :
	// 1) doesn't have an inner widget grabbing input focus
	// or
	// 2) has such widget, and this widget ( and all its descendants ) 
	//    pass "CanClose" check
	//
	// *** see also "twidget.CanClose" ***
	//
	function candefocus: boolean;

	// tries to defocus the currently focused widget if it belongs to the window,
	// if succeeds then executes code of virtual "DoDefocus" of the widget descessor
	// ( this code defines behaviour & look of the widget on defocusing );
	//
	// no defocusing is done if the focused widget ( or its descendants ) 
	// doesn't pass "CanClose" check
	//
	procedure nofocus;
   
   	// setfocusedwidget(widget)
   
   property focuscount: cardinal read ffocuscount;
   function close: boolean; //true if ok
   procedure beginmoving; //lock window rect modification
   procedure endmoving;
   procedure bringtofront;
   procedure sendtoback;
   procedure stackunder(const predecessor: twindow);
       //stacking is performed in mainloop idle, nil means top
   procedure stackover(const predecessor: twindow);
       //stacking is performed in mainloop idle, nil means bottom
   function stackedunder: twindow; //nil if top
   function stackedover: twindow;  //nil if bottom
   function hastransientfor: boolean;

   procedure capturemouse;
   procedure releasemouse;
   procedure postkeyevent(const akey: keyty; 
        const ashiftstate: shiftstatesty = []; const release: boolean = false;
                  const achars: msestring = '');

   function winid: winidty;
   function haswinid: boolean;
   function state: windowstatesty;
   function visible: boolean;
   function activating: boolean; //in internalactivate proc
   function normalwindowrect: rectty;
   property updateregion: regionty read fupdateregion;
   function updaterect: rectty;

   procedure registermovenotification(sender: iobjectlink);
   procedure unregistermovenotification(sender: iobjectlink);

   property options: windowoptionsty read foptions;

	// widget 
	property owner: twidget read fowner;

   property focusedwidget: twidget read ffocusedwidget;
   property transientfor: twindow read ftransientfor;
   property modalresult: modalresultty read fmodalresult write setmodalresult;
   property buttonendmodal: boolean read getbuttonendmodal write setbuttonendmodal;
   property globalshortcuts: boolean read getglobalshortcuts write setglobalshortcuts;
   property localshortcuts: boolean read getlocalshortcuts write setlocalshortcuts;
   property windowpos: windowposty read getwindowpos write setwindowpos;
   property caption: msestring read fcaption write setcaption;


 windowoptionty = (wo_popup,wo_message,wo_buttonendmodal,wo_groupleader,
                   wo_windowcentermessage); //showmessage centered in window


	optionswindow:
		wo_popup 
			- in run-time, hides all OS windows-manager ( WM ) decorations (title bar, buttons "Close/Resize,Min/Max" etc),
			letting only its client area to appear
			so :
				= the window should have own facilities to replace the deactivated WM functionality if needed
				= can't be resized/maximize/minimized/moved
		wo_message
			- similar to "wo_popup" but allows WM to close ( with "Close" button ) & move the window

		wo_groupleader
			- keeps on the WM taskbar a shortcut to the window 
			( if the parent window is a groupleader too then displays a step upper in its group )

	Event handlers:

	 - onmove
		= fires once the (window/widget) is created/moved ( with check if really moved by a distance)

TFormScrollbox

- presents client area of form & parent of its widgets, 
	initially stretched to fit the form & bound with anchoring 
	but may be adjusted with "bounds" & "anchors"
   
    Properties:
                
	anchors
	bounds
	
	color
		- color of the whole container area ( except its frame ) & form widgets 
		if their color is "cl_parent"

	name = container

	cursor,	enabled, face, frame, helpcontext, hint, optionswidget, popupmenu,
	taborder, tag, visible, onactivate, onafterpaint, onbeforepaint, 
	onchildmouseevent, onclientmouseevent, ondeativate, ondefocus, onenter,
	onexit, onfocus, onfontheightdelta, onmouseevent, onpaint, onpopup
	onresize, onshowhint
		- the same meaning as for the served form


	oncalcminscrollsize	
	onscroll
	onchildscaled	

TFaceList

TFrameComp

See also here: Reference:_MSEgui/TFrame.


	Terminology :

	{client area = area of the widget which interacts with a user}

	{bevelling = additional facets rising/sinking frame & client area, 
		constists of two parts - 
			- external: between frame and widget
			- internal: between frame and client area
	}

	{frame=	flat space between external & internal facets,
			floats at the inner level of the external facet
 	}

	*** Both frame & bevelling affect the client area ***

	--------------------------
	template:

		colorclient	=	color of the client area

		colorframe =	color of the frame
		colorframeactive =	used instead of colorframe if the widget is
							active; "cl_default" means same as colorframe.

		works if (leveli/levelo <> 0 that's the facets exist :

			colorshadow = color of facets screened from the NW light source
			colordkshadow =	color of shadows dropped by the NW light source
        	        colordkwidth =	width of the shadows in pixel, -1=default

			colorlight = color of facets exposed to the NW light source
			colorhighlight = color of brighter edges of the facets
                 	colorhlwidth = width of the brighter edges in pixel, -1=default

		        extraspace = if applied to menu items, adds more space between these items

		framei_:
			(for extendable widgets like menus, these settings widen the widget,
			for non-extendable like buttons - they squeeze the text area )

			bottom=	lower margin of text to the client area
			left =	left margin of text to the client area
			right =	margin of text to the client area
			top =	upper margin of text to the client area

		framewidth=	width of the frame
	leveli = {width=height} of the internal facet, positive -> raised, negative -> sunken
	levelo = {width=height} of the external facet, positive -> raised, negative -> sunken

<any frame>

	*** extends & customizes "tframecomp" ***

	template
		- "tframecomp" supplying the initial settings

	colorclient,colordkshadow,colordkwidth,colorframe,colorframeactive,
	colorhighlight,colorhlwidth,colorlight,colorshadow,framewidth, 
	leveli, levelo, framei_*,

		<see "tframecomp">

	font
		<see "tfont">

	caption	
		- some descriptive text( function name, user prompt,...) placed 
		in a N/W/S/E-combination to the widget's client area

		*** 
		non-empty caption if (captionpos <> cp_center) & (captiondistouter=false & captiondist>0) enlarges the framed widget 
		by the corresponding size of caption

		***

	captiondist - margin between the caption & the client area

	captiondistouter :

	- if "false"(by default), the distance is measured between 
		the inner (facing the client area) extent of the caption 
		and the client area outward the area, 
		the caption is placed outside of the client area

	- if "true", the caption is mirrored against the edge of client area as 
		to the position when "false"

		*** nagative values of "captiondist" visually inverse "out of" and within ***

       captionnoclip - do not clip frame and client area for caption background 
					( the client area preserves own background under the caption text)

	captionnooffset - shift orthogonal to "captiondist"

	captionpos - "corner" where to place the caption

	localprops :

		frl_levelo - "levelo" overrides "template.levelo"
		frl_leveli - "leveli" overrides "template.leveli"
		frl_framewidth - "framewidth" overrides "template.framewidth"
		frl_colorclient - "colorclient" overrides "template.colorclient"
		frl_colorframe - "colorframe" overrides "template.colorframe"
		frl_colorframeactive - "colorframeactive" overrides "template.colorframeactive"
		frl_colordkshadow - "colordkshadow" overrides "template.colordkshadow"
		frl_colorshadow - "colorshadow" overrides "template.colorshadow"
		frl_colorlight - "colorlight" overrides "template.colorlight"
		frl_colorhighlight - "colorhighlight" overrides "template.colorhighlight"
		frl_colordkwidth - "colordkwidth" overrides "template.colordkwidth"
		frl_colorhlwidth - "colorhlwidth" overrides "template.colorhlwidth"
		frl_fileft - "framei_left" overrides "template.framei_left"
		frl_firight - "framei_right" overrides "template.framei_right"
		frl_fitop - "framei_top" overrides "template.framei_top"
		frl_fibottom - "framei_bottom" overrides "template.framei_bottom"

		frl_nodisable

TFaceComp

See also here: https://wiki.freepascal.org/Reference:_MSEgui/TFace

	- doesn't affect the widget frame but client area of the frame


	template:
		fade:
			color[i]: = colors forming the fade
			direction: = direction where the fade grows to
			gd_(right/up/left/down)

		pos[i]: = relational position of color[i] on the direction (0.0..1.0) extent

			transparency = 	makes the face half-transparent and enlighten the underlying widget  
							with a light source of the selected color 
							( in this case, colors of the face & the widget & the light source 
							simply summarize to higher brightness )

		image:
			see <any image>

		options:

        	*** The fade colors are used not as colors but RGB alpha values ($00 -> opaque, $ff -> transparent) 
			if fao_alpha* are set *** :

				fao_alphafadeall = applies blending to the widget & all its children
				fao_alphafadenochildren = preserves child widgets from blending
		                fao_alphafadeimage = applies blending to "face.image" 


<any face>

	*** extends & customizes "tfacecomp" ***

	fade, image, option
		- see "tfacecomp"
	
	template
		- "tfacecomp" supplying the initial settings

	localprops :
		fal_options - "options" overrides "template.options"
		fal_fadirection - "fade.direction" overrides "template.fade.direction"
		fal_image - "image" overrides "template.image"
		fal_fapos - "fade.pos[i]" overrides "template.fade.pos[i]"
		fal_facolor - "fade.color[i]" overrides "template.fade.color[i]"
		fal_fatransparency - "fade.transparency" overrides "template.fade.transparency"

TBitmapComp

TScalingwidget

   optionsscale : 
		autosizing to provide room for :
		= {"frame.caption" + "offset_*"}
		= "offset_*" if "frame.caption" is unset and "osc_shrink*" is set
	
		= osc_expandx 
			- makes the widget wider to fit the caption if needed

		= osc_shrinkx
			- makes the widget narrower to have no space left & right to the "frame.caption"

		= osc_expandy
			- makes the widget taller to fit the caption if needed

		= osc_shrinky
			- makes the widget lower to have no space up & down to the "frame.caption"

		= osc_invisishrinkx
			- fully h-collapses if "visible=false" ( run-time only )

		= osc_invisishrinky
			- fully v-collapses if "visible=false" ( run-time only )

TImageList

TPopupMenu

TMainMenu

Dialog

TFileListview

TFileDialog

TFaceComp

TFileNameEdit

TDirDropdownEdit

TColorEdit

TMemoDialogEdit

TPageSizeSelector

TPageOrientationSelector

Application

TGuiApplication

 tguiapplication = class(tcustomapplication)
  public

   // [re]starts the system timer with the new period and 
   // subscribes the application to be a receiver of the modified "ek_timer" event 
   // ( can check for it in the event queue )
   procedure settimer(const us: integer);

   // finds a window by its winID
   function findwindow(id: winidty; out window: twindow): boolean;

   // finds a window by its ID & adjusts "rect" so that it 
   // fits "bounds_minc*" & "bounds_maxc*" of the found window
   procedure checkwindowrect(winid: winidty; var rect: rectty);

   // initialises the timer and "megraphics"
   procedure initialize;

   // frees the allocated system resources (GDI, event subscription, the timer)
   procedure deinitialize;

   // creates a form instance, it will be shown in "application.run"
   procedure createform(instanceclass: widgetclassty; var reference);

   // invalidates all registered forms ( all their widgets will be redrawn )
   procedure invalidate; 
   
   // calls a nested main event loop, forces processing any pending messages,
   procedure processmessages; override; //handle with care!

   // TRUE if no pending events to process for the application
   function idle: boolean; override;
   
   // requests to indicate waiting ( to show the "watches" cursors )
   procedure beginwait; override;

   // removes the "watches" if no unclosed requests for displaying them,
   // otherwise closes the currently active request
   procedure endwait; override;

   // TRUE if there are unclosed requests for displaying "watches"
   function waiting: boolean;

   // TRUE if ESC has just been pressed
   //  - if all requests for displaying "watches" are closed then refreshes 
   //    the internal list of events ( the GUI-queue -> the app event list)
   function waitescaped: boolean; //true if escape pressed while waiting

   // sets state of the current wait dialogue ( but doesn't close one ) to undefined
   procedure resetwaitdialog;   

   // runs "aexecuteaction" in the main thread in OnIdle mode,
   // then shows a cancellable message,
   // if the one is cancelled then runs "acancelaction" then 
   // either fully clears (if exceptions occur ) 
   // or terminates the execution otherwise,
   // true if not cancelled;
   // "application.processmessages" must be called regularly if "aexecuteaction" is used here,
   // alternatively "aidleaction" can be used, call sleep ( some time ) in order to minimize
   // processor load. 
   // If athread <> nil the function starts and terminates the thread    
   function waitdialog(const athread: tthreadcomp = nil; const atext: msestring = '';
                   const caption: msestring = '';
                   const acancelaction: notifyeventty = nil;
                   const aexecuteaction: notifyeventty = nil): boolean; override;

   // closes the currently modal waitdialogue with "cancelled" state
   procedure cancelwait;

   // closes the currently modal waitdialogue with "ok" state
   procedure terminatewait;

   function waitstarted: boolean;   // the last waitdialogue is currently showing for some requests
   function waitcanceled: boolean;  // the last waitdialogue has been cancelled for some request (but can be shown fot others ?)
   function waitterminated: boolean; // the last waitdialogue has been terminated for some request (but can be shown fot others ?) 

   // if called from the main app thread then shows as a modal message describing the exception 
   // otherwise posts an async event for which the message will be called
   procedure showexception(e: exception; const leadingtext: string = ''); override;

   // posts an async event for which the message describing the exception will be called
   procedure showasyncexception(e: exception; const leadingtext: string = '');

   // "application.errormessage" shows standard error message ( with "ERROR" title ) 
   procedure errormessage(const amessage: msestring); override;

   // [re]calculates timings & position of hint for "ahintedwidget"
   // if "ow_timedhint" in "ahintedwidget.foptionswidget" then iys showtime will be 
   // "defaulthintshowtime" ( an app wide setting, 3sec by default)   
   procedure inithintinfo(var info: hintinfoty; const ahintedwidget: twidget);


   // shows the supplied hint text within "aposrect" with alignment "aplacement" during "ashowtime",
   // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove   
   procedure showhint(const sender: twidget; const hint: msestring;
              const aposrect: rectty; const aplacement: captionposty = cp_bottomleft;
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
                 // -1 defaultshowtime if ow_timedhint in sender.optionswidget
              const aflags: hintflagsty = defaulthintflags
                      ); overload;

   // shows the supplied hint text at left-top position"apos" during "ashowtime",
   // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove   
   procedure showhint(const sender: twidget; const hint: msestring;
              const apos: pointty;
              const ashowtime: integer = defaulthintshowtime; //0 -> inifinite,
                 // -1 defaultshowtime if ow_timedhint in sender.optionswidget
              const aflags: hintflagsty = defaulthintflags
                      ); overload;

   // shows the hint fully defined in "info" for the widget "sender"
   procedure showhint(const sender: twidget; const info: hintinfoty); overload;

   // removes the current hint widget & frees its resources & stops its stop timer
   procedure hidehint;

   // restarts the current hint and its stop timer
   procedure restarthint(const sender: twidget);

   function hintedwidget: twidget; //last hinted widget
   function activehintedwidget: twidget; //nil if no hint active

   // returns helpcontext of active widget, '' if none;   
   function activehelpcontext: msestring;

   // returns helpcontext of the widget under mouse, '' if none;
   function mousehelpcontext: msestring;

   // TRUE if one of the app's window/console is in input focus
   function active: boolean;

   // returns the desktop resolution ( or the virtual one if used )
   function screensize: sizety;

   // returns the (virtual) desktop resolution except the tray area,
   // nil -> current active window
   function workarea(const awindow: twindow = nil): rectty;

   // returns which application window ( a form not an eventwidget, an openglwidget or a windowwidget !) 
   // is active ( provides the input focus ),
   // it's same for all widgets of the form served by this window
   function activewindow: twindow;

/ * A transient window is a descendant of ( "transientfor" ) another window in the stacking order hierarchy */

   // returns a first non-transient ( on top of the app stacking order ) window upward 
   // from the currently active window of the application.
   // or that active window if no such
   function regularactivewindow: twindow;

   // same as "activewindow" but the window must not be released (?)
   function unreleasedactivewindow: twindow;

   // returns the focused widget of the currently active window if one exists
   function activewidget: twidget;

   // returns the widget presenteing the currently active window
   function activerootwidget: twidget;
   
   // returns the window ( not hidden or disabled !) under the screen point "pos"
   function windowatpos(const pos: pointty): twindow;

   // puts to "awidget" the container of widget pointed by "namepath"
   // ( finalizing "." is discarded if found ) ,
   // FALSE if not found, and NIL and TRUE if "namepath" = ''
   function findwidget(const namepath: string; out awidget: twidget): boolean;

   // rebuilds the application's window list accorrding to the current on-screen Z-order of its windows;
   // window list is ordered by "z" - bottom first & top last;
   // invisibles first
   procedure sortzorder;

   // returns a copy of the internal window list of application
   function windowar: windowarty;

   // returns the list of application window winIDs
   function winidar: winidarty;

   // returns the count of the application windows    
   function windowcount: integer;

   // returns the window by its number ( "index" >= 0) in the application window list
   property windows[const index: integer]: twindow read getwindows;

   // returns the lowest visible window in stackorder, 
   // calls "sortzorder" within
   function bottomwindow: twindow;

   // returns the highest visible window in stackorder, 
   // calls "sortzorder" within
   function topwindow: twindow;


   // TRUE if all owned windows pass "CanClose" check or 
   // don't have focused widgets
   function candefocus: boolean;

   // subscribes the handler "method" to receive keyboard events
   procedure registeronkeypress(const method: keyeventty);

   // unsubscribes the handler "method" from receiving keyboard events
   procedure unregisteronkeypress(const method: keyeventty);

   // subscribes the handler "method" to receive shortcut events
   procedure registeronshortcut(const method: keyeventty);

   // unsubscribes the handler "method" from receiving shortcut events
   procedure unregisteronshortcut(const method: keyeventty);

   // subscribes the handler "method" to receive "OnWindowActiveChanged" event ( form-wide )
   procedure registeronactivechanged(const method: activechangeeventty);

   // unsubscribes the handler "method" from receiving "OnWindowActiveChanged" event ( form-wide )
   procedure unregisteronactivechanged(const method: activechangeeventty);

   // subscribes the handler "method" to receive "OnDestroyed" events ( form-wide )
   procedure registeronwindowdestroyed(const method: windoweventty);

   // unsubscribes the handler "method" from receiving "OnDestroyed" events ( form-wide )
   procedure unregisteronwindowdestroyed(const method: windoweventty);

   // subscribes the handler "method" to receive "OnWindowDestroyed" events ( form-wide )
   procedure registeronwiniddestroyed(const method: winideventty);

   // unsubscribes the handler "method" form receiving "OnWindowDestroyed" events ( form-wide )
   procedure unregisteronwiniddestroyed(const method: winideventty);

   // subscribes the handler "method" to receive "ApplicationActiveChanged" events ( form-wide )
   procedure registeronapplicationactivechanged(const method: booleaneventty);

   // unsubscribes the handler "method" from receiving "ApplicationActiveChanged" events ( form-wide )
   procedure unregisteronapplicationactivechanged(const method: booleaneventty);

// tcustomapplication

   // subscribes the handler "method" to receive "OnTerminated" event ( form-wide )
   procedure registeronterminated(const method: notifyeventty);

   // unsubscribes the handler "method" from receiving "OnTerminated" events ( form-wide )
   procedure unregisteronterminated(const method: notifyeventty);

   // subscribes the handler "method" to receive "OnTerminateQuery" event ( form-wide )
   procedure registeronterminate(const method: terminatequeryeventty);

   // unsubscribes the handler "method" from receiving "OnTerminateQuery" event ( form-wide )
   procedure unregisteronterminate(const method: terminatequeryeventty);

   // subscribes the handler "method" to receive "OnIdle" event ( form-wide )
   procedure registeronidle(const method: idleeventty);

   // unsubscribes the handler "method" from receiving "OnIdle" events ( form-wide )
   procedure unregisteronidle(const method: idleeventty);

   // calls "canclose" of all application windows except the "sender" window 
   // if all "canclose"are TRUE then checks "OnTerminateQuery" 
   // for all its subscribers ( usually forms of the application )
   procedure terminate(const sender: twindow = nil); 

   // TRUE as long as a "terminate" call is in progress
   function terminating: boolean;

   // TRUE as long as a "deinitialize" call is in progress
   function deinitializing: boolean;
   
   // returns the current caret object ( the text input focus indicator ) of the application
   / ( this object provides facilities to control position & appearance & visibility & timings of the caret )
   property caret: tcaret read fcaret;

   // returns the current mouse object of the application
   / ( this object provides facitities to control position & appearance of the mouse )   
   property mouse: tmouse read fmouse;

   // simulates mouseparkevent 
   // ( an adjusting mouse movement without user intervention - grid snapping, docking etc ?)
   procedure mouseparkevent;

   // sets mouse position correction for further mouse events,
   // the real position is less the visual one by the supplied shift
   procedure delayedmouseshift(const ashift: pointty);

   // returns/sets a cursor shape used for widgets having their cursor shape set to "cr_default";
   // setting it to "cr_default" restores the individual widget cursor(s)
   property widgetcursorshape: cursorshapety read fwidgetcursorshape write
                                        fwidgetcursorshape;

   // returns/sets the current application-wide cursor shape ( not "watches" if a waiting dialog is currently displayed ! )
   // or request to set a new cursor shape ( app-wide );
   // doesn't change when changing mouse widgets
   // 
   // if called from a non-main app thread & no waiting dialogue displayed then redraws 
   // the cursor immediately;
   // set it to "cr_default" to restore the shape to one set by "widgetcursorshape"
   //
   property cursorshape: cursorshapety; // cr_arrow, cr_*

   // assures the displayed mouse cursor shape to be the shape assigned to the currently under-mouse widget,
   // otherwise "cr_default" 
   procedure updatecursorshape; //restores cursorshape of mousewidget

   // returns a widget of the application where the mouse is currently positioned over
   property mousewidget: twidget read fmousewidget;

   // returns a widget of the application currently "owning" the mouse ( grabbing all mouse input )
   property mousecapturewidget: twidget read fmousecapturewidget;


   // returns/sets a window to become the main window of the application
   // then resets all other application windows to the window group it belongs to ( Linux only );
   //
   // the main window minimizes all windows if minimized;
   property mainwindow: twindow read fmainwindow write setmainwindow;

   // returns which system thread was allocated to the application on its start
   // ( the main thread )
   property thread: threadty read fthread;

   // returns teh widget where a mouse button click occured last time 
   // ( to compare with when determinibg whether another widget is clicked )
   property buttonpresswidgetbefore: twidget read fbuttonpresswidgetbefore;

   // returns teh widget where a mouse button release occured last time 
   // ( to compare with when determinibg whether another widget is clicked )
   property buttonreleasewidgetbefore: twidget read fbuttonreleasewidgetbefore;


   // returns/sets the interval of mouse double click recognition ( in microsecs ),
   // defaults to 0.4 sec
   property dblclicktime: integer read fdblclicktime write fdblclicktime default
                 defaultdblclicktime; //us

// tcustomapplication

   // creates a datamodule instance ( its startup code including "OnLoaded" is executed )
   procedure createdatamodule(instanceclass: msecomponentclassty; var reference);


   // enters the application event loop;
   //
   // once the loop finishes, performs "OnTerminated" for all its subscribers,
   // destroys all application forms ( components & windows )
   procedure run;

   // TRUE if the eventloop is entered
   function running: boolean;

   // returns/sets the application name 
   // ( defaults to the full path to application executable in the native OS format );
   // currently, only for informatiion query purposes
   property applicationname: msestring read fapplicationname write fapplicationname;
   

   // if exclusive "rights" are satisfied for the main thread ( a mutex lock is OK )  & the event loop is in progress 
   // then posts the "event" to the main application thread for asyc processing,
   // otherwise adds the event to the internal list for further handling as soon as the above conditions meet
   procedure postevent(event: tevent);

   // TRUE if never idle since last call,
   // unlocks the application and calls sleep if not mainthread and asleepus >= 0
   function checkoverload(const asleepus: integer = 100000): boolean;

   // returns/sets the application exception handler
   property onexception: exceptioneventty read fonexception write fonexception;

   // if not "eabort" & no unhandled exceptions, 
   // executes the above "OnException" code if assigned 
   // or shows an exception message otherwise;
   procedure handleexception(sender: tobject = nil; 
                                       const leadingtext: string = '');

   // synchronizes the calling thread with the main event loop ( via a mutex),
   // TRUE if the calling thread allready holds the mutex,
   // the mutex is recursive
   function lock: boolean;

   // tries to synchronize the calling thread with the main event loop ( via a mutex)
   function trylock: boolean;

   // releases the mutex if the calling thread holds the mutex,
   // TRUE if no unlock done
   function unlock: boolean;

   // releases the mutex recursively if the calling thread holds the mutex,
   // returns "count" for the below "relockall"
   function unlockall: integer;

   // regains the mutex to serve "count" locks
   procedure relockall(count: integer);

   // creates a syncronize event ( which will fire asyncronously then waits for another thread will allow it to finish ), assigns "proc" to it as the event handler, 
   // then frees all locks temporarily then posts the event to the app event queue & waits fot it to be processed the resores the locks;
   // 
   // TRUE if not aborted, quiet -> shows no exceptions if occurs
   //
   // the "syncronize event" is an event owning a semaphore which can be touched by another thread 
   // thus causing "event.waitfo" to return & to exec the event handler code
   //
   function synchronize(const proc: objectprocty;
                       const quite: boolean = false): boolean;

   // TRUE if the calling ( this function ) thread is the application main thread
   function ismainthread: boolean;

   // TRUE if the currently locked thread is the application main thread
   function islockthread: boolean;

   // waith for "athread" to terminate,
   // does "unlock-relock" around waiting
   procedure waitforthread(athread: tmsethread);

   // post a "nothing-to-do" event for asynchronous processing in the main thread 
   procedure wakeupmainthread;

   // invalidates all registered forms of the application so that their widgets redraw land-specific captions 
   // ( changed by "mseconsts.setlangconsts" ),
   // called internally in "setlangconsts" before return
   procedure langchanged; virtual;

   // returns/sets "aps_terminated" state flag ( no actions ? )
   // this flag is also set internally by "terminate" if not cancelled
   property terminated: boolean read getterminated write setterminated;

   // returns the number of "handleexception" calls having an effect ( a message or the handler code )
   property exceptioncount: longword read fexceptioncount;


private
 // function tinternalapplication.beginmodal(const sender: twindow): boolean;

DB

DBedit

DBfields

TDBwidgetgrid

  Properties:

        anchors - ...
	bounds - ...

	color 
		- color of the grid's client area
	cursor 
		- cursor shape when the mouse is over the client area

	datacols
		colorselect
		linecolor
		linecolorfix
		linewidth
		newrowcol

		options
			co_readonly
			co_nofocus
			co_invisible
			co_disabled
			co_drawfocus
			co_mousemovefocus
			co_lefbuttonfocusonly
			co_focusselect
			co_mouseselect
			co_keyselect
			co_multiselect
			co_resetselectionexit
			co_rowselect
			co_fixwidth
			co_fixpos
			co_fill
			co_proportional
			co_nohscroll
			co_savevalue
			co_savestate
			co_rowfont
			co_rowcolor
			co_zebracolor
			co_nosort
			co_sortdescent
			co_norearrange
			co_cancopy
			co_canpaste
			co_mousescrollrow
			co_rowdatachange

		sortcol
		width

		items[N]
			color
			colorselect
			datalist - ???
			face - see <any face>
			fontselect - see <any font>
			frame - see <any frame>
			linecolor
			linecolorfix
			linewidth
			name
			
			options
	

Report

TRepSpacer

TRecordBand

TrepValueDisp

TRepPageNumdisp

TRepPrintDateDisp

TBandGroup

TTileArea

Design

TGdbMi

TSyntaxEdit

TSyntaxPainter

Comm

TCommPort

TAsciiCommPort

TAsciiProtPort

TCommSelector

General stuff

Properties for all widgets


	name

	anchors

		-----------

		- they control of design/runtime sticking widgets to their parents

		- dimention pair ( top/bottom or left/right ) both set to "false" cause 
		the widget to fit the parent's client area in that dimention;
		this effect may be partial in case of "bounds_c*max" settings limit the extents

		*** Return to the look "before dimention fit" is only possible by manual resizing or setting "bounds_*"
		-----------
		an_left 
			- on run-time, resizes/shifts left the widget to keep the design-set distance 
			between the widget's left border and the left side of parent's client area 
			as the parent resizes, until scrolling begins

		an_top
			- on run-time, resizes/shifts up the widget to keep the design-set distance 
			between the widget's top border and the upper side of parent's client area 
			as the parent resizes, until scrolling begins

		an_right
			- on run-time, resizes/shifts right the widget to keep the design-set distance 
			between the widget's right border and the right side of parent's client area 
			as the parent resizes, until scrolling begins

		an_bottom
			- on run-time, resizes/shifts down the widget to keep the design-set distance 
			between the widget's bottom border and the lower side of parent's client area 
			as the parent resizes, until scrolling begins

	bounds

		cx	- width of the widget
		cxmax, cxmin - design/runtime width of the widget is enforced between "cxmax" and "cxmin"
		cy	- height of the widget
		cymax, cymin - design/runtime height of the widget is enforced between "cymax" and "cymin"
		x	- distance between the widget's left border and the left side of parent's client area 
		y	- distance between the widget's top border and the upper side of parent's client area 


	autosize

		-----------
		- only applicable to widgets with "ow_autosize" set
		- the effect may be partial in case when "bounds_c*max" settings limit the extents
		-----------

		cx - addition to width of the widget (with h-centering post applied)
		cy - addition to height of the widget (with v-centering post applied)

	- color
		= the default color of client area & caption text background
		= may be overwritten:
			* the client area - with "frame.colorclient"
			* the caption BG - with "frame.font.colorbackground"

	- font
		= see {any font}

	- frame
		= see {any frame}

	- face
		= see {any face}

	- hint
		= descriptive text appearing when mouse pointer enters the widget

	- cursor
		= shape of the mouse pointer over the client area of widget (run-time only)

	- visible
		= "true" allow the widget to appear ( run-time only )

	- enabled
		= "true" allows the widget to participate in GUI interaction
		= "false" disallows the widget & its children :
			* processing all events & shortcuts & menu calls
			* auto "CanClose" check

			Also "false" usually paints the widget in color marking 
			the "disabled" state ( usually light gray font color )

	- popupmenu
		= reference to a preset tpopupmenu widget serving the right-click menu

	- taborder
		- {0..N} order number when TAB-key cycling through widgets in the container 

	- tag
		- an integer value bound to this widget instance

	- helpcontext
		= a string returned by "(active/mouse)helpcontext" methods of the owning form 
		  when this widget is focused or under mouse in the active window

	- zorder
		= reading: finds the current Z-order of the widget's window
		= setting: if the value = 0 then lowers the widget's window in the stacking hierarchy, otherwise rises


	optionswidget:

		ow_background
			- keeps the window/widget on bottom of the Z-order stack.

		ow_top
			- keeps the window/widget in foreground

		ow_noautosizing
			- when docking, not to resize for the docking area

		ow_mousefocus
			- "false" here disables focusing the widget with mouse
			  ( and "OnFocus" doesn't fire on mouse clicks )

		ow_tabfocus
			- "false" here disables focusing the widget with "TAB" key
			  ( and "OnFocus" doesn't fire on TAB pressed )

		ow_parenttabfocus
			- enters the childs on TAB-focusing then returns to the widget after 
			sequential TAB-ing through its child widgets,
			otherwise TAB-ing cycles on the children if entered

		ow_arrowfocus
			- allows the widget ( and its children in turn ) to be focused with 
			the arrow keys 

		ow_subfocus, ow_arrowfocusin, ow_arrowfocusout
			- in case of arrow keys focusing enabled for child-containing widget, 
			determine behaviour on entering & leaving the widget, see the below table:

			ow_subfocus	| ow_arrowfocusin |	ow_arrowfocusout | effect

			   FALSE           FALSE             FALSE         entering-/leaving-
			   FALSE           FALSE             TRUE          entering-/leaving+
			   FALSE           TRUE              FALSE         entering(nearest)+/leaving-
			   FALSE           TRUE              TRUE          entering(nearest)+/leaving+
			   TRUE            FALSE             FALSE         entering(last focused)+/leaving-
			   TRUE            FALSE             TRUE          entering(last focused)+/leaving+
			   TRUE            TRUE              FALSE         entering(nearest)+/leaving-
			   TRUE            TRUE              TRUE          entering(nearest)+/leaving+

			- "entering" is focusing on a child within the widget
			- "leaving"  is return from last child onto the widget's level
			- "nearest" is the child closest on the arrow direction
			- "last focused" is the child focused on last leaving the widget
 
			*** The Up/Down arrow keys can leave from the children circle, 
				but Left/Right can only toggle between the children ***

			*** mouse entering/leaving isn't controllable by these options


		ow_focusbackonesc 
			- on pressing "Esc", returns input focus to the previously focused widget

		ow_noparentshortcut

			*** disables processing of delegated ( from the parent ) shortcuts *** 

			- "true" here disables processing shortcuts	if they're delegated 
			from the parent widget ( obviously, not processed by the parent )

		ow_nochildshortcut

			*** disables delegating shortcuts to the parent for taking decision *** 

			- if "true" then the widget tries to process it by oneself 
			otherwise it's passed to the parent widget for further chaining

			*** A shortcut can only be processed once ( by one widget ) ***

		ow_canclosenil
			- "true" here allows to continue even if there's contained widget(s) 
			not passing "CanClose" check

		ow_mousetransparent
			- "true" here causes the widget oneself ( not its contained ones ) 
			not to react to mouse events ( just allow them through to the children )

		ow_mousewheel
			- enables/disables {scrolling/navigating} with wheel of ImPS/2 etc mouse

		ow_noscroll
			- don't use screen image scrolling for twidget.scrollrect, 
			redraw the whole scrolled widget rectangle instead;
			sometimes needed with background fades.

		ow_nochildpaintclip
			- 

		ow_destroywidgets
			- "true" here causes calling "free" for all containing widgets as well

		ow_hinton
			- to show the hint even in case of hinting is disabled on the parent
			( "parent.ow_hintoff= true & parent.ow_hinton= false" )

		ow_hintoff 
			- "true" here combined with "ow_hinton=false" fully disables displaying the hint

		ow_multiplehint 
			- "true" here causes the widget to redisplay its hint on each {>3px} move within the widget oneself

        	ow_timedhint 
			- "true" here causes hint of the widget to disappear after a timed inteval (about 2 secs by default)

		ow_fontlineheight (design-time only)
			- causes "extraspace" of the last text line to be drawn, 
			in turn it causes adjustment of widget height if "ow_autoscale" is set
			
			*** makes sence only if "ow_autoscale=true" & ow_autosize=false & "extraspace <> 0" ***

		ow_fontglyphheight (design-time only)
			- causes only interline "extraspace"-s to be drawn, opposite to "ow_fontlineheight" 

		ow_autoscale (design-time only)
			- causes that if the contents change (design OR run-time) so that its' height changes 
			then the widget will be v-scaled as well

		ow_autosize (design-time only)
			- causes that widget's height & width & client area adjust so that to provide space for contents of the client area
			- no design-time change of height/width are possible as long as this option is in effect

		ow_autosizeanright
			- when autosizing & {an_right isn't set}, the design-set right margin against the parent is preserved

		ow_autosizeanbottom
			- when autosizing & {an_bottom isn't set}, the design-set bottom margin against the parent is preserved

	optionsskin:

		- osc_noskin
		- osc_framebuttononly
		- osc_container


	Methods:

	  // tmsecomponent

		// (re)draws the widget according to the related skin if apllicable;
		//
		// also called internally by "loaded" procedure ( before "OnLoaded" code ),
		// by ShowMessage ( for the internal widgets of the message dialogue ), 
		// when creating tab & form & menu widgets
		procedure updateskin(const recursive: boolean = false);

		// TRUE if the instance is created but not yet ready 
		// for interaction & accessing data & appearance change & receiving events etc
		// ( the stage between firing "OnCreate" & "OnLoaded" )
		function loading: boolean;
	
	 {$ifdef FPC}
		procedure setinline(value: boolean); // ?
		procedure setancestor(value: boolean); // ?
	 {$endif}

		// TRUE if all conditios are OK for executing the code of "event" ( a handler must be assigned to the event )
		function canevent(const event: tmethod): boolean;


		// Shortly, replaces the persistent storage of the widget
		//
		// if {value <> nil} then 
		//	- if "instance" is nil then calls "createproc" to create the instance,
		//    then assigns the instance's value:= "value" 
		// otherwise frees "instance"
		procedure setoptionalobject(const value: tpersistent; var instance;
                        createproc: createprocty);

		// creates the persistent storage of the widget via calling "createproc"
		procedure getoptionalobject(const instance: tobject; createproc: createprocty);

		// obtains & puts to "obj" a CORBA interface entry for "aintf" (GUID,...)
		function getcorbainterface(const aintf: ptypeinfo; out obj) : boolean;

        // TRUE if the widget is owned, or "self" otherwise
		function checkowned(component: tcomponent): boolean; 

        // TRUE if the widget is owner, or "self" otherwise
		function checkowner(component: tcomponent): boolean; 

		// return the top-most widget in owner chain starting from this widget
		function rootowner: tcomponent;

		// return the array of owning widgets starting from this widget
		// componentarty[0] is the widget oneself
		function getrootcomponentpath: componentarty;

        // returns items of objeclinker ( which notify this widget )
        // and free notify list ( which are notified by this widget ),
        // duplicates are removed.
        //	
        // Notifies mainly relate to insertion/removal operation on widgets
        // The notify list is maintained by FreeNotification & RemoveFreeNotification
		function linkedobjects: objectarty;

		// sends "event" recursively to child widgets until no more children or 
		// the event is processed ( cea_processed ) by one of the children,
		// "event" will be destroyed if destroyevent= true and not async
		procedure sendcomponentevent(const event: tcomponentevent; 
                                        const destroyevent: boolean = true);

		// sends "event" to each of owning widgets downward from the root owner,
		// "event" will be destroyed if destroyevent= true and not async
		procedure sendrootcomponentevent(const event: tcomponentevent;
                                        const destroyevent: boolean = true);

		// posts an async "atag"-ged event to be handled by oneself
		procedure asyncevent(atag: integer = 0);

		// posts a "tcomponentevent" instance from sender=self, 
		// "kind" is defined when creating the event, 
		// and "tag" may be adjusted after creation
		procedure postcomponentevent(const event: tcomponentevent);

		// returns the classname of the widget if the widget is toplevel, 
		// and "tmsecomponent" otherwise )
		property moduleclassname: string read getmoduleclassname;

		// returns the classname of the widget as the entry of its constructor
		// ( button => tbutton, datamodule => tdm1mo, form => ttstfo, dbstringedit => tdbstringedit,.. )
		property actualclassname: string read getactualclassname;

		// returns "fmsecomponentstate"
		// ( a set of cs_ismodule,cs_endreadproc,cs_loadedproc,cs_noload, cs_hasskin,cs_noskin )
		property msecomponentstate: msecomponentstatesty read fmsecomponentstate;

		// returns/sets a pointer associated with the widget
		// ( contrary to the integer "tag", allows to use an arbitary data type 
		// for associating data )
		property tagpo: pointer read ftagpo write ftagpo;

		// returns/sets a string identifying the widget in the help system
		property helpcontext: msestring read gethelpcontext write fhelpcontext;

	// twidget

		// creates an instance of the widget, owned by "aowner" if not NIL
		constructor create(aowner: tcomponent); override;

		destructor destroy; override;

		// ??
		procedure afterconstruction; override;

		// rescales the widget frame ( if assigned ) then owned widgets ( if exist, recursively ) then bounds_* then the font ( if assigned )
		// called before inserting in parentwidget,
		// calls "scale(ascale)",
		// no visual repainting
		procedure initnewcomponent(const ascale: real); virtual;

 		// restores the "fontheight" to "font.glyphheight" if "ow_fontglyphheight" or
 		// to "font.lineheight" if "ow_fontlineheight" otherwise,
		// ascale is ignored ?
		// calls "synctofontheight->setfontheight",
		// called after inserting in parentwidget,
		// no visual repainting
		procedure initnewwidget(const ascale: real); virtual;

		// creates the widget frame if not yet created
		procedure createframe;

		// creates the widget face if not yet  created
		procedure createface;

		// creates the widget font if not yet  created
		procedure createfont;

		// checks ws_loadlock and csdestroing too
		function isloading: boolean;

		// returns "widgetstatety" - a set of (
		// ws_visible,ws_enabled,ws_active,ws_entered,ws_entering,ws_exiting,
		// ws_focused,ws_mouseinclient,ws_wantmousebutton,ws_wantmousemove,
		// ws_wantmousefocus,ws_iswidget,ws_opaque,ws_nopaint,
		// ws_clicked,ws_mousecaptured,ws_clientmousecaptured,
		// ws_loadlock,ws_loadedproc,ws_showproc,ws_minclientsizevalid,
		// ws_showed,ws_hidden, //used in tcustomeventwidget
		// ws_destroying,ws_staticframe,ws_staticface,ws_isvisible
		//
		// iframe
		function widgetstate: widgetstatesty;

		// returns "widgetstate1ty" - a set of (
		// (ws1_childscaled,ws1_fontheightlock,
		// ws1_widgetregionvalid,ws1_rootvalid,
		// ws1_anchorsizing,ws1_isstreamed,
		// ws1_scaled, //used in tcustomscalingwidget
		// ws1_noclipchildren,
		// ws1_nodesignvisible,ws1_nodesignframe,ws1_nodesignhandles,
		// ws1_nodesigndelete,ws1_designactive,
		// ws1_fakevisible,ws1_nominsize //used for report size calculations
		// )
		property widgetstate1: widgetstates1ty read fwidgetstate1;
		
			* this set of states is needed because the max FPC set size is 32 
			  thus "widgetstate1ty" can't fit all states

		// TRUE if the widget is contained within another widget
		// ( tcomponent stuff )
		function hasparent: boolean; override;               

		// returns the parent component if it's a widget or the grandparent otherwise
		function getparentcomponent: tcomponent; override;   // tcomponent

		// TRUE if "awidget" is an ascendant or the widget or they are the same widget
		function checkdescendent(awidget: twidget): boolean;
		
		// TRUE if app is running and the widget owns the caret or the caret widget
		function hascaret: boolean;

        // TRUE if "winid" allocated and not loading and not destroying,
        // all widgets on a form have "winid" of this form ( a real window allocated by the OS )
        // thus have this function TRUE
		function windowallocated: boolean;

		// TRUE if presents a valid toplevelwindow with assigned "winid"
		function ownswindow: boolean;

		// invalidated area of the widget, the origin is "clientpos" against the roor widget
		function updaterect: rectty; 

		// calls recursively "canclose" for all contained widgets ( the widget oneself excluded! ),
		// TRUE if none of the widgets return FALSE
		//
		// more specialized widgets may have "canclose" overridden 
		// to perform more work than just this call recursion
		// ( not null or range check,.. )
		//
		// "onclosequery" must also pass the check if assigned, for the function to succeed
		function canclose(const newfocus: twidget = nil): boolean; virtual;

        // checks "canclose" first for focused widget of the window ( form,.. ) 
        // if it is a descendant of the widget or the widget oneself,
        // then continues with subwidgets of the widget;
        // also - finishes editing ( snapshots "value" ) in the focused widget before checking
		function canparentclose(const newfocus: twidget): boolean; overload;

		// the above function but with the preserved focus
		function canparentclose: boolean; overload;
                   //newfocus = window.focusedwidget      

		function canfocus: boolean; virtual;
		function setfocus(aactivate: boolean = true): boolean; virtual;//true if ok
		procedure nextfocus; //sets inputfocus to then next appropriate widget

		function findtabfocus(const ataborder: integer): twidget;
                       //nil if cannot focus

		function firsttabfocus: twidget;
		function lasttabfocus: twidget;
		function nexttaborder(const down: boolean = false): twidget;

		function focusback(const aactivate: boolean = true): boolean;
                               //false if focus not changed

		function parentcolor: colorty;
		function actualcolor: colorty; virtual;
		function actualopaquecolor: colorty;
		function backgroundcolor: colorty;
		function translatecolor(const acolor: colorty): colorty;

		procedure widgetevent(const event: twidgetevent); virtual;

		procedure sendwidgetevent(const event: twidgetevent);
                              //event will be destroyed

		procedure release; override;

		function show(const modal: boolean = false; const transientfor: twindow = nil): modalresultty; virtual;

		procedure hide;
		procedure activate(const abringtofront: boolean = true); virtual;
                             //show and setfocus

		procedure bringtofront;
		procedure sendtoback;
		procedure stackunder(const predecessor: twidget);

		procedure paint(const canvas: tcanvas); virtual;
		procedure update; virtual;
		procedure scrollwidgets(const dist: pointty);

		procedure scrollrect(const dist: pointty; const rect: rectty; scrollcaret: boolean);
                             //origin = paintrect.pos

		procedure scroll(const dist: pointty);
                            //scrolls paintrect and widgets

		procedure getcaret;
		procedure scrollcaret(const dist: pointty);
		function mousecaptured: boolean;
		procedure capturemouse(grab: boolean = true);
		procedure releasemouse;
		procedure capturekeyboard;
		procedure releasekeyboard;
		procedure synctofontheight; virtual;

		procedure dragevent(var info: draginfoty); virtual;
		procedure dochildscaled(const sender: twidget); virtual;

		procedure invalidatewidget;     //invalidates whole widget
		procedure invalidate;           //invalidates clientrect
		procedure invalidaterect(const rect: rectty; org: originty = org_client);
		procedure invalidateframestate;

		procedure invalidateframestaterect(const rect: rectty; 
                                        const org: originty = org_client);   
		function hasoverlappingsiblings(arect: rectty): boolean; //origin = pos

		function window: twindow;
		function rootwidget: twidget;

		function parentofcontainer: twidget;
            //parentwidget.parentwidget if parentwidget has not ws_iswidget,
            //parentwidget otherwise

		property parentwidget: twidget read fparentwidget write setparentwidget;
		function getrootwidgetpath: widgetarty; //root widget is last

		// number of contained widgets ( the widget oneself excluded ! )
		function widgetcount: integer;

		function parentwidgetindex: integer; //index in parentwidget.widgets, -1 if none
		property widgets[const index: integer]: twidget read getwidgets;
		function widgetatpos(var info: widgetatposinfoty): twidget; overload;
		function widgetatpos(const pos: pointty): twidget; overload;

		function widgetatpos(const pos: pointty; 
                   const state: widgetstatesty): twidget; overload;

		property taborderedwidgets: widgetarty read gettaborderedwidgets;

		function findtagwidget(const atag: integer; const aclass: widgetclassty): twidget;
              //returns first matching descendent

		property container: twidget read getcontainer;
		function containeroffset: pointty;
		function childrencount: integer; virtual;
		property children[const index: integer]: twidget read getchildwidgets; default;

		function childatpos(const pos: pointty; 
                   const clientorigin: boolean = true): twidget; virtual;

		function getsortxchildren: widgetarty;
		function getsortychildren: widgetarty;
		property focusedchild: twidget read ffocusedchild;
		property focusedchildbefore: twidget read ffocusedchildbefore;

		function mouseeventwidget(const info: mouseeventinfoty): twidget;

		function checkdescendent(widget: twidget): boolean;
                    //true if widget is descendent or self

		function checkancestor(widget: twidget): boolean;
                    //true if widget is ancestor or self

		function containswidget(awidget: twidget): boolean;

		procedure insertwidget(const awidget: twidget); overload;

		procedure insertwidget(const awidget: twidget; const apos: pointty); overload; virtual;
                 //widget can be child

		function iswidgetclick(const info: mouseeventinfoty; const caption: boolean = false): boolean;
		//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
 		//or in frame.caption if caption = true, origin = pos

		function isclick(const info: mouseeventinfoty): boolean;
		//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect

		function isdblclick(const info: mouseeventinfoty): boolean;
		//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
		// and timedlay to last buttonpress is short

		function isdblclicked(const info: mouseeventinfoty): boolean;
		//true if eventtype in [et_buttonpress,et_butonrelease], button is mb_left,
		// and timedlay to last same buttonevent is short

		function isleftbuttondown(const info: mouseeventinfoty): boolean;
		//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
		//origin = paintrect.pos

		widgetrect: the widget on-screen area including its frame & frame caption

			paintrect: the widget on-screen area except its frame & frame caption

			clientrect: virtual area which 
				- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
				- for scrolling widgets, may be bigger than "paintrect", 
				  also may shift ( change its "pos" ) when scrolling
		
	// the coord of outer top-left corner against the toplevel form = the window owner,
	// including the frame & frame caption 
		function rootpos: pointty; 

	// the coord of the outer top-left corner against the screen ( the WM decorations aren't counted in )
	// includes the frame & frame caption 
		property screenpos: pointty; 

	//  the coord of the outer top-left corner against the parent widget,
	// including the frame & frame caption 
		property widgetrect: rectty; 
		property pos: pointty; // =widgetrect.pos
		property size: sizety; // =widgetrect.size
		property left: integer; // =bounds_x
		property right: integer; //widgetrect.x + widgetrect.cx, sets cx;
		property top: integer;  // =bounds_y
		property bottom: integer; //widgetrect.y + widgetrect.cy, sets cy;
		property width: integer; // =bounds_cx
		property height: integer; // =bounds_cy
		function widgetsizerect: rectty;          //pos = nullpoint

    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
    //  except the frame & frame caption 
		function paintrect: rectty;
		function paintpos: pointty;
		function paintsize: sizety;
		function innerpaintrect: rectty; // mainly equals to paintrect
		function clientwidgetrect: rectty; // mainly equals to paintrect
		function clientwidgetpos: pointty;
		function clippedpaintrect: rectty; // mainly equals to  but clipped by all parentpaintrects
		function innerwidgetrect: rectty;     // mainly equals to paintrect
		function innerclientwidgetpos: pointty;

    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
    //  except the frame caption 
		function framerect: rectty; // =paintrect except the frame caption area
		function framepos: pointty;
		function framesize: sizety;

    // the coord of the client area ( clientrect )  against the paint area ( paintrect )
    //  usually these areas match
		function clientrect: rectty;
		property clientsize: sizety;
		property clientwidth: integer;
		property clientheight: integer;
		property clientpos: pointty;

    // the coord of the paint area of the parent against the paint area of this widget
		function paintrectparent: rectty; //nullrect if parent = nil,

    // the coord of the client area of the parent against the paint area of this widget
		function clientrectparent: rectty; //nullrect if parent = nil,

	// the coord of the inner area against the client area ( clientrect )
		function innerclientrect: rectty;  // mainly equals to clientrect
		function innerclientsize: sizety;
		function innerclientpos: pointty;

		function framewidth: sizety;              //widgetrect.size - paintrect.size
		function clientframewidth: sizety;        //widgetrect.size - clientrect.size
		function innerclientframewidth: sizety;   //widgetrect.size - innerclientrect.size
		function innerframewidth: sizety;         //clientrect.size - innerclientrect.size  

    // the coord of the paint area against the widgetrect(pos) of the parent
		function paintparentpos: pointty;    //origin = parentwidget.pos

    // the coord of the client area against the widgetrect(pos) of the parent
		function clientparentpos: pointty;   //origin = parentwidget.pos

    // the coord of the widgetrect(pos) against the client area of parent
		property parentclientpos: pointty;


		function clientpostowidgetpos(const apos: pointty): pointty;
		function widgetpostoclientpos(const apos: pointty): pointty;
		function widgetpostopaintpos(const apos: pointty): pointty;
		function paintpostowidgetpos(const apos: pointty): pointty;
		procedure scale(const ascale: real); virtual;


		property minsize: sizety read fminsize write setminsize;
		property maxsize: sizety read fmaxsize write setmaxsize;
		function maxclientsize: sizety; virtual;


		property anchors: anchorsty read fanchors write setanchors default defaultanchors;
		property defaultfocuschild: twidget read getdefaultfocuschild write setdefaultfocuschild;


		procedure changeclientsize(const delta: sizety); //asynchronous

		function getcanvas(aorigin: originty = org_client): tcanvas;

		function showing: boolean;
               //true if self and all ancestors visible and window allocated

		function isenabled: boolean;
               //true if self and all ancestors enabled

		function active: boolean;
		function entered: boolean;

		function activeentered: boolean; 
			//true if entered and window is regularactivewindow or inactivated

		function focused: boolean;
		function clicked: boolean;

		function indexofwidget(const awidget: twidget): integer;

		procedure changedirection(const avalue: graphicdirectionty;
                                            var dest: graphicdirectionty); virtual;

		// (re)arranges "awidgets" horizontally within the parent's client area 
		// so that awidget[i] were placed next each other 
		// at h-space dist[i], starting from "startx" with the right margin "endmargin";
		// 
		// if the number of "dist" is fewer than the number of "awidgets" then the remaining h-spaces are taken 
		// as the last "dist[i]" or "0" if none;
		// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
		// 
		// non-zero "endmargin" causes one of awdidget[i] to h-resize to provide the margin :
		//  - if one or more of awidgets[i] have [an_left,an_right] set then the first of such is resized
		//    otherwise the last awidgets[i] is h-resized 
		// 
		procedure placexorder(
				const startx: integer; 
				const dist: array of integer;
                const awidgets: array of twidget;
                const endmargin: integer = minint);

		// (re)arranges "awidgets" vertically within the parent's client area 
		// so that awidget[i] were placed upper/lower each other 
		// at v-space dist[i], starting from "starty" with the bottom margin "endmargin";
		// 
		// if the number of "dist" is fewer than the number of "awidgets" then the remaining v-spaces are taken 
		// as the last "dist[i]" or "0" if none;
		// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
		// 
		// non-zero "endmargin" causes one of awdidget[i] to v-resize to provide the margin :
		//  - if one or more of awidgets[i] have [an_top,an_bottom] set then the first of such is resized
		//    otherwise the last awidgets[i] is v-resized 
		// 
		procedure placeyorder(
				const starty: integer; 
				const dist: array of integer;
                const awidgets: array of twidget;
                const endmargin: integer = minint);
               //origin = clientpos, endmargin by size adjust of widgets 
               //with [an_top,an_bottom], minint -> no change

		// if {mode <> wam_none} then (re)arranges "awidgets" horizontally  within the parent's client area so that 
		// awidgets[0] stays on its place but awidgets[1..N] :
		// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_left" set ) so that they right borders match the right border of awidgets[0]
		// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_right" set ) so that they left borders match the left border of awidgets[0]
		// - if {mode = wam_center} then awidgets[i>=1] move so that they Y-axes match the Y-axe of awidgets[0]
		//
		// mainly applicable for v-stacked widgets since h-stacked may overlap after such alignment
		//
        // returns the reference point ( the coord of awidgets[0] )
		function alignx(const mode: widgetalignmodety;
                        const awidgets: array of twidget): integer;


		// if {mode <> wam_none} then (re)arranges "awidgets" vertically within the parent's client area so that 
		// awidgets[0] stays on its place but awidgets[1..N] : 
		// - if {mode = wam_end} then awidgets[i>=1] move or resize ( if "anchors.al_top" set ) so that they bottom borders match the bottom border of awidgets[0]
		// - if {mode = wam_start} then awidgets[i>=1] move or resize ( if "anchors.al_bottom" set ) so that they top borders match the top border of awidgets[0]
		// - if {mode = wam_center} then awidgets[i>=1] move so that they X-axes match the X-axe of awidgets[0]
		//
		// mainly applicable for h-stacked widgets since v-stacked may overlap after such alignment
		//
        // returns the reference point ( the coord of awidgets[0] )
		function aligny(const mode: widgetalignmodety;
                        const awidgets: array of twidget): integer;

		function actualcursor: cursorshapety; virtual;


	Event handlers:

	- onactivate

		 fires :

		= on receiving input focus, just before "OnFocus"
			
		= forms specific :
			* on 1-st display of the form after "OnLoaded" ( from "Loaded" procedure)
			* on switch back from another apllication/WM ( "oe_activate" event )
			* after closure of a descendant form
			* on minimizing/maximizing the form

	- onchildscaled

		 fires :

		= on child/children resizing due to font height change

		= form widget: once "form.container" {scrolling widget} is loaded

	- ondeactivate
		 fires 
			= form widget: when the form looses input focus
			= non-form widget: when the widget looses input focus

	- ondefocus

		fires 
		= on disabling the widget

	= form widget: if another form is focused
		= non-form widget: if another widget is focused

	- onenter
		= fires on any way of taking parent-wide focus as soon as 
		the parent stores the new child's order, before "OnActivate" & "OnFocus"

	- onexit
		= fires last on parent-wide lossing focus, after "OnDefocus" & "OnDeactivate"
		= for top-level ( not in a container ) forms, doesn't fire

	- onfocus
		fires 
			= once the existing widget takes the focus 
			= on showing the widget's form if the widget has the lowest "TabOrder"

	- onfontheightdelta
		fires
			= if [ow_fontglyphheight OR ow_fontlineheight ] AND {the
			new font height differs from the previos one}
			= before the parent redraws this widget

	- onpopup
		fires :
			= on calling a popup-menu ( with "RightClick" ), once the menu items of the current level are loaded
			( before building the submenus ) 

	- onresize

		= fires on creating/(changing size)/(min-max restoring) of widget, 
		before actual redrawing

		= rechecks if there's real work to do

	- onshowhint
		= fires when a installed hint is activated or on "aplication.showint" called
		= since called last, allows to adjust the default behavior

	- onbeforeupdateskin
		= fires in "updateskin" ( the widget is loaded etc ) before applying the skin

	- onafterupdateskin
		= fires in "updateskin" ( the widget is loaded etc ) once the skin is applied

TWidget stuff

   Properties:    
		- name
		- anchors
		- bounds
		- color
		- enabled
		- visible
		- <face> : see {any face}
		- <frame> : see {any frame}
	    - hint
	    - helpcontext
	    - tag
	    - taborder
	    - cursor
	    - optionswidget
	    - optionsskin
	    - popupmenu
    
		twidget's event handlers:
    
			- on(de)activate
			- onbeforeupdateskin
			- onafterupdateskin
			- onchildscaled
			- onfontheightdelta
			- on(de)focus
			- onenter
			- onmove
			- onpopup
			- onresize
			- onshowhint
      
	align_glue : 
	  ( outer anchoring mode for widget group, in the align mode )
		- wam_none
		- wam_start
		- wan_center
		- wm_end

	align_leader : 
		the widget ( incl another spacer, splitter or layouter ) against which the alignment applies ( the reference widget )

	align_mode : 
	  ( inner anchoring mode within widget group, in the align mode )
		- wam_none
		- wam_start
		- wan_center
		- wm_end

// Place mode:

      
	place_mindist, place_maxdist:
		- in the place(ment) mode, limits distance between widgets
		  ( these distance once calculated also define side margins if applicable )

	place_mode: 
	  ( outer anchoring mode for widget group, in the place mode )
		- wam_none
		- wam_start
		- wan_center
		- wm_end

	place_options:
		- plo_endmargin
			= to resize a widget so that it "eats" extra space if it occurs
			
			* only applicable in the place mode, with a limiting value of "place_maxdist" and:

			  1) {place_mode <> wam_none}
			or
			  2) {place_mode = wam_end} and {plo_propmargin in place_options}

			For the exact look, see above


		- plo_propmargin
			= виджеты расставляются теснее так, чтобы образовались отступы перед и после,
			  причем расстояние между центрами виджетов было бы таким же, 
			  как и растояние между серединами крайних виджетов и соотв. границами зоны расстановки

		- plo_syncmaxautosize
			= see above

		- plo_synccaptiondistx
			= see above

			  * affects widgets with opposite cp_left/right set as well	
			  * the minimal before-adjustment "captiondist" among all widgets limits "captiondist" for each of the widget
              * don't set cfo_captiondistouter here !

		- plo_synccaptiondisty
			= see above

			  * affects also widgets with opposite cp_top/bottom set	
			  * the minimal before-adjustment "captiondist" amongst all widgets limits "captiondist" for each of the widget

              ! here, don't set "cfo_captiondistouter" for affected widgets !

		- plo_syncpaintwidth
			= see above

		- plo_syncpaintheight
			= see above

		- plo_scalesize
			= see above


	dist_left, dist_right, dist_top, dist_bottom : 
		= margins between most outer edge the layouter and 
		  the corresponding linked widget

		* see "tspacer" for detail

	linkleft,linkright,linktop,linkbottom : see "tspacer"

	options:
		- spao_glueright, spao_gluebottom: 
			= set the adjustment dependencies between the layouter and its link_* widgets

			* see "tspacer" for more details

	// which mode of widget placement to apply - see above
	optionslayout: 
		- lao_alignx
		- lao_aligny
		- lao_placex
		- lao_placey
		- lao_scalewidth
		- lao_scaleheight
		- lao_scaleleft
		- lao_scaletop
		
		* lao_place* & lao_align* can't be combined for one direction

	optionsscale: 
	  
	  * cause the layouter to provide full space for the widgets as long as they expand/shrink/move

		- osc_expandx 
			= allocates more h-space if needed

		- osc_shrinkx
			= removes extra h-space if occurred

		- osc_expandy
			= allocates more v-space if needed

		- osc_shrinky
			= removes extra v-space if occurred

		- osc_invisishrinkx
			= fully h-collapses the layouter if "visible=false" ( run-time only )

		- osc_invisishrinky
			= fully v-collapses the layoter if "visible=false" ( run-time only )

	optionsskin:
		= see <any widget>


	Methods:

		constructor create(aowner: tcomponent); override;

Public stuff

	(f)window: 
		the OS-allocated ( root = toplevel ) window common for all widgets of this window
		
		* "widget.fwindow.fowner = widget.self" in case of the widget present the root "fwindow" 
		  ( owns the window )

	(f)rootpos: 
		position of the widget in the coord of toplevel window not the nearest parent widget alone,
		calculated as sum of such positions ( fwidgetrect.pos ) starting from the toplevel through the
                chain of all parents up to the current widget;
		"nullpoint" (0,0) for toplevel widgets ( window-owning forms,..)

	screenpos:
		- coord aginst the top-left corner of screen
		- WM decoration & title aren't parts of the widget !

	widgetrect: 
		the widget on-screen area including its frame & frame caption

	paintrect: 
		the widget on-screen area except its frame & frame caption

	clientrect: 
		virtual area which 
			- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
			- for scrolling widgets, may be bigger than "paintrect", 
		 	  also may shift ( change its "pos" ) when scrolling

			* "t*grid" aren't such scrollable widgets since their virtual height would be limited by 
			  the X11 "+-32000" limitation, 
			  so example of such widgets are tscrollbox, "tform.container" etc

	framerect: 
		the widget on-screen area except its frame caption but including inner & outer frame

	****************

	// releases all thread locks then post the event to the app event queue and
	// waits for the event handler finishes ( signalled by "sye_ok on a semaphore )
	// finally restores the locks
    // true if the handler is not aborted
	function synchronizeevent(const aevent: tsynchronizeevent): boolean;

    // translates "point" coord against "source" widgetrect to "dest" widgetrect
	//
	//   * nil "source" = from screen coord 
	//   * nil "dest" = to screen coord
	procedure translatewidgetpoint1(var point: pointty; const source,dest: twidget);

	// the function-framed version of "translatewidgetpoint1"
	function translatewidgetpoint(const point: pointty; const source,dest: twidget): pointty;

	// rect isntead of point, 
	// if dest = nil then to screen 
    // if source = nil then against screen
	function translatewidgetrect(const rect: rectty; const source,dest: twidget): rectty;
	//-----------------
    // translates "point" coord against "source" paintrect to "dest" paintrect
	//   * nil "source" = from screen coord 
	//   * nil "dest" = to screen coord
	procedure translatepaintpoint1(var point: pointty; const source,dest: twidget);

	// the function-framed version of "translatepaintpoint1"
	function translatepaintpoint(const point: pointty; const source,dest: twidget): pointty;

	// rect isntead of point, 
	// if dest = nil then to screen 
    // if source = nil then against screen
	function translatepaintrect(const rect: rectty;const source,dest: twidget): rectty;
    //-----------------
    // translates "point" coord against "source" clientrect to "dest" clienttrect
	//   * nil "source" = from screen coord 
	//   * nil "dest" = to screen coord
	procedure translateclientpoint1(var point: pointty;
                    const source,dest: twidget);

	// the function-framed version of "translateclientpoint1"
	function translateclientpoint(const point: pointty; const source,dest: twidget): pointty;

	// rect isntead of point, 
	// if dest = nil then to screen 
    // if source = nil then against screen
	function translateclientrect(const rect: rectty; const source,dest: twidget): rectty;
    //-----------------

	// (re)sorts "awidgets" in order of increasing their "widgetrect.x" coords
	//   - if parent = nil then the coords are against individual parent of each of "awidgets"
	//   - if parent is supplied then the coords are against this parent
	procedure sortwidgetsxorder(var awidgets: widgetarty; const parent: twidget = nil);

	// (re)sorts "awidgets" in order of increasing their "widgetrect.y" coords
	//   - if parent = nil then the coords are against individual parent of each of "awidgets"
	//   - if parent is supplied then the coords are against this parent
	procedure sortwidgetsyorder(var awidgets: widgetarty; const parent: twidget = nil);

	// for each  of "widgets", calculates its autosized client area ( min size rect to fit the caption, etc )
    //   - both hor & ver sizes of client area of each of "widgets" are adjusted to the max of the above calculated areas,
	//	   as the result - client areas of all widgets become identically v+h sized
    // 
    //   * right & bottom anchored margins of each widget are preserved
	procedure syncmaxautosize(const widgets: array of twidget);

	// for each  of "widgets", width of client area of each of "widgets" is adjusted so that 
    // external ( by the outer border of frame ) widths of all widgets become identical 
    // to the external widht of the widest widget
    //    
    //   * if "awidth" >= 0 then no determining the widest widget is taken and
    //     "awidth" is adjusted to instead, for all widgets
    //   * right anchored margins of each widget are lost
	procedure syncminframewidth(const awidgets: array of twidget;
                               const awidth: integer = -1);

	// for each  of "widgets", height of client area of each of "widgets" is adjusted so that 
    // external ( by the outer border of frame ) heights of all widgets become identical 
    // to the external height of the highest widget
    //    
    //   * if "aheight" >= 0 then no determining the highest widget is taken and
    //     "aheight" is adjusted to instead, for all widgets
    //   * bottom anchored margins of each widget are lost
	procedure syncminframeheight(const awidgets: array of twidget; const aheight: integer = -1);

Projects using MSEgui