Difference between revisions of "LGUI2:button"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 29: Line 29:
 
[[Category:LavishGUI 2 Elements]]
 
[[Category:LavishGUI 2 Elements]]
 
[[Category:LavishGUI 2 Bordered Elements]]
 
[[Category:LavishGUI 2 Bordered Elements]]
 +
[[Category:LavishGUI 2 Content Container Elements]]

Revision as of 17:51, 26 June 2018

A LavishGUI 2 button element is a standard Content Container element, with the added behavior of accepting Keyboard Focus when clicked.

Defining a button element

A button element is a Content Container with no additional properties.

Clicks on buttons are handled with Event Handlers in the same way as clicks on all other elements. See Base Element events

Examples

A button element, with a 1 pixel thick white border around a black background containing a textblock.
When clicked, this button will execute the LavishScript code: MyController:HandleButton1
{
  "type": "button",
  "name": "button1",
  "content": "My border has some text!",
  "borderBrush": {
    "color": [ 1.0, 1.0, 1.0 ]
  },
  "backgroundBrush": {
    "color": [ 0, 0, 0 ]
  },
  "borderThickness": 1
  "eventHandlers": {
    "onMouseButtonMove": ["method","MyController","HandleButton1"]
    }
  }
}