virtual const CGXStyle& LookupStyleRowCol(ROWCOL nRow, ROWCOL nCol);
nRow
Specifies the row id.
nCol
Specifies the column id.
Returns a reference to a style-object internally stored in a cache.
This advanced method retrieves the full style for the specified cell inheriting all attributes from its base styles by calling ComposeStyleRowCol.
Please note that the method returns a reference to a temporary style-object being stored in a cache. OnGridDraw empties the cache by calling FreeObjectCache.
This example illustrates how to determine if the font for the current cell is set to Bold.
ROWCOL nRow, nCol;
BOOL bIsBold = FALSE;
if (GetCurrentCell(nRow, nCol))
{
const CGXStyle& style = LookupStyleRowCol(nRow, nCol);
// Cell-specific style, e.g. RTF will set font and textcolor
// attributes of the current selection
CGXControl* pControl = GetRegisteredControl(style.GetControl());
pControl->LoadStyle(nRow, nCol, &style);
bIsBold = style.IsSubSet(
CGXStyle( ).SetFont(
CGXFont( ).SetBold(TRUE)
));
}
CGXGridCore::GetStyleRowCol CGXGridCore::ComposeStyleRowCol CGXGridCore::FreeObjectCache
Class Overview | Class Members