Print Page | Close Window

Reload Menus from Resource

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1780
Printed Date: 07 November 2025 at 2:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Reload Menus from Resource
Posted By: msherman
Subject: Reload Menus from Resource
Date Posted: 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




Replies:
Posted By: SuperMario
Date 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).




Posted By: msherman
Date 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



Posted By: SuperMario
Date 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.


Posted By: msherman
Date 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



Posted By: Oleg
Date Posted: 11 February 2005 at 1:27pm

Use

CMenu menu;
menu.LoadMenu(nIDResource);
pMenuBar->LoadMenu(&menu);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: msherman
Date Posted: 11 February 2005 at 2:43pm

Thank You! It works perfectly.

Mark




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net