Skip to main content
Version: 2025

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.

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

NameTypeDescriptionValue
COL_NOCHANGEInt32Leaves the corresponding color unchanged in color setters.
COL_NOT_BGInt32Legacy sentinel indicating no background color.
ROWDELETE_BMPInt32Legacy bitmap identifier for a deleted row.
ROWEDIT_BMPInt32Legacy bitmap identifier for an edited row.
ROWNEW_BMPInt32Legacy bitmap identifier for a newly inserted row.
TBL_BMP_BESTFITInt32Legacy best-fit bitmap option; ignored by the Web bitmap implementation.
TBL_BMP_BOTTOMInt32Aligns the bitmap at the bottom edge when the top flag is absent.
TBL_BMP_CENTERInt32Centers the bitmap horizontally when no left or right flag is supplied.
TBL_BMP_COLORInt32Keeps the bitmap in color; this is the zero-valued default.
TBL_BMP_LEFTInt32Aligns the bitmap at the left edge.
TBL_BMP_MONOInt32Requests grayscale conversion when adding a bitmap.
TBL_BMP_RIGHTInt32Aligns the bitmap at the right edge when the left flag is absent.
TBL_BMP_SCALEInt32Legacy default bitmap scaling option; scaling is not implemented.
TBL_BMP_TOFITInt32Legacy stretch-to-fit bitmap option; ignored by the Web bitmap implementation.
TBL_BMP_TOPInt32Aligns the bitmap at the top edge.
TBL_BMP_VCENTERInt32Centers the bitmap vertically when no top or bottom flag is supplied.
TBL_FLG_BOLDInt32Enables bold when modifying a font style.
TBL_FLG_DOTTEDCOLLINESInt32Zero-valued legacy default for dotted column lines.
TBL_FLG_DOTTEDROWLINESInt32Zero-valued legacy default for dotted row lines.
TBL_FLG_ITALICInt32Enables italic when modifying a font style.
TBL_FLG_NOBOLDInt32Removes bold; takes precedence over the enable flag.
TBL_FLG_NOCOLLINESInt32Legacy flag suppressing column lines; not consumed by these Web methods.
TBL_FLG_NOCOLORSInt32Legacy flag disabling extended colors; not consumed by these Web methods.
TBL_FLG_NOFONTSInt32Legacy flag disabling extended fonts; not consumed by these Web methods.
TBL_FLG_NOITALICInt32Removes italic; takes precedence over the enable flag.
TBL_FLG_NOROWLINESInt32Legacy flag suppressing row lines; not consumed by these Web methods.
TBL_FLG_NOSTRIKEOUTInt32Removes strikeout; takes precedence over the enable flag.
TBL_FLG_NOUNDERLINEInt32Removes underline; takes precedence over the enable flag.
TBL_FLG_SOLIDCOLLINESUInt32Legacy flag selecting solid column lines; not consumed by these Web methods.
TBL_FLG_SOLIDROWLINESInt32Legacy flag selecting solid row lines; not consumed by these Web methods.
TBL_FLG_STRIKEOUTInt32Enables strikeout when modifying a font style.
TBL_FLG_UNDERLINEInt32Enables underline when modifying a font style.

Methods

Static member AddBitmap(table, hBitmap, nFlags, nWidth, nHeight, nIndex)

Registers an image copied from a native bitmap handle in the table image collection.

ParameterTypeDescription
tableControlThe table control.
hBitmapSalNumberA nonzero native bitmap handle.
nFlagsSalNumberMonochrome and horizontal/vertical alignment flags.
nWidthSalNumberRetained for compatibility; ignored.
nHeightSalNumberRetained for compatibility; ignored.
nIndexSalNumberInsertion 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);
}
}

Static member AddRowBitmap(table, hBitmap, nFlags, nWidth, nHeight, nTransparentColor, nInversionColor, nRowFlags, nIndex, bReplace)

Reports that row-header bitmap registration is not implemented.

ParameterTypeDescription
tableControlRequested table; ignored.
hBitmapSalNumberRequested bitmap handle; ignored.
nFlagsSalNumberRequested bitmap flags; ignored.
nWidthSalNumberRequested width; ignored.
nHeightSalNumberRequested height; ignored.
nTransparentColorSalNumberRequested transparent color; ignored.
nInversionColorSalNumberRequested inversion color; ignored.
nRowFlagsSalNumberRequested row flags; ignored.
nIndexSalNumberRequested bitmap index; ignored.
bReplaceSalBooleanRequested replacement behavior; ignored.

Returns: SalNumber. Always zero.

Static member FreeBitmap(hBitmap)

Checks a bitmap handle without releasing its native resource.

ParameterTypeDescription
hBitmapSalNumberThe native bitmap handle.

Returns: SalBoolean. False for zero; true otherwise.

Native object deletion is not implemented.

Static member GetCellBitmap(table, nRow, nCol)

Returns the placeholder cell-bitmap result.

ParameterTypeDescription
tableControlThe table control.
nRowSalNumberThe row identifier.
nColSalNumberThe column identifier.

Returns: SalNumber. Always -1; image-map retrieval is not implemented.

Static member GetCellColor(table, nRow, nCol, nForeColor, nBackColor)

Reads the cell foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColor by referenceSalNumberReceives the Win32 foreground color, or COLOR_Default for an empty style color.
nBackColor by referenceSalNumberReceives 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.

Static member GetCellFont(table, nRow, nCol)

Reads the cell font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nColSalNumberThe table column identifier resolved with GetColumnFromId.

Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.

Static member GetColBitmap(table, nCol)

Returns the placeholder column-bitmap result.

ParameterTypeDescription
tableControlThe table control.
nColSalNumberThe column identifier.

Returns: SalNumber. Always -1; image-map retrieval is not implemented.

Static member GetColColor(table, nCol, nForeColor, nBackColor)

Reads the column foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColor by referenceSalNumberReceives the Win32 foreground color, or COLOR_Default for an empty style color.
nBackColor by referenceSalNumberReceives 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.

Static member GetColFont(table, nCol)

Reads the column font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.

Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.

Static member GetColHdrColor(table, nCol, nForeColor, nBackColor)

Reads the column header foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColor by referenceSalNumberReceives the Win32 foreground color, or COLOR_Default for an empty style color.
nBackColor by referenceSalNumberReceives 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.

Static member GetColHdrFont(table, nCol)

Reads the column header font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.

Returns: SalNumber. The enabled font-style flags, or zero if no table, style, or font is available.

Static member GetRowColor(table, nRow, nForeColor, nBackColor)

Reads the row foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nForeColor by referenceSalNumberReceives the Win32 foreground color, or COLOR_Default for an empty style color.
nBackColor by referenceSalNumberReceives 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.

Static member GetRowFont(table, nRow)

Reads the row font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe 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.

Static member GetRowHdrColor(table, nRow, nForeColor, nBackColor)

Reads the row header foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nForeColor by referenceSalNumberReceives the Win32 foreground color, or COLOR_Default for an empty style color.
nBackColor by referenceSalNumberReceives 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.

Static member GetRowHdrFont(table, nRow)

Reads the row header font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe 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.

Static member GetTableFont(table)

Reads the table font-style flags.

ParameterTypeDescription
tableControlThe 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.

Static member LoadBitmap(sFileName)

Loads a bitmap file and obtains a native bitmap handle.

ParameterTypeDescription
sFileNameSalStringThe 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.

Static member RemoveBitmap(table, nIndex)

Accepts a removal request for a registered bitmap.

ParameterTypeDescription
tableControlThe table control.
nIndexSalNumberThe 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.

Static member RemoveRowBitmap(table, nIndex)

Reports that row-header bitmap removal is not implemented.

ParameterTypeDescription
tableControlRequested table; ignored.
nIndexSalNumberRequested bitmap index; ignored.

Returns: SalBoolean. Always false.

Static member Reset(table)

Clears row and column default colors and fonts in the main grid.

ParameterTypeDescription
tableControlThe table control.

Returns: SalBoolean. True if the table resolves; otherwise false.

Does not clear individual cell or header styles, table fonts, or registered images.

Static member SetCellBitmap(table, nRow, nCol, nIndex)

Validates a cell and bitmap index without assigning the image.

ParameterTypeDescription
tableControlThe table control.
nRowSalNumberThe row identifier.
nColSalNumberThe column identifier.
nIndexSalNumberThe zero-based registered-image index.

Returns: SalBoolean. True if the style and image index are available; otherwise false.

Image-map assignment is not implemented.

Static member SetCellColor(table, nRow, nCol, nForeColor, nBackColor)

Updates the cell foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColorSalNumberThe SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default.
nBackColorSalNumberThe 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);
}
}

Static member SetCellFont(table, nRow, nCol, nFlags)

Updates the cell font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nFlagsSalNumberTBL_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.

Static member SetColBitmap(table, nCol, nIndex)

Obtains a column style without assigning a bitmap.

ParameterTypeDescription
tableControlThe table control.
nColSalNumberThe column identifier.
nIndexSalNumberRequested 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.

Static member SetColColor(table, nCol, nForeColor, nBackColor)

Updates the column foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColorSalNumberThe SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default.
nBackColorSalNumberThe 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.

Static member SetColFont(table, nCol, nFlags)

Updates the column font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nFlagsSalNumberTBL_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.

Static member SetColHdrColor(table, nCol, nForeColor, nBackColor)

Updates the column header foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nForeColorSalNumberThe SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default.
nBackColorSalNumberThe 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.

Static member SetColHdrFont(table, nCol, nFlags)

Updates the column header font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nColSalNumberThe table column identifier resolved with GetColumnFromId.
nFlagsSalNumberTBL_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.

Static member SetRowColor(table, nRow, nForeColor, nBackColor)

Updates the row foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nForeColorSalNumberThe SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default.
nBackColorSalNumberThe 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.

Static member SetRowFont(table, nRow, nFlags)

Updates the row font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nFlagsSalNumberTBL_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.

Static member SetRowHdrColor(table, nRow, nForeColor, nBackColor)

Updates the row header foreground and background colors.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nForeColorSalNumberThe SAL foreground color; COL_NOCHANGE preserves it, and COLOR_Default or SAL null restores the default.
nBackColorSalNumberThe 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.

Static member SetRowHdrFont(table, nRow, nFlags)

Updates the row header font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nRowSalNumberThe table row identifier accepted by the table style helper.
nFlagsSalNumberTBL_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.

Static member SetTableFont(table, nFlags)

Updates the table font-style flags.

ParameterTypeDescription
tableControlThe table control or a control that resolves to its SalTableWindow.
nFlagsSalNumberTBL_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.