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 » Yet anher problem with the new design of CExtTabPageContainerWnd Collapse All
Subject Author Date
Offer Har Nov 9, 2009 - 7:48 AM

Hi,


I have this code in OnInitDialog:



    m_grid1.Create(&m_ctrlTab);
    m_grid2Create(&m_ctrlTab);

And in a much later time I decide if I want to show these tabs:



if (bShowGrid1) m_ctrlTab.PageInsert(m_grid1, "grid 1");
In 2.84 it worked fine, however in 2.87 unless I add this line (after you fixed this function...):

m_ctrlTab.GetSafeTabWindow();

The pages I decide not to show will partially appear if I click in the tab control in the place where there is no tab.


This derives, again, from the actual control not being created while the pages are created.


Please fix.


Thanks,


Ron.

Technical Support Nov 16, 2009 - 1:20 PM

Here is the source code of the CExtTabPageContainerWnd::GetSafeTabWindow() method in Prof-UIS 2.87 (just released):

CExtTabWnd * CExtTabPageContainerWnd::GetSafeTabWindow()
{
            ASSERT_VALID( this );
            VERIFY( _CreateHelper() );
            if( m_pWndTab == NULL )
                        return NULL;
            ASSERT_VALID( m_pWndTab );
            if( m_pWndTab->GetSafeHwnd() == NULL )
                        return NULL;
            return m_pWndTab;
}
As you can see, it invokes the VERIFY( _CreateHelper() ); code before any other actions. The CExtTabPageContainerWnd::_CreateHelper() method instantiates and create the tab window inside the tab page container:
bool CExtTabPageContainerWnd::_CreateHelper()
{
            ASSERT_VALID( this );
            if( GetSafeHwnd() == NULL )
                        return false;
            if( m_pWndTab == NULL )
                        m_pWndTab = OnTabWndGetTabImpl();
            ASSERT_VALID( m_pWndTab );
            if(                     m_pWndTab != NULL 
                        &&        m_pWndTab->m_hWnd == NULL 
                        )
            {
                        if( !       m_pWndTab->Create(
                                                            this,
                                                            CRect( 0, 0, 0, 0 ),
                                                            0x100,
                                                            WS_CHILD|WS_VISIBLE, //|WS_TABSTOP,
                                                            __ETWS_ORIENT_BOTTOM,
                                                            NULL
                                                            )
                                    )
                                    return false;
                        _RepositionBarsImpl();
                        HookSpyRegister( __EHSEF_KEYBOARD );
            }           
            return true;
}
Please note, all the other methods of the CExtTabPageContainerWnd class are invoking the CExtTabPageContainerWnd::GetSafeTabWindow() method at the beginning. Here is the example:
bool CExtTabPageContainerWnd::EnabledBtnHelpGet() const
{
            ASSERT_VALID( this );
            if( GetSafeTabWindow() == NULL )
                        return false;
            return (m_pWndTab->GetTabWndStyle() & __ETWS_ENABLED_BTN_HELP) ? true : false;
}
This means, the tab page container control in the released Prof-UIS 2.87 works like it did in previous Prof-UIS versions.
If you have different source code of the CExtTabPageContainerWnd::GetSafeTabWindow() and CExtTabPageContainerWnd::_CreateHelper() methods, then please update to just released version 2.87.



Technical Support Nov 9, 2009 - 11:17 AM

We cannot confirm this. The CExtTabPageContainerWnd::PageInsert() method invokes the CExtTabPageContainerWnd::_CreateHelper() before registering the page window and the CExtTabPageContainerWnd::_RepositionBarsImpl() finally. The CExtTabPageContainerWnd::_CreateHelper() method creates tab control. The CExtTabPageContainerWnd::_RepositionBarsImpl() method updates internal layout of the tab page container window. Did you override any virtual methods of the CExtTabPageContainerWnd class for changing its default behavior?

Offer Har Nov 14, 2009 - 2:06 PM

Hi,


I am telling you that this is what happens to our existing code.... code that worked perfectly fine in 2.84 does not work well in 2.87 unless I add the line that calls GetSafeTabWindow before I do any tab container related work... As you well know, and explained me in the past problem I had with this issue in 2.87, You do not create the tab control window until an explicit call to create it, which is not the same as it was in 2.84, and the problem is right in front of my eyes... and the solution as well!


Pleas explain why you are doing this change of not creating the tab control? it seems to break a lot of existing code. Please re-consider this change before the final release of 2.87.


By the way when are you going to release 2.87?


Thanks,


Ron.