Print Page | Close Window

CXTPControlPopup menus

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=2400
Printed Date: 05 March 2025 at 1:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlPopup menus
Posted By: andy_t
Subject: CXTPControlPopup menus
Date 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!

 




Replies:
Posted By: Oleg
Date Posted: 17 June 2005 at 7:16am
call it only if bPopup == TRUE

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


Posted By: andy_t
Date Posted: 20 June 2005 at 5:46am

Oh, of course...

Thanks a lot, that solved it!

,Andy




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