Esempio n. 1
0
 internal DockPaneStripBase.Tab GetTab(DockPaneStripBase dockPaneStrip)
 {
     if (this.m_tab == null)
     {
         this.m_tab = dockPaneStrip.CreateTab(this.Content);
     }
     return(this.m_tab);
 }
Esempio n. 2
0
 private System.Drawing.Drawing2D.GraphicsPath GetTabOutline(DockPaneStripBase.Tab tab, bool rtlTransform,
                                                             bool toScreen)
 {
     if (base.Appearance == DockPane.AppearanceStyle.ToolWindow)
     {
         return(this.GetTabOutline_ToolWindow(tab, rtlTransform, toScreen));
     }
     return(this.GetTabOutline_Document(tab, rtlTransform, toScreen, false));
 }
Esempio n. 3
0
        private System.Drawing.Drawing2D.GraphicsPath GetTabOutline_ToolWindow(DockPaneStripBase.Tab tab,
                                                                               bool rtlTransform, bool toScreen)
        {
            Rectangle tabRectangle = this.GetTabRectangle(base.Tabs.IndexOf(tab));

            if (rtlTransform)
            {
                tabRectangle = DrawHelper.RtlTransform(this, tabRectangle);
            }
            if (toScreen)
            {
                tabRectangle = base.RectangleToScreen(tabRectangle);
            }
            DrawHelper.GetRoundedCornerTab(GraphicsPath, tabRectangle, false);
            return(GraphicsPath);
        }
Esempio n. 4
0
 public DockContentHandler(System.Windows.Forms.Form form, GetPersistStringCallback getPersistStringCallback)
 {
     this.m_previousActive      = null;
     this.m_nextActive          = null;
     this.m_allowEndUserDocking = true;
     this.m_autoHidePortion     = 0.25;
     this.m_closeButton         = true;
     this.m_allowedAreas        = DockAreas.Document | DockAreas.DockBottom | DockAreas.DockTop | DockAreas.DockRight |
                                  DockAreas.DockLeft | DockAreas.Float;
     this.m_dockState                = DockState.Unknown;
     this.m_dockPanel                = null;
     this.m_isHidden                 = true;
     this.m_tabText                  = null;
     this.m_visibleState             = DockState.Unknown;
     this.m_isFloat                  = false;
     this.m_panelPane                = null;
     this.m_floatPane                = null;
     this.m_countSetDockState        = 0;
     this.m_getPersistStringCallback = null;
     this.m_hideOnClose              = false;
     this.m_showHint                 = DockState.Unknown;
     this.m_isActivated              = false;
     this.m_tabPageContextMenu       = null;
     this.m_toolTipText              = null;
     this.m_activeWindowHandle       = IntPtr.Zero;
     this.m_tab                     = null;
     this.m_autoHideTab             = null;
     this.m_flagClipWindow          = false;
     this.m_tabPageContextMenuStrip = null;
     if (!(form is IDockContent))
     {
         throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form");
     }
     this.m_form = form;
     this.m_getPersistStringCallback = getPersistStringCallback;
     this.m_events          = new EventHandlerList();
     this.Form.Disposed    += new EventHandler(this.Form_Disposed);
     this.Form.TextChanged += new EventHandler(this.Form_TextChanged);
 }
Esempio n. 5
0
        private System.Drawing.Drawing2D.GraphicsPath GetTabOutline_Document(DockPaneStripBase.Tab tab,
                                                                             bool rtlTransform, bool toScreen, bool full)
        {
            int width = 6;

            GraphicsPath.Reset();
            Rectangle tabRectangle = this.GetTabRectangle(base.Tabs.IndexOf(tab));

            if (rtlTransform)
            {
                tabRectangle = DrawHelper.RtlTransform(this, tabRectangle);
            }
            if (toScreen)
            {
                tabRectangle = base.RectangleToScreen(tabRectangle);
            }
            if (((tab.Content == base.DockPane.ActiveContent) || (base.Tabs.IndexOf(tab) == this.StartDisplayingTab)) ||
                full)
            {
                if (this.RightToLeft == RightToLeft.Yes)
                {
                    GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Bottom,
                                         tabRectangle.Right + (tabRectangle.Height / 2), tabRectangle.Bottom);
                    GraphicsPath.AddLine(tabRectangle.Right + (tabRectangle.Height / 2), tabRectangle.Bottom,
                                         (tabRectangle.Right - (tabRectangle.Height / 2)) + (width / 2), tabRectangle.Top + (width / 2));
                }
                else
                {
                    GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Bottom,
                                         tabRectangle.Left - (tabRectangle.Height / 2), tabRectangle.Bottom);
                    GraphicsPath.AddLine(tabRectangle.Left - (tabRectangle.Height / 2), tabRectangle.Bottom,
                                         (tabRectangle.Left + (tabRectangle.Height / 2)) - (width / 2), tabRectangle.Top + (width / 2));
                }
            }
            else if (this.RightToLeft == RightToLeft.Yes)
            {
                GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Bottom, tabRectangle.Right,
                                     tabRectangle.Bottom - (tabRectangle.Height / 2));
                GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Bottom - (tabRectangle.Height / 2),
                                     (tabRectangle.Right - (tabRectangle.Height / 2)) + (width / 2), tabRectangle.Top + (width / 2));
            }
            else
            {
                GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Bottom, tabRectangle.Left,
                                     tabRectangle.Bottom - (tabRectangle.Height / 2));
                GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Bottom - (tabRectangle.Height / 2),
                                     (tabRectangle.Left + (tabRectangle.Height / 2)) - (width / 2), tabRectangle.Top + (width / 2));
            }
            if (this.RightToLeft == RightToLeft.Yes)
            {
                GraphicsPath.AddLine((tabRectangle.Right - (tabRectangle.Height / 2)) - (width / 2), tabRectangle.Top,
                                     tabRectangle.Left + (width / 2), tabRectangle.Top);
                GraphicsPath.AddArc(new Rectangle(tabRectangle.Left, tabRectangle.Top, width, width), 180f, 90f);
            }
            else
            {
                GraphicsPath.AddLine((tabRectangle.Left + (tabRectangle.Height / 2)) + (width / 2), tabRectangle.Top,
                                     tabRectangle.Right - (width / 2), tabRectangle.Top);
                GraphicsPath.AddArc(new Rectangle(tabRectangle.Right - width, tabRectangle.Top, width, width), -90f, 90f);
            }
            if ((((base.Tabs.IndexOf(tab) != this.EndDisplayingTab) && (base.Tabs.IndexOf(tab) != (base.Tabs.Count - 1))) &&
                 (base.Tabs[base.Tabs.IndexOf(tab) + 1].Content == base.DockPane.ActiveContent)) && !full)
            {
                if (this.RightToLeft == RightToLeft.Yes)
                {
                    GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Top + (width / 2), tabRectangle.Left,
                                         tabRectangle.Top + (tabRectangle.Height / 2));
                    GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Top + (tabRectangle.Height / 2),
                                         tabRectangle.Left + (tabRectangle.Height / 2), tabRectangle.Bottom);
                }
                else
                {
                    GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Top + (width / 2), tabRectangle.Right,
                                         tabRectangle.Top + (tabRectangle.Height / 2));
                    GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Top + (tabRectangle.Height / 2),
                                         tabRectangle.Right - (tabRectangle.Height / 2), tabRectangle.Bottom);
                }
            }
            else if (this.RightToLeft == RightToLeft.Yes)
            {
                GraphicsPath.AddLine(tabRectangle.Left, tabRectangle.Top + (width / 2), tabRectangle.Left,
                                     tabRectangle.Bottom);
            }
            else
            {
                GraphicsPath.AddLine(tabRectangle.Right, tabRectangle.Top + (width / 2), tabRectangle.Right,
                                     tabRectangle.Bottom);
            }
            return(GraphicsPath);
        }