Print Page | Close Window

Toolbar dynamic menu

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=4553
Printed Date: 11 November 2025 at 8:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar dynamic menu
Posted By: rsimcic
Subject: Toolbar dynamic menu
Date Posted: 07 July 2006 at 6:25am
How can I, at runtime, attach a dynamically created menu to the toolbar button with the flag xtpControlSplitButtonPopup(created in OnCreateControl function). I have the menu in resource file but occasionally I must modify it or replace it with a new one.
 
Please help.
 
Thanks



Replies:
Posted By: Oleg
Date Posted: 07 July 2006 at 8:49am
Hello,
See DynamicPopups sample.


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


Posted By: rsimcic
Date Posted: 07 July 2006 at 12:35pm

This is what I need but in my case it's not working. I Created the new class like in the example and I added the submenu button to the OnCreateControl function but it's not going into the if statement.

This is the toolbar button if statement in OnCreateControl function

if (lpCreateControl->nID == ID_CALC_PIPE_LINE)

{

lpCreateControl->controlType = xtpControlSplitButtonPopup;

return TRUE;

}

And this is the submenu button statement that doesn't work (here doesn't enter but the menu is created)

if (lpCreateControl->nID == ID_INSTALATION_LIST)

{

lpCreateControl->pControl = new CnstalationList();

return TRUE;

}

 

This is the menu:

ID_CALC_PIPE_LINE MENU DISCARDABLE

BEGIN

POPUP ""

BEGIN

MENUITEM "[Installations]", ID_INSTALATION_LIST

END

What is missing?


Posted By: Oleg
Date Posted: 07 July 2006 at 3:49pm
Hi,
 
It looks ok. Attach full mainfrm.cpp to see. Try to recompile project may be problem that resource in rc is different than in cpp...


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


Posted By: Tsenoh
Date Posted: 04 December 2006 at 9:23am
Originally posted by rsimcic rsimcic wrote:

if (lpCreateControl->nID == ID_INSTALATION_LIST)

{

lpCreateControl->pControl = new CnstalationList();

return TRUE;

}

 


Can it be that an "I" is missing in the line with "new" (CInstalationList)




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