示例#1
0
        internal MetaTreeNode[] CurrentContentsMetaTreeNodes;      // MetaTreeNodes currently selected

        public QbContentsTree()
        {
            InitializeComponent();
            WinFormsUtil.LogControlChildren(this);

            ContentsTreeContextMenus = new QbContentsTreeMenus();             // context menus for main contents tree
            ContentsTreeContextMenus.QbContentsTree = this;
            Instance = this;
        }
示例#2
0
        private void ListControl_MouseDown(object sender, MouseEventArgs e)
        {
            //ClientLog.Message("Down " + ListControl.SelectedIndex);
            int i1 = ListControl.SelectedIndex;             //  e.Y / ListControl.ItemHeight;

            if (i1 >= MatchingContentsNodes.Count)
            {
                return;                                                // selected elipsis
            }
            MetaTreeNode mtn = MatchingContentsNodes[i1];

            if (e.Button == MouseButtons.Left)             // immediate action
            {
                QbUtil.CallCurrentProcessTreeItemOperationMethod("Open", mtn.Target);
                //MainMenuControl.OpenMetaTreeNodeObject(mtn);
                HideQuickSearchPopup();
            }

            else             // right button click, show menu
            {
                QbContentsTree treeCtl = SessionManager.Instance.MainContentsControl;
                treeCtl.CurrentContentsMetaTreeNode = mtn;
                treeCtl.CurrentContentsTreeListNode = null;                 // tree list node not known

                ActiveContextMenu = treeCtl.ContentsTreeContextMenus.GetSingleNodeContextMenu(mtn);
                if (ActiveContextMenu != null)
                {
                    ActiveContextMenu.Show(ListControl, new System.Drawing.Point(e.X, e.Y));
                    while (ActiveContextMenu != null && ActiveContextMenu.Visible)                     // keep this visible as long as popup is visible
                    {
                        System.Threading.Thread.Sleep(250);
                        Application.DoEvents();
                    }
                    HideQuickSearchPopup();
                }
            }

            return;
        }