Example #1
0
 /// <summary>
 /// Gets the tab ColorStateTable for the given state
 /// </summary>
 /// <param name="tabState">eTabState</param>
 /// <returns>SuperTabItemStateColorTable</returns>
 internal SuperTabItemStateColorTable GetTabColorTable(eTabState tabState)
 {
     return (_TabItemDisplay.GetTabColorTable(tabState));
 }
Example #2
0
        private SuperTabItemStateColorTable GetStateColorTable(
            eTabState tabState, SuperTabColorStates cs)
        {
            switch (tabState)
            {
                case eTabState.MouseOver:
                    return (cs.MouseOver);

                case eTabState.Selected:
                    return (cs.Selected);

                case eTabState.SelectedMouseOver:
                    return (cs.SelectedMouseOver);

                case eTabState.Disabled:
                    return (cs.Disabled);

                default:
                    return (cs.Normal);
            }
        }
Example #3
0
        internal virtual void ApplyPredefinedColor(eTabState tabState, SuperTabItemStateColorTable sct)
        {
            if (TabItem.PredefinedColor != eTabItemColor.Default)
            {
                SuperTabItemColorTable ct =
                    SuperTabStyleColorFactory.GetPredefinedTabColors(TabItem.PredefinedColor, ColorFactory.Empty);

                SuperTabItemStateColorTable ict = ct.Default.Normal;

                switch (tabState)
                {
                    case eTabState.SelectedMouseOver:
                        ict = ct.Default.SelectedMouseOver;
                        break;

                    case eTabState.MouseOver:
                        ict = ct.Default.MouseOver;
                        break;

                    case eTabState.Selected:
                        ict = ct.Default.Selected;
                        break;
                }

                sct.Text = ict.Text;
                sct.InnerBorder = ict.InnerBorder;
                sct.OuterBorder = ict.OuterBorder;
                sct.Background = ict.Background;
                sct.CloseMarker = ict.CloseMarker;
                sct.SelectionMarker = ict.SelectionMarker;
            }
        }
Example #4
0
        internal virtual SuperTabItemStateColorTable GetTabColorTable(eTabState tabState)
        {
            SuperTabItemStateColorTable sct = GetStateColorTable(tabState, _DefaultTabColorTable.Default);
            SuperTabItemStateColorTable tct = GetStateColorTable(tabState, TabItem.TabColor.Default);

            sct = (SuperTabItemStateColorTable)sct.Clone();
            tct = (SuperTabItemStateColorTable)tct.Clone();

            switch (TabItem.TabAlignment)
            {
                case eTabStripAlignment.Left:
                    ApplyTabColors(sct, GetStateColorTable(tabState, _DefaultTabColorTable.Left));
                    ApplyTabColors(tct, GetStateColorTable(tabState, TabItem.TabColor.Left));
                    break;

                case eTabStripAlignment.Bottom:
                    ApplyTabColors(sct, GetStateColorTable(tabState, _DefaultTabColorTable.Bottom));
                    ApplyTabColors(tct, GetStateColorTable(tabState, TabItem.TabColor.Bottom));
                    break;

                case eTabStripAlignment.Right:
                    ApplyTabColors(sct, GetStateColorTable(tabState, _DefaultTabColorTable.Right));
                    ApplyTabColors(tct, GetStateColorTable(tabState, TabItem.TabColor.Right));
                    break;
            }

            ApplyPredefinedColor(tabState, sct);
            ApplyTabColors(sct, tct);

            if (sct.SelectionMarker.IsEmpty == true &&
                (tabState == eTabState.Selected || tabState == eTabState.SelectedMouseOver))
            {
                using (SuperTabColorTable ct = TabDisplay.GetColorTable())
                {
                    sct.SelectionMarker = ct.SelectionMarker;
                }
            }

            return (sct);
        }