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 General Discussion » CExtColorButton custom font Collapse All
Subject Author Date
Tor Erik Ottinsen Sep 20, 2005 - 3:48 AM

According to the FAQ, the OnQueryFont method of CExtButton can be overrided to use a custom font. This method does not appear to be called when using a CExtColorButton. Is this correct? Is there any way to use a custom font with CExtColorButton?

Technical Support Sep 20, 2005 - 7:00 AM

Thank you for the bug report. It seems we missed OnQueryFont() in the code responsible for painting the color button. Please open the CExtColorButton::_RenderImpl method and find the following code:

CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
            this,
            true, rectClient, (LPCTSTR)sWindowText,
            &icon, bFlat, bHover, bPushed,
            false, bEnabled,
            (m_bDrawBorder && (!CExtPopupMenuWnd::IsMenuTracking()))
                  ? true : false,
            (bDrawFocusRect && (!CExtPopupMenuWnd::IsMenuTracking())
                  && (!sWindowText.IsEmpty()) )
                  ? true : false,
            bDefault, m_nAlign,
            NULL, _IsMenuAvail(), 0, bTransparent
            );
Please replace it with this code:
CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
            this,                                                          
            true, 
            rectClient, 
            (LPCTSTR)sWindowText,
            &icon, 
            bFlat, 
            bHover, 
            bPushed,
            false, 
            bEnabled,
            m_bDrawBorder ? true : false,
            bDrawFocusRect, 
            bDefault, 
            m_nAlign,
            OnQueryFont(), 
            _IsMenuAvail(), 
            0, 
            bTransparent
            );
Then recompile the library. This bug will be also fixed in the next release.