Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Popup Menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Popup Menus

 Post Reply Post Reply
Author
Message
DigiDog View Drop Down
Newbie
Newbie
Avatar

Joined: 22 August 2007
Location: United States
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote DigiDog Quote  Post ReplyReply Direct Link To This Post Topic: Popup Menus
    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
 
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2008 at 8:45pm

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
Back to Top
DigiDog View Drop Down
Newbie
Newbie
Avatar

Joined: 22 August 2007
Location: United States
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote DigiDog Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2008 at 10:33pm
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
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.188 seconds.