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 » Skin background Collapse All
Subject Author Date
Nigel Channon Apr 30, 2008 - 9:57 AM

I like implement my own skin via xml and png images. But I found one unpleasant aspect. When control draw itself with interlacing as source for background control use WindowBackground. But more real be using of vision background controls(for example, GroupBox or etc). How I can check it?

Technical Support Apr 30, 2008 - 2:27 PM

You can use a skinable paint manager from the ProfSkin library (which comes with Prof-UIS) or any paint manager from Prof-UIS. In any case, the background of your window should be painted using the following code:

CPaintDC dc( this );
      if(         (! PmBridge_GetPM()->GetCb2DbTransparentMode(this) )
            ||    (! PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
            )
      {
            CRect rcClient;
            GetClientRect( &rcClient );
            COLORREF clrBackground = g_PaintManager->GetColor( CExtPaintManager::CLR_3DFACE_OUT );
            dc.FillSolidRect( &rcClient, clrBackground );   
      }

// TO-DO: paint content of your window here ...

      PmBridge_GetPM()->OnPaintSessionComplete( this );
Of course, you may need a flicker free version. So, the first line of code CPaintDC dc( this ); should be replaced with:
CPaintDC dcPaint( this );
CRect rcClient;
      GetClientRect( &rcClient );
CExtMemoryDC dc ( &dcPaint, &rcClient );
The code above paints a themed Prof-UIS background of any window. If you need to implement some custom background which is shared between deeply nested parent windows, then you can also use the code above except you should implement a CExtPaintManager::g_nMsgPaintInheritedBackground registered message handler as it is demonstrated in the TabbedBars sample application which is able to draw the hurricane like background in the main frame window and application specific gradient background in the One Note tab page container window with colored tabs created as the main SDI view window.