DzButton Class Reference
[Interface Widget Objects]

DAZ Script abstract base class for button widgets. More...

Inheritance diagram for DzButton:

DzWidget DzCheckBox DzPushButton DzRadioButton DzStepButton List of all members.

Enumerations

enum  ToggleState { Off, NoChange, On }
enum  ToggleType { SingleShot, Toggle, Tristate }

Properties



Boolean autoRepeat
Boolean down
Boolean exclusiveToggle
Boolean on
Pixmap pixmap
String text
Boolean toggleButton
ToggleState toggleState
ToggleType toggleType

Constructors

 DzButton (DzWidget parent)

Methods

void toggle ()

Signals

void clicked ()
 Signature: "clicked()"
void pressed ()
 Signature: "pressed()"
void released ()
 Signature: "released()"
void stateChanged (Number state)
 Signature: "stateChanged(int)"
void toggled (Boolean onOff)
 Signature: "toggled(bool)"

Detailed Description

DAZ Script abstract base class for button widgets.

If you want to create a button use DzPushButton.

The DzButton class implements an abstract button, and lets subclasses (DzPushButton / DzCheckBox / DzRadioButton) specify how to reply to user actions and how to draw the button.

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).


Member Enumeration Documentation

enum DzButton::ToggleState

Deprecated:
This is no longer applicable. See DzCheckBox::checkState
Enumerator:
Off 
Deprecated:
NoChange 
Deprecated:
On 
Deprecated:

enum DzButton::ToggleType

Deprecated:
This is no longer applicable. See DzCheckBox::tristate
Enumerator:
SingleShot 
Deprecated:
Toggle 
Deprecated:
Tristate 
Deprecated:


Constructor & Destructor Documentation

DzButton::DzButton ( DzWidget  parent  ) 

Creates a button as a child of the given parent widget


Member Function Documentation

void DzButton::clicked (  )  [signal]

Signature: "clicked()"

Emitted when the button is pressed and then released.

Example:
function myFunction(){
    print( "Button clicked." );
}

//... build myDialog

var wButton = new DzButton( myDialog );
connect( wButton, "clicked()", myFunction );

void DzButton::pressed (  )  [signal]

Signature: "pressed()"

Emitted when the button is pressed.

Example:
function myFunction(){
    print( "Button pressed." );
}

//... build myDialog

var wButton = new DzButton( myDialog );
connect( wButton, "pressed()", myFunction );

void DzButton::released (  )  [signal]

Signature: "released()"

Emitted when the button is released.

Example:
function myFunction(){
    print( "Button released." );
}

//... build myDialog

var wButton = new DzButton( myDialog );
connect( wButton, "released()", myFunction );

void DzButton::stateChanged ( Number  state  )  [signal]

Signature: "stateChanged(int)"

Emitted when the ToggleState of the button is changed.

void DzButton::toggle (  ) 

Toggles the state of a toggle button.

void DzButton::toggled ( Boolean  onOff  )  [signal]

Signature: "toggled(bool)"

Emitted when the button is toggled. onOff is true if the button is on, false if the button is off

Example:
function myFunction( bArg ){
    print( String( "Button toggled: %1" ).arg( bArg ) );
}

//... build myDialog

var wButton = new DzButton( myDialog );
connect( wButton, "toggled(bool)", myFunction );


Member Data Documentation

bool DzButton::autoRepeat

Whether 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.

Boolean DzButton::down

Whether 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.

Boolean DzButton::exclusiveToggle

Deprecated:
This is always false.

Boolean DzButton::on

Deprecated:
This is always false.

const QPixmap * DzButton::pixmap

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.

QString DzButton::text

The text displayed on the button. undefined by default. An ampersand (&) in the String automacitally 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 DzButton::toggleButton

Whether the button is a toggle (read-only). false by default.

ToggleState DzButton::toggleState

Deprecated:
Always returns NoChange. See DzCheckBox::checkState

int DzButton::toggleType

Deprecated:
Always returns SingleShot. See DzCheckBox::tristate


Generated on Thu Sep 24 12:21:11 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.