Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPControlPopup menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlPopup menus

 Post Reply Post Reply
Author
Message
andy_t View Drop Down
Newbie
Newbie


Joined: 19 October 2004
Location: Norway
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andy_t Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlPopup menus
    Posted: 17 June 2005 at 5:51am

Hi there,

I have a toolbar where I need dynamic CXTPControlPopup menus, so I went ahead and inherited from CXTPControlPopup and overrode OnSetPopup so that I could give it a new menu every time it's clicked:

BOOL CMyControlPopup::OnSetPopup(BOOL bPopup)
{
  CMenu menu;
  menu.LoadMenu(ID_MENU);

  /* Modify menu */ 

  // m_pCommandBar = NULL;

  SetCommandBar(menu.GetSubMenu(0));

  return CXTPControlPopup::OnSetPopup(bPopup);
}

1. This will show my new menu perfectly, but strange things happen when I select some of the menu items (it seems confused about the menu IDs).  Plus there's some strange flickering going on). 

2. If I uncomment the "m_pCommandBar = NULL;" statement things work much better, so there might be a bug in the LoadMenu call of CXTPControls or somewhere which is not cleaning out the menu correctly...

3. Even with the fix in 2., the menu usually stays up after a menu item is clicked:( Anyone know how to fix this?

Using XT Pro v9.60

cheers!

 

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: 17 June 2005 at 7:16am
call it only if bPopup == TRUE
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andy_t View Drop Down
Newbie
Newbie


Joined: 19 October 2004
Location: Norway
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andy_t Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2005 at 5:46am

Oh, of course...

Thanks a lot, that solved it!

,Andy

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