sgUIKit for VisualNEO Win

Advanced user-interface controls for VisualNEO Win publications: a data grid, a PDF viewer, a tree view, a code editor, a page control and a Kanban board, driven by 166 action commands.

Developed by Saptarshi Ghosh · LIS Software Lab, DLIS, University of North Bengal

Installing the plug-in

  1. Close VisualNEO Win.
  2. Install sgUIKit.nbp with VisualNEO Win's Plug-Ins dialog, or copy it into the VisualNEO Win Plugins folder and restart VisualNEO Win.
  3. Keep sgUIKit_Help.html (this file) in the same folder as sgUIKit.nbp: the Help button of every action dialog opens it at the command you are editing.
  4. The commands appear in the Action Editor in groups such as Grid Setup, PDF Viewer, Tree View, Code Editor, Page Control and Kanban Board.

Requirements: VisualNEO Win (NeoBook 4.0.9 or later plug-in interface). The PDF viewer needs Windows 10 or later. Your users do not need anything else: the plug-in is included with the compiled publication.

How the controls work

Every control lives on a Rectangle object of your page. You draw a Rectangle where the control should appear, give it a name, and run the control's Create command with that name:

sgGridCreate "GridBooks" "11" "7" "1"

From then on the Rectangle's name identifies the control in every other command (sgGridSetCell "GridBooks" "1" "1" "New title"). The control fills the Rectangle and follows it when the publication window is resized.

Parameters, variables and text

Addressing rows, nodes, pages and cards

ControlWhatHow to write it
Gridcellcolumn, row (0-based; row 0 is the header row). Many commands accept ranges such as 1-3, lists 1,4,6, * (all) or Selected.
PDF viewerpagezero-based page index
Tree viewnode0/1/2 (path of child indexes), =Text, key:DBKey, row:N, or empty = selected node
Code editorline, column1-based; an empty line means the line with the cursor
Page controlpagezero-based index, =Caption or Active
Kanban boardcolumnzero-based index, =Header or the column name
Kanban boardcardcolumn/item (e.g. 1/0), =Title, key:DBKey or Selected

Events: running a subroutine

Each family has an OnEvent command that runs one of your VisualNEO subroutines when the control raises an event:

sgGridOnEvent "GridBooks" "OnClickCell" "sgOnCellClick"

:sgOnCellClick
SetVar "[sgInfo]" "Clicked column [sgGrid_Col], row [sgGrid_Row]"
Return

Properties, methods and the generic commands

Besides the friendly commands, every family offers four generic commands that reach any property, method or event of the control by name:

...SetPropertyset a property; nested paths are allowed: Font.Size, SortSettings.Show, Interaction.MultiSelect
...GetPropertyread a property (or a function without parameters) into a variable
...CallMethodcall a method; arguments are separated by |; arguments left out at the end take the control's own default values
...ListMemberslist properties, property types, events, methods or method signatures, for reference

Value formats: True/False; numbers with a dot as decimal separator; colours as clRed, Red, #FF0000 (RGB) or $0000FF (Delphi BGR); enumeration names such as taCenter; sets as [fsBold,fsItalic]; fonts as Name=Segoe UI;Size=10;Color=clNavy;Style=[fsBold].

The editor dialogs list the available names in drop-down boxes, and the value box suggests valid values for the selected property.

Errors and troubleshooting

Using the controls together

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

CommandPurpose
sgGridCreateAttach a grid to a Rectangle object.
sgGridDeleteRemove a grid from a Rectangle object.
sgGridClearClear the grid contents without destroying the grid.
sgGridSetSizeChange the number of rows and columns.
sgGridStyleApply 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"
#ParameterTypeDefaultValues
1Attach the grid to this Rectangle objectRectangle object
2Number of rows (including the header)number105, 10, 20, 50, 100
3Number of columnsnumber52, 3, 4, 5, 6, 8, 10
4Fixed header rowsnumber10, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
Example (from the demo)
sgGridDelete "GridSetup"
Top

sgGridClearID 3

Clear the grid contents without destroying the grid.

sgGridClear "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Number of rowsnumber105, 10, 20, 50, 100
3Number of columnsnumber52, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Style or style filechoicetsOffice2019Whitenames listed in the editor dialog
Example (from the demo)
sgGridStyle "GridSetup" "tsOffice2007Luna"
Top

Cell Data

CommandPurpose
sgGridSetCellSet the text of a grid cell.
sgGridGetCellCopy the text of a grid cell into a variable.
sgGridSetRowFill a row from a list of values.
sgGridGetRowRead a row as a delimited list.
sgGridLoadTextLoad delimited text (e.g. from a variable) into the grid.
sgGridGetTextCopy all grid text into a variable as delimited text.
sgGridFindFind text and return its column and row.

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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Columnnumber10, 1, 2, 3, 4, 5
3Rownumber10, 1, 2, 3, 4, 5
4Cell texttext
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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Columnnumber10, 1, 2, 3, 4, 5
3Rownumber10, 1, 2, 3, 4, 5
4Store the cell text in this variablevariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Row (or new)textnewnew, 1, 2, 3
3Valuestexta|b|c
4Separatortext|names listed in the editor dialog
5First columntext0, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Rownumber10, 1, 2, 3
3Store the row in this variablevariable[sgGridRowText]
4Separatortext|names listed in the editor dialog
5First columntext00, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Texttext[MyData]
3Delimitertext,names listed in the editor dialog
4First rowtext0, 1
5First columntext0, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Store the text in this variablevariable[sgGridText]
3Delimitertext,names listed in the editor dialog
4First rowtext00, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Text to findtext
3Store the column in this variablevariable[FoundCol]
4Store the row in this variablevariable[FoundRow]
Example (from the demo)
sgGridFind "GridData" "Ranganathan" "[sgCol]" "[sgRow]"
Top

Rows and Columns

CommandPurpose
sgGridAddRowInsert a row at a position, or append one (-1).
sgGridDeleteRowDelete a non-fixed row.
sgGridRowsColsInsert, remove, move or swap rows and columns.
sgGridHideHide or show columns and rows.
sgGridAutoSizeAuto-size or auto-number columns and rows.
sgGridMergeMerge or split cells.
sgGridNodeAdd, remove, expand or contract row nodes.

sgGridAddRowID 6

Insert a row at a position, or append one (-1).

sgGridAddRow "Rectangle" "Insert before row"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Insert 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Row to deletenumber11, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceInsertRowsInsertRows, RemoveRows, InsertCols, RemoveCols, MoveRow, MoveRows, MoveColumn, SwapRows, SwapColumns, AddRow, InsertChildRow, RemoveChildRow, RemoveSelectedRows, RemoveUnSelectedRows
3Argument 1 (index / from)text1
4Argument 2 (count / to)text1
5Argument 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2WhatchoiceColumnsColumns, Rows, AllColumns, AllRows, SelectedRows, UnselectedRows
3Fromtext11, 2, 3
4Totext1, 2, 3, 5
5ActionchoiceHideHide, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceColumnsColumns, ColumnsWithFixed, Col, Rows, Row, GrowColumns, FitColumns, Stretch, NumberCol, NumberRow
3Column / row indextext0, 1, 2, 3
4Padding (pixels)text40, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Columntext11, 2, 3, all
3Rowtext10, 1, 2, 3
4Span X (columns)text21, 2, 3, 4, auto
5Span Y (rows)text11, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceAddAdd, Remove, Expand, Contract, ExpandAll, ContractAll
3Rownumber11, 2, 3
4Span (rows)number00, 2, 3, 5, 10
Example (from the demo)
sgGridNode "GridRows" "Add" "1" "3"
Top

Appearance and Formatting

CommandPurpose
sgGridCellStyleColour, font and alignment of cells.
sgGridCellGraphicAdd checkboxes, buttons, progress bars, pictures... to cells.
sgGridColumnFormatWidth, header, alignment, read-only, sort and number format of columns.
sgGridColumnEditorInplace editor type for columns (combo, spin, date, colour picker...).
sgGridHighlightHighlight 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
3Row(s)text11, 2, 3, *, all, 1-10
4Background colourcolour
5Font colourcolour
6Font stylechoice[fsBold], [fsItalic], [fsUnderline], [fsStrikeOut], [fsBold,fsItalic], none
7Font sizetext8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 36
8Font namefont
9Alignmentchoiceleft, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2GraphicchoiceCheckboxCheckbox, DataCheckbox, TriStateCheckbox, CheckboxColumn, TriStateCheckboxColumn, Radio, RadioButton, RadioButtonColumn, Button, Progress, ProgressEx, ProgressFormatted, AdvProgress, ProgressPie …
3Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
4Row(s)text*1, 2, 3, *, all, 1-10
5Argumentschoice
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
3Widthtextauto, 40, 64, 80, 100, 120, 150, 200, 250, 300
4Header texttext
5Alignmentchoiceleft, center, right, none
6Read-onlyTrue/False
7Sort stylechoicenames listed in the editor dialog
8Float formattext%.0f, %.1f, %.2f, %.3f, %.0n, %.2n, %.2m, %d, %e, none
9Background colourcolour
10Font colourcolour
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
3EditorchoiceedComboListnames listed in the editor dialog
4Items (a|b|c)text
5Optionschoice
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2ModechoiceHilightHilight, UnHilight, Mark, UnMark, RemoveAllMarkers
3Texttext
4ScopechoiceGridGrid, Column, Row, Cell
5Indextext1, 2, 3, 1,1
6Match caseTrue/FalseFalse
Example (from the demo)
sgGridHighlight "GridLook" "Hilight" "Classification" "Grid" "" "False"
Top

Sort, Filter and Group

CommandPurpose
sgGridSortSort on one or more columns.
sgGridFilterFilter rows on a column condition.
sgGridNarrowDownShow only rows containing a text (incremental search).
sgGridGroupGroup rows on a column (with optional sub-groups and group totals).
sgGridColumnCalcSum, average, min, max... of a column.
sgGridFooterFloating footer with automatic column totals.

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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Column(s)text11, 2, 3, 4, 5, 1,2, 2,1
3DirectionchoiceAscendingAscending, 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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Column (* = whole row)text1*, 1, 2, 3, 4, 5
3Conditiontext>0, <0, >=100, <=100, =Text, !Text, A*, !A*, *text*, >10 & <20, <0 ^ >100
4OperationchoicefoAND, foOR, foXOR, foNONE
5Case sensitiveTrue/FalseFalse
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Texttext
3Columnnumber-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)"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Group column(s)text10, 1, 2, 3, 1,2
3CalculationchoiceSum, Avg, Min, Max, Count, Distinct, StdDev
4Calculation column(s)text2, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Columnnumber11, 2, 3, 4, 5
3FunctionchoiceSumSum, Avg, Min, Max, Count, Distinct, StdDev
4From rownumber-1-1, 1, 2
5To rownumber-1-1, 10, 20
6Store the result in this variablevariable[sgGridValue]
Example (from the demo)
sgGridColumnCalc "GridSort" "5" "Sum" "-1" "-1" "[sgValue]"
Top

sgGridFooterID 37

Floating footer with automatic column totals.

Footer style etc.: sgGridSetProperty FloatingFooter.FooterStyle ...

sgGridFooter "Rectangle" "Show the footer" "Column(s)" "Calculation"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Show the footerTrue/FalseTrue
3Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
4CalculationchoiceacSUMacSUM, acAVG, acCOUNT, acMIN, acMAX, acDISTINCT, acSTDDEV, acCUSTOM, acNONE
Example (from the demo)
sgGridFooter "GridSort" "True" "5,6" "acSUM"
Top

Selection and Editing

CommandPurpose
sgGridSelectSelect a cell or a range of cells.
sgGridGetSelectionRead the selected range and its text.
sgGridEditStart or stop inplace editing, or focus a cell.
sgGridClipboardCopy, cut or paste grid cells.

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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Left columnnumber10, 1, 2, 3
3Top rownumber10, 1, 2, 3
4Right columntext1, 2, 3, 4, 5
5Bottom rowtext1, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Store the left column invariable[SelLeft]
3Store the top row invariable[SelTop]
4Store the right column invariable[SelRight]
5Store the bottom row invariable[SelBottom]
6Store the selected text invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceStartStart, Stop, Focus
3Columnnumber11, 2, 3
4Rownumber11, 2, 3
Example (from the demo)
sgGridEdit "GridSel" "Start" "2" "3"
Top

sgGridClipboardID 33

Copy, cut or paste grid cells.

sgGridClipboard "Rectangle" "Operation"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceCopySelectionCopy, CopySelection, CopyHTML, Cut, CutSelection, Paste, PasteSelection
Example (from the demo)
sgGridClipboard "GridSel" "CopySelection"
Top

Import, Export and Print

CommandPurpose
sgGridLoadCSVLoad grid data from a CSV file.
sgGridSaveCSVSave grid data to a CSV file.
sgGridImportLoad the grid from CSV, XML, Excel, Access...
sgGridExportSave the grid as CSV, HTML, XML, JSON, ASCII, Word, Excel...
sgGridPrintPrint the grid (all, selection, selected rows/columns).
sgGridStateSave or restore column layout, sort, filter and visual settings.

sgGridLoadCSVID 9

Load grid data from a CSV file.

sgGridLoadCSV "Rectangle" "CSV file to load"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2CSV file to loadfile
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Save to this CSV filefile
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2FormatchoiceCSVnames listed in the editor dialog
3Load this filefile
4Optionchoice
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2FormatchoiceCSVnames listed in the editor dialog
3Save to this filefile
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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2PrintchoicePrintnames listed in the editor dialog
3Titletext
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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2OperationchoiceSaveColumnsSaveColumns, LoadColumns, SetColumnOrder, ResetColumnOrder, SaveSort, LoadSort, SaveFilter, LoadFilter, SaveVisual, LoadVisual
3Value or filetext[sgGridState], C:\Data\grid.flt, C:\Data\style.gp
4Store the result in this variablevariable[sgGridState]
Example (from the demo)
sgGridState "GridIO" "SaveColumns" "" "[sgLayout]"
Top

Advanced: Properties, Methods and Events

CommandPurpose
sgGridSetPropertySet any grid property by name.
sgGridGetPropertyRead any grid property into a variable.
sgGridSetCellPropertySet an indexed cell property for a range of cells.
sgGridGetCellPropertyRead an indexed cell property into a variable.
sgGridCallMethodCall any public grid method.
sgGridOnEventRun a subroutine when a grid event fires.
sgGridCollectionWork with collection properties (hover buttons, filters, dropdown columns...).
sgGridListMembersList property, event or method names (for reference).

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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Property (path)choiceOptionsnames listed in the editor dialog
3New valuechoice+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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Property (path)choiceRowCountnames listed in the editor dialog
3Store the value in this variablevariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Cell propertychoiceColorsnames listed in the editor dialog
3Column(s)text11, 2, 3, 4, 5, *, all, 1-3, 1,3
4Row(s)text11, 2, 3, *, all, 1-10
5New valuechoiceclYellow
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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Cell propertychoiceStrippedCellsnames listed in the editor dialog
3Columnnumber10, 1, 2, 3, 4, 5
4Rownumber10, 1, 2, 3, 4, 5
5Store the value in this variablevariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Method (path)choiceAutoSizeColumnsnames listed in the editor dialog
3Arguments (a|b|c)choiceFalse|4
4Store the result in this variablevariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2EventchoiceOnClickCellnames listed in the editor dialog
3Run this subroutinesubroutine
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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2Collection pathchoiceHoverButtons.ButtonsHoverButtons.Buttons, Filter, GridDropDown.Columns, GridDropDown.Items, DetailPickerDropDown.Items
3OperationchoiceAddAdd, Set, Get, Delete, Clear, Count
4Item indexnumber00, 1, 2, 3
5Values / propertychoiceCaption=Button
6Store the result in this variablevariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the gridRectangle object
2ListchoicePropertiesProperties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings
3Sub-object pathtextSortSettings, PrintSettings, Navigation, MouseActions, ControlLook, Grouping, FloatingFooter, SearchFooter, Bands, Background, Balloon, FilterDropDown, FilterEdit, HTMLSettings …
4Store the list in this variablevariable[sgGridList]
Example (from the demo)
sgGridListMembers "GridAdv" "Events" "" "[sgValue]"
Top

PDF viewer

Shows PDF files with page navigation, display modes (single page, two pages, continuous) and an optional thumbnail pane. Pages are zero-based. Requires Windows 10 or later.

sgPDFCreate "PdfBox" "[PubDir]manual.pdf"
sgPDFGotoPage "PdfBox" "2"
sgPDFGetPageCount "PdfBox" "[sgPages]"
CommandPurpose
sgPDFCreateAttach a PDF viewer to a Rectangle object.
sgPDFDeleteRemove a PDF viewer from a Rectangle object.
sgPDFLoadLoad a PDF file into an existing viewer.
sgPDFNextPageDisplay the next PDF page.
sgPDFPreviousPageDisplay the previous PDF page.
sgPDFFirstPageDisplay the first PDF page.
sgPDFLastPageDisplay the last PDF page.
sgPDFGotoPageDisplay a specified PDF page.
sgPDFGetPageCountStore the PDF page count in a variable.
sgPDFGetCurrentPageStore the current zero-based page index in a variable.
sgPDFSavePageImageRender a PDF page to an image file.
sgPDFSetDisplayModeSet the PDF display mode.
sgPDFSetThumbnailsShow or hide the PDF thumbnail pane.

sgPDFCreateID 100

Attach a PDF viewer to a Rectangle object.

The optional PDF file is loaded immediately after the viewer is created.

sgPDFCreate "Rectangle" "Optional PDF file to load"
#ParameterTypeDefaultValues
1Rectangle object for the PDF viewerRectangle object
2Optional PDF file to loadfile
Requires Windows 10 or later. Use a full path or [PubDir] for the file.
Example (from the demo)
sgPDFCreate "GridPdf" "[PubDir]sample.pdf"
Top

sgPDFDeleteID 101

Remove a PDF viewer from a Rectangle object.

sgPDFDelete "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
Example (from the demo)
sgPDFDelete "GridPdf"
Top

sgPDFLoadID 102

Load a PDF file into an existing viewer.

sgPDFLoad "Rectangle" "PDF file to load"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2PDF file to loadfile
Example (from the demo)
sgPDFLoad "GridPdf" "[PubDir]sample.pdf"
Top

sgPDFNextPageID 103

Display the next PDF page.

sgPDFNextPage "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
Example (from the demo)
sgPDFNextPage "GridPdf"
Top

sgPDFPreviousPageID 104

Display the previous PDF page.

sgPDFPreviousPage "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
Example (from the demo)
sgPDFPreviousPage "GridPdf"
Top

sgPDFFirstPageID 105

Display the first PDF page.

sgPDFFirstPage "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
Example (from the demo)
sgPDFFirstPage "GridPdf"
Top

sgPDFLastPageID 106

Display the last PDF page.

sgPDFLastPage "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
Example (from the demo)
sgPDFLastPage "GridPdf"
Top

sgPDFGotoPageID 107

Display a specified PDF page.

Page index is zero-based.

sgPDFGotoPage "Rectangle" "Zero-based page index"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Zero-based page indexnumber00, 1, 2, 3, 4, 5, 10
Example (from the demo)
sgPDFGotoPage "GridPdf" "2"
Top

sgPDFGetPageCountID 108

Store the PDF page count in a variable.

sgPDFGetPageCount "Rectangle" "[variable]"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Variable for the page countvariable[PDFPageCount]
Example (from the demo)
sgPDFGetPageCount "GridPdf" "[sgValue]"
Top

sgPDFGetCurrentPageID 109

Store the current zero-based page index in a variable.

sgPDFGetCurrentPage "Rectangle" "[variable]"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Variable for the current page indexvariable[PDFPage]
Example (from the demo)
sgPDFGetCurrentPage "GridPdf" "[sgValue]"
Top

sgPDFSavePageImageID 110

Render a PDF page to an image file.

Use -1 to save the currently displayed page.

sgPDFSavePageImage "Rectangle" "Zero-based page index" "Output image file"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Zero-based page index (-1 = current)number-1-1, 0, 1, 2, 3
3Output image filefile
Example (from the demo)
sgPDFSavePageImage "GridPdf" "-1" "[PubDir]page.png"
Top

sgPDFSetDisplayModeID 111

Set the PDF display mode.

sgPDFSetDisplayMode "Rectangle" "Display mode"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Display modechoiceSingleSingle, Double, Continuous
Example (from the demo)
sgPDFSetDisplayMode "GridPdf" "Single"
Top

sgPDFSetThumbnailsID 112

Show or hide the PDF thumbnail pane.

sgPDFSetThumbnails "Rectangle" "Show thumbnails"
#ParameterTypeDefaultValues
1Rectangle object with the PDF viewerRectangle object
2Show thumbnailsTrue/FalseTrueTrue, False
Example (from the demo)
sgPDFSetThumbnails "GridPdf" "True"
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"
CommandPurpose
sgTreeCreateAttach a tree view to a Rectangle object.
sgTreeDeleteRemove a tree view from a Rectangle object.
sgTreeClearRemove nodes, columns or the filter.
sgTreeAddColumnAdd or insert a column.
sgTreeColumnSet a column property, auto-size or delete a column.
sgTreeAddNodeAdd a node (root or child) and return its path.
sgTreeSetNodeTextChange the text of a node.
sgTreeGetNodeTextRead the text of a node into a variable.
sgTreeDeleteNodeDelete a node, or only its children.
sgTreeMoveNodeMove or copy a node under another parent.
sgTreeFindNodeFind a node by text and return its path.
sgTreeExpandExpand, collapse or toggle a node (or the whole tree).
sgTreeNodeInfoRead information about a node or the tree.
sgTreeNodePropertySet a property of a node.
sgTreeSelectSelect a node (and scroll it into view).
sgTreeGetSelectedRead the selected node(s).
sgTreeCheckShow check boxes / radio buttons and check or uncheck nodes.
sgTreeGetCheckedList the checked nodes.
sgTreeLoadTextBuild the tree from text or a text file.
sgTreeGetTextExport the tree as text.
sgTreeLoadFromGridBuild a grouped tree from an sgGrid.
sgTreeSortSort the nodes by a column.
sgTreeFilterFilter the nodes by a column condition.
sgTreeSetPropertySet any tree view property by name.
sgTreeGetPropertyRead any tree view property into a variable.
sgTreeCallMethodCall any public tree view method.
sgTreeOnEventRun a subroutine when a tree view event fires.
sgTreeListMembersList property, event or method names (for reference).

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"
#ParameterTypeDefaultValues
1Rectangle object for the tree viewRectangle object
2Column captions (a|b|c)choiceName, 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
Example (from the demo)
sgTreeDelete "GridTree"
Top

sgTreeClearID 202

Remove nodes, columns or the filter.

sgTreeClear "Rectangle" "Clear"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2ClearchoiceNodesNodes, 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2CaptiontextColumn
3Width (0 = auto)number00, 80, 100, 120, 150, 200, 250
4Insert 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Column (zero-based)number00, 1, 2, 3, 4
3Property or commandchoiceWidthDelete, AutoSize, Text, Width, Visible, HorizontalTextAlign, VerticalTextAlign, WordWrapping, Trimming, EditorType, EditorItems, Sorting, Filtering.Enabled, Expandable …
4Valuechoice150
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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Parent node (empty = root)choice0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Text (col0|col1|...)textNew node
4Position (-1 = append)number-1-1, 0, 1, 2
5Store the new node path invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Column (-1 = all, a|b|c)number0-1, 0, 1, 2, 3
4Texttext
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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Column (-1 = all)number0-1, 0, 1, 2, 3
4Store the text invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Delete only the childrenTrue/FalseFalseFalse, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice0/00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Destination parent (empty = root)choice10, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
4Position (-1 = last)number-1-1, 0, 1, 2
5ModechoiceMoveMove, Copy
6Store the resulting node path invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Text to findtext
3Columnnumber00, 1, 2, 3
4OptionschoiceExactExact, Contains, Exact Case, Contains Case, Contains All, Exact All
5Store the node path invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Node (* = all)choice**, 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3ModechoiceExpandExpand, Collapse, Toggle
4Include all sub-levelsTrue/FalseFalseFalse, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3InformationchoiceChildCountChildCount, Descendants, Children, Level, Path, Index, Parent, Next, Previous, FirstChild, LastChild, Text, Expanded, Checked …
4Store the value invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Nodechoice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3PropertychoiceEnabledEnabled, Extended, Expanded, Tag, DBKey, DataString, DataInteger
4ValuechoiceTrue
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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Node (empty = none)choice00, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Scroll into viewTrue/FalseTrueTrue, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Store the node path(s) invariable[sgTreeNode]
3Store the node text(s) invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Node (* = all)choice**, 0, 1, 0/0, 0/1, 0/0/0, =Classification, key:1, row:0
3Columnnumber00, 1, 2, 3
4StatechoiceFalseTrue, False, Toggle, Unchanged
5Check typechoiceCheckBoxCheckBox, Radio, None
6Include sub-levelsTrue/FalseFalseFalse, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Columnnumber00, 1, 2, 3
3Store the node paths invariable[sgTreeChecked]
4Store the node texts invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Text or file namefile
3FormatchoiceIndentedIndented, IdParent
4Column delimiterchoice{pipe}{pipe}, ,, ;, tab
5Clear existing nodesTrue/FalseTrueTrue, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2FormatchoiceIndentedIndented, IdParent, Paths
3Column delimiterchoice{pipe}{pipe}, ,, ;, tab
4Store the text invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Rectangle object with the sgGridRectangle object
3Group by columns (e.g. 3 or 3,2)text33, 2, 3,2, 4
4Text columns (e.g. 1,2,4)text1,2,41, 1,2, 1,2,4, 1,2,4,5,6
5Clear the tree firstTrue/FalseTrueTrue, 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Columnnumber00, 1, 2, 3
3OrderchoiceAscendingAscending, Descending
4Sort all sub-levelsTrue/FalseTrueTrue, False
5Case sensitiveTrue/FalseFalseFalse, 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Columnnumber00, 1, 2, 3
3Conditionchoice*Clear, *text*, A*, !A*, >1990, <2000, =Text
4Case sensitiveTrue/FalseFalseFalse, True
5Add to the existing filterTrue/FalseFalseFalse, 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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Property (path)choiceNodesAppearance.ShowLinesnames listed in the editor dialog
3New valuechoiceTrue
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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2Property (path)choiceNodesAppearance.FixedHeightnames listed in the editor dialog
3Store the value invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2MethodchoiceExpandAllnames listed in the editor dialog
3Arguments (a|b|c)choice
4Store the result invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2EventchoiceOnAfterSelectNodenames listed in the editor dialog
3Run this subroutinesubroutine
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]"
#ParameterTypeDefaultValues
1Rectangle object with the tree viewRectangle object
2ListchoicePropertiesProperties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings
3Sub-object pathtextNodesAppearance, ColumnsAppearance, GroupsAppearance, Interaction, Fill, Stroke
4Store the list invariable[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]"
CommandPurpose
sgMemoCreateAttach a code editor (syntax highlighting) to a Rectangle.
sgMemoDeleteRemove a code editor from a Rectangle object.
sgMemoSetTextReplace, append or insert text.
sgMemoGetTextRead text into a variable.
sgMemoLoadFileLoad a text or source file.
sgMemoSaveFileSave the text, or export it as coloured HTML / RTF.
sgMemoClearRemove all text.
sgMemoLineGet, set, insert, delete or append a line.
sgMemoInfoRead editor information into a variable.
sgMemoGotoMove the cursor to a line and column (or Begin / End).
sgMemoSelectSelect text by line/column, or All / None / Word.
sgMemoEditRun an edit command.
sgMemoInsertInsert text at the cursor or at a line/column.
sgMemoFindFind text; returns "line,column" of the match.
sgMemoReplaceReplace text (all occurrences by default).
sgMemoHighlightHighlight every occurrence of a text (empty = off).
sgMemoLanguageSwitch the syntax language, or save it as a styler .ini.
sgMemoKeywordsAdd your own highlighted keywords.
sgMemoAppearanceSet the visual style, font and background.
sgMemoGutterConfigure the gutter (line numbers).
sgMemoOptionSet an editor option.
sgMemoBookmarkSet, clear, toggle, list or go to bookmarks.
sgMemoMarkMark lines: breakpoint, executable, error or active line.
sgMemoFoldCode folding: auto, add, remove, expand, collapse.
sgMemoAutoCompletionAuto-completion word list.
sgMemoAutoCorrectAuto-correct pairs typed as wrong=right.
sgMemoSetPropertySet any code editor property by name.
sgMemoGetPropertyRead any code editor property into a variable.
sgMemoCallMethodCall any public code editor method.
sgMemoOnEventRun a subroutine when a memo event fires.
sgMemoListMembersList 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"
#ParameterTypeDefaultValues
1Rectangle object for the memoRectangle object
2LanguagechoicePascalText, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Texttext
3ModechoiceReplaceReplace, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2TextchoiceAllAll, Selection, Word, Token, Line, Wrapped
3Store the text invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Filefile
3LanguagechoiceAutoAuto, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Filefile
3FormatchoiceTextText, HTML, RTF
4Encoding (Text)choiceUTF8UTF8, ANSI, Unicode
Example (from the demo)
sgMemoSaveFile "GridMemo" "[PubDir]sample.pas" "Text" "UTF8"
Top

sgMemoClearID 306

Remove all text.

sgMemoClear "Rectangle"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceGetGet, Set, Insert, Delete, Append
3Line (1-based)number11, 2, 3, 5, 10
4Text, or variable for Gettext[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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2InformationchoiceLineCountLineCount, Line, Column, Position, SelStart, SelLength, Length, Modified, CanUndo, CanRedo, CanPaste, TopLine, VisibleLines, BookmarkCount …
3Store the value invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Line (or Begin / End)choice1Begin, End, 1, 10, 50, 100
3Columnnumber11, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2From line (or All / None / Word)choiceAllAll, None, Word, 1, 2, 5
3From columnnumber11, 5
4To linenumber11, 2, 5, 10
5To column (0 = end of line)number00, 10, 20
Example (from the demo)
sgMemoSelect "GridMemo" "2" "1" "4" "0"
Top

sgMemoEditID 311

Run an edit command.

sgMemoEdit "Rectangle" "Command"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2CommandchoiceUndoUndo, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Texttext
3Line (0 = cursor)number00, 1, 2, 5
4Columnnumber11, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Findtext
3OptionschoiceStartStart, Down, Up, Start Case, Start Whole, Count, Count Case
4Store the result invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Findtext
3Replace withtext
4OptionschoiceStartStart, Start Case, Start Whole, First
5Store the number of replacements invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Texttext
3Case sensitiveTrue/FalseFalseFalse, True
4Whole wordsTrue/FalseFalseFalse, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2LanguagechoicePascalText, Pascal, SQL, HTML, XML, JavaScript, Python, CSharp, PHP, VisualNEO, INI, JSON, MARC, file:C:\styler.ini
3Save 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceAddAdd, Replace, Clear
3KeywordstextRanganathan,Colon,Facet
4ColourcolourclPurple
5StylechoicefsBoldfsBold, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Visual stylechoicenames listed in the editor dialog
3FontchoiceConsolasConsolas, Courier New, Cascadia Mono, Lucida Console, Segoe UI
4Font sizenumber109, 10, 11, 12, 14, 16
5Background colourcolour
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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Gutter visibleTrue/FalseTrueTrue, False
3Line numbersTrue/FalseTrueTrue, False
4Mark modified linesTrue/FalseTrue, False
5Width (0 = unchanged)number00, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OptionchoiceReadOnlyReadOnly, WordWrap, AutoIndent, ShowRightMargin, RightMargin, TabSize, ActiveLine, UrlAware, SmartTabs, AutoExpand, CaseSensitive, BlockShow, TrimTrailingSpaces
3ValuechoiceTrue
Example (from the demo)
sgMemoOption "GridMemo" "WordWrap" "True"
Top

sgMemoBookmarkID 321

Set, clear, toggle, list or go to bookmarks.

sgMemoBookmark "Rectangle" "Operation" "Line" "[variable]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceToggleSet, Clear, Toggle, Goto, List, ClearAll
3Line (or index for Goto)number1, 2, 5, 0
4Store 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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2KindchoiceBreakpointBreakpoint, Executable, Error, Active, Modified
3OperationchoiceToggleSet, Clear, Toggle, List, ClearAll
4Linenumber1, 2, 5
5Store 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceAutoAuto, Add, Remove, RemoveAll, ExpandAll, CollapseAll, Toggle, Enable, Disable
3From linenumber1, 2, 5
4To line (Add)number5, 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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceSetSet, Add, Clear, Enable, Disable
3WordstextSetVar,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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2OperationchoiceSetSet, Add, Clear, Enable, Disable
3Pairs (wrong=right;...)textteh=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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Property (path)choiceReadOnlynames listed in the editor dialog
3New valuechoiceTrue
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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2Property (path)choiceModifiednames listed in the editor dialog
3Store the value invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2MethodchoiceGotoEndnames listed in the editor dialog
3Arguments (a|b|c)choice
4Store the result invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2EventchoiceOnChangenames listed in the editor dialog
3Run this subroutinesubroutine
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]"
#ParameterTypeDefaultValues
1Rectangle object with the memoRectangle object
2ListchoicePropertiesProperties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings, Languages
3Sub-object pathtextGutter, AutoCompletion, AutoCorrect, ActiveLineSettings, CodeFolding, PrintOptions, Font
4Store the list invariable[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"
CommandPurpose
sgPageCreateAttach a page control or an Office pager to a Rectangle.
sgPageDeleteRemove a page control from a Rectangle object.
sgPageAddAdd a page (tab).
sgPageRemoveDelete a page.
sgPageSelectShow a page.
sgPageGetActiveRead the active page index and caption.
sgPageCaptionChange a page caption.
sgPageInfoRead page-control or page information into a variable.
sgPageMoveMove a page to another position.
sgPageTabSet a property of one page / tab.
sgPageStyleTab style, tab position and tab height.
sgPageClosedClose / reopen pages and the closed-pages list.
sgPageAttachPut an sgGrid / sgPDF / sgTree / sgMemo control on a page.
sgPageSetPropertySet any page-control property by name.
sgPageGetPropertyRead any page-control property into a variable.
sgPageCallMethodCall any public page-control method.
sgPageOnEventRun a subroutine when a page-control event fires.
sgPageListMembersList properties, events or methods (for reference).

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"
#ParameterTypeDefaultValues
1Rectangle object for the page controlRectangle object
2KindchoicePageControlPageControl, Office
3Page captions (a|b|c)textData|Notes|SettingsData, Notes, Settings, Page 1, Page 1, Page 2
4Stylechoicenames 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2CaptiontextNew page
3Position (-1 = end)number-1-1, 0, 1, 2
4Store the new page index invariable[sgPageIndex]
5Activate itchoiceTrueTrue, False
Example (from the demo)
sgPageAdd "GridPage" "Report" "-1" "[sgPageIndex]" "True"
Top

sgPageRemoveID 403

Delete a page.

Controls attached to it with sgPageAttach go back to their own Rectangle. A page is a zero-based index, =Caption (e.g. =Notes) or Active.

sgPageRemove "Rectangle" "Page"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (index, =Caption, Active)textActiveActive, 0, 1, 2, =Data
Example (from the demo)
sgPageRemove "GridPage" "[sgValue]"
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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2PagetextNextNext, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Store the index invariable[sgPageIndex]
3Store 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (index, =Caption, Active)textActiveActive, 0, 1, 2, =Data
3New captiontextRenamed
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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (index, =Caption, Active)textActiveActive, 0, 1, 2, =Data
3InformationchoiceCountCount, Active, ActiveCaption, Captions, ClosedCount, Kind, Caption, Index, Visible, Enabled, ImageIndex, Hint, TabColor
4Store the value invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (index, =Caption, Active)textActiveActive, 0, 1, 2, =Data
3New indexnumber00, 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (index, =Caption, Active)textActiveActive, 0, 1, 2, =Data
3PropertychoiceVisiblenames listed in the editor dialog
4ValuechoiceTrue
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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Stylechoicenames listed in the editor dialog
3Tab positionchoiceTop, Bottom, Left, Right
4Tab height (0 = keep)number00, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2OperationchoiceCloseClose, Open, OpenAll, List, ShowList
3Page / caption / True-FalsetextActiveActive, 0, 1, =Notes, True, False
4Store 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Page (empty = detach)text00, 1, 2, =Data, Active
3Rectangle that holds the controlRectangle 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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Property (path)choiceShowClosedListnames listed in the editor dialog
3New valuechoiceTrue
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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2Property (path)choiceActivePageIndexnames listed in the editor dialog
3Store the value invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2MethodchoiceSelectNextPagenames listed in the editor dialog
3Arguments (a|b|c)choice
4Store the result invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2EventchoiceOnChangenames listed in the editor dialog
3Run this subroutinesubroutine
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]"
#ParameterTypeDefaultValues
1Rectangle object with the page controlRectangle object
2ListchoicePropertiesProperties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings
3PathtextPage, Styler, Font
4Store the list invariable[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"
CommandPurpose
sgKanbanCreateAttach a Kanban board to a Rectangle object.
sgKanbanDeleteRemove a Kanban board from a Rectangle object.
sgKanbanAddColumnAdd a column.
sgKanbanColumnSet a column property.
sgKanbanRemoveColumnDelete a column and its cards.
sgKanbanAddItemAdd a card to a column.
sgKanbanItemSet a card property.
sgKanbanGetItemRead a card value into a variable.
sgKanbanRemoveItemDelete a card.
sgKanbanMoveItemMove or copy a card to another column.
sgKanbanSelectSelect a card, scroll to it or clear the selection.
sgKanbanGetSelectedRead the selected card address and title.
sgKanbanFindFind cards by title, text or DBKey.
sgKanbanInfoRead board or column information into a variable.
sgKanbanLoadTextLoad cards from text: one card per line.
sgKanbanGetTextRead all cards as text (Column<d>Title<d>Text<d>DBKey lines).
sgKanbanLoadFromGridBuild the board from the rows of an sgGrid.
sgKanbanFileSave or load the board.
sgKanbanSortSort the cards of a column (or * = all columns).
sgKanbanFilterShow only the cards that match (others are hidden).
sgKanbanInteractionInteraction settings.
sgKanbanAppearanceColours, fonts and sizes of the board.
sgKanbanColumnActionRun a column operation.
sgKanbanSetPropertySet any Kanban board property by name.
sgKanbanGetPropertyRead any Kanban board property into a variable.
sgKanbanCallMethodCall any public Kanban board method.
sgKanbanOnEventRun a subroutine when a Kanban board event fires.
sgKanbanListMembersList properties, events or methods (for reference).

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"
#ParameterTypeDefaultValues
1Rectangle object for the Kanban boardRectangle object
2Columns (a|b|c) or SampletextTo do|In progress|DoneSample
3Drag and dropchoiceMoveMove, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle 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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2HeadertextReview
3Position (-1 = end)number-1-1, 0, 1, 2
4Store the column index invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (index, =Header)text00, 1, 2, =To do, =Done
3PropertychoiceHeadernames listed in the editor dialog
4ValuechoiceTo 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (index, =Header)text00, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (index, =Header)text00, 1, 2, =To do, =Done
3TitletextNew card
4TexttextDescription of the task
5Store the card address invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Card (column/item, =Title, key:, Selected)textSelectedSelected, 0/0, 1/0, =Card title, key:1
3PropertychoiceColornames listed in the editor dialog
4Valuechoice#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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Card (column/item, =Title, key:, Selected)textSelectedSelected, 0/0, 1/0, =Card title, key:1
3ValuechoiceTitleTitle, Text, PlainText, Path, Column, ColumnHeader, Index, DBKey, Selected, All, Color, MarkColor, Enabled
4Store the value invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Card (column/item, =Title, key:, Selected)textSelectedSelected, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Card (column/item, =Title, key:, Selected)textSelectedSelected, 0/0, 1/0, =Card title, key:1
3To column (index, =Header)text10, 1, 2, =Done
4Index in that column (-1 = end)number-1-1, 0, 1
5ModechoiceMoveMove, Copy
6Store the new address invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Card (column/item, =Title, key:, Selected)textSelectedSelected, 0/0, 1/0, =Card title, key:1
3OperationchoiceSelectSelect, 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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Store the address invariable[sgKanbanItem]
3Store 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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Search fortextRanganathan
3Search inchoiceBothBoth, Title, Text, DBKey
4MatchchoiceContainsContains, Exact
5Store the addresses invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2InformationchoiceCountsColumnCount, Headers, ItemCount, Counts, Titles, SelectedCount, Header, Version, Width, Visible, Expanded
3Column (for column values)text0, 1, 2, =Done
4Store the value invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Text or variabletext[sgKanbanData]
3DelimiterchoicePipePipe, Tab, Comma, ;
4ModechoiceReplaceReplace, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Store the text invariable[sgValue]
3DelimiterchoicePipePipe, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Rectangle that holds the gridRectangle object
3Grid column for the Kanban columnnumber30, 1, 2, 3, 4
4Grid column for the card titlenumber10, 1, 2
5Grid column for the card text (-1 = none)number2-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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2OperationchoiceSaveSave, Load
3Filefile[PubDir]board.txt
4FormatchoiceTextText, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (* = all)text**, 0, 1, =To do
3Sort bychoiceTitleTitle, Text
4OrderchoiceAscendingAscending, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (* = all)text**, 0, 1, =To do
3ConditiontextRanganathanClear, Ranganathan, *Class*
4Search inchoiceBothBoth, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2SettingchoiceMultiSelectDragDropMode, MultiSelect, MouseEditMode, KeyboardEdit, Editing, DirectDrag, AutoOpenURL, TouchScrolling, SwipeBounceGesture
3ValuechoiceTrue
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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2PartchoiceColumnHeaderBoard, Column, ColumnHeader, ColumnHeaderFont, Item, ItemSelected, ItemFont, TitleFont, ItemHeight, ColumnWidth, Reset
3Colour / mode / widthtext#DDEBF7#DDEBF7, #F3F6FA, clWhite, clNavy, Fixed, Variable, 250
4Font size / height (optional)text9, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Column (index, =Header)text00, 1, 2, =To do, =Done
3OperationchoiceCollapseExpand, 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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Property (path)choiceInteraction.MultiSelectnames listed in the editor dialog
3New valuechoiceTrue
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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2Property (path)choiceVersionnames listed in the editor dialog
3Store the value invariable[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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2MethodchoiceClearSelectionnames listed in the editor dialog
3Arguments (a|b|c)choice
4Store the result invariable[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"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2EventchoiceOnSelectItemnames listed in the editor dialog
3Run this subroutinesubroutine
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]"
#ParameterTypeDefaultValues
1Rectangle object with the Kanban boardRectangle object
2ListchoiceEventsProperties, PropertyTypes, Events, Methods, Signatures, Indexed, Bindings
3PathtextColumn, Item, ItemsAppearance, ColumnsAppearance, Interaction
4Store the list invariable[sgValue]
Example (from the demo)
sgKanbanListMembers "GridKanban" "Events" "" "[sgValue]"
Top

About

sgUIKit — advanced UI controls for VisualNEO Win.
Developed by Saptarshi Ghosh, LIS Software Lab, Department of Library and Information Science, University of North Bengal.

The demo publication Demo\sgUIKit_Demo.pub uses every command; its readable source is in Demo\sgUIKit_Demo_Script.txt. The examples in this help file are taken from it.

All commands A–Z

sgGridAddRowsgGridAutoSizesgGridCallMethodsgGridCellGraphicsgGridCellStylesgGridClearsgGridClipboardsgGridCollectionsgGridColumnCalcsgGridColumnEditorsgGridColumnFormatsgGridCreatesgGridDeletesgGridDeleteRowsgGridEditsgGridExportsgGridFiltersgGridFindsgGridFootersgGridGetCellsgGridGetCellPropertysgGridGetPropertysgGridGetRowsgGridGetSelectionsgGridGetTextsgGridGroupsgGridHidesgGridHighlightsgGridImportsgGridListMemberssgGridLoadCSVsgGridLoadTextsgGridMergesgGridNarrowDownsgGridNodesgGridOnEventsgGridPrintsgGridRowsColssgGridSaveCSVsgGridSelectsgGridSetCellsgGridSetCellPropertysgGridSetPropertysgGridSetRowsgGridSetSizesgGridSortsgGridStatesgGridStylesgKanbanAddColumnsgKanbanAddItemsgKanbanAppearancesgKanbanCallMethodsgKanbanColumnsgKanbanColumnActionsgKanbanCreatesgKanbanDeletesgKanbanFilesgKanbanFiltersgKanbanFindsgKanbanGetItemsgKanbanGetPropertysgKanbanGetSelectedsgKanbanGetTextsgKanbanInfosgKanbanInteractionsgKanbanItemsgKanbanListMemberssgKanbanLoadFromGridsgKanbanLoadTextsgKanbanMoveItemsgKanbanOnEventsgKanbanRemoveColumnsgKanbanRemoveItemsgKanbanSelectsgKanbanSetPropertysgKanbanSortsgMemoAppearancesgMemoAutoCompletionsgMemoAutoCorrectsgMemoBookmarksgMemoCallMethodsgMemoClearsgMemoCreatesgMemoDeletesgMemoEditsgMemoFindsgMemoFoldsgMemoGetPropertysgMemoGetTextsgMemoGotosgMemoGuttersgMemoHighlightsgMemoInfosgMemoInsertsgMemoKeywordssgMemoLanguagesgMemoLinesgMemoListMemberssgMemoLoadFilesgMemoMarksgMemoOnEventsgMemoOptionsgMemoReplacesgMemoSaveFilesgMemoSelectsgMemoSetPropertysgMemoSetTextsgPageAddsgPageAttachsgPageCallMethodsgPageCaptionsgPageClosedsgPageCreatesgPageDeletesgPageGetActivesgPageGetPropertysgPageInfosgPageListMemberssgPageMovesgPageOnEventsgPageRemovesgPageSelectsgPageSetPropertysgPageStylesgPageTabsgPDFCreatesgPDFDeletesgPDFFirstPagesgPDFGetCurrentPagesgPDFGetPageCountsgPDFGotoPagesgPDFLastPagesgPDFLoadsgPDFNextPagesgPDFPreviousPagesgPDFSavePageImagesgPDFSetDisplayModesgPDFSetThumbnailssgTreeAddColumnsgTreeAddNodesgTreeCallMethodsgTreeChecksgTreeClearsgTreeColumnsgTreeCreatesgTreeDeletesgTreeDeleteNodesgTreeExpandsgTreeFiltersgTreeFindNodesgTreeGetCheckedsgTreeGetNodeTextsgTreeGetPropertysgTreeGetSelectedsgTreeGetTextsgTreeListMemberssgTreeLoadFromGridsgTreeLoadTextsgTreeMoveNodesgTreeNodeInfosgTreeNodePropertysgTreeOnEventsgTreeSelectsgTreeSetNodeTextsgTreeSetPropertysgTreeSort