Rows
The following is a mini GUI that:
- creates a Window, with a minimal Menu and a shut-down callback
- places a simple ROW container in the Window
- Adds to the ROW container three SOBs (selected because they have different sizes): label, ListView, push button
newscript
dim myWindow = sob (0, "add","window","Hello World")
function ClickMyWindow ( sobid )
sob ( myWindow, "delete")
quit
End function
sob ( myWindow , "ON" , "CLICK" , "ClickMyWindow" )
dim myMenuBar = sob (myWindow , "add" , "menu" , "bar" )
dim myMenuFile = sob (myMenuBar , "add" , "menu" , "Horizontal" , "File" )
dim myFileExit = sob ( myMenuFile , "add" , "menu" , "Vertical" , "Exit" )
sob ( myFileExit , "ON" , "CLICK" , "ClickMyWindow")
dim myContainer = sob ( myWindow , "add" , "CONTAINER" , "ROW")
sob ( myContainer, "add" ,"label" , "ROW" )
sob ( myContainer, "add" , "LISTVIEW"," ", 5,0x00800008 )
sob ( myContainer, "add" , "button" , "Push" , "Push button" )
sob ( myWindow, "SET" , "SHRINK" )
sob ( SOBSQLite, "SET", "SHOW", 0 )
The following screenshot shows the resulting GUI.
There are 4 sets of rules that can be applied to a row based container:
Positioning:
- In all ROW based containers the children are placed sequentially in a row, with no overlaps, newest at the right.
Dimensions:
- ROW – no dimensioning rules imposed on the child object
- ROW .H – all child objects take the height of the tallest child object
- ROW .W – all child objects take the width of the widest child object
- ROW .HW – all child objects take the height of the tallest child object and of the widest child object
The following screenshot shows these rules applied to the same 3 child objects:
Functional specifications for row container related SOB commands:
Add – Container
SOB ( _
<Parent: number expression> ,_
"ADD" , _
"CONTAINER" , _"container type" , _
)
Where container type
(enclosed in a pair of "
) must be replaced by one of the following (case insensitive):
- row
- row.h
- row.w
- row.hw