Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - How do I add a Pane menu?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I add a Pane menu?

 Post Reply Post Reply
Author
Message
mstuart View Drop Down
Groupie
Groupie


Joined: 06 April 2010
Location: United States
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote mstuart Quote  Post ReplyReply Direct Link To This Post Topic: How do I add a Pane menu?
    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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
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.125 seconds.