I have a cell with an ellipsis button, which I customize its color & text by over-riding OnPaintButton
:
void CExtGridMyCell::OnPaintButton(
const RECT & rcButton,
INT nButtonType, // e_button_type_t
bool bPressed,
bool bHovered,
bool bFocused,
bool bEnabled,
const CExtGridWnd & wndGrid,
CDC & dc,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcVisibleRange,
DWORD dwAreaFlags,
DWORD dwHelperPaintFlags) const
{
if (__EBTT_ELLIPSIS==nButtonType)
{
CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
((CObject*)this),
true,
rcButton,
m_bGreen? GREEN_SYMBOL : RED_SYMBOL,
NULL,
false,
bHovered,
bPressed,
false,
bEnabled,
true,
false,
false,
CExtPaintManager::__ALIGN_HORIZ_CENTER|CExtPaintManager::__ALIGN_VERT_CENTER,
NULL,
false,
0,
false);
_ppbd.m_clrForceTextNormal = m_bGreen? RGB(0,192,0) : RGB(255,0,0);
wndGrid.PmBridge_GetPM()->PaintPushButton(dc, _ppbd);
return;
}
CExtGridBaseCell::OnPaintButton(
rcButton,
nButtonType,
bPressed,
bHovered,
bFocused,
bEnabled,
wndGrid,
dc,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcVisibleRange,
dwAreaFlags,
dwHelperPaintFlags);
}
This works fine in all other themes, but in
CExtPaintManagerOffice2007_R2_Obsidian::PaintPushButton
there is a flag
bInvertNormalTextColor
which makes the text being drawn in white and not in the color I provided (line 38402):
if( bInvertNormalTextColor )
_ppbd.m_clrForceTextNormal = RGB(255,255,255);
Why is this? Can I just remove this line?