Custom fonts and colors

With M!Table you can define individual fonts and colors for almost every table item.

Functions and flags

Cell
MTblSetCellFont / MTblGetCellFont / MTblGetEffCellFont
MTblSetCellTextColor / MTblGetCellTextColor / MTblGetEffCellTextColor
MTblSetCellBackColor / MTblGetCellBackColor / MTblGetEffCellBackColor

Column
MTblSetColumnFont / MTblGetColumnFont
MTblSetColumnTextColor / MTblGetColumnTextColor
MTblSetColumnBackColor / MTblGetColumnBackColor
MTBL_FLAG_COLOR_ENTIRE_COLUMN

Column lines
MTblDefineColLines / MTblQueryColLines
MTblDefineLastLockedColLine / MTblQueryLastLockedColLine

Column header
MTblSetColumnHdrFont / MTblGetColumnHdrFont / MTblGetEffColumnHdrFont
MTblSetColumnHdrTextColor / MTblGetColumnHdrTextColor / MTblGetEffColumnHdrTextColor
MTblSetColumnHdrBackColor / MTblGetColumnHdrBackColor / MTblGetEffColumnHdrBackColor
MTblSetColumnHdrFreeBackColor / MTblGetColumnHdrFreeBackColor / MTblGetEffColumnHdrFreeBackColor

Column header group
MTblSetColHdrGrpFont / MTblGetColHdrGrpFont / MTblGetEffColHdrGrpFont
MTblSetColHdrGrpTextColor / MTblGetColHdrGrpTextColor / MTblGetEffColHdrGrpTextColor
MTblSetColHdrGrpBackColor / MTbGetColHdrGrpBackColor / MTblGetEffColHdrGrpBackColor

Focus frame
MTblDefineFocusFrame / MTblQueryFocusFrame
MTBL_FLAG_CLIP_FOCUS_AREA

Headers
MTblSetHeadersBackColor / MTblGetHeadersBackColor
MTBL_FLAG_GRADIENT_HEADERS

Row
MTblSetAltRowBackColors / MTblGetAltRowBackColors
MTblSetRowFont / MTblGetRowFont
MTblSetRowTextColor / MTblGetRowTextColor
MTblSetRowBackColor / MTblGetRowBackColor
MTBL_FLAG_COLOR_ENTIRE_ROW

Row lines
MTblDefineRowLines / MTblQueryRowLines

Row header
MTblSetRowHdrBackColor / MTblGetRowHdrBackColor / MTblGeEffRowHdrBackColor

Corner
MTblSetCornerBackColor / MTblGetCornerBackColor / MTblGetEffCornerBackColor

Tooltip
MTblSetTipFont / MTblGetTipFont
MTblSetTipTextColor / MTblGetTipTextColor
MTblSetTipBackColor / MTblGetTipBackColor
MTblSetTipFrameColor / MTblGetTipFrameColor

Tree nodes
MTblSetTreeNodeColors / MTblGetTreeNodeColors

Tree lines
MTblDefineTreeLines / MTblQueryTreeLines

Button
MTBL_BTN_SHARE_FONT


Hints and tips

How the effective font/color is determined
What the hell means effective? Effective means "actually used".
Let's have a look at a case study:

! Set the cell font, size and enhancements are undefined
Call MTblSetCellFont( tbl1.col1, 2, "Arial", MTBL_UNDEF_FONT_SIZE, MTBL_UNDEF_FONT_ENH, 0 )
! Set the column font, enhancements are undefined
Call MTblSetColumnFont( tbl1.col1, "Courier New", 10, MTBL_UNDEF_FONT_ENH, 0 )
! Set the row font, enhancements are undefined
Call MTblSetRowFont( tbl1, 2, MTBL_FONT_UNDEF_NAME, 12, MTBL_UNDEF_FONT_ENH, 0 )
! Set the table font
Call SalFontSet( tbl1, "MS Sans Serif", 8, FONT_EnhBold )

What is the effective cell font??
First M!Table checks the cell's font definition. In this case it founds that the name is defined, so the name ( "Arial" ) is used.
Then the column's font definition is checked. It has a defined size, so it's used ( 10 ).
Now the row's font definition is checked, but the missing font enhancements are not defined here.
Finally the table's font is used to get the missing definitions, so our effective cell font is "Arial", 10, FONT_EnhBold.

With MTblDefineEffCellPropDet you can control how the effective font/color is determined, e.g. you can define that M!Table checks the row font definition prior to the column font definition and/or that font enhancements are combined.

M!Table provides functions to get the effective font/color, e.g. MTblGetEffCellFont.

Created with the Personal Edition of HelpNDoc: Full-featured Help generator