VisTblEx
Namespace: PPJ.Runtime.Vis
Assembly: PPJ.Web.Vis.50 (5.0.0.0)
Provides Visual Toolchest table color, font-style, and bitmap compatibility operations.
- C#
- VB.NET
public class VisTblEx
Public Class VisTblEx
Table arguments must resolve to a SalTableWindow. Several bitmap operations are placeholders on the Web platform; consult their return and remarks documentation.
Example:
using PPJ.Runtime;
using PPJ.Runtime.Vis;
using PPJ.Runtime.Windows;
public static class TableAppearance
{
public static void Highlight(SalTableWindow table, SalNumber row)
{
VisTblEx.SetTableFont(table, VisTblEx.TBL_FLG_BOLD);
VisTblEx.SetRowColor(table, row, Sys.COLOR_Red, VisTblEx.COL_NOCHANGE);
}
}
Fields
| Name | Type | Description | Value |
|---|---|---|---|
| COL_NOCHANGE | Int32 | Leaves the corresponding color unchanged in color setters. | |
| COL_NOT_BG | Int32 | Legacy sentinel indicating no background color. | |
| ROWDELETE_BMP | Int32 | Legacy bitmap identifier for a deleted row. | |
| ROWEDIT_BMP | Int32 | Legacy bitmap identifier for an edited row. | |
| ROWNEW_BMP | Int32 | Legacy bitmap identifier for a newly inserted row. | |
| TBL_BMP_BESTFIT | Int32 | Legacy best-fit bitmap option; ignored by the Web bitmap implementation. | |
| TBL_BMP_BOTTOM | Int32 | Aligns the bitmap at the bottom edge when the top flag is absent. | |
| TBL_BMP_CENTER | Int32 | Centers the bitmap horizontally when no left or right flag is supplied. | |
| TBL_BMP_COLOR | Int32 | Keeps the bitmap in color; this is the zero-valued default. | |
| TBL_BMP_LEFT | Int32 | Aligns the bitmap at the left edge. | |
| TBL_BMP_MONO | Int32 | Requests grayscale conversion when adding a bitmap. | |
| TBL_BMP_RIGHT | Int32 | Aligns the bitmap at the right edge when the left flag is absent. | |
| TBL_BMP_SCALE | Int32 | Legacy default bitmap scaling option; scaling is not implemented. | |
| TBL_BMP_TOFIT | Int32 | Legacy stretch-to-fit bitmap option; ignored by the Web bitmap implementation. | |
| TBL_BMP_TOP | Int32 | Aligns the bitmap at the top edge. | |
| TBL_BMP_VCENTER | Int32 | Centers the bitmap vertically when no top or bottom flag is supplied. | |
| TBL_FLG_BOLD | Int32 | Enables bold when modifying a font style. | |
| TBL_FLG_DOTTEDCOLLINES | Int32 | Zero-valued legacy default for dotted column lines. | |
| TBL_FLG_DOTTEDROWLINES | Int32 | Zero-valued legacy default for dotted row lines. | |
| TBL_FLG_ITALIC | Int32 | Enables italic when modifying a font style. | |
| TBL_FLG_NOBOLD | Int32 | Removes bold; takes precedence over the enable flag. | |
| TBL_FLG_NOCOLLINES | Int32 | Legacy flag suppressing column lines; not consumed by these Web methods. | |
| TBL_FLG_NOCOLORS | Int32 | Legacy flag disabling extended colors; not consumed by these Web methods. | |
| TBL_FLG_NOFONTS | Int32 | Legacy flag disabling extended fonts; not consumed by these Web methods. | |
| TBL_FLG_NOITALIC | Int32 | Removes italic; takes precedence over the enable flag. | |
| TBL_FLG_NOROWLINES | Int32 | Legacy flag suppressing row lines; not consumed by these Web methods. | |
| TBL_FLG_NOSTRIKEOUT | Int32 | Removes strikeout; takes precedence over the enable flag. | |
| TBL_FLG_NOUNDERLINE | Int32 | Removes underline; takes precedence over the enable flag. | |
| TBL_FLG_SOLIDCOLLINES | UInt32 | Legacy flag selecting solid column lines; not consumed by these Web methods. | |
| TBL_FLG_SOLIDROWLINES | Int32 | Legacy flag selecting solid row lines; not consumed by these Web methods. | |
| TBL_FLG_STRIKEOUT | Int32 | Enables strikeout when modifying a font style. | |
| TBL_FLG_UNDERLINE | Int32 | Enables underline when modifying a font style. |
Methods
AddBitmap(table, hBitmap, nFlags, nWidth, nHeight, nIndex)
Registers an image copied from a native bitmap handle in the table image collection.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| hBitmap | SalNumber | A nonzero native bitmap handle. |
| nFlags | SalNumber | Monochrome and horizontal/vertical alignment flags. |
| nWidth | SalNumber | Retained for compatibility; ignored. |
| nHeight | SalNumber | Retained for compatibility; ignored. |
| nIndex | SalNumber | Insertion index from zero through the image count, or -1 to append. |
Returns: SalNumber. The inserted index; zero on table, handle, or index validation failure, which is indistinguishable from successful insertion at zero.
Bitmap scaling flags are ignored.
Example:
Register a copy of a live native bitmap. The caller retains ownership of the supplied handle. Zero can mean either the first image index or validation failure; it is not a reliable success flag. Registration alone does not display an image, and the Web SetCellBitmap image-map assignment is not implemented.
using System;
using PPJ.Runtime;
using PPJ.Runtime.Vis;
using PPJ.Runtime.Windows;
public static class TableImageRegistration
{
public static SalNumber Register(SalTableWindow table, SalNumber bitmapHandle)
{
if (table == null || bitmapHandle == 0)
throw new ArgumentException("A table and live bitmap handle are required.");
// Append rather than supplying a potentially invalid insertion index.
return VisTblEx.AddBitmap(table, bitmapHandle,
VisTblEx.TBL_BMP_LEFT, 0, 0, -1);
}
}
AddRowBitmap(table, hBitmap, nFlags, nWidth, nHeight, nTransparentColor, nInversionColor, nRowFlags, nIndex, bReplace)
Reports that row-header bitmap registration is not implemented.
| Parameter | Type | Description |
|---|---|---|
| table | Control | Requested table; ignored. |
| hBitmap | SalNumber | Requested bitmap handle; ignored. |
| nFlags | SalNumber | Requested bitmap flags; ignored. |
| nWidth | SalNumber | Requested width; ignored. |
| nHeight | SalNumber | Requested height; ignored. |
| nTransparentColor | SalNumber | Requested transparent color; ignored. |
| nInversionColor | SalNumber | Requested inversion color; ignored. |
| nRowFlags | SalNumber | Requested row flags; ignored. |
| nIndex | SalNumber | Requested bitmap index; ignored. |
| bReplace | SalBoolean | Requested replacement behavior; ignored. |
Returns: SalNumber. Always zero.
FreeBitmap(hBitmap)
Checks a bitmap handle without releasing its native resource.
| Parameter | Type | Description |
|---|---|---|
| hBitmap | SalNumber | The native bitmap handle. |
Returns: SalBoolean. False for zero; true otherwise.
Native object deletion is not implemented.
GetCellBitmap(table, nRow, nCol)
Returns the placeholder cell-bitmap result.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| nRow | SalNumber | The row identifier. |
| nCol | SalNumber | The column identifier. |
Returns: SalNumber. Always -1; image-map retrieval is not implemented.
GetCellColor(table, nRow, nCol, nForeColor, nBackColor)
Reads the cell foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | Receives the Win32 foreground color, or COLOR_Default for an empty style color. |
| nBackColor | SalNumber | Receives the Win32 background color, or COLOR_Default for an empty style color. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Outputs remain unchanged on failure.
GetCellFont(table, nRow, nCol)
Reads the cell font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
GetColBitmap(table, nCol)
Returns the placeholder column-bitmap result.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| nCol | SalNumber | The column identifier. |
Returns: SalNumber. Always -1; image-map retrieval is not implemented.
GetColColor(table, nCol, nForeColor, nBackColor)
Reads the column foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | Receives the Win32 foreground color, or COLOR_Default for an empty style color. |
| nBackColor | SalNumber | Receives the Win32 background color, or COLOR_Default for an empty style color. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Outputs remain unchanged on failure.
GetColFont(table, nCol)
Reads the column font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
GetColHdrColor(table, nCol, nForeColor, nBackColor)
Reads the column header foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | Receives the Win32 foreground color, or COLOR_Default for an empty style color. |
| nBackColor | SalNumber | Receives the Win32 background color, or COLOR_Default for an empty style color. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Outputs remain unchanged on failure.
GetColHdrFont(table, nCol)
Reads the column header font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
GetRowColor(table, nRow, nForeColor, nBackColor)
Reads the row foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nForeColor | SalNumber | Receives the Win32 foreground color, or COLOR_Default for an empty style color. |
| nBackColor | SalNumber | Receives the Win32 background color, or COLOR_Default for an empty style color. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Outputs remain unchanged on failure.
GetRowFont(table, nRow)
Reads the row font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
GetRowHdrColor(table, nRow, nForeColor, nBackColor)
Reads the row header foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nForeColor | SalNumber | Receives the Win32 foreground color, or COLOR_Default for an empty style color. |
| nBackColor | SalNumber | Receives the Win32 background color, or COLOR_Default for an empty style color. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Outputs remain unchanged on failure.
GetRowHdrFont(table, nRow)
Reads the row header font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
GetTableFont(table)
Reads the table font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.
LoadBitmap(sFileName)
Loads a bitmap file and obtains a native bitmap handle.
| Parameter | Type | Description |
|---|---|---|
| sFileName | SalString | The server-side image file path. |
Returns: SalNumber. The native handle, SAL null if the decoded bitmap is null, or zero if the file does not exist.
Other image-loading errors propagate. FreeBitmap does not currently release the resulting handle.
RemoveBitmap(table, nIndex)
Accepts a removal request for a registered bitmap.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| nIndex | SalNumber | The zero-based bitmap index to validate. |
Returns: SalBoolean. False if the table or index is invalid; otherwise true.
The implementation calls ArrayList.Remove with the numeric argument rather than RemoveAt. Registered ImageInfo entries therefore remain in the collection.
RemoveRowBitmap(table, nIndex)
Reports that row-header bitmap removal is not implemented.
| Parameter | Type | Description |
|---|---|---|
| table | Control | Requested table; ignored. |
| nIndex | SalNumber | Requested bitmap index; ignored. |
Returns: SalBoolean. Always false.
Reset(table)
Clears row and column default colors and fonts in the main grid.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
Returns: SalBoolean. True if the table resolves; otherwise false.
Does not clear individual cell or header styles, table fonts, or registered images.
SetCellBitmap(table, nRow, nCol, nIndex)
Validates a cell and bitmap index without assigning the image.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| nRow | SalNumber | The row identifier. |
| nCol | SalNumber | The column identifier. |
| nIndex | SalNumber | The zero-based registered-image index. |
Returns: SalBoolean. True if the style and image index are available; otherwise false.
Image-map assignment is not implemented.
SetCellColor(table, nRow, nCol, nForeColor, nBackColor)
Updates the cell foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | The SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
| nBackColor | SalNumber | The SAL background color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Example:
Highlight an existing cell without changing its foreground, then restore its background from the row template. Pass a valid column identifier accepted by this table.
using PPJ.Runtime;
using PPJ.Runtime.Vis;
using PPJ.Runtime.Windows;
public static class CellHighlight
{
public static bool Apply(SalTableWindow table, SalNumber row, SalNumber columnId)
{
return VisTblEx.SetCellColor(table, row, columnId,
VisTblEx.COL_NOCHANGE, Sys.COLOR_Yellow);
}
public static bool Reset(SalTableWindow table, SalNumber row, SalNumber columnId)
{
return VisTblEx.SetCellColor(table, row, columnId,
VisTblEx.COL_NOCHANGE, Sys.COLOR_Default);
}
}
SetCellFont(table, nRow, nCol, nFlags)
Updates the cell font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Uses the displayed font, then row-template and grid fonts as fallbacks. If the requested result is Regular, the existing fallback font is retained; otherwise a new font uses the table font family and computed style.
SetColBitmap(table, nCol, nIndex)
Obtains a column style without assigning a bitmap.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control. |
| nCol | SalNumber | The column identifier. |
| nIndex | SalNumber | Requested bitmap index; not validated or applied. |
Returns: SalBoolean. False if the table or style cannot be resolved; otherwise true.
Image-map assignment is not implemented.
SetColColor(table, nCol, nForeColor, nBackColor)
Updates the column foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | The SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
| nBackColor | SalNumber | The SAL background color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Restoring the default background uses the row-template foreground color in this implementation.
SetColFont(table, nCol, nFlags)
Updates the column font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Uses the displayed font, then row-template and grid fonts as fallbacks. If the requested result is Regular, the existing fallback font is retained; otherwise a new font uses the table font family and computed style.
SetColHdrColor(table, nCol, nForeColor, nBackColor)
Updates the column header foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nForeColor | SalNumber | The SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
| nBackColor | SalNumber | The SAL background color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
SetColHdrFont(table, nCol, nFlags)
Updates the column header font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nCol | SalNumber | The table column identifier resolved with GetColumnFromId. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Uses the displayed font, then row-template and grid fonts as fallbacks. If the requested result is Regular, the existing fallback font is retained; otherwise a new font uses the table font family and computed style.
SetRowColor(table, nRow, nForeColor, nBackColor)
Updates the row foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nForeColor | SalNumber | The SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
| nBackColor | SalNumber | The SAL background color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
SetRowFont(table, nRow, nFlags)
Updates the row font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Uses the displayed font, then row-template and grid fonts as fallbacks. If the requested result is Regular, the existing fallback font is retained; otherwise a new font uses the table font family and computed style.
SetRowHdrColor(table, nRow, nForeColor, nBackColor)
Updates the row header foreground and background colors.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nForeColor | SalNumber | The SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
| nBackColor | SalNumber | The SAL background color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
SetRowHdrFont(table, nRow, nFlags)
Updates the row header font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nRow | SalNumber | The table row identifier accepted by the table style helper. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.
Uses the displayed font, then row-template and grid fonts as fallbacks. If the requested result is Regular, the existing fallback font is retained; otherwise a new font uses the table font family and computed style.
SetTableFont(table, nFlags)
Updates the table font-style flags.
| Parameter | Type | Description |
|---|---|---|
| table | Control | The table control or a control that resolves to its SalTableWindow. |
| nFlags | SalNumber | TBL_FLG_* enable/disable bits for bold, italic, underline, and strikeout; disable bits take precedence. |
Returns: SalBoolean. True when the table and required style are available; otherwise false.