Exemple #1
0
 private void MdiManager_MouseDown(object sender, MouseEventArgs e)
 {
     if (LastClickPoint.X == e.X && LastClickPoint.Y == e.Y)
     {
         int _usedTime = Environment.TickCount - LastClickTime;
         if (_usedTime < MouseDoubleClickTime)
         {
             int            i     = 0;
             BaseTabHitInfo _info = this.MdiManager.CalcHitInfo(new Point(e.X, e.Y));
             if (_info.Page != null)
             {
                 XtraMdiTabPage _page = _info.Page as XtraMdiTabPage;
                 _page.MdiChild.Close();
             }
             _usedTime = 0;
         }
         else
         {
             _usedTime = Environment.TickCount;
         }
     }
     else
     {
         LastClickPoint = new Point(e.X, e.Y);
         LastClickTime  = Environment.TickCount;
     }
 }
Exemple #2
0
        void manager_MouseMove(object sender, MouseEventArgs e)
        {
            BaseTabHitInfo hi = _Manager.CalcHitInfo(e.Location);

            if (hi.HitTest == XtraTabHitTest.PageHeader)
            {
                ShowHint(hi.Page);
            }
        }
        protected void OnMdiClientDragOver(object sender, DragEventArgs e)
        {
            IXtraTab       xtraTab = manager as IXtraTab;
            Point          p       = xtraTab.ScreenPointToControl(new Point(e.X, e.Y));
            BaseTabHitInfo hitInfo = manager.CalcHitInfo(p);

            if (hitInfo.HitTest == XtraTabHitTest.PageHeader)
            {
                manager.SelectedPage = (XtraMdiTabPage)hitInfo.Page;
            }
        }
Exemple #4
0
        protected override ToolTipControlInfo GetToolTipInfo(Point point)
        {
            BaseTabHitInfo hit = ViewInfo.CalcHitInfo(point);

            if (hit.Page != null && !hit.InPageControlBox)
            {
                foreach (BaseTabPageViewInfoDescendant item in AllPages)
                {
                    if (item.Page == hit.Page)
                    {
                        BaseTabPageViewInfoDescendant PageDes = item as BaseTabPageViewInfoDescendant;
                        return(PageDes.PagePanel.GetToolTip(point));
                    }
                }
            }
            return(base.GetToolTipInfo(point));
        }
Exemple #5
0
        void OnManagerMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            BaseTabHitInfo hi = managerCore.CalcHitInfo(new Point(e.X, e.Y));

            if (hi.HitTest == XtraTabHitTest.PageHeader)
            {
                Menu.Items.Clear();
                PopupMenuShowingEventArgs args = new PopupMenuShowingEventArgs(hi.Page)
                {
                    Menu = Menu
                };
                RaisePopupMenuShowing(args);
                ((IDXDropDownControl)Menu).Show(new SkinMenuManager(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel),
                                                managerCore.MdiParent.ActiveMdiChild,
                                                e.Location);
            }
        }
Exemple #6
0
        private void xtraTabbedMdiManager1_MouseUp(object sender, MouseEventArgs e)
        {
            //点左键无效, 必须是点右键弹出菜单
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            BaseTabHitInfo hint = xtraTabbedMdiManager1.CalcHitInfo(e.Location);

            //点击有效,且点击在TabPage标题上
            if (hint.IsValid && (hint.Page != null))
            {
                //有效子窗体
                if (xtraTabbedMdiManager1.SelectedPage.MdiChild != null)
                {
                    Point p = xtraTabbedMdiManager1.SelectedPage.MdiChild.PointToScreen(e.Location);
                    enableCloseMenu(xtraTabbedMdiManager1.Pages.Count == 1 ? false : true);
                    this.popupMenu2.ShowPopup(p);
                }
            }
        }
        private void xtraTabbedMdiManager1_MouseUp(object sender, MouseEventArgs e)
        {
            //点左键无效, 必须是点右键弹出菜单
            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            menuCloseThis.Enabled = !(xtraTabbedMdiManager1.SelectedPage.MdiChild is frmModuleContainer);//模块主窗体禁止关闭

            BaseTabHitInfo hint = xtraTabbedMdiManager1.CalcHitInfo(e.Location);

            //点击有效,且点击在TabPage标题上
            if (hint.IsValid && (hint.Page != null))
            {
                //有效子窗体
                if (xtraTabbedMdiManager1.SelectedPage.MdiChild != null)
                {
                    Point p = xtraTabbedMdiManager1.SelectedPage.MdiChild.PointToScreen(e.Location);
                    menuStripCloseForm.Show(p); //显示弹出菜单
                }
            }
        }