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 » Painting a child dialog background consistent with the CExtTabPageContainerWnd tabs Collapse All
Subject Author Date
Raffaele Cappelli May 21, 2006 - 12:15 PM

I would like to create a child property sheet using CExtTabPageContainerWnd and child dialogs as pages.
Is there a way to paint the background of the child dialog so that it is "consistent" with the active tab background?
Something similar to EnableThemeDialogTexture() with ETDT_USETABTEXTURE, but that could work with any of your PaintManagers.
My apologies in advance if I have missed this in one of the samples or in a FAQ.

Technical Support May 22, 2006 - 4:30 AM

Thank you for the interesting question. The CChildView class in the TabbedBars sample is derived from the CExtTabPageContainerOneNoteWnd class and used as the main SDI view window. This class demonstrates two backgrounds: OneNote-consistent and a custom hurricane-like.

Now let us explain the details. Prof-UIS features the 100% implemented support for inheritable custom background painting, but this feature is turned off by default. To turn it on, invoke the following code both at start up and after installing a new paint manager on-the-fly:

pPM->m_bCustomBackgroundInheritanceEnabled = true;
After this flag is set on, any our paint manager sends the CExtPaintManager::g_nMsgPaintInheritedBackground registered windows message to allow painted windows to draw the inheritable custom background which is consistent between child/parent windows. This message is handled in the CMainFrame::OnMsgPaintInheritedBackground() and CChildView::OnMsgPaintInheritedBackground() methods in the TabbedBars sample. The main frame window handles this message to paint the hurricane-like background of dock bar windows and control bars. The child view window handles this message to paint the custom background of dialog pages and this case seems is what you really need. We implemented a gradient background of dialog pages which (as we hope) looks good because it uses both light and dark colors of the tab item in the OneNote tab control. But it is not a problem to use only the dark color and paint solid colored tab page background.

Raffaele Cappelli May 22, 2006 - 10:44 AM

Thank you for the explanation.
If I understand correctly, this works with CExtTabPageContainerOneNoteWnd, CExtTabPageContainerFlatWnd, and CExtTabPageContainerWhidbeyWnd. It would be nice to enable this to work also for CExtTabPageContainerWnd: this in the native xp paint manager should correspond to the normal windows xp theme behavious for the property sheet, and in the other paint managers should be consistent to the tab style. However, I understand this would be more complicated since the look of CExtTabPageContainerWnd tabs is different in each paint manager.

Technical Support May 24, 2006 - 1:04 PM

We can implement a custom tab page container background in each paint manager but in most cases it is not needed because the tab window in the style of Visual Studio .NET / 2005 is designed as a stand-alone scrollable tab control which eats less possible space and does not control the background of other windows. The consistent background may really be needed in the Native WinXP theme and in custom tab page containers like One Note.

Raffaele Cappelli May 25, 2006 - 2:38 AM

I agree it is not worth to develop a custom tab child window background for each paint manager.
In my application at the end I decided to just add a thin border to separate the tabs from the child, and it looks good.