List of all members | Public Member Functions | Public Attributes
Button Class Reference

stateless transient button. More...

+ Inheritance diagram for Button:

Public Member Functions

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

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
 
string dragAndDropFilepath
 file path that should be used for drag and drop
 
bool enabled
 boolean flag to enable / disable the widget
 
string font
 path to TrueType font
 
number fontSize
 font size
 
int height
 widget height in pixels
 
bool interceptsMouseClicks
 boolean flag to toggle mouse handling on widget
 
Mapper::Type mapper
 Mapper type, default is Mapper.Linear.
 
string name
 widget name
 
string normalImage
 image path for normal buttonState
 
string overImage
 image path for over buttonState
 
bool persistent
 flag to tell if the widget values should be serialized when saving. True by default. Persistent widgets will call their changed function on reload
 
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
 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.
 
Unit::Type unit
 Unit type, default is Unit.Generic.
 
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, mods)
print("button clicked:", mods.altDown)
end

Constructor & Destructor Documentation

Button::Button ( string  name)

creates a push button widget on the user inteface.

Parameters
namethe name to give to the widget

Member Function Documentation

void Button::push ( bool  callChangedCallback)

push the button!

Parameters
callChangedCallbacktrigger the button changed callback if true