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 » CExtNCW::OnPaint() Collapse All
Subject Author Date
Massimo Germi Jul 1, 2006 - 2:45 AM

Hi to all,

I need to draw some lines, inside a dialog frame ( CDlgObjects : public CExtNCW < CExtResizableDialog > ), maintaining current skin and/or colours.

I tried to override OnPaint function as follow:
void CDlgObjects::OnPaint()
{
    CExtNCW<CExtResizableDialog>::OnPaint();

    CClientDC dc(this);
    // My Drawing lines
}

I tried to call CExtNCW<CExtResizableDialog>::OnPaint(); believing to mantain current skin, but it seems doesn’t correct.

Do you have any suggestions
TX

Technical Support Jul 3, 2006 - 10:48 AM

To invoke the OnPaint() method of the base class is not correct and it is unnecessary. The themed background is painted before the OnPaint handler is invoked. So your code should look like as follows:

void CMainDlg::OnPaint() 
{
 CClientDC dc(this);
 
 dc.LineTo( 100, 100 );
}
Please note that CClientDC should be used instead of CPaintDC here.

Massimo Germi Jul 4, 2006 - 6:31 AM

I’m sending you an email with attached an image that reproduce the problem

Technical Support Jul 5, 2006 - 9:02 AM

Unfortunately we failed to reproduce this bug. You can open any Prof-UIS dialog-based sample and add the OnPaint() handler. You will not see any problems. Would you show us your OnPaint() code or send us the entire project?

Massimo Germi Jul 6, 2006 - 4:47 AM

I’ve sent you a simple project that put in evidence my problem.
TX