GuiControlClass
Members
callback
desc: A callback that will be called whenever a glabel would be called. If set to false
the callback will be ignored.
type: Func|BoundFunc|false
default: false
meta: [object]
link: link
DPIScale
desc: Whether or not to scale unscaled values by DPI/96.
type: bool
default: false
guiHwnd
desc: The hwnd of the parent GUI.
type: hwnd
logfont
desc: An instance of GridGUI.LOGFONT
which hold information on the font and colour of the control.
type: GridGUI.LOGFONT
meta: [object]
type
desc: The type of the control e.g. Button
, Edit
etc.
type: string
vVar
desc: A variable containing the value of the control as returned by GridGUI.GuiControlClass.GuiControlGet
when called with no arguments, it is updated when the glabel is fired.
type: any
default: The initial value of the control.
Methods
__glabel
__glabel(label)
An internal method used to allow a function callback to a label.
parameters
__New
__New(hwnd, type, options := "", callback := false, DPIScale := true)
Constructor.
parameters
name: hwnd
desc: The hwnd of the control.
type: hwnd
name: type
desc: The type of the control.
type: string
name: options
desc: The ahk options string that the control was created with, used to set up min-size and glabel callback.
type: string
default: ""
name: callback
desc: The callback to call whenever the glabel of the control would be called.
type: Func|BoundFunc|false
default: false
name: DPIScale
desc: Whether or not to scale unscaled values by DPI/96.
type: bool
default: true
return value
desc: A new GridGUI.GuiControlClass
instance.
type: GridGUI.GuiControlClass
__ParseOptions
__ParseOptions(options)
Parses option strings for values that are used by the class and updated the instance based on the values.
parameters
name: options
desc: The options that will be parsed, values handled by the lib will be acted on and removed.
type: string
return value
desc: The option string without the parts that the class handles.
type: string
Draw
Draw(pos)
Draws the control using MoveDraw
.
parameters
Font
Font(Options := "", FontName := "", updateMinSize := true)
Changes the font, style and colour of the control, without impacting other controls. After the font and style has been applied the min-size of the control is changed so that the text fits.
parameters
name: Options
desc: Styling option string, see link for detail of what options are available.
type: string
default: ""
link: link
name: updateMinSize
desc: Whether or not to update the min size of the control so that the text will be visible using the new font.
type: bool
default: true
link: link
GetPos
GetPos()
Implements the method GridGUI.CellControl.GetPos
of the GridGUI.Cell
interface GridGUI.CellControl
.
return value
desc: The position and size of the control.
type: GridGUI.Position
GuiControl
GuiControl(subCommand, value)
A thin function wrapper for GuiControl
.
parameters
name: subCommand
desc: The subcommand to set for the control. See link for available subcommands.
type: string
link: link
name: value
desc: The value to apply to the subcommand. See link for values used in the subcommands.
type: string|number|object
link: link
link: link
GuiControlGet
GuiControlGet(subCommand := "", value := "")
A thin function wrapper for GuiControlGet
.
parameters
name: subCommand
desc: The subcommand to retrieve from the control. See link for available subcommands.
type: string
default: ""
link: link
name: value
desc: Used to specify what to retrieve when the subcommand is not specific enough.
type: string
default: ""
link: link
return value
desc: The retrieved value.
type: any
link: link
Options
Options(options)
Applies options to the control using GuiControl
.
parameters
name: options
desc: The ahk option string to apply. See link for available options.
type: string
link: link
link: link
ReDraw
ReDraw()
Draws the control again, using options that work when drawing the control ontop of other controls.
ToStr
ToStr(indent := "")
Converts the object to a string.
parameters
name: indent
desc: The amount of indentation to add on each line.
type: string
default: ""
return value
desc: A string representing this GridGUI.GuiControlClass
.
type: string
ZOrder
ZOrder(top := true, topmost := false)
Changes the z-order of the control to either bottom
, top
or topmost
.
parameters
name: top
desc: If true moved the control to the top of the z-order. If false moves the control to the bottom of the z-order.
type: bool
default: true
name: topmost
desc: If true
moves the control to be above all other controls. If false sets the z-order based on GridGUI.GuiControlClass.top
.
type: bool
default: false
link: link