dlangui.widgets.widget

This module contains declaration of Widget class - base class for all widgets.

Widgets are styleable. Use styleId property to set style to use from current Theme.

When any of styleable attributes is being overriden, widget's own copy of style is being created to hold modified attributes (defaults to parent style).

Two phase layout model (like in Android UI) is used - measure() call is followed by layout() is used to measure and layout widget and its children.abstract

Method onDraw will be called to draw widget on some surface. Widget.onDraw() draws widget background (if any).

More...

Public Imports

dlangui.core.types
public import dlangui.core.types;
Undocumented in source.
dlangui.core.events
public import dlangui.core.events;
Undocumented in source.
dlangui.core.i18n
public import dlangui.core.i18n;
Undocumented in source.
dlangui.core.collections
public import dlangui.core.collections;
Undocumented in source.
dlangui.widgets.styles
public import dlangui.widgets.styles;
Undocumented in source.
dlangui.widgets.menu
public import dlangui.widgets.menu;
Undocumented in source.
dlangui.graphics.drawbuf
public import dlangui.graphics.drawbuf;
Undocumented in source.
dlangui.graphics.resources
public import dlangui.graphics.resources;
Undocumented in source.
dlangui.graphics.fonts
public import dlangui.graphics.fonts;
Undocumented in source.
dlangui.graphics.colors
public import dlangui.graphics.colors;
Undocumented in source.
dlangui.core.signals
public import dlangui.core.signals;
Undocumented in source.
dlangui.platforms.common.platform
public import dlangui.platforms.common.platform;
Undocumented in source.
dlangui.dml.annotations
public import dlangui.dml.annotations;
Undocumented in source.

Members

Aliases

WidgetList
alias WidgetList = ObjectList!Widget

Widget list holder.

Classes

Widget
class Widget

Base class for all widgets.

WidgetGroup
class WidgetGroup

Base class for widgets which have children.

WidgetGroupDefaultDrawing
class WidgetGroupDefaultDrawing

WidgetGroup with default drawing of children (just draw all children)

Enums

CursorType
enum CursorType

standard mouse cursor types

FocusMovement
enum FocusMovement

focus movement options

FocusReason
enum FocusReason
Undocumented in source.
Orientation
enum Orientation
Undocumented in source.
Visibility
enum Visibility

Visibility (see Android View Visibility)

Functions

generatePropertySetter
string generatePropertySetter(string propName)

use in mixin to set this object property with name propName with value of variable value if variable name matches propName

generatePropertySetters
string generatePropertySetters(string[] propNames)

use in mixin to set this object properties with names from parameter list with value of variable value if variable name matches propName

generatePropertySettersMethodOverride
string generatePropertySettersMethodOverride(string methodName, string typeName, string[] propNames)

use in mixin for method override to set this object properties with names from parameter list with value of variable value if variable name matches propName

Interfaces

OnActionHandler
interface OnActionHandler

interface - slot for onAction

OnCheckHandler
interface OnCheckHandler

interface - slot for onCheckChanged

OnClickHandler
interface OnClickHandler

interface - slot for onClick

OnFocusHandler
interface OnFocusHandler

interface - slot for onFocusChanged

OnKeyActionHandler
interface OnKeyActionHandler

interface - slot for keyToAction

OnKeyHandler
interface OnKeyHandler

interface - slot for onKey

OnMouseHandler
interface OnMouseHandler

interface - slot for onMouse

Manifest constants

ONE_SECOND
enum ONE_SECOND;
Undocumented in source.

Mixin templates

ActionTooltipSupport
mixintemplate ActionTooltipSupport()

mixin this to widget class to support tooltips based on widget's action label

Static variables

TOUCH_MODE
bool TOUCH_MODE;
Undocumented in source.

Structs

AnimationHelper
struct AnimationHelper

Helper to handle animation progress

TextTypingShortcutHelper
struct TextTypingShortcutHelper

helper for locating items in list, tree, table or other controls by typing their name

Detailed Description

Synopsis:

import dlangui.widgets.widget;

// access attributes as properties
auto w = new Widget("id1");
w.backgroundColor = 0xFFFF00;
w.layoutWidth = FILL_PARENT;
w.layoutHeight = FILL_PARENT;
w.padding(Rect(10,10,10,10));
// same, but using chained method call
auto w = new Widget("id1").backgroundColor(0xFFFF00).layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).padding(Rect(10,10,10,10));

Meta

License

Boost License 1.0

Authors

Vadim Lopatin, coolreader.org@gmail.com