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 » Run-time tabbed bar style changing Collapse All
Subject Author Date
Alex Makarov Sep 16, 2006 - 7:54 PM

I am writing an appication in which I want user to be able to choose the tabbed toolbar style from classes:

CExtTabbedToolControlBar
CExtTabbedToolControlBarFlat
CExtTabbedToolControlBarButtons
CExtTabbedToolControlBarWhidbey
CExtTabbedToolControlBarOneNote

Can you please suggest the best way to implement run-time changing of the tabbed toolbar class?
Thank you.

Technical Support Sep 18, 2006 - 3:09 AM

To change tabbed windows on the fly, save the control bar’s UI state, destroy all the tabbed toolbars and create them again using a new desired type. All the re-created bars should have the same dialog control identifiers as the previous bars of the previous type. Finally, you should load the control bar’s state.

Alex Makarov Sep 18, 2006 - 8:07 AM

And on the next launch user sees the original style. Does not work. Thank you, this way is obvious, is there anything else actualy doing what I need?

Technical Support Sep 19, 2006 - 9:32 AM

We believe it is possible to code the correctly working solution as we described in the previous message. Of course, you should save/restore the settings which describe the type of currently used bars. We can analyze your project if you send it to us.

Alex Makarov Sep 20, 2006 - 8:38 AM

I use the segments of your TabbedBars sample. All styles bars there are created in OnCreate() of MainFrm.cpp. In my project I create only one tabbed toolbar with style defined in the pubilc member control decralation in MainFrm.h. I can change the bar style on the fly as you suggested and remember this user’s preference. But at the next application’s start, where the program is supposed to find the proper control declaration, if it is in the header file, loading before checking all stored settings?
Thanks.

Technical Support Sep 21, 2006 - 6:33 AM

You should use a pointer to the CExtTabbedToolControlBar window as a member of your main frame window. The tabbed toolbar window of appropriate type should be created using the C++ new operator before invoking its Create() method. Of course you should load the type setting before instantiating the tabbed tool bar C++ object in the dynamic memory. The type of tabbed bar to instantiate can be loaded/saved as numeric constant with invoking of the CWinApp::GetProfileInt()/CWinApp::WriteProfileInt() methods.

Alex Makarov Sep 21, 2006 - 2:44 PM

Thanks, makes sense:) I’ll try it.