Difference between revisions of "LGUI2:table"

From Lavish Software Wiki
Jump to navigation Jump to search
(Created page with "A LavishGUI 2 panel element is a specialized panel where the children are automatically arranged into a grid of rows and columns. == Defining a table ele...")
 
(No difference)

Latest revision as of 15:50, 23 November 2019

A LavishGUI 2 panel element is a specialized panel where the children are automatically arranged into a grid of rows and columns.


Defining a table element

A table element is defined like a panel, with additional properties for doing table things.

Each child of a table element may use metadata to specify its row/column placement in the table. See "Child Metadata", below.

table element properties
rows An array of row definitions (see "row", below)
columns An array of column definitions (see "column", below)
cellSpacing A size definition specifying the space between rows and columns
cellSpacingFactor A size definition specifying the space factor (a portion of the full table size) between rows and columns
autoFill An autoFill definition (see "autoFill", below)

row

row properties
height A number specifying the height of the row
heightFactor A number specifying the height factor (portion of the full table height)


column

column properties
width A number specifying the width of the column
widthFactor A number specifying the width factor (portion of the full table width)


autoFill

autoFill properties
firstRow An integer specifying the first row to use to auto-fill child elements into
lastRow An integer specifying the last row to use to auto-fill child elements into
firstColumn An integer specifying the first column to use to auto-fill child elements into
lastColumn An integer specifying the last column to use to auto-fill child elements into


Child Metadata

Each child of a table element may use metadata to specify its row/column placement in the table.

Child Metadata properties
row An integer specifying the element's row in the table
column An integer specifying the element's column in the table
rowSpan An integer specifying the number of rows to fill with this element (if not specified, 1 row is the default)
columnSpan An integer specifying the number of columns to fill with this element (if not specified, 1 column is the default)


Examples

Example 1

{
    "type":"table",
    "name": "mytable",
    "width":100,
    "height":100,
    "borderThickness":1,
    "borderBrush":{
        "color":"#cccccc"
    },
    "rows": [
        {                
            "heightFactor":0.5    
        },
        {                    
            "heightFactor":0.5    
        }
    ],
    "columns": [
        {
            "widthFactor":0.5    
        },
        {
            "widthFactor":0.5    
        }
    ],
    "children":[
        {
            "type":"textblock",
            "text": "Cell 1,1",
            "_row":1,
            "_column":1
        },
        {
            "type":"textblock",
            "text": "Cell 1,2",
            "_row":1,
            "_column":2
        },
        {
            "type":"textblock",
            "text": "Cell 2,1",
            "_row":2,
            "_column":1
        },
        {
            "type":"textblock",
            "text": "Cell 2,2",
            "_row":2,
            "_column":2
        }
    ]
}        

Table.png


LavishGUI 2 Element Types

LavishGUI 2 LavishScript Object Types

Core API (see Using LavishGUI 2 from LavishScript)
lgui2 - lgui2animateargs - lgui2animationtype - lgui2elementref - lgui2eventargs - lgui2eventhandler - lgui2elementtype - lgui2itemviewgeneratorargs - lgui2inputbinding - lgui2layer - lgui2skin - lgui2trigger
Enums
elgui2animationframestate - elgui2dpad - elgui2edge - elgui2fontflags - elgui2horizontalalignment - elgui2imageorientation - elgui2progresstext - elgui2scrollbar - elgui2sizetocontent - elgui2verticalignment - elgui2visibility
Element Components
lgui2animation - lgui2brush - lgui2fontstyle - lgui2margins - lgui2item - lgui2property - lgui2radialitem - lgui2radialgaugeneedle
Element Base Types
lgui2element - lgui2bordered - lgui2contentbase - lgui2headeredcontentbase - lgui2itemlist
Elements