SOLVED: Respond to Context Menu |
Post Reply |
Author | |
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
Posted: 27 August 2008 at 3:39am |
Dear all,
How to respond to Context Menu selection ...!!
Regards
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Add Execute event handler.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hi Oleg,
Could You elaborate more, an example will be great ...
Actually, I added an event handler to the commandbar execute event, and it works for all toolbar buttons, but for the context it sometimes fire and sometimes not ...!!
regards
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Did you create your menu in code or did you just dropped a Commandbars control and let CB create the menu for you?
I did the last option and found there are a couple of strange things happening see my post: https://forum.codejock.com/forum_posts.asp?TID=11986
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hello Aaron,
I create the full Context Menu in Code ...
Is it cona be different to create those context as popup menus in the Active menubar itself ??? I 'll give it a try ....
Best,
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi, Yes, you can. I have a mainmenu with items, same items can be shown as toolbar and/or context menu.
Just call:
CommandBars.ActiveMenuBar.Controls(ID_POPUP_CONTROL).CommandBar.ShowPopup
for showing contextmenu
Just call:
CommandBarsViewEditor.ActiveMenuBar.Controls(ID_POPUP_CONTROL).CommandBar.SetTearOffPopup "Caption of toolbar", SOME_ID, 500
for possibility to tearoff toolbar
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hello All,
I try the Popup Menu it works fine as Popup menu up in the active menu bar, but not as Context Menu, Still behave the same .... !!!
Funny, isn't it ....
Ideas ......
/Edit:
Thanks Aaron they both works fine ...
CommandBars.ActiveMenuBar.Controls(1).CommandBar.ShowPopup()
&
CommandBars.ActiveMenuBar.Controls(1).CommandBar.SetTearOffPopup("Tree Options", 20000, 500)
It is strange that the Context Menu is not behaving the same !!!
Not a problem as long as It surve the purpose, right ...
Thanks again Aaron.
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
try not specify x and y to allow commandbars use cursor coordintes. guess problem in your calculation fo these x and y.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Dear All,
I am doomed !!!
The Popup menu solution to be used as context menu has been successful so far, until I decided to hide the Active menu bar....
I can't used the popup menus anymore ...
any ideas, I am ... doomed
Best regards,
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I justed tested this and it works with STANDARD VB MENU So I expect... it should be working when creating a menu in code.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hello Aaron, I used this code: CommandBars.ActiveMenuBar.Visible = False when I rightclick on any control I got an empty Menu (small Gray box)If I put it back to True, I can ....
what is the problem the Menubar can be exist but not visible, right ...
Best regards
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Yes it should be. Do you create contextmenu in code as well? Or create it when necessary? If you do, try to loop Commandbar.Controls collection and check if there are any...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
WaleedSeada
Groupie Joined: 29 March 2007 Location: Egypt Status: Offline Points: 88 |
Post Options
Thanks(0)
|
Hello Aaron,
I don't use context Menus, I used the Popup menu from the one attahced to the ActiveMenuBar.
and it is created in code ...
regards,
|
|
:Powerbuilder 10.5
:Codejock suite 11.2.2 ========================= Waleed Seada |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
You can also copy buttons into your popmenu and also check if they exist. I have only VB code to show you but maybe you understand it anyway.
Dim Control As CommandBarControl
Dim ContextControl As CommandBarControl
Dim Popup As CommandBar Set Control = CommandBars.ActiveMenuBar.FindControl(, ID_POPUPCONTROL)
If Control Is Nothing Then Exit Sub Set Popup = CommandBars.Add("Popup", xtpBarPopup) For Each ContextControl In Control.CommandBar.Controls ContextControl.Copy Popup Next Popup.ShowPopup |
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
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 |