Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Context menu customise problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Context menu customise problem

 Post Reply Post Reply
Author
Message
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Topic: Context menu customise problem
    Posted: 26 August 2008 at 3:46am
Using the RibbonSample vb6 project or the vb.net equivalent, if you add the following code to the form in order to customise and handle the context menu
 
Private Sub CommandBars_ToolBarContextMenu(ByVal ToolBar As
XtremeCommandBars.ICommandBar, ByVal ContextMenu As XtremeCommandBars.ICommandBar)
        ContextMenu.ShowPopup 0#, 100, 100
        ContextMenu.Controls.DeleteAll
End Sub
run the project and click on the quickaccess context menu button, the menu pops up as exepected, choose an option, then a blank menu appears, then the quickaccess context menu button cannot be clicked on again.
 
Have also noticed a similar problem sometimes occurs with the globe contol if a right click is done on a popupbarlist
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: 26 August 2008 at 6:52am
Hi,
don't call ShowPopup from ToolBarContextMenu menu handler. Change ContextMenu controls instead - Toolkit will show popup manually.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2008 at 7:25am
Hi,
The reason why I was showing the popup was because the commandbar execute event did not occur when choosing commands added to the context menu,
i.e. in your sample having the following code in the ToolBarContextMenu event and clicking on the commands added didnt cause the execute event to be raised.
 

Private Sub CommandBars_ToolBarContextMenu(ByVal ToolBar As XtremeCommandBars.ICommandBar, ByVal ContextMenu As XtremeCommandBars.ICommandBar)
        ContextMenu.Controls.Add xtpControlButton, ID_CHAR_BOLD, "Bold"
        ContextMenu.Controls.Add xtpControlButton, ID_CHAR_ITALIC, "Italic"
End Sub
 
Is there something I am missing?
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: 26 August 2008 at 11:51am
What sample did you modify? Works for me....
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2008 at 10:25pm
The one installed here:
C:\Program Files\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v12.0.2\Samples\CommandBars\VB\RibbonSample
 
The only thing it goes into the CommandBars execute event for, from the context menu,  is the More Commands option
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 9:34pm
It seems to operate as if the TPM_RETURNCMD flag is set when the popup menu is shown after the ToolBarContextMenu event is used to customise the context menu
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2008 at 7:37pm
Seems similar to the topic https://forum.codejock.com/forum_posts.asp?TID=11984, in that the the execute event does not fire for items chosen from the context menu. It says solved there, but the solution doesnt seen to apply to the original problem of items added to the context menu not causing the execute event to fire when chosen.
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2008 at 4:13am
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6
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: 29 September 2008 at 4:08am
Hello,
 
Thanks for sample, now I see. Its fixed for 12.1 release.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2008 at 8:49pm
Thanks for that. The workaround we used was to show the popup ourselves, return the command and execute the selected control. This worked fine on a right click, but froze the quickaccess dropdown button so that it couldnt be used after the first use.
 
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6
Back to Top
jads View Drop Down
Groupie
Groupie


Joined: 26 August 2008
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jads Quote  Post ReplyReply Direct Link To This Post Posted: 17 June 2009 at 12:20am
Having clicked on the context manu button to show the context menu, if you hit the <Esc> key or click somewhere not on the context menu, the context menu closes, but the context menu button cannot be selected again. it remains in the selected state.
If you choose an option from the context menu, the context menu button state correctly becomes unselected.
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6
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.293 seconds.