CheckBox

A simple toggle button.

Constructors

this
this(Text text, string source, Coordinate coordinates, bool checked)
this(dstring text, string source, Coordinate coordinates, bool checked)

CTOR for checkbox with text

this
this(string iconChecked, string iconUnchecked, string source, Coordinate coordinates, bool checked)

CTOR for small button version

Members

Functions

check
bool check()

Sets the value of the checkbox to checked. Does not inwoke any events.

draw
void draw()
Undocumented in source. Be warned that the author may not have intended to support it.
isLeftSide
bool isLeftSide()

Returns true if left side justified, false otherwise.

isLeftSide
bool isLeftSide(bool val)

Sets the small button to the left side if true.

isSmallButtonHeight
bool isSmallButtonHeight(int height)

Returns true if the checkbox is a small button.

passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)
Undocumented in source. Be warned that the author may not have intended to support it.
toggle
bool toggle()

Toggles the checkbox. Inwokes an onToggle event if delegate is set.

toggle
bool toggle(bool val)

Toggles the checkbox to the given value. Inwokes an onToggle event if delegate is set.

unCheck
bool unCheck()

Sets the value of the checkbox to unchecked. Does not inwoke any events.

Variables

iconChecked
string iconChecked;

Sets the icon for checked positions

iconUnchecked
string iconUnchecked;

Sets the icon for unchecked positions

onToggle
EventDeleg onToggle;
Undocumented in source.

Inherited Members

From WindowElement

inputHandler
InputHandler inputHandler;

Common input handler, must be set upon program initialization for text input, etc.

position
Box position;

Contains the position of the element. Should be only modified with functions to ensure consistency.

parent
ElementContainer parent;

Points to the container for two-way communication

text
Text text;

Contains the text of the element if any. Should be modified with functions to ensure redraws.

source
string source;

Passed with other event informations when event is caused. Can be something like the name of the instance.

flags
uint flags;

Contains various status flags.

ENABLE_MOUSE_PRESS
enum ENABLE_MOUSE_PRESS;
Undocumented in source.
IS_CLICKED
enum IS_CLICKED;
Undocumented in source.
ENABLE_RCLICK_FLAG
enum ENABLE_RCLICK_FLAG;
Undocumented in source.
IS_PRESSED
enum IS_PRESSED;
Undocumented in source.
IS_CHECKED
enum IS_CHECKED;
Undocumented in source.
IS_FOCUSED
enum IS_FOCUSED;
Undocumented in source.
IS_LHS
enum IS_LHS;
Undocumented in source.
customStyle
StyleSheet customStyle;

Sets a custom style for this element. If not set, then it'll get the style from it's parent.

onMouseLClick
EventDeleg onMouseLClick;

Called on left mouseclick released

onMouseRClick
EventDeleg onMouseRClick;

Called on right mouseclick released

onMouseMClick
EventDeleg onMouseMClick;

Called on middle mouseclick released

onMouseMove
EventDeleg onMouseMove;

Called if mouse is moved on object

onMouseScroll
EventDeleg onMouseScroll;

Called if mouse is scrolled on object

lastMousePosition
MouseMotionEvent lastMousePosition;

Stores the last known mouse position for future reference

getText
Text getText()

Returns the text of this element.

setText
void setText(Text s)
Undocumented in source. Be warned that the author may not have intended to support it.
setText
void setText(dstring s)
Undocumented in source. Be warned that the author may not have intended to support it.
state
ElementState state [@property setter]

Sets whether the element is enabled or not.

state
ElementState state [@property getter]

Returns whether the element is enabled or not.

setParent
void setParent(ElementContainer parent)
Undocumented in source. Be warned that the author may not have intended to support it.
draw
void draw()

Updates the output. Every subclass must override it.

getPosition
Box getPosition()
Undocumented in source. Be warned that the author may not have intended to support it.
setPosition
Box setPosition(Box position)
Undocumented in source. Be warned that the author may not have intended to support it.
getSource
string getSource [@property getter]

Returns the source string.

mousePressEvent
bool mousePressEvent [@property getter]

Returns true if the element will generate events on mouse press and mouse release. By default, only release is used.

mousePressEvent
bool mousePressEvent [@property setter]

Returns true if the element will generate events on mouse press and mouse release. By default, only release is used.

getStyleSheet
StyleSheet getStyleSheet()

Returns the next available StyleSheet.

focusGiven
void focusGiven()

Called when an object receives focus.

focusTaken
void focusTaken()

Called when an object loses focus.

cycleFocus
int cycleFocus(int direction)

Cycles the focus on a single element. Returns -1 if end is reached, or the number of remaining elements that are cycleable in the direction.

passKey
void passKey(uint keyCode, ubyte mod)

Passes key events to the focused element when not in text editing mode.

isFocused
bool isFocused [@property getter]

Returns whether the element is focused

isPressed
bool isPressed [@property getter]

Returns whether the element is pressed

isChecked
bool isChecked [@property getter]

Returns whether the element is checked

isChecked
bool isChecked [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)
Undocumented in source. Be warned that the author may not have intended to support it.
passMME
void passMME(MouseEventCommons mec, MouseMotionEvent mme)
Undocumented in source. Be warned that the author may not have intended to support it.
passMWE
void passMWE(MouseEventCommons mec, MouseWheelEvent mwe)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta