コード例 #1
0
ファイル: TabStyleProvider.cs プロジェクト: h3tch/ProtoFX
        public static TabStyleProvider CreateProvider(FXTabControl tabControl)
        {
            TabStyleProvider provider;

            // Depending on the display style of the tabControl generate an appropriate provider.
            switch (tabControl.DisplayStyle)
            {
            case TabStyle.None:
                provider = new TabStyleProvider(tabControl);
                break;

            case TabStyle.Default:
                provider = new TabStyleDefaultProvider(tabControl);
                break;

            case TabStyle.Rounded:
                provider = new TabStyleRoundedProvider(tabControl);
                break;

            case TabStyle.FX:
                provider = new FXTabStyleProvider(tabControl);
                break;

            default:
                provider = new TabStyleDefaultProvider(tabControl);
                break;
            }

            provider.style = tabControl.DisplayStyle;
            return(provider);
        }
コード例 #2
0
ファイル: FXTabStyleProvider.cs プロジェクト: h3tch/ProtoFX
        public FXTabStyleProvider(FXTabControl tabControl) : base(tabControl)
        {
            radius        = 1;
            showTabCloser = false;

            // Must set after the _Radius as this is used in the calculations of the actual padding
            Padding = new Drawing.Point(8, 3);
        }
コード例 #3
0
ファイル: TabStyleProvider.cs プロジェクト: h3tch/ProtoFX
        protected TabStyleProvider(FXTabControl tabControl)
        {
            this.tabControl = tabControl;

            borderColor         = Color.Empty;
            borderColorSelected = Color.Empty;
            focusColor          = Color.Orange;

            imageAlign = tabControl.RightToLeftLayout
                ? ContentAlignment.MiddleRight : ContentAlignment.MiddleLeft;

            HotTrack = true;

            // Must set after the _Overlap as this is used
            // in the calculations of the actual padding
            Padding = new Drawing.Point(6 + (ShowTabCloser ? 6 : 0), 3);
        }
コード例 #4
0
 private static bool ApplyTo(FXTabControl c)
 {
     c.BackColor = BackColor;
     c.ForeColor = ForeColor;
     c.DisplayStyleProvider.BackColor           = BackColor;
     c.DisplayStyleProvider.BackColorHot        = WorkspaceHighlight;
     c.DisplayStyleProvider.BackColorSelected   = Workspace;
     c.DisplayStyleProvider.CloserColorActive   = Workspace;
     c.DisplayStyleProvider.CloserColor         = ForeColor;
     c.DisplayStyleProvider.TextColor           = ForeColor;
     c.DisplayStyleProvider.TextColorSelected   = ForeColor;
     c.DisplayStyleProvider.TextColorDisabled   = HighlightBackColor;
     c.DisplayStyleProvider.BorderColor         = Color.Transparent;
     c.DisplayStyleProvider.BorderColorHot      = HighlightBackColor;
     c.DisplayStyleProvider.BorderColorSelected = HighlightBackColor;
     return(true);
 }
コード例 #5
0
 public TabStyleRoundedProvider(FXTabControl tabControl) : base(tabControl)
 {
     radius = 10;
     //	Must set after the _Radius as this is used in the calculations of the actual padding
     Padding = new Drawing.Point(6, 3);
 }
コード例 #6
0
 public TabStyleDefaultProvider(FXTabControl tabControl) : base(tabControl)
 {
     focusTrack = true;
     radius     = 2;
 }