Print Page | Close Window

Dynamic popup menu in ribbon splut-button?

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=13945
Printed Date: 28 February 2025 at 2:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dynamic popup menu in ribbon splut-button?
Posted By: znakeeye
Subject: Dynamic popup menu in ribbon splut-button?
Date Posted: 07 April 2009 at 9:58am
Where should I re-populate a dynamic popup menu that is used in a split-button of a ribbon button?
I tried adding it in my update-handler, but that resulted in extreme flickering :P.
 
Your ribbon samples do not demonstrate this. The undo-menu (as close as it gets) is a gallery... :(


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: Oleg
Date Posted: 08 April 2009 at 12:53am
Hi,
 
Most right way is to create special control that popuplates menu. See how it work in Samples\CommandBars\DynamicPopups\ControlUndo.cpp


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


Posted By: znakeeye
Date Posted: 08 April 2009 at 2:57am

Ah, thanks!

OnCreateControl if I recall correctly... :)


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 08 April 2009 at 2:47pm

Just want to point out that DynamicPopups principle does not work for ribbon-controls!

However, simply adding the control to the group solves it. But if OnCreateControl is supposed to be fired, you do indeed have a bug!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 09 April 2009 at 3:40am
Hi,
 
OnCalcDynamicSize will be called when size of Ribbon will be changed or something like that. Better use it only in Popup windows - not in toolbars or Ribbons.


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


Posted By: znakeeye
Date Posted: 09 April 2009 at 6:06am

Ok, I just noticed there is a problem with OnCalcDynamicSize when the the menu buttons do not close the menu (SetCloseOnSubMenuClick(FALSE)). The item is not redrawn after clicking it the first time. Perhaps just a ribbon-problem, but I sense this is a problem for the DynamicPopup sample too.

Anyway, can you please tell me how to create a dynamic popup-menu for a ribbon control. Do I have to use a gallery? Thanks!



-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 09 April 2009 at 7:49am

Hi,

Same way will work for dynamic popup-menu for a ribbon control. You only can't use it to popluate control directly in Ribbon.


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


Posted By: znakeeye
Date Posted: 09 April 2009 at 4:39pm
Ok, so the question remains. When should I populate/re-populate it? The wanted items will change during the lifetime of the ribbon...
 
Perhaps the gallery-handler? OnMyGallery() ...


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 10 April 2009 at 1:27am

Hi,

I don't understand your task. You alredy wrote 3 times that these items inside popup-menu and not inside Ribbon.


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


Posted By: znakeeye
Date Posted: 10 April 2009 at 4:30am
I solved it, so let me explain.
 
I have a popup-button in my ribbon. The popup menu to show is dynamic and changes every now and then. Where should I populate it?
 
The answer is: ON_XTP_INITMENUPOPUP (don't remember the exact name). Inside this handler I remove all menu-items and recreate them. Works!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 10 April 2009 at 6:36am
ok :)

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



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