Serializing Controls and dynamic updates |
Post Reply |
Author | |
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Posted: 26 June 2008 at 6:04am |
Hi,
I use CXTPPropExchangeSection and DoPropExchange to load/store docking panels, menu bars, toolbars etc. in a database. Our application (especially while developing) gets new menu items and commands frequently. On runtime we also add/remove menu items depending on the availability of plug-ins or the current user. We also change the name of menu entries based on the current language, or the application mode. The problem is that new menu entries don't show up in the menus when we load them from the archive. It seems that CJ is not only storing the layout of the menues, but also the names of the menus. How can I restore the position and layout of menus and other control bars, but have the flexibility to change the name of a menu between application settings. XTP should not store the menu name string in the layout, right? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Its all depend what you do in your code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
I do what you do in your samples, or what one may be able to grasp from your documentation.
But when I change the menu bar (add entries, change the name of entries), and then call the methods to load the stored state, the new entries in the menu are no longer there and the old names are displayed. From what I can tell, your serialization methods store the complete menu, including the names of the menu entries. Instead of just the position of the menu. Is this correct? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Yes it stores all entries.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Is there a "How-To"how to deal with this?
Applications are dynamic, and updates may bring new menu commands, changed entries, order of menu entries etc. As far as I can see it, with the current XTP version I can only tell my users to throw away all their saved workspaces (containing docking pane layouts, toolbar positions, custmizations) when I bring out a new version. They won't like this because it takes quite some time to setup your custom workspace... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Please attach new sample to show what you do and what problem you have.
It have to work by default. You do something wrong in your code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
I'm doing nothing special. I load a menu from my "resource manager" into a CMenu, and then
The problem is that when the menu I load with LoadMenu has changed since the last run (new items added or removed), or the names of the items have changed in the menu (language switch), the m_paneManager.SetLayout(&layoutNormal); will invalidate all these changes. This call restores for example the names of the menu items as they were on the last save, not recognizing that they have changed. The layout apparently does not contain only the position of the menu but also the plain text names, descriptions, tool tip texts etc. So far the only thing that helps is to skip the call to load the layout when I did make changes to the menu or the names used in the menu. But then all docking panel positions etc. will also be reset to default values. My users won't like this. Is there a way in XTP to store only the positions, docking states etc. but not the actual items and commands used in the toolbars and menus? |
|
Smucker
Senior Member Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
|
I agree that this is a major problem, creating a support nightmare: users either lose their customizations or are missing new and changed commands. Both cause complaints and support calls.
|
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Yeah, I think this too.
But I'd would appreciate an official comment from Oleg or another Codejock Supporter. I don't think that Codejock has intented this to work this way because it would not fit the otherwise very good quality of the product. All I want to have is a safe way to restore the positions and size of docking panels and toolbars, even when some of the menu items have changed in-between. This cannot be so difficult, but frankly, all the serialization stuff in XTP has become so complex, I don't know where to begin... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
It works by default. You can check our samples.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |