Print Page | Close Window

How do I add a Pane menu?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=17520
Printed Date: 06 October 2024 at 12:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do I add a Pane menu?
Posted By: mstuart
Subject: How do I add a Pane menu?
Date Posted: 03 November 2010 at 4:30pm
Hi all,
I can't work out how to add a popup menu to a Pane.

I've searched the forum, looked at the samples, and also looked in the help, but can't find anything that shows how to do this in VB6.

Can someone help me please?

I've added the following event, but it's not working:

Private Sub DockingPane_PanePopupMenu(ByVal Pane As XtremeDockingPane.IPane, ByVal x As Long, ByVal y As Long, Handled As Boolean)
    If Pane.Id = 1 Then
        Dim PaneMenu As CommandBarPopup
        Set PaneMenu = CommandBars.ActiveMenuBar.Controls.Add(xtpControlButtonPopup, 1, "Popup")
        
        
        With PaneMenu.CommandBar.Controls
            .Add xtpControlButton, 111, "New Filter"
        End With
    End If
End Sub


Regards,
Mark Stuart


-------------
Regards,
Mark Stuart

Product: Xtreme SuitePro (ActiveX) v13.2.1
Platform: WinXP (32bit)/Win7 (64bit)
Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9



Replies:
Posted By: Hemesh
Date Posted: 04 November 2010 at 6:46am
Hi,

You have to enable the menu button on the pane (Pane.Options = PaneHasMenuButton) and then in the event you've mentioned, you have to use the ShowPopup function from the CommandBar to show the custom menu.

Is this what you mean? It's documented in the Help File (albeit in C#.NET, but easy enough to translate to VB6).



private void frmMain_Load(object sender, System.EventArgs e)
        {            
            MyColor = new System.Drawing.Color[15];
 
            MyColor[0] = System.Drawing.Color.AliceBlue;
            MyColor[1] = System.Drawing.Color.Beige;
            MyColor[2] = System.Drawing.Color.Chartreuse;
            MyColor[3] = System.Drawing.Color.DarkBlue;
            MyColor[4] = System.Drawing.Color.Cyan;
            MyColor[5] = System.Drawing.Color.Green;
            MyColor[6] = System.Drawing.Color.Magenta;
            MyColor[7] = System.Drawing.Color.Orange;
            MyColor[8] = System.Drawing.Color.Yellow;
            MyColor[9] = System.Drawing.Color.Salmon;
            MyColor[10] = System.Drawing.Color.Turquoise;
            MyColor[11] = System.Drawing.Color.Red;
            MyColor[12] = System.Drawing.Color.SteelBlue;
            MyColor[13] = System.Drawing.Color.Brown;
            MyColor[14] = System.Drawing.Color.Honeydew;
                    
            Pane A, B;
    
            A = MDIDockingPaneManager.CreatePane(1, 200, 120, DockingDirection.DockTopOf, null);
            A.Title = "Pane 1";
            A.Options = XtremeDockingPane.PaneOptions.PaneHasMenuButton;
            B = MDIDockingPaneManager.CreatePane(2, 200, 120, DockingDirection.DockLeftOf, A);
            B.Title = "Pane 2";
            B.Options = XtremeDockingPane.PaneOptions.PaneHasMenuButton;
        }
                    
        public System.Drawing.Color [] MyColor;
        
        private void MDIDockingPaneManager_PanePopupMenu(object sender, AxXtremeDockingPane._DDockingPaneEvents_PanePopupMenuEvent e)
        {
            if (e.pane.Id == 1 || e.pane.Id == 2)
            {
                
                CommandBar Popup;
                CommandBarControl Control;
                XtremeCommandBars.CommandBarControls Controls;
 
                Popup = CommandBars.Add("Popup", XtremeCommandBars.XTPBarPosition.xtpBarPopup);
                Controls = Popup.Controls;
 
                for (int x = 500; x < 515; x++) 
                {
                    Control = Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, x, MyColor[x - 500].ToString(), -1, false);
                }
            
                Popup.ShowPopup(XtremeCommandBars.XTPTrackPopupFlags.TPM_RIGHTBUTTON, e.x, e.y);
            }    
        }


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0



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