Popup Menus |
Post Reply |
Author | |
DigiDog
Newbie Joined: 22 August 2007 Location: United States Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: 27 March 2008 at 5:03pm |
In the Customizable sample in CommandBars a right click gets the Edit Popup Menu on the text window at the mouse cursor.
How can that be made to be a different menu?
How can it be made to be a menu not visible on the toolbar?
Thanks
|
|
wlcabral
Groupie Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
Post Options
Thanks(0)
|
This Code can give you some idea (it's written for MS FOXPRO) ---------------------------------------------------------------------------------------------------------------------------------------------- * Create some ContextMenus with my special IDs. Check ContextMenu in Help for more information... * this.xTremeCommandBars.ContextMenus.Add(-100,'columnclick') * In Any right-click event : * Create a refrente to my contextmenu oPopup = This.oRibbon.xTREMECOMMANDBARS.ContextMenus.Find(-100) With oPopup.Controls * Clear the popup .DeleteAll() * Add some options .Add( xtpControlButton, 10, "abrir uma nova tela") .Add( xtpControlButton, 20, atualizar as informacoes") .Add( xtpControlButton, 30, "excluir") .Add( xtpControlButton, 40, "editar") .Add( xtpControlButton, 50, "adicionar") * Show Popup (see help for more information about ShowPopup) nOption = oPopup.ShowPopup(TPM_RETURNCMD) Do Case Case nOption = 10 Case nOption = 20 Case nOption = 30 Case nOption = 40 Case nOption = 50 Endcase Endwith |
|
wlcabral
|
|
DigiDog
Newbie Joined: 22 August 2007 Location: United States Status: Offline Points: 18 |
Post Options
Thanks(0)
|
Thanks for the reply wlcabral, but I guess what I am really trying to findout is how we know that ID_CONTEXT_MENU (1092) belongs to the Edit menu. Of the menus created in the Designer this is the menu it brings up. What if I want to bring up the Tools menu for example. There is no ID I can find that will do that. What makes Edit so special. Even looking at the XML of the visio file is not particularily helpful.
Thanks again for your help.
(VB6)
Private Sub rtfText_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If (Button = 2) Then If CommandBars.DesignerControls Is Nothing Then Exit Sub Dim Control As CommandBarControl, ContextControl As CommandBarControl Dim Popup As CommandBar Set Control = CommandBars.DesignerControls.Find(, ID_CONTEXT_MENU) 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 End If End Sub |
|
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 |