|
|
|
|
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.
Subject |
Author |
Date |
|
Andrej Kasa
|
Feb 13, 2008 - 5:35 AM
|
Hello,
I have a view that contains CExtTabPageContainerFlatWnd. Inside one of the tabs ("All Units") I have an embedded CWnd window (since I need to paint it by a device context) and that is a problem: I don’t know how to make the backround color of the CWnd consistent to the selected theme of ProfUIS. Please see attached example that demostrates the problem:
In this case I am running LunaBlue so I would like to have the backround color similar to the rest o the app (blue color). I tried to rename the CWnd to CExtWS < CWnd > the get the Profuis theme support but nothing has changed. What am I doing wrong? thanks, krompo
|
|
Andrej Kasa
|
Feb 13, 2008 - 7:24 AM
|
|
|
Technical Support
|
Feb 13, 2008 - 6:44 AM
|
There is no solid background color in most of the themes. The Office 2003/2007 and Visual Studio 2005/2008 themes, a non-linear gradient background is used and in ProfSkin-based themes, bitmaps are used. You should let the paint manager paint the background of your window in this way: #if (!defined __EXT_MEMORY_DC_H)
#include <../Src/ExtMemoryDC.h>
#endif
void CYourWnd::OnPaint()
{
ASSERT_VALID( this )
CPaintDC dcPaint( this );
CRect rcClient;
GetClientRect( &rcClient );
if( rcClient.IsRectEmpty() || (! dcPaint.RectVisible( &rcClient ) ) )
return;
CExtMemoryDC dc( &dcPaint, &rcClient );
CExtPaintManager::stat_ExcludeChildAreas(
dcPaint.GetSafeHdc(),
GetSafeHwnd()
);
if( (! g_PaintManager->GetCb2DbTransparentMode( this ) )
|| (! g_PaintManager->PaintDockerBkgnd( true, dc, this ) )
)
dc.FillSolidRect(
&rcClient,
g_PaintManager->GetColor(
CExtPaintManager::CLR_3DFACE_OUT,
this
)
);
}
|
|