Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Add/Remove menu items
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add/Remove menu items

 Post Reply Post Reply
Author
Message
phil_the_lick View Drop Down
Groupie
Groupie


Joined: 03 January 2008
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote phil_the_lick Quote  Post ReplyReply Direct Link To This Post Topic: Add/Remove menu items
    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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2008 at 11:17am
Him
 
See Samples\CommandBars\DynamicPopups  sample.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.