Print Page | Close Window

Popup Menus

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=9979
Printed Date: 08 October 2024 at 6:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Popup Menus
Posted By: DigiDog
Subject: Popup Menus
Date 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
 



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


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



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