TextLabelWidget

Displays some text

And it can't handle new-line characters

If the text doesn't fit in width, it will move left-right

Constructors

this
this(dstring newCaption)

constructor

Members

Functions

resizeEvent
void resizeEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
timerEvent
void timerEvent(uinteger msecs)
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

caption
dstring caption [@property getter]
dstring caption [@property setter]

the text to display

Variables

backgroundColor
Color backgroundColor;

text and background colors

scrollTimer
uinteger scrollTimer;

milliseconds after it scrolls 1 pixel, in case text too long to fit in 1 line

textColor
Color textColor;

text and background colors

Inherited Members

From QWidget

_size
Size _size;

size of this widget

_show
bool _show;

whether this widget should be drawn or not

_sizeRatio
uinteger _sizeRatio;

specifies that how much height (in horizontal layout) or width (in vertical) is given to this widget. The ratio of all widgets is added up and height/width for each widget is then calculated using this

_wantsTab
bool _wantsTab;

specifies whether this widget should receive the Tab key press, default is false, and should only be changed to true if only required, for example, in text editors

_wantsInput
bool _wantsInput;

whether the widget wants input

_display
Display _display;

used to write to terminal

cycleActiveWidget
bool cycleActiveWidget()

For cycling between widgets. Returns false, always.

searchAndActivateWidget
bool searchAndActivateWidget(QWidget target)

activate the passed widget if this is actually the correct widget, return if it was activated or not

setActiveWidgetCycleKey
void setActiveWidgetCycleKey(dchar newKey)

changes the key used for cycling active widgets

_customInitEvent
InitFunction _customInitEvent;

custom onInit event, if not null, it should be called before doing anything else in init();

_customMouseEvent
MouseEventFuction _customMouseEvent;

custom mouse event, if not null, it should be called before doing anything else in mouseEvent.

_customKeyboardEvent
KeyboardEventFunction _customKeyboardEvent;

custom keyboard event, if not null, it should be called before doing anything else in keyboardEvent.

_customResizeEvent
ResizeEventFunction _customResizeEvent;

custom resize event, if not null, it should be called before doing anything else in the resizeEvent

_customActivateEvent
ActivateEventFunction _customActivateEvent;

custom onActivate event, if not null, it should be called before doing anything else in activateEvent

_customTimerEvent
TimerEventFunction _customTimerEvent;

custom onTimer event, if not null, it should be called before doing anything else in timerEvent

update
void update()

Called by parent to update this widget

initialize
void initialize()

Called after _display has been set and this widget is ready to be used

mouseEvent
void mouseEvent(MouseEvent mouse)

Called when mouse is clicked with cursor on this widget.

keyboardEvent
void keyboardEvent(KeyboardEvent key)

Called when key is pressed and this widget is active.

resizeEvent
void resizeEvent()

Called when widget size is changed, or widget should recalculate it's child widgets' sizes;

activateEvent
void activateEvent(bool isActive)

called right after this widget is activated, or de-activated, i.e: is made _activeWidget, or un-made _activeWidget

timerEvent
void timerEvent(uinteger msecs)

called often. msecs is the msecs since last timerEvent, not accurate

requestUpdate
void requestUpdate()

Called by itself when it needs to request an update

requestResize
void requestResize()

Called to request this widget to resize at next update

registerKeyHandler
bool registerKeyHandler(dchar key)

Called by itself (not necessarily) to register itself as a key handler

onInitEvent
InitFunction onInitEvent [@property setter]

use to change the custom initialize event

onMouseEvent
MouseEventFuction onMouseEvent [@property setter]

use to change the custom mouse event

onKeyboardEvent
KeyboardEventFunction onKeyboardEvent [@property setter]

use to change the custom keyboard event

onResizeEvent
ResizeEventFunction onResizeEvent [@property setter]

use to change the custom resize event

onActivateEvent
ActivateEventFunction onActivateEvent [@property setter]

use to change the custom activate event

onTimerEvent
TimerEventFunction onTimerEvent [@property setter]

use to change the custom timer event

parent
QWidget parent [@property getter]
isActive
bool isActive [@property getter]
wantsTab
bool wantsTab [@property getter]
bool wantsTab [@property setter]
wantsInput
bool wantsInput [@property getter]
cursorPosition
Position cursorPosition [@property getter]
sizeRatio
uinteger sizeRatio [@property getter]
uinteger sizeRatio [@property setter]

size of width (height/width, depending of Layout.Type it is in) of this widget, in ratio to other widgets in that layout

show
bool show [@property getter]

visibility of the widget. getter

show
bool show [@property setter]

visibility of the widget. setter

size
Size size [@property getter]

size of the widget. getter **NOTE: call this.requestResize() if you change the size!**

size
Size size [@property setter]

size of the widget. setter

Meta