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 » CExtTabPageContainerFlatWnd Collapse All
Subject Author Date
Artur Shingirei Nov 29, 2004 - 8:19 AM

Hello.

I used CExtTabPageContainerFlatWnd as a base class for custom control.
My TabPageContainer contain more one Tab.
I need to make some initialize of controls inside container before appearing of form when I did click at tab on the TabPageContainer.

What method of CExtTabPageContainerFlatWnd I need to redefine or make something else?

Technical Support Nov 30, 2004 - 2:39 AM

Dear Artur,

Create a class derived from the CExtTabPageContainerFlatWnd class and override this method:

virtual bool
 CExtTabPageContainerFlatWnd::OnTabWndSelectionChange(
    LONG nOldItemIndex,
    LONG nNewItemIndex,
    bool bPreSelectionTest
    )
{
    bool bRetVal =
        OnTabWndSelectionChange(
            nOldItemIndex,
            nNewItemIndex,
            bPreSelectionTest
            );
    if( bRetVal )
    {
        if( bPreSelectionTest )
        {
/// POINT A:
/// BEFORE A NEW PAGE BECOMES ACTIVE
/// (the previous page window is still on the top
        ...
        }
        else
        {
/// POINT B:
/// WHEN THE NEW PAGE IS ACTIVATED
/// (the new page is visible)
        ...
        }
    }
    return bRetVal;
}
As the comments imply, you have two points where you can initialize the page. At the point A you may return false to disable selection of the tab item (this may be useful if your initialization code for this page fails for some reason).