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 » Bug in CExtPageNavigatorWnd Collapse All
Subject Author Date
Hans Bergmeister Jul 18, 2007 - 1:46 AM

Hello,

in our application we need to create a CExtPageNavigatorWnd item with three panes. The height of the top pane shall be initially set to -1.

The following code creates the three panes in correct order:

// correct: ////////////////////////////////////////////////////////////////////////

    CExtPageNavigatorWnd::PAGE_ITEM_INFO * pPII =
        m_wndPageNavigator.ItemInsert(
            -1,
            _T("Correct"),
            (HICON)NULL,
            (HICON)NULL
            );

    CEditView* poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    CExtPageNavigatorWnd::ITEM_PANE_INFO * pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            -1,
            _T("Top"),
            100,
            true
            );
    pIPI;

    poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            -1,
            _T("Center"),
            100,
            true
            );

    pIPI->Expand(CExtPageNavigatorWnd::ITEM_PANE_INFO::__ET_COLLAPSE);

    poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            -1,
            _T("Bottom"),
            -1,
            true
            );

    pIPI->Expand(CExtPageNavigatorWnd::ITEM_PANE_INFO::__ET_COLLAPSE);

// end of correct ////////////////////////////////////////////////////////////////////////

But as soon as we create the panes as we need them, with the height of the top pane set to -1, then the panes appear in wrong order:
"Top" over "Bottom" over "Center". The code below shows the wrong behaviour. It can be easily reproduced with the PageNavigator sample.

The order, in which these panes appear on the screen, should not depend on which of the panes has height -1.

(We cannot simply swap the order of "Bottom" and "Center" on creation of the panes as a workaround, because we additionally need to assign the height of -1 to different panes at runtime - by calling CExtPageNavigatorWnd::ITEM_PANE_INFO::HeightSet() programmatically. This again causes the items to appear in arbitrary order during runtime, which does not look very good).

// wrong ////////////////////////////////////////////////////////////////////////

    pPII =
        m_wndPageNavigator.ItemInsert(
            -1,
            _T("Wrong"),
            (HICON)NULL,
            (HICON)NULL
            );

    poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            -1,
            _T("Top"),
            -1,
            true
            );
    pIPI;

    poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            100,
            _T("Center"),
            100,
            true
            );

    pIPI->Expand(CExtPageNavigatorWnd::ITEM_PANE_INFO::__ET_COLLAPSE);

    poView = new CEditView;
    poView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);

    pIPI =
        pPII->PaneInsert(
            poView->GetSafeHwnd(),
            100,
            _T("Bottom"),
            100,
            true
            );

    pIPI->Expand(CExtPageNavigatorWnd::ITEM_PANE_INFO::__ET_COLLAPSE);

// end of wrong ////////////////////////////////////////////////////////////////////////

Technical Support Jul 18, 2007 - 8:48 AM

Thank you for reporting this bug. The next version (v.2.80) is ready and will be released today or tomorrow. So a fix for this bug will be added later.