SalTableWindow
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Runtime.50 (5.0.0.0)
Displays SAL table rows and columns with window actions, cell editing, and row enumeration.
- 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:
void AddControl(System.Windows.Forms.Control parent)
{
var control = new PPJ.Runtime.Windows.SalTableWindow();
control.Name = "SalTableWindow";
parent.Controls.Add(control);
}
Constructors
SalTableWindow()
Initializes the table window, its SAL message host, and its table-filling helper.
Properties
AllowAutoEditing
Boolean: Gets or sets whether eligible focused cells automatically enter edit mode. (Default: False)
AllowFiltering
Boolean: Gets or sets interactive filtering in the main grid. (Default: False)
Disabling filtering resets every main-grid column filter.
AllowRowSizing
Boolean: Gets or sets the row-header flag that permits row resizing. (Default: False)
BackgroundFillInterval
Int32: Gets or sets the timer interval in milliseconds used when starting background table population.
BackgroundFillRows
Int32: Gets or sets the maximum number of rows fetched during each background-fill batch.
CellContextMenu
ContextMenu: Gets or sets the legacy context menu assigned to cell editors. (Default: null)
CellContextMenuStrip
ContextMenuStrip: Gets or sets the Windows Forms menu strip assigned to cell editors. (Default: null)
CultureInfo
CultureInfo: Gets or sets the culture used by table values, falling back at run time to the containing SAL form and then Sys.CultureInfo. (Default: null)
Assigning null or the current Sys.CultureInfo clears the explicit setting. Throws:
- ArgumentException The assigned explicit culture is neutral.
DefaultFocusRowStyle
FocusRowStyle: Gets or sets the initial focus-row frame style for subsequently constructed tables.
GetMergedRangeHandler
GetMergedRangeDelegate: Gets or sets the callback that overrides merged-range resolution.
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 the number of text lines used to calculate row height. (Default: 1)
Only values from 1 through 32 are accepted; other assignments are ignored.
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 editing is disabled in both main and split grids. (Default: False)
RowSizingStyle
RowsSizingStyle: Gets or sets how user row resizing propagates to other rows. (Default: FreeSize)
UseNativeTypes
Boolean: Gets or sets native data-type handling for cell values and refreshes every column cell type when changed. (Default: False)
VirtualMode
Boolean: Gets or sets whether the main grid fetches visible rows after scrolling. (Default: False)
Enabling this mode installs a scroll handler and enables delayed scrolling.
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(colStart, colEnd, extraSpace)
Sizes an inclusive range of columns to their contents and synchronizes widths across both grids and SAL column controls.
| Parameter | Type | Description |
|---|---|---|
| colStart | Int32 | The first native grid-column index. |
| colEnd | Int32 | The last native grid-column index. |
| extraSpace | Int32 | Additional width in pixels. |
When a split grid exists, each column uses the larger width required by either grid.
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(type)
Restores the default cursor for a role, using the I-beam for TextBox subclasses.
| Parameter | Type | Description |
|---|---|---|
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
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 a dynamic column with an explicit data type.
| 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. |
| dataType | DataType | The value type of the new column. |
Returns: SalNumber. The new SAL column 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 named SalTableColumn subclass and adds it as a dynamic column.
| Parameter | Type | Description |
|---|---|---|
| className | SalString | The type name resolved against the entry assembly. |
| position | SalNumber | The requested display position; negative values leave the appended position unchanged. |
Returns: SalTableColumn. The new column, or null when the type is unresolved or is not a SalTableColumn subclass.
DefineRowHeader(title, width, flags, column)
Configures the row-header caption, width, flags, and optional mirrored column.
| Parameter | Type | Description |
|---|---|---|
| title | SalString | The row-header caption. |
| width | SalNumber | The row-header width in pixels. |
| flags | SalNumber | The Sys.TBL_RowHdr_* display flags. |
| column | Control | The column to mirror; a column from another table is resolved by its identifier in this table. |
Returns: SalBoolean. Always true after applying the settings.
DefineSplitWindow(rows, resizable)
Creates or resizes the split grid, or removes it for a nonpositive row count.
| Parameter | Type | Description |
|---|---|---|
| rows | SalNumber | The desired visible split-row count; zero or less removes the split. |
| resizable | SalBoolean | Whether the split separator can be dragged. |
Returns: SalBoolean. Always true after processing.
DeleteRow(rowNum, flag)
Removes or logically deletes a table row and updates row context.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL context row to delete. |
| flag | SalNumber | Sys.TBL_NoAdjust physically removes the row; other values mark it deleted and hidden. |
Returns: SalBoolean. True when deletion succeeds; false for an absent, already deleted, or validation-blocked row.
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 only when every column is dynamic.
Returns: SalBoolean. True when no columns exist or all dynamic columns are destroyed; false if any static column prevents destruction.
Population is stopped even when a static column prevents removal.
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.
DoDeletes(hSql, flagsOn)
Executes a prepared delete command for matching existing rows and marks matching rows deleted.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared SQL handle, using each matching row as context. |
| flagsOn | SalNumber | At least one required row flag, or zero to include all nondeleted rows. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
New rows are deleted locally without SQL execution. Earlier successful operations are retained if a later row fails.
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 command with each new row as context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared insert-command handle. |
| clearFlags | SalBoolean | True to clear ROW_New and ROW_Edited after each successful execution. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
When rows are processed, context remains on the last attempted row.
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 command with each edited, nonnew row as context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The prepared update-command handle. |
| clearFlags | SalBoolean | True to clear ROW_Edited after each successful execution. |
Returns: SalBoolean. False at the first failed execution; otherwise, true.
When rows are processed, context remains on the last attempted row.
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 through the requested row as needed, dispatches SAL fetch actions, and sets context on success.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The requested SAL row context. |
Returns: SalNumber. Sys.TBL_RowFetched, Sys.TBL_RowDeleted, or Sys.TBL_NoMoreRows.
FindChild(windowName)
Searches this window for a child control by name.
| Parameter | Type | Description |
|---|---|---|
| windowName | 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)
Finds the next matching nondeleted row, continuing from split rows into the main grid.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The starting context row; receives the match on success and remains unchanged on failure. TBL_MinRow starts before the first row. |
| 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 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 System.Windows.Forms;
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)
Finds a matching nondeleted row before the supplied context.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The starting context row; receives the match on success and remains unchanged on failure. |
| 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 row is found; otherwise, false.
FireWindowActions(msg, mywParam, mylParam)
Invokes this control's SAL action handlers directly and returns their result.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The action message code. |
| mywParam | SalNumber | The first action parameter. |
| mylParam | SalNumber | The second action parameter. |
Returns: SalNumber. The result stored in the dispatched action arguments.
FireWindowActionsToChildren(nMsg, nMywParam, nMylParam)
Dispatches a SAL action directly to eligible child controls and descendants.
| Parameter | Type | Description |
|---|---|---|
| nMsg | Int32 | The action message code. |
| nMywParam | SalNumber | The first action parameter. |
| nMylParam | SalNumber | The second action parameter. |
Returns: SalBoolean. True after dispatching; false for an unavailable or disposed target.
Traversal does not descend into embedded forms or user controls.
FormUnitsToPixels(formUnits, vertical)
Converts a length in form units to pixels using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| formUnits | SalNumber | The length in form units. |
| vertical | 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)
Resolves a physical grid-column position to its SAL column control.
| Parameter | Type | Description |
|---|---|---|
| colPos | Int32 | The native grid-column index, including fixed columns in the indexing scheme. |
Returns: SalTableColumn. The associated SAL column, or null when unresolved.
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)
Resolves a column handle by identifier or physical grid position.
| Parameter | Type | Description |
|---|---|---|
| nCol | SalNumber | The column identifier or native grid index. |
| nFlags | SalNumber | Sys.COL_GetPos selects position lookup; other values select identifier lookup. |
Returns: SalWindowHandle. The column handle, or a null SAL handle when unresolved.
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(typeMask)
Finds the first child matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| typeMask | 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(name, size, enhancement)
Reads the control font's family, point size, and style flags.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | Receives the font family name. |
| size | SalNumber | Receives the size in points. |
| enhancement | 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(x, y)
Reads this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | Receives the horizontal location. |
| y | SalNumber | Receives the vertical location. |
Returns: SalBoolean. Always true; an unresolved control produces zero coordinates.
GetLockedColumns()
Gets the main grid frozen-column count.
Returns: SalNumber. The frozen count reported by the underlying grid.
GetMergedRange(row, col, clip)
Resolves merging through the configured callback or an enclosing form table.
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | The native grid row index. |
| col | Int32 | The native grid column index. |
| clip | Boolean | Whether the result should be clipped to the visible area. |
Returns: CellRange. The custom range, or an empty range when no provider exists.
GetName(text)
Copies this control's name to the supplied variable.
| Parameter | Type | Description |
|---|---|---|
| text | 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(typeMask)
Finds the next sibling matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| typeMask | 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(name, value)
Reads a SAL named property into a supplied variable.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The property name. |
| value | SalString | Receives the value only when the property is found. |
Returns: SalBoolean. True if a non-null property value was found; otherwise, false.
GetProperty(name)
Gets the value of a SAL named property.
| Parameter | Type | Description |
|---|---|---|
| name | 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(width, height)
Reads this control's size in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | Receives the width. |
| height | 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(text, maxLen)
Copies this control's displayed text or long-string value to a SAL string.
| Parameter | Type | Description |
|---|---|---|
| text | SalString | Receives the retrieved text. |
| maxLen | 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(maxLen)
Gets this control's displayed text or long-string value.
| Parameter | Type | Description |
|---|---|---|
| maxLen | 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(colorIndex)
Reads a window or cell color as a Win32 color value.
| Parameter | Type | Description |
|---|---|---|
| colorIndex | 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.
Transparent colors are reported as Sys.COLOR_None. Table-column window colors use the system window colors; cell colors use the column settings.
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)
Classifies a table point against rows, headers, locked columns, and the split area.
| 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 associated column handle, or a null handle. |
| location | SalNumber | Receives the combined Sys.TBL_XOver* and Sys.TBL_YOver* location flags. |
Returns: SalBoolean. Always true after testing, including points outside data cells.
InsertRow(rowNum)
Inserts a fetched row marked ROW_New and makes it the current row context.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The insertion context; use TBL_MaxRow to append. Out-of-range translated positions append, and header positions are clamped past fixed rows. |
Returns: SalNumber. The new context row, or Sys.TBL_Error for a disposed grid or an argument error.
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(typeClass)
Tests this control's runtime type against an application base type.
| Parameter | Type | Description |
|---|---|---|
| typeClass | 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()
Finishes editing and selects the current full row when an active data column exists.
Returns: SalBoolean. True if editing finishes; false if validation prevents completion.
KillFocusRow()
Removes cell focus rectangles from both grids.
Returns: SalBoolean. Always true after updating the grids.
KillTimer(idEvent)
Stops the native window timer with the specified identifier.
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber | The timer identifier to remove. |
Returns: SalBoolean. The native timer-removal result, or false if the control cannot be resolved.
MoveWindow(xOffset, yOffset)
Moves this control by an offset expressed in form units.
| Parameter | Type | Description |
|---|---|---|
| xOffset | SalNumber | The horizontal offset to add to the current position. |
| yOffset | 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.
OnAfterResizeRow(grid, args)
Propagates the new row height according to RowSizingStyle and fetches the resulting visible range.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RowColEventArgs | The resized row. |
OnAfterRowColChange(grid, args)
Updates context and focus styling, dispatches SAL context, focus, and user-click actions, and starts eligible automatic editing.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RangeEventArgs | The old and new ranges. |
OnAfterScroll(grid, args)
Runs base scroll synchronization and fetches visible rows when the main grid scrolls downward.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RangeEventArgs | The old and new visible ranges. |
OnBeforeMouseDown(grid, args)
Caches the initial hit-test result before base mouse processing can alter grid layout.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | BeforeMouseDownEventArgs | The pending mouse input and cancellation state. |
OnBeforeRowColChange(grid, args)
Finishes editing, sends focus-loss and row-validation actions, and restores focus when the cell change is canceled.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RangeEventArgs | The proposed old and new ranges and cancellation state. |
OnButtonClick(grid, args)
Sends SAM_Click with the native column index and current SAL row context.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RowColEventArgs | The cell containing the button. |
OnChangeEdit(grid, args)
Synchronizes row context, marks the cell modified and unvalidated, and dispatches SAM_AnyEdit.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | EventArgs | The edit-change event data. |
OnChildEditWndProc(sender, edit, m)
Dispatches SAL mouse, keyboard, context-menu, and double-click actions for a cell editor.
| Parameter | Type | Description |
|---|---|---|
| sender | NativeWindow | The native editor-window hook. |
| edit | Control | The receiving editor control. |
| m | Message | The native message and result. |
Returns: Boolean. True when processing should stop; otherwise, the base hook result.
OnChildGridWndProc(sender, grid, m)
Dispatches SAL mouse, keyboard, scroll, command, and double-click actions for a child grid.
| Parameter | Type | Description |
|---|---|---|
| sender | NativeWindow | The native grid-window hook. |
| grid | C1FlexGrid | The receiving grid. |
| m | Message | The native message and result. |
Returns: Boolean. True when processing should stop; otherwise, the base hook result.
OnDrawCell(grid, args)
Replaces displayed data-cell text with password text for masked columns, except during measurement.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | OwnerDrawCellEventArgs | The cell, text, and drawing state. |
OnFontChanged(e)
Recalculates column widths, row line heights, and header heights for the new font.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The font-change event data. |
OnGotFocus(grid, lostFocusHandle)
Applies focused styling and sends SAM_SetFocus while avoiding duplicate notifications during mouse-driven cell changes.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The grid receiving focus. |
| lostFocusHandle | IntPtr | The previously focused native window. |
OnHandleCreated(e)
Captures the base font and recalculates column-header heights after base handle initialization.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The handle-creation event data. |
OnLeaveEdit(grid, args)
Closes combo drop-downs and validates unvalidated cell data before permitting editor exit.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RowColEventArgs | The cell leaving edit mode. |
OnLostFocus(grid, gotFocusHandle)
Applies inactive styling, clears cached hit testing, and sends SAM_KillFocus unless the containing form is closing.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The grid losing focus. |
| gotFocusHandle | IntPtr | The native window receiving focus. |
OnMouseDown(grid, args)
Translates eligible left-button cell and header clicks into SAL actions and starts automatic editing when appropriate.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | MouseEventArgs | The mouse location, button, and click count. |
OnResize(grid, args)
Fetches rows needed by the visible range when the main grid is resized.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | EventArgs | The resize event data. |
OnRowChangeValidate(grid, args)
Sends SAM_RowValidate for the current nondeleted row and cancels navigation for a rejected or invalid destination.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RangeEventArgs | The pending row change and cancellation state. |
OnSetupEditor(grid, args)
Attaches the configured cell context menu after base editor setup, preferring the legacy menu over the menu strip.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | RowColEventArgs | The cell whose editor is being configured. |
OnValidateEdit(grid, args)
Validates checkbox or ordinary cell values in the correct row context while preventing recursive validation.
| Parameter | Type | Description |
|---|---|---|
| grid | C1FlexGrid | The originating grid. |
| args | ValidateEditEventArgs | The proposed cell value and validation state. |
OnValidating(e)
Attempts to finish the current cell edit when focus leaves a live table and form.
| Parameter | Type | Description |
|---|---|---|
| e | CancelEventArgs | The validation event, canceled when cell editing cannot finish. |
PasteRows()
Appends clipboard Unicode text as newline-separated rows and tab-separated visible-column values.
Returns: SalBoolean. True when text was available for processing, even if it contains no nonempty rows; false when text is unavailable or an exception is caught.
Hidden columns do not consume fields. Earlier inserted rows remain if a later operation fails.
PixelsToFormUnits(numPixels, vertical)
Converts a pixel length to form units using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| numPixels | SalNumber | The pixel length to convert. |
| vertical | 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 repopulates the table using immediate, demand-driven, or background filling.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle used to prepare, execute, and fetch. |
| select | SalString | The SQL statement, or an empty value to reuse a prepared statement. |
| method | SalNumber | Sys.TBL_FillNormal, TBL_FillAllBackground, or TBL_FillAll; an unrecognized combination defaults to filling all rows. |
Returns: SalBoolean. False if preparation or execution fails; otherwise, the population result.
Existing rows and automatic columns are replaced. Columns can be generated from the result schema when no columns or INTO bindings are present.
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 System.Windows.Forms;
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)
Repopulates the table within a temporary SQL error-handler context.
| Parameter | Type | Description |
|---|---|---|
| hSql | SalSqlHandle | The SQL handle used to prepare, execute, and fetch. |
| select | SalString | The statement, or an empty value to reuse the prepared statement. |
| method | SalNumber | The Sys.TBL_FillNormal, TBL_FillAllBackground, or TBL_FillAll population mode. |
| errorHandler | WhenSqlErrorHandler | The SQL callback active during this call. |
Returns: SalBoolean. False if preparation or execution fails; otherwise, the population result.
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 System.Windows.Forms;
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);
}
}
PopulateFromXML(file, rootNode, tableNode, useSchema)
Clears table rows and loads XML records by matching field element names to column titles.
| Parameter | Type | Description |
|---|---|---|
| file | SalString | The XML file path. |
| rootNode | SalString | The element name used to select records or the table container. |
| tableNode | SalBoolean | True to use children of the first matching element as rows; false to use the matching elements themselves. |
| useSchema | SalBoolean | True to add columns from the companion base-name_Schema.xsd file, resolved in the current directory. |
Returns: SalBoolean. True after loading rows; false when no matching elements exist.
SAM_XMLRowDone is sent for each row. XML and file errors are traced and rethrown; rows can already have been cleared.
PostMessage(msg, mywParam, mylParam)
Posts a native Windows message to this control for asynchronous processing.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The Windows or SAL message code. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. True if the native message was posted; false for an unavailable or disposed control, or if posting fails.
ProcessCmdKey(msg, keyData)
Applies table navigation for Tab, Shift+Tab, Enter, and Escape after base command-key processing.
| Parameter | Type | Description |
|---|---|---|
| msg | Message | The keyboard message. |
| keyData | Keys | The key and modifier flags. |
Returns: Boolean. True when base processing or table navigation handles the key; otherwise, false.
QueryFocusCell(rowNum, column)
Reads the current grid row and its enabled SAL column.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | Receives the translated focused-row context. |
| column | SalWindowHandle | Receives the column handle, or a null handle when the active column is absent or disabled. |
Returns: SalBoolean. Always true.
QueryRowHeader(title, maxTitle, width, flags, column)
Reads the row-header caption, size, flags, and mirrored column.
| Parameter | Type | Description |
|---|---|---|
| title | SalString | Receives the caption, or an empty string if no header exists. |
| maxTitle | SalNumber | The maximum number of caption characters to copy. |
| width | SalNumber | Receives the header width in pixels, or zero if absent. |
| flags | SalNumber | Receives the row-header flag mask. |
| column | SalWindowHandle | Receives the mirrored column handle, or a null handle. |
Returns: SalBoolean. Always true.
QueryScroll(position, minRange, maxRange)
Reads the main grid top-row position and current row range.
| Parameter | Type | Description |
|---|---|---|
| position | SalNumber | Receives the top row relative to fixed headers. |
| minRange | SalNumber | Receives a nonnegative lower bound adjusted for deleted rows. |
| maxRange | SalNumber | Receives the final data-row index, or -1 for no data rows. |
Returns: SalBoolean. Always true.
QuerySplitWindow(rows, resizable)
Reads the split grid visible row span and resize setting.
| Parameter | Type | Description |
|---|---|---|
| rows | SalNumber | Receives the visible row span, or zero when no split exists. |
| resizable | SalBoolean | Receives the splitter enabled state, or false when no split exists. |
Returns: SalBoolean. Always true.
QueryVisibleRange(minRange, maxRange)
Calculates the main grid visible row span, including estimated unused space below existing rows.
| Parameter | Type | Description |
|---|---|---|
| minRange | SalNumber | Receives the nonnegative first visible data-row index. |
| maxRange | SalNumber | Receives the estimated last visible data-row index, which may exceed existing data. |
Returns: SalBoolean. Always true.
ResetTable()
Stops population, finishes editing, and clears table rows while suppressing redraw.
Returns: SalBoolean. True after resetting; false when editing cannot finish.
Population is stopped even when validation prevents the reset.
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 fetched row to an edge or makes its cell visible.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The requested SAL row context. |
| column | Control | The target column, or null for the first grid column. |
| flags | SalNumber | Sys.TBL_ScrollTop or TBL_ScrollBottom for edge placement; other values show the cell normally. |
Returns: SalBoolean. Always true after scrolling; failure to fetch the row uses the main grid header position.
When forwarded through an emulated secondary base, this overload currently discards the flags.
SendMessage(msg, mywParam, mylParam)
Sends a native Windows message to this control synchronously.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The Windows or SAL message code. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalNumber. The native message result, or zero when the control is unavailable or disposed.
SendMessageToChildren(msg, mywParam, mylParam)
Sends a message to this control's child windows and eligible descendants.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The Windows or SAL message code. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. True after dispatching; false when the parent is unavailable or disposed.
Traversal does not descend into embedded forms or user controls. Close and destroy messages for ordinary child controls are routed to their action handlers instead of their native window procedures.
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, flags)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| flags | 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.
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(resource, type)
Loads a cursor resource and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| resource | SalResourceCursor | The cursor resource to load. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
SetCursor(resourceId, type)
Assigns a system cursor or a cursor identified by its native handle to the requested role.
| Parameter | Type | Description |
|---|---|---|
| resourceId | Int32 | A Sys.CURSOR_* identifier, or a native cursor handle represented as an integer. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
SetCursor(blob, type)
Loads a cursor from binary data and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| blob | SalString | The cursor file data stored in a SAL binary string. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.
SetCursorFile(file, type)
Loads a cursor file and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| file | SalString | The cursor file path. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.
SetFlagsAnyRows(flags, on, flagsOn, flagsOff)
Changes flags on matching rows in both grids while preserving row context.
| Parameter | Type | Description |
|---|---|---|
| flags | SalNumber | The row flags to change. |
| on | SalBoolean | True to set flags; false to clear them. |
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Flags that must be absent. |
Returns: SalBoolean. True if at least one grid processes matching rows; false if no rows match or selection validation blocks all matching grids.
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, editMin, editMax)
Focuses a cell and starts editing when its type and permissions allow it.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| column | Control | The SAL column; a missing column falls back to focusing the full row. |
| editMin | SalNumber | The first selected text position, clamped to zero when negative. |
| editMax | SalNumber | The exclusive selection end; values below editMin select through the text end. |
Returns: SalBoolean. True when focus processing succeeds, whether or not editing starts; false for resolution, fetching, validation, or selection failure.
SetFocusRow(rowNum)
Fetches and focuses a row without generating a programmatic SAM_Click notification.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context to focus. |
Returns: SalBoolean. False when the row cannot be translated or fetched or editing cannot finish; otherwise, true after processing.
SetFont(name, size, enhancement)
Creates and assigns a font to this control.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The font family name. |
| size | SalNumber | The font size in points. |
| enhancement | 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(x, y)
Sets this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | The new horizontal coordinate. |
| y | 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)
Sets the frozen-column count in both grids.
| Parameter | Type | Description |
|---|---|---|
| locked | SalNumber | The requested count, clamped from zero to the main grid column count. |
Returns: SalBoolean. Always true after assignment.
SetProperty(name, value, length)
Assigns a SAL named property after limiting the value's length.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The property name. |
| value | SalString | The value to assign. |
| length | 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 population and establishes a main-grid row range after finishing editing.
| Parameter | Type | Description |
|---|---|---|
| min | SalNumber | The minimum row; negative values leave the range unchanged. |
| max | SalNumber | The maximum row, or TBL_MaxRow for the filler unlimited mode. A value below min clears the data rows. |
Returns: SalBoolean. False when editing cannot finish; otherwise, true.
SetRow(rowPos)
Navigates to the first, last, next, or previous visible row and gives it focus.
| Parameter | Type | Description |
|---|---|---|
| rowPos | SalNumber | Sys.TBL_SetFirstRow, TBL_SetLastRow, TBL_SetNextRow, or TBL_SetPrevRow. |
Returns: SalNumber. The selected context row, or Sys.TBL_Error when navigation fails or the code is unsupported.
Moving to the last row fetches remaining data first.
SetRowFlags(rowNum, flags, on)
Changes flags for a nondeleted row while preserving row context.
| Parameter | Type | Description |
|---|---|---|
| rowNum | SalNumber | The SAL row context. |
| flags | SalNumber | The Sys.ROW_* flags to modify. |
| on | SalBoolean | True to enable flags; false to clear them. |
Returns: SalBoolean. False for a missing or deleted row, or when selecting requires editing that cannot finish; otherwise, true.
SetSize(width, height)
Sets this control's dimensions in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | The new width. |
| height | SalNumber | The new height. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetTableFlags(flags, on)
Sets or clears table flags, attempting to finish editing before applying them.
| Parameter | Type | Description |
|---|---|---|
| flags | SalNumber | The Sys.TBL_Flag_* flags to modify. |
| on | SalBoolean | True to set the flags; false to clear them. |
Returns: SalBoolean. Always true after applying flags, even if editing could not finish.
SetText(text)
Assigns the control's displayed text.
| Parameter | Type | Description |
|---|---|---|
| text | SalString | The text to assign. |
Returns: SalBoolean. True if the translated control exists and assignment completes; otherwise, false.
An empty string is passed as null when assigning combo-box text.
SetTimer(idEvent, elapseMilliSec)
Creates or updates a native window timer for this control.
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber | The timer identifier. |
| elapseMilliSec | SalNumber | The requested interval in milliseconds. |
Returns: SalBoolean. True if the native timer was created; otherwise, false.
SetWindowColor(colorIndex, color)
Assigns a SAL window, table-cell, text, or transparent-image color.
| Parameter | Type | Description |
|---|---|---|
| colorIndex | SalNumber | The Sys.COLOR_Index* component to update. |
| color | SalNumber | The SAL color value. |
Returns: SalBoolean. True for a recognized color index and resolved control, even when the component does not apply to that control; otherwise, false.
Cell colors apply to table columns; window colors apply to other controls. Transparent colors require the SAL picture-control contract.
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 by an enabled sortable column and synchronizes the main-grid row context.
| Parameter | Type | Description |
|---|---|---|
| colId | SalNumber | The SAL column identifier. |
| order | SalNumber | Sys.TBL_SortDecreasing for descending order; other values sort ascending. |
Returns: SalBoolean. True after sorting; false for a missing column or one without COL_EnableSort.
TrackPopupMenu(menuName, flags, x, y)
Creates and displays a temporary popup menu at screen coordinates.
| Parameter | Type | Description |
|---|---|---|
| menuName | SalString | The menu type name to resolve. |
| flags | SalNumber | SAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported. |
| x | SalNumber | The screen X coordinate, unless TPM_CursorX selects the cursor position. |
| y | SalNumber | The screen Y coordinate, unless TPM_CursorY selects the cursor position. |
Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.
The previous context menu is restored after display and the temporary menu is queued for disposal.
TrackPopupMenu(menuType, flags, x, y)
Creates and displays a temporary popup menu at screen coordinates.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| flags | SalNumber | SAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported. |
| x | SalNumber | The screen X coordinate, unless TPM_CursorX selects the cursor position. |
| y | SalNumber | The screen Y coordinate, unless TPM_CursorY selects the cursor position. |
Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.
The previous context menu is restored after display and the temporary menu is queued for disposal.
UpdateWindow()
Requests an update of this control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
WinHelp(file, command, numData, strData)
Invokes the legacy Windows Help API for this control.
| Parameter | Type | Description |
|---|---|---|
| file | SalString | The help file path. |
| command | SalNumber | The Sys.HELP_* command. |
| numData | SalNumber | The numeric topic or index for HELP_Context and HELP_SetIndex. |
| strData | SalString | The lookup text for HELP_Key. |
Returns: SalBoolean. The native help result, or false for an empty file name.
WndProc(m)
Routes clipboard, focus, context-menu, and keyboard messages through table-specific handlers.
| Parameter | Type | Description |
|---|---|---|
| m | Message | The native message and result. |
WriteXMLandSchema(path, writeTypes)
Writes table data, its schema, or both to disk.
| Parameter | Type | Description |
|---|---|---|
| path | SalString | The XML output path; schema output uses the same directory and base name with _Schema.xsd appended. |
| writeTypes | SalNumber | Sys.XML_Document, XML_Schema, or XML_DocAndSchema. |
Returns: SalBoolean. True for a supported completed write; false for an unsupported write type.
Throws:
- ArgumentNullException The path is empty.
WriteXMLandSchemaEx(path, writeTypes, flagsOn, flagsOff)
Writes filtered main-grid rows and optional column schema to disk.
| Parameter | Type | Description |
|---|---|---|
| path | SalString | The XML output path; schema output uses the same directory and base name with _Schema.xsd appended. |
| writeTypes | SalNumber | Sys.XML_Document, XML_Schema, or XML_DocAndSchema. |
| flagsOn | SalNumber | At least one required row flag, or zero for no inclusion filter. |
| flagsOff | SalNumber | Flags that must be absent from exported rows. |
Returns: SalBoolean. True for a supported completed write; false for an unsupported write type.
Throws:
- ArgumentNullException The path is empty.
Yield()
Dispatches one pending message for this window, or processes application messages when no window handle exists.
Message dispatch can reenter application code.
Events
MessageActions
SalMessageHandler Provides the legacy SAL message-handler event.
Use WindowActions for new handlers.
WindowActions
WindowActionsEventHandler Occurs when this control dispatches a SAL or custom window action.
Inherited By
| Name | Description |
|---|---|
| SalQuickToolTipChildTable | Provides a SAL child table with Quick Objects tooltip and status-text compatibility methods. |
Implements
| Name | Description |
|---|---|
| ISalControl | Provides access to a SAL control's typed value, associated label, and modification state. |
| ISalWindow | Exposes SAL message dispatch and runtime metadata for child controls, forms, dialogs, and MDI windows. |