DlangUI

Cross Platform GUI for D programming language

Home API Docs Screenshots Download .zip View on GitHub

dlangui.widgets.controls

This module contains simple controls widgets implementation.

TextWidget

ImageWidget

Button

ImageButton

ScrollBar



Synopsis:
import dlangui.widgets.controls;



License:
Boost License 1.0

Authors:
Vadim Lopatin, coolreader.org@gmail.com

class VSpacer: dlangui.widgets.widget.Widget;
vertical spacer to fill empty space in vertical layouts

class HSpacer: dlangui.widgets.widget.Widget;
horizontal spacer to fill empty space in horizontal layouts

class TextWidget: dlangui.widgets.widget.Widget;
static text widget

@property dstring text();
get widget text

@property Widget text(dstring s);
set text to show

@property Widget text(UIString s);
set text to show

@property Widget textResource(string s);
set text resource ID to show

class ImageWidget: dlangui.widgets.widget.Widget;
static image widget

@property string drawableId();
get drawable image id

@property ImageWidget drawableId(string id);
set drawable image id

@property ref DrawableRef drawable();
get drawable

@property ImageWidget drawable(DrawableRef img);
set custom drawable (not one from resources)

@property ImageWidget drawable(string drawableId);
set custom drawable (not one from resources)

class ImageButton: dlangui.widgets.controls.ImageWidget;
button with image only

class ImageTextButton: dlangui.widgets.layouts.HorizontalLayout;
button with image and text

class CheckBox: dlangui.widgets.controls.ImageTextButton;
checkbox

class RadioButton: dlangui.widgets.controls.ImageTextButton;
radio button

class Button: dlangui.widgets.widget.Widget;
Text only button

interface OnScrollHandler;
scroll event handler interface

abstract bool onScrollEvent(AbstractSlider source, ScrollEvent event);
handle scroll event

class AbstractSlider: dlangui.widgets.widget.WidgetGroup;
base class for widgets like scrollbars and sliders

Signal!OnScrollHandler onScrollEventListener;
scroll event listeners

const @property int position();
returns slider position

@property AbstractSlider position(int newPosition);
sets new slider position

const @property int minValue();
returns slider range min value

const @property int maxValue();
returns slider range max value

const @property int pageSize();
page size (visible area size)

@property AbstractSlider pageSize(int size);
set page size (visible area size)

AbstractSlider setRange(int min, int max);
set new range (min and max values for slider)

class ScrollBar: dlangui.widgets.controls.AbstractSlider, dlangui.widgets.widget.OnClickHandler;
scroll bar - either vertical or horizontal

@property Orientation orientation();
returns scrollbar orientation (Vertical, Horizontal)

@property ScrollBar orientation(Orientation value);
sets scrollbar orientation

protected void updateState();
hide controls when scroll is not possible

bool onMouseEvent(MouseEvent event);
handle mouse wheel events

void onDraw(DrawBuf buf);
Draw widget at its position to buffer