Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Toolbar dynamic menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar dynamic menu

 Post Reply Post Reply
Author
Message
rsimcic View Drop Down
Newbie
Newbie
Avatar

Joined: 26 July 2005
Location: Croatia
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote rsimcic Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar dynamic menu
    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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 07 July 2006 at 8:49am
Hello,
See DynamicPopups sample.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rsimcic View Drop Down
Newbie
Newbie
Avatar

Joined: 26 July 2005
Location: Croatia
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote rsimcic Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
Tsenoh View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tsenoh Quote  Post ReplyReply Direct Link To This Post 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)

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.047 seconds.