Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Problem paining buttons in CExtPaintManagerOffice2007_R2_Obsidian Collapse All
Subject Author Date
Offer Har Mar 31, 2008 - 3:46 PM

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?

Offer Har Apr 3, 2008 - 8:51 AM

Dear Support,


I found out where this change I;ve done take effect:


Now all my top lever menu titles are black on black. You use this flag to invert teh default black to white in the black themes, but by this you override the user’s request for a specific color. The color should not be inverted when the user request a specific color like in my case.


I guess this is a bug in the implementation of the CExtPaintManagerOffice2007_R2_Obsidian theme, and you need to address it please.


Regards,


Ron.

Offer Har Mar 31, 2008 - 3:50 PM

Just to clarify - I commented these two lines, and didn’t see any problems in the look&feel of my application.


So what is the purpose of this flag?


Thanks,


Ron.