WindowElement

All Window elements inherit from this class. Provides basic interfacing with containers.

Members

Functions

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.

draw
void draw()

Updates the output. Every subclass must override it.

focusGiven
void focusGiven()

Called when an object receives focus.

focusTaken
void focusTaken()

Called when an object loses focus.

getPosition
Box getPosition()
Undocumented in source. Be warned that the author may not have intended to support it.
getStyleSheet
StyleSheet getStyleSheet()

Returns the next available StyleSheet.

getText
Text getText()

Returns the text of this element.

passKey
void passKey(uint keyCode, ubyte mod)

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

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.
setParent
void setParent(ElementContainer parent)
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.
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.

Properties

getSource
string getSource [@property getter]

Returns the source string.

isChecked
bool isChecked [@property getter]

Returns whether the element is checked

isChecked
bool isChecked [@property setter]

Sets whether the element is checked

isFocused
bool isFocused [@property getter]

Returns whether the element is focused

isPressed
bool isPressed [@property getter]

Returns whether the element is pressed

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.

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.

Static variables

ENABLE_MOUSE_PRESS
enum ENABLE_MOUSE_PRESS;
Undocumented in source.
ENABLE_RCLICK_FLAG
enum ENABLE_RCLICK_FLAG;
Undocumented in source.
IS_CHECKED
enum IS_CHECKED;
Undocumented in source.
IS_CLICKED
enum IS_CLICKED;
Undocumented in source.
IS_FOCUSED
enum IS_FOCUSED;
Undocumented in source.
IS_LHS
enum IS_LHS;
Undocumented in source.
IS_PRESSED
enum IS_PRESSED;
Undocumented in source.
inputHandler
InputHandler inputHandler;

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

onDraw
void delegate() onDraw;

Called when drawing is finished

Variables

customStyle
StyleSheet customStyle;

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

flags
uint flags;

Contains various status flags.

lastMousePosition
MouseMotionEvent lastMousePosition;

Stores the last known mouse position for future reference

onMouseLClick
EventDeleg onMouseLClick;

Called on left mouseclick released

onMouseMClick
EventDeleg onMouseMClick;

Called on middle mouseclick released

onMouseMove
EventDeleg onMouseMove;

Called if mouse is moved on object

onMouseRClick
EventDeleg onMouseRClick;

Called on right mouseclick released

onMouseScroll
EventDeleg onMouseScroll;

Called if mouse is scrolled on object

parent
ElementContainer parent;

Points to the container for two-way communication

position
Box position;

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

source
string source;

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

text
Text text;

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

Meta