Exemplo n.º 1
0
 /// <summary>
 /// Initialize a new instance of the ViewDrawMenuSeparator class.
 /// </summary>
 /// <param name="state">State specific source of palette values.</param>
 public ViewDrawMenuSeparator(PaletteDouble state)
     : base(state.Back, state.Border)
 {
     // We need to be big enough to contain 1 pixel square spacer
     Orientation = VisualOrientation.Left;
     Add(new ViewLayoutSeparator(1));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize a new instance of the KryptonGroup class.
        /// </summary>
        public KryptonGroup()
        {
            // Create the palette storage
            _stateCommon   = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
            _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate);
            _stateNormal   = new PaletteDouble(_stateCommon, NeedPaintDelegate);

            // Create the internal panel used for containing content
            _panel = new KryptonGroupPanel(this, _stateCommon, _stateDisabled, _stateNormal, new NeedPaintHandler(OnGroupPanelPaint));

            // Make sure the panel back style always mimics our back style
            _panel.PanelBackStyle = PaletteBackStyle.ControlClient;

            // Create the element that fills the remainder space and remembers fill rectange
            _layoutFill = new ViewLayoutFill(_panel);

            // Create view for the control border and background
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDocker.Add(_layoutFill, ViewDockStyle.Fill);

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

            // We want to default to shrinking and growing (base class defaults to GrowOnly)
            AutoSizeMode = AutoSizeMode.GrowAndShrink;

            // Add panel to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize a new instance of the KryptonPanel class.
        /// </summary>
        public KryptonPanel()
        {
            // Create the palette storage
            _stateCommon   = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
            _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate);
            _stateNormal   = new PaletteDouble(_stateCommon, NeedPaintDelegate);

            Construct();
        }
        /// <summary>
        /// Initialize a new instance of the PaletteDataGridViewAll class.
        /// </summary>
        /// <param name="inherit">Source for inheriting values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDataGridViewAll(PaletteDataGridViewRedirect inherit,
                                      NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Create storage that maps onto the inherit instances
            _background = new PaletteDouble(inherit.BackgroundDouble, needPaint);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initialize a new instance of KryptonPaletteDouble3 KryptonPaletteControl 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 KryptonPaletteDouble3(PaletteRedirect redirect,
                              PaletteBackStyle backStyle,
                              PaletteBorderStyle borderStyle,
                              NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateCommon   = new PaletteDoubleRedirect(redirect, backStyle, borderStyle, needPaint);
     _stateDisabled = new PaletteDouble(_stateCommon, needPaint);
     _stateNormal   = new PaletteDouble(_stateCommon, needPaint);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemState class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for ItemHighlight.</param>
 /// <param name="redirectItemImage">Redirector for ItemImage.</param>
 /// <param name="redirectItemShortcutText">Redirector for ItemShortcutText.</param>
 /// <param name="redirectItemSplit">Redirector for ItemSplit.</param>
 /// <param name="redirectItemTextAlternate">Redirector for ItemTextStandard.</param>
 /// <param name="redirectItemTextStandard">Redirector for ItemTextAlternate.</param>
 public PaletteContextMenuItemState(PaletteDoubleMetricRedirect redirectItemHighlight,
                                    PaletteTripleJustImageRedirect redirectItemImage,
                                    PaletteContentInheritRedirect redirectItemShortcutText,
                                    PaletteDoubleRedirect redirectItemSplit,
                                    PaletteContentInheritRedirect redirectItemTextStandard,
                                    PaletteContentInheritRedirect redirectItemTextAlternate)
 {
     _paletteItemHighlight     = new PaletteDoubleMetric(redirectItemHighlight);
     _paletteItemImage         = new PaletteTripleJustImage(redirectItemImage);
     _paletteItemShortcutText  = new PaletteContentJustShortText(redirectItemShortcutText);
     _paletteItemSplit         = new PaletteDouble(redirectItemSplit);
     _paletteItemTextStandard  = new PaletteContentJustText(redirectItemTextStandard);
     _paletteItemTextAlternate = new PaletteContentJustText(redirectItemTextAlternate);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Initialize a new instance of the KryptonPanel class.
        /// </summary>
        /// <param name="stateCommon">Common appearance state to inherit from.</param>
        /// <param name="stateDisabled">Disabled appearance state.</param>
        /// <param name="stateNormal">Normal appearance state.</param>
        public KryptonPanel(PaletteDoubleRedirect stateCommon,
                            PaletteDouble stateDisabled,
                            PaletteDouble stateNormal)
        {
            Debug.Assert(stateCommon != null);
            Debug.Assert(stateDisabled != null);
            Debug.Assert(stateNormal != null);

            // Remember the palette storage
            _stateCommon   = stateCommon;
            _stateDisabled = stateDisabled;
            _stateNormal   = stateNormal;

            Construct();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initialize a new instance of the KryptonGroupPanel class.
        /// </summary>
        /// <param name="alignControl">Container control for alignment.</param>
        /// <param name="stateCommon">Common appearance state to inherit from.</param>
        /// <param name="stateDisabled">Disabled appearance state.</param>
        /// <param name="stateNormal">Normal appearance state.</param>
        /// <param name="layoutHandler">Callback delegate for layout processing.</param>
        public KryptonGroupPanel(Control alignControl,
                                 PaletteDoubleRedirect stateCommon,
                                 PaletteDouble stateDisabled,
                                 PaletteDouble stateNormal,
                                 NeedPaintHandler layoutHandler)
            : base(stateCommon, stateDisabled, stateNormal)
        {
            // Remember the delegate used to notify layouts
            _layoutHandler = layoutHandler;

            // Create the forced overrides to enforce the graphics option we want
            _forcedDisabled = new PaletteBackInheritForced(stateDisabled.Back);
            _forcedNormal   = new PaletteBackInheritForced(stateNormal.Back);

            // We never allow the anti alias option as it prevent transparent background working
            _forcedDisabled.ForceGraphicsHint = PaletteGraphicsHint.None;
            _forcedNormal.ForceGraphicsHint   = PaletteGraphicsHint.None;

            // Set the correct initial palettes
            ViewDrawPanel.SetPalettes(Enabled ? _forcedNormal : _forcedDisabled);

            // Make sure the alignment of the group panel is as that of the parent
            ViewManager.AlignControl = alignControl;
        }
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemStateHighlight class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for the ItemHighlight.</param>
 /// <param name="redirectItemSplit">Redirector for the ItemSplit.</param>
 public PaletteContextMenuItemStateHighlight(PaletteDoubleMetricRedirect redirectItemHighlight,
                                             PaletteDoubleRedirect redirectItemSplit)
 {
     _paletteItemHighlight = new PaletteDoubleMetric(redirectItemHighlight);
     _paletteItemSplit     = new PaletteDouble(redirectItemSplit);
 }