Difference between revisions of "LGUI2:Content Containers"

From Lavish Software Wiki
Jump to navigation Jump to search
(Created page with "A LavishGUI 2 Content Container is a common base for a wide range of LGUI2:Elements, but is not itself a type of element. A Content Container has a LGUI2:Border, a ...")
 
Line 31: Line 31:
 
   "type": "button",
 
   "type": "button",
 
   "name": "button1",
 
   "name": "button1",
   "content": "My border has some text!",
+
   "content": "My button has some text!",
 
   "borderBrush": {
 
   "borderBrush": {
 
     "color": [ 1.0, 1.0, 1.0 ]
 
     "color": [ 1.0, 1.0, 1.0 ]

Revision as of 17:50, 26 June 2018

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"]
    }
  }
}