Implement storage for palette border,background and separator padding.
Inheritance: PaletteDouble, IPaletteMetric
コード例 #1
0
 /// <summary>
 /// Initialize a new instance of the PaletteNavigatorOtherEx class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteNavigatorOtherEx(PaletteNavigatorRedirect redirect,
                                NeedPaintHandler needPaint)
     : base(redirect, needPaint)
 {
     // Create the palette storage
     _paletteSeparator = new PaletteSeparatorPadding(redirect.Separator, redirect.Separator, needPaint);
 }
コード例 #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonSeparator class.
        /// </summary>
        public KryptonSeparator()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Create the palette storage
            StateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                            PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorHighProfile,
                                                            PaletteBorderStyle.SeparatorHighProfile, NeedPaintDelegate)
            {
                BorderRedirect = { OverrideBorderToFalse = true }
            };

            // Never draw the border around the background

            StateDisabled = new PaletteSplitContainer(StateCommon, StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StateNormal   = new PaletteSplitContainer(StateCommon, StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StateTracking = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StatePressed  = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
                                                   StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
                                                   PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            // Get the separator to fill the entire client area
            _drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border)
            {
                IgnoreAllBorderAndPadding = true
            };
            _drawDocker.Add(_drawSeparator, ViewDockStyle.Fill);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController  = _separatorController;
            _drawSeparator.KeyController    = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Use timer to redraw after windows messages are processed
            _redrawTimer = new Timer
            {
                Interval = 1
            };
            _redrawTimer.Tick += OnRedrawTick;

            // Set other internal starting values
            _style             = SeparatorStyle.HighProfile;
            _orientation       = Orientation.Vertical;
            AllowMove          = true;
            SplitterIncrements = 1;
            _splitterWidth     = 5;
        }
コード例 #3
0
 /// <summary>
 /// Initialize a new instance of the PaletteSplitContainer class.
 /// </summary>
 /// <param name="inheritSplitContainer">Source for inheriting back/border defaulted values.</param>
 /// <param name="inheritSeparator">Source for inheriting separator defaulted values.</param>
 /// <param name="inheritMetric">Source for inheriting separator metric values.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteSplitContainer(IPaletteDouble inheritSplitContainer,
                              IPaletteDouble inheritSeparator,
                              IPaletteMetric inheritMetric,
                              NeedPaintHandler needPaint)
     : base(inheritSplitContainer, needPaint)
 {
     // Create the embedded separator palette information
     Separator = new PaletteSeparatorPadding(inheritSeparator, inheritMetric, needPaint);
 }
コード例 #4
0
 /// <summary>
 /// Initialize a new instance of the PaletteSplitContainer class.
 /// </summary>
 /// <param name="inheritSplitContainer">Source for inheriting back/border defaulted values.</param>
 /// <param name="inheritSeparator">Source for inheriting separator defaulted values.</param>
 /// <param name="inheritMetric">Source for inheriting separator metric values.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteSplitContainer(IPaletteDouble inheritSplitContainer,
                              IPaletteDouble inheritSeparator,
                              IPaletteMetric inheritMetric,
                              NeedPaintHandler needPaint)
     : base(inheritSplitContainer, needPaint)
 {
     // Create the embedded separator palette information
     _separator = new PaletteSeparatorPadding(inheritSeparator, inheritMetric, needPaint);
 }
コード例 #5
0
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteSeparator class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="backStyle">Background style.</param>
 /// <param name="borderStyle">Border style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteSeparator(PaletteRedirect redirect,
                                PaletteBackStyle backStyle,
                                PaletteBorderStyle borderStyle,
                                NeedPaintHandler needPaint)
 {
     // Create the storage objects
     StateCommon   = new PaletteSeparatorPaddingRedirect(redirect, backStyle, borderStyle, needPaint);
     StateDisabled = new PaletteSeparatorPadding(StateCommon, StateCommon, needPaint);
     StateNormal   = new PaletteSeparatorPadding(StateCommon, StateCommon, needPaint);
     StateTracking = new PaletteSeparatorPadding(StateCommon, StateCommon, needPaint);
     StatePressed  = new PaletteSeparatorPadding(StateCommon, StateCommon, needPaint);
 }
コード例 #6
0
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteSeparator class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="backStyle">Background style.</param>
 /// <param name="borderStyle">Border style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteSeparator(PaletteRedirect redirect,
                                PaletteBackStyle backStyle,
                                PaletteBorderStyle borderStyle,
                                NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateCommon = new PaletteSeparatorPaddingRedirect(redirect, backStyle, borderStyle, needPaint);
     _stateDisabled = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint);
     _stateNormal = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint);
     _stateTracking = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint);
     _statePressed = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint);
 }
コード例 #7
0
ファイル: KryptonSeparator.cs プロジェクト: yp25/Krypton
        /// <summary>
        /// Initialize a new instance of the KryptonSeparator class.
        /// </summary>
        public KryptonSeparator()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Create the palette storage
            _stateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                             PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorHighProfile,
                                                             PaletteBorderStyle.SeparatorHighProfile, NeedPaintDelegate);

            // Never draw the border around the background
            _stateCommon.BorderRedirect.OverrideBorderToFalse = true;

            _stateDisabled = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateNormal = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateTracking = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _statePressed = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(_stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                   _stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                    PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            // Get the separator to fill the entire client area
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDocker.IgnoreAllBorderAndPadding = true;
            _drawDocker.Add(_drawSeparator, ViewDockStyle.Fill);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController = _separatorController;
            _drawSeparator.KeyController = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Use timer to redraw after windows messages are processed
            _redrawTimer = new Timer();
            _redrawTimer.Interval = 1;
            _redrawTimer.Tick += new EventHandler(OnRedrawTick);

            // Set other internal starting values
            _style = SeparatorStyle.HighProfile;
            _orientation = Orientation.Vertical;
            _allowMove = true;
            _splitterIncrements = 1;
            _splitterWidth = 5;
        }
コード例 #8
0
        /// <summary>
        /// Initialize a new instance of the KryptonSplitContainer class.
        /// </summary>
        public KryptonSplitContainer()
        {
            // Create the palette storage
            _stateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                             PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorLowProfile,
                                                             PaletteBorderStyle.SeparatorLowProfile, NeedPaintDelegate);

            _stateDisabled = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateNormal = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateTracking = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _statePressed = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(_stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                   _stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                    PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            _drawPanel = new ViewDrawPanel(_stateNormal.Back);
            _drawPanel.Add(_drawSeparator);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController = _separatorController;
            _drawSeparator.KeyController = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawPanel);

            // Set other internal starting values
            _splitterDistance = 50;
            _splitterPercent = 1f / 3f;
            _splitterIncrement = 1;
            _panel1MinSize = 25;
            _panel2MinSize = 25;
            _splitterWidth = 5;
            _fixedDistance = 50;
            _fixedPanel = FixedPanel.None;
            _orientation = Orientation.Vertical;

            // Create the two fixed child panels
            _panel1 = new KryptonSplitterPanel(this);
            _panel2 = new KryptonSplitterPanel(this);

            // Add both panels to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel1);
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel2);
        }
コード例 #9
0
 /// <summary>
 /// Initialize a new instance of the PaletteNavigatorNormabled class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteNavigator(PaletteNavigatorRedirect redirect,
                         NeedPaintHandler needPaint)
     : base(redirect, needPaint)
 {
     // Create the palette storage
     _palettePage = new PalettePage(redirect.PalettePage, needPaint);
     _paletteHeaderGroup = new PaletteNavigatorHeaderGroup(redirect.HeaderGroup, redirect.HeaderGroup.HeaderPrimary, redirect.HeaderGroup.HeaderSecondary, redirect.HeaderGroup.HeaderBar, redirect.HeaderGroup.HeaderOverflow, needPaint);
     _paletteCheckButton = new PaletteTriple(redirect.CheckButton, needPaint);
     _paletteOverflowButton = new PaletteTriple(redirect.OverflowButton, needPaint);
     _paletteMiniButton = new PaletteTriple(redirect.MiniButton, needPaint);
     _paletteBorderEdge = new PaletteBorderEdge(redirect.BorderEdge, needPaint);
     _paletteSeparator = new PaletteSeparatorPadding(redirect.Separator, redirect.Separator, needPaint);
     _paletteTab = new PaletteTabTriple(redirect.Tab, needPaint);
     _paletteRibbonTab = new PaletteRibbonTabContent(redirect.RibbonTab.TabDraw, redirect.RibbonTab.TabDraw, redirect.RibbonTab.Content, needPaint);
 }