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 » Owner drawn Combo-box drawing bug in 2.84 Collapse All
Subject Author Date
Offer Har Feb 24, 2009 - 11:18 AM

Dear Support,


I use the CExtPaintManagerXP theme, I have several combo-boxes, when drawing an owner-drawn combo-box they are displayed in the normal XP style, not in the theme I choose. When I hover over them, it seems that Prof-UIS draws them, but immediately after the OS draws them again, causing an annoying flicker.


This is an example of 4 combo-boxes, 2 are normal, and 2 are ownder drawn:



Please fix.


Thanks,


Ron.

Technical Support Feb 24, 2009 - 1:41 PM

Thank you for reporting this issue. We have fixed it in the following method:

void CExtComboBox::OnPaint()
{
            if( ( GetExStyle() & (WS_EX_DLGMODALFRAME|WS_EX_CLIENTEDGE|WS_EX_STATICEDGE) ) != 0 )
                        ModifyStyleEx( WS_EX_DLGMODALFRAME|WS_EX_CLIENTEDGE|WS_EX_STATICEDGE, 0, SWP_FRAMECHANGED );
COLORREF clrFillClientArea = COLORREF(-1L);
DWORD dwStyle = GetStyle();
CPaintDC dcPaint( this );
            CExtPaintManager::stat_ExcludeChildAreas( dcPaint.GetSafeHdc(), GetSafeHwnd() );
CRect rcClient;
            GetClientRect( &rcClient );
CExtMemoryDC dc( &dcPaint, &rcClient );
CRgn _rgn;
            if( ( dwStyle & ( CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE ) ) != 0 )
            {
                        CRect rcRgn = rcClient;
                        rcRgn.right -= ::GetSystemMetrics( SM_CXVSCROLL );
                        if( _rgn.CreateRectRgnIndirect( &rcRgn ) )
                                    dc.SelectClipRgn( &_rgn );
            }
            DefWindowProc( WM_PAINT, (WPARAM)dc.GetSafeHdc(), (LPARAM)0 );
            if( _rgn.GetSafeHandle() != NULL )
                        dc.SelectClipRgn( NULL );
            if(                     (dwStyle&CBS_SIMPLE) == CBS_SIMPLE 
                        &&        (dwStyle&CBS_DROPDOWN) != CBS_DROPDOWN
                        &&        (dwStyle&CBS_DROPDOWNLIST) != CBS_DROPDOWNLIST
                        )
            {
                        if(                     (! PmBridge_GetPM()->GetCb2DbTransparentMode(this) )
                                    ||           (! PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
                                    )
                                    clrFillClientArea = PmBridge_GetPM()->GetColor( CExtPaintManager::CLR_3DFACE_OUT, this );
            }
            if( clrFillClientArea != COLORREF(-1L) )
                        dc.FillSolidRect( &rcClient, clrFillClientArea );
            _OnDrawComboImpl( GetDroppedState() ? true : false, IsHovered(), &dc );
}

Offer Har Feb 24, 2009 - 1:49 PM

Thanks!