/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupButtonBackBorder class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="groupItem">Reference to owning group item.</param> /// <param name="paletteBack">Palette to use for the background.</param> /// <param name="paletteBorder">Palette to use for the border.</param> /// <param name="constantBorder">Should the border be a constant normal state.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupButtonBackBorder(KryptonRibbon ribbon, KryptonRibbonGroupItem groupItem, IPaletteBack paletteBack, IPaletteBorder paletteBorder, bool constantBorder, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(groupItem != null); Debug.Assert(paletteBack != null); Debug.Assert(paletteBorder != null); // Remember incoming references _ribbon = ribbon; GroupItem = groupItem; _paletteBack = paletteBack; _paletteBackDraw = new PaletteBackInheritForced(paletteBack) { ForceDraw = InheritBool.True }; _paletteBackLight = new PaletteBackLightenColors(paletteBack); _paletteBorderAll = new PaletteBorderInheritForced(paletteBorder); _paletteBorderAll.ForceBorderEdges(PaletteDrawBorders.All); _paletteBorder = paletteBorder; ConstantBorder = constantBorder; // Default other fields Checked = false; DrawNonTrackingAreas = true; // Create delegate used to process end of click action FinishDelegate = ActionFinished; // Attach a controller to this element for the pressing of the button Controller = new GroupButtonController(_ribbon, this, needPaint); Controller.Click += OnClick; Controller.ContextClick += OnContextClick; Controller.DropDown += OnDropDown; MouseController = Controller; SourceController = Controller; KeyController = Controller; _viewSize = new Size((int)(22 * FactorDpiX), (int)(22 * FactorDpiY)); }
/// <summary> /// Initialize a new instance of the ViewDrawSplitCanvas class. /// </summary> /// <param name="paletteBack">Palette source for the background.</param> /// <param name="paletteBorder">Palette source for the border.</param> /// <param name="paletteMetric">Palette source for metric values.</param> /// <param name="metricPadding">Matric used to get padding values.</param> /// <param name="orientation">Visual orientation of the content.</param> public ViewDrawSplitCanvas(IPaletteBack paletteBack, IPaletteBorder paletteBorder, IPaletteMetric paletteMetric, PaletteMetricPadding metricPadding, VisualOrientation orientation) { // Cache the starting values PaletteBorder = paletteBorder; PaletteBack = paletteBack; _paletteBackDraw = new PaletteBackInheritForced(PaletteBack) { ForceDraw = InheritBool.True }; _paletteBackLight = new PaletteBackLightenColors(PaletteBack); PaletteMetric = paletteMetric; _metricPadding = metricPadding; Orientation = orientation; DrawTabBorder = false; DrawCanvas = true; Splitter = false; }