Print Page | Close Window

Add/Remove menu items

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=9457
Printed Date: 17 November 2024 at 10:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add/Remove menu items
Posted By: phil_the_lick
Subject: Add/Remove menu items
Date 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.




Replies:
Posted By: Oleg
Date Posted: 31 January 2008 at 11:17am
Him
 
See Samples\CommandBars\DynamicPopups  sample.


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



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