Difference between revisions of "Reference: MSEgui"

From Lazarus wiki
Jump to navigationJump to search
(General stuff)
Line 700: Line 700:
 
Only useful if inserted into a twidgetgrid, builds a very simple terminal emulator. Used in MSEide target console.
 
Only useful if inserted into a twidgetgrid, builds a very simple terminal emulator. Used in MSEide target console.
  
== Properties for all widgets ==
+
== NoGui ==
 +
=== TAction ===
 
<pre>
 
<pre>
 +
Shortcut processing order :
  
name
+
- 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
  
anchors
 
  
-----------
+
*** A shortcut is bound to a widget by :
 +
- placing an action component on the widget ***
 +
- direct assigning the shortcut to the widget (menus,..)
 +
---------------------------
  
- they control of design/runtime sticking widgets to their parents
+
caption, color, colorglyph, helpcontext, hint, imagecheckedoffset,
 +
imagelist <see "timagelist">, imagenr, imagenrdisabled
  
- dimention pair ( top/bottom or left/right ) both set to "false" cause
+
- sets look of "clients" (buttons, menu/toolbar items,..), unless
the widget to fit the parent's client area in that dimention;
+
these clients have "state.as_local*" set :
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_*"
+
*** For meaning of these options, see help on the "client" widgets ***
-----------
 
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
+
group
- on run-time, resizes/shifts up the widget to keep the design-set distance
+
- default value for one-named property of the bound widgets
between the widget's top border and the upper side of parent's client area
+
( menu items,... )
as the parent resizes, until scrolling begins
 
  
an_right
+
options :
- on run-time, resizes/shifts right the widget to keep the design-set distance
+
ao_updateonidle
between the widget's right border and the right side of parent's client area
+
- runs this action in cycle, waiting for no gui events everytime
as the parent resizes, until scrolling begins
 
  
an_bottom
+
ao_globalshortcut
- on run-time, resizes/shifts down the widget to keep the design-set distance
+
- allows the action to trigger on a non-main form
between the widget's bottom border and the lower side of parent's client area
+
  (the shortcut is triggered whatever form of the applicatin it was pressed on,
as the parent resizes, until scrolling begins
+
  otherwise only when the form where the aption is placed on is focused )
  
bounds
+
ao_nocandefocus
 
+
- causes the action not to call "CanDefocus" for focused edit widget of active form
cx - width of the widget
+
  before executing own code
cxmax, cxmin - design/runtime width of the widget is enforced between "cxmax" and "cxmin"
+
  ( it helps to avoid the effect of cancelling changes in these widgets
cy - height of the widget
+
  on activating the bound shortcut )
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
 
  
 +
shortcut
 +
- keyboard combination triggering the action
  
autosize
+
shortcut
 +
- alternative "shortcut" and handled identically
  
-----------
+
state :
- 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)
+
as_disabled
cy - addition to height of the widget (with v-centering post applied)
+
- prevents the action from triggering, also puts the bound widgets to "disabled" look
  
- color
+
as_invisible
= the default color of client area & caption text background
+
- in run-time, hides the bound widget, still reacting on the shortcut or direct call
= may be overwtitten:
 
* the client area - with "frame.colorclient"
 
* the caption BG - with "frame.font.colorbackground"
 
  
- font
+
as_checked
= see {any font}
+
- selects the bound menu item if it has "mao_checkbox" option set
  
- frame
+
as_default
= see {any frame}
+
as_local*
  
- face
+
statfile
= see {any face}
+
<see "tstatfile">
  
- hint
+
stavarname
= descriptive text appearing when mouse pointer enters the widget
 
  
- cursor
+
= shape of the mouse pointer over the client area of widget (run-time only)
+
tagaction
 +
onasyncevent
 +
onchange
 +
onexecute
 +
onupdate
 +
<pre/>
  
- visible
+
=== TActivator ===
= "true" allow the widget to appear ( run-time only )
+
=== TThreadComp ===
 
+
=== TStatFile ===
- enabled
+
- so that to be in effect, it should also be assigned to the form where the widget using the stafile is placed on
= "true" allows the widget to participate in GUI interaction
+
- in design, if "onstatwrite" is set and "filedir" is not yet created, deactivate exception "ECreateError" in project settings ( "Debugger" tab )
= "false" disallows the widget & its childs :
+
- "filedir" may contain "~/" indicating the user's home directory
* processing all events & shortcuts & menu calls
+
- options "oe_savestate" & "oe_savevalue" of "client" widgets define what to store to the file
* auto "CanClose" check
+
- 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
  
Also "false" usually aints the widget in color marking
+
Positioning to a section speeds up accessing its statvars
the "disabled" state ( usually light gray font color )
 
  
- popupmenu
+
- there also is "tstatfiler" ( exposed by some "tstatfile" events ) which:
= reference to a preset tpopupmenu widget serving the right-click menu
+
= 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
  
- taborder
+
=== TTimer ===
- {0..N} order number when TAB-key cycling through widgets in the container
+
=== TNoGuiAction ===
 
+
=== TPipeReadercomp ===
- tag
+
=== TSysEnvManager ===
- an integer value bound to this widget instance
+
=== TProcessMonitor ===
 +
=== TFilechangeNotifier ===
 +
=== TShortCutController ===
 +
=== TPostscriptPrinter ===
 +
=== TGdiPrinter ===
 +
=== TWmfPrinter ===
 +
=== TSkinController ===
 +
=== TGuiThreadComp ===
  
- helpcontext
+
== Font ==
= a string returned by "(active/mouse)helpcontext" methods of the owning form
+
=== Any Font ===
  when this widget is focued or under mouse in the active window
+
<pre>
 
+
    charset { ANSI/ DEFAULT/ SYMBOL /SHIFTJIS /HANGEUL /GB2312 /CHINESEBIG5 /OEM
- zorder
+
/JOHAB / HEBREW/ ARABIC/ GREEK/ TURKISH/ VIETNAMESE/ THAI/ EASTEUROPE/
= reading: finds the current Z-order of the widget's window
+
RUSSIAN/ MAC/ BALTIC }
= setting: if the value = 0 then lowers the widget's window in the stacking hierarchy, otherwise rises
+
- 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
optionswidget:
+
- color of the glyphs contours
 
+
colorbackground
ow_background
+
- fill color of the glyph cells ( not including extraspace )
- keeps the window/widget on bottom of the Z-order stack.
+
colorshadow
 
+
- color of SE glyph "edges" ( if not "cl_none", deactivates "colorbackground" )
ow_top
+
extraspace
- keeps the window/widget in foreground
+
- v-space between glyph cells of adjacent text rows (negative values cause the cells to overlap )
 
+
height
ow_noautosizing
+
- v-size of glyph cells, in pixels
- when docking, not to resize for the docking area
+
name
 
+
- initially, font is choosen by { "family" = this name }
ow_mousefocus
+
options:
- "false" here disables focusing the widget with mouse
+
foo_fixed
  ( and "OnFocus" doesn't fire on mouse clicks )
+
- changes the font to the nearest "mono" spaced (usually = Courier)
 
+
foo_proportional
ow_tabfocus
+
- changes the font to the nearest "proportionally" spaced (usually = Helvetica)
- "false" here disables focusing the widget with "TAB" key
+
foo_helvetica
  ( and "OnFocus" doesn't fire on TAB pressed )
+
- 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
  
ow_parenttabfocus
+
width
- enters the childs on TAB-focusing then returns to the widget after
+
- 10*{ glyph cell width, average in pixels }, 0 = {font default}
sequential TAB-ing through its child widgets,
+
 
otherwise TAB-ing cycles on the childs if entered
+
xscale
 +
- width ratio of each glyph {cell & contour}, the effect is similar to "width"
  
ow_arrowfocus
+
*** "foo_*" font selection overrides one made with "name"
- allows the widget ( and its childs in turn ) to be focused with  
 
the arrow keys
 
  
ow_subfocus, ow_arrowfocusin, ow_arrowfocusout
+
*** if change with "foo_*" is usuccessful then the nearest "sans" font is usually choosen
- 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
+
*** The categories :
  
  FALSE          FALSE            FALSE        entering-/leaving-
+
sans => have no serifs and have strokes of even thickness
  FALSE          FALSE            TRUE          entering-/leaving+
+
serif => have serifs at glyph contours and made up of strokes of varying thickness
  FALSE          TRUE              FALSE        entering(nearest)+/leaving-
+
script => resemble handwriting
  FALSE          TRUE              TRUE          entering(nearest)+/leaving+
+
decorative => flashy styles to be used sparingly in headlines or posters
  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
+
<pre/>
- "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 childs circle,
 
but Left/Right can only toggle between the childs ***
 
  
*** mouse entering/leaving isn't controllable by these options
+
== GUI ==
 +
=== TWindow ===
 +
<pre>
 +
twindow = class(teventobject,icanvas)
 +
  public
  
 +
// releases mouse, unlinks from the canvas, processes all pending events of the window
 +
// if called from within main thead then destroys the window directly
 +
// otherwise posts a window destroy event for oneself and waits for it to be processed
 +
procedure destroywindow;
  
ow_focusbackonesc
+
// registers the instance of onself in the "owner" widget, allocates the canvas,
- on pressing "Esc", returns input focus to the previously focused widget
+
// 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);
  
ow_noparentshortcut
+
destructor destroy; override;
  
*** disables processing of delegated ( from the parent ) shortcuts ***
+
// adds "method" to the internal list of scroll dependants
 +
procedure registeronscroll(const method: notifyeventty);
  
- "true" here disables processing shortcuts if they're delegated
+
// removes "method" from the internal list of scroll dependants
from the parent widget ( obviously, not processed by the parent )
+
procedure unregisteronscroll(const method: notifyeventty);
  
ow_nochildshortcut
+
// 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 
  
*** disables delegating shortcuts to the parent for taking desision ***
+
  function tinternalapplication.beginmodal(const sender: twindow): boolean;
  
- if "true" then the widget tries to process it by oneself
+
// removes the internal stuff which indicates the modal state
otherwise it's passed to the parent widget for further chaining
+
procedure endmodal;
  
*** A shortcut can only be processed once ( by one widget ) ***
+
// 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-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;
  
ow_canclosenil
+
  // if the bound widget has visible=true then:
- "true" here allows to continue even if there's contained widget(s)  
+
  //  - if NOT windowevent then :
not passing "CanClose" check
+
  //    = address the WM to set size of the window acc to window opts
 
+
  //      wp_maximized, wp_fullscreen or normal size otherwise
ow_mousetransparent
+
  // = if the window is normally sized, moves it to its default position is specified ( screen centered etc )
- "true" here causes the widget oneself ( not its contained ones )
+
  // - unhides/unminimizes the window if needed
not to react to mouse events ( just allow them through to the childs )
+
  // - shows other windows of the applications acc to state of the window group
 +
  // ( in normal size or minimized )
  
ow_mousewheel
+
  private
- enables/disables {scrolling/navigating} with wheel of ImPS/2 etc mouse
+
procedure twindow.show(windowevent: boolean);
  
ow_noscroll
+
// TRUE if this window currently grabs user input
- don't use screen image scrolling for twidget.scrollrect,
+
( a widget drawn within the window(=form) is in focus,.. )
redraw the whole scrolled widget rectangle instead;
+
function active: boolean;
sometimes needed with background fades.
 
  
ow_nochildpaintclip
+
// 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 occured
 +
function deactivateintermediate: boolean;
  
ow_destroywidgets
+
// makes the window active & clears the above app reference to it ( "active before deactivating" )
- "true" here causes calling "free" for all containing widgets as well
+
procedure reactivate; //clears app.finactivewindow
  
ow_hinton
+
// scans the app event queue for "ek_expose" event[s] addressed to the window,
- to show the hint even in case of hinting is disabled on the parent
+
// if found then redraws that part of the window which the event describes
( "parent.ow_hintoff= true & parent.ow_hinton= false" )
+
// ( processed events are then deleted )
 +
procedure update;
  
ow_hintoff
+
// TRUE if the window :
- "true" here combined with "ow_hinton=false" fully disables displaying the hint
+
// 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;
  
ow_multiplehint
+
// tries to defocus the currently focused widget if it belongs to the window,
- "true" here causes the widget to redisplay its hint on each {>3px} move within the widget oneself
+
// if succeeds then executes code of virtual "DoDefocus" of the widget descessor
 
+
// ( this code defines behaviour & look of the widget on defocusing );
*mse ow_timedhint
+
//
- "true" here causes hint of the widget to disappear after a timed inteval (about 2 secs by default)
+
// no defocusing is done if the focused widget ( or its descendants )  
 
+
// doesn't pass "CanClose" check
ow_fontlineheight (design-time only)
+
//
- causes "extraspace" of the last text line to be drawn,
+
procedure nofocus;
in turn it causes adjustment of widget height if "ow_autoscale" is set
+
 
+
  // setfocusedwidget(widget)
*** makes sence only if "ow_autoscale=true" & ow_autosize=false & "extraspace <> 0" ***
+
 
 +
  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;
  
ow_fontglyphheight (design-time only)
+
  procedure capturemouse;
- causes only interline "extraspace"-s to be drawn, opposite to "ow_fontlineheight"
+
  procedure releasemouse;
 +
  procedure postkeyevent(const akey: keyty;
 +
        const ashiftstate: shiftstatesty = []; const release: boolean = false;
 +
                  const achars: msestring = '');
  
ow_autoscale (design-time only)
+
  function winid: winidty;
- causes that if the contents change (design OR run-time) so that its' height changes
+
  function haswinid: boolean;
then the widget will be v-scaled as well
+
  function state: windowstatesty;
 
+
  function visible: boolean;
ow_autosize (design-time only)
+
  function activating: boolean; //in internalactivate proc
- causes that widget's heigh & width & client area adjust so that to provide space for contents of the client area
+
  function normalwindowrect: rectty;
- no desing-time change of height/width are possible as long as this option is in effect
+
  property updateregion: regionty read fupdateregion;
 +
  function updaterect: rectty;
  
ow_autosizeanright
+
  procedure registermovenotification(sender: iobjectlink);
- when autosizing & {an_right isn't set}, the design-set right margin against the parent is preserved
+
  procedure unregistermovenotification(sender: iobjectlink);
  
ow_autosizeanbottom
+
  property options: windowoptionsty read foptions;
- when autosizing & {an_bottom isn't set}, the design-set bottom margin against the parent is preserved
 
  
optionsskin:
+
// widget
 +
property owner: twidget read fowner;
  
- osc_noskin
+
  property focusedwidget: twidget read ffocusedwidget;
- osc_framebuttononly
+
  property transientfor: twindow read ftransientfor;
- osc_container
+
  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;
  
  
Methods:
+
windowoptionty = (wo_popup,wo_message,wo_buttonendmodal,wo_groupleader,
 +
                  wo_windowcentermessage); //showmessage centered in window
  
  // tmsecomponent
 
  
// (re)draws the widget according to the related skin if apllicable;
+
optionswindow:
//
+
wo_popup
// also called internally by "loaded" procedure ( before "OnLoaded" code ),
+
- in run-time, hides all OS windows-manager ( WM ) decorations (title bar, buttons "Close/Resize,Min/Max" etc),
// by ShowMessage ( for the internal widgets of the message dialogue ),
+
letting only its client area to appear
// when creating tab & form & menu widgets
+
so :
procedure updateskin(const recursive: boolean = false);
+
= 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
  
// TRUE if the instance is created but not yet ready
+
wo_groupleader
// for interaction & accessing data & appearance change & receiving events etc
+
- keeps on the WM taskbar a shortcut to the window
// ( the stage between firing "OnCreate" & "OnLoaded" )
+
( if the parent window is a groupleader too then dislpays a step upper in its group )
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 )
+
Event handlers:
function canevent(const event: tmethod): boolean;
 
  
 +
- onmove
 +
= fires once the (window/widget) is created/moved ( with check if really moved by a distance)
  
// Shortly, replaces the persistent storage of the widget
+
<pre/>
//
+
=== TFaceList ===
// if {value <> nil} then
+
=== TFrameComp ===
// - if "instance" is nil then calls "createproc" to create the instance,
+
//    then assigns the instance's value:= "value"
+
Terminilogy :
// otherwise frees "instance"
 
procedure setoptionalobject(const value: tpersistent; var instance;
 
                        createproc: createprocty);
 
  
// creates the persistent storage of the widget via calling "createproc"
+
{client area = area of the widget which interacts with a user}
procedure getoptionalobject(const instance: tobject; createproc: createprocty);
 
  
// obtains & puts to "obj" a CORBA interface entry for "aintf" (GUID,...)
+
{bevelling = additional facets rising/sinking frame & client area,  
function getcorbainterface(const aintf: ptypeinfo; out obj) : boolean;
+
constists of two parts -
 +
- external: between frame and widget
 +
- internal: between frame and client area
 +
}
  
        // TRUE if the widget is owned, or "self" otherwise
+
{frame= flat space between external & internal facets,
function checkowned(component: tcomponent): boolean;
+
floats at the inner level of the external facet
 +
}
  
        // TRUE if the widget is owner, or "self" otherwise
+
*** Both frame & bevelling affect the client area ***
function checkowner(component: tcomponent): boolean;
 
  
// return the top-most widget in owner chain starting from this widget
+
--------------------------
function rootowner: tcomponent;
+
template:
  
// return the array of owning widgets starting from this widget
+
colorclient = color of the client area
// componentarty[0] is the widget oneself
 
function getrootcomponentpath: componentarty;
 
  
        // returns items of objeclinker ( which notify this widget )
+
colorframe = color of the frame
        // and free notify list ( which are notified by this widget ),
+
colorframeactive = used instead of colorframe if the widget is
        // duplicates are removed.
+
active; "cl_default" means same as colorframe.
        //
 
        // 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
+
works if (leveli/levelo <> 0 that's the facets exist :
// the event is processed ( cea_processed ) by one of the childs,
 
// "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,
+
colorshadow = color of facets screened from the NW light source
// "event" will be destroyed if destroyevent= true and not async
+
colordkshadow = color of shadows dropped by the NW light source
procedure sendrootcomponentevent(const event: tcomponentevent;
+
                colordkwidth = width of the shadows in pixel, -1=default
                                        const destroyevent: boolean = true);
 
  
// posts an async "atag"-ged event to be handled by oneself
+
colorlight = color of facets exposed to the NW light source
procedure asyncevent(atag: integer = 0);
+
colorhighlight = color of brighter edges of the facets
 +
                colorhlwidth = width of the brighter edges in pixel, -1=default
  
// posts a "tcomponentevent" instance from sender=self,  
+
        extraspace = if applied to menu items, adds more space between these items
// "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,  
+
framei_:
// and "tmsecomponent" otherwise )
+
(for extendable widgets like menus, these settings widen the widget,
property moduleclassname: string read getmoduleclassname;
+
for non-extendable like buttons - they squeeze the text area )
  
// returns the classname of the widget as the entry of its constructor
+
bottom= lower margin of text to the client area
// ( button => tbutton, datamodule => tdm1mo, form => ttstfo, dbstringedit => tdbstringedit,.. )
+
left = left margin of text to the client area
property actualclassname: string read getactualclassname;
+
right = margin of text to the client area
 +
top = upper margin of text to the client area
  
// returns "fmsecomponentstate"
+
framewidth= width of the frame
// ( a set of cs_ismodule,cs_endreadproc,cs_loadedproc,cs_noload, cs_hasskin,cs_noskin )
+
leveli = {width=height} of the internal facet, positive -> raised, negative -> sunken
property msecomponentstate: msecomponentstatesty read fmsecomponentstate;
+
levelo = {width=height} of the external facet, positive -> raised, negative -> sunken
  
// returns/sets a pointer associated with the widget
+
<any frame>
// ( 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
+
*** extends & customizes "tframecomp" ***
property helpcontext: msestring read gethelpcontext write fhelpcontext;
 
  
// twidget
+
template
 +
- "tframecomp" supplying the initial settings
  
// creates an instance of the widget, owned by "aowner" if not NIL
+
colorclient,colordkshadow,colordkwidth,colorframe,colorframeactive,
constructor create(aowner: tcomponent); override;
+
colorhighlight,colorhlwidth,colorlight,colorshadow,framewidth,
 +
leveli, levelo, framei_*,
  
destructor destroy; override;
+
<see "tframecomp">
  
// ??
+
font
procedure afterconstruction; override;
+
<see "tfont">
  
// rescales the widget frame ( if assigned ) then owned widgets ( if exist, recursively ) then bounds_* then the font ( if assigned )
+
caption
// called before inserting in parentwidget,
+
- some descriptive text( function name, user prompt,...) placed
// calls "scale(ascale)",
+
in a N/W/S/E-combination to the widget's client area
// 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,
+
non-empty caption if (captionpos <> cp_center) & (captiondistouter=false & captiondist>0) enlarges the framed widget
// ascale is ignored ?
+
by the corresponding size of caption
// 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
+
captiondist - margin between the caption & the client area
procedure createframe;
 
  
// creates the widget face if not yet  created
+
captiondistouter :
procedure createface;
 
  
// creates the widget font if not yet  created
+
- if "false"(by default), the distance is measured between
procedure createfont;
+
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
  
// checks ws_loadlock and csdestroing too
+
- if "true", the caption is mirrored against the edge of client area as
function isloading: boolean;
+
to the position when "false"
  
// returns "widgetstatety" - a set of (
+
*** nagative values of "captiondist" visually inverse "out of" and within ***
// 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 (
+
      captionnoclip - do not clip frame and client area for caption background
// (ws1_childscaled,ws1_fontheightlock,
+
( the client area preserves own background under the caption text)
// 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
+
captionnooffset - shift orthogonal to "captiondist"
// ( tcomponent stuff )
 
function hasparent: boolean; override;             
 
  
// returns the parent component if it's a widget or the grandparent otherwise
+
captionpos - "corner" where to place the caption
function getparentcomponent: tcomponent; override;  //tcomponent
 
  
// TRUE if "awidget" is an ascendant or the widget or they are the same widget
+
localprops :
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,
+
frl_levelo - "levelo" overrides "template.levelo"
        // all widgets on a form have "winid" of this form ( a real window allocated by the OS )
+
frl_leveli - "leveli" overrides "template.leveli"
        // thus have this function TRUE
+
frl_framewidth - "framewidth" overrides "template.framewidth"
function windowallocated: boolean;
+
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"
  
// TRUE if presents a valid toplevelwindow with assigned "winid"
+
frl_nodisable
function ownswindow: boolean;
 
  
// invalidated area of the widget, the origin is "clientpos" against the roor widget
+
=== TFaceComp ===
function updaterect: rectty;
+
- doesn't affect the widget frame but client area of the frame
  
// 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,.. )
+
template:
        // if it is a descendant of the widget or the widget oneself,
+
fade:
        // then continues with subwidgets of the widget;
+
color[i]: = colors forming the fade
        // also - finishes editing ( snapshots "value" ) in the focused widget before checking
+
direction: = direction where the fade grows to
function canparentclose(const newfocus: twidget): boolean; overload;
+
gd_(right/up/left/down)
  
// the above function but with the preserved focus
+
pos[i]: = relational position of color[i] on the direction (0.0..1.0) extent
function canparentclose: boolean; overload;
 
                  //newfocus = window.focusedwidget     
 
  
function canfocus: boolean; virtual;
+
transparency = makes the face half-transparent and enlight the underlying widget 
function setfocus(aactivate: boolean = true): boolean; virtual;//true if ok
+
with a light source of the selected color
procedure nextfocus; //sets inputfocus to then next appropriate widget
+
( in this case, colors of the face & the widget & the light source
 +
simply summarize to higher brightness )
  
function findtabfocus(const ataborder: integer): twidget;
+
image:
                      //nil if can not focus
+
see <any image>
  
function firsttabfocus: twidget;
+
options:
function lasttabfocus: twidget;
 
function nexttaborder(const down: boolean = false): twidget;
 
  
function focusback(const aactivate: boolean = true): boolean;
+
        *** The fade colors are used not as colors but RGB alpha values ($00 -> opaque, $ff -> transparent)  
                              //false if focus not changed
+
if fao_alpha* are set *** :
  
function parentcolor: colorty;
+
fao_alphafadeall = applies blending to the widget & all its childs
function actualcolor: colorty; virtual;
+
fao_alphafadenochildren = preserves child widgets from blending
function actualopaquecolor: colorty;
+
                fao_alphafadeimage = applies blending to "face.image"
function backgroundcolor: colorty;
 
function translatecolor(const acolor: colorty): colorty;
 
  
procedure widgetevent(const event: twidgetevent); virtual;
 
  
procedure sendwidgetevent(const event: twidgetevent);
+
<any face>
                              //event will be destroyed
 
  
procedure release; override;
+
*** extends & customizes "tfacecomp" ***
  
function show(const modal: boolean = false;
+
fade, image, option
            const transientfor: twindow = nil): modalresultty; virtual;
+
- see "tfacecomp"
 +
 +
template
 +
- "tfacecomp" supplying the initial settings
  
procedure hide;
+
localprops :
procedure activate(const abringtofront: boolean = true); virtual;
+
fal_options - "options" overrides "template.options"
                            //show and setfocus
+
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"
  
procedure bringtofront;
+
=== TBitmapComp ===
procedure sendtoback;
+
=== TImageList ===
procedure stackunder(const predecessor: twidget);
+
=== TPopupMenu ===
 +
=== TMainMenu ===
  
procedure paint(const canvas: tcanvas); virtual;
+
== Dialog ==
procedure update; virtual;
+
=== TFileListview ===
procedure scrollwidgets(const dist: pointty);
+
=== TFileDialog ===
 +
=== TFaceComp ===
 +
=== TFileNameEdit ===
 +
=== TDirDropdownEdit ===
 +
=== TColorEdit ===
 +
=== TMemoDialogEdit ===
 +
=== TPageSizeSelector ===
 +
=== TPageOrientationSelector ===
  
procedure scrollrect(const dist: pointty; const rect: rectty; scrollcaret: boolean);
+
== Application ==
                            //origin = paintrect.pos
+
=== TGuiApplication ===
 +
<pre>
 +
tguiapplication = class(tcustomapplication)
 +
  public
  
procedure scroll(const dist: pointty);
+
  // [re]starts the system timer with the new period and
                            //scrolls paintrect and widgets
+
  // 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);
  
procedure getcaret;
+
  // finds a window by its winID
procedure scrollcaret(const dist: pointty);
+
  function findwindow(id: winidty; out window: twindow): boolean;
function mousecaptured: boolean;
 
procedure capturemouse(grab: boolean = true);
 
procedure releasemouse;
 
procedure capturekeyboard;
 
procedure releasekeyboard;
 
procedure synctofontheight; virtual;
 
  
procedure dragevent(var info: draginfoty); virtual;
+
  // finds a window by its ID & adjusts "rect" so that it
procedure dochildscaled(const sender: twidget); virtual;
+
  // fits "bounds_minc*" & "bounds_maxc*" of the found window
 +
  procedure checkwindowrect(winid: winidty; var rect: rectty);
  
procedure invalidatewidget;    //invalidates whole widget
+
  // inits the timer and "megraphics"
procedure invalidate;          //invalidates clientrect
+
  procedure initialize;
procedure invalidaterect(const rect: rectty; org: originty = org_client);
 
procedure invalidateframestate;
 
  
procedure invalidateframestaterect(const rect: rectty;
+
  // frees the allocated system resources (GDI, event subsription, the timer)
                                        const org: originty = org_client)
+
  procedure deinitialize;
function hasoverlappingsiblings(arect: rectty): boolean; //origin = pos
 
  
function window: twindow;
+
  // creates a form instance, it will be shown in "application.run"
function rootwidget: twidget;
+
  procedure createform(instanceclass: widgetclassty; var reference);
  
function parentofcontainer: twidget;
+
  // invalidates all registered forms ( all their widgets will be redrawn )
            //parentwidget.parentwidget if parentwidget has not ws_iswidget,
+
  procedure invalidate;  
            //parentwidget otherwise
+
 
 +
  // calls a nested main eventloop, forces processing any pending messages,
 +
  procedure processmessages; override; //handle with care!
  
property parentwidget: twidget read fparentwidget write setparentwidget;
+
  // TRUE if no pending events to process for the application
function getrootwidgetpath: widgetarty; //root widget is last
+
  function idle: boolean; override;
 +
 
 +
  // requests to indicate waiting ( to show the "watches" cursos )
 +
  procedure beginwait; override;
  
// number of contained widgets ( the widget oneself excluded ! )
+
  // removes the "watches" if no unclosed requests for displaying them,
function widgetcount: integer;
+
  // otherwise closes the currently active request
 +
  procedure endwait; override;
  
function parentwidgetindex: integer; //index in parentwidget.widgets, -1 if none
+
  // TRUE if there're unclosed requests for displaying "watches"
property widgets[const index: integer]: twidget read getwidgets;
+
  function waiting: boolean;
function widgetatpos(var info: widgetatposinfoty): twidget; overload;
 
function widgetatpos(const pos: pointty): twidget; overload;
 
  
function widgetatpos(const pos: pointty;
+
  // TRUE if ESC has just been pressed
                  const state: widgetstatesty): twidget; overload;
+
  //  - 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
  
property taborderedwidgets: widgetarty read gettaborderedwidgets;
+
  // sets state of the current wait dialogue ( but doesn't close one ) to undefined
 +
  procedure resetwaitdialog;  
  
function findtagwidget(const atag: integer; const aclass: widgetclassty): twidget;
+
  // runs "aexecuteaction" in the main thread in OnIdle mode,
              //returns first matching descendent
+
  // 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;
  
property container: twidget read getcontainer;
+
  // closes the currently modal waitdialogue with "cancelled" state
function containeroffset: pointty;
+
  procedure cancelwait;
function childrencount: integer; virtual;
 
property children[const index: integer]: twidget read getchildwidgets; default;
 
  
function childatpos(const pos: pointty;
+
  // closes the currently modal waitdialogue with "ok" state
                  const clientorigin: boolean = true): twidget; virtual;
+
  procedure terminatewait;
  
function getsortxchildren: widgetarty;
+
  function waitstarted: boolean;   // the last waitdialogue is currently showing for some requests
function getsortychildren: widgetarty;
+
  function waitcanceled: boolean; // the last waitdialogue has been cancelled for some request (but can be shown fot others ?)
property focusedchild: twidget read ffocusedchild;
+
  function waitterminated: boolean; // the last waitdialogue has been terminated for some request (but can be shown fot others ?)
property focusedchildbefore: twidget read ffocusedchildbefore;
 
  
function mouseeventwidget(const info: mouseeventinfoty): twidget;
+
  // 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;
  
function checkdescendent(widget: twidget): boolean;
+
  // posts an async event for which the message describing the exception will be called
                    //true if widget is descendent or self
+
  procedure showasyncexception(e: exception; const leadingtext: string = '');
  
function checkancestor(widget: twidget): boolean;
+
  // "application.errormessage" shows standard error message ( with "ERROR" title )
                    //true if widget is ancestor or self
+
  procedure errormessage(const amessage: msestring); override;
  
function containswidget(awidget: twidget): boolean;
+
  // [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);
  
procedure insertwidget(const awidget: twidget); overload;
 
  
procedure insertwidget(const awidget: twidget; const apos: pointty); overload; virtual;
+
  // shows the supplied hint text within "aposrect" with alignment "aplacement" during "ashowtime",
                 //widget can be child
+
  // 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;
  
function iswidgetclick(const info: mouseeventinfoty; const caption: boolean = false): boolean;
+
  // shows the supplied hint text at left-top position"apos" during "ashowtime",
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
+
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
//or in frame.caption if caption = true, origin = pos
+
  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;
  
function isclick(const info: mouseeventinfoty): boolean;
+
  // shows the hint fully defined in "info" for the widget "sender"
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
+
  procedure showhint(const sender: twidget; const info: hintinfoty); overload;
  
 +
  // removes the current hint widget & frees its resources & stops its stop timer
 +
  procedure hidehint;
  
function isdblclick(const info: mouseeventinfoty): boolean;
+
  // restarts the current hint and its stop timer
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
+
  procedure restarthint(const sender: twidget);
// and timedlay to last buttonpress is short
 
  
function isdblclicked(const info: mouseeventinfoty): boolean;
+
  function hintedwidget: twidget; //last hinted widget
//true if eventtype in [et_buttonpress,et_butonrelease], button is mb_left,
+
  function activehintedwidget: twidget; //nil if no hint active
// and timedlay to last same buttonevent is short
 
  
function isleftbuttondown(const info: mouseeventinfoty): boolean;
+
  // returns helpcontext of active widget, '' if none; 
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
+
  function activehelpcontext: msestring;
//origin = paintrect.pos
 
  
//======================
+
  // returns helpcontext of the widget under mouse, '' if none;
 +
  function mousehelpcontext: msestring;
  
widgetrect: the widget on-screen area including its frame & frame caption
+
  // TRUE if one of the app's window/console is in input focus
 +
  function active: boolean;
  
paintrect: the widget on-screen area except its frame & frame caption
+
  // returns the desktop resolution ( or the virtual one if used )
 +
  function screensize: sizety;
  
clientrect: virtual area which
+
  // returns the (virtual) desktop resolution except the tray area,
- for non-scrolling widgets, equals to "paintrect", with its "pos:= (0,0)"
+
  // nil -> current active window
- for scrolling widgets, may be bigger than "paintrect",
+
  function workarea(const awindow: twindow = nil): rectty;
  also may shift ( change its "pos" ) when scrolling
 
 
 
//======================
 
  
 +
  // 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 */
  
// the coord of outer top-left corner against the toplevel form = the window owner,
+
  // returns a first non-transient ( on top of the app stacking order ) window upward
// including the frame & frame caption
+
  // from the currently active window of the application.
function rootpos: pointty;  
+
  // or that active window if no such
 +
  function regularactivewindow: twindow;
  
// the coord of the outer top-left corner against the screen ( the WM decorations aren't counted in )
+
  // same as "activewindow" but the window must not be released (?)
// includes the frame & frame caption
+
  function unreleasedactivewindow: twindow;
property screenpos: pointty;  
 
  
// the coord of the outer top-left corner against the parent widget,
+
  // returns the focused widget of the currently active window if one exists
// including the frame & frame caption
+
  function activewidget: twidget;
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" )
+
  // returns the widget presenteing the currently active window
    //  except the frame & frame caption
+
  function activerootwidget: twidget;
function paintrect: rectty;
+
 
function paintpos: pointty;
+
  // returns the window ( not hidden or disabled !) under the screen point "pos"
function paintsize: sizety;
+
  function windowatpos(const pos: pointty): twindow;
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" )
+
  // puts to "awidget" the container of widget pointed by "namepath"
    // except the frame caption
+
  // ( finalizing "." is discarded if found ) ,
function framerect: rectty; // =paintrect except the frame caption area
+
  // FALSE if not found, and NIL and TRUE if "namepath" = ''
function framepos: pointty;
+
  function findwidget(const namepath: string; out awidget: twidget): boolean;
function framesize: sizety;
 
  
    // the coord of the client area ( clientrect )  against the paint area ( paintrect )
+
  // rebuilds the application's window list accorrding to the current on-screen Z-order of its windows;
    // usually these areas match
+
  // window list is ordered by "z" - bottom first & top last;
function clientrect: rectty;
+
  // invisibles first
property clientsize: sizety;
+
  procedure sortzorder;
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
+
  // returns a copy of the internal window list of application
function paintrectparent: rectty; //nullrect if parent = nil,
+
  function windowar: windowarty;
  
    // the coord of the client area of the parent against the paint area of this widget
+
  // returns the list of application window winIDs
function clientrectparent: rectty; //nullrect if parent = nil,
+
  function winidar: winidarty;
  
// the coord of the inner area against the client area ( clientrect )
+
  // returns the count of the application windows   
function innerclientrect: rectty;  // mainly equals to clientrect
+
  function windowcount: integer;
function innerclientsize: sizety;
 
function innerclientpos: pointty;
 
  
function framewidth: sizety;              //widgetrect.size - paintrect.size
+
  // returns the window by its number ( "index" >= 0) in the application window list
function clientframewidth: sizety;        //widgetrect.size - clientrect.size
+
  property windows[const index: integer]: twindow read getwindows;
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
+
  // returns the lowest visible window in stackorder,
function paintparentpos: pointty;   //origin = parentwidget.pos
+
  // calls "sortzorder" within
 +
  function bottomwindow: twindow;
  
    // the coord of the client area against the widgetrect(pos) of the parent
+
  // returns the highest visible window in stackorder,
function clientparentpos: pointty;   //origin = parentwidget.pos
+
  // calls "sortzorder" within
 +
  function topwindow: twindow;
  
    // the coord of the widgetrect(pos) against the client area of parent
 
property parentclientpos: pointty;
 
  
 +
  // TRUE if all owned windows pass "CanClose" check or
 +
  // don't have focused widgets
 +
  function candefocus: boolean;
  
function clientpostowidgetpos(const apos: pointty): pointty;
+
  // subscribes the handler "method" to receive keyboard events
function widgetpostoclientpos(const apos: pointty): pointty;
+
  procedure registeronkeypress(const method: keyeventty);
function widgetpostopaintpos(const apos: pointty): pointty;
 
function paintpostowidgetpos(const apos: pointty): pointty;
 
procedure scale(const ascale: real); virtual;
 
  
 +
  // unsubscribes the handler "method" from receiving keyboard events
 +
  procedure unregisteronkeypress(const method: keyeventty);
  
property minsize: sizety read fminsize write setminsize;
+
  // subscribes the handler "method" to receive shortcut events
property maxsize: sizety read fmaxsize write setmaxsize;
+
  procedure registeronshortcut(const method: keyeventty);
function maxclientsize: sizety; virtual;
 
  
 +
  // unsubscribes the handler "method" from receiving shortcut events
 +
  procedure unregisteronshortcut(const method: keyeventty);
  
property anchors: anchorsty read fanchors write setanchors default defaultanchors;
+
  // subscribes the handler "method" to receive "OnWindowActiveChanged" event ( form-wide )
property defaultfocuschild: twidget read getdefaultfocuschild write setdefaultfocuschild;
+
  procedure registeronactivechanged(const method: activechangeeventty);
  
 +
  // unsubscribes the handler "method" from receiving "OnWindowActiveChanged" event ( form-wide )
 +
  procedure unregisteronactivechanged(const method: activechangeeventty);
  
procedure changeclientsize(const delta: sizety); //asynchronous
+
  // subscribes the handler "method" to receive "OnDestroyed" events ( form-wide )
 +
  procedure registeronwindowdestroyed(const method: windoweventty);
  
function getcanvas(aorigin: originty = org_client): tcanvas;
+
  // unsubscribes the handler "method" from receiving "OnDestroyed" events ( form-wide )
 +
  procedure unregisteronwindowdestroyed(const method: windoweventty);
  
function showing: boolean;
+
  // subscribes the handler "method" to receive "OnWindowDestroyed" events ( form-wide )
              //true if self and all ancestors visible and window allocated
+
  procedure registeronwiniddestroyed(const method: winideventty);
  
function isenabled: boolean;
+
  // unsubscribes the handler "method" form receiving "OnWindowDestroyed" events ( form-wide )
              //true if self and all ancestors enabled
+
  procedure unregisteronwiniddestroyed(const method: winideventty);
  
function active: boolean;
+
  // subscribes the handler "method" to receive "ApplicationActiveChanged" events ( form-wide )
function entered: boolean;
+
  procedure registeronapplicationactivechanged(const method: booleaneventty);
  
function activeentered: boolean;  
+
  // unsubscribes the handler "method" from receiving "ApplicationActiveChanged" events ( form-wide )
//true if entered and window is regularactivewindow or inactivated
+
  procedure unregisteronapplicationactivechanged(const method: booleaneventty);
  
function focused: boolean;
+
// tcustomapplication
function clicked: boolean;
 
  
function indexofwidget(const awidget: twidget): integer;
+
  // subscribes the handler "method" to receive "OnTerminated" event ( form-wide )
 +
  procedure registeronterminated(const method: notifyeventty);
  
procedure changedirection(const avalue: graphicdirectionty;
+
  // unsubscribes the handler "method" from receiving "OnTerminated" events ( form-wide )
                                            var dest: graphicdirectionty); virtual;
+
  procedure unregisteronterminated(const method: notifyeventty);
  
// (re)arranges "awidgets" horizontally within the parent's client area
+
  // subscribes the handler "method" to receive "OnTerminateQuery" event ( form-wide )
// so that awidget[i] were placed next each other
+
  procedure registeronterminate(const method: terminatequeryeventty);
// at h-space dist[i], starting from "startx" with the right margin "endmargin";
+
 
//
+
  // unsubscribes the handler "method" from receiving "OnTerminateQuery" event ( form-wide )
// if the number of "dist" is fewer than the number of "awidgets" then the remaining h-spaces are taken
+
  procedure unregisteronterminate(const method: terminatequeryeventty);
// 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
+
  // subscribes the handler "method" to receive "OnIdle" event ( form-wide )
//
+
   procedure registeronidle(const method: idleeventty);
// 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
+
  // unsubscribes the handler "method" from receiving "OnIdle" events ( form-wide )
// so that awidget[i] were placed upper/lower each other
+
   procedure unregisteronidle(const method: idleeventty);
// 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
+
  // calls "canclose" of all application windows except the "sender" window
// awidgets[0] stays on its place but awidgets[1..N] :
+
  // if all "canclose"are TRUE then checks "OnTerminateQuery"  
// - 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]
+
  // for all its subscribers ( usually forms of the application )
// - 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]
+
  procedure terminate(const sender: twindow = nil);  
// - 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;
 
  
 +
  // TRUE as long as a "terminate" call is in progress
 +
  function terminating: boolean;
  
// if {mode <> wam_none} then (re)arranges "awidgets" vertically within the parent's client area so that
+
  // TRUE as long as a "deinitialize" call is in progress
// awidgets[0] stays on its place but awidgets[1..N] :  
+
  function deinitializing: boolean;
// - 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]
+
  // returns the current caret object ( the text input focus indicator ) of the application
// - if {mode = wam_center} then awidgets[i>=1] move so that they X-axes match the X-axe of awidgets[0]
+
  / ( this object provides facitities to control position & appearance & visibility & timings of the caret )
//
+
  property caret: tcaret read fcaret;
// 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;
+
  // 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;
  
Event handlers:
+
  // 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);
  
- onactivate
+
  // 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;
  
fires :
+
  // returns/sets the current application-wide cursor shape ( not "watches" if a waiting dialogue is curerntly 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_*
  
= on receiving input focus, just before "OnFocus"
+
  // assures the displayed mouse cursor shape to be the shape assigned to the currently under-mouse widget,
+
  // otherwise "cr_default"  
= forms specific :
+
  procedure updatecursorshape; //restores cursorshape of mousewidget
* 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
+
  // returns a widget of the application where the mouse is currently positioned over
 +
  property mousewidget: twidget read fmousewidget;
  
fires :
+
  // returns a widget of the application currently "owning" the mouse ( grabbing all mouse input )
 +
  property mousecapturewidget: twidget read fmousecapturewidget;
  
= on child(s) resizing due to font height change
 
  
= form widget: once "form.container" {scrolling widget} is loaded
+
  // 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;
  
- ondeactivate
+
  // returns which system thread was allocated to the application on its start
fires
+
  // ( the main thread )
= form widget: when the form looses input focus
+
  property thread: threadty read fthread;
= non-form widget: when the widget looses input focus
 
  
- ondefocus
+
  // 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;
  
fires
+
  // returns teh widget where a mouse button release occured last time
= on disabling the widget
+
  // ( to compare with when determinibg whether another widget is clicked )
 +
  property buttonreleasewidgetbefore: twidget read fbuttonreleasewidgetbefore;
  
*mse = form widget: if another form is focused
 
= non-form widget: if another widget is focused
 
  
- onenter
+
  // returns/sets the interval of mouse double click recognition ( in microsecs),
= fires on any way of taking parent-wide focus as soon as
+
  // defaults to 0.4 sec
the parent stores the new child's order, before "OnActivate" & "OnFocus"
+
  property dblclicktime: integer read fdblclicktime write fdblclicktime default
 +
                defaultdblclicktime; //us
  
- onexit
+
// tcustomapplication
= fires last on parent-wide lossing focus, after "OnDefocus" & "OnDeactivate"
 
= for top-level ( not in a container ) forms, doesn't fire
 
  
- onfocus
+
  // creates a datamodule instance ( its startup code including "OnLoaded" is executed )
fires
+
  procedure createdatamodule(instanceclass: msecomponentclassty; var reference);
= 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
+
  // enters the application event loop;
fires :
+
  //
= on calling a popup-menu ( with "RightClick" ), once the menu items of the current level are loaded
+
  // once the loop finishes, performs "OnTerminated" for all its subscribers,
( before building the submenus )  
+
  // destroys all application forms ( components & windows )
 +
  procedure run;
  
- onresize
+
  // TRUE if the eventloop is entered
 +
  function running: boolean;
  
= fires on creating/(changing size)/(min-max restoring) of widget,  
+
  // returns/sets the application name
before actual redrawing
+
  // ( defaults to the full path to application executable in the native OS format );
 
+
  // currently, only for informatiion query purposes
= rechecks if there's real work to do
+
  property applicationname: msestring read fapplicationname write fapplicationname;
 +
 
  
- onshowhint
+
  // if exclusive "rights" are satisfied for the main thread ( a mutex lock is OK )  & the event loop is in progress
= fires when a installed hint is activated or on "aplication.showint" called
+
  // then posts the "event" to the main application thread for asyc processing,
= since called last, allows to adjust the default behavior
+
  // otherwise adds the event to the internal list for further handling as soon as the above conditions meet
 +
  procedure postevent(event: tevent);
  
- onbeforeupdateskin
+
  // TRUE if never idle since last call,
= fires in "updateskin" ( the widget is loaded etc ) before applying the skin
+
  // unlocks the application and calls sleep if not mainthread and asleepus >= 0
 +
  function checkoverload(const asleepus: integer = 100000): boolean;
  
- onafterupdateskin
+
  // returns/sets the application exception handler
= fires in "updateskin" ( the widget is loaded etc ) once the skin is applied
+
  property onexception: exceptioneventty read fonexception write fonexception;
  
<pre/>
+
  // 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 = '');
  
== NoGui ==
+
  // synchronizes the calling thread with the main event loop ( via a mutex),
=== TAction ===
+
  // TRUE if the calling thread allready holds the mutex,
<pre>
+
  // the mutex is recursive
Shortcut processing order :
+
  function lock: boolean;
  
- the smallest piece of processing is "doshortcut" procedure which
+
  // tries to synchronize the calling thread with the main event loop ( via a mutex)
is called until processed:
+
  function trylock: 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
 
  
 +
  // releases the mutex if the calling thread holds the mutex,
 +
  // TRUE if no unlock done
 +
  function unlock: boolean;
  
*** A shortcut is bound to a widget by :
+
  // releases the mutex recursively if the calling thread holds the mutex,
- placing an action component on the widget ***
+
  // returns "count" for the below "relockall"
- direct assigning the shortcut to the widget (menus,..)
+
  function unlockall: integer;
---------------------------
 
  
caption, color, colorglyph, helpcontext, hint, imagecheckedoffset,
+
  // regains the mutex to serve "count" locks
imagelist <see "timagelist">, imagenr, imagenrdisabled
+
  procedure relockall(count: integer);
  
- sets look of "clients" (buttons, menu/toolbar items,..), unless
+
  // 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,  
these clients have "state.as_local*" set :
+
  // 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;
  
*** For meaning of these options, see help on the "client" widgets ***
+
  // TRUE if the calling ( this function ) thread is the application main thread
 +
  function ismainthread: boolean;
  
group
+
  // TRUE if the currently locked thread is the application main thread
- default value for one-named property of the bound widgets
+
  function islockthread: boolean;
( menu items,... )
 
  
options :
+
  // waith for "athread" to terminate,
ao_updateonidle
+
  // does "unlock-relock" around waiting
- runs this action in cycle, waiting for no gui events everytime
+
  procedure waitforthread(athread: tmsethread);
  
ao_globalshortcut
+
  // post a "nothing-to-do" event for asynchronous processing in the main thread
- allows the action to trigger on a non-main form
+
  procedure wakeupmainthread;
  (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
+
  // invalidates all registered forms of the application so that their widgets redraw land-specific captions
- causes the action not to call "CanDefocus" for focused edit widget of active form
+
  // ( changed by "mseconsts.setlangconsts" ),
  before executing own code
+
  // called internally in "setlangconsts" before return
  ( it helps to avoid the effect of cancelling changes in these widgets
+
  procedure langchanged; virtual;
  on activating the bound shortcut )
 
  
shortcut
+
  // returns/sets "aps_terminated" state flag ( no actions ? )
- keyboard combination triggering the action
+
  // this flag is also set internally by "terminate" if not cancelled
 +
  property terminated: boolean read getterminated write setterminated;
  
shortcut
+
  // returns the number of "handleexception" calls having an effect ( a message or the handler code )
- alternative "shortcut" and handled identically
+
  property exceptioncount: longword read fexceptioncount;
  
state :
 
  
as_disabled
+
private
- prevents the action from triggering, also puts the bound widgets to "disabled" look
+
// function tinternalapplication.beginmodal(const sender: twindow): boolean;
  
as_invisible
+
<pre/>
- in run-time, hides the bound widget, still reacting on the shortcut or direct call
 
  
as_checked
+
== DB ==
- selects the bound menu item if it has "mao_checkbox" option set
 
  
as_default
+
=== DBedit ===
as_local*
+
=== DBfields ===
 +
=== TDBwidgetgrid ===
 +
<pre>
 +
  Properties:
  
statfile
+
        anchors - ...
<see "tstatfile">
+
bounds - ...
  
stavarname
+
color
 +
- color of the grid's client area
 +
cursor
 +
- cursor shape when the mouse is over the client area
  
+
datacols
tagaction
+
colorselect
onasyncevent
+
linecolor
onchange
+
linecolorfix
onexecute
+
linewidth
onupdate
+
newrowcol
<pre/>
 
  
=== TActivator ===
+
options
=== TThreadComp ===
+
co_readonly
=== TStatFile ===
+
co_nofocus
- so that to be in effect, it should also be assigned to the form where the widget using the stafile is placed on
+
co_invisible
- in design, if "onstatwrite" is set and "filedir" is not yet created, deactivate exception "ECreateError" in project settings ( "Debugger" tab )
+
co_disabled
- "filedir" may contain "~/" indicating the user's home directory
+
co_drawfocus
- options "oe_savestate" & "oe_savevalue" of "client" widgets define what to store to the file
+
co_mousemovefocus
- position etc changes or/and value changes
+
co_lefbuttonfocusonly
- 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
+
co_focusselect
- each "tstafile" owns:
+
co_mouseselect
= tstatwriter:
+
co_keyselect
* provides methods of writing sections & statvars to a memory/file stream
+
co_multiselect
- tstatreader:
+
co_resetselectionexit
* holds list of sections with statvars each
+
co_rowselect
* provides search & check & reading interface to the statvars
+
co_fixwidth
* provides reading statvars from a memory/file stream
+
co_fixpos
 
+
co_fill
Positioning to a section speeds up accessing its statvars
+
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
  
- there also is "tstatfiler" ( exposed by some "tstatfile" events ) which:
+
sortcol
= may present or "tstatwriter" or "tstatreader" ( there's a check method )
+
width
= provides directionless "update" methods with internal switch to needed direction of processing
 
- "reading" or "writing" statvars on per-section basis
 
  
=== TTimer ===
+
items[N]
=== TNoGuiAction ===
+
color
=== TPipeReadercomp ===
+
colorselect
=== TSysEnvManager ===
+
datalist - ???
=== TProcessMonitor ===
+
face - see <any face>
=== TFilechangeNotifier ===
+
fontselect - see <any font>
=== TShortCutController ===
+
frame - see <any frame>
=== TPostscriptPrinter ===
+
linecolor
=== TGdiPrinter ===
+
linecolorfix
=== TWmfPrinter ===
+
linewidth
=== TSkinController ===
+
name
=== TGuiThreadComp ===
+
 +
options
 +
 +
<pre/>
 +
=== Report ===
 +
 
 +
==== TRepSpacer ====
 +
==== TRecordBand ====
 +
==== TrepValueDisp ====
 +
==== TRepPageNumdisp ====
 +
==== TRepPrintDateDisp ====
 +
==== TBandGroup ====
 +
==== TTileArea ====
 +
 
 +
== Design ==
 +
 
 +
=== TGdbMi ===
 +
=== TSyntaxEdit ===
 +
=== TSyntaxPainter ===
 +
 
 +
== Comm ==
 +
 
 +
=== TCommPort ===
 +
=== TAsciiCommPort ===
 +
=== TAsciiProtPort ===
 +
=== TCommSelector ===
 +
 
 +
== General stuff==
 +
 
 +
=== Properties for all widgets ===
 +
<pre>
  
== Font ==
 
=== Any Font ===
 
<pre>
 
    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
 
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
+
anchors
- 10*{ glyph cell width, average in pixels }, 0 = {font default}
+
 
 +
-----------
  
xscale
+
- they control of design/runtime sticking widgets to their parents
- width ratio of each glyph {cell & contour}, the effect is similar to "width"
 
  
*** "foo_*" font selection overrides one made with "name"  
+
- 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
  
*** if change with "foo_*" is usuccessful then the nearest "sans" font is usually choosen
+
*** 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
  
*** The categories :
+
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
  
sans => have no serifs and have strokes of even thickness
+
an_right
serif => have serifs at glyph contours and made up of strokes of varying thickness
+
- on run-time, resizes/shifts right the widget to keep the design-set distance
script => resemble handwriting
+
between the widget's right border and the right side of parent's client area
decorative => flashy styles to be used sparingly in headlines or posters
+
as the parent resizes, until scrolling begins
  
<pre/>
+
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
  
== GUI ==
+
bounds
=== TWindow ===
 
<pre>
 
twindow = class(teventobject,icanvas)
 
  public
 
  
// releases mouse, unlinks from the canvas, processes all pending events of the window
+
cx - width of the widget
// if called from within main thead then destroys the window directly
+
cxmax, cxmin - design/runtime width of the widget is enforced between "cxmax" and "cxmin"
// otherwise posts a window destroy event for oneself and waits for it to be processed
+
cy - height of the widget
procedure destroywindow;
+
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
  
// 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;
+
autosize
  
// adds "method" to the internal list of scroll dependants
+
-----------
procedure registeronscroll(const method: notifyeventty);
+
- 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)
 +
cy - addition to height of the widget (with v-centering post applied)
  
// removes "method" from the internal list of scroll dependants
+
- color
procedure unregisteronscroll(const method: notifyeventty);
+
= the default color of client area & caption text background
 +
= may be overwtitten:
 +
* the client area - with "frame.colorclient"
 +
* the caption BG - with "frame.font.colorbackground"
  
// releases mouse if captured, resets the cursor, then enters an event loop for the window,
+
- font
// TRUE on return if the window is destroyed
+
= see {any font}
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;
+
- frame
 +
= see {any frame}
  
// removes the internal stuff which indicates the modal state
+
- face
procedure endmodal;
+
= see {any face}
  
// if the window is visible,
+
- hint
// deactivates the previously active window, shows the window (see below),
+
= descriptive text appearing when mouse pointer enters the widget
// 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:
+
- cursor
  //  - if NOT windowevent then :
+
= shape of the mouse pointer over the client area of widget (run-time only)
  //    = 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
+
- visible
procedure twindow.show(windowevent: boolean);
+
= "true" allow the widget to appear ( run-time only )
  
// TRUE if this window currently grabs user input
+
- enabled
( a widget drawn within the window(=form) is in focus,.. )
+
= "true" allows the widget to participate in GUI interaction
function active: boolean;
+
= "false" disallows the widget & its childs :
 +
* processing all events & shortcuts & menu calls
 +
* auto "CanClose" check
  
// if the window was active then deactivates the window  & remembers it as the previous active ( to restore leater if requested ),
+
Also "false" usually aints the widget in color marking
// returns TRUE if that storage occured
+
the "disabled" state ( usually light gray font color )
function deactivateintermediate: boolean;
+
 
 +
- popupmenu
 +
= reference to a preset tpopupmenu widget serving the right-click menu
  
// makes the window active & clears the above app reference to it ( "active before deactivating" )
+
- taborder
procedure reactivate; //clears app.finactivewindow
+
- {0..N} order number when TAB-key cycling through widgets in the container
  
// scans the app event queue for "ek_expose" event[s] addressed to the window,
+
- tag
// if found then redraws that part of the window which the event describes
+
- an integer value bound to this widget instance
// ( processed events are then deleted )
 
procedure update;
 
  
// TRUE if the window :
+
- helpcontext
// 1) doesn't have an inner widget grabbing input focus
+
= a string returned by "(active/mouse)helpcontext" methods of the owning form
// or
+
  when this widget is focued or under mouse in the active window
// 2) has such widget, and this widget ( and all its descendants )
+
 
//    pass "CanClose" check
+
- zorder
//
+
= reading: finds the current Z-order of the widget's window
// *** see also "twidget.CanClose" ***
+
= setting: if the value = 0 then lowers the widget's window in the stacking hierarchy, otherwise rises
//
 
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;
+
optionswidget:
  procedure releasemouse;
 
  procedure postkeyevent(const akey: keyty;
 
        const ashiftstate: shiftstatesty = []; const release: boolean = false;
 
                  const achars: msestring = '');
 
  
  function winid: winidty;
+
ow_background
  function haswinid: boolean;
+
- keeps the window/widget on bottom of the Z-order stack.
  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);
+
ow_top
  procedure unregistermovenotification(sender: iobjectlink);
+
- keeps the window/widget in foreground
  
  property options: windowoptionsty read foptions;
+
ow_noautosizing
 +
- when docking, not to resize for the docking area
  
// widget  
+
ow_mousefocus
property owner: twidget read fowner;
+
- "false" here disables focusing the widget with mouse
 +
  ( and "OnFocus" doesn't fire on mouse clicks )
  
  property focusedwidget: twidget read ffocusedwidget;
+
ow_tabfocus
  property transientfor: twindow read ftransientfor;
+
- "false" here disables focusing the widget with "TAB" key
  property modalresult: modalresultty read fmodalresult write setmodalresult;
+
  ( and "OnFocus" doesn't fire on TAB pressed )
  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;
 
  
 +
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 childs if entered
  
windowoptionty = (wo_popup,wo_message,wo_buttonendmodal,wo_groupleader,
+
ow_arrowfocus
                  wo_windowcentermessage); //showmessage centered in window
+
- allows the widget ( and its childs 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:
  
optionswindow:
+
ow_subfocus | ow_arrowfocusin | ow_arrowfocusout | effect
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
+
  FALSE          FALSE            FALSE        entering-/leaving-
- keeps on the WM taskbar a shortcut to the window
+
  FALSE          FALSE            TRUE          entering-/leaving+
( if the parent window is a groupleader too then dislpays a step upper in its group )
+
  FALSE          TRUE              FALSE        entering(nearest)+/leaving-
 
+
  FALSE          TRUE              TRUE          entering(nearest)+/leaving+
Event handlers:
+
  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+
  
- onmove
+
- "entering" is focusing on a child within the widget
= fires once the (window/widget) is created/moved ( with check if really moved by a distance)
+
- "leaving"  is return from last child onto the widget's level
 
+
- "nearest" is the child closest on the arrow direction
<pre/>
+
- "last focused" is the child focused on last leaving the widget
=== TFaceList ===
 
=== TFrameComp ===
 
 
   
 
   
Terminilogy :
+
*** The Up/Down arrow keys can leave from the childs circle,
 +
but Left/Right can only toggle between the childs ***
  
{client area = area of the widget which interacts with a user}
+
*** mouse entering/leaving isn't controllable by these options
  
{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,
+
ow_focusbackonesc
floats at the inner level of the external facet
+
- on pressing "Esc", returns input focus to the previously focused widget
}
 
  
*** Both frame & bevelling affect the client area ***
+
ow_noparentshortcut
  
--------------------------
+
*** disables processing of delegated ( from the parent ) shortcuts ***
template:
 
  
colorclient = color of the client area
+
- "true" here disables processing shortcuts if they're delegated
 +
from the parent widget ( obviously, not processed by the parent )
  
colorframe = color of the frame
+
ow_nochildshortcut
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 :
+
*** disables delegating shortcuts to the parent for taking desision ***
  
colorshadow = color of facets screened from the NW light source
+
- if "true" then the widget tries to process it by oneself
colordkshadow = color of shadows dropped by the NW light source
+
otherwise it's passed to the parent widget for further chaining
                colordkwidth = width of the shadows in pixel, -1=default
 
  
colorlight = color of facets exposed to the NW light source
+
*** A shortcut can only be processed once ( by one widget ) ***
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
+
ow_canclosenil
 +
- "true" here allows to continue even if there's contained widget(s)
 +
not passing "CanClose" check
  
framei_:
+
ow_mousetransparent
(for extendable widgets like menus, these settings widen the widget,
+
- "true" here causes the widget oneself ( not its contained ones )
for non-extendable like buttons - they squeeze the text area )
+
not to react to mouse events ( just allow them through to the childs )
  
bottom= lower margin of text to the client area
+
ow_mousewheel
left = left margin of text to the client area
+
- enables/disables {scrolling/navigating} with wheel of ImPS/2 etc mouse
right = margin of text to the client area
 
top = upper margin of text to the client area
 
  
framewidth= width of the frame
+
ow_noscroll
leveli = {width=height} of the internal facet, positive -> raised, negative -> sunken
+
- don't use screen image scrolling for twidget.scrollrect,  
levelo = {width=height} of the external facet, positive -> raised, negative -> sunken
+
redraw the whole scrolled widget rectangle instead;
 +
sometimes needed with background fades.
  
<any frame>
+
ow_nochildpaintclip
 +
-
  
*** extends & customizes "tframecomp" ***
+
ow_destroywidgets
 +
- "true" here causes calling "free" for all containing widgets as well
  
template
+
ow_hinton
- "tframecomp" supplying the initial settings
+
- to show the hint even in case of hinting is disabled on the parent
 +
( "parent.ow_hintoff= true & parent.ow_hinton= false" )
  
colorclient,colordkshadow,colordkwidth,colorframe,colorframeactive,
+
ow_hintoff
colorhighlight,colorhlwidth,colorlight,colorshadow,framewidth,
+
- "true" here combined with "ow_hinton=false" fully disables displaying the hint
leveli, levelo, framei_*,
 
  
<see "tframecomp">
+
ow_multiplehint
 +
- "true" here causes the widget to redisplay its hint on each {>3px} move within the widget oneself
  
font
+
        ow_timedhint
<see "tfont">
+
- "true" here causes hint of the widget to disappear after a timed inteval (about 2 secs by default)
  
caption
+
ow_fontlineheight (design-time only)
- some descriptive text( function name, user prompt,...) placed
+
- causes "extraspace" of the last text line to be drawn,  
in a N/W/S/E-combination to the widget's client area
+
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)
non-empty caption if (captionpos <> cp_center) & (captiondistouter=false & captiondist>0) enlarges the framed widget
+
- causes only interline "extraspace"-s to be drawn, opposite to "ow_fontlineheight"
by the corresponding size of caption
 
  
***
+
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
  
captiondist - margin between the caption & the client area
+
ow_autosize (design-time only)
 +
- causes that widget's heigh & width & client area adjust so that to provide space for contents of the client area
 +
- no desing-time change of height/width are possible as long as this option is in effect
  
captiondistouter :
+
ow_autosizeanright
 +
- when autosizing & {an_right isn't set}, the design-set right margin against the parent is preserved
  
- if "false"(by default), the distance is measured between
+
ow_autosizeanbottom
the inner (facing the client area) extent of the caption
+
- when autosizing & {an_bottom isn't set}, the design-set bottom margin against the parent is preserved
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
+
optionsskin:
to the position when "false"
 
  
*** nagative values of "captiondist" visually inverse "out of" and within ***
+
- osc_noskin
 +
- osc_framebuttononly
 +
- osc_container
  
      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"
+
Methods:
  
captionpos - "corner" where to place the caption
+
  // tmsecomponent
  
localprops :
+
// (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);
  
frl_levelo - "levelo" overrides "template.levelo"
+
// TRUE if the instance is created but not yet ready
frl_leveli - "leveli" overrides "template.leveli"
+
// for interaction & accessing data & appearance change & receiving events etc
frl_framewidth - "framewidth" overrides "template.framewidth"
+
// ( the stage between firing "OnCreate" & "OnLoaded" )
frl_colorclient - "colorclient" overrides "template.colorclient"
+
function loading: boolean;
frl_colorframe - "colorframe" overrides "template.colorframe"
+
frl_colorframeactive - "colorframeactive" overrides "template.colorframeactive"
+
{$ifdef FPC}
frl_colordkshadow - "colordkshadow" overrides "template.colordkshadow"
+
procedure setinline(value: boolean); // ?
frl_colorshadow - "colorshadow" overrides "template.colorshadow"
+
procedure setancestor(value: boolean); // ?
frl_colorlight - "colorlight" overrides "template.colorlight"
+
{$endif}
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
+
// 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;
  
=== TFaceComp ===
 
- doesn't affect the widget frame but client area of the frame
 
  
 +
// 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);
  
template:
+
// creates the persistent storage of the widget via calling "createproc"
fade:
+
procedure getoptionalobject(const instance: tobject; createproc: createprocty);
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
+
// obtains & puts to "obj" a CORBA interface entry for "aintf" (GUID,...)
 +
function getcorbainterface(const aintf: ptypeinfo; out obj) : boolean;
  
transparency = makes the face half-transparent and enlight the underlying widget
+
        // TRUE if the widget is owned, or "self" otherwise
with a light source of the selected color
+
function checkowned(component: tcomponent): boolean;
( in this case, colors of the face & the widget & the light source
 
simply summarize to higher brightness )
 
  
image:
+
        // TRUE if the widget is owner, or "self" otherwise
see <any image>
+
function checkowner(component: tcomponent): boolean;
  
options:
+
// return the top-most widget in owner chain starting from this widget
 +
function rootowner: tcomponent;
  
        *** The fade colors are used not as colors but RGB alpha values ($00 -> opaque, $ff -> transparent)
+
// return the array of owning widgets starting from this widget
if fao_alpha* are set *** :
+
// componentarty[0] is the widget oneself
 +
function getrootcomponentpath: componentarty;
  
fao_alphafadeall = applies blending to the widget & all its childs
+
        // returns items of objeclinker ( which notify this widget )
fao_alphafadenochildren = preserves child widgets from blending
+
        // and free notify list ( which are notified by this widget ),
                fao_alphafadeimage = applies blending to "face.image"
+
        // 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 childs or
 +
// the event is processed ( cea_processed ) by one of the childs,
 +
// "event" will be destroyed if destroyevent= true and not async
 +
procedure sendcomponentevent(const event: tcomponentevent;
 +
                                        const destroyevent: boolean = true);
  
<any face>
+
// 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);
  
*** extends & customizes "tfacecomp" ***
+
// posts an async "atag"-ged event to be handled by oneself
 +
procedure asyncevent(atag: integer = 0);
  
fade, image, option
+
// posts a "tcomponentevent" instance from sender=self,  
- see "tfacecomp"
+
// "kind" is defined when creating the event,
+
// and "tag" may be adjusted after creation
template
+
procedure postcomponentevent(const event: tcomponentevent);
- "tfacecomp" supplying the initial settings
 
  
localprops :
+
// returns the classname of the widget if the widget is toplevel,
fal_options - "options" overrides "template.options"
+
// and "tmsecomponent" otherwise )
fal_fadirection - "fade.direction" overrides "template.fade.direction"
+
property moduleclassname: string read getmoduleclassname;
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 ===
+
// returns the classname of the widget as the entry of its constructor
=== TImageList ===
+
// ( button => tbutton, datamodule => tdm1mo, form => ttstfo, dbstringedit => tdbstringedit,.. )
=== TPopupMenu ===
+
property actualclassname: string read getactualclassname;
=== TMainMenu ===
 
  
== Dialog ==
+
// returns "fmsecomponentstate"
=== TFileListview ===
+
// ( a set of cs_ismodule,cs_endreadproc,cs_loadedproc,cs_noload, cs_hasskin,cs_noskin )
=== TFileDialog ===
+
property msecomponentstate: msecomponentstatesty read fmsecomponentstate;
=== TFaceComp ===
 
=== TFileNameEdit ===
 
=== TDirDropdownEdit ===
 
=== TColorEdit ===
 
=== TMemoDialogEdit ===
 
=== TPageSizeSelector ===
 
=== TPageOrientationSelector ===
 
  
== Application ==
+
// returns/sets a pointer associated with the widget
=== TGuiApplication ===
+
// ( contrary to the integer "tag", allows to use an arbitary data type
<pre>
+
// for associating data )
tguiapplication = class(tcustomapplication)
+
property tagpo: pointer read ftagpo write ftagpo;
  public
 
  
  // [re]starts the system timer with the new period and
+
// returns/sets a string identifying the widget in the help system
  // subscribes the application to be a receiver of the modified "ek_timer" event
+
property helpcontext: msestring read gethelpcontext write fhelpcontext;
  // ( can check for it in the event queue )
 
  procedure settimer(const us: integer);
 
  
  // finds a window by its winID
+
// twidget
  function findwindow(id: winidty; out window: twindow): boolean;
 
  
  // finds a window by its ID & adjusts "rect" so that it
+
// creates an instance of the widget, owned by "aowner" if not NIL
  // fits "bounds_minc*" & "bounds_maxc*" of the found window
+
constructor create(aowner: tcomponent); override;
  procedure checkwindowrect(winid: winidty; var rect: rectty);
 
  
  // inits the timer and "megraphics"
+
destructor destroy; override;
  procedure initialize;
 
  
  // frees the allocated system resources (GDI, event subsription, the timer)
+
// ??
  procedure deinitialize;
+
procedure afterconstruction; override;
  
  // creates a form instance, it will be shown in "application.run"
+
// rescales the widget frame ( if assigned ) then owned widgets ( if exist, recursively ) then bounds_* then the font ( if assigned )
  procedure createform(instanceclass: widgetclassty; var reference);
+
// called before inserting in parentwidget,
 +
// calls "scale(ascale)",
 +
// no visual repainting
 +
procedure initnewcomponent(const ascale: real); virtual;
  
  // invalidates all registered forms ( all their widgets will be redrawn )
+
// restores the "fontheight" to "font.glyphheight" if "ow_fontglyphheight" or
  procedure invalidate;
+
// to "font.lineheight" if "ow_fontlineheight" otherwise,
 
+
// ascale is ignored ?
  // calls a nested main eventloop, forces processing any pending messages,
+
// calls "synctofontheight->setfontheight",
  procedure processmessages; override; //handle with care!
+
// called after inserting in parentwidget,
 +
// no visual repainting
 +
procedure initnewwidget(const ascale: real); virtual;
  
  // TRUE if no pending events to process for the application
+
// creates the widget frame if not yet created
  function idle: boolean; override;
+
procedure createframe;
 
 
  // requests to indicate waiting ( to show the "watches" cursos )
 
  procedure beginwait; override;
 
  
  // removes the "watches" if no unclosed requests for displaying them,
+
// creates the widget face if not yet  created
  // otherwise closes the currently active request
+
procedure createface;
  procedure endwait; override;
 
  
  // TRUE if there're unclosed requests for displaying "watches"
+
// creates the widget font if not yet  created
  function waiting: boolean;
+
procedure createfont;
  
  // TRUE if ESC has just been pressed
+
// checks ws_loadlock and csdestroing too
  //  - if all requests for displaying "watches" are closed then refreshes
+
function isloading: boolean;
  //    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
+
// returns "widgetstatety" - a set of (
  procedure resetwaitdialog;  
+
// 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;
  
  // runs "aexecuteaction" in the main thread in OnIdle mode,
+
// returns "widgetstate1ty" - a set of (
  // then shows a cancellable message,
+
// (ws1_childscaled,ws1_fontheightlock,
  // if the one is cancelled then runs "acancelaction" then
+
// ws1_widgetregionvalid,ws1_rootvalid,
  // either fully clears (if exceptions occur )
+
// ws1_anchorsizing,ws1_isstreamed,
  // or terminates the execution otherwise,
+
// ws1_scaled, //used in tcustomscalingwidget
  // true if not cancelled;
+
// ws1_noclipchildren,
  // "application.processmessages" must be called regularly if "aexecuteaction" is used here,
+
// ws1_nodesignvisible,ws1_nodesignframe,ws1_nodesignhandles,
  // alternatively "aidleaction" can be used, call sleep ( some time ) in order to minimize
+
// ws1_nodesigndelete,ws1_designactive,
  // processor load.
+
// ws1_fakevisible,ws1_nominsize //used for report size calculations
  // If athread <> nil the function starts and terminates the thread   
+
// )
  function waitdialog(const athread: tthreadcomp = nil; const atext: msestring = '';
+
property widgetstate1: widgetstates1ty read fwidgetstate1;
                  const caption: msestring = '';
+
                  const acancelaction: notifyeventty = nil;
+
* this set of states is needed because the max FPC set size is 32
                  const aexecuteaction: notifyeventty = nil): boolean; override;
+
  thus "widgetstate1ty" can't fit all states
  
  // closes the currently modal waitdialogue with "cancelled" state
+
// TRUE if the widget is contained within another widget
  procedure cancelwait;
+
// ( tcomponent stuff )
 +
function hasparent: boolean; override;              
  
  // closes the currently modal waitdialogue with "ok" state
+
// returns the parent component if it's a widget or the grandparent otherwise
  procedure terminatewait;
+
function getparentcomponent: tcomponent; override;   //tcomponent
  
  function waitstarted: boolean;  // the last waitdialogue is currently showing for some requests
+
// TRUE if "awidget" is an ascendant or the widget or they are the same widget
  function waitcanceled: boolean; // the last waitdialogue has been cancelled for some request (but can be shown fot others ?)
+
function checkdescendent(awidget: twidget): boolean;
  function waitterminated: boolean; // the last waitdialogue has been terminated for some request (but can be shown fot others ?)
+
 +
// TRUE if app is running and the widget owns the caret or the caret widget
 +
function hascaret: boolean;
  
  // if called from the main app thread then shows as a modal message describing the exception
+
        // TRUE if "winid" allocated and not loading and not destroying,
  // otherwise posts an async event for which the message will be called
+
        // all widgets on a form have "winid" of this form ( a real window allocated by the OS )
  procedure showexception(e: exception; const leadingtext: string = ''); override;
+
        // thus have this function TRUE
 +
function windowallocated: boolean;
  
  // posts an async event for which the message describing the exception will be called
+
// TRUE if presents a valid toplevelwindow with assigned "winid"
  procedure showasyncexception(e: exception; const leadingtext: string = '');
+
function ownswindow: boolean;
  
  // "application.errormessage" shows standard error message ( with "ERROR" title )
+
// invalidated area of the widget, the origin is "clientpos" against the roor widget
  procedure errormessage(const amessage: msestring); override;
+
function updaterect: rectty;  
  
  // [re]calculates timings & position of hint for "ahintedwidget"
+
// calls recursively "canclose" for all contained widgets ( the widget oneself excluded! ),
  // if "ow_timedhint" in "ahintedwidget.foptionswidget" then iys showtime will be
+
// TRUE if none of the widgets return FALSE
  // "defaulthintshowtime" ( an app wide setting, 3sec by default) 
+
//
  procedure inithintinfo(var info: hintinfoty; const ahintedwidget: twidget);
+
// 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;
  
  // shows the supplied hint text within "aposrect" with alignment "aplacement" during "ashowtime",
+
// the above function but with the preserved focus
  // the avail ( but not used currenly ) flags are : hfl_show,hfl_custom,hfl_noautohidemove,hfl_noautohidemove 
+
function canparentclose: boolean; overload;
  procedure showhint(const sender: twidget; const hint: msestring;
+
                  //newfocus = window.focusedwidget     
              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"
+
function canfocus: boolean; virtual;
  procedure showhint(const sender: twidget; const info: hintinfoty); overload;
+
function setfocus(aactivate: boolean = true): boolean; virtual;//true if ok
 +
procedure nextfocus; //sets inputfocus to then next appropriate widget
  
  // removes the current hint widget & frees its resources & stops its stop timer
+
function findtabfocus(const ataborder: integer): twidget;
  procedure hidehint;
+
                      //nil if can not focus
  
  // restarts the current hint and its stop timer
+
function firsttabfocus: twidget;
  procedure restarthint(const sender: twidget);
+
function lasttabfocus: twidget;
 +
function nexttaborder(const down: boolean = false): twidget;
  
  function hintedwidget: twidget; //last hinted widget
+
function focusback(const aactivate: boolean = true): boolean;
  function activehintedwidget: twidget; //nil if no hint active
+
                              //false if focus not changed
  
  // returns helpcontext of active widget, '' if none;  
+
function parentcolor: colorty;
  function activehelpcontext: msestring;
+
function actualcolor: colorty; virtual;
 +
function actualopaquecolor: colorty;
 +
function backgroundcolor: colorty;
 +
function translatecolor(const acolor: colorty): colorty;
  
  // returns helpcontext of the widget under mouse, '' if none;
+
procedure widgetevent(const event: twidgetevent); virtual;
  function mousehelpcontext: msestring;
 
  
  // TRUE if one of the app's window/console is in input focus
+
procedure sendwidgetevent(const event: twidgetevent);
  function active: boolean;
+
                              //event will be destroyed
  
  // returns the desktop resolution ( or the virtual one if used )
+
procedure release; override;
  function screensize: sizety;
 
  
  // returns the (virtual) desktop resolution except the tray area,
+
function show(const modal: boolean = false; const transientfor: twindow = nil): modalresultty; virtual;
  // 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 !)
+
procedure hide;
  // is active ( provides the input focus ),
+
procedure activate(const abringtofront: boolean = true); virtual;
  // it's same for all widgets of the form served by this window
+
                            //show and setfocus
  function activewindow: twindow;
 
  
/ * A transient window is a descendant of ( "transientfor" ) another window in the stacking order hierarchy */
+
procedure bringtofront;
 +
procedure sendtoback;
 +
procedure stackunder(const predecessor: twidget);
  
  // returns a first non-transient ( on top of the app stacking order ) window upward
+
procedure paint(const canvas: tcanvas); virtual;
  // from the currently active window of the application.
+
procedure update; virtual;
  // or that active window if no such
+
procedure scrollwidgets(const dist: pointty);
  function regularactivewindow: twindow;
 
  
  // same as "activewindow" but the window must not be released (?)
+
procedure scrollrect(const dist: pointty; const rect: rectty; scrollcaret: boolean);
  function unreleasedactivewindow: twindow;
+
                            //origin = paintrect.pos
  
  // returns the focused widget of the currently active window if one exists
+
procedure scroll(const dist: pointty);
  function activewidget: twidget;
+
                            //scrolls paintrect and widgets
  
  // returns the widget presenteing the currently active window
+
procedure getcaret;
  function activerootwidget: twidget;
+
procedure scrollcaret(const dist: pointty);
 
+
function mousecaptured: boolean;
  // returns the window ( not hidden or disabled !) under the screen point "pos"
+
procedure capturemouse(grab: boolean = true);
  function windowatpos(const pos: pointty): twindow;
+
procedure releasemouse;
 +
procedure capturekeyboard;
 +
procedure releasekeyboard;
 +
procedure synctofontheight; virtual;
  
  // puts to "awidget" the container of widget pointed by "namepath"
+
procedure dragevent(var info: draginfoty); virtual;
  // ( finalizing "." is discarded if found ) ,
+
procedure dochildscaled(const sender: twidget); virtual;
  // 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;
+
procedure invalidatewidget;    //invalidates whole widget
  // window list is ordered by "z" - bottom first & top last;
+
procedure invalidate;           //invalidates clientrect
  // invisibles first
+
procedure invalidaterect(const rect: rectty; org: originty = org_client);
  procedure sortzorder;
+
procedure invalidateframestate;
  
  // returns a copy of the internal window list of application
+
procedure invalidateframestaterect(const rect: rectty;
  function windowar: windowarty;
+
                                        const org: originty = org_client); 
 +
function hasoverlappingsiblings(arect: rectty): boolean; //origin = pos
  
  // returns the list of application window winIDs
+
function window: twindow;
  function winidar: winidarty;
+
function rootwidget: twidget;
  
  // returns the count of the application windows   
+
function parentofcontainer: twidget;
  function windowcount: integer;
+
            //parentwidget.parentwidget if parentwidget has not ws_iswidget,
 +
            //parentwidget otherwise
  
  // returns the window by its number ( "index" >= 0) in the application window list
+
property parentwidget: twidget read fparentwidget write setparentwidget;
  property windows[const index: integer]: twindow read getwindows;
+
function getrootwidgetpath: widgetarty; //root widget is last
  
  // returns the lowest visible window in stackorder,
+
// number of contained widgets ( the widget oneself excluded ! )
  // calls "sortzorder" within
+
function widgetcount: integer;
  function bottomwindow: twindow;
 
  
  // returns the highest visible window in stackorder,  
+
function parentwidgetindex: integer; //index in parentwidget.widgets, -1 if none
  // calls "sortzorder" within
+
property widgets[const index: integer]: twidget read getwidgets;
  function topwindow: twindow;
+
function widgetatpos(var info: widgetatposinfoty): twidget; overload;
 +
function widgetatpos(const pos: pointty): twidget; overload;
  
 +
function widgetatpos(const pos: pointty;
 +
                  const state: widgetstatesty): twidget; overload;
  
  // TRUE if all owned windows pass "CanClose" check or
+
property taborderedwidgets: widgetarty read gettaborderedwidgets;
  // don't have focused widgets
 
  function candefocus: boolean;
 
  
  // subscribes the handler "method" to receive keyboard events
+
function findtagwidget(const atag: integer; const aclass: widgetclassty): twidget;
  procedure registeronkeypress(const method: keyeventty);
+
              //returns first matching descendent
  
  // unsubscribes the handler "method" from receiving keyboard events
+
property container: twidget read getcontainer;
  procedure unregisteronkeypress(const method: keyeventty);
+
function containeroffset: pointty;
 +
function childrencount: integer; virtual;
 +
property children[const index: integer]: twidget read getchildwidgets; default;
  
  // subscribes the handler "method" to receive shortcut events
+
function childatpos(const pos: pointty;
  procedure registeronshortcut(const method: keyeventty);
+
                  const clientorigin: boolean = true): twidget; virtual;
  
  // unsubscribes the handler "method" from receiving shortcut events
+
function getsortxchildren: widgetarty;
  procedure unregisteronshortcut(const method: keyeventty);
+
function getsortychildren: widgetarty;
 +
property focusedchild: twidget read ffocusedchild;
 +
property focusedchildbefore: twidget read ffocusedchildbefore;
  
  // subscribes the handler "method" to receive "OnWindowActiveChanged" event ( form-wide )
+
function mouseeventwidget(const info: mouseeventinfoty): twidget;
  procedure registeronactivechanged(const method: activechangeeventty);
 
  
  // unsubscribes the handler "method" from receiving "OnWindowActiveChanged" event ( form-wide )
+
function checkdescendent(widget: twidget): boolean;
  procedure unregisteronactivechanged(const method: activechangeeventty);
+
                    //true if widget is descendent or self
  
  // subscribes the handler "method" to receive "OnDestroyed" events ( form-wide )
+
function checkancestor(widget: twidget): boolean;
  procedure registeronwindowdestroyed(const method: windoweventty);
+
                    //true if widget is ancestor or self
  
  // unsubscribes the handler "method" from receiving "OnDestroyed" events ( form-wide )
+
function containswidget(awidget: twidget): boolean;
  procedure unregisteronwindowdestroyed(const method: windoweventty);
 
  
  // subscribes the handler "method" to receive "OnWindowDestroyed" events ( form-wide )
+
procedure insertwidget(const awidget: twidget); overload;
  procedure registeronwiniddestroyed(const method: winideventty);
 
  
  // unsubscribes the handler "method" form receiving "OnWindowDestroyed" events ( form-wide )
+
procedure insertwidget(const awidget: twidget; const apos: pointty); overload; virtual;
  procedure unregisteronwiniddestroyed(const method: winideventty);
+
                //widget can be child
  
  // subscribes the handler "method" to receive "ApplicationActiveChanged" events ( form-wide )
+
function iswidgetclick(const info: mouseeventinfoty; const caption: boolean = false): boolean;
  procedure registeronapplicationactivechanged(const method: booleaneventty);
+
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
 +
//or in frame.caption if caption = true, origin = pos
  
  // unsubscribes the handler "method" from receiving "ApplicationActiveChanged" events ( form-wide )
+
function isclick(const info: mouseeventinfoty): boolean;
  procedure unregisteronapplicationactivechanged(const method: booleaneventty);
+
//true if eventtype = et_butonrelease, button is mb_left, clicked and pos in clientrect
  
// tcustomapplication
+
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
  
  // subscribes the handler "method" to receive "OnTerminated" event ( form-wide )
+
function isdblclicked(const info: mouseeventinfoty): boolean;
  procedure registeronterminated(const method: notifyeventty);
+
//true if eventtype in [et_buttonpress,et_butonrelease], button is mb_left,
 +
// and timedlay to last same buttonevent is short
  
  // unsubscribes the handler "method" from receiving "OnTerminated" events ( form-wide )
+
function isleftbuttondown(const info: mouseeventinfoty): boolean;
  procedure unregisteronterminated(const method: notifyeventty);
+
//true if eventtype = et_butonpress, button is mb_left, pos in clientrect
 +
//origin = paintrect.pos
  
  // subscribes the handler "method" to receive "OnTerminateQuery" event ( form-wide )
+
widgetrect: the widget on-screen area including its frame & frame caption
  procedure registeronterminate(const method: terminatequeryeventty);
 
  
  // unsubscribes the handler "method" from receiving "OnTerminateQuery" event ( form-wide )
+
paintrect: the widget on-screen area except its frame & frame caption
  procedure unregisteronterminate(const method: terminatequeryeventty);
 
  
  // subscribes the handler "method" to receive "OnIdle" event ( form-wide )
+
clientrect: virtual area which
  procedure registeronidle(const method: idleeventty);
+
- 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;  
  
  // unsubscribes the handler "method" from receiving "OnIdle" events ( form-wide )
+
// the coord of the outer top-left corner against the screen ( the WM decorations aren't counted in )
  procedure unregisteronidle(const method: idleeventty);
+
// includes the frame & frame caption
 +
property screenpos: pointty;  
  
  // calls "canclose" of all application windows except the "sender" window
+
// the coord of the outer top-left corner against the parent widget,
  // if all "canclose"are TRUE then checks "OnTerminateQuery"
+
// including the frame & frame caption
  // for all its subscribers ( usually forms of the application )
+
property widgetrect: rectty;
  procedure terminate(const sender: twindow = nil);  
+
property pos: pointty; // =widgetrect.pos
 
+
property size: sizety; // =widgetrect.size
  // TRUE as long as a "terminate" call is in progress
+
property left: integer; // =bounds_x
  function terminating: boolean;
+
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
  
  // TRUE as long as a "deinitialize" call is in progress
+
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
  function deinitializing: boolean;
+
    //  except the frame & frame caption
 
+
function paintrect: rectty;
  // returns the current caret object ( the text input focus indicator ) of the application
+
function paintpos: pointty;
  / ( this object provides facitities to control position & appearance & visibility & timings of the caret )
+
function paintsize: sizety;
  property caret: tcaret read fcaret;
+
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;
  
  // returns the current mouse object of the application
+
    // the coord of the paint area ( paintrect ) against own outer top-left corner ( against "widgetrect=pos" )
  / ( this object provides facitities to control position & appearance of the mouse ) 
+
    // except the frame caption
  property mouse: tmouse read fmouse;
+
function framerect: rectty; // =paintrect except the frame caption area
 +
function framepos: pointty;
 +
function framesize: sizety;
  
  // simulates mouseparkevent
+
    // the coord of the client area ( clientrect )  against the paint area ( paintrect )
  // ( an adjusting mouse movement without user intervention - grid snapping, docking etc ?)
+
    //  usually these areas match
  procedure mouseparkevent;
+
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,
  
  // sets mouse position correction for further mouse events,
+
    // the coord of the client area of the parent against the paint area of this widget
  // the real position is less the visual one by the supplied shift
+
function clientrectparent: rectty; //nullrect if parent = nil,
  procedure delayedmouseshift(const ashift: pointty);
 
  
  // returns/sets a cursor shape used for widgets having their cursor shape set to "cr_default";
+
// the coord of the inner area against the client area ( clientrect )
  // setting it to "cr_default" restores the individual widget cursor(s)
+
function innerclientrect: rectty; // mainly equals to clientrect
  property widgetcursorshape: cursorshapety read fwidgetcursorshape write
+
function innerclientsize: sizety;
                                        fwidgetcursorshape;
+
function innerclientpos: pointty;
  
  // returns/sets the current application-wide cursor shape ( not "watches" if a waiting dialogue is curerntly displayed ! )
+
function framewidth: sizety;              //widgetrect.size - paintrect.size
  // or request to set a new cursor shape ( app-wide );
+
function clientframewidth: sizety;        //widgetrect.size - clientrect.size
  // doesn't change when changing mouse widgets
+
function innerclientframewidth: sizety;   //widgetrect.size - innerclientrect.size
  //  
+
function innerframewidth: sizety;        //clientrect.size - innerclientrect.size 
  // if called from a non-main app thread & no waiting dialogue displayed then redraws
+
 
  // the cursor immediately;
+
    // the coord of the paint area against the widgetrect(pos) of the parent
  // set it to "cr_default" to restore the shape to one set by "widgetcursorshape"
+
function paintparentpos: pointty;   //origin = parentwidget.pos
  //
 
  property cursorshape: cursorshapety; // cr_arrow, cr_*
 
  
  // assures the displayed mouse cursor shape to be the shape assigned to the currently under-mouse widget,
+
    // the coord of the client area against the widgetrect(pos) of the parent
  // otherwise "cr_default"
+
function clientparentpos: pointty;   //origin = parentwidget.pos
  procedure updatecursorshape; //restores cursorshape of mousewidget
 
  
  // returns a widget of the application where the mouse is currently positioned over
+
    // the coord of the widgetrect(pos) against the client area of parent
  property mousewidget: twidget read fmousewidget;
+
property parentclientpos: pointty;
  
  // returns a widget of the application currently "owning" the mouse ( grabbing all mouse input )
 
  property mousecapturewidget: twidget read fmousecapturewidget;
 
  
 +
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;
  
  // 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
+
property minsize: sizety read fminsize write setminsize;
  // ( the main thread )
+
property maxsize: sizety read fmaxsize write setmaxsize;
  property thread: threadty read fthread;
+
function maxclientsize: sizety; virtual;
  
  // 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
+
property anchors: anchorsty read fanchors write setanchors default defaultanchors;
  // ( to compare with when determinibg whether another widget is clicked )
+
property defaultfocuschild: twidget read getdefaultfocuschild write setdefaultfocuschild;
  property buttonreleasewidgetbefore: twidget read fbuttonreleasewidgetbefore;
 
  
  
  // returns/sets the interval of mouse double click recognition ( in microsecs),
+
procedure changeclientsize(const delta: sizety); //asynchronous
  // defaults to 0.4 sec
 
  property dblclicktime: integer read fdblclicktime write fdblclicktime default
 
                defaultdblclicktime; //us
 
  
// tcustomapplication
+
function getcanvas(aorigin: originty = org_client): tcanvas;
  
  // creates a datamodule instance ( its startup code including "OnLoaded" is executed )
+
function showing: boolean;
  procedure createdatamodule(instanceclass: msecomponentclassty; var reference);
+
              //true if self and all ancestors visible and window allocated
  
 +
function isenabled: boolean;
 +
              //true if self and all ancestors enabled
  
  // enters the application event loop;
+
function active: boolean;
  //
+
function entered: boolean;
  // 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 activeentered: boolean;
  function running: boolean;
+
//true if entered and window is regularactivewindow or inactivated
  
  // returns/sets the application name
+
function focused: boolean;
  // ( defaults to the full path to application executable in the native OS format );
+
function clicked: boolean;
  // 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
+
function indexofwidget(const awidget: twidget): integer;
  // 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,
+
procedure changedirection(const avalue: graphicdirectionty;
  // unlocks the application and calls sleep if not mainthread and asleepus >= 0
+
                                            var dest: graphicdirectionty); virtual;
  function checkoverload(const asleepus: integer = 100000): boolean;
 
  
  // returns/sets the application exception handler
+
// (re)arranges "awidgets" horizontally within the parent's client area
  property onexception: exceptioneventty read fonexception write fonexception;
+
// so that awidget[i] were placed next each other
 
+
// at h-space dist[i], starting from "startx" with the right margin "endmargin";
  // if not "eabort" & no unhandled exceptions,
+
//
  // executes the above "OnException" code if assigned
+
// if the number of "dist" is fewer than the number of "awidgets" then the remaining h-spaces are taken
  // or shows an exception message otherwise;
+
// as the last "dist[i]" or "0" if none;
  procedure handleexception(sender: tobject = nil;  
+
// if the number of "dist" is more than the number of "awidgets" then the extra dist[i] are discarded
                                      const leadingtext: string = '');
+
//
 +
// 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);
  
  // synchronizes the calling thread with the main event loop ( via a mutex),
+
// (re)arranges "awidgets" vertically within the parent's client area
  // TRUE if the calling thread allready holds the mutex,
+
// so that awidget[i] were placed upper/lower each other
  // the mutex is recursive
+
// at v-space dist[i], starting from "starty" with the bottom margin "endmargin";
  function lock: boolean;
+
//
 
+
// if the number of "dist" is fewer than the number of "awidgets" then the remaining v-spaces are taken
   // tries to synchronize the calling thread with the main event loop ( via a mutex)
+
// as the last "dist[i]" or "0" if none;
  function trylock: boolean;
+
// 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
  
  // releases the mutex if the calling thread holds the mutex,
+
// if {mode <> wam_none} then (re)arranges "awidgets" horizontally  within the parent's client area so that
  // TRUE if no unlock done
+
// awidgets[0] stays on its place but awidgets[1..N] :
  function unlock: boolean;
+
// - 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;
  
  // 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
+
// if {mode <> wam_none} then (re)arranges "awidgets" vertically within the parent's client area so that
  procedure relockall(count: integer);
+
// 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;
  
  // 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
+
Event handlers:
  function ismainthread: boolean;
 
  
  // TRUE if the currently locked thread is the application main thread
+
- onactivate
  function islockthread: boolean;
 
  
  // waith for "athread" to terminate,
+
fires :
  // does "unlock-relock" around waiting
 
  procedure waitforthread(athread: tmsethread);
 
  
  // post a "nothing-to-do" event for asynchronous processing in the main thread
+
= on receiving input focus, just before "OnFocus"
  procedure wakeupmainthread;
+
 +
= 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
  
  // invalidates all registered forms of the application so that their widgets redraw land-specific captions
+
- onchildscaled
  // ( changed by "mseconsts.setlangconsts" ),
 
  // called internally in "setlangconsts" before return
 
  procedure langchanged; virtual;
 
  
  // returns/sets "aps_terminated" state flag ( no actions ? )
+
fires :
  // 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 )
+
= on child(s) resizing due to font height change
  property exceptioncount: longword read fexceptioncount;
 
  
 +
= form widget: once "form.container" {scrolling widget} is loaded
  
private
+
- ondeactivate
// function tinternalapplication.beginmodal(const sender: twindow): boolean;
+
fires
 +
= form widget: when the form looses input focus
 +
= non-form widget: when the widget looses input focus
  
<pre/>
+
- ondefocus
  
== DB ==
+
fires
 +
= on disabling the widget
  
=== DBedit ===
+
= form widget: if another form is focused
=== DBfields ===
+
= non-form widget: if another widget is focused
=== TDBwidgetgrid ===
 
<pre>
 
  Properties:
 
  
        anchors - ...
+
- onenter
bounds - ...
+
= fires on any way of taking parent-wide focus as soon as
 +
the parent stores the new child's order, before "OnActivate" & "OnFocus"
  
color
+
- onexit
- color of the grid's client area
+
= fires last on parent-wide lossing focus, after "OnDefocus" & "OnDeactivate"
cursor
+
= for top-level ( not in a container ) forms, doesn't fire
- cursor shape when the mouse is over the client area
 
  
datacols
+
- onfocus
colorselect
+
fires
linecolor
+
= once the existing widget takes the focus
linecolorfix
+
= on showing the widget's form if the widget has the lowest "TabOrder"
linewidth
+
 
newrowcol
+
- 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
  
options
+
- onafterupdateskin
co_readonly
+
= fires in "updateskin" ( the widget is loaded etc ) once the skin is applied
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
 
 
 
<pre/>
 
<pre/>
=== Report ===
 
 
==== TRepSpacer ====
 
==== TRecordBand ====
 
==== TrepValueDisp ====
 
==== TRepPageNumdisp ====
 
==== TRepPrintDateDisp ====
 
==== TBandGroup ====
 
==== TTileArea ====
 
 
== Design ==
 
 
=== TGdbMi ===
 
=== TSyntaxEdit ===
 
=== TSyntaxPainter ===
 
 
== Comm ==
 
 
=== TCommPort ===
 
=== TAsciiCommPort ===
 
=== TAsciiProtPort ===
 
=== TCommSelector ===
 
  
== TWidget stuff ==
+
=== TWidget stuff ===
 
<pre>
 
<pre>
 
   Properties:     
 
   Properties:     
Line 2,807: Line 2,801:
 
constructor create(aowner: tcomponent); override;
 
constructor create(aowner: tcomponent); override;
  
== Public stuff ==
+
=== Public stuff ===
 
<pre/> (f)window:  
 
<pre/> (f)window:  
 
the OS-allocated ( root = toplevel ) window common for all widgets of this window
 
the OS-allocated ( root = toplevel ) window common for all widgets of this window

Revision as of 02:10, 7 January 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".

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

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 to store the typeinfo pointer of the enum type into sender.typeinfopo.

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

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

TTimer

TNoGuiAction

TPipeReadercomp

TSysEnvManager

TProcessMonitor

TFilechangeNotifier

TShortCutController

TPostscriptPrinter

TGdiPrinter

TWmfPrinter

TSkinController

TGuiThreadComp

Font

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 usuccessful then the nearest "sans" font is usually choosen

		*** 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 thead 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-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:
	  //  - 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 occured
	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 dislpays 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)


TFaceList

TFrameComp

Terminilogy :

{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

- 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 enlight 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 childs 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

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);

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

   // frees the allocated system resources (GDI, event subsription, 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 eventloop, 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" cursos )
   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're 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 facitities 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 dialogue is curerntly 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 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)
		cy - addition to height of the widget (with v-centering post applied)

	- color
		= the default color of client area & caption text background
		= may be overwtitten:
			* 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 childs :
			* processing all events & shortcuts & menu calls
			* auto "CanClose" check

			Also "false" usually aints 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 focued 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 childs if entered

		ow_arrowfocus
			- allows the widget ( and its childs 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 childs circle, 
				but Left/Right can only toggle between the childs ***

			*** 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 desision *** 

			- 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 childs )

		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 heigh & width & client area adjust so that to provide space for contents of the client area
			- no desing-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 childs or 
		// the event is processed ( cea_processed ) by one of the childs,
		// "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 can not 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(s) 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 aligment 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 calclated also define side margins if aplicable )

	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" amongst 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 an 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 occured

		- osc_expandy
			= allocates more v-space if needed

		- osc_shrinky
			= removes extra v-space if occured

		- 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);