User Tools

Site Tools


DzButton

DAZScript abstract base class for button widgets.

More...

Inherits :

Inherited By : DzCheckBox, DzPushButton and DzRadioButton

Properties

Methods

DAZ Script
voidtoggle ()

Signals

voidclicked ()
voidpressed ()
voidreleased ()
voidstateChanged ( Number state )
voidtoggled ( Boolean onOff )

Detailed Description

DzButton implements an abstract button base. Subclasses specify how to respond to user interaction, and how to present the button to the user. If you want to create a button, create a DzPushButton.

DzPushButton provides both push and toggle buttons. The DzRadioButton and DzCheckBox classes provide only toggle buttons.

The difference between down and on is, when a user clicks a [toggle] button to toggle it on, the button is first pressed and then released into the On state (on is true, down is false). When the user clicks it again (to toggle it off), the button is first pressed and then released to the Off state (on and down are false).

Properties


Boolean : autoRepeat

Holds whether or not autoRepeat is enabled. false by default. If enabled, the clicked() signal is emitted at regular intervals if down is true. This property has no effect on toggle buttons.


Number : autoRepeatDelay

Holds the initial delay, in milliseconds, before auto-repetition begins


Number : autoRepeatInterval

Holds the length of the auto-repetition interval, in milliseconds


Boolean : checkable

Holds whether or not the button is checkable. false by default.


Boolean : checked

Holds whether or not the button is checked. Only applies to checkable buttons.


Boolean : down

Holds whether or not the button is pressed. true if the button is pressed down. false by default. The signals pressed() and clicked() are not emitted when this property set to true.


Pixmap : pixmap

Holds the Pixmap shown on the button. If the Pixmap is monochrome (e.g. its depth is 1) and it does not have a mask, the Pixmap will be its own mask. This allows transparent bitmaps to be drawn, which are important for toggle buttons. 0 if no pixmap is set.


String : text

Holds the text displayed on the button. undefined by default. An ampersand (&) in the String automatically creates an accelerator for it using the character that follows the ampersand, as the accelerator key. Any previous accelerator will be overwritten, or cleared if no accelerator is defined by the text.


Boolean : toggleButton

Holds whether or not the button is a toggle (Read Only). false by default.

Methods


void : toggle()

Toggles the state of a toggle button.

Signals


void : clicked()

Signature:“clicked()”

Emitted when the button is pressed and then released.


void : pressed()

Signature:“pressed()”

Emitted when the button is pressed.


void : released()

Signature:“released()”

Emitted when the button is released.


void : stateChanged( Number state )

Signature:“stateChanged(int)”

Emitted when toggleState on this button has changed.


void : toggled( Boolean onOff )

Signature:“toggled(bool)”

Emitted when the button is toggled.

Parameter(s):

  • onOff - true if the button is on, false if the button is off.