Professional UI Solutions
Site Map   /  Register


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 » CExtPanelControlBar with toolbar background Collapse All
Subject Author Date
Olaf Reusch Jun 7, 2007 - 7:46 AM

It is possible to create a CExtPanelControlBar with the background of a CExtToolControlbar?

Olaf Reusch Jun 7, 2007 - 11:12 AM

Yes, this is right. But CExtPanelControlBar has a CExtResizableDialog in it and this background is not the same of CExtPanelControlBar. How i can get, that the Dialog have the same background?

Technical Support Jun 8, 2007 - 12:42 PM

So the question is how to draw a dialog background like in toolbars. And this background should be consistent between controls anywhere inside the dialog. There is a property CExtPaintManager::m_bCustomBackgroundInheritanceEnabled which allows you to paint a custom background for windows in your application. By default, it is set to false and the background of a particular window is painted by the current paint manager. When CExtPaintManager::m_bCustomBackgroundInheritanceEnabled is true, the paint manager, instead of painting the standard background of the window, sends the CExtPaintManager::g_nMsgPaintInheritedBackground message to the window back and allows it to paint the background in the handler of this message. If the message is not handled, the paint manager sends it to its parent and so forth until the message is processed, which means the background has been painted. If the message has not been processed by parent windows, the paint manager simply paints the standard background.

There is also an article relating to your question: How to paint a custom background consistent between the windows in my application?

When the handler for painting a custom background is ready, you can draw the background like in toolbars. You can take a look how it is done in CExtPaintManagerOffice2003::OnPaintToolBarGradient().

Technical Support Jun 7, 2007 - 10:35 AM

By default, CExtPanelControlBar has exactly the same background as in CExtToolControlBar.