FormControl - Kirix Documentation

Developer Resources

FormControl

Overview

The form control component encapsulates functions common to form controls such as position, size, focus, layout, and update functions.

Constructor

FormControl()

Events

FormControl.mouseEnter
Fired when the mouse enters the control window.
FormControl.mouseLeave
Fired when the mouse leaves the control window.
FormControl.mouseLeftDoubleClick
Fired when the left mouse button is double-clicked.
FormControl.mouseLeftDown
Fired when the left mouse button is down.
FormControl.mouseLeftUp
Fired when the left mouse button is released.
FormControl.mouseMiddleDoubleClick
Fired when the middle mouse button is double-clicked.
FormControl.mouseMiddleDown
Fired when the middle mouse button is down.
FormControl.mouseMiddleUp
Fired when the middle mouse button is released.
FormControl.mouseMove
Fired when the mouse is moved inside the control window.
FormControl.mouseRightDoubleClick
Fired when the right mouse button is double-clicked.
FormControl.mouseRightDown
Fired when the right mouse button is down.
FormControl.mouseRightUp
Fired when the right mouse button is released.
FormControl.mouseWheel
Fired when the mouse wheel is moved.
FormControl.paint
Fired when the form control is painted.
FormControl.sizeChanged
Fired when the form control size is changed.

Methods

FormControl.captureMouse
Captures the mouse on this form control.
FormControl.disablePaint
Disables the window from redrawing itself.
FormControl.enablePaint
Enables the window to redraw itself.
FormControl.getBackgroundColor
Gets the background color of the form control.
FormControl.getClientSize
Gets the client size of the form control.
FormControl.getEnabled
Indicates whether or not a form control is enabled.
FormControl.getFont
Gets the default font for the text of form control.
FormControl.getForegroundColor
Gets the foreground color of the form control.
FormControl.getMaxSize
Gets the maximum size of the form control.
FormControl.getMinSize
Gets the minimum size of the form control.
FormControl.getMousePosition
Gets the mouse position relative to this form control.
FormControl.getNativeHandle
Gets the native handle of the window/control
FormControl.getPosition
Gets the position of a form control.
FormControl.getSize
Gets the size of the form control.
FormControl.invalidate
Invalidates a form control, which will cause it to be repainted on the next paint event.
FormControl.refresh
Refreshes a form control, which immediately repaints the entire form control.
FormControl.releaseMouse
Releases the mouse from being captured on this form control.
FormControl.setBackgroundColor
Sets the background color of the form control.
FormControl.setClientSize
Sets the client size of a form control.
FormControl.setEnabled
Enables or disables the form control.
FormControl.setFocus
Sets the focus to the form control.
FormControl.setFont
Sets the default font for the text of the form control.
FormControl.setForegroundColor
Sets the foreground color of the form control.
FormControl.setMaxSize
Sets the maximum size of a form control.
FormControl.setMinSize
Sets the minimum size of a form control.
FormControl.setPosition
Sets the position of a form control relative to the the form control's parent.
FormControl.setSize
Sets the size of a form control.
FormControl.show
Shows or hides the form control.
FormControl.update
Updates a form control, which will immediately repaint any invalid areas.

FormControl.captureMouse

function FormControl.captureMouse()

Description

Captures the mouse on this form control.

FormControl.disablePaint

function FormControl.disablePaint()

Description

Calling disablePaint causes the window not to redraw. This can be useful in controlling flicker when dealing with form elements. Each disablePaint call should have a corresponding enablePaint call.

FormControl.enablePaint

function FormControl.enablePaint()

Description

Reenables window redraw which was masked by a call to disablePaint. Each enablePaint call should have a corresponding disablePaint call.

FormControl.getBackgroundColor

function FormControl.getBackgroundColor() : Color

Returns

Returns the background color of the form control.

Description

Returns the background color of the form control.

FormControl.getClientSize

function FormControl.getClientSize() : Size

Returns

Returns the client size of the form control.

Description

Returns the client size of the form control.

FormControl.getEnabled

function FormControl.getEnabled() : Boolean

Returns

Returns true if a form control is enabled, and false otherwise.

Description

Returns true if a form control is enabled. Returns false if a form control is not enabled.

FormControl.getFont

function FormControl.getFont() : Font

Returns

Returns the default font used for the text of the form control.

Description

Returns the default font used for the text of the form control.

FormControl.getForegroundColor

function FormControl.getForegroundColor() : Color

Returns

Returns the foreground color of the form control.

Description

Returns the foreground color of the form control.

FormControl.getMaxSize

function FormControl.getMaxSize() : Size

Returns

Returns the maximum size of the form control.

Description

Returns the maximum size of the form control.

FormControl.getMinSize

function FormControl.getMinSize() : Size

Returns

Returns the minimum size of the form control.

Description

Returns the minimum size of the form control.

FormControl.getMousePosition

function FormControl.getMousePosition() : Point

Returns

Returns the mouse position relative to this form control.

Description

Returns the mouse position relative to this form control.

FormControl.getNativeHandle

function FormControl.getNativeHandle() : Number

Returns

Returns the handle as an numeric value

Description

Returns the native handle of the window or control. On Windows, this is the value of the window's HWND handle.

FormControl.getPosition

function FormControl.getPosition() : Point

Returns

Returns the position of a form control, relative to its parent.

Description

Returns the position of a form control, relative to its parent.

FormControl.getSize

function FormControl.getSize() : Size

Returns

Returns the size of the form control.

Description

Returns the size of the form control.

FormControl.invalidate

function FormControl.invalidate()

Description

Invalidates a form control, which will cause it to be repainted on the next paint event.

FormControl.refresh

function FormControl.refresh()

Description

Refreshes a form control, which immediately repaints the entire form control.

FormControl.releaseMouse

function FormControl.releaseMouse()

Description

Releases the mouse from being captured on this form control.

FormControl.setBackgroundColor

function FormControl.setBackgroundColor(color : Color)

Arguments

color
The color to which to set the background of the specified form control.

Description

Sets the background color of the form control to the specified color.

FormControl.setClientSize

function FormControl.setClientSize(size : Size)
function FormControl.setClientSize(width : Integer, height : Integer)

Arguments

size
The client size to which to set the form control.
width
The client width to which to set the form control.
height
The client height to which to set the form control.

Description

Sets the client size of a form control to the specified size or width and height values.

FormControl.setEnabled

function FormControl.setEnabled(flag : Boolean)

Arguments

flag
A flag which indicates whether or not to enable the form control.

Description

Enables the form control if flag is true. Disables the form control if flag is false. If flag isn't specified, the form control is disabled.

FormControl.setFocus

function FormControl.setFocus()

Description

Sets the focus to the form control.

FormControl.setFont

function FormControl.setFont(font : Font)

Arguments

font
The default font to use when rendering the text of the form control.

Description

Sets the default font for the text of the form control.

FormControl.setForegroundColor

function FormControl.setForegroundColor(color : Color)

Arguments

color
The color to which to set the foreground of the specified form control.

Description

Sets the foreground color of the form control to the specified color.

FormControl.setMaxSize

function FormControl.setMaxSize(size : Size)
function FormControl.setMaxSize(width : Integer, height : Integer)

Arguments

size
The maximum size to which to set the form control.
width
The maximum width to which to set the form control.
height
The maximum height to which to set the form control.

Description

Sets the maximum size of a form control to the specified size or width and height values.

FormControl.setMinSize

function FormControl.setMinSize(size : Size)
function FormControl.setMinSize(width : Integer, height : Integer)

Arguments

size
The minimum size to which to set the form control.
width
The minimum width to which to set the form control.
height
The minimum height to which to set the form control.

Description

Sets the minimum size of a form control to the specified size or width and height values.

FormControl.setPosition

function FormControl.setPosition(point : Point)
function FormControl.setPosition(x : Integer, y : Integer)

Arguments

point
The position to which to set the form control.
x
The x portion of the position to which to set the form control.
y
The y portion of the position to which to set the form control.

Description

Sets the position of a form control relative its parent from the specified point or (x, y) position.

FormControl.setSize

function FormControl.setSize(size : Size)
function FormControl.setSize(width : Integer, height : Integer)

Arguments

size
The size to which to set the form control.
width
The width to which to set the form control.
height
The height to which to set the form control.

Description

Sets the size of a form control to the specified size or width and height values.

FormControl.show

function FormControl.show(flag : Boolean)

Arguments

flag
A flag which indicates whether to show or hide the form control.

Description

Shows the form control if the flag is true. Hides the form control if the flag is false. If flag isn't specified, the form control is shown.

FormControl.update

function FormControl.update()

Description

Updates a form control, which will immediately repaint any invalid areas.