SOB – c – Container – Columns

Column

The following is a mini GUI that:

  • creates a Window, with a minimal Menu and a shut-down callback
  • places a simple COLUMN container in the Window
  • Adds to the COLUMN 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" , "COLUMN")
sob ( myContainer, "add" ,"label" , "COLUMN" )
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 column based container:

Positioning:

  • In all COLUMN based containers the children are placed sequentially in a column, with no overlaps, newest at the bottom

Dimensions:

  • COLUMN – no dimensioning rules imposed on the child object
  • COLUMN.H – all child objects take the height of the tallest child object
  • COLUMN.W – all child objects take the width of the widest child object
  • COLUMN.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 column 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):

  • column
  • column.h
  • column.w
  • column.hw