![]() |
Reload Menus from Resource |
Post Reply
|
| Author | |
msherman
Newbie
Joined: 11 February 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Reload Menus from ResourcePosted: 11 February 2005 at 11:20am |
|
Hello, Using CXTPCommandBars I call SetMenu and pass in the resource ID. It works wonderfully well, the menus are created. However I would like to provide the ability for users to refresh their menus, after they have configured them, to their original state as they are defined in the resource file. Is there a way to do this? Thanks Mark |
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 11:37am |
|
Yes there is. By default all toolbar have a "Reset" button to
reset to there original configuration. I think you need to enable
customization (There is a post on here somewhere that tells how).
![]() |
|
![]() |
|
msherman
Newbie
Joined: 11 February 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 11:49am |
|
Thanks for the very fast reply! Is there a way to launch a refresh programmatically and not just when the user selects the refresh menu item? Also it appears that the reset feature you mention calls CXTPToolBar::Reset(). I would like to run the same type of functionality on a CXTPMenuBar but however the overridden method Reset() is private in that class. Thanks Mark |
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 12:07pm |
|
Hmm, in the next release you can save you layout to an XML file.
You could then save a "default" layout of your menus as you want
them. Then you would simply load the "default" menu. All
can be done programmatically. New release should be out next
week. Currently you can load and save with XCB files, but you
have to create the menuin the Designer Studio. So unless someone
else has a better solution I would suggest waiting until the next
release for the XML file functionality.
Edited by SuperMario |
|
![]() |
|
msherman
Newbie
Joined: 11 February 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 12:52pm |
|
On a potentially tangential topic, what does CXTPMenuBar::LoadMenuBar() do? I called it passing in the resource id for the menu I would like to refresh and it seems to have successfully reset the menu to its state as defined in the resource file. However I also got an assert in xtpmenubar.cpp line 508. Thanks Mark |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 1:27pm |
|
Use CMenu menu; |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
msherman
Newbie
Joined: 11 February 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2005 at 2:43pm |
|
Thank You! It works perfectly. Mark |
|
![]() |
|
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 |