Print Page | Close Window

Context menu customise problem

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=11966
Printed Date: 22 December 2024 at 3:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Context menu customise problem
Posted By: jads
Subject: Context menu customise problem
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: jads
Date 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?


Posted By: Oleg
Date Posted: 26 August 2008 at 11:51am
What sample did you modify? Works for me....

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


Posted By: jads
Date 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


Posted By: jads
Date 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


Posted By: jads
Date Posted: 16 September 2008 at 7:37pm
Seems similar to the topic  https://forum.codejock.com/forum_posts.asp?TID=11984 - 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


Posted By: jads
Date Posted: 26 September 2008 at 4:13am
https://forum.codejock.com/uploads/20080926_040552_RibbonSample.zip -
 
 
uploads/20080926_040552_RibbonSample.zip
 
Here is a sample showing the problem. It adds a couple of items to the context menu that shows if you right click on the ribbon or on the dropdown next to the quickaccess bar. Clicking on the added items does nothing to the text, whne the expected result is to either bold or italic the text. Hope this helps to track down the problem.


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6


Posted By: Oleg
Date 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


Posted By: jads
Date 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.
 
https://forum.codejock.com/uploads/20080929_204827_RibbonSample.zip - uploads/20080929_204827_RibbonSample.zip


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP6


Posted By: jads
Date 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



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