LGUI2:dockpanel

From Lavish Software Wiki
Revision as of 01:00, 27 June 2018 by Lax (talk | contribs)
Jump to navigation Jump to search

A LavishGUI 2 dockpanel element is a specialized panel where the children are automatically "docked" to a specified edge.

Defining a panel element

A dockpanel element is defined like a panel, and has no additional properties.

However, all children of a dockpanel may have a "dock" metadata property with one of the following values: "left" "top" "right" "bottom". Note that metadata properties defined in JSON are prefixed with an underscore "_" so a typical usage looks like this

"_dock":"bottom"

Examples

From DefaultSkin.json
"window.titleBar": {
  "type": "dockpanel",
  "children": [      
    {
      "type": "button",
      "_dock": "right",
      "borderThickness": 1,
      "borderColor": [ 1, 1, 1, 1 ],
      "content": "x",
      "padding": 3,
      "onMouseButtonMove": {
        "type": "forward",
        "elementType": "window",
        "event": "onCloseButtonClick"
      }
    },
    {
      "type": "button",
      "_dock": "right",
      "borderThickness": 1,
      "borderColor": [ 1, 1, 1, 1 ],
      "content": "_",
      "padding": 3,
      "onMouseButtonMove": {
        "type": "forward",
        "elementType": "window",
        "event": "onShadeButtonClick"
      }
    }
  ],
}