Widget

An empty widget.

Constructors

this
this()

Members

Functions

checkNeedLayout
bool checkNeedLayout(bool recursively)

Checks if the widget needs re-layout.

disableState
void disableState(WidgetState state)

Disables the state.

draw
void draw(Window win)

Draws the widget. Be called only by Window.

draw
void draw(Window win, ColorSet parent)

Draws the widget.

drawBox
void drawBox(Window win)
Undocumented in source. Be warned that the author may not have intended to support it.
drawChildren
void drawChildren(Window win)
Undocumented in source. Be warned that the author may not have intended to support it.
enableState
void enableState(WidgetState state)

Enables the state.

findChildAt
Widget findChildAt(vec2 pt)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePopup
void handlePopup(bool , WindowContext )
infectWindowContext
void infectWindowContext()
Undocumented in source. Be warned that the author may not have intended to support it.
layout
void layout(vec2i size)

Re-layouts the widget. Be called only by Window.

layout
vec2 layout(vec2 pos, vec2 size)

Re-layouts the widget.

requestLayout
void requestLayout()

Set needLayout true.

requestRedraw
void requestRedraw()

Sets needRedraw true.

setLayout
void setLayout(Args args)

Changes Layout object.

shift
void shift(vec2 size)

Mixins

__anonymous
mixin Mouse
Undocumented in source.
__anonymous
mixin Keyboard
Undocumented in source.

Properties

calcedChildren
Widget[] calcedChildren [@property getter]

Child widgets that have no uncalculated style properties.

childLayoutables
Layoutable[] childLayoutables [@property getter]

Child widgets that are casted to Layoutable.

childPlacerOwners
PlacerOwner[] childPlacerOwners [@property getter]

Child widgets that are casted to PlacerOwner.

children
Widget[] children [@property getter]

Child widgets.

colorset
colorset [@property getter]

Current colorset.

layoutObject
inout(Layout) layoutObject [@property getter]

Layout object.

needLayout
bool needLayout [@property getter]

Checks if the widget needs re-layout.

needRedraw
bool needRedraw [@property getter]

Checks if the widget needs redrawing.

status
status [@property getter]

Current status.

style
inout(WidgetStyle) style [@property getter]

Style of the widget.

wantedSize
vec2 wantedSize [@property getter]

Variables

_box
BoxElement _box;
Undocumented in source.
_colorset
ColorSet _colorset;
Undocumented in source.
_context
WindowContext _context;
Undocumented in source.
_layout
Layout _layout;
Undocumented in source.
_needLayout
bool _needLayout;
Undocumented in source.
_status
uint _status;
Undocumented in source.
_style
WidgetStyle _style;
Undocumented in source.

Mixed In Members

From mixin Mouse

_hovered
Widget _hovered;
Undocumented in source.
setHovered
void setHovered(Widget child, vec2 pos)
Undocumented in source. Be warned that the author may not have intended to support it.
cursor
const(Cursor) cursor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
isTracked
isTracked [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
trackable
bool trackable [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
track
void track()
Undocumented in source. Be warned that the author may not have intended to support it.
refuseTrack
void refuseTrack()
Undocumented in source. Be warned that the author may not have intended to support it.
handleMouseEnter
bool handleMouseEnter(bool entered, vec2 pos)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMouseMove
bool handleMouseMove(vec2 pos)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMouseButton
bool handleMouseButton(MouseButton btn, bool status, vec2 pos)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMouseScroll
bool handleMouseScroll(vec2 amount, vec2 pos)
Undocumented in source. Be warned that the author may not have intended to support it.
handleTracked
void handleTracked(bool a)
Undocumented in source. Be warned that the author may not have intended to support it.

From mixin Keyboard

_focusChain
Widget _focusChain;
Undocumented in source.
focusChain
focusChain [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
setFocusChain
void setFocusChain(Widget w)
Undocumented in source. Be warned that the author may not have intended to support it.
pullFocusChain
bool pullFocusChain()
Undocumented in source. Be warned that the author may not have intended to support it.
isFocused
isFocused [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
focusable
bool focusable [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
focus
void focus()
Undocumented in source. Be warned that the author may not have intended to support it.
dropFocus
void dropFocus()
Undocumented in source. Be warned that the author may not have intended to support it.
handleKey
bool handleKey(Key key, KeyState status)
Undocumented in source. Be warned that the author may not have intended to support it.
handleTextInput
bool handleTextInput(dchar c)
Undocumented in source. Be warned that the author may not have intended to support it.
handleFocused
void handleFocused(bool a)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From WindowContent

handleMouseEnter
bool handleMouseEnter(bool , vec2 )

Be called with true when cursor is entered.

handleMouseMove
bool handleMouseMove(vec2 )

Be called when cursor is moved.

handleMouseButton
bool handleMouseButton(MouseButton , bool , vec2 )

Be called when mouse button is clicked.

handleMouseScroll
bool handleMouseScroll(vec2 , vec2 )

Be called when mouse wheel is rotated.

handleKey
bool handleKey(Key , KeyState )

Be called when key is pressed, repeated or released.

handleTextInput
bool handleTextInput(dchar )

Be called when focused and text was inputted.

cursor
const(g4d.Cursor) cursor [@property getter]

Current cursor.

needLayout
bool needLayout [@property getter]

Checks if the contents need window size.

needRedraw
bool needRedraw [@property getter]

Checks if the contents need redrawing.

requestRedraw
void requestRedraw()

Sets the content redraw next frame.

layout
void layout(vec2i )

Be called with size of Window when needLayout is true.

draw
void draw(Window )

Be called when needRedraw is true.

From Layoutable

layoutObject
inout(Layout) layoutObject [@property getter]

Layout object.

childLayoutables
Layoutable[] childLayoutables [@property getter]

Child layoutables.

wantedSize
vec2 wantedSize [@property getter]

Wanted size.

checkNeedLayout
bool checkNeedLayout(bool )

Checks if need to layout completely. Set the first argument true to check recursively.

shift
void shift(vec2 )

Moves the owner and the children.

Meta