Grid
A spreadsheet-style data grid with fixed header rows, HTML-formatted cells, in-cell
graphics (check boxes, progress bars, ratings), per-column formats and editors, sorting, filtering, grouping,
merged cells, import/export (CSV, XML, HTML, JSON, Excel) and printing. Cells are addressed by column and row,
both zero-based; row 0 is the header row.
sgGridCreate "GridBooks" "11" "7" "1"
sgGridLoadCSV "GridBooks" "[PubDir]books.csv"
sgGridSort "GridBooks" "4" "Descending"
Grid Setup
| Command | Purpose |
|---|
sgGridCreate | Attach a grid to a Rectangle object. |
sgGridDelete | Remove a grid from a Rectangle object. |
sgGridClear | Clear the grid contents without destroying the grid. |
sgGridSetSize | Change the number of rows and columns. |
sgGridStyle | Apply a visual style (Office, Windows...) or a .gp style file. |
sgGridCreateID 1
Attach a grid to a Rectangle object.
Rows and columns include the fixed header row. Style the grid afterwards with sgGridStyle and sgGridColumnFormat.
sgGridCreate "Rectangle" "Number of rows" "Number of columns" "Fixed header rows"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Attach the grid to this Rectangle object | Rectangle object | | |
| 2 | Number of rows (including the header) | number | 10 | 5, 10, 20, 50, 100 |
| 3 | Number of columns | number | 5 | 2, 3, 4, 5, 6, 8, 10 |
| 4 | Fixed header rows | number | 1 | 0, 1, 2 |
Creating a grid on a Rectangle that already has one replaces it.
Example (from the demo)sgGridCreate "[sgRect]" "11" "7" "1"
Top
sgGridDeleteID 2
Remove a grid from a Rectangle object.
sgGridDelete "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
Example (from the demo)sgGridDelete "GridSetup"
Top
sgGridClearID 3
Clear the grid contents without destroying the grid.
sgGridClear "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
Example (from the demo)sgGridClear "GridSetup"
Top
sgGridSetSizeID 11
Change the number of rows and columns.
sgGridSetSize "Rectangle" "Number of rows" "Number of columns"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Number of rows | number | 10 | 5, 10, 20, 50, 100 |
| 3 | Number of columns | number | 5 | 2, 3, 4, 5, 6, 8, 10 |
Example (from the demo)sgGridSetSize "GridSetup" "20" "9"
Top
sgGridStyleID 22
Apply a visual style (Office, Windows...) or a .gp style file.
tsXXX names call SetComponentStyle, glXXX names set Look, a file name loads visual properties.
sgGridStyle "Rectangle" "Style or style file"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Style or style file | choice | tsOffice2019White | names listed in the editor dialog |
Example (from the demo)sgGridStyle "GridSetup" "tsOffice2007Luna"
Top
Cell Data
sgGridSetCellID 4
Set the text of a grid cell.
Column and row are 0-based; row 0 is the header. The value may contain HTML tags (<b>, <font color="clRed">, <a href="...">).
sgGridSetCell "Rectangle" "Column" "Row" "Cell text"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column | number | 1 | 0, 1, 2, 3, 4, 5 |
| 3 | Row | number | 1 | 0, 1, 2, 3, 4, 5 |
| 4 | Cell text | text | | |
Example (from the demo)sgGridSetCell "GridData" "1" "1" "<b>Colon</b> <font color='clRed'>Classification</font>"
Top
sgGridGetCellID 5
Copy the text of a grid cell into a variable.
sgGridGetCell "Rectangle" "Column" "Row" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column | number | 1 | 0, 1, 2, 3, 4, 5 |
| 3 | Row | number | 1 | 0, 1, 2, 3, 4, 5 |
| 4 | Store the cell text in this variable | variable | [CellText] | |
Example (from the demo)sgGridGetCell "GridData" "1" "3" "[sgValue]"
Top
sgGridSetRowID 38
Fill a row from a list of values.
Row "new" appends a row; its index is stored in [sgGrid_LastRow].
sgGridSetRow "Rectangle" "Row" "Values" "Separator" "First column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Row (or new) | text | new | new, 1, 2, 3 |
| 3 | Values | text | a|b|c | |
| 4 | Separator | text | | | names listed in the editor dialog |
| 5 | First column | text | | 0, 1 |
Example (from the demo)sgGridSetRow "GridData" "new" "11|Ranganathan for Librarians|N N Gidwani|Biography|1992|1|350" "|" "0"
Top
sgGridGetRowID 39
Read a row as a delimited list.
sgGridGetRow "Rectangle" "Row" "[variable]" "Separator" "First column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Row | number | 1 | 0, 1, 2, 3 |
| 3 | Store the row in this variable | variable | [sgGridRowText] | |
| 4 | Separator | text | | | names listed in the editor dialog |
| 5 | First column | text | 0 | 0, 1 |
Example (from the demo)sgGridGetRow "GridData" "3" "[sgValue]" " / " "0"
Top
sgGridLoadTextID 40
Load delimited text (e.g. from a variable) into the grid.
One line per row. Quoted fields are supported.
sgGridLoadText "Rectangle" "Text" "Delimiter" "First row" "First column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Text | text | [MyData] | |
| 3 | Delimiter | text | , | names listed in the editor dialog |
| 4 | First row | text | | 0, 1 |
| 5 | First column | text | | 0, 1 |
Example (from the demo)sgGridLoadText "[sgRect]" "[sgData]" "," "0" "0"
Top
sgGridGetTextID 41
Copy all grid text into a variable as delimited text.
sgGridGetText "Rectangle" "[variable]" "Delimiter" "First row"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Store the text in this variable | variable | [sgGridText] | |
| 3 | Delimiter | text | , | names listed in the editor dialog |
| 4 | First row | text | 0 | 0, 1 |
Example (from the demo)sgGridGetText "GridData" "[sgValue]" "," "0"
Top
sgGridFindID 8
Find text and return its column and row.
The first matching cell is focused. -1 is returned when nothing is found.
sgGridFind "Rectangle" "Text to find" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Text to find | text | | |
| 3 | Store the column in this variable | variable | [FoundCol] | |
| 4 | Store the row in this variable | variable | [FoundRow] | |
Example (from the demo)sgGridFind "GridData" "Ranganathan" "[sgCol]" "[sgRow]"
Top
Rows and Columns
sgGridAddRowID 6
Insert a row at a position, or append one (-1).
sgGridAddRow "Rectangle" "Insert before row"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Insert before row (-1 = append at the end) | number | -1 | -1, 1, 2, 3 |
Example (from the demo)sgGridAddRow "GridRows" "2"
Top
sgGridDeleteRowID 7
Delete a non-fixed row.
sgGridDeleteRow "Rectangle" "Row to delete"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Row to delete | number | 1 | 1, 2, 3 |
Example (from the demo)sgGridDeleteRow "GridRows" "2"
Top
sgGridRowsColsID 46
Insert, remove, move or swap rows and columns.
InsertRows Index|Count, RemoveRows Index|Count, MoveRow From|To, MoveRows From|To|Count, SwapColumns A|B. AddRow and RemoveSelectedRows need no arguments.
sgGridRowsCols "Rectangle" "Operation" "Argument 1" "Argument 2" "Argument 3"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | InsertRows | InsertRows, RemoveRows, InsertCols, RemoveCols, MoveRow, MoveRows, MoveColumn, SwapRows, SwapColumns, AddRow, InsertChildRow, RemoveChildRow, RemoveSelectedRows, RemoveUnSelectedRows |
| 3 | Argument 1 (index / from) | text | 1 | |
| 4 | Argument 2 (count / to) | text | 1 | |
| 5 | Argument 3 (count) | text | | |
Example (from the demo)sgGridRowsCols "GridRows" "InsertRows" "3" "2" ""
Top
sgGridHideID 29
Hide or show columns and rows.
From/To are column or row indexes (To defaults to From).
sgGridHide "Rectangle" "What" "From" "To" "Action"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | What | choice | Columns | Columns, Rows, AllColumns, AllRows, SelectedRows, UnselectedRows |
| 3 | From | text | 1 | 1, 2, 3 |
| 4 | To | text | | 1, 2, 3, 5 |
| 5 | Action | choice | Hide | Hide, Unhide |
Example (from the demo)sgGridHide "GridRows" "Columns" "6" "6" "Hide"
Top
sgGridAutoSizeID 47
Auto-size or auto-number columns and rows.
sgGridAutoSize "Rectangle" "Operation" "Column / row index" "Padding"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | Columns | Columns, ColumnsWithFixed, Col, Rows, Row, GrowColumns, FitColumns, Stretch, NumberCol, NumberRow |
| 3 | Column / row index | text | | 0, 1, 2, 3 |
| 4 | Padding (pixels) | text | 4 | 0, 2, 4, 8, 10, 16 |
Example (from the demo)sgGridAutoSize "[sgRect]" "Columns" "" "12"
Top
sgGridMergeID 27
Merge or split cells.
Span 1 x 1 splits the cell. Column "all" splits every cell. Span X "auto" merges equal cells in the column, Span Y "auto" merges equal cells in the row.
sgGridMerge "Rectangle" "Column" "Row" "Span X" "Span Y"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column | text | 1 | 1, 2, 3, all |
| 3 | Row | text | 1 | 0, 1, 2, 3 |
| 4 | Span X (columns) | text | 2 | 1, 2, 3, 4, auto |
| 5 | Span Y (rows) | text | 1 | 1, 2, 3, auto |
Example (from the demo)sgGridMerge "GridRows" "3" "1" "1" "3"
Top
sgGridNodeID 28
Add, remove, expand or contract row nodes.
Span 0 spans up to the next node.
sgGridNode "Rectangle" "Operation" "Row" "Span"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | Add | Add, Remove, Expand, Contract, ExpandAll, ContractAll |
| 3 | Row | number | 1 | 1, 2, 3 |
| 4 | Span (rows) | number | 0 | 0, 2, 3, 5, 10 |
Example (from the demo)sgGridNode "GridRows" "Add" "1" "3"
Top
| Command | Purpose |
|---|
sgGridCellStyle | Colour, font and alignment of cells. |
sgGridCellGraphic | Add checkboxes, buttons, progress bars, pictures... to cells. |
sgGridColumnFormat | Width, header, alignment, read-only, sort and number format of columns. |
sgGridColumnEditor | Inplace editor type for columns (combo, spin, date, colour picker...). |
sgGridHighlight | Highlight or error-mark text in cells. |
sgGridCellStyleID 18
Colour, font and alignment of cells.
Leave a field empty to keep it unchanged; "none" resets a colour.
sgGridCellStyle "Rectangle" "Column(s)" "Row(s)" "Background colour" "Font colour" "Font style" "Font size" "Font name" "Alignment"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column(s) | text | 1 | 1, 2, 3, 4, 5, *, all, 1-3, 1,3 |
| 3 | Row(s) | text | 1 | 1, 2, 3, *, all, 1-10 |
| 4 | Background colour | colour | | |
| 5 | Font colour | colour | | |
| 6 | Font style | choice | | [fsBold], [fsItalic], [fsUnderline], [fsStrikeOut], [fsBold,fsItalic], none |
| 7 | Font size | text | | 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 36 |
| 8 | Font name | font | | |
| 9 | Alignment | choice | | left, center, right, none |
Example (from the demo)sgGridCellStyle "GridLook" "all" "0" "#1F3A5F" "clWhite" "[fsBold]" "" "" "center"
Top
sgGridCellGraphicID 19
Add checkboxes, buttons, progress bars, pictures... to cells.
The argument list shows examples for the selected graphic. Arguments are optional and separated by |; empty positions keep their defaults.
sgGridCellGraphic "Rectangle" "Graphic" "Column(s)" "Row(s)" "Arguments"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Graphic | choice | Checkbox | Checkbox, DataCheckbox, TriStateCheckbox, CheckboxColumn, TriStateCheckboxColumn, Radio, RadioButton, RadioButtonColumn, Button, Progress, ProgressEx, ProgressFormatted, AdvProgress, ProgressPie … |
| 3 | Column(s) | text | 1 | 1, 2, 3, 4, 5, *, all, 1-3, 1,3 |
| 4 | Row(s) | text | * | 1, 2, 3, *, all, 1-10 |
| 5 | Arguments | choice | | |
Example (from the demo)sgGridCellGraphic "GridLook" "Progress" "5" "*" "clLime|clWhite"
Top
sgGridColumnFormatID 20
Width, header, alignment, read-only, sort and number format of columns.
Leave a field empty to keep it; "none" clears it. Width "auto" fits the text. Float format uses Delphi Format(): %.2f, %.0n, %.2m.
sgGridColumnFormat "Rectangle" "Column(s)" "Width" "Header text" "Alignment" "Read-only" "Sort style" "Float format" "Background colour" "Font colour"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column(s) | text | 1 | 1, 2, 3, 4, 5, *, all, 1-3, 1,3 |
| 3 | Width | text | | auto, 40, 64, 80, 100, 120, 150, 200, 250, 300 |
| 4 | Header text | text | | |
| 5 | Alignment | choice | | left, center, right, none |
| 6 | Read-only | True/False | | |
| 7 | Sort style | choice | | names listed in the editor dialog |
| 8 | Float format | text | | %.0f, %.1f, %.2f, %.3f, %.0n, %.2n, %.2m, %d, %e, none |
| 9 | Background colour | colour | | |
| 10 | Font colour | colour | | |
Example (from the demo)sgGridColumnFormat "GridLook" "6" "auto" "Price (Rs)" "right" "False" "ssNumeric" "%.2f" "" "clNavy"
Top
sgGridColumnEditorID 21
Inplace editor type for columns (combo, spin, date, colour picker...).
Items for combo/list editors are separated by |. The options list follows the selected editor (Name=Value pairs applied when editing starts). Editing is switched on automatically.
sgGridColumnEditor "Rectangle" "Column(s)" "Editor" "Items" "Options"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column(s) | text | 1 | 1, 2, 3, 4, 5, *, all, 1-3, 1,3 |
| 3 | Editor | choice | edComboList | names listed in the editor dialog |
| 4 | Items (a|b|c) | text | | |
| 5 | Options | choice | | |
Example (from the demo)sgGridColumnEditor "GridLook" "3" "edComboList" "Classification|Cataloguing|Metadata|Retrieval|Technology|Philosophy" ""
Top
sgGridHighlightID 43
Highlight or error-mark text in cells.
Index: column or row number, or col,row for a single cell.
sgGridHighlight "Rectangle" "Mode" "Text" "Scope" "Index" "Match case"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Mode | choice | Hilight | Hilight, UnHilight, Mark, UnMark, RemoveAllMarkers |
| 3 | Text | text | | |
| 4 | Scope | choice | Grid | Grid, Column, Row, Cell |
| 5 | Index | text | | 1, 2, 3, 1,1 |
| 6 | Match case | True/False | False | |
Example (from the demo)sgGridHighlight "GridLook" "Hilight" "Classification" "Grid" "" "False"
Top
Sort, Filter and Group
sgGridSortID 23
Sort on one or more columns.
Several columns: 2,1 with directions Descending,Ascending. "Unsort" restores the order.
sgGridSort "Rectangle" "Column(s)" "Direction"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column(s) | text | 1 | 1, 2, 3, 4, 5, 1,2, 2,1 |
| 3 | Direction | choice | Ascending | Ascending, Descending, Toggle, Unsort, Descending,Ascending |
Example (from the demo)sgGridSort "GridSort" "1" "Ascending"
Top
sgGridFilterID 24
Filter rows on a column condition.
Conditions: >20, <=5, A*, !A*, =text, >10 & <20 (AND), <0 ^ >100 (OR). Column * = match anywhere in the row. Each call adds a condition; an empty condition removes all filtering.
sgGridFilter "Rectangle" "Column" "Condition" "Operation" "Case sensitive"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column (* = whole row) | text | 1 | *, 1, 2, 3, 4, 5 |
| 3 | Condition | text | | >0, <0, >=100, <=100, =Text, !Text, A*, !A*, *text*, >10 & <20, <0 ^ >100 |
| 4 | Operation | choice | | foAND, foOR, foXOR, foNONE |
| 5 | Case sensitive | True/False | False | |
Example (from the demo)sgGridFilter "GridSort" "4" ">1980" "" "False"
Top
sgGridNarrowDownID 25
Show only rows containing a text (incremental search).
Column -1 searches all columns. Empty text shows all rows again.
sgGridNarrowDown "Rectangle" "Text" "Column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Text | text | | |
| 3 | Column | number | -1 | -1, 1, 2, 3, 4, 5 |
Example (from the demo)sgGridNarrowDown "GridSort" "Library" "-1"
Top
sgGridGroupID 26
Group rows on a column (with optional sub-groups and group totals).
Columns: 1 or 1,2 (first = group, rest = sub-groups). 0 removes grouping.
sgGridGroup "Rectangle" "Group column(s)" "Calculation" "Calculation column(s)"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Group column(s) | text | 1 | 0, 1, 2, 3, 1,2 |
| 3 | Calculation | choice | | Sum, Avg, Min, Max, Count, Distinct, StdDev |
| 4 | Calculation column(s) | text | | 2, 3, 4, 2,3, * |
Example (from the demo)sgGridGroup "GridSort" "3" "Sum" "5"
Top
sgGridColumnCalcID 36
Sum, average, min, max... of a column.
From/To row -1 = all normal rows.
sgGridColumnCalc "Rectangle" "Column" "Function" "From row" "To row" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Column | number | 1 | 1, 2, 3, 4, 5 |
| 3 | Function | choice | Sum | Sum, Avg, Min, Max, Count, Distinct, StdDev |
| 4 | From row | number | -1 | -1, 1, 2 |
| 5 | To row | number | -1 | -1, 10, 20 |
| 6 | Store the result in this variable | variable | [sgGridValue] | |
Example (from the demo)sgGridColumnCalc "GridSort" "5" "Sum" "-1" "-1" "[sgValue]"
Top
Selection and Editing
sgGridSelectID 34
Select a cell or a range of cells.
Right/Bottom default to Left/Top.
sgGridSelect "Rectangle" "Left column" "Top row" "Right column" "Bottom row"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Left column | number | 1 | 0, 1, 2, 3 |
| 3 | Top row | number | 1 | 0, 1, 2, 3 |
| 4 | Right column | text | | 1, 2, 3, 4, 5 |
| 5 | Bottom row | text | | 1, 2, 3, 5, 10 |
Example (from the demo)sgGridSelect "GridSel" "1" "1" "3" "4"
Top
sgGridGetSelectionID 35
Read the selected range and its text.
Leave a variable empty to skip it.
sgGridGetSelection "Rectangle" "[variable]" "[variable]" "[variable]" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Store the left column in | variable | [SelLeft] | |
| 3 | Store the top row in | variable | [SelTop] | |
| 4 | Store the right column in | variable | [SelRight] | |
| 5 | Store the bottom row in | variable | [SelBottom] | |
| 6 | Store the selected text in | variable | [SelText] | |
Example (from the demo)sgGridGetSelection "GridSel" "[sgL]" "[sgT]" "[sgR]" "[sgB]" "[sgValue]"
Top
sgGridEditID 44
Start or stop inplace editing, or focus a cell.
sgGridEdit "Rectangle" "Operation" "Column" "Row"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | Start | Start, Stop, Focus |
| 3 | Column | number | 1 | 1, 2, 3 |
| 4 | Row | number | 1 | 1, 2, 3 |
Example (from the demo)sgGridEdit "GridSel" "Start" "2" "3"
Top
sgGridClipboardID 33
Copy, cut or paste grid cells.
sgGridClipboard "Rectangle" "Operation"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | CopySelection | Copy, CopySelection, CopyHTML, Cut, CutSelection, Paste, PasteSelection |
Example (from the demo)sgGridClipboard "GridSel" "CopySelection"
Top
Import, Export and Print
| Command | Purpose |
|---|
sgGridLoadCSV | Load grid data from a CSV file. |
sgGridSaveCSV | Save grid data to a CSV file. |
sgGridImport | Load the grid from CSV, XML, Excel, Access... |
sgGridExport | Save the grid as CSV, HTML, XML, JSON, ASCII, Word, Excel... |
sgGridPrint | Print the grid (all, selection, selected rows/columns). |
sgGridState | Save or restore column layout, sort, filter and visual settings. |
sgGridLoadCSVID 9
Load grid data from a CSV file.
sgGridLoadCSV "Rectangle" "CSV file to load"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | CSV file to load | file | | |
Example (from the demo)sgGridLoadCSV "GridIO" "[PubDir]books.csv"
Top
sgGridSaveCSVID 10
Save grid data to a CSV file.
sgGridSaveCSV "Rectangle" "Save to this CSV file"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Save to this CSV file | file | | |
Example (from the demo)sgGridSaveCSV "GridIO" "[PubDir]books.csv"
Top
sgGridImportID 31
Load the grid from CSV, XML, Excel, Access...
The option list follows the format: CSV delimiter, Excel sheet, Access table or SQL.
sgGridImport "Rectangle" "Format" "Load this file" "Option"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Format | choice | CSV | names listed in the editor dialog |
| 3 | Load this file | file | | |
| 4 | Option | choice | | |
Example (from the demo)sgGridImport "GridIO" "CSV" "[PubDir]books.csv" ","
Top
sgGridExportID 30
Save the grid as CSV, HTML, XML, JSON, ASCII, Word, Excel...
DOC and XLS use OLE automation and need Word/Excel installed. BIN keeps cell properties.
sgGridExport "Rectangle" "Format" "Save to this file"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Format | choice | CSV | names listed in the editor dialog |
| 3 | Save to this file | file | | |
Example (from the demo)sgGridExport "GridIO" "HTML" "[PubDir]books.html"
Top
sgGridPrintID 32
Print the grid (all, selection, selected rows/columns).
Further settings: sgGridSetProperty PrintSettings.Orientation, PrintSettings.FitToPage ...
sgGridPrint "Rectangle" "Print" "Title"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Print | choice | Print | names listed in the editor dialog |
| 3 | Title | text | | |
Example (from the demo)sgGridPrint "GridIO" "Print" "Library Catalogue - sgUIKit"
Top
sgGridStateID 45
Save or restore column layout, sort, filter and visual settings.
Save* operations return a string or write the file; Load* take the string or file.
sgGridState "Rectangle" "Operation" "Value or file" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Operation | choice | SaveColumns | SaveColumns, LoadColumns, SetColumnOrder, ResetColumnOrder, SaveSort, LoadSort, SaveFilter, LoadFilter, SaveVisual, LoadVisual |
| 3 | Value or file | text | | [sgGridState], C:\Data\grid.flt, C:\Data\style.gp |
| 4 | Store the result in this variable | variable | [sgGridState] | |
Example (from the demo)sgGridState "GridIO" "SaveColumns" "" "[sgLayout]"
Top
Advanced: Properties, Methods and Events
sgGridSetPropertyID 12
Set any grid property by name.
Nested: SortSettings.Show, Navigation.AllowInsertRow, Bands.Active, Font.Color. Indexed: Colors[2,3], FloatingFooter.ColumnCalc[2]. Sets: +goEditing, -goRowSelect, [goEditing,goColSizing]. Objects: Font = Name=Arial;Size=10. Lists: A|B|C. Pictures: a file name. The value list follows the selected property.
sgGridSetProperty "Rectangle" "Property" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Property (path) | choice | Options | names listed in the editor dialog |
| 3 | New value | choice | +goEditing | |
Example (from the demo)sgGridSetProperty "GridSort" "SortSettings.Show" "True"
Top
sgGridGetPropertyID 13
Read any grid property into a variable.
Same paths as sgGridSetProperty. A parameterless function name (e.g. GetVersionString, SelectedRowCount) also works.
sgGridGetProperty "Rectangle" "Property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Property (path) | choice | RowCount | names listed in the editor dialog |
| 3 | Store the value in this variable | variable | [sgGridValue] | |
Example (from the demo)sgGridGetProperty "GridAdv" "RowCount" "[sgValue]"
Top
sgGridSetCellPropertyID 16
Set an indexed cell property for a range of cells.
Columns/rows: 3, 1-5, 1,3,7, * (all normal), all. Examples: Colors=clYellow, FontStyles=[fsBold], ReadOnly=True, CellComment=Note, Alignments=taCenter.
sgGridSetCellProperty "Rectangle" "Cell property" "Column(s)" "Row(s)" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Cell property | choice | Colors | names listed in the editor dialog |
| 3 | Column(s) | text | 1 | 1, 2, 3, 4, 5, *, all, 1-3, 1,3 |
| 4 | Row(s) | text | 1 | 1, 2, 3, *, all, 1-10 |
| 5 | New value | choice | clYellow | |
Example (from the demo)sgGridSetCellProperty "GridAdv" "Colors" "2" "1-5" "clYellow"
Top
sgGridGetCellPropertyID 17
Read an indexed cell property into a variable.
Examples: Colors, FontStyles, Floats, Ints, Dates, StrippedCells, CellComment, ReadOnly.
sgGridGetCellProperty "Rectangle" "Cell property" "Column" "Row" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Cell property | choice | StrippedCells | names listed in the editor dialog |
| 3 | Column | number | 1 | 0, 1, 2, 3, 4, 5 |
| 4 | Row | number | 1 | 0, 1, 2, 3, 4, 5 |
| 5 | Store the value in this variable | variable | [sgGridValue] | |
Example (from the demo)sgGridGetCellProperty "GridAdv" "Floats" "6" "1" "[sgValue]"
Top
sgGridCallMethodID 14
Call any public grid method.
Arguments are separated by |. Pass every parameter (defaults are not filled in); the list shows the parameter names of the selected method. For var parameters pass a variable such as [State]. Examples: MergeCells 1|1|3|1, AddCheckBox 1|2|True|False.
sgGridCallMethod "Rectangle" "Method" "Arguments" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Method (path) | choice | AutoSizeColumns | names listed in the editor dialog |
| 3 | Arguments (a|b|c) | choice | False|4 | |
| 4 | Store the result in this variable | variable | [sgGridResult] | |
Example (from the demo)sgGridCallMethod "GridAdv" "ColumnSum" "6|1|10" "[sgValue]"
Top
sgGridOnEventID 15
Run a subroutine when a grid event fires.
Parameters arrive in [sgGrid_<Name>] (e.g. [sgGrid_ACol], [sgGrid_Value]) plus [sgGrid_Col], [sgGrid_Row], [sgGrid_Event], [sgGrid_Object], [sgGrid_Params]. Change var parameters (CanEdit, Valid, Value, Allow...) by setting the same variable. Leave the subroutine empty to unbind.
sgGridOnEvent "Rectangle" "Event" "Subroutine"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Event | choice | OnClickCell | names listed in the editor dialog |
| 3 | Run this subroutine | subroutine | | |
Parameters arrive in [sgGrid_<Name>]; var parameters (CanEdit, Allow ...) can be changed by the subroutine.
Example (from the demo)sgGridOnEvent "GridAdv" "OnAnchorClick" "sgOnAnchor"
Top
sgGridCollectionID 42
Work with collection properties (hover buttons, filters, dropdown columns...).
The values list follows the collection path. For Get, give the property name.
sgGridCollection "Rectangle" "Collection path" "Operation" "Item index" "Values / property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | Collection path | choice | HoverButtons.Buttons | HoverButtons.Buttons, Filter, GridDropDown.Columns, GridDropDown.Items, DetailPickerDropDown.Items |
| 3 | Operation | choice | Add | Add, Set, Get, Delete, Clear, Count |
| 4 | Item index | number | 0 | 0, 1, 2, 3 |
| 5 | Values / property | choice | Caption=Button | |
| 6 | Store the result in this variable | variable | [sgGridResult] | |
Example (from the demo)sgGridCollection "GridAdv" "HoverButtons.Buttons" "Clear" "0" "" ""
Top
sgGridListMembersID 48
List property, event or method names (for reference).
Path selects a sub-object, e.g. SortSettings or PrintSettings. "Bindings" lists bound events.
sgGridListMembers "Rectangle" "List" "Sub-object path" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the grid | Rectangle object | | |
| 2 | List | choice | Properties | Properties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings |
| 3 | Sub-object path | text | | SortSettings, PrintSettings, Navigation, MouseActions, ControlLook, Grouping, FloatingFooter, SearchFooter, Bands, Background, Balloon, FilterDropDown, FilterEdit, HTMLSettings … |
| 4 | Store the list in this variable | variable | [sgGridList] | |
Example (from the demo)sgGridListMembers "GridAdv" "Events" "" "[sgValue]"
Top
Tree view
A multi-column tree for hierarchies and outlines with check boxes, sorting, filtering and
editing. Nodes are addressed by a path of zero-based child indexes (0/1/2), =Text,
key:DBKey or row:N. sgTreeLoadText reads indented outlines or ID,ParentID,Text rows.
sgTreeCreate "TreeSubjects" "Subject|Books"
sgTreeAddNode "TreeSubjects" "" "Classification|3" "-1" "[sgNode]"
sgTreeExpand "TreeSubjects" "*" "Expand" "False"
sgTreeCreateID 200
Attach a tree view to a Rectangle object.
Column captions are separated by |, e.g. Title|Author|Year. Leave empty for a single column without a header. Any old tree on the same Rectangle is replaced.
sgTreeCreate "Rectangle" "Column captions"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object for the tree view | Rectangle object | | |
| 2 | Column captions (a|b|c) | choice | | Name, Title, Author, Year, Title, Author, Subject |
Example (from the demo)sgTreeCreate "GridTree" "Title|Author|Year"
Top
sgTreeDeleteID 201
Remove a tree view from a Rectangle object.
sgTreeDelete "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
Example (from the demo)sgTreeDelete "GridTree"
Top
sgTreeClearID 202
Remove nodes, columns or the filter.
sgTreeClear "Rectangle" "Clear"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Clear | choice | Nodes | Nodes, Columns, All, Filter |
Example (from the demo)sgTreeClear "GridTree" "Nodes"
Top
sgTreeAddColumnID 203
Add or insert a column.
Width 0 = automatic. Position -1 appends.
sgTreeAddColumn "Rectangle" "Caption" "Width" "Insert at position"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Caption | text | Column | |
| 3 | Width (0 = auto) | number | 0 | 0, 80, 100, 120, 150, 200, 250 |
| 4 | Insert at position (-1 = append) | number | -1 | -1, 0, 1, 2, 3 |
Example (from the demo)sgTreeAddColumn "GridTree" "Copies" "0" "-1"
Top
sgTreeColumnID 204
Set a column property, auto-size or delete a column.
Property may be any tree column property path (Width, Visible, HorizontalTextAlign, Font.Color, Sorting, Filtering.Enabled, EditorType ...) or the commands Delete / AutoSize.
sgTreeColumn "Rectangle" "Column" "Property or command" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Column (zero-based) | number | 0 | 0, 1, 2, 3, 4 |
| 3 | Property or command | choice | Width | Delete, AutoSize, Text, Width, Visible, HorizontalTextAlign, VerticalTextAlign, WordWrapping, Trimming, EditorType, EditorItems, Sorting, Filtering.Enabled, Expandable … |
| 4 | Value | choice | 150 | |
Example (from the demo)sgTreeColumn "GridTree" "0" "Width" "260"
Top
sgTreeAddNodeID 205
Add a node (root or child) and return its path.
Texts for several columns are separated by |. Parent empty = root node. Position -1 appends. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeAddNode "Rectangle" "Parent node" "Text" "Position" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Parent node (empty = root) | choice | | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Text (col0|col1|...) | text | New node | |
| 4 | Position (-1 = append) | number | -1 | -1, 0, 1, 2 |
| 5 | Store the new node path in | variable | [sgTreeNode] | |
Example (from the demo)sgTreeAddNode "GridTree" "0/0" "New book|Unknown author|2026" "-1" "[sgTreeNode]"
Top
sgTreeSetNodeTextID 206
Change the text of a node.
Column -1 sets every column from a | separated list. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeSetNodeText "Rectangle" "Node" "Column" "Text"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Column (-1 = all, a|b|c) | number | 0 | -1, 0, 1, 2, 3 |
| 4 | Text | text | | |
Example (from the demo)sgTreeSetNodeText "GridTree" "[sgTreeNode]" "0" "Renamed book"
Top
sgTreeGetNodeTextID 207
Read the text of a node into a variable.
Column -1 returns all columns separated by |. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeGetNodeText "Rectangle" "Node" "Column" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Column (-1 = all) | number | 0 | -1, 0, 1, 2, 3 |
| 4 | Store the text in | variable | [sgTreeText] | |
Example (from the demo)sgTreeGetNodeText "GridTree" "0/0/0" "-1" "[sgValue]"
Top
sgTreeDeleteNodeID 208
Delete a node, or only its children.
Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeDeleteNode "Rectangle" "Node" "Delete only the children"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Delete only the children | True/False | False | False, True |
Example (from the demo)sgTreeDeleteNode "GridTree" "[sgTreeNode]" "False"
Top
sgTreeMoveNodeID 209
Move or copy a node under another parent.
Destination empty = root level. Position -1 = last. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeMoveNode "Rectangle" "Node" "Destination parent" "Position" "Mode" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0/0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Destination parent (empty = root) | choice | 1 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 4 | Position (-1 = last) | number | -1 | -1, 0, 1, 2 |
| 5 | Mode | choice | Move | Move, Copy |
| 6 | Store the resulting node path in | variable | [sgTreeNode] | |
Example (from the demo)sgTreeMoveNode "GridTree" "0/1" "1" "-1" "Move" "[sgTreeNode]"
Top
sgTreeFindNodeID 210
Find a node by text and return its path.
Options: Exact (default) or Contains, add Case for case-sensitive, add All to return every match (one path per line). Empty result when nothing matches.
sgTreeFindNode "Rectangle" "Text to find" "Column" "Options" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Text to find | text | | |
| 3 | Column | number | 0 | 0, 1, 2, 3 |
| 4 | Options | choice | Exact | Exact, Contains, Exact Case, Contains Case, Contains All, Exact All |
| 5 | Store the node path in | variable | [sgTreeNode] | |
Example (from the demo)sgTreeFindNode "GridTree" "Metadata" "0" "Exact" "[sgTreeNode]"
Top
sgTreeExpandID 211
Expand, collapse or toggle a node (or the whole tree).
Node * or empty = whole tree. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeExpand "Rectangle" "Node" "Mode" "Include all sub-levels"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node (* = all) | choice | * | *, 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Mode | choice | Expand | Expand, Collapse, Toggle |
| 4 | Include all sub-levels | True/False | False | False, True |
Example (from the demo)sgTreeExpand "GridTree" "*" "Expand" "False"
Top
sgTreeNodeInfoID 212
Read information about a node or the tree.
TotalCount, RootCount and ColumnCount ignore the node. Any other name reads that node property (Enabled, Extended, Tag, DBKey ...). Children returns one path per line. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeNodeInfo "Rectangle" "Node" "Information" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Information | choice | ChildCount | ChildCount, Descendants, Children, Level, Path, Index, Parent, Next, Previous, FirstChild, LastChild, Text, Expanded, Checked … |
| 4 | Store the value in | variable | [sgTreeValue] | |
Example (from the demo)sgTreeNodeInfo "GridTree" "0" "Descendants" "[sgValue]"
Top
sgTreeNodePropertyID 213
Set a property of a node.
Any tree node property path, e.g. Enabled, Extended (bold header row), Tag, DBKey, Values[0].CheckType, Values[1].Checked. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeNodeProperty "Rectangle" "Node" "Property" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Property | choice | Enabled | Enabled, Extended, Expanded, Tag, DBKey, DataString, DataInteger |
| 4 | Value | choice | True | |
Example (from the demo)sgTreeNodeProperty "GridTree" "0" "Extended" "True"
Top
sgTreeSelectID 214
Select a node (and scroll it into view).
Empty node = clear the selection. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeSelect "Rectangle" "Node" "Scroll into view"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node (empty = none) | choice | 0 | 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Scroll into view | True/False | True | True, False |
Example (from the demo)sgTreeSelect "GridTree" "[sgTreeNode]" "True"
Top
sgTreeGetSelectedID 215
Read the selected node(s).
Several selected nodes (Interaction.MultiSelect) are returned one per line.
sgTreeGetSelected "Rectangle" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Store the node path(s) in | variable | [sgTreeNode] | |
| 3 | Store the node text(s) in | variable | [sgTreeText] | |
Example (from the demo)sgTreeGetSelected "GridTree" "[sgTreeNode]" "[sgValue]"
Top
sgTreeCheckID 216
Show check boxes / radio buttons and check or uncheck nodes.
Node * = every node. Check type empty = leave unchanged. "Include sub-levels" also checks the children. Node address: an index path such as 0/2/1 (zero-based: root / child / ...), =Text (first node with that text in column 0), key:ID (DBKey) or row:N (visible row).
sgTreeCheck "Rectangle" "Node" "Column" "State" "Check type" "Include sub-levels"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Node (* = all) | choice | * | *, 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0 |
| 3 | Column | number | 0 | 0, 1, 2, 3 |
| 4 | State | choice | False | True, False, Toggle, Unchanged |
| 5 | Check type | choice | CheckBox | CheckBox, Radio, None |
| 6 | Include sub-levels | True/False | False | False, True |
Example (from the demo)sgTreeCheck "GridTree" "*" "0" "False" "CheckBox" "False"
Top
sgTreeGetCheckedID 217
List the checked nodes.
One node path (and text) per line.
sgTreeGetChecked "Rectangle" "Column" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Column | number | 0 | 0, 1, 2, 3 |
| 3 | Store the node paths in | variable | [sgTreeChecked] | |
| 4 | Store the node texts in | variable | [sgTreeCheckedText] | |
Example (from the demo)sgTreeGetChecked "GridTree" "0" "[sgValue]" "[sgValue2]"
Top
sgTreeLoadTextID 218
Build the tree from text or a text file.
Indented: one node per line, one tab (or two spaces) per level, columns separated by the delimiter. IdParent: ID, ParentID, Text0, Text1 ... per line (ParentID empty or 0 = root); the ID is kept as the node DBKey (address key:ID). The source may be text, a variable or a file name.
sgTreeLoadText "Rectangle" "Text or file name" "Format" "Column delimiter" "Clear existing nodes"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Text or file name | file | | |
| 3 | Format | choice | Indented | Indented, IdParent |
| 4 | Column delimiter | choice | {pipe} | {pipe}, ,, ;, tab |
| 5 | Clear existing nodes | True/False | True | True, False |
Example (from the demo)sgTreeLoadText "GridTree" "[sgTreeData]" "IdParent" "," "True"
Top
sgTreeGetTextID 219
Export the tree as text.
Indented (tabs), IdParent (DBKey or path as ID) or Paths (path then texts).
sgTreeGetText "Rectangle" "Format" "Column delimiter" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Format | choice | Indented | Indented, IdParent, Paths |
| 3 | Column delimiter | choice | {pipe} | {pipe}, ,, ;, tab |
| 4 | Store the text in | variable | [sgTreeText] | |
Example (from the demo)sgTreeGetText "GridTree" "Indented" "," "[sgValue]"
Top
sgTreeLoadFromGridID 220
Build a grouped tree from an sgGrid.
Group columns (e.g. 3 or 3,2) become nested group nodes; each grid row becomes a leaf with the text columns. With "Clear" the tree columns are taken from the grid header.
sgTreeLoadFromGrid "Rectangle" "Rectangle" "Group by columns" "Text columns" "Clear the tree first"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Rectangle object with the sgGrid | Rectangle object | | |
| 3 | Group by columns (e.g. 3 or 3,2) | text | 3 | 3, 2, 3,2, 4 |
| 4 | Text columns (e.g. 1,2,4) | text | 1,2,4 | 1, 1,2, 1,2,4, 1,2,4,5,6 |
| 5 | Clear the tree first | True/False | True | True, False |
Example (from the demo)sgTreeLoadFromGrid "GridTree" "GridTree" "3" "1,2,4" "True"
Top
sgTreeSortID 221
Sort the nodes by a column.
sgTreeSort "Rectangle" "Column" "Order" "Sort all sub-levels" "Case sensitive"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Column | number | 0 | 0, 1, 2, 3 |
| 3 | Order | choice | Ascending | Ascending, Descending |
| 4 | Sort all sub-levels | True/False | True | True, False |
| 5 | Case sensitive | True/False | False | False, True |
Example (from the demo)sgTreeSort "GridTree" "0" "Ascending" "True" "False"
Top
sgTreeFilterID 222
Filter the nodes by a column condition.
Condition uses the filter syntax (e.g. *text*, >1990, !A*). Empty or "Clear" removes all filters.
sgTreeFilter "Rectangle" "Column" "Condition" "Case sensitive" "Add to the existing filter"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Column | number | 0 | 0, 1, 2, 3 |
| 3 | Condition | choice | * | Clear, *text*, A*, !A*, >1990, <2000, =Text |
| 4 | Case sensitive | True/False | False | False, True |
| 5 | Add to the existing filter | True/False | False | False, True |
Example (from the demo)sgTreeFilter "GridTree" "0" "*Class*" "False" "False"
Top
sgTreeSetPropertyID 223
Set any tree view property by name.
Nested paths work: NodesAppearance.FixedHeight, NodesAppearance.ShowLines, ColumnsAppearance.Stretch, Interaction.MultiSelect, Interaction.ReadOnly, Fill.Color ...
sgTreeSetProperty "Rectangle" "Property" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Property (path) | choice | NodesAppearance.ShowLines | names listed in the editor dialog |
| 3 | New value | choice | True | |
Example (from the demo)sgTreeSetProperty "GridTree" "NodesAppearance.ShowLines" "False"
Top
sgTreeGetPropertyID 224
Read any tree view property into a variable.
A parameterless function name (e.g. GetTotalNodeCount) also works.
sgTreeGetProperty "Rectangle" "Property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Property (path) | choice | NodesAppearance.FixedHeight | names listed in the editor dialog |
| 3 | Store the value in | variable | [sgTreeValue] | |
Example (from the demo)sgTreeGetProperty "GridTree" "NodesAppearance.FixedHeight" "[sgValue]"
Top
sgTreeCallMethodID 225
Call any public tree view method.
Arguments are separated by |; pass every parameter. Examples: ExpandAll, ScrollToTop, AutoSizeColumn 0.
sgTreeCallMethod "Rectangle" "Method" "Arguments" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Method | choice | ExpandAll | names listed in the editor dialog |
| 3 | Arguments (a|b|c) | choice | | |
| 4 | Store the result in | variable | [sgTreeResult] | |
Example (from the demo)sgTreeCallMethod "GridTree" "ScrollToBottom" "" ""
Top
sgTreeOnEventID 226
Run a subroutine when a tree view event fires.
Parameters arrive in [sgGrid_<Name>]; node parameters give the node path, [sgGrid_<Name>_Text] its texts, and [sgTree_Node] / [sgTree_NodeText] the same for the last node. Leave the subroutine empty to unbind.
sgTreeOnEvent "Rectangle" "Event" "Subroutine"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | Event | choice | OnAfterSelectNode | names listed in the editor dialog |
| 3 | Run this subroutine | subroutine | | |
The node of the event is also given in [sgTree_Node] (path) and [sgTree_NodeText].
Example (from the demo)sgTreeOnEvent "GridTree" "OnAfterSelectNode" "sgOnTreeSelect"
Top
sgTreeListMembersID 227
List property, event or method names (for reference).
Path selects a sub-object, e.g. NodesAppearance, ColumnsAppearance, Interaction.
sgTreeListMembers "Rectangle" "List" "Sub-object path" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the tree view | Rectangle object | | |
| 2 | List | choice | Properties | Properties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings |
| 3 | Sub-object path | text | | NodesAppearance, ColumnsAppearance, GroupsAppearance, Interaction, Fill, Stroke |
| 4 | Store the list in | variable | [sgTreeList] | |
Example (from the demo)sgTreeListMembers "GridTree" "Events" "" "[sgValue]"
Top
Code editor
A source-code editor with syntax highlighting for Pascal, SQL, HTML, XML, JavaScript,
Python, C#, PHP, VisualNEO script, INI, JSON and MARC, plus bookmarks, breakpoint and error marks, code folding,
auto-completion and auto-correct. Line and column numbers are 1-based, as shown in the gutter.
sgMemoCreate "Editor" "Pascal"
sgMemoLoadFile "Editor" "[PubDir]sample.pas" "Auto"
sgMemoFind "Editor" "begin" "Start" "[sgPos]"
| Command | Purpose |
|---|
sgMemoCreate | Attach a code editor (syntax highlighting) to a Rectangle. |
sgMemoDelete | Remove a code editor from a Rectangle object. |
sgMemoSetText | Replace, append or insert text. |
sgMemoGetText | Read text into a variable. |
sgMemoLoadFile | Load a text or source file. |
sgMemoSaveFile | Save the text, or export it as coloured HTML / RTF. |
sgMemoClear | Remove all text. |
sgMemoLine | Get, set, insert, delete or append a line. |
sgMemoInfo | Read editor information into a variable. |
sgMemoGoto | Move the cursor to a line and column (or Begin / End). |
sgMemoSelect | Select text by line/column, or All / None / Word. |
sgMemoEdit | Run an edit command. |
sgMemoInsert | Insert text at the cursor or at a line/column. |
sgMemoFind | Find text; returns "line,column" of the match. |
sgMemoReplace | Replace text (all occurrences by default). |
sgMemoHighlight | Highlight every occurrence of a text (empty = off). |
sgMemoLanguage | Switch the syntax language, or save it as a styler .ini. |
sgMemoKeywords | Add your own highlighted keywords. |
sgMemoAppearance | Set the visual style, font and background. |
sgMemoGutter | Configure the gutter (line numbers). |
sgMemoOption | Set an editor option. |
sgMemoBookmark | Set, clear, toggle, list or go to bookmarks. |
sgMemoMark | Mark lines: breakpoint, executable, error or active line. |
sgMemoFold | Code folding: auto, add, remove, expand, collapse. |
sgMemoAutoCompletion | Auto-completion word list. |
sgMemoAutoCorrect | Auto-correct pairs typed as wrong=right. |
sgMemoSetProperty | Set any code editor property by name. |
sgMemoGetProperty | Read any code editor property into a variable. |
sgMemoCallMethod | Call any public code editor method. |
sgMemoOnEvent | Run a subroutine when a memo event fires. |
sgMemoListMembers | List properties, events, methods or languages. |
sgMemoCreateID 300
Attach a code editor (syntax highlighting) to a Rectangle.
Language: Text, Pascal, SQL, HTML, XML, JavaScript, Python, CSharp, PHP, VisualNEO, INI, JSON, MARC, or file:<path> to a styler .ini saved with sgMemoLanguage.
sgMemoCreate "Rectangle" "Language"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object for the memo | Rectangle object | | |
| 2 | Language | choice | Pascal | Text, Pascal, SQL, HTML, XML, JavaScript, Python, CSharp, PHP, VisualNEO, INI, JSON, MARC, file:C:\styler.ini |
Example (from the demo)sgMemoCreate "GridMemo" "Pascal"
Top
sgMemoDeleteID 301
Remove a code editor from a Rectangle object.
sgMemoDelete "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
Example (from the demo)sgMemoDelete "GridMemo"
Top
sgMemoSetTextID 302
Replace, append or insert text.
Insert puts the text at the cursor; Selection replaces the selected text.
sgMemoSetText "Rectangle" "Text" "Mode"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Text | text | | |
| 3 | Mode | choice | Replace | Replace, Append, Insert, Selection |
Text containing square brackets is read by VisualNEO as variables; load such text from a file instead.
Example (from the demo)sgMemoSetText "GridMemo" "-- books by subject[#13][#10]SELECT Title, Author, Year[#13][#10]FROM Books[#13][#10]WHERE Subject = 'Classification'[#13][#10] AND Year < 1950[#13][#10]ORDER BY Year DESC;" "Replace"
Top
sgMemoGetTextID 303
Read text into a variable.
All, Selection, Word (at cursor), Token (at cursor), Line (with the cursor), Wrapped.
sgMemoGetText "Rectangle" "Text" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Text | choice | All | All, Selection, Word, Token, Line, Wrapped |
| 3 | Store the text in | variable | [sgMemoText] | |
Example (from the demo)sgMemoGetText "GridMemo" "Selection" "[sgValue]"
Top
sgMemoLoadFileID 304
Load a text or source file.
Language Auto picks the language from the file extension; Keep leaves it unchanged.
sgMemoLoadFile "Rectangle" "File" "Language"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | File | file | | |
| 3 | Language | choice | Auto | Auto, Keep, Text, Pascal, SQL, HTML, XML, JavaScript, Python, CSharp, PHP, VisualNEO, INI, JSON … |
Example (from the demo)sgMemoLoadFile "GridMemo" "[PubDir]sample.pas" "Auto"
Top
sgMemoSaveFileID 305
Save the text, or export it as coloured HTML / RTF.
sgMemoSaveFile "Rectangle" "File" "Format" "Encoding"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | File | file | | |
| 3 | Format | choice | Text | Text, HTML, RTF |
| 4 | Encoding (Text) | choice | UTF8 | UTF8, ANSI, Unicode |
Example (from the demo)sgMemoSaveFile "GridMemo" "[PubDir]sample.pas" "Text" "UTF8"
Top
sgMemoClearID 306
Remove all text.
sgMemoClear "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
Example (from the demo)sgMemoClear "GridMemo"
Top
sgMemoLineID 307
Get, set, insert, delete or append a line.
sgMemoLine "Rectangle" "Operation" "Line" "Text, or variable for Get"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Get | Get, Set, Insert, Delete, Append |
| 3 | Line (1-based) | number | 1 | 1, 2, 3, 5, 10 |
| 4 | Text, or variable for Get | text | [sgMemoLine] | |
Example (from the demo)sgMemoLine "GridMemo" "Get" "1" "[sgValue]"
Top
sgMemoInfoID 308
Read editor information into a variable.
Line/Column = cursor position (1-based). Any other name reads that property.
sgMemoInfo "Rectangle" "Information" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Information | choice | LineCount | LineCount, Line, Column, Position, SelStart, SelLength, Length, Modified, CanUndo, CanRedo, CanPaste, TopLine, VisibleLines, BookmarkCount … |
| 3 | Store the value in | variable | [sgMemoValue] | |
Example (from the demo)sgMemoInfo "GridMemo" "Position" "[sgMemoPos]"
Top
sgMemoGotoID 309
Move the cursor to a line and column (or Begin / End).
sgMemoGoto "Rectangle" "Line" "Column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Line (or Begin / End) | choice | 1 | Begin, End, 1, 10, 50, 100 |
| 3 | Column | number | 1 | 1, 5, 10 |
Example (from the demo)sgMemoGoto "GridMemo" "12" "3"
Top
sgMemoSelectID 310
Select text by line/column, or All / None / Word.
sgMemoSelect "Rectangle" "From line" "From column" "To line" "To column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | From line (or All / None / Word) | choice | All | All, None, Word, 1, 2, 5 |
| 3 | From column | number | 1 | 1, 5 |
| 4 | To line | number | 1 | 1, 2, 5, 10 |
| 5 | To column (0 = end of line) | number | 0 | 0, 10, 20 |
Example (from the demo)sgMemoSelect "GridMemo" "2" "1" "4" "0"
Top
sgMemoEditID 311
Run an edit command.
sgMemoEdit "Rectangle" "Command"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Command | choice | Undo | Undo, Redo, Copy, Cut, Paste, CopyHTML, SelectAll, DeleteSelection, DeleteLine, ClearUndo, Print, PrintSelection, Format, ScrollTop … |
Example (from the demo)sgMemoEdit "GridMemo" "SelectAll"
Top
sgMemoInsertID 312
Insert text at the cursor or at a line/column.
sgMemoInsert "Rectangle" "Text" "Line" "Column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Text | text | | |
| 3 | Line (0 = cursor) | number | 0 | 0, 1, 2, 5 |
| 4 | Column | number | 1 | 1, 5 |
Example (from the demo)sgMemoInsert "GridMemo" "// inserted at the cursor" "0" "1"
Top
sgMemoFindID 313
Find text; returns "line,column" of the match.
Options can combine: Start (search from the beginning), Up, Case, Whole, Count (return the number of matches instead).
sgMemoFind "Rectangle" "Find" "Options" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Find | text | | |
| 3 | Options | choice | Start | Start, Down, Up, Start Case, Start Whole, Count, Count Case |
| 4 | Store the result in | variable | [sgMemoFound] | |
Example (from the demo)sgMemoFind "GridMemo" "Ranganathan" "Start" "[sgValue]"
Top
sgMemoReplaceID 314
Replace text (all occurrences by default).
Options: Start, Case, Whole, First (only the next occurrence).
sgMemoReplace "Rectangle" "Find" "Replace with" "Options" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Find | text | | |
| 3 | Replace with | text | | |
| 4 | Options | choice | Start | Start, Start Case, Start Whole, First |
| 5 | Store the number of replacements in | variable | [sgMemoCount] | |
Example (from the demo)sgMemoReplace "GridMemo" "Ranganathan" "S. R. Ranganathan" "Start" "[sgValue]"
Top
sgMemoHighlightID 315
Highlight every occurrence of a text (empty = off).
sgMemoHighlight "Rectangle" "Text" "Case sensitive" "Whole words"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Text | text | | |
| 3 | Case sensitive | True/False | False | False, True |
| 4 | Whole words | True/False | False | False, True |
Example (from the demo)sgMemoHighlight "GridMemo" "Title" "False" "True"
Top
sgMemoLanguageID 316
Switch the syntax language, or save it as a styler .ini.
Save writes the current language (with any sgMemoKeywords) as a styler file that sgMemoCreate / sgMemoLanguage can load with file:<path>.
sgMemoLanguage "Rectangle" "Language" "Save the styler to"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Language | choice | Pascal | Text, Pascal, SQL, HTML, XML, JavaScript, Python, CSharp, PHP, VisualNEO, INI, JSON, MARC, file:C:\styler.ini |
| 3 | Save the styler to (optional) | file | | |
Example (from the demo)sgMemoLanguage "GridMemo" "SQL" ""
Top
sgMemoKeywordsID 317
Add your own highlighted keywords.
Words separated by , or |. Replace removes the language keywords first; Clear removes all.
sgMemoKeywords "Rectangle" "Operation" "Keywords" "Colour" "Style"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Add | Add, Replace, Clear |
| 3 | Keywords | text | Ranganathan,Colon,Facet | |
| 4 | Colour | colour | clPurple | |
| 5 | Style | choice | fsBold | fsBold, fsItalic, fsBold,fsItalic, fsUnderline, none |
Example (from the demo)sgMemoKeywords "GridMemo" "Add" "Colon,Classification,Ranganathan" "clPurple" "fsBold,fsItalic"
Top
sgMemoAppearanceID 318
Set the visual style, font and background.
sgMemoAppearance "Rectangle" "Visual style" "Font" "Font size" "Background colour"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Visual style | choice | | names listed in the editor dialog |
| 3 | Font | choice | Consolas | Consolas, Courier New, Cascadia Mono, Lucida Console, Segoe UI |
| 4 | Font size | number | 10 | 9, 10, 11, 12, 14, 16 |
| 5 | Background colour | colour | | |
Example (from the demo)sgMemoAppearance "GridMemo" "" "Consolas" "13" "#FFFFF0"
Top
sgMemoGutterID 319
Configure the gutter (line numbers).
Empty = unchanged.
sgMemoGutter "Rectangle" "Gutter visible" "Line numbers" "Mark modified lines" "Width"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Gutter visible | True/False | True | True, False |
| 3 | Line numbers | True/False | True | True, False |
| 4 | Mark modified lines | True/False | | True, False |
| 5 | Width (0 = unchanged) | number | 0 | 0, 30, 45, 60 |
Example (from the demo)sgMemoGutter "GridMemo" "True" "True" "True" "0"
Top
sgMemoOptionID 320
Set an editor option.
WordWrap accepts True, False or RightMargin.
sgMemoOption "Rectangle" "Option" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Option | choice | ReadOnly | ReadOnly, WordWrap, AutoIndent, ShowRightMargin, RightMargin, TabSize, ActiveLine, UrlAware, SmartTabs, AutoExpand, CaseSensitive, BlockShow, TrimTrailingSpaces |
| 3 | Value | choice | True | |
Example (from the demo)sgMemoOption "GridMemo" "WordWrap" "True"
Top
sgMemoBookmarkID 321
Set, clear, toggle, list or go to bookmarks.
sgMemoBookmark "Rectangle" "Operation" "Line" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Toggle | Set, Clear, Toggle, Goto, List, ClearAll |
| 3 | Line (or index for Goto) | number | | 1, 2, 5, 0 |
| 4 | Store the list in (List) | variable | [sgMemoList] | |
Example (from the demo)sgMemoBookmark "GridMemo" "Toggle" "" ""
Top
sgMemoMarkID 322
Mark lines: breakpoint, executable, error or active line.
sgMemoMark "Rectangle" "Kind" "Operation" "Line" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Kind | choice | Breakpoint | Breakpoint, Executable, Error, Active, Modified |
| 3 | Operation | choice | Toggle | Set, Clear, Toggle, List, ClearAll |
| 4 | Line | number | | 1, 2, 5 |
| 5 | Store the list in (List) | variable | [sgMemoList] | |
Example (from the demo)sgMemoMark "GridMemo" "Breakpoint" "Toggle" "13" ""
Top
sgMemoFoldID 323
Code folding: auto, add, remove, expand, collapse.
sgMemoFold "Rectangle" "Operation" "From line" "To line"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Auto | Auto, Add, Remove, RemoveAll, ExpandAll, CollapseAll, Toggle, Enable, Disable |
| 3 | From line | number | | 1, 2, 5 |
| 4 | To line (Add) | number | | 5, 10, 20 |
Example (from the demo)sgMemoFold "GridMemo" "Auto" "" ""
Top
sgMemoAutoCompletionID 324
Auto-completion word list.
Words separated by , ; | or new lines. Set replaces the list, Add appends.
sgMemoAutoCompletion "Rectangle" "Operation" "Words"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Set | Set, Add, Clear, Enable, Disable |
| 3 | Words | text | SetVar,AlertBox,GotoPage,sgGridCreate | |
Example (from the demo)sgMemoAutoCompletion "GridMemo" "Set" "WriteLn,ReadLn,Ranganathan,Classification,Integer"
Top
sgMemoAutoCorrectID 325
Auto-correct pairs typed as wrong=right.
Pairs separated by ; | or new lines, e.g. teh=the;adn=and.
sgMemoAutoCorrect "Rectangle" "Operation" "Pairs"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Operation | choice | Set | Set, Add, Clear, Enable, Disable |
| 3 | Pairs (wrong=right;...) | text | teh=the;adn=and | |
Example (from the demo)sgMemoAutoCorrect "GridMemo" "Set" "teh=the;adn=and"
Top
sgMemoSetPropertyID 326
Set any code editor property by name.
Nested paths: Gutter.GutterColor, ActiveLineSettings.ActiveLineColor, Font.Name, AutoCompletion.Delay, CodeFolding.Enabled, PrintOptions.Title ...
sgMemoSetProperty "Rectangle" "Property" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Property (path) | choice | ReadOnly | names listed in the editor dialog |
| 3 | New value | choice | True | |
Example (from the demo)sgMemoSetProperty "GridMemo" "ActiveLineSettings.ShowActiveLine" "True"
Top
sgMemoGetPropertyID 327
Read any code editor property into a variable.
A parameterless function (CanUndo, WordAtCursor, GetVersionString) also works.
sgMemoGetProperty "Rectangle" "Property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Property (path) | choice | Modified | names listed in the editor dialog |
| 3 | Store the value in | variable | [sgMemoValue] | |
Example (from the demo)sgMemoGetProperty "GridMemo" "Modified" "[sgValue]"
Top
sgMemoCallMethodID 328
Call any public code editor method.
Arguments separated by |, e.g. BlockIndent 0|5|2, SaveToHTML C:\x.html|True.
sgMemoCallMethod "Rectangle" "Method" "Arguments" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Method | choice | GotoEnd | names listed in the editor dialog |
| 3 | Arguments (a|b|c) | choice | | |
| 4 | Store the result in | variable | [sgMemoResult] | |
Example (from the demo)sgMemoCallMethod "GridMemo" "GotoEnd" "" ""
Top
sgMemoOnEventID 329
Run a subroutine when a memo event fires.
Parameters arrive in [sgGrid_<Name>]. Useful: OnChange, OnCursorChange, OnSelectionChange, OnGutterClick (LineNo), OnURLClick, OnStatusChange. Empty subroutine = unbind.
sgMemoOnEvent "Rectangle" "Event" "Subroutine"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | Event | choice | OnChange | names listed in the editor dialog |
| 3 | Run this subroutine | subroutine | | |
Example (from the demo)sgMemoOnEvent "GridMemo" "OnCursorChange" "sgOnMemoCursor"
Top
sgMemoListMembersID 330
List properties, events, methods or languages.
Path selects a sub-object, e.g. Gutter, AutoCompletion, ActiveLineSettings, PrintOptions.
sgMemoListMembers "Rectangle" "List" "Sub-object path" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the memo | Rectangle object | | |
| 2 | List | choice | Properties | Properties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings, Languages |
| 3 | Sub-object path | text | | Gutter, AutoCompletion, AutoCorrect, ActiveLineSettings, CodeFolding, PrintOptions, Font |
| 4 | Store the list in | variable | [sgMemoList] | |
Example (from the demo)sgMemoListMembers "GridMemo" "Languages" "" "[sgValue]"
Top
Page control
Tabbed pages, either a classic page control (tab styles tsClassic, tsDotNet, tsDelphi)
or an Office-style pager with Office colour schemes. Tabs can be hidden, disabled, closed and reopened, and any other
sgUIKit control can be attached to a tab with sgPageAttach.
sgPageCreate "Tabs" "PageControl" "Data|Notes|Settings" "tsDotNet"
sgPageAttach "Tabs" "=Data" "GridBooks"
sgPageSelect "Tabs" "=Data"
sgPageCreateID 400
Attach a page control or an Office pager to a Rectangle.
Kind PageControl = page control (tab styles tsClassic, tsDotNet, tsDelphi); Office = Office pager with an Office styler (psOffice2019White ...). Captions separated by | create the first pages.
sgPageCreate "Rectangle" "Kind" "Page captions" "Style"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object for the page control | Rectangle object | | |
| 2 | Kind | choice | PageControl | PageControl, Office |
| 3 | Page captions (a|b|c) | text | Data|Notes|Settings | Data, Notes, Settings, Page 1, Page 1, Page 2 |
| 4 | Style | choice | | names listed in the editor dialog |
Example (from the demo)sgPageCreate "GridPage" "PageControl" "Data|Notes|Settings" "tsDotNet"
Top
sgPageDeleteID 401
Remove a page control from a Rectangle object.
Attached sgUIKit controls are not freed; delete them with their own Delete action.
sgPageDelete "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
Example (from the demo)sgPageDelete "GridPage"
Top
sgPageAddID 402
Add a page (tab).
Position -1 appends. The new page index is stored in the variable.
sgPageAdd "Rectangle" "Caption" "Position" "[variable]" "Activate it"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Caption | text | New page | |
| 3 | Position (-1 = end) | number | -1 | -1, 0, 1, 2 |
| 4 | Store the new page index in | variable | [sgPageIndex] | |
| 5 | Activate it | choice | True | True, False |
Example (from the demo)sgPageAdd "GridPage" "Report" "-1" "[sgPageIndex]" "True"
Top
sgPageSelectID 404
Show a page.
Next / Previous skip hidden and disabled tabs. A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageSelect "Rectangle" "Page"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page | text | Next | Next, Previous, First, Last, 0, 1, 2, =Data |
Example (from the demo)sgPageSelect "GridPage" "Next"
Top
sgPageGetActiveID 405
Read the active page index and caption.
sgPageGetActive "Rectangle" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Store the index in | variable | [sgPageIndex] | |
| 3 | Store the caption in (optional) | variable | [sgPageCaption] | |
Example (from the demo)sgPageGetActive "GridPage" "[sgPageIndex]" "[sgPageCaption]"
Top
sgPageCaptionID 406
Change a page caption.
A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageCaption "Rectangle" "Page" "New caption"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page (index, =Caption, Active) | text | Active | Active, 0, 1, 2, =Data |
| 3 | New caption | text | Renamed | |
Example (from the demo)sgPageCaption "GridPage" "Active" "Renamed"
Top
sgPageInfoID 407
Read page-control or page information into a variable.
Count, Active, ActiveCaption, Captions (a|b|c), ClosedCount, Kind ignore the page field. Caption, Index, Visible, Enabled or any page property name read the given page. A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageInfo "Rectangle" "Page" "Information" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page (index, =Caption, Active) | text | Active | Active, 0, 1, 2, =Data |
| 3 | Information | choice | Count | Count, Active, ActiveCaption, Captions, ClosedCount, Kind, Caption, Index, Visible, Enabled, ImageIndex, Hint, TabColor |
| 4 | Store the value in | variable | [sgPageValue] | |
Example (from the demo)sgPageInfo "GridPage" "" "Count" "[sgValue]"
Top
sgPageMoveID 408
Move a page to another position.
A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageMove "Rectangle" "Page" "New index"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page (index, =Caption, Active) | text | Active | Active, 0, 1, 2, =Data |
| 3 | New index | number | 0 | 0, 1, 2, 3 |
Example (from the demo)sgPageMove "GridPage" "Active" "0"
Top
sgPageTabID 409
Set a property of one page / tab.
Visible hides the tab, Enabled disables it, Close shows its close button. Any other tab / Office page property name also works. A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageTab "Rectangle" "Page" "Property" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page (index, =Caption, Active) | text | Active | Active, 0, 1, 2, =Data |
| 3 | Property | choice | Visible | names listed in the editor dialog |
| 4 | Value | choice | True | |
Example (from the demo)sgPageTab "GridPage" "=Settings" "Visible" "False"
Top
sgPageStyleID 410
Tab style, tab position and tab height.
Style: tsClassic|tsDotNet|tsDelphi (PageControl) or an Office style such as psOffice2019White, psWindows10 (Office). Empty fields are left unchanged.
sgPageStyle "Rectangle" "Style" "Tab position" "Tab height"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Style | choice | | names listed in the editor dialog |
| 3 | Tab position | choice | | Top, Bottom, Left, Right |
| 4 | Tab height (0 = keep) | number | 0 | 0, 20, 24, 28, 32 |
Example (from the demo)sgPageStyle "GridPage" "tsDelphi" "Top" "28"
Top
sgPageClosedID 411
Close / reopen pages and the closed-pages list.
Close hides a page into the closed list; Open reopens one by caption or name; OpenAll reopens all; List stores the closed captions (a|b) in the variable; ShowList True/False shows the closed-pages drop-down button. A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageClosed "Rectangle" "Operation" "Page / caption / True-False" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Operation | choice | Close | Close, Open, OpenAll, List, ShowList |
| 3 | Page / caption / True-False | text | Active | Active, 0, 1, =Notes, True, False |
| 4 | Store the list in (List) | variable | [sgPageList] | |
Example (from the demo)sgPageClosed "GridPage" "Close" "Active" ""
Top
sgPageAttachID 412
Put an sgGrid / sgPDF / sgTree / sgMemo control on a page.
Create the control on its own (hidden or small) Rectangle first, then attach it; it fills the page and follows the page control when it is resized. An empty page detaches it back to its own Rectangle. A page is a zero-based index, =Caption (e.g. =Notes) or Active.
sgPageAttach "Rectangle" "Page" "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Page (empty = detach) | text | 0 | 0, 1, 2, =Data, Active |
| 3 | Rectangle that holds the control | Rectangle object | | |
The attached control keeps its own Rectangle name for all its commands. Deleting the page or the page control returns it to its own Rectangle first.
Example (from the demo)sgPageAttach "GridPage" "=Data" "PageGridSrc"
Top
sgPageSetPropertyID 413
Set any page-control property by name.
Nested paths: Font.Name, TabSettings... For the Office pager, Styler.<name> sets a property of its Office styler (e.g. Styler.Style psOffice2016Black).
sgPageSetProperty "Rectangle" "Property" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Property (path) | choice | ShowClosedList | names listed in the editor dialog |
| 3 | New value | choice | True | |
Example (from the demo)sgPageSetProperty "GridPage" "ShowClosedList" "True"
Top
sgPageGetPropertyID 414
Read any page-control property into a variable.
A parameterless function also works.
sgPageGetProperty "Rectangle" "Property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Property (path) | choice | ActivePageIndex | names listed in the editor dialog |
| 3 | Store the value in | variable | [sgPageValue] | |
Example (from the demo)sgPageGetProperty "GridPage" "ActivePageIndex" "[sgValue]"
Top
sgPageCallMethodID 415
Call any public page-control method.
Arguments separated by |, e.g. SelectNextPage True, OpenClosedTab sgTab2, SavePagesState; Office pager: SaveToFile C:\tabs.ini, LoadFromFile C:\tabs.ini, ClearAdvPages.
sgPageCallMethod "Rectangle" "Method" "Arguments" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Method | choice | SelectNextPage | names listed in the editor dialog |
| 3 | Arguments (a|b|c) | choice | | |
| 4 | Store the result in | variable | [sgPageResult] | |
Example (from the demo)sgPageCallMethod "GridPage" "SelectNextPage" "True" ""
Top
sgPageOnEventID 416
Run a subroutine when a page-control event fires.
Parameters arrive in [sgGrid_<Name>]. Useful: OnChange (tab switched), OnChanging, OnCanChange (FromPage, ToPage, AllowChange), OnClosedListClick; Office pager also OnClosePage (PageIndex, Allow), OnClosedPage (PageIndex), OnTabMoved. Empty subroutine = unbind.
sgPageOnEvent "Rectangle" "Event" "Subroutine"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | Event | choice | OnChange | names listed in the editor dialog |
| 3 | Run this subroutine | subroutine | | |
Example (from the demo)sgPageOnEvent "GridPage" "OnChange" "sgOnPageChange"
Top
sgPageListMembersID 417
List properties, events or methods (for reference).
Path: empty = the page control, Page = a tab sheet, Styler = the Office styler, or a sub-object path such as Font.
sgPageListMembers "Rectangle" "List" "Path" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the page control | Rectangle object | | |
| 2 | List | choice | Properties | Properties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings |
| 3 | Path | text | | Page, Styler, Font |
| 4 | Store the list in | variable | [sgPageList] | |
Example (from the demo)sgPageListMembers "GridPage" "Events" "" "[sgValue]"
Top
Kanban board
Columns of cards (tasks) that users drag between columns. Cards have a title and an
HTML text, colours, marks and a DBKey for your own record IDs. Columns are addressed by index or =Header,
cards by column/item, =Title, key:DBKey or Selected.
sgKanbanCreate "Board" "To do|In progress|Done" "Move"
sgKanbanAddItem "Board" "0" "Catalogue new books" "10 titles" "[sgCard]"
sgKanbanOnEvent "Board" "OnAfterDropItem" "sgCardMoved"
sgKanbanCreateID 500
Attach a Kanban board to a Rectangle object.
Columns separated by |, e.g. To do|In progress|Done. "Sample" loads the built-in sample board. Drag and drop: Move, Copy or None.
sgKanbanCreate "Rectangle" "Columns" "Drag and drop"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object for the Kanban board | Rectangle object | | |
| 2 | Columns (a|b|c) or Sample | text | To do|In progress|Done | Sample |
| 3 | Drag and drop | choice | Move | Move, Copy, None |
Example (from the demo)sgKanbanCreate "GridKanban" "To do|In progress|Done" "Move"
Top
sgKanbanDeleteID 501
Remove a Kanban board from a Rectangle object.
sgKanbanDelete "Rectangle"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
Example (from the demo)sgKanbanDelete "GridKanban"
Top
sgKanbanAddColumnID 502
Add a column.
Position -1 appends. The new column index is stored in the variable.
sgKanbanAddColumn "Rectangle" "Header" "Position" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Header | text | Review | |
| 3 | Position (-1 = end) | number | -1 | -1, 0, 1, 2 |
| 4 | Store the column index in | variable | [sgKanbanColumn] | |
Example (from the demo)sgKanbanAddColumn "GridKanban" "Review" "2" "[sgKanbanColumn]"
Top
sgKanbanColumnID 503
Set a column property.
Header, Footer (empty hides it), Width, Visible, Color, HeaderColor, HeaderFontColor, Expandable, Expanded, FilterButton, Sorting or any column property path (HeaderFont.Size). A column is a zero-based index, =Header or its name.
sgKanbanColumn "Rectangle" "Column" "Property" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (index, =Header) | text | 0 | 0, 1, 2, =To do, =Done |
| 3 | Property | choice | Header | names listed in the editor dialog |
| 4 | Value | choice | To do | |
Example (from the demo)sgKanbanColumn "GridKanban" "=Done" "HeaderColor" "#E2EFDA"
Top
sgKanbanRemoveColumnID 504
Delete a column and its cards.
A column is a zero-based index, =Header or its name.
sgKanbanRemoveColumn "Rectangle" "Column"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (index, =Header) | text | 0 | 0, 1, 2, =To do, =Done |
Example (from the demo)sgKanbanRemoveColumn "GridKanban" "=Review"
Top
sgKanbanAddItemID 505
Add a card to a column.
Title and text may contain HTML (<b>, <i>, <font color>, <br>). The new card address (column/item) is stored in the variable. A column is a zero-based index, =Header or its name.
sgKanbanAddItem "Rectangle" "Column" "Title" "Text" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (index, =Header) | text | 0 | 0, 1, 2, =To do, =Done |
| 3 | Title | text | New card | |
| 4 | Text | text | Description of the task | |
| 5 | Store the card address in | variable | [sgKanbanItem] | |
Example (from the demo)sgKanbanAddItem "GridKanban" "0" "New acquisitions" "Catalogue <b>10</b> new books" "[sgKanbanItem]"
Top
sgKanbanItemID 506
Set a card property.
Title, Text, Color, TitleColor, TextColor, Mark (Left, Top, Right, Bottom, None), MarkColor, Rounding, Enabled, Visible, Movable, DBKey, Tag, Height or any card property. A card is column/item (zero-based, e.g. 1/0), =Title, key:DBKey or Selected.
sgKanbanItem "Rectangle" "Card" "Property" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Card (column/item, =Title, key:, Selected) | text | Selected | Selected, 0/0, 1/0, =Card title, key:1 |
| 3 | Property | choice | Color | names listed in the editor dialog |
| 4 | Value | choice | #FFF2CC | |
Example (from the demo)sgKanbanItem "GridKanban" "0/0" "Mark" "Left"
Top
sgKanbanGetItemID 507
Read a card value into a variable.
Path (column/item), Column, ColumnHeader, Index, Title, Text, PlainText, DBKey, Selected, All (title|text|column) or any card property. A card is column/item (zero-based, e.g. 1/0), =Title, key:DBKey or Selected.
sgKanbanGetItem "Rectangle" "Card" "Value" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Card (column/item, =Title, key:, Selected) | text | Selected | Selected, 0/0, 1/0, =Card title, key:1 |
| 3 | Value | choice | Title | Title, Text, PlainText, Path, Column, ColumnHeader, Index, DBKey, Selected, All, Color, MarkColor, Enabled |
| 4 | Store the value in | variable | [sgValue] | |
Example (from the demo)sgKanbanGetItem "GridKanban" "0/0" "All" "[sgValue]"
Top
sgKanbanRemoveItemID 508
Delete a card.
A card is column/item (zero-based, e.g. 1/0), =Title, key:DBKey or Selected.
sgKanbanRemoveItem "Rectangle" "Card"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Card (column/item, =Title, key:, Selected) | text | Selected | Selected, 0/0, 1/0, =Card title, key:1 |
Example (from the demo)sgKanbanRemoveItem "GridKanban" "Selected"
Top
sgKanbanMoveItemID 509
Move or copy a card to another column.
Index -1 puts it at the end. The new card address is stored in the variable. A card is column/item (zero-based, e.g. 1/0), =Title, key:DBKey or Selected.
sgKanbanMoveItem "Rectangle" "Card" "To column" "Index in that column" "Mode" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Card (column/item, =Title, key:, Selected) | text | Selected | Selected, 0/0, 1/0, =Card title, key:1 |
| 3 | To column (index, =Header) | text | 1 | 0, 1, 2, =Done |
| 4 | Index in that column (-1 = end) | number | -1 | -1, 0, 1 |
| 5 | Mode | choice | Move | Move, Copy |
| 6 | Store the new address in | variable | [sgKanbanItem] | |
Example (from the demo)sgKanbanMoveItem "GridKanban" "Selected" "=Done" "-1" "Move" "[sgKanbanItem]"
Top
sgKanbanSelectID 510
Select a card, scroll to it or clear the selection.
A card is column/item (zero-based, e.g. 1/0), =Title, key:DBKey or Selected.
sgKanbanSelect "Rectangle" "Card" "Operation"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Card (column/item, =Title, key:, Selected) | text | Selected | Selected, 0/0, 1/0, =Card title, key:1 |
| 3 | Operation | choice | Select | Select, ScrollTo, Clear |
Example (from the demo)sgKanbanSelect "GridKanban" "1/0" "Select"
Top
sgKanbanGetSelectedID 511
Read the selected card address and title.
The address is empty when no card is selected.
sgKanbanGetSelected "Rectangle" "[variable]" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Store the address in | variable | [sgKanbanItem] | |
| 3 | Store the title in (optional) | variable | [sgValue] | |
Example (from the demo)sgKanbanGetSelected "GridKanban" "[sgKanbanItem]" "[sgValue]"
Top
sgKanbanFindID 512
Find cards by title, text or DBKey.
All matching addresses are stored, separated by |; the first one is selected.
sgKanbanFind "Rectangle" "Search for" "Search in" "Match" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Search for | text | Ranganathan | |
| 3 | Search in | choice | Both | Both, Title, Text, DBKey |
| 4 | Match | choice | Contains | Contains, Exact |
| 5 | Store the addresses in | variable | [sgValue] | |
Example (from the demo)sgKanbanFind "GridKanban" "Ranganathan" "Both" "Contains" "[sgValue]"
Top
sgKanbanInfoID 513
Read board or column information into a variable.
ColumnCount, Headers (a|b), ItemCount (board, or one column), Counts (header=n|...), Titles (of a column), SelectedCount, Header, Version, or any column property. A column is a zero-based index, =Header or its name.
sgKanbanInfo "Rectangle" "Information" "Column" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Information | choice | Counts | ColumnCount, Headers, ItemCount, Counts, Titles, SelectedCount, Header, Version, Width, Visible, Expanded |
| 3 | Column (for column values) | text | | 0, 1, 2, =Done |
| 4 | Store the value in | variable | [sgValue] | |
Example (from the demo)sgKanbanInfo "GridKanban" "Counts" "" "[sgValue]"
Top
sgKanbanLoadTextID 514
Load cards from text: one card per line.
Line format: Column<d>Title<d>Text<d>DBKey (text and DBKey optional). Columns that do not exist are added. Delimiter: | (default), Tab, Comma or any character.
sgKanbanLoadText "Rectangle" "Text or variable" "Delimiter" "Mode"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Text or variable | text | [sgKanbanData] | |
| 3 | Delimiter | choice | Pipe | Pipe, Tab, Comma, ; |
| 4 | Mode | choice | Replace | Replace, Append |
Example (from the demo)sgKanbanLoadText "GridKanban" "[sgKanbanData]" "Pipe" "Replace"
Top
sgKanbanGetTextID 515
Read all cards as text (Column<d>Title<d>Text<d>DBKey lines).
sgKanbanGetText "Rectangle" "[variable]" "Delimiter"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Store the text in | variable | [sgValue] | |
| 3 | Delimiter | choice | Pipe | Pipe, Tab, Comma, ; |
Example (from the demo)sgKanbanGetText "GridKanban" "[sgValue]" "Pipe"
Top
sgKanbanLoadFromGridID 516
Build the board from the rows of an sgGrid.
One column per distinct value of the column field; one card per grid row (DBKey = row number).
sgKanbanLoadFromGrid "Rectangle" "Rectangle" "Grid column for the Kanban c" "Grid column for the card tit" "Grid column for the card tex"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Rectangle that holds the grid | Rectangle object | | |
| 3 | Grid column for the Kanban column | number | 3 | 0, 1, 2, 3, 4 |
| 4 | Grid column for the card title | number | 1 | 0, 1, 2 |
| 5 | Grid column for the card text (-1 = none) | number | 2 | -1, 0, 1, 2 |
Example (from the demo)sgKanbanLoadFromGrid "GridKanban" "KanbanGridSrc" "3" "1" "2"
Top
sgKanbanFileID 517
Save or load the board.
Text: one card per line, Tab-separated (UTF-8). Settings: the control's own settings file (appearance and columns). A relative name is taken from PubDir.
sgKanbanFile "Rectangle" "Operation" "File" "Format"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Operation | choice | Save | Save, Load |
| 3 | File | file | [PubDir]board.txt | |
| 4 | Format | choice | Text | Text, Settings |
Example (from the demo)sgKanbanFile "GridKanban" "Save" "[PubDir]board.txt" "Text"
Top
sgKanbanSortID 518
Sort the cards of a column (or * = all columns).
sgKanbanSort "Rectangle" "Column" "Sort by" "Order"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (* = all) | text | * | *, 0, 1, =To do |
| 3 | Sort by | choice | Title | Title, Text |
| 4 | Order | choice | Ascending | Ascending, Descending |
Example (from the demo)sgKanbanSort "GridKanban" "*" "Title" "Ascending"
Top
sgKanbanFilterID 519
Show only the cards that match (others are hidden).
Condition: text contained in the card, or a mask such as *Class*. Empty or Clear shows all.
sgKanbanFilter "Rectangle" "Column" "Condition" "Search in"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (* = all) | text | * | *, 0, 1, =To do |
| 3 | Condition | text | Ranganathan | Clear, Ranganathan, *Class* |
| 4 | Search in | choice | Both | Both, Title, Text |
Filtering hides the cards that do not match; "Clear" shows them all again.
Example (from the demo)sgKanbanFilter "GridKanban" "*" "*Class*" "Both"
Top
sgKanbanInteractionID 520
Interaction settings.
DragDropMode (Move, Copy, None), MultiSelect, MouseEditMode, KeyboardEdit, Editing, DirectDrag, AutoOpenURL, TouchScrolling.
sgKanbanInteraction "Rectangle" "Setting" "Value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Setting | choice | MultiSelect | DragDropMode, MultiSelect, MouseEditMode, KeyboardEdit, Editing, DirectDrag, AutoOpenURL, TouchScrolling, SwipeBounceGesture |
| 3 | Value | choice | True | |
Example (from the demo)sgKanbanInteraction "GridKanban" "MultiSelect" "True"
Top
sgKanbanAppearanceID 521
Colours, fonts and sizes of the board.
Board, Column, ColumnHeader, Item, ItemSelected: colour. ColumnHeaderFont, ItemFont, TitleFont: colour and size. ItemHeight: Fixed/Variable and height. ColumnWidth: width. Reset: default style.
sgKanbanAppearance "Rectangle" "Part" "Colour / mode / width" "Font size / height"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Part | choice | ColumnHeader | Board, Column, ColumnHeader, ColumnHeaderFont, Item, ItemSelected, ItemFont, TitleFont, ItemHeight, ColumnWidth, Reset |
| 3 | Colour / mode / width | text | #DDEBF7 | #DDEBF7, #F3F6FA, clWhite, clNavy, Fixed, Variable, 250 |
| 4 | Font size / height (optional) | text | | 9, 10, 12, 70 |
Example (from the demo)sgKanbanAppearance "GridKanban" "ColumnHeader" "#DDEBF7" ""
Top
sgKanbanColumnActionID 522
Run a column operation.
Expand, Collapse, StartEdit / StopEdit / ToggleEdit (edit mode), StartFilter / StopFilter / RemoveFilters (built-in filter row), ClearSelection, Enable / Disable (interaction), Clear (remove all cards), ScrollTop. A column is a zero-based index, =Header or its name.
sgKanbanColumnAction "Rectangle" "Column" "Operation"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Column (index, =Header) | text | 0 | 0, 1, 2, =To do, =Done |
| 3 | Operation | choice | Collapse | Expand, Collapse, StartEdit, StopEdit, ToggleEdit, StartFilter, StopFilter, RemoveFilters, ClearSelection, Enable, Disable, Clear, ScrollTop |
Example (from the demo)sgKanbanColumnAction "GridKanban" "0" "Collapse"
Top
sgKanbanSetPropertyID 523
Set any Kanban board property by name.
Nested paths: ItemsAppearance.FixedHeight, ColumnsAppearance.HeaderFont.Size, Interaction.MultiSelect, Columns[0].HeaderText ...
sgKanbanSetProperty "Rectangle" "Property" "New value"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Property (path) | choice | Interaction.MultiSelect | names listed in the editor dialog |
| 3 | New value | choice | True | |
Example (from the demo)sgKanbanSetProperty "GridKanban" "ItemsAppearance.ShowFocus" "False"
Top
sgKanbanGetPropertyID 524
Read any Kanban board property into a variable.
A parameterless function also works.
sgKanbanGetProperty "Rectangle" "Property" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Property (path) | choice | Version | names listed in the editor dialog |
| 3 | Store the value in | variable | [sgValue] | |
Example (from the demo)sgKanbanGetProperty "GridKanban" "Version" "[sgValue]"
Top
sgKanbanCallMethodID 525
Call any public Kanban board method.
Arguments separated by |, e.g. ClearSelection, ClearItems, InitSample.
sgKanbanCallMethod "Rectangle" "Method" "Arguments" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Method | choice | ClearSelection | names listed in the editor dialog |
| 3 | Arguments (a|b|c) | choice | | |
| 4 | Store the result in | variable | [sgValue] | |
Example (from the demo)sgKanbanCallMethod "GridKanban" "ClearSelection" "" ""
Top
sgKanbanOnEventID 526
Run a subroutine when a Kanban board event fires.
Cards arrive as column/item in [sgKanban_Item] (title in [sgKanban_ItemTitle]); columns in [sgKanban_Column] / [sgKanban_ColumnHeader]. Useful: OnSelectItem, OnItemClick, OnItemDblClick, OnAfterDropItem (AFromItem, AToItem), OnBeforeDropItem (ACanDrop), OnUpdateItemText, OnColumnExpand, OnColumnCollapse, OnDoneButtonClicked, OnItemTextAnchorClick. Empty subroutine = unbind.
sgKanbanOnEvent "Rectangle" "Event" "Subroutine"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | Event | choice | OnSelectItem | names listed in the editor dialog |
| 3 | Run this subroutine | subroutine | | |
Cards arrive as column/item in [sgKanban_Item]; in OnBeforeDropItem set [sgGrid_ACanDrop] to False to refuse a drop.
Example (from the demo)sgKanbanOnEvent "GridKanban" "OnSelectItem" "sgOnKanbanSelect"
Top
sgKanbanListMembersID 527
List properties, events or methods (for reference).
Path: empty = the board, Column, Item (card), or a sub-object such as ItemsAppearance.
sgKanbanListMembers "Rectangle" "List" "Path" "[variable]"
| # | Parameter | Type | Default | Values |
|---|
| 1 | Rectangle object with the Kanban board | Rectangle object | | |
| 2 | List | choice | Events | Properties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings |
| 3 | Path | text | | Column, Item, ItemsAppearance, ColumnsAppearance, Interaction |
| 4 | Store the list in | variable | [sgValue] | |
Example (from the demo)sgKanbanListMembers "GridKanban" "Events" "" "[sgValue]"
Top