Implementation of Windows.Forms.Form.
The form is the global object used to hang things off of since every Elem has a pointer to the form.
It is extended to add custom objects. See x.
Field | Format | Description |
---|---|---|
$appGbl | [hashtable] | application wide globals such as base folder |
$appJob | [object] | Owning Object (such as JobDesc) or $null |
$appRoot | [object] | app specific root object |
$bDebLayout | [boolean] | on if layout debug |
$bNoJam | [boolean] | EC9B30 - resize exit. Do not ajust form size |
$bRestartGUI | [boolean] | EC2520 - on if to restart GUI after closing |
$cfg | [hashtable] | Related config |
$colors | [hashtable] | Registered RBG colors |
$confirmClose | [ScriptBlock] | Script to execute before closing. return true to close, false to cancel close. |
$ctx | [object] | context for confirmClose |
$custObj | [object] | Custon owning object |
$dialogs | [hashtable] | Dialogs attached to Form |
$elems | [hashtable] | Elems contained in form |
$exitCharSeq | [string] | if we used k/b to exit, set flags. as below |
$exitCmdSeq | [string] | Actual exit str (copy of $exitCharStr, timing issue means above is not reliable) |
$exitExitSeq | [string] | What we look for. Default .. Exit GUI. |
$exitRestartSeq | [string] | What we look for. Default // Restart GUI and classes with exit code 901 |
$fonts | [hashtable] | Registered named fonts |
$gridList | [object] | Registered Grids |
$icons | [hashtable] | Registered named Icons |
$layoutExit | [scriptBlock] | execute after layout performed |
$layoutExitBusy | [boolean] | prevents recursion if exit dinks with sizes and causes new |
$onClose | [scriptBlock] | Script to execute on closing |
$openExit | [scriptBlock] | EC2701 - used to perform processing after form is visible |
$resizeExit | [scriptBlock] | EC9B29 - resize exit |
$title | [string] | Value shown in outer window caption |
$toolTip | [Windows.Forms.ToolTip] | Tool tips attached to Form |
addGridList Register a Grid on the Form
staticcreateForm not-described
findColor Find a color by name. Used internally by backColor and foreColor methods.
findElem Find the registered Elem using the $name parameter as the search argument
findElemOpt Find the registered Elem using the $name parameter as the search argument
getBoldFont Create a bolded font of the specified Points using the font family \"Microsoft Sans Serif\"
getBoldFont Create a bolded font of the specfied Points using the specified font family
getFixedFont Create a fixed-font of the specified Points using the font family \"Lucida Console\"
getFont Create a font of the specified Points using the font family \"Microsoft Sans Serif\"
getFont Create a font of the specfied Points using the specified font family
log Log a message to the Logger window of the form, if it exists
log Log a black message to the Logger window of the form, if it exists
logFlag Log a red message to the Logger window of the form, if it exists
logGood Log a green message to the Logger window of the form, if it exists
logWarn Log an orange message to the Logger window of the form, if it exists
regColor Register a color by name
regDialog Register a Dialog as being open
regElem Register Elem using the Elem.name property
regElem Register Elem using the $name parameter as the name
regFont Register a font by name
regIcon Register an Icon (image) by name
remDialog Remove a Dialog for the registry
resize Resizes the current window
rgb Calculate the color value using RGB values
setConfirmClose Sets or removes confirmClose property
showForm shows the form
[void] addGridList ( [Windows.Forms.DataGridView]$dgv)
Parameter Format Description
$dgv Windows.Forms.DataGridView subject DataGridView
Register a Grid on the Form
Timing issues exist with Grids and focus. Registering the Grid allows for race conditions to be circumvented and the 'non-focus' of a grid cell to be more reliable.
static [Form] createForm ( [object]$appJob, [hashtable]$cfg, [scriptBlock]$closeCallBack, [Form]$form)
Parameter Format Description
$appJob object parm description missing
$cfg hashtable Loaded config file
$closeCallBack scriptBlock parm description missing
$form Form parm description missing
The ?@Form@? created is the topmost window of the GUI interface
The optional $cfg parm provides a hashtable where configration information such as window sizes is stored. This is used in rebuilding the window. See ?@formCfg@?.
The optional $closeCallBack parm provides a script or function that is called when the window is about to close. See ?@formClose@?.
The optional $form parm provides a means whereby a Form can be extendeds with additional fields or behavoirs. see ?@formExtend@?.
.optp $cfg Configuration file .optp $closeCallBack Function/script to call when ?@Form@? closes .optp $Form Existing extended ?@Form@? to use as parent
[string] findColor ( [string]$name)
Parameter Format Description
$name string name to lookup
Find a color by name. Used internally by backColor and foreColor methods.
[Elem] findElem ( [string]$name)
Parameter Format Description
$name string name to lookup
Find the registered Elem using the $name parameter as the search argument
Throws an error if not found
[Elem] findElemOpt ( [string]$name)
Parameter Format Description
$name string name to lookup
Find the registered Elem using the $name parameter as the search argument
Returns $null if not found
[System.Drawing.Font] getBoldFont ( [int]$pts)
Parameter Format Description
$pts int Points size of font
Create a bolded font of the specified Points using the font family "Microsoft Sans Serif"
[System.Drawing.Font] getBoldFont ( [int]$pts, [string]$family)
Parameter Format Description
$pts int Points size of font
$family string Font family to use
Create a bolded font of the specfied Points using the specified font family
[System.Drawing.Font] getFixedFont ( [int]$pts)
Parameter Format Description
$pts int Points size of font
Create a fixed-font of the specified Points using the font family "Lucida Console"
[System.Drawing.Font] getFont ( [int]$pts)
Parameter Format Description
$pts int Points size of font
Create a font of the specified Points using the font family "Microsoft Sans Serif"
[System.Drawing.Font] getFont ( [int]$pts, [string]$family)
Parameter Format Description
$pts int Points size of font
$family string Font family to use
Create a font of the specfied Points using the specified font family
[void] log ( [string]$msg, [string]$col)
Parameter Format Description
$msg string the message
$col string the color (default black)
Log a message to the Logger window of the form, if it exists
The specified color sometimes has difficulty 'taking', especially in the early stages of the windows creation or after clearing the logging window using the "Clear Log" link
[void] log ( [string]$msg)
Parameter Format Description
$msg string parm description missing
Log a black message to the Logger window of the form, if it exists
[void] logFlag ( [string]$msg)
Parameter Format Description
$msg string parm description missing
Log a red message to the Logger window of the form, if it exists
[void] logGood ( [string]$msg)
Parameter Format Description
$msg string parm description missing
Log a green message to the Logger window of the form, if it exists
[void] logWarn ( [string]$msg)
Parameter Format Description
$msg string parm description missing
Log an orange message to the Logger window of the form, if it exists
[void] regColor ( [string]$name, [int]$r, [int]$g, [int]$b)
Parameter Format Description
$name string the name to register under
$r int red component of RGB value
$g int green component of RGB value
$b int blue component of RGB value
Register a color by name
[void] regDialog ( [Dialog]$dlg)
Parameter Format Description
$dlg Dialog parm description missing
Register a Dialog as being open
This is used so that open dialogs are automatically closed when the parent window is closed. Failure to do this causes orphan windows that tangles up the Windows OS.
This is automatically called by the Dialog create factory function.
[void] regElem ( [Elem]$elem)
Parameter Format Description
$elem Elem parm description missing
Register Elem using the Elem.name property
[void] regElem ( [Elem]$elem, [string]$name)
Parameter Format Description
$elem Elem parm description missing
$name string name to lookup
Register Elem using the $name parameter as the name
[void] regFont ( [string]$name, [Drawing.Font]$font)
Parameter Format Description
$name string name to lookup
$font Drawing.Font parm description missing
Register a font by name
[void] regIcon ( [string]$name, [Drawing.BitMap]$icon)
Parameter Format Description
$name string name to lookup
$icon Drawing.BitMap parm description missing
Register an Icon (image) by name
[void] remDialog ( [Dialog]$dlg)
Parameter Format Description
$dlg Dialog parm description missing
Remove a Dialog for the registry
Automatically called by the standard Dialog close function
[void] resize ()
Resizes the current window
This is called internally when the user resizes the Form window (typically with the mouse).
This triggers the Form layout method to be called
[string] rgb ( [int]$red, [int]$green, [int]$blue)
Parameter Format Description
$red int red component of RGB value
$green int green component of RGB value
$blue int blue component of RGB value
Calculate the color value using RGB values
[Form] setConfirmClose ( [object]$ctx, [ScriptBlock]$confirmClose)
Parameter Format Description
$ctx object parm description missing
$confirmClose ScriptBlock parm description missing
Sets or removes confirmClose property
[void] showForm ()
shows the form
This shows the form and freezes the Powershell console window. ?@hlog@? messages and its varients are still displayed.
A keyboard listener is installed so that the keyboard can be used to close the window. The following keyboard sequences have meaning. All others are ignored but forwarded to controls that accept keyboard input.
Refer to ?@GuiRestart@? for more details.
Copyright © 2018-2021, 2022, Rexcel System Inc.