FBButton Class Reference


Detailed Description

Used to create and manage buttons in a user interface.

This class includes functionality to create buttons in a user interface and add a callback. In MotionBuilder, buttons are created within regions, which are in turn created in layouts with FBLayout. For usage, see the Python sample Button.py. See also: FBButtonStyle, FBTextJustify, FBButtonLook.

Examples
UI/Button.py, UI/Popup.py, UI/RadioButton.py
Inheritance diagram for FBButton:

List of all members.

Public Member Functions

 __init__ ()
 Constructor.
FBColor GetStateColor (FBButtonState pState)
 Queries the color associated with a button state.
 SetStateColor (FBButtonState pState, FBColor pColor)
 Returns whether or not the item pIndex is currently selected.
 SetImageFileNames (str pUpImage, str pDownImage=0, str pThirdImage=0, bool pFromResources=False)
 Sets the image used to generate a kFBBitmap2States.
 HookToButton (FBButton pButton)
 Sets a link to another button.

Public Attributes

FBPropertyBase State
 Read Write Property: Current state of button.
FBPropertyButtonStyle Style
 Read Write Property: Button style.
FBPropertyTextJustify Justify
 Read Write Property: Current state of button.
FBPropertyButtonLook Look
 Read Write Property: Current state of button.
FBPropertyEvent OnClick
 Event: Button clicked.
FBPropertyEvent OnDragAndDrop
 Event: Something was dragged.

Member Function Documentation

FBColor GetStateColor ( FBButtonState  pState)

Queries the color associated with a button state.

This method is only useful for buttons of style kFB2States.

Parameters:
pStateThe state to be queried.
Returns:
The color vector.
SetStateColor ( FBButtonState  pState,
FBColor  pColor 
)

Returns whether or not the item pIndex is currently selected.

Parameters:
pStateThe state to be set.
pColorThe desired color vector.
SetImageFileNames ( str  pUpImage,
str  pDownImage = 0,
str  pThirdImage = 0,
bool  pFromResources = False 
)

Sets the image used to generate a kFBBitmap2States.

Parameters:
pUpImageThe image used when button is unpushed
pDownImageThe image used when button is pushed
pThirdImage
pFromResourcesAdd resource path to image path.
HookToButton ( FBButton  pButton)

Sets a link to another button.

Parameters:
pButtonTarget button

Member Data Documentation

FBPropertyBase State

Read Write Property: Current state of button.

FBPropertyButtonStyle Style

Read Write Property: Button style.

FBPropertyTextJustify Justify

Read Write Property: Current state of button.

FBPropertyButtonLook Look

Read Write Property: Current state of button.

FBPropertyEvent OnClick

Event: Button clicked.

FBPropertyEvent OnDragAndDrop

Event: Something was dragged.


FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton
FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton FBButton