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 ...")
 
m (Lax moved page LGUI2:Content Container to LGUI2:Content Containers over redirect)
 
(4 intermediate revisions by the same user not shown)
Line 26: Line 26:
  
 
== Examples ==
 
== Examples ==
; A button element, with a 1 pixel thick white border around a black background containing a textblock.  
+
; A [[LGUI2:button|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: <tt>MyController:HandleButton1</tt>
 
: When clicked, this button will execute the [[LavishScript]] code: <tt>MyController:HandleButton1</tt>
 
  {
 
  {
 
   "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 ]
Line 45: Line 45:
 
  }
 
  }
  
 
+
{{LGUI2:Topic}}
 
[[Category:LavishGUI 2]]
 
[[Category:LavishGUI 2]]
 
[[Category:LavishGUI 2 Elements]]
 
[[Category:LavishGUI 2 Elements]]
 
[[Category:LavishGUI 2 Bordered Elements]]
 
[[Category:LavishGUI 2 Bordered Elements]]
 +
[[Category:LavishGUI 2 Content Container Elements]]

Latest revision as of 18:49, 16 July 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"]
    }
  }
}

LavishGUI 2 Topics