// helper method for scaling KyrptonPaletteButtonSpecTyped /// <summary>Scales the type of the button spec image.</summary> /// <param name="bst">The ButtonSpecType.</param> /// <param name="scaleFactor">The scale factor.</param> private static void ScaleButtonSpecImageType(KryptonPaletteButtonSpecTyped bst, SizeF scaleFactor) { bst.Image = GetScaledImage(bst.Image, scaleFactor); CheckButtonImageStates imgState = bst.ImageStates; imgState.ImageCheckedNormal = GetScaledImage(imgState.ImageCheckedNormal, scaleFactor); imgState.ImageCheckedPressed = GetScaledImage(imgState.ImageCheckedPressed, scaleFactor); imgState.ImageCheckedTracking = GetScaledImage(imgState.ImageCheckedTracking, scaleFactor); imgState.ImageDisabled = GetScaledImage(imgState.ImageDisabled, scaleFactor); imgState.ImageNormal = GetScaledImage(imgState.ImageNormal, scaleFactor); imgState.ImagePressed = GetScaledImage(imgState.ImagePressed, scaleFactor); imgState.ImageTracking = GetScaledImage(imgState.ImageTracking, scaleFactor); }
/// <summary> /// Initialize a new instance of the KryptonPaletteButtonSpecs class. /// </summary> /// <param name="redirector">Palette redirector for sourcing inherited values.</param> internal KryptonPaletteButtonSpecs(PaletteRedirect redirector) { Debug.Assert(redirector != null); // Create exposed button specifications Common = new KryptonPaletteButtonSpecTyped(redirector); Generic = new KryptonPaletteButtonSpecTyped(redirector); Close = new KryptonPaletteButtonSpecTyped(redirector); Context = new KryptonPaletteButtonSpecTyped(redirector); Next = new KryptonPaletteButtonSpecTyped(redirector); Previous = new KryptonPaletteButtonSpecTyped(redirector); ArrowLeft = new KryptonPaletteButtonSpecTyped(redirector); ArrowRight = new KryptonPaletteButtonSpecTyped(redirector); ArrowUp = new KryptonPaletteButtonSpecTyped(redirector); ArrowDown = new KryptonPaletteButtonSpecTyped(redirector); DropDown = new KryptonPaletteButtonSpecTyped(redirector); PinVertical = new KryptonPaletteButtonSpecTyped(redirector); PinHorizontal = new KryptonPaletteButtonSpecTyped(redirector); FormClose = new KryptonPaletteButtonSpecTyped(redirector); FormMax = new KryptonPaletteButtonSpecTyped(redirector); FormMin = new KryptonPaletteButtonSpecTyped(redirector); FormRestore = new KryptonPaletteButtonSpecTyped(redirector); FormHelp = new KryptonPaletteButtonSpecTyped(redirector); PendantClose = new KryptonPaletteButtonSpecTyped(redirector); PendantMin = new KryptonPaletteButtonSpecTyped(redirector); PendantRestore = new KryptonPaletteButtonSpecTyped(redirector); WorkspaceMaximize = new KryptonPaletteButtonSpecTyped(redirector); WorkspaceRestore = new KryptonPaletteButtonSpecTyped(redirector); RibbonMinimize = new KryptonPaletteButtonSpecTyped(redirector); RibbonExpand = new KryptonPaletteButtonSpecTyped(redirector); // Create redirector for inheriting from style specific to style common PaletteRedirectButtonSpec redirectCommon = new(redirector, Common); // Inform the button spec to use the new redirector Generic.SetRedirector(redirectCommon); Close.SetRedirector(redirectCommon); Context.SetRedirector(redirectCommon); Next.SetRedirector(redirectCommon); Previous.SetRedirector(redirectCommon); ArrowLeft.SetRedirector(redirectCommon); ArrowRight.SetRedirector(redirectCommon); ArrowUp.SetRedirector(redirectCommon); ArrowDown.SetRedirector(redirectCommon); DropDown.SetRedirector(redirectCommon); PinVertical.SetRedirector(redirectCommon); PinHorizontal.SetRedirector(redirectCommon); FormClose.SetRedirector(redirectCommon); FormMax.SetRedirector(redirectCommon); FormMin.SetRedirector(redirectCommon); FormRestore.SetRedirector(redirectCommon); FormHelp.SetRedirector(redirectCommon); PendantClose.SetRedirector(redirectCommon); PendantMin.SetRedirector(redirectCommon); PendantRestore.SetRedirector(redirectCommon); WorkspaceMaximize.SetRedirector(redirectCommon); WorkspaceRestore.SetRedirector(redirectCommon); RibbonMinimize.SetRedirector(redirectCommon); RibbonExpand.SetRedirector(redirectCommon); // Hook into the storage change events Common.ButtonSpecChanged += OnButtonSpecChanged; Generic.ButtonSpecChanged += OnButtonSpecChanged; Close.ButtonSpecChanged += OnButtonSpecChanged; Context.ButtonSpecChanged += OnButtonSpecChanged; Next.ButtonSpecChanged += OnButtonSpecChanged; Previous.ButtonSpecChanged += OnButtonSpecChanged; ArrowLeft.ButtonSpecChanged += OnButtonSpecChanged; ArrowRight.ButtonSpecChanged += OnButtonSpecChanged; ArrowUp.ButtonSpecChanged += OnButtonSpecChanged; ArrowDown.ButtonSpecChanged += OnButtonSpecChanged; DropDown.ButtonSpecChanged += OnButtonSpecChanged; PinVertical.ButtonSpecChanged += OnButtonSpecChanged; PinHorizontal.ButtonSpecChanged += OnButtonSpecChanged; FormClose.ButtonSpecChanged += OnButtonSpecChanged; FormMax.ButtonSpecChanged += OnButtonSpecChanged; FormMin.ButtonSpecChanged += OnButtonSpecChanged; FormRestore.ButtonSpecChanged += OnButtonSpecChanged; FormHelp.ButtonSpecChanged += OnButtonSpecChanged; PendantClose.ButtonSpecChanged += OnButtonSpecChanged; PendantMin.ButtonSpecChanged += OnButtonSpecChanged; PendantRestore.ButtonSpecChanged += OnButtonSpecChanged; WorkspaceMaximize.ButtonSpecChanged += OnButtonSpecChanged; WorkspaceRestore.ButtonSpecChanged += OnButtonSpecChanged; RibbonMinimize.ButtonSpecChanged += OnButtonSpecChanged; RibbonExpand.ButtonSpecChanged += OnButtonSpecChanged; }