Add/Remove menu items |
Post Reply |
Author | |
phil_the_lick
Groupie Joined: 03 January 2008 Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: 31 January 2008 at 10:21am |
Hi,
I've got a requirement whereby my file open menu needs to have items dynamically added/removed at run time. Not a most recent list but similar. I have the following in CMainFrame::OnCreateControl() if(lpCreateControl->nID==ID_FILE_OPEN) { lpCreateControl->controlType=xtpControlSplitButtonPopup; return TRUE; } Resource: ID_FILE_OPEN MENU BEGIN POPUP "Popup" BEGIN MENUITEM "item1" ID_FILE_ITEM1 MENUITEM "item2" ID_FILE_ITEM2 END END This converts the control into a sub menu both on my main menu and the toolbar in question. What I want is the ability to add a separator then some more items onto the end of the menu once on application startup. I'm guessing I also need to remove the sep and the menu items before the command bar state is saved. I also want to associate images with these new commands. How to go about this? Cheers, Phil. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Him
See Samples\CommandBars\DynamicPopups sample.
|
|
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 |