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:
Inheritance graph
[legend]

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)
  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:
pState The state to be queried.
Returns:
The color vector.
SetStateColor ( FBButtonState  pState,
FBColor  pColor 
)

Returns whether or not the item pIndex is currently selected.

Parameters:
pState The state to be set.
pColor The desired color vector.
SetImageFileNames ( str  pUpImage,
str  pDownImage = 0,
str  pThirdImage = 0 
)

Sets the image used to generate a kFBBitmap2States.

Parameters:
pUpImage The image used when button is unpushed
pDownImage The image used when button is pushed
pThirdImage
HookToButton ( FBButton  pButton )

Sets a link to another button.

Parameters:
pButton Target 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