VSpacer

vertical spacer to fill empty space in vertical layouts

class VSpacer : Widget {}

Constructors

this
this()
Undocumented in source.

Inherited Members

From Widget

_id
string _id;

widget id

_pos
Rect _pos;

current widget position, set by layout()

_visibility
Visibility _visibility;

widget visibility: either Visible, Invisible, Gone

_styleId
string _styleId;

style id to lookup style in theme

_ownStyle
Style _ownStyle;

own copy of style - to override some of style properties, null of no properties overriden

_state
uint _state;

widget state (set of flags from State enum)

_measuredWidth
int _measuredWidth;

width measured by measure()

_measuredHeight
int _measuredHeight;

height measured by measure()

_needLayout
bool _needLayout;

true to force layout

_needDraw
bool _needDraw;

true to force redraw

_parent
Widget _parent;

parent widget

_window
Window _window;

window (to be used for top level widgets only!)

_trackHover
bool _trackHover;

does widget need to track mouse Hover

trackHover
bool trackHover [@property getter]

mouse movement processing flag (when true, widget will change Hover state while mouse is moving)

trackHover
bool trackHover [@property setter]

set new trackHover flag value (when true, widget will change Hover state while mouse is moving)

~this
~this()
Undocumented in source.
style
const(Style) style [@property getter]

accessor to style - by lookup in theme by styleId (if style id is not set, theme base style will be used).

style
uint style [@property setter]

accessor to style - by lookup in theme by styleId (if style id is not set, theme base style will be used).

stateStyle
const(Style) stateStyle [@property getter]

returns style for current widget state

ownStyle
Style ownStyle [@property getter]

enforces widget's own style - allows override some of style properties

id
string id [@property getter]

returns widget id, null if not set

id
string id [@property setter]

set widget id

compareId
bool compareId(string id)

compare widget id with specified value, returs true if matches

state
uint state [@property getter]

widget state (set of flags from State enum)

handleFocusChange
void handleFocusChange(bool focused)

override to handle focus changes

handleCheckChange
void handleCheckChange(bool checked)

override to handle check changes

state
uint state [@property setter]

set new widget state (set of flags from State enum)

setState
uint setState [@property setter]

add state flags (set of flags from State enum)

resetState
uint resetState [@property setter]

remove state flags (set of flags from State enum)

styleId
string styleId [@property getter]

returns widget style id, null if not set

styleId
string styleId [@property setter]

set widget style id

margins
Rect margins [@property getter]

get margins (between widget bounds and its background)

margins
Rect margins [@property setter]

set margins for widget - override one from style

padding
Rect padding [@property getter]

get padding (between background bounds and content of widget)

padding
Rect padding [@property setter]

set padding for widget - override one from style

backgroundColor
uint backgroundColor [@property getter]

returns background color

backgroundColor
uint backgroundColor [@property setter]

set background color for widget - override one from style

textColor
uint textColor [@property getter]

get text color (ARGB 32 bit value)

textColor
uint textColor [@property setter]

set text color (ARGB 32 bit value)

fontFace
string fontFace [@property getter]

returns font face

fontFace
string fontFace [@property setter]

set font face for widget - override one from style

fontItalic
bool fontItalic [@property getter]

returns font style (italic/normal)

fontItalic
bool fontItalic [@property setter]

set font style (italic/normal) for widget - override one from style

fontWeight
ushort fontWeight [@property getter]

returns font weight

fontWeight
ushort fontWeight [@property setter]

set font weight for widget - override one from style

fontSize
ushort fontSize [@property getter]

returns font size in pixels

fontSize
ushort fontSize [@property setter]

set font size for widget - override one from style

fontFamily
FontFamily fontFamily [@property getter]

returns font family

fontFamily
FontFamily fontFamily [@property setter]

set font family for widget - override one from style

alignment
ubyte alignment [@property getter]

returns alignment (combined vertical and horizontal)

alignment
ubyte alignment [@property setter]

sets alignment (combined vertical and horizontal)

valign
Align valign [@property getter]

returns horizontal alignment

halign
Align halign [@property getter]

returns vertical alignment

font
FontRef font [@property getter]

returns font set for widget using style or set manually

text
dstring text [@property getter]

returns widget content text (override to support this)

text
dstring text [@property setter]

sets widget content text (override to support this)

text
UIString text [@property setter]

sets widget content text (override to support this)

needLayout
bool needLayout [@property getter]

returns true if layout is required for widget and its children

needDraw
bool needDraw [@property getter]

returns true if redraw is required for widget and its children

animating
bool animating [@property getter]

returns true is widget is being animated - need to call animate() and redraw

animate
void animate(long interval)

animates window; interval is time left from previous draw, in hnsecs (1/10000 of second)

measuredWidth
measuredWidth [@property getter]

returns measured width (calculated during measure() call)

measuredHeight
measuredHeight [@property getter]

returns measured height (calculated during measure() call)

width
int width [@property getter]

returns current width of widget in pixels

height
int height [@property getter]

returns current height of widget in pixels

top
int top [@property getter]

returns widget rectangle top position

left
int left [@property getter]

returns widget rectangle left position

pos
Rect pos [@property getter]

returns widget rectangle

minWidth
int minWidth [@property getter]

returns min width constraint

maxWidth
int maxWidth [@property getter]

returns max width constraint (SIZE_UNSPECIFIED if no constraint set)

minHeight
int minHeight [@property getter]

returns min height constraint

maxHeight
int maxHeight [@property getter]

returns max height constraint (SIZE_UNSPECIFIED if no constraint set)

maxWidth
int maxWidth [@property setter]

set max width constraint (SIZE_UNSPECIFIED for no constraint)

minWidth
int minWidth [@property setter]

set max width constraint (0 for no constraint)

maxHeight
int maxHeight [@property setter]

set max height constraint (SIZE_UNSPECIFIED for no constraint)

minHeight
int minHeight [@property setter]

set max height constraint (0 for no constraint)

layoutWidth
int layoutWidth [@property getter]

returns layout width options (WRAP_CONTENT, FILL_PARENT, or some constant value)

layoutHeight
int layoutHeight [@property getter]

returns layout height options (WRAP_CONTENT, FILL_PARENT, or some constant value)

layoutWeight
int layoutWeight [@property getter]

returns layout weight (while resizing to fill parent, widget will be resized proportionally to this value)

layoutWidth
int layoutWidth [@property setter]

sets layout width options (WRAP_CONTENT, FILL_PARENT, or some constant value)

layoutHeight
int layoutHeight [@property setter]

sets layout height options (WRAP_CONTENT, FILL_PARENT, or some constant value)

layoutWeight
int layoutWeight [@property setter]

sets layout weight (while resizing to fill parent, widget will be resized proportionally to this value)

visibility
Visibility visibility [@property getter]

returns widget visibility (Visible, Invisible, Gone)

visibility
Visibility visibility [@property setter]

sets widget visibility (Visible, Invisible, Gone)

isPointInside
bool isPointInside(int x, int y)

returns true if point is inside of this widget

enabled
bool enabled [@property getter]

return true if state has State.Enabled flag set

enabled
bool enabled [@property setter]

change enabled state

_clickable
bool _clickable;
Undocumented in source.
clickable
bool clickable [@property getter]

when true, user can click this control, and get onClick listeners called

clickable
bool clickable [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
canClick
bool canClick [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
_checkable
bool _checkable;
Undocumented in source.
checkable
bool checkable [@property getter]

when true, control supports Checked state

checkable
bool checkable [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
canCheck
bool canCheck [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
_checked
bool _checked;
Undocumented in source.
checked
bool checked [@property getter]

get checked state

checked
bool checked [@property setter]

set checked state

_focusable
bool _focusable;
Undocumented in source.
focusable
bool focusable [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
focusable
bool focusable [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
focused
bool focused [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
visible
bool visible [@property getter]

returns true if this widget and all its parents are visible

canFocus
bool canFocus [@property getter]

returns true if widget is focusable and visible

setFocus
Widget setFocus()

sets focus to this widget or suitable focusable child, returns previously focused widget

findFocusableChild
Widget findFocusableChild(bool defaultOnly)

searches children for first focusable item, returns null if not found

handleClick
bool handleClick()
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyEvent
bool onKeyEvent(KeyEvent event)

process key event, return true if event is processed.

onMouseEvent
bool onMouseEvent(MouseEvent event)

process mouse event; return true if event is processed by widget.

onClickListener
Signal!OnClickHandler onClickListener;

on click event listener (bool delegate(Widget))

onCheckChangeListener
Signal!OnCheckHandler onCheckChangeListener;

checked state change event listener (bool delegate(Widget, bool))

onFocusChangeListener
Signal!OnFocusHandler onFocusChangeListener;

focus state change event listener (bool delegate(Widget, bool))

requestLayout
void requestLayout()

request relayout of widget and its children

invalidate
void invalidate()

request redraw

measuredContent
void measuredContent(int parentWidth, int parentHeight, int contentWidth, int contentHeight)

helper function for implement measure() when widget's content dimensions are known

measure
void measure(int parentWidth, int parentHeight)

Measure widget according to desired width and height constraints. (Step 1 of two phase layout).

layout
void layout(Rect rc)

Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).

onDraw
void onDraw(DrawBuf buf)

Draw widget at its position to buffer

applyMargins
void applyMargins(Rect rc)

Helper function: applies margins to rectangle

applyPadding
void applyPadding(Rect rc)

Helper function: applies padding to rectangle

applyAlign
void applyAlign(Rect rc, Point sz)

Applies alignment for content of size sz - set rectangle rc to aligned value of content inside of initial value of rc.

childCount
int childCount [@property getter]

returns number of children of this widget

child
Widget child(int index)

returns child by index

addChild
Widget addChild(Widget item)

adds child, returns added item

removeChild
Widget removeChild(int index)

removes child, returns removed item

removeChild
Widget removeChild(string id)

removes child by ID, returns removed item

childIndex
int childIndex(Widget item)

returns index of widget in child list, -1 if passed widget is not a child of this widget

isChild
bool isChild(Widget item, bool deepSearch)

returns true if item is child of this widget (when deepSearch == true - returns true if item is this widget or one of children inside children tree).

childById
Widget childById(string id, bool deepSearch)

find child by id, returns null if not found

parent
Widget parent [@property getter]

returns parent widget, null for top level widget

parent
Widget parent [@property setter]

sets parent for widget

window
Window window [@property getter]

returns window (if widget or its parent is attached to window)

window
Window window [@property setter]

sets window (to be used for top level widget from Window implementation). TODO: hide it from API?

Meta