Dynamic popup menu in ribbon splut-button? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Ah, thanks! OnCreateControl if I recall correctly... :)
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok :)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |