SalTableWindow
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Web.50 (5.0.0.0)
Displays SAL table rows and columns in a web grid, with row contexts, split rows, validation messages, and SQL population.
- C#
- VB.NET
public class SalTableWindow : SalTableWindowBase, ISalWindow, ISalControl, IEnumerable<SalTableRow>, IEnumerable
Public Class SalTableWindow
Inherits SalTableWindowBase
Implements ISalWindow, ISalControl, IEnumerable(Of SalTableRow), IEnumerable
Example:
SalTableWindow table = new SalTableWindow();
table.AllowSorting = true;
table.CreateColumn(0, 20, 80, "Name", DataType.String);
table.InsertRow(Sys.TBL_MaxRow);
Constructors
SalTableWindow()
Initializes the table window, its SAL message host, and its table-filling helper.
Properties
AllowAutoEditing
Boolean: Gets or sets whether cells enter edit mode on entry instead of waiting for a keystroke or F2. (Default: False)
AllowRowSizing
Boolean: Gets or sets the row-header flag that permits row resizing. (Default: False)
BackgroundFillInterval
Int32: Gets or sets the background-fill interval in milliseconds, clamping assignments to at least 500.
BackgroundFillRows
Int32: Gets or sets the number of rows fetched per background-fill operation, clamping assignments to at least 10.
CultureInfo
CultureInfo: Gets or sets the culture used by this table. A null value inherits the containing SalForm’s culture, or Sys.CultureInfo at runtime.
Throws:
- ArgumentException The assigned culture is neutral.
IsEmbedded
Boolean: Gets whether this table was created as the embedded grid of a form table.
Item(id)
SalTableColumn: Gets a column by its SAL column identifier.
Item(name)
SalTableColumn: Gets a column by its control name.
Label
Control: Gets or sets the label associated with this control through the SAL window implementation.
LinesPerRow
Int32: Gets or sets row height as a multiple of the theme’s row height. Assignments outside 1 through 32 are ignored. (Default: 1)
Modified
Boolean: Gets or sets the table-level SAL modification flag.
NamedProperties
SalNamedProperties: Gets the SAL named-property collection associated with this control.
ReadOnly
Boolean: Gets or sets whether cells in the main and split grids are read-only. (Default: False)
RowSizingStyle
RowsSizingStyle: Gets or sets which grids keep their rows at a uniform height when a row is resized. (Default: FreeSize)
Methods
AnyRows(flagsOn, flagsOff)
Checks both grids for a nondeleted row matching the flag filters.
| Parameter | Type | Description |
|---|---|---|
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Row flags that must all be absent. |
Returns: SalBoolean. True when a matching row exists; otherwise, false.
AutoSizeCols(extraSpace)
Resizes all main-grid columns to fit their cells plus additional space.
| Parameter | Type | Description |
|---|---|---|
| extraSpace | Int32 | The extra width in pixels added to each measured column. |
AutoSizeCols(colStart, colEnd, extraSpace)
Resizes main-grid columns starting at the specified index to fit their cells.
| Parameter | Type | Description |
|---|---|---|
| colStart | Int32 | The first zero-based column index. |
| colEnd | Int32 | The additional exclusive loop bound. |
| extraSpace | Int32 | The extra width in pixels added to each measured column. |
The loop continues while the index is below either the column count or colEnd. It therefore processes all remaining columns even when colEnd is smaller; a value above the column count can address nonexistent columns.
BringWindowToTop()
Brings this control to the front, or activates it when it is a top-level or MDI form.
Returns: SalBoolean. True if the translated control exists; otherwise, false.
CenterWindow()
Centers this window within its parent or, for a top-level form, its owner or screen working area.
Returns: SalBoolean. True when the translated control exists; otherwise, false.
A top-level form is constrained to the selected screen working area. A control without a parent is unchanged unless it is a top-level form.
ClearCursor(nType)
Restores the default cursor for the requested role.
| Parameter | Type | Description |
|---|---|---|
| nType | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.
ClearSelection()
Clears selected rows in the main and split grids.
Returns: SalBoolean. Always true after processing.
ColumnAverage(columnId, flagsOn, flagsOff)
Calculates the numeric average for matching rows of a column, preserving row context.
| Parameter | Type | Description |
|---|---|---|
| columnId | SalNumber | The SAL column identifier. |
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Row flags that must all be absent. |
Returns: SalNumber. The average, or zero for an unresolved column or no matching rows.
ColumnSum(columnId, flagsOn, flagsOff)
Sums numeric values for matching rows of a column, preserving row context.
| Parameter | Type | Description |
|---|---|---|
| columnId | SalNumber | The SAL column identifier. |
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Row flags that must all be absent. |
Returns: SalNumber. The sum, or zero for an unresolved column, a date/time column, or no matching rows.
CopyRows(flagsOn, flagsOff)
Copies matching rows to the clipboard as tab-separated fields and CRLF-separated records.
| Parameter | Type | Description |
|---|---|---|
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Row flags that must all be absent. |
Returns: SalBoolean. True when a nonempty text block is submitted to the clipboard helper; false when there is no text to copy.
CreateColumn(colPos, dispWidth, maxChars, title)
Creates a dynamic string column.
| Parameter | Type | Description |
|---|---|---|
| colPos | SalNumber | The requested display position. |
| dispWidth | SalNumber | The width in horizontal form units. |
| maxChars | SalNumber | The maximum text length. |
| title | SalString | The column caption. |
Returns: SalNumber. The new SAL column identifier.
CreateColumn(colPos, dispWidth, maxChars, title, dataType)
Creates and attaches a dynamic SAL column.
| Parameter | Type | Description |
|---|---|---|
| colPos | SalNumber | The column’s display position. |
| dispWidth | SalNumber | The width in horizontal form units. |
| maxChars | SalNumber | The maximum input length. |
| title | SalString | The column caption. |
| dataType | DataType | The SAL data type of the column values. |
Returns: SalNumber. The new column’s identifier.
CreateColumnEx(colPos, dispWidth, title, maxChars, dataType)
Creates a dynamic column using a numeric SAL data-type code.
| Parameter | Type | Description |
|---|---|---|
| colPos | SalNumber | The requested display position. |
| dispWidth | SalNumber | The width in horizontal form units. |
| title | SalString | The column caption. |
| maxChars | SalNumber | The maximum text length. |
| dataType | SalNumber | The SAL data-type code converted to DataType. |
Returns: SalNumber. The new SAL column identifier.
CreateColumnFromClass(className, position)
Instantiates a resolved SalTableColumn subclass and adds it as a dynamic column.
| Parameter | Type | Description |
|---|---|---|
| className | SalString | The class name resolved against the web application’s main assembly. |
| position | SalNumber | The display position, or a negative value to retain the default position. |
Returns: SalTableColumn. The new column, or null when the class cannot be resolved or is not a SalTableColumn subclass.
DefineRowHeader(title, width, flags, column)
Sets the row-header caption, width, flags, and optional mirror column.
| Parameter | Type | Description |
|---|---|---|
| title | SalString | The upper-left header caption. |
| width | SalNumber | The row-header width in pixels; a nonpositive value hides main-grid row headers before applying flags. |
| flags | SalNumber | The TBL_RowHdr_* flags to apply. |
| column | Control | The column whose values supply row-header text, or null. A foreign column is matched by identifier. |
Returns: SalBoolean. True when the settings have been applied.
DefineSplitWindow(rows, resizable)
Creates or removes the split grid when its configured row count changes.
| Parameter | Type | Description |
|---|---|---|
| rows | SalNumber | The split-grid row count; a nonpositive value removes the split grid. |
| resizable | SalBoolean | True to allow splitter resizing when the split grid is configured. |
Returns: SalBoolean. True.
If rows already equals SplitGridRows, no settings are changed, including resizable.
DeleteRow(rowNum, flag)
Removes a row or marks it deleted while suppressing user-click behavior.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| flag | SalNumber | TBL_NoAdjust to remove the row physically; another value to mark it deleted. |
Returns: SalBoolean. The row’s Deleted state after the operation, or false if the row was absent or already deleted.
DeleteSelected(hSql)
Executes the prepared SQL command for selected existing rows and marks selected rows deleted.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared delete-command handle; new rows skip SQL execution. |
Returns: SalBoolean. False when SQL execution fails; otherwise, true.
DeleteSelected(hSql, errorHandler)
Deletes selected rows within a temporary SQL error-handler context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared delete-command handle; new rows skip SQL execution. |
| errorHandler | WhenSqlErrorHandler | The callback active during SQL operations. |
Returns: SalBoolean. False when SQL execution fails; otherwise, true.
DestroyColumns()
Stops population and removes all rows and columns if every column is dynamic.
Returns: SalBoolean. True if the columns were removed or there were none; false if any column is not dynamic.
DestroyWindow()
Closes this window when it is a form, or disposes the control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
A true result reports that the close or disposal request was made; a form can apply its own closing behavior.
DisableWindow()
Disables input to this control, or clears editability for a table column.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
DisableWindowAndLabel()
Disables input to this control and disables its associated label.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
Dispose(disposing)
Marks this SAL window disposed before releasing the base control resources.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | True to release managed resources; false for finalization cleanup. |
DoDeletes(hSql, flagsOn)
Executes a prepared delete statement for matching existing rows and marks each processed row deleted.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle containing the prepared statement and row-context bindings. |
| flagsOn | SalNumber | The flags required on rows to process. |
Returns: SalBoolean. True if every required execution succeeds; false at the first execution failure.
New rows are marked deleted without executing SQL. The previous row context is restored; earlier successful operations are not rolled back.
DoDeletes(hSql, flagsOn, errorHandler)
Processes matching row deletions within a temporary SQL error-handler context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared delete-command handle. |
| flagsOn | Int32 | At least one required row flag, or zero for no inclusion filter. |
| errorHandler | WhenSqlErrorHandler | The callback active during SQL operations. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
DoInserts(hSql, clearFlags)
Executes the prepared SQL statement in the context of each matching new rows.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle containing the prepared statement and row-context bindings. |
| clearFlags | SalBoolean | True to clear ROW_New and ROW_Edited after each successful execution. |
Returns: SalBoolean. True if every execution succeeds; false at the first failure.
The previous row context is restored; earlier successful operations are not rolled back.
DoInserts(hSql, clearFlags, errorHandler)
Processes new-row inserts within a temporary SQL error-handler context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared insert-command handle. |
| clearFlags | SalBoolean | True to clear new and edited flags after each successful execution. |
| errorHandler | WhenSqlErrorHandler | The callback active during SQL operations. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
DoUpdates(hSql, clearFlags)
Executes the prepared SQL statement in the context of each matching edited rows that are not new.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle containing the prepared statement and row-context bindings. |
| clearFlags | SalBoolean | True to clear ROW_Edited after each successful execution. |
Returns: SalBoolean. True if every execution succeeds; false at the first failure.
The previous row context is restored; earlier successful operations are not rolled back.
DoUpdates(hSql, clearFlags, errorHandler)
Processes edited-row updates within a temporary SQL error-handler context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared update-command handle. |
| clearFlags | SalBoolean | True to clear the edited flag after each successful execution. |
| errorHandler | WhenSqlErrorHandler | The callback active during SQL operations. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
EnableWindow()
Enables input to this control, or enables editing for a table column.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
For text-box controls, this operation also clears the read-only setting.
Native disabled styles are also cleared. When needed, tab navigation is restored except for unchecked radio buttons.
EnableWindowAndLabel()
Enables input to this control and enables its associated label.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
FetchRow(rowNum)
Fetches a table row and makes it the current SAL row context on success.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context to fetch. |
Returns: SalNumber. The TBL_RowFetched, TBL_NoMoreRows, or TBL_Error result from the row fetch.
FindChild(sWindowName)
Searches this window for a child control by name.
| Parameter | Type | Description |
|---|---|---|
| sWindowName | SalString | The child control name to locate. |
Returns: SalWindowHandle. The matching child handle, or a null SAL handle if no child is found.
FindNextRow(rowNum, flagsOn, flagsOff)
Searches after the supplied row context for a row matching the flag masks.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The starting SAL row context; receives the matching context on success. |
| flagsOn | SalNumber | The flags required on the matching row. |
| flagsOff | SalNumber | The flags that must be clear on the matching row. |
Returns: SalBoolean. True if a matching row is found; otherwise, false.
Example:
Collect selected, visible row contexts without changing the current row context.
using PPJ.Runtime;
using PPJ.Runtime.Windows;
using Wisej.Web;
public static class SelectionExample
{
public static System.Collections.Generic.List<SalNumber> SelectedRows(
SalTableWindow table)
{
var rows = new System.Collections.Generic.List<SalNumber>();
SalNumber row = Sys.TBL_MinRow;
while (table.FindNextRow(ref row, Sys.ROW_Selected, Sys.ROW_Hidden))
rows.Add(row);
return rows;
}
}
FindPrevRow(rowNum, flagsOn, flagsOff)
Searches before the supplied row context for a row matching the flag masks.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The starting SAL row context; receives the matching context on success. |
| flagsOn | SalNumber | The flags required on the matching row. |
| flagsOff | SalNumber | The flags that must be clear on the matching row. |
Returns: SalBoolean. True if a matching row is found; otherwise, false.
FormUnitsToPixels(nFormUnits, bVertical)
Converts a length in form units to pixels using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| nFormUnits | SalNumber | The length in form units. |
| bVertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted pixel length.
FromControl(ctrl)
Gets a table control directly or from a SalFormTableWindow wrapper.
| Parameter | Type | Description |
|---|---|---|
| ctrl | Control | The control or form to inspect. |
Returns: SalTableWindow. The table, or null for any other control type.
GetClassName()
Gets the translated application class name associated with this control.
Returns: SalString. The class name, an empty string for a runtime-defined class, or a null SAL string for an unresolved or native control.
Forms use their base type; nested table-window types are walked upward to a non-nested type.
GetColumnFromId(colId)
Resolves a SAL column identifier to its column control.
| Parameter | Type | Description |
|---|---|---|
| colId | Int32 | The SAL column identifier. |
Returns: SalTableColumn. The column, or null when unresolved.
GetColumnFromPos(colPos)
Finds a SAL column by its display position.
| Parameter | Type | Description |
|---|---|---|
| colPos | Int32 | The column’s display position. |
Returns: SalTableColumn. The matching column, or null when no column occupies that position.
GetColumnText(colId, text)
Copies a column value from the current row context.
| Parameter | Type | Description |
|---|---|---|
| colId | SalNumber | The SAL column identifier. |
| text | SalString | Receives formatted cell text, binary-string data for a binary column, or an empty string for an unresolved column. |
Returns: SalBoolean. Always true.
GetColumnText(colId)
Gets a column value from the current row context.
| Parameter | Type | Description |
|---|---|---|
| colId | SalNumber | The SAL column identifier. |
Returns: SalString. Formatted cell text, binary-string data for a binary column, or an empty string for an unresolved column.
GetColumnWindow(nCol, nFlags)
Finds a column handle by display position or identifier.
| Parameter | Type | Description |
|---|---|---|
| nCol | SalNumber | The column position or identifier. |
| nFlags | SalNumber | COL_GetPos to interpret nCol as a display position; otherwise, it is an identifier. |
Returns: SalWindowHandle. The matching column handle, or a null handle.
GetContextRow()
Gets the SAL row context used for column-value access.
Returns: SalNumber. The current context-row value.
GetControlType()
Gets the SAL window type of this control.
Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.
GetFirstChild(nTypeMask)
Finds the first child matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| nTypeMask | SalNumber | The SAL window types to include; zero matches no controls. |
Returns: SalWindowHandle. The first matching child handle, or a null SAL handle when none matches.
Ordinary controls use tab order; table columns use their creation order, and MDI forms use their child-form collection.
GetFont(sName, nSize, nEnhancement)
Reads the control font's family, point size, and style flags.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | Receives the font family name. |
| nSize | SalNumber | Receives the size in points. |
| nEnhancement | SalNumber | Receives the combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if a font was available; otherwise, false.
GetLabelText(sText, nMaxLength)
Copies the associated label text to a supplied variable.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | Receives the label text when it can be read. |
| nMaxLength | SalNumber | The maximum number of leading characters to copy. |
Returns: SalNumber. The number of characters copied, or zero if no label text is available.
GetLabelText(nMaxLength)
Gets this control's associated label text.
| Parameter | Type | Description |
|---|---|---|
| nMaxLength | SalNumber | The maximum number of leading characters to return. |
Returns: SalString. The label text limited to the requested length, or an empty string if no label exists.
GetLinesPerRow(lines)
Copies the configured text-line count per row.
| Parameter | Type | Description |
|---|---|---|
| lines | SalNumber | Receives LinesPerRow. |
Returns: SalBoolean. Always true.
GetLinesPerRow()
Gets the configured text-line count per row.
Returns: SalNumber. The LinesPerRow setting.
GetLocation(nX, nY)
Reads this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| nX | SalNumber | Receives the horizontal location. |
| nY | SalNumber | Receives the vertical location. |
Returns: SalBoolean. Always true; an unresolved control produces zero coordinates.
GetLockedColumns()
Counts consecutive frozen columns from the start of the main grid’s display order.
Returns: SalNumber. The number of leading frozen columns.
GetName(sText)
Copies this control's name to the supplied variable.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | Receives the control name when the operation succeeds. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
GetName()
Gets this control's name.
Returns: SalString. The control name, or an empty string if the control cannot be resolved.
GetNextChild(nTypeMask)
Finds the next sibling matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| nTypeMask | SalNumber | The SAL window types to include; zero matches no controls. |
Returns: SalWindowHandle. The next matching control handle, or a null SAL handle when none matches.
GetNextColumn(prev, forward)
Traverses columns in collection order.
| Parameter | Type | Description |
|---|---|---|
| prev | SalTableColumn | The reference column, or null to return the first column regardless of direction. |
| forward | Boolean | True for the following column; false for the preceding column. |
Returns: SalTableColumn. The neighboring column, or null at a boundary or for an unknown reference column.
GetParent()
Gets the SAL parent form, owner, or table container for this control.
Returns: SalWindowHandle. The parent window handle, or a null SAL handle if no parent can be resolved.
GetProperty(sName, sValue)
Reads a SAL named property into a supplied variable.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
| sValue | SalString | Receives the value only when the property is found. |
Returns: SalBoolean. True if a non-null property value was found; otherwise, false.
GetProperty(sName)
Gets the value of a SAL named property.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
Returns: SalString. The property value, or a SAL null string if the value is unavailable.
GetRowFlags(rowNum, flags)
Tests whether a nondeleted row has any requested flag.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| flags | SalNumber | The flag mask; zero never matches. |
Returns: SalBoolean. True when at least one bit matches; false for an absent or deleted row.
GetSize(nWidth, nHeight)
Reads this control's size in form units.
| Parameter | Type | Description |
|---|---|---|
| nWidth | SalNumber | Receives the width. |
| nHeight | SalNumber | Receives the height. |
Returns: SalBoolean. Always true; an unresolved control produces a zero size.
GetTableFlags(flags)
Checks whether every requested table flag is enabled.
| Parameter | Type | Description |
|---|---|---|
| flags | SalNumber | The table flag mask. |
Returns: SalBoolean. True when all bits are set, including a zero mask.
GetText(sText, nMaxLen)
Copies this control's displayed text or long-string value to a SAL string.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | Receives the retrieved text. |
| nMaxLen | SalNumber | The maximum character count for ordinary text; ignored for a Sys.DT_LongString value. |
Returns: SalNumber. The number of characters copied, or zero when no text is available.
GetText(nMaxLen)
Gets this control's displayed text or long-string value.
| Parameter | Type | Description |
|---|---|---|
| nMaxLen | SalNumber | The maximum character count for ordinary text; ignored for a Sys.DT_LongString value. |
Returns: SalString. The retrieved text, or an empty string if the control cannot be resolved.
GetWindowColor(nColorIndex)
Reads a window or cell color as a Win32 color value.
| Parameter | Type | Description |
|---|---|---|
| nColorIndex | SalNumber | The Sys.COLOR_Index* color component to read. |
Returns: SalNumber. The color encoded as a Win32 color value, or zero if the control is unavailable.
GetWindowState()
Gets the visibility and form-state classification of this window.
Returns: SalNumber. A Sys.Window_* state code; visible non-form controls report Sys.Window_Normal.
HideWindow()
Hides this control or table column.
Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.
HideWindowAndLabel()
Hides this control and its associated label.
Returns: SalBoolean. The control's visibility before the operation, or false if it cannot be resolved.
HitTest(x, y, row, col, location)
Identifies table rows, columns, headers, and split regions at a client point.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | The horizontal client coordinate in pixels. |
| y | SalNumber | The vertical client coordinate in pixels. |
| row | SalNumber | Receives the SAL row context, or TBL_Error when no row is hit. |
| col | SalWindowHandle | Receives the SAL column handle, or a null handle when no column is hit. |
| location | SalNumber | Receives the combined TBL_XOver* and TBL_YOver* region flags. |
Returns: SalBoolean. True after the hit-test outputs are assigned, even when no cell is hit.
InsertRow(rowNum)
Inserts a fetched row marked ROW_New and makes it the SAL row context.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The context before which to insert; an index outside the target grid’s range appends a row. Use TBL_MaxRow to append to the main grid. |
Returns: SalNumber. The new row’s SAL context, or TBL_Error when an ArgumentException prevents insertion.
The grid’s focused row index is preserved. Editing is ended when possible, and edit and selection messages are suppressed during insertion.
InvalidateWindow()
Invalidates this control and its child controls for repainting.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
IsDerivedFromClass(tClass)
Tests this control's runtime type against an application base type.
| Parameter | Type | Description |
|---|---|---|
| tClass | Type | The type to test, including the framework's emulated inheritance relationships. |
Returns: SalBoolean. True if the runtime type derives from the requested type; otherwise, false.
IsEnabled()
Determines whether this control accepts input.
Returns: SalBoolean. The enabled state, or the editable flag for a table column; false if the control cannot be resolved.
IsVisible()
Determines whether this control is visible.
Returns: SalBoolean. The visible state, or the visibility flag for a table column; false if the control cannot be resolved.
KillCellEdit()
Ends editing in the current grid and selects its current row.
Returns: SalBoolean. True if editing ended successfully or no edit was active; otherwise, false.
KillFocusRow()
Clears the current cell in both main and split grids.
Returns: SalBoolean. True.
KillTimer(nIDEvent)
Stops an existing timer owned by this control.
| Parameter | Type | Description |
|---|---|---|
| nIDEvent | SalNumber | The identifier used when the timer was started. |
Returns: SalBoolean. True if the timer was found and stopped; otherwise, false.
The timer remains registered and can be restarted by SetTimer.
MoveWindow(nXOffset, nYOffset)
Moves this control by an offset expressed in form units.
| Parameter | Type | Description |
|---|---|---|
| nXOffset | SalNumber | The horizontal offset to add to the current position. |
| nYOffset | SalNumber | The vertical offset to add to the current position. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
NotifyRender(config)
Clears the pending header-height adjustment marker after rendering.
| Parameter | Type | Description |
|---|---|---|
| config | Object | The render configuration; this override does not inspect it. |
OnBeginEdit(grid, e)
Receives the cell-begin-edit notification without additional processing.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellCancelEventArgs | The event data. |
OnCellClick(grid, e)
Dispatches a click message for a noneditable cell when it was not already handled by the current-cell transition.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnCellDoubleClick(grid, e)
Sets the clicked row’s context and sends SAM_DoubleClick to its SAL column.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnCellFormatting(grid, e)
Replaces nonempty password-cell text with the column’s masked display text.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellFormattingEventArgs | The event data. |
OnCellValidating(grid, e)
Validates dirty or modified cell contents in their row context, restoring the previous context afterward.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellValidatingEventArgs | The event data. |
OnColumnHeaderMouseClick(grid, e)
Sends SAM_ColumnSelectClick to the column identified by the clicked header.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellMouseEventArgs | The event data. |
OnColumnHeaderMouseDoubleClick(grid, e)
Sends SAM_CaptionDoubleClick to the column identified by the double-clicked header.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellMouseEventArgs | The event data. |
OnCornerClick(grid, e)
Sends SAM_CornerClick for the upper-left header cell.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnCornerDoubleClick(grid, e)
Sends SAM_CornerDoubleClick for the upper-left header cell.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnCreateControl()
Creates the table infrastructure, records its initial font, and updates column headers.
OnCurrentCellChanged(grid, e)
Updates the row context and dispatches column focus and client-originated click messages for the new current cell.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | EventArgs | The event data. |
OnDefaultRowHeightChanged(grid, e)
Receives the default-row-height notification without additional processing.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | EventArgs | The event data. |
OnDoubleClick(grid, e)
Sends SAM_DoubleClick when the mouse is over the grid’s empty area.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | EventArgs | The event data. |
OnDragDrop(e)
Processes the SAL drop notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragEnd(e)
Ends SAL drag handling before raising the inherited drag-end event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnDragEnter(e)
Processes the SAL drag-enter notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragLeave(e)
Processes the SAL drag-leave notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnDragOver(e)
Processes SAL drag feedback before raising the inherited drag-over event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragStart(e)
Starts SAL drag handling before raising the inherited drag-start event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnEditingControlShowing(grid, e)
Configures the column editor, combo-box drop-down messages, popup height, password masking, and spell checking.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewEditingControlShowingEventArgs | The event data. |
OnEndEdit(grid, e)
Notifies the SAL column that its cell editor has closed.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnFontChanged(e)
Propagates the new font and updates column widths and header layout.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The font-change event data. |
OnGotFocus(grid, e)
Records this table as the focused SAL window and sends the grid’s focus-gain message.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | EventArgs | The event data. |
OnLastCellTab(grid, e)
Sends SAM_EndCellTab and restores the row context if a handler changes it.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnLostFocus(grid, e)
Sends the grid’s SAL focus-loss message unless the top-level form is closing.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | EventArgs | The event data. |
OnMouseDown(e)
Synchronizes the SAL row context with the current grid cell before raising the mouse event.
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The mouse event data. |
OnRowEnter(grid, e)
Sets the entered row’s context and sends SAM_RowSetContext.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellEventArgs | The event data. |
OnRowHeaderMouseClick(grid, e)
Sets the row context and sends SAM_RowHeaderClick.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellMouseEventArgs | The event data. |
OnRowHeaderMouseDoubleClick(grid, e)
Sets the row context and sends SAM_RowHeaderDoubleClick.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The main or split grid raising the event. |
| e | DataGridViewCellMouseEventArgs | The event data. |
OnRowValidating(grid, args)
Sends SAM_RowValidate in the row being left and restores the previous context afterward.
| Parameter | Type | Description |
|---|---|---|
| grid | DataGridView | The grid containing the row. |
| args | DataGridViewCellCancelEventArgs | The validation event data; Cancel is set for VALIDATE_Cancel or if the handler removes the row. |
OnValidating(e)
Validates the current cell when focus leaves the table, unless the table or an ancestor is disposing.
| Parameter | Type | Description |
|---|---|---|
| e | CancelEventArgs | The event data; Cancel is set when the current cell cannot be left. |
OnWebEvent(e)
Processes split-grid resize events in a SAL context and dispatches WinSDK-compatible event notifications.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | The browser event to process. |
OnWebRender(config)
Serializes internal-grid identifiers, cache settings, and split-grid options for the table’s browser component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | The mutable browser configuration and wired-event collection. |
PasteRows()
Appends rows from tab-separated Unicode clipboard text, assigning fields to visible columns.
Returns: SalBoolean. True when Unicode text is available and processed; false when no usable text is available.
Carriage returns and line feeds delimit rows; empty lines are skipped. Failed row insertions are skipped, so true does not guarantee every input row was inserted.
PixelsToFormUnits(nNumPixels, bVertical)
Converts a pixel length to form units using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| nNumPixels | SalNumber | The pixel length to convert. |
| bVertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted length in form units.
Populate(hSql, select, method)
Executes a query and populates the table, replacing existing rows and previous automatic columns.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle used to prepare, execute, and fetch the query. |
| select | SalString | The SQL statement, or empty text to execute the handle’s previously prepared statement. |
| method | SalNumber | TBL_FillNormal, TBL_FillAllBackground, or TBL_FillAll. |
Returns: SalBoolean. False if preparation or execution fails; otherwise, true after population is started or completed.
When no columns or INTO bindings exist, columns are created from the result schema. Selection messages are suppressed during setup; background population continues after this call returns.
Example:
Populate an initialized table using an already connected SQL handle. This example fetches all rows before returning.
using PPJ.Runtime;
using PPJ.Runtime.Windows;
using Wisej.Web;
public static class PopulationExample
{
public static bool LoadCustomers(SalTableWindow table, PPJ.Runtime.Sql.SalSqlHandle sql)
{
// CustomerId and CustomerName are columns in the application's database.
// With no existing columns or INTO bindings, result columns are generated.
return table.Populate(sql,
"SELECT CustomerId, CustomerName FROM Customers ORDER BY CustomerName",
Sys.TBL_FillAll);
}
}
Populate(hSql, select, method, errorHandler)
Executes a query and populates the table, replacing existing rows and previous automatic columns.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle used to prepare, execute, and fetch the query. |
| select | SalString | The SQL statement, or empty text to execute the handle’s previously prepared statement. |
| method | SalNumber | TBL_FillNormal, TBL_FillAllBackground, or TBL_FillAll. |
| errorHandler | WhenSqlErrorHandler | The SQL error handler installed for this call. |
Returns: SalBoolean. False if preparation or execution fails; otherwise, true after population is started or completed.
When no columns or INTO bindings exist, columns are created from the result schema. Selection messages are suppressed during setup; background population continues after this call returns.
Example:
Populate an initialized table using an already connected SQL handle. This example fetches all rows before returning.
using PPJ.Runtime;
using PPJ.Runtime.Windows;
using Wisej.Web;
public static class PopulationExample
{
public static bool LoadCustomers(SalTableWindow table, PPJ.Runtime.Sql.SalSqlHandle sql,
PPJ.Runtime.Sql.WhenSqlErrorHandler onSqlError)
{
// CustomerId and CustomerName are columns in the application's database.
// With no existing columns or INTO bindings, result columns are generated.
return table.Populate(sql,
"SELECT CustomerId, CustomerName FROM Customers ORDER BY CustomerName",
Sys.TBL_FillAll, onSqlError);
}
}
PostMessage(nMsg, nMywParam, nMylParam)
Queues a SAL window action for later dispatch on the application context.
| Parameter | Type | Description |
|---|---|---|
| nMsg | SalNumber | The SAL or application-defined message code. |
| nMywParam | SalNumber | The first message parameter. |
| nMylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. True if the action was queued; false if the control is unavailable or disposed.
QueryFocusCell(rowNum, column)
Retrieves the current row and enabled column from the focused split grid, or the main grid otherwise.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | Receives the current SAL row context, or TBL_Error when no current row exists. |
| column | SalWindowHandle | Receives the current SAL column handle, or a null handle when no column is current or the column is disabled. |
Returns: SalBoolean. True.
QueryRowHeader(title, maxTitle, width, flags, column)
Retrieves the main-grid row-header caption, width, flags, and mirror column.
| Parameter | Type | Description |
|---|---|---|
| title | SalString | Receives the header caption truncated to maxTitle characters, or empty text when no header column exists. |
| maxTitle | SalNumber | The maximum number of caption characters to return. |
| width | SalNumber | Receives the header width in pixels, or zero when no header column exists. |
| flags | SalNumber | Receives the TBL_RowHdr_* flags. |
| column | SalWindowHandle | Receives the mirror column handle. |
Returns: SalBoolean. True.
QueryScroll(position, minRange, maxRange)
Retrieves the main grid’s first displayed row and current row-index range.
| Parameter | Type | Description |
|---|---|---|
| position | SalNumber | Receives the first displayed row index. |
| minRange | SalNumber | Receives the first nondeleted row context found from MinRow, or MinRow when none is found. |
| maxRange | SalNumber | Receives the main-grid row count minus one. |
Returns: SalBoolean. True.
QuerySplitWindow(rows, resizable)
Retrieves the split-grid row count and splitter enabled state.
| Parameter | Type | Description |
|---|---|---|
| rows | SalNumber | Receives the configured row count, or zero when no split grid exists. |
| resizable | SalBoolean | Receives Splitter.Enabled, or false when no split grid exists. |
Returns: SalBoolean. True.
The returned resizable value reflects the splitter’s Enabled property, rather than its IsSplitterFixed setting.
QueryVisibleRange(minRange, maxRange)
Retrieves the first and last main-grid rows whose Visible state is set.
| Parameter | Type | Description |
|---|---|---|
| minRange | SalNumber | Receives the first visible row context, or TBL_Error when none exists. |
| maxRange | SalNumber | Receives the last visible row context, or TBL_Error when none exists. |
Returns: SalBoolean. True.
Visibility here is the row’s Visible state, not whether the row is currently within the scrolled viewport.
ResetTable()
Stops population, ends the current edit, and clears the table’s row data.
Returns: SalBoolean. True if the table was reset; false if the current edit could not end.
ScrollRow(rowNum, column)
Fetches a requested row as needed and scrolls its cell into view.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The requested SAL row context. |
| column | Control | The target column, or null for the first grid column. |
Returns: SalBoolean. Always true after scrolling; a row that cannot be fetched falls back to the main grid header position.
ScrollRow(rowNum, column, flags)
Scrolls a row and column into view, optionally aligning them to the top or bottom.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context; -1 requests column-only scrolling. |
| column | Control | The SAL column, or null to use the first column. A foreign column is matched by identifier. |
| flags | SalNumber | TBL_ScrollTop, TBL_ScrollBottom, or another value for normal scrolling. |
Returns: SalBoolean. True if the resolved cell can be scrolled into view; false for an invalid cell or a missing column in column-only mode.
If the requested row cannot be fetched, the implementation falls back to main-grid row zero.
SendMessage(nMsg, nMywParam, nMylParam)
Dispatches a SAL window action synchronously and returns its result.
| Parameter | Type | Description |
|---|---|---|
| nMsg | SalNumber | The SAL or application-defined message code. |
| nMywParam | SalNumber | The first message parameter. |
| nMylParam | SalNumber | The second message parameter. |
Returns: SalNumber. The action's return value, or zero if the target is unavailable or disposed.
SendMessageToChildren(nMsg, nMywParam, nMylParam)
Dispatches a SAL message to this control's children.
| Parameter | Type | Description |
|---|---|---|
| nMsg | SalNumber | The SAL or application-defined message code. |
| nMywParam | SalNumber | The first message parameter. |
| nMylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. The result of child-message dispatch; false if the parent is unavailable or disposed.
SetColumnText(columnId, text)
Assigns text to a column in the current row context.
| Parameter | Type | Description |
|---|---|---|
| columnId | SalNumber | The SAL column identifier. |
| text | SalString | The text to assign. |
Returns: SalBoolean. True when the column resolves and assignment completes; otherwise, false.
SetContextMenu(sMenuName, nFlags)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| sMenuName | SalString | The menu type name to resolve. |
| nFlags | SalNumber | Use Sys.CM_TableCell to assign the table's cell-editor menu; otherwise, assign the control's context menu. |
Returns: SalBoolean. True if a control and menu type resolve and the menu is created; otherwise, false.
When called during a SAL context-menu action, the created menu is also shown at the current mouse position.
SetContextMenu(menuType, nFlags)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The type of the menu to create. |
| nFlags | SalNumber | Use Sys.CM_TableCell to target the associated table column; other values target the control. |
Returns: SalBoolean. True if the menu was created; false if the control or menu type is unavailable or menu creation fails.
SetContextRow(rowNum)
Changes the row context used by column-value access.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL context row, including the temporary-row code where supported. |
Returns: SalBoolean. True when context changes successfully; false for an untranslatable, invalid, or deleted row.
SetCursor(nResourceId, nType)
Assigns a predefined cursor to the requested role.
| Parameter | Type | Description |
|---|---|---|
| nResourceId | Int32 | A supported Sys.CURSOR_* cursor identifier. |
| nType | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.
SetCursor(sBlob, nType)
Requests a cursor from binary data; this web implementation does not support binary cursor loading.
| Parameter | Type | Description |
|---|---|---|
| sBlob | SalString | The binary cursor data. |
| nType | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. Always false.
SetCursorFile(sFile, nType)
Loads a cursor from a file and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| sFile | SalString | The cursor file path. |
| nType | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.
Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.
SetFlagsAnyRows(flags, on, flagsOn, flagsOff)
Changes row flags on matching rows in both main and split grids.
| Parameter | Type | Description |
|---|---|---|
| flags | SalNumber | The ROW_* flags to change. |
| on | SalBoolean | True to set the flags; false to clear them. |
| flagsOn | SalNumber | The flags required on rows to change. |
| flagsOff | SalNumber | The flags that must be clear on rows to change. |
Returns: SalBoolean. True if at least one grid processed matching rows; false if no rows matched or required edit completion failed in every matching grid.
SetFocus()
Moves keyboard focus to this control, deferring the change when SAL validation is in progress.
Returns: SalWindowHandle. The previously focused managed control as a SAL handle, or a null handle if the target is unavailable, a table column, an ActiveX host, disabled, or hidden.
SetFocusCell(rowNum, column)
Fetches a row and focuses its specified column, ending a different active cell edit first.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| column | Control | The SAL column to focus, or a control that does not resolve to a column to focus the row header. A foreign column is matched by identifier. |
Returns: SalBoolean. True when focus is set or already correct; false when the column, row, edit completion, or cell change prevents the operation.
For a hidden cell, only the SAL row context is updated and the current cell is cleared. Programmatic changes suppress SAM_Click.
SetFocusRow(rowNum)
Focuses a visible, nondeleted row’s header after ending editing and fetching the row.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context to focus. |
Returns: SalBoolean. True if the row receives focus; false if the row is invalid, hidden, deleted, unavailable, or cannot be focused.
The operation preserves selection and suppresses SAM_Click generated by programmatic cell changes.
SetFont(sName, nSize, nEnhancement)
Creates and assigns a font to this control.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The font family name. |
| nSize | SalNumber | The font size in points. |
| nEnhancement | SalNumber | The combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if the font was created and assigned; otherwise, false.
SetLabelText(sText)
Assigns the text of this control's associated label.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | The label text to display. |
Returns: SalBoolean. True if an associated label was found and updated; otherwise, false.
SetLinesPerRow(nLines)
Assigns the text-line count used for row sizing.
| Parameter | Type | Description |
|---|---|---|
| nLines | SalNumber | A line count from 1 through 32; other values are ignored. |
Returns: SalBoolean. Always true, including ignored assignments.
SetLocation(nX, nY)
Sets this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| nX | SalNumber | The new horizontal coordinate. |
| nY | SalNumber | The new vertical coordinate. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
For forms, this also selects manual startup positioning.
SetLockedColumns(locked)
Freezes the leading columns in display order in both grids and prevents moving those columns.
| Parameter | Type | Description |
|---|---|---|
| locked | SalNumber | The number of leading columns to freeze, clamped to zero through the grid’s column count. |
Returns: SalBoolean. True.
SetProperty(sName, sValue, nLength)
Assigns a SAL named property after limiting the value's length.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
| sValue | SalString | The value to assign. |
| nLength | SalNumber | The number of leading characters to retain. |
Returns: SalBoolean. True if the translated control implements the SAL window contract; otherwise, false.
SetRange(min, max)
Stops current population and establishes the main-grid row range.
| Parameter | Type | Description |
|---|---|---|
| min | SalNumber | The minimum row context; a negative value leaves the range unchanged after ending editing. |
| max | SalNumber | The inclusive maximum row context; less than min clears the main grid, and TBL_MaxRow requests an unbounded fill. |
Returns: SalBoolean. False if editing cannot end; otherwise, true.
SetRow(rowPos)
Moves the row context and focus to the first, last, next, or previous visible fetched row.
| Parameter | Type | Description |
|---|---|---|
| rowPos | SalNumber | TBL_SetFirstRow, TBL_SetLastRow, TBL_SetNextRow, or TBL_SetPrevRow. |
Returns: SalNumber. The selected row context, or TBL_Error if navigation fails.
Next and previous navigation start from FocusRow. Last-row navigation fetches all remaining rows before searching backward.
SetRowFlags(rowNum, flags, on)
Changes the specified flags on an existing, nondeleted row.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| flags | SalNumber | The ROW_* flags to change. |
| on | SalBoolean | True to set the flags; false to clear them. |
Returns: SalBoolean. True if the flags were applied; false for an absent or deleted row, or if editing cannot end before changing ROW_Selected.
SetSize(nWidth, nHeight)
Sets this control's dimensions in form units.
| Parameter | Type | Description |
|---|---|---|
| nWidth | SalNumber | The new width. |
| nHeight | SalNumber | The new height. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetTableFlags(flags, on)
Ends the current grid edit and changes the specified table flags.
| Parameter | Type | Description |
|---|---|---|
| flags | SalNumber | The TBL_Flag_* mask to change. |
| on | SalBoolean | True to set the flags; false to clear them. |
Returns: SalBoolean. True; the return value from ending the edit is ignored.
SetText(sText)
Assigns the control's text.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | The text to display. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetTimer(nIDEvent, nElapseMilliSec)
Starts or restarts a timer that sends SAL timer actions to this control.
| Parameter | Type | Description |
|---|---|---|
| nIDEvent | SalNumber | The timer identifier sent in the first parameter of each Sys.SAM_Timer action. |
| nElapseMilliSec | SalNumber | The interval between ticks, in milliseconds. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetWindowColor(nColorIndex, nColor)
Assigns a window or table-cell color.
| Parameter | Type | Description |
|---|---|---|
| nColorIndex | SalNumber | The Sys.COLOR_Index* component to change. |
| nColor | SalNumber | The SAL color value to translate and assign. |
Returns: SalBoolean. True for a supported color index and resolved control; otherwise, false.
Cell colors apply only to table columns. Window colors on table windows also update their grid styles.
ShowWindow()
Shows this control or table column.
Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.
ShowWindowAndLabel()
Shows this control and its associated label.
Returns: SalBoolean. The control's visibility before the operation, or false if it cannot be resolved.
SortRows(colId, order)
Sorts the main-grid rows using a column that has COL_EnableSort set.
| Parameter | Type | Description |
|---|---|---|
| colId | SalNumber | The SAL column identifier. |
| order | SalNumber | TBL_SortDecreasing for descending order; otherwise, ascending order. |
Returns: SalBoolean. False if the column is absent or sorting is disabled on it; otherwise, true.
Selection messages are suppressed, and the main-grid row context is synchronized after sorting.
TrackPopupMenu(sMenuName, nFlags, nX, nY, callback)
Creates and displays a popup menu, disposing it after it closes.
| Parameter | Type | Description |
|---|---|---|
| sMenuName | SalString | The name used to resolve the menu type. |
| nFlags | SalNumber | Popup flags controlling right alignment and use of the current cursor coordinates. Center alignment and context-menu flags are not supported. |
| nX | SalNumber | The horizontal screen coordinate in pixels, unless the cursor-X flag is set. |
| nY | SalNumber | The vertical screen coordinate in pixels, unless the cursor-Y flag is set. |
| callback | Action<ContextMenu> | An optional callback invoked when the menu closes, before it is disposed. |
Returns: SalBoolean. True if the menu was created and shown; otherwise, false.
TrackPopupMenu(menuType, nFlags, nX, nY, callback)
Creates and displays a popup menu, disposing it after it closes.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| nFlags | SalNumber | Popup flags controlling right alignment and use of the current cursor coordinates. Center alignment and context-menu flags are not supported. |
| nX | SalNumber | The horizontal screen coordinate in pixels, unless the cursor-X flag is set. |
| nY | SalNumber | The vertical screen coordinate in pixels, unless the cursor-Y flag is set. |
| callback | Action<ContextMenu> | An optional callback invoked when the menu closes, before it is disposed. |
Returns: SalBoolean. True if the menu was created and shown; otherwise, false.
UpdateColumnHeaders()
Enables header wrapping when a caption contains a newline and schedules header-height adjustment.
UpdateColumnWidths()
Reapplies column widths after creation or designer loading and records the current base font.
UpdateWindow()
Requests an update of this control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
Events
WindowActions
WindowActionsEventHandler Occurs when this control dispatches a SAL or custom window action.
Implements
| Name | Description |
|---|---|
| ISalControl | Exposes a SAL control's data type, value, and modification state. |
| ISalWindow | Provides SAL window actions, named properties, and access to a window's runtime implementation. |