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 General Discussion » CExtPageNavigatorWnd - dynamically change the menus? Collapse All
Subject Author Date
Cyndi Chatman Mar 5, 2007 - 8:10 AM

I am using the CExtPageNavigatorWnd class. In several of my views, I have dialog boxes with tabs on them. Based upon which tab is active, I want to swap out the menu that is displayed in the page navigator. For example, if I have a tab with a grid control on it, I want to display a menu; if I have a different tab active, I want to display a tree control in the page navigator. I am setting up the page navigator in the OnCreateClient() function of the CMainFrame. Since this is done once, at startup, so how can I dynamically change out the contents of the m_wndPageNavigator during runtime?

Technical Support Mar 5, 2007 - 12:13 PM

To switch between the Page Navigator panes in the command handler, you need to use the CExtPageNavigatorWnd::SelectionSet method.

Please note that the Page Navigator control allows the user to regroup (swap, move) its items using the Options dialog. These operations can also be done programmatically using the ItemsSwap and ItemMove methods. Moreover the Page Navigator’s state can be saved and then restored. So the problem is how to locate you pages. In other words how to retrieve real indexes of the pages which can be changed after the Page Navigator was initialized.

As you can see, you should not save the page indexes at the initialization stage and then use it. To solve this problem, to retrieve the real index of the page, you should always use the ItemFind method.

This method has two overloads, which allows you to find the first page by its name (the sText parameter) or by the user data associated with the page (the lParam parameter).