Ejemplo n.º 1
0
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteHeader 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="contentStyle">Content style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteHeader(PaletteRedirect redirect,
                             PaletteBackStyle backStyle,
                             PaletteBorderStyle borderStyle,
                             PaletteContentStyle contentStyle,
                             NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateCommon   = new PaletteHeaderRedirect(redirect, backStyle, borderStyle, contentStyle, needPaint);
     _stateDisabled = new PaletteTripleMetric(_stateCommon, needPaint);
     _stateNormal   = new PaletteTripleMetric(_stateCommon, needPaint);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize a new instance of the PaletteForm class.
        /// </summary>
        /// <param name="inheritForm">Source for inheriting palette defaulted values.</param>
        /// <param name="inheritHeader">Source for inheriting header defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteForm(PaletteFormRedirect inheritForm,
                           PaletteTripleMetricRedirect inheritHeader,
                           NeedPaintHandler needPaint)
            : base(inheritForm, needPaint)
        {
            Debug.Assert(inheritForm != null);
            Debug.Assert(inheritHeader != null);

            // Remember the inheritance
            _inherit = inheritForm;

            // Create the palette storage
            _paletteHeader = new PaletteTripleMetric(inheritHeader, needPaint);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize a new instance of the KryptonHeader class.
        /// </summary>
        public KryptonHeader()
        {
            // The header cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default values
            _style                   = HeaderStyle.Primary;
            _orientation             = VisualOrientation.Top;
            _allowButtonSpecToolTips = false;

            // Create storage objects
            _headerValues              = new HeaderValues(NeedPaintDelegate);
            _headerValues.TextChanged += new EventHandler(OnHeaderTextChanged);
            _buttonSpecs = new HeaderButtonSpecCollection(this);

            // Create the palette storage
            _stateCommon   = new PaletteHeaderRedirect(Redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, NeedPaintDelegate);
            _stateDisabled = new PaletteTripleMetric(_stateCommon, NeedPaintDelegate);
            _stateNormal   = new PaletteTripleMetric(_stateCommon, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker  = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border, null);
            _drawContent = new ViewDrawContent(_stateNormal.Content, _headerValues, Orientation);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

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

            // Create button specification collection manager
            _buttonManager = new ButtonSpecManagerDraw(this, Redirector, _buttonSpecs, null,
                                                       new ViewDrawDocker[] { _drawDocker },
                                                       new IPaletteMetric[] { _stateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.HeaderButtonPaddingPrimary },
                                                       new GetToolStripRenderer(CreateToolStripRenderer),
                                                       NeedPaintDelegate);

            // Create the manager for handling tooltips
            _toolTipManager                = new ToolTipManager();
            _toolTipManager.ShowToolTip   += new EventHandler <ToolTipEventArgs>(OnShowToolTip);
            _toolTipManager.CancelToolTip += new EventHandler(OnCancelToolTip);
            _buttonManager.ToolTipManager  = _toolTipManager;

            // We want to be auto sized by default, but not the property default!
            AutoSize     = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialize a new instance of the PaletteHeaderGroup class.
        /// </summary>
        /// <param name="inheritHeaderGroup">Source for inheriting palette defaulted values.</param>
        /// <param name="inheritHeaderPrimary">Source for inheriting primary header defaulted values.</param>
        /// <param name="inheritHeaderSecondary">Source for inheriting secondary header defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteHeaderGroup(PaletteHeaderGroupRedirect inheritHeaderGroup,
                                  PaletteHeaderPaddingRedirect inheritHeaderPrimary,
                                  PaletteHeaderPaddingRedirect inheritHeaderSecondary,
                                  NeedPaintHandler needPaint)
            : base(inheritHeaderGroup, needPaint)
        {
            Debug.Assert(inheritHeaderGroup != null);
            Debug.Assert(inheritHeaderPrimary != null);
            Debug.Assert(inheritHeaderSecondary != null);

            // Remember the inheritance
            _inherit = inheritHeaderGroup;

            // Create the palette storage
            _paletteHeaderPrimary   = new PaletteTripleMetric(inheritHeaderPrimary, needPaint);
            _paletteHeaderSecondary = new PaletteTripleMetric(inheritHeaderSecondary, needPaint);
        }