Core Function GUIDataGrid
(→Example) |
(→GetValue) |
||
Line 14: | Line 14: | ||
=== Functions === | === Functions === | ||
+ | |||
+ | ==== SelectionMode ==== | ||
+ | |||
+ | Change the selection mode | ||
+ | |||
+ | Allow all one type | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIDataGrid($GS, "SelectionMode", @CellSelect); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Allow all two types | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIDataGrid($GS, "SelectionMode", @CellSelect | @RowHeaderSelect); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Allow all types | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | GUIDataGrid($GS, "SelectionMode", | ||
+ | @CellSelect | | ||
+ | @FullColumnSelect | | ||
+ | @FullRowSelect | | ||
+ | @RowHeaderSelect | | ||
+ | @ColumnHeaderSelect); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Possible types are: | ||
+ | <pre> | ||
+ | @CellSelect | ||
+ | @FullColumnSelect | ||
+ | @FullRowSelect | ||
+ | @RowHeaderSelect | ||
+ | @ColumnHeaderSelect | ||
+ | </pre> | ||
==== GetValue ==== | ==== GetValue ==== |
Revision as of 03:33, 15 December 2011
GUIDataGrid( <datagrid> )
Contents |
Description
Properties & Functions specifically for DataGrid
Parameters
datagrid
The DataGrid GUI object to use.
Functions
SelectionMode
Change the selection mode
Allow all one type
GUIDataGrid($GS, "SelectionMode", @CellSelect);
Allow all two types
GUIDataGrid($GS, "SelectionMode", @CellSelect | @RowHeaderSelect);
Allow all types
GUIDataGrid($GS, "SelectionMode", @CellSelect | @FullColumnSelect | @FullRowSelect | @RowHeaderSelect | @ColumnHeaderSelect);
Possible types are:
@CellSelect @FullColumnSelect @FullRowSelect @RowHeaderSelect @ColumnHeaderSelect
GetValue
Get a value at a given Column, Row
$k = 0; For($j = 0; $j < $RowCount; $j++) { For($i = 0; $i < $ColumnCount; $i++) { $Data = GUIDataGrid($GS, "GetValue", $i, $j); println("Col '$i' ROW '$j' DATA '$Data'"); $k++; } }
SetValue
Set a value at a given Column, Row
$k = 0; For($j = 0; $j < $RowCount; $j++) { For($i = 0; $i < $ColumnCount; $i++) { GUIDataGrid($GS, "SetValue", $i, $j, "Meows $i, $j"); $k++; } }
Clear
Delete all rows and columns
GUIDataGrid($GS, "Clear");
AddColumn
Add a column to the end
GUIDataGrid($GS, "AddColumn", "Four");
InsertColumn
Add a column at a given location
GUIDataGrid($GS, "InsertColumn", 0, "Zero");
DelColumn
Delete a column by name
GUIDataGrid($GS, "DelColumn", "Two");
DelColumnAt
Delete a column at a given location
GUIDataGrid($GS, "DelColumnAt", 0);
ClearColumns
Delete all columns
GUIDataGrid($GS, "ClearColumns");
GetColumns
Get array of all Column names
$Columns = GUIDataGrid($GS, "GetColumns");
Columns
Get Column count
$ColumnCount = GUIDataGrid($GS, "Columns");
SetColumns
Set the columns to all names in array
GUIDataGrid($GS, "SetColumns", array("One", "Two", "Three"));
AddRow
Add a Row to the end (Array UBound must be equal to number of columns)
GUIDataGrid($GS, "AddRow", array(1, 2, 3));
InsertRow
Insert a Row at a given location (Array UBound must be equal to number of columns)
GUIDataGrid($GS, "InsertRow", 4, array("ONE", "TWO", "THREE"));
DelRow
Delete a given Row at a given location
GUIDataGrid($GS, "DelRow", 0);
ClearRows
Delete all rows
GUIDataGrid($GS, "ClearRows");
Rows
Get Row count
$RowCount = GUIDataGrid($GS, "Rows");
Example
Go see GUICreate( "DataGrid" ) for example.