예제 #1
0
/// <summary>
/// Tabs_MouseUp - Handle mouse right-click operations
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

        private void Tabs_MouseUp(object sender, MouseEventArgs e)
        {
            Point mousePosition = Control.MousePosition;

            if (e.Button == MouseButtons.Right)
            {
                XtraTabHitInfo hitInfo = Tabs.CalcHitInfo(new Point(e.X, e.Y));
                if (hitInfo.HitTest == XtraTabHitTest.PageHeader)
                {
                    XtraTabPage tp      = hitInfo.Page;
                    string      tabName = (tp.Tag != null) ? tp.Tag.ToString() : "";

                    if (tabName == "AddNewTab")
                    {
                        return;
                    }

                    else                     // show the ResultsPage menu
                    {
                        int   x = Cursor.Position.X;
                        int   y = Cursor.Position.Y;
                        Point p = new Point(x, y);
                        p = this.PointToClient(p);
                        PageContextMenu.Show(this, p);
                    }
                }
            }
        }
예제 #2
0
        ////////////////////////////////////////////////
        ///////////////// Query Menu ////////////////////
        ////////////////////////////////////////////////

        /// <summary>
        /// Display query command menu on a rt-click on the tab header for a query
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Tabs_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                XtraTabHitInfo hitInfo = Tabs.CalcHitInfo(Tabs.PointToClient(Control.MousePosition));
                if (hitInfo.HitTest == XtraTabHitTest.PageHeader)
                {
                    XtraTabPage tp      = hitInfo.Page;
                    string      tabName = (tp.Tag != null) ? tp.Tag.ToString() : "";

                    int   x = Cursor.Position.X;
                    int   y = Cursor.Position.Y;
                    Point p = new Point(x, y);
                    p = this.PointToClient(p);
                    QueryContextMenu.Show(this, p);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Show menu for table
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Tabs_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                XtraTabHitInfo hitInfo = Tabs.CalcHitInfo(Tabs.PointToClient(Control.MousePosition));
                if (hitInfo.HitTest == XtraTabHitTest.PageHeader)
                {
                    XtraTabPage tp = hitInfo.Page;
                    if (ShowCriteriaTab && tp == Tabs.TabPages[0])
                    {
                        return;                         // no menu if criteria tab
                    }
                    int   x = Cursor.Position.X;
                    int   y = Cursor.Position.Y;
                    Point p = new Point(x, y);
                    p = this.PointToClient(p);
                    TableControlPrototype.QbTableLabelContextMenu.Show(this, p);
                }
            }
        }