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 » Where could I have the document about CExtPainManager? And Could I have g_paintmanager to paint the Collapse All
Subject Author Date
Sungsoo Yoon Jan 22, 2006 - 7:37 AM

Dear Prof-UIS.


I always receive your help. Thanks a lot.


But I can’t see any word about CExtPaintManager in your help file. Could you tell me where to get that.


In fact I would like to have g_paintmanager to paint the specified window area that is scrolled.


I got the code that enable the print preview from Cformview.


That code works well with Prof-UIS when the CFormview is small and don’t need to have any scrollbar.


But It has some trouble if the CFormview is larger than screen and some parts are scrolled.


Fortunately my application has the fixed size of formview and I decided to use the fixed size CRect in making bitmap instead of GetClientRect().


but g_paintmanager still use GetClientRect in the PaintDockerBkgnd(). So the scrolled area has black color.


How can I overcome it? I am going to send the sample code to you by email.


Thanks


 


void CMyFormView::OnFilePrintPreview()
{
 CRect rect(0,0,851,679);
//  this->GetClientRect( rect );
  CDC memDC;


 CClientDC dc( this );
  memDC.CreateCompatibleDC( &dc );


 CBitmap bitmap;
 bitmap.CreateCompatibleBitmap( &dc, rect.Width(), rect.Height() );
 {
  LocalGDI local( &memDC, &bitmap );
  this->Print( &memDC, PRF_CLIENT|PRF_CHILDREN|PRF_ERASEBKGND );
 }
 m_dib.Attach( GDIUtil::DDBToDIB( bitmap ) );


 CExtWS< CExtAFV< CFormView > >::OnFilePrintPreview( );
}


 


LRESULT CMyFormView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    LRESULT IResult = CExtWS< CExtAFV< CFormView > >::WindowProc(message, wParam, lParam);
 if (message == WM_INITDIALOG)
        OnInitialUpdate();
 
    if( message == WM_PRINTCLIENT )
    {
        ASSERT_VALID( this );
        CDC* pDC = CDC::FromHandle((HDC)wParam); //the specified device context


        CRect rcClient(0,0,851,679);
//        GetClientRect( &rcClient );


        CExtMemoryDC dc( pDC, &rcClient );
        bool bTransparent = false;


        if( g_PaintManager->GetCb2DbTransparentMode( this ) )
        {
            CExtPaintManager::stat_ExcludeChildAreas(dc.GetSafeHdc(), GetSafeHwnd(),
                CExtPaintManager::stat_DefExcludeChildAreaCallback);


            if( g_PaintManager->PaintDockerBkgnd( true, dc, this ) )
                bTransparent = true;
        }// if( g_PaintManager->GetCb2DbTransparentMode( this ) )


        if( ! bTransparent )
            dc.FillSolidRect(&rcClient,
            g_PaintManager->GetColor(CExtPaintManager::CLR_3DFACE_OUT, this));


        ///////////////////////////////////////////////////
        //////// DRAW YOUR RECTANGLES ON dc HERE ////////
        ///////////////////////////////////////////////////


        return 0;
    } // if( message == WM_PAINT )



 return IResult;
}

Technical Support Jan 22, 2006 - 9:24 AM

Paint managers are conceived to be internal parts of Prof-UIS. Typically you don’t need to know anything about them but just one thing: how to install this or that paint manager. The CExtPaintManager::PaintDockerBkgnd() virtual method paints a themed background which is based on a solid color in 2000/XP themes, a gradient in 2003/2005 themes and PNG images with different kinds of drawing effects in the skinned version of the paint manager. This means you have to redraw the entire content of the scrollable form view window when it is scrolled horizontally and/or vertically. Would you provide us with a test project which shows painting problems in your form view?

Sungsoo Yoon Jan 22, 2006 - 10:26 AM

Dear Prof-UIS

 

Thanks for your quick answer.

But I have already sent you my test project named "sample.zip".

Couldn’t you see it?

I am sending it again. This test project is your MDI sample code that I modified to explain my problem.

You can compile and run it then see one docked formview and print preview menu on the menubar.

 

Thanks

Technical Support Jan 25, 2006 - 4:26 AM

We received your e-mail and sent you a modified project. It now has an improved version of the scrollable form view with a consistent background.