Button

A button widget displays a textual label and/or image, and evaluates a command when pressed.

Constructors

this
this(UiElement parent, string text, Image image, string imagePosition)

Construct the widget.

this
this(UiElement parent, Image image, string text, string imagePosition)

Construct the widget.

this
this(string text, Image image, string imagePosition)

Construct the widget.

this
this(Image image, string text, string imagePosition)

Construct the widget.

Members

Mixins

__anonymous
mixin Command

Mixin common commands.

__anonymous
mixin Default_
Undocumented in source.
__anonymous
mixin Invoke
Undocumented in source.

Mixed In Members

From mixin Command

setCommand
auto setCommand(CommandCallback callback)

Add a command to a widget.

removeCommand
auto removeCommand()

Remove a previously set command.

From mixin Default_

setDefault
auto setDefault()

Make the widget the default one on the interface.

From mixin Invoke

invokeCommand
auto invokeCommand()

Invoke the command associated with the widget.

Inherited Members

From TextWidget

_textVariable
string _textVariable;
Undocumented in source.
_image
Image _image;
Undocumented in source.
setText
auto setText(string text)

Set the widget text.

getText
string getText()

Get the widget text.

setImage
auto setImage(Image image, string imagePosition)

Set the image for this widget.

setImagePosition
auto setImagePosition(string imagePosition)

Change the position of the image in relation to the text.

setTextCharacterWidth
auto setTextCharacterWidth(int characterWidth)

Set the text character width.

destroy
void destroy()

Destroy this widget.

__anonymous
mixin Underline

Mixin common commands.

Examples

auto button = new Button(new Png!("image.png"), "Text")
	.setCommand(delegate(CommandArgs arg){ ... })
	.pack();

Common Commands

These are injected common commands that can also be used with this widget.

Command
Default
Invoke

Additional Events

Additional events that can also be bound to using the bind method.

<<Invoke>>, <<PrevWindow>>, <Alt-Key>, <B1-Enter>, <B1-Leave>, <Button-1>, <ButtonRelease-1>, <Enter>, <Key-F10>, <Key-Tab>, <Key-space>, <Leave>,

Styles: Button widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.

See Also

Meta