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 » Frame Features Tech Support » CExtChildResizablePropertySheet not draw correctly Collapse All
Subject Author Date
Adam Marcol Mar 25, 2005 - 6:52 AM

Hi,

I have a problem with the CExtChildResizablePropertySheet. It does not draw correctly the border if you choose the style with the borders. The bottom border is not visible. This happens also in your sample. Its very ugly when it is coloured style or when you put anchored controls, they seem to be anchored down endless. Is there a solution for this ?

Kind Regards
Adam

Technical Support Mar 25, 2005 - 9:26 AM

Dear Adam,

The standard Windows property sheet control is designed to be used as a pop-up window only. Our CExtResizablePropertySheet class allows you to use the property sheet control as a child window, which is demonstrated in the ResizableChildSheet sample. We have remade the property sheet’s functionality (including that dealing with processing the TAB key, when you need to switch between its child windows) to make it work as a child window. This was mostly experimental work. Yes, we confirm that this is a bug and it is at least several month old. But unfortunately we have not found a way to fix it. When we tried to re-position the tab window manually we faced many situations when the property sheet moves it back into covering border state. If you fix this problem we would offer you a one user license. What do you think about this idea?

Adam Marcol Mar 25, 2005 - 12:00 PM

Hi,

I found a workaround that is working fine for me with all Child Propertysheet styles.

In CExtResizablePropertySheet::OnSize(...) it is moving the window and i changed it to this :

            pTabCtrl->GetItemRect(0,&rect);
            pTabCtrl->MoveWindow( 0, 0, cx, cy-(rect.bottom-rect.top)-9, FALSE );

It seems to be the height of the Tabs + 9 Pixels the problem. But I dont`t know where this 9 px come from. Perhaps you know. I think it could be from the window Header ( CExtControlBar ).

Adam Marcol Mar 25, 2005 - 12:28 PM

In Release this doesn`t work, because the rect of the tab control is returing completly shity numbers.
Here works only with the original height 18 hardcoded.

pTabCtrl->MoveWindow( 0, 0, cx, cy-18-9, FALSE );

Is 27 a "magic" number for the height of something ?

Technical Support Mar 28, 2005 - 6:22 AM

It seems, with your help, we have fixed the bug in our experimental property sheet. Please check the modified version and contact us at support@prof-uis.com so that we can fulfill our promise.

void CExtResizablePropertySheet::OnSize(
    UINT nType, int cx, int cy ) 
{
    CExtWA <
        CExtWS <
            __BASEOF_CExtResizablePropertySheet__
            >
        > :: OnSize( nType, cx, cy );
    if(    GetSafeHwnd() != NULL
        && ::IsWindow( GetSafeHwnd() )
        )
    { // if valid window
        DWORD dwStyle = GetStyle();
        if( (dwStyle&WS_CHILD) != 0 )
        { // if child sheet window
            CTabCtrl * pTabCtrl = GetTabControl();
            if( pTabCtrl != NULL )
            {
                int nAdjustTabWndDY =
                    ( (dwStyle&WS_CAPTION) == 0 )
                        ? ( ::GetSystemMetrics(
                                SM_CYCAPTION )
                          + ::GetSystemMetrics(
                                SM_CYDLGFRAME )
                              * 2
                          )
                        : 0
                        ;
                pTabCtrl->MoveWindow(
                    0,
                    0,
                    cx,
                    cy - nAdjustTabWndDY,
                    FALSE
                    );
                ArrangeLayout();
                _TrickSyncActviveChild();
            } // if( pTabCtrl != NULL )
        } // if child sheet window
    } // if valid window
}

Adam Marcol Mar 29, 2005 - 2:11 PM

Hi,

Works fine ...