Label

A simple label used on GUI elements to annotate things.

Constructors

this
this(dstring text, string source, Box position)
Undocumented in source.
this
this(Text text, string source, Box position)
Undocumented in source.

Members

Functions

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

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.

onDraw
void delegate() onDraw;

Called when drawing is finished

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]

Sets whether the element is checked

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