| SAT Demo2 Application - displayhost |
|
| Home | SATGUI | SATSHELL | SATFORM | SATFILTER | SATREPORT | SATMYSQL | License | Download | Examples | Contact |
| Source Code |
newScreen {{"Display Host"} 62x22 display}
addData {updated}
addEntries {1,1
{9,15 {-Host} {-Serial_No} {-Company} {-Model} {OS focus}}
{11,8 {Processors int} {Speed_MHz int} {Memory_Mb int} {} {IP_Address 16 ip}}
}
addBorder {Disks 1,12 60x0 title}
addMultiList {disk 1,13 6 {ID,16 Size,8,numeric Type,6} copy(disk:id,disk:size,type) outline yscroll}
addEntries {40,13
{6,10 {disk:ID alphanum} {disk:Size num}}
}
addRadioButtons {Type 40,18 {+SCSI IDE} outline title}
| Comments |
This SAT/DL screen displays all details for the selected host.
newScreen {{"Display Host"} 62x22 display}
Clear the screen/message line, set the application screen size to 62 characters by 22 rows,
set the window title to "Display Host", and set the current Group to display.
If this screen was to be called from main only it would not be necessary to set the size, however it can also be called by addhost which is smaller.
addData {updated}
Add a data item called updated. The value of the "updated" column from the
host entry in the database is stored here. This field is used to provide a simple locking
mechinism (See displaysave).
addEntries {1,1
{9,15 {-Host} {-Serial_No} {-Company} {-Model} {OS focus}}
{11,8 {Processors int} {Speed_MHz int} {Memory_Mb int} {} {IP_Address 16 ip}}
}
Add two columns of entry fields with its top left corner at column 1, row 1.
The first column has a label text width of 9 characters and a default entry width of
15 characters. The second column has a label text width of 11 characters and
a default entry width of 8 characters.
The names of the first four entry names in the first column are prefixed with "-". This causes the entries to be disabled (read only). The last ("OS") entry in the first column has the focus option set. This causes the cursor to appear in this entry. The first four entries in the second column have the int option set. These entries will be validated to check that the contents are an integer. The fourth entry is null, which leaves a one entry gap in the column. The last ("IP_Address") entry in the second column has an integer as the first option, which will override the default entry width. In this case it is set to 16 characters. The ip option will validate the entry to check that the contents match the pattern for an IP Address.
addBorder {Disks 1,12 60x0 title}
Add a border with its top left corner at column 1, row 12. The border is
60 characters wide and 0 rows deep. A border which is zero rows deep
is displayed as a horizontal line. The border, in this case a line, has the title
option set, which displays the name of the border (Disks) overlayed at its lefthand end.
addMultiList {disk 1,13 6 {ID,16 Size,8,numeric Type,6} copy(disk:id,disk:size,type) outline yscroll}
Add a multi-column list box called disk with its top left corner at column 1,
row 13 which is 6 lines deep. The list box has three columns: "ID"
(16 characters), "Size" (8 characters, with numeric justify),
and "Type" (6 characters). When a disk is selected by single or double-click
the copy option is invoked. In this case the first column is copied to the disk:id
entry, the second column to the disk:size entry and the third to the type
radio buttons. The list box has an outline and a vertical scrollbar (yscroll).
addEntries {40,13
{6,10 {disk:ID alphanum} {disk:Size num}}
}
Add a single column of entry fields with its top left corner at column 40, row 13,
with a default ("5") character gap between columns. The column has a label text width of 6
characters and a default entry width of 10 characters.
The first entry has the alphanum option set. This entry will be validated to check if the contents are alphanumeric. The second entry has the num option set. This entry will be validated to check if the contents are numeric.
When an item name contains ":" the characters to the left are the prefix (which is not displayed). The characters to the right are the actual label to be shown, if applicable. This allows more than one button to have the same visible name and, as in this case, to group items for validation purposes.
addRadioButtons {Type 40,18 {+SCSI IDE} outline title}
Add a group of radio buttons called Type with its top left corner at column 40,
row 18. The group has two buttons: SCSI and IDE. The "+"
prefix causes the SCSI button to be activated. The radio buttons have an outline
and the title option is set, which displays the name of the radio buttons (Type)
overlayed at its top left.