![]() |
Toolbar dynamic menu |
Post Reply
|
| Author | |
rsimcic
Newbie
Joined: 26 July 2005 Location: Croatia Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Toolbar dynamic menuPosted: 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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 July 2006 at 8:49am |
|
Hello,
See DynamicPopups sample.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
rsimcic
Newbie
Joined: 26 July 2005 Location: Croatia Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Tsenoh
Groupie
Joined: 08 November 2006 Status: Offline Points: 69 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 December 2006 at 9:23am |
Can it be that an "I" is missing in the line with "new" (CInstalationList) |
|
![]() |
|
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 |