Public Member Functions | Public Attributes

Button Class Reference
[User Interface]

stateless transient button. More...

Inheritance diagram for Button:
Widget

List of all members.

Public Member Functions

 Button (string name)
 creates a push button widget on the user inteface.
 push (bool callChangedCallback)
 push the button!

Public Attributes

number alpha
 transparency value between 0.0 and 1.0
string backgroundColourOff
 background colour Off: colour string that defines the desired colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
string backgroundColourOn
 background colour On: colour string that defines the desired colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
table bounds
 widget bounding rect {x,y,width,height}
function changed
 callback function used by child widgets to be notified of changes
string displayName
 widget display name
bool enabled
 boolean flag to enable / disable the widget
int height
 widget height in pixels
string name
 widget name
string normalImage
 image path for normal buttonState
bool persistent
 flag to tell if the widget values should be serialized when saving
table position
 widget position {x,y}
string pressedImage
 image path for pressed buttonState
bool showLabel
 show widgets label if any
table size
 widget size {width, height}
string textColourOff
 textColour Off: colour string that defines the desired colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
string textColourOn
 textColour On: colour string that defines the desired colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
string tooltip
 widget tooltip, default is name
bool triggeredOnMouseDown
 triggeredOnMouseDown: Sets whether the button click should happen when the mouse is pressed or released. By default the button is only considered to have been clicked when the mouse is released
bool visible
 boolean flag to toggle widget visibility
int width
 widget width in pixels
int x
 x position in pixels
int y
 y position in pixels

Detailed Description

stateless transient button.

creates a push button widget on the user inteface.

 b = Button("button")
 b.backgroundColourOff = "darkgrey"
 b.backgroundColourOn = "darkred"
 b.textColourOff = "white"
 b.textColourOn = "white"
 b.changed = function(self)
 print("button clicked:")
 end

Constructor & Destructor Documentation

Button::Button ( string  name  ) 

creates a push button widget on the user inteface.

Parameters:
name the name to give to the widget

Member Function Documentation

Button::push ( bool  callChangedCallback  ) 

push the button!

Parameters:
callChangedCallback call the changed callback function if true