LGUI2:Content Containers

From Lavish Software Wiki
Revision as of 17:52, 26 June 2018 by Lax (talk | contribs)
Jump to navigation Jump to search

A LavishGUI 2 Content Container is a common base for a wide range of Elements, but is not itself a type of element.

A Content Container has a Border, a "contentContainer" element, and a "content" element. The Content Container will place the "contentContainer" inside the Border, and the "content" inside the "contentContainer".

Defining a Content Container

A Content Container uses standard Element and Border properties, with the addition of a "contentContainer" element and a "content" element.

Content Container properties
content A Element definition specifying the actual content for the control
contentContainer A Element definition specifying the container to place the content in. If not given, a panel will be used.
borderBrush A Brush definition specifying the brush for the standard Border
backgroundBrush A Brush definition specifying the brush for the background inside the Border
borderThickness A Thickness definition specifying the thickness for the standard Border

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 button has some text!",
  "borderBrush": {
    "color": [ 1.0, 1.0, 1.0 ]
  },
  "backgroundBrush": {
    "color": [ 0, 0, 0 ]
  },
  "borderThickness": 1
  "eventHandlers": {
    "onMouseButtonMove": ["method","MyController","HandleButton1"]
    }
  }
}