/// <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); }
/// <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 Header = new PaletteTripleMetric(inheritHeader, needPaint); }
/// <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; AllowButtonSpecToolTipPriority = false; // Create storage objects Values = new HeaderValues(NeedPaintDelegate); Values.TextChanged += 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, Values, 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 }, CreateToolStripRenderer, NeedPaintDelegate); // Create the manager for handling tooltips ToolTipManager = new ToolTipManager(); ToolTipManager.ShowToolTip += OnShowToolTip; ToolTipManager.CancelToolTip += OnCancelToolTip; _buttonManager.ToolTipManager = ToolTipManager; // We want to be auto sized by default, but not the property default! AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; }
/// <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 HeaderPrimary = new PaletteTripleMetric(inheritHeaderPrimary, needPaint); HeaderSecondary = new PaletteTripleMetric(inheritHeaderSecondary, needPaint); }