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 General Discussion » be covered with the background in CExtResizableDialog Collapse All
Subject Author Date
Fan Lianghuan May 17, 2008 - 3:13 AM

In my application, there is a dialog based on CExtResizableDialog and a CExtControlBar with the dialog in it .

And in the dialog, I draw some lines within it .


OnPaint()

{


CPaintDC dc(this);

dc.MoveTo(10,10);

dc.LineTo(100,10);


}



But when running ,the lines are covered by the background of the dialog or the CExtControlBar.



Later,I replaced the CExtResizableDialog with CDialog, and the lines could be saw.

 


What can do to fix this problem?



Thank you very much!

Fan Lianghuan May 20, 2008 - 4:01 AM

Thank you very much!


It’s OK!

Technical Support May 19, 2008 - 9:43 AM

To implement a custom dialog background, we would recommend theWindowProc() virtual method :

#if (!defined __EXT_MEMORY_DC_H)
      #include <../Src/ExtMemoryDC.h>
#endif

LRESULT CYourDialog::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
      if( message == WM_PAINT )
      {
            CRect rcClient;
            GetClientRect( &rcClient );
            CPaintDC dcPaint( this );
            CExtMemoryDC dc( &dcPaint, &rcClient );
            COLORREF clrBackground = GetBkColor();
            bool bTransparent = false;
            if(         PmBridge_GetPM()->GetCb2DbTransparentMode( this )
                  &&    ( clrBackground == COLORREF(-1L) )
                  )
            {
                  CExtPaintManager::stat_ExcludeChildAreas(
                        dc,
                        GetSafeHwnd(),
                        CExtPaintManager::stat_DefExcludeChildAreaCallback
                        );
                  if( PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
                        bTransparent = true;
            }
            if(         (! bTransparent)
                  &&    clrBackground != COLORREF(-1L)
                  )
                  dc.FillSolidRect( &rcClient, clrBackground );   
            //
            // Please insert your painting code here ...
            // (use dc for painting)
            //
            PmBridge_GetPM()->OnPaintSessionComplete( this );
            return TRUE;
      }
      return CExtResizableDialog::WindowProc( message, wParam, lParam );
}
The method above demonstrates simple complete repainting of dialog surface. Please note, Prof-UIS also supports complex inherited background painting based on a CExtPaintManager::g_nMsgPaintInheritedBackground registered message, which is demonstrated in the TabbedBars sample application where you can turn on the painting of a hurricane like background which is shared between many windows inside the main frame window.

Fan Lianghuan May 20, 2008 - 4:02 AM

It’s OK!


Thank you !