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 » Match Look of CExtDynamicControlBar Non-client area Collapse All
Subject Author Date
John Ritzenthaler Mar 3, 2010 - 1:45 PM

I have an owner-drawn area inside a dynamic control bar.  I want the "look" of what I draw to match the control bar.


Can you direct me to the non-client drawing logic in the source code so I can see what fonts, colors, gradients, etc. are used.


I assume thet eventually I’ll need to get these from the PaintManager.


Thanks.

Technical Support Mar 4, 2010 - 8:49 AM

You should use the following paint manager’s method to draw background of everything including client and non-client window parts:

   virtual bool PaintDockerBkgnd(
                        bool bClientMapping,
                        CDC & dc,
                        CWnd * pWnd,
                        LPARAM lParam = NULL
                        );

The bClientMapping flag indicates whether the specified device context for painting is a window client/paint device context if set to true. If this flag is false, then the device context is window device context with zero coordinate system set to the left/top corner of window non-client area.
The themed background does not mean the single color fill. It can be bitmap based or gradient based in different paint managers. It can be different for dialog windows and other windows.
The text color can be retrieved using the following paint manager’s method:
   COLORREF GetColor(
                        int nColorIndex,
                        CObject * pHelperSrc = NULL,
                        LPARAM lParam = 0L
                        ) const;

The nColorIndex parameter can be the standard color index like COLOR_BTNTEXT. It also be the CExtPaintManager::e_translated_colors_t enumeration like CExtPaintManager::CLR_TEXT_OUT.
The CExtPaintManager::m_FontNormal font is recommended for most of controls. You can use the CExtPaintManager::m_FontBold font if you need bold text elements.