Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Dynamic popup menu in ribbon splut-button?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic popup menu in ribbon splut-button?

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic popup menu in ribbon splut-button?
    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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2009 at 2:57am

Ah, thanks!

OnCreateControl if I recall correctly... :)
PokerMemento - http://www.pokermemento.com/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 10 April 2009 at 6:36am
ok :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.170 seconds.