From a4891302f87481abd9c92487f2c0c58a86b650a8 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 1 Dec 2023 14:44:33 +0000 Subject: [PATCH 01/16] * Implement #1187 --- .../KryptonAlternateCommandLinkButton.cs | 143 ++++ .../KryptonCommandLinkButton.cs | 730 ++++++++++++++++++ .../Controls Toolkit/KryptonMessageBox.cs | 1 + .../KryptonCommandLinkButtonActionList.cs | 168 ++++ .../KryptonCommandLinkButtonDesigner.cs | 47 ++ .../Krypton.Toolkit/General/PlatformInvoke.cs | 8 +- .../Values/CommandLinkImageValues.cs | 123 +++ .../Values/CommandLinkMainTextValue.cs | 30 + .../Values/CommandLinkSubscriptTextValue.cs | 30 + .../Values/CommandLinkTextValues.cs | 58 ++ .../View Draw/ViewDrawCommandLinkButton.cs | 518 +++++++++++++ .../TestForm/Form1.Designer.cs | 12 + Source/Krypton Components/TestForm/Form1.cs | 7 + .../TestForm/Form7.Designer.cs | 227 ++++++ Source/Krypton Components/TestForm/Form7.cs | 22 + Source/Krypton Components/TestForm/Form7.resx | 251 ++++++ 16 files changed, 2371 insertions(+), 4 deletions(-) create mode 100644 Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs create mode 100644 Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs create mode 100644 Source/Krypton Components/TestForm/Form7.Designer.cs create mode 100644 Source/Krypton Components/TestForm/Form7.cs create mode 100644 Source/Krypton Components/TestForm/Form7.resx diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs new file mode 100644 index 000000000..2c8b569d2 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs @@ -0,0 +1,143 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + /// + /// A KryptonCommandLink button. + /// Boilerplate code from (https://blogs.msdn.microsoft.com/knom/2007/03/12/vista-command-link-control-with-c-windows-forms/) + /// + /// If used on Windows Vista or higher, the button will be a CommandLink: Basically the same functionality as a Button but looks different. + [DesignerCategory("Code")] + [DisplayName("Krypton Command Link")] + [Description("A Krypton Command Link Button.")] + [ToolboxItem(true)] + [ToolboxBitmap(typeof(KryptonButton))] + public class KryptonAlternateCommandLinkButton : KryptonButton + { + #region Static Fields + + private const int BS_COMMANDLINK = 0x0000000E; + + private const int BCM_SETNOTE = 0x00001609; + + private const int BCM_GETNOTE = 0x0000160A; + + private const int BCM_GETNOTELENGTH = 0x0000160B; + + private const int BCM_SETSHIELD = 0x0000160C; + + #endregion + + #region Instance Fields + + private bool _showUACShield; + + #endregion + + #region Public + + /// + /// Gets or sets the shield icon visibility of the command link. + /// + [Category("Command Link"), Description("Gets or sets the shield icon visibility of the command link."), DefaultValue(false)] + public bool ShowUACShield + { + get => _showUACShield; + + set + { + _showUACShield = value; + + SendMessage(new HandleRef(this, Handle), BCM_SETSHIELD, IntPtr.Zero, _showUACShield); + } + } + + /// + /// Gets or sets the note text of the command link. + /// + [Category("Command Link"), Description("Gets or sets the note text of the command link."), DefaultValue("")] + public string NoteText + { + get => GetNoteText(); + + set => SetNoteText(value); + } + #endregion + + #region WIN32 Calls + + [DllImport(Libraries.User32, CharSet = CharSet.Unicode)] + static extern int SendMessage(HandleRef hWnd, uint msg, ref int wParam, StringBuilder lParam); + + [DllImport(Libraries.User32, CharSet = CharSet.Unicode)] + static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, string lParam); + + [DllImport(Libraries.User32, CharSet = CharSet.Unicode)] + static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, bool lParam); + + [DllImport(Libraries.User32, CharSet = CharSet.Unicode)] + static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, IntPtr lParam); + + #endregion + + #region Identity + + /// Initializes a new instance of the class. + public KryptonAlternateCommandLinkButton() + { + + } + + #endregion + + #region Protected + + /// + protected override Size DefaultSize => new Size(160, 60); + + /// + protected override CreateParams CreateParams + { + get + { + CreateParams createParams = base.CreateParams; + + createParams.Style |= BS_COMMANDLINK; + + return createParams; + } + } + + #endregion + + #region Implementation + + /// Sets the NoteText to the value of value. + /// The desired value of NoteText. + private void SetNoteText(string value) => SendMessage(new HandleRef(this, Handle), BCM_SETNOTE, IntPtr.Zero, value); + + /// + /// Returns the value of the NoteText. + /// + /// The value of the NoteText. + private string GetNoteText() + { + int length = SendMessage(new HandleRef(this, Handle), BCM_GETNOTELENGTH, IntPtr.Zero, IntPtr.Zero) + 1; + + StringBuilder stringBuilder = new StringBuilder(length); + + SendMessage(new HandleRef(this, Handle), BCM_GETNOTE, ref length, stringBuilder); + + return stringBuilder.ToString(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs new file mode 100644 index 000000000..621188ed7 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs @@ -0,0 +1,730 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + /// Combines button functionality with the styling features of the Krypton Toolkit. + /// Main code taken from KryptonButton, then trimmed out to force the CommandLink layout. + [ToolboxBitmap(typeof(KryptonButton))] + [ToolboxItem(true)] + [DefaultEvent("Click")] + [DefaultProperty("Heading")] + [Designer(typeof(KryptonCommandLinkButtonDesigner))] + [DesignerCategory("code")] + [ClassInterface(ClassInterfaceType.AutoDispatch)] + [DisplayName("Krypton Command Link")] + [Description("A Krypton Command Link Button.")] + [ComVisible(true)] + public class KryptonCommandLinkButton : VisualSimpleBase, IButtonControl + { + #region Static Fields + + private const int BCM_SETSHIELD = 0x0000160C; + + #endregion + + #region Instance Fields + + private bool _isDefault; + private bool _useMnemonic; + private bool _wasEnabled; + private ButtonStyle _buttonStyle; + private IKryptonCommand? _command; + private readonly ButtonController _buttonController; + private readonly PaletteTripleOverride _overrideFocus; + private readonly PaletteTripleOverride _overrideNormal; + private readonly PaletteTripleOverride _overridePressed; + private readonly PaletteTripleOverride _overrideTracking; + private readonly ViewDrawCommandLinkButton _drawCommandLinkButton; + private VisualOrientation _orientation; + + #endregion + + #region Events + + /// + /// Occurs when the value of the KryptonCommand property changes. + /// + [Category("Property Changed")] + [Description("Occurs when the value of the KryptonCommand property changes.")] + public event EventHandler KryptonCommandChanged; + + #endregion + + #region Identity + + /// Initializes a new instance of the class. + public KryptonCommandLinkButton() + { + // We generate click events manually, suppress default + // production of them by the base Control class + SetStyle(ControlStyles.StandardClick | + ControlStyles.StandardDoubleClick, false); + + // Set default button properties + base.AutoSize = false; + DialogResult = DialogResult.None; + _orientation = VisualOrientation.Top; + _useMnemonic = true; + + // Create content storage + CommandLinkImageValues = new CommandLinkImageValues(NeedPaintDelegate); + CommandLinkTextValues = new CommandLinkTextValues(NeedPaintDelegate); + + // Create the palette storage + StateCommon = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate); + PaletteContentText contentShortText = StateCommon.Content.ShortText; + contentShortText.Font = new Font(@"Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); + contentShortText.TextH = PaletteRelativeAlign.Near; + contentShortText.TextV = PaletteRelativeAlign.Center; + StateCommon.Content.LongText.TextH = PaletteRelativeAlign.Near; + StateCommon.Content.LongText.TextV = PaletteRelativeAlign.Far; + + StateDisabled = new PaletteTriple(StateCommon, NeedPaintDelegate); + StateNormal = new PaletteTriple(StateCommon, NeedPaintDelegate); + StateTracking = new PaletteTriple(StateCommon, NeedPaintDelegate); + StatePressed = new PaletteTriple(StateCommon, NeedPaintDelegate); + OverrideDefault = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate); + OverrideFocus = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate); + OverrideFocus.Border.Draw = InheritBool.True; + OverrideFocus.Border.DrawBorders = PaletteDrawBorders.All; + OverrideFocus.Border.GraphicsHint = PaletteGraphicsHint.AntiAlias; + // Force style update + ButtonStyle = ButtonStyle.Command; + + // Create the override handling classes + _overrideFocus = new PaletteTripleOverride(OverrideFocus, StateNormal, PaletteState.FocusOverride); + _overrideNormal = new PaletteTripleOverride(OverrideDefault, _overrideFocus, PaletteState.NormalDefaultOverride); + _overrideTracking = new PaletteTripleOverride(OverrideFocus, StateTracking, PaletteState.FocusOverride); + _overridePressed = new PaletteTripleOverride(OverrideFocus, StatePressed, PaletteState.FocusOverride); + + // Create the view button instance + _drawCommandLinkButton = new ViewDrawCommandLinkButton(StateDisabled, + _overrideNormal, + _overrideTracking, + _overridePressed, + new PaletteMetricRedirect(Redirector!), + CommandLinkImageValues, CommandLinkTextValues, + Orientation, + UseMnemonic) + { + // Only draw a focus rectangle when focus cues are needed in the top level form + TestForFocusCues = true + }; + + // Create a button controller to handle button style behaviour + _buttonController = new ButtonController(_drawCommandLinkButton, NeedPaintDelegate); + + // Assign the controller to the view element to treat as a button + _drawCommandLinkButton.MouseController = _buttonController; + _drawCommandLinkButton.KeyController = _buttonController; + _drawCommandLinkButton.SourceController = _buttonController; + + // Need to know when user clicks the button view or mouse selects it + _buttonController.Click += OnButtonClick; + _buttonController.MouseSelect += OnButtonSelect; + + // Create the view manager instance + ViewManager = new ViewManager(this, _drawCommandLinkButton); + } + + #endregion + + #region Public + + /// + /// Gets and sets the automatic resize of the control to fit contents. + /// + [Browsable(false)] + [Localizable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override bool AutoSize + { + get => base.AutoSize; + set + { + // Do nothing } + } + } + + /// + /// Gets and sets the internal padding space. + /// + [Browsable(false)] + [Localizable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Padding Padding + { + get => base.Padding; + set => base.Padding = value; + } + + /// + /// Gets or sets the text associated with this control. + /// + [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] + [Browsable(false)] + [Localizable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override string Text + { + get => CommandLinkTextValues.Heading; + + set => CommandLinkTextValues.Heading = value; + } + + private bool ShouldSerializeText() + { + // Never serialize, let the button values serialize instead + return false; + } + + /// + /// Resets the Text property to its default value. + /// + public override void ResetText() + { + CommandLinkTextValues.ResetText(); + } + + /// + /// Gets and sets the visual orientation of the control. + /// + [Category("Visuals")] + [Description("Visual orientation of the control.")] + [DefaultValue(typeof(VisualOrientation), "Top")] + public virtual VisualOrientation Orientation + { + get => _orientation; + + set + { + if (_orientation != value) + { + _orientation = value; + + // Update the associated visual elements that are effected + _drawCommandLinkButton.Orientation = value; + + PerformNeedPaint(true); + } + } + } + + /// + /// Gets and sets the button style. + /// + [Category("Visuals")] + [Description("Button style.")] + public ButtonStyle ButtonStyle + { + get => _buttonStyle; + + set + { + if (_buttonStyle != value) + { + _buttonStyle = value; + SetStyles(_buttonStyle); + PerformNeedPaint(true); + } + } + } + + private bool ShouldSerializeButtonStyle() + { + return (ButtonStyle != ButtonStyle.Command); + } + + private void ResetButtonStyle() + { + ButtonStyle = ButtonStyle.Command; + } + + /// + /// Gets access to the button content. + /// + [Category("CommandLink")] + [Description("CommandLink Button Text")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public CommandLinkTextValues CommandLinkTextValues { get; } + + /// + /// Gets access to the button content. + /// + [Category("CommandLink")] + [Description("CommandLink Button Image")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public CommandLinkImageValues CommandLinkImageValues { get; } + + private bool ShouldSerializeValues() + { + return false; + } + + /// + /// Gets access to the common button appearance that other states can override. + /// + [Category("Visuals")] + [Description("Overrides for defining common button appearance that other states can override.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTripleRedirect StateCommon { get; } + + private bool ShouldSerializeStateCommon() + { + return !StateCommon.IsDefault; + } + + /// + /// Gets access to the disabled button appearance entries. + /// + [Category("Visuals")] + [Description("Overrides for defining disabled button appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTriple StateDisabled { get; } + + private bool ShouldSerializeStateDisabled() + { + return !StateDisabled.IsDefault; + } + + /// + /// Gets access to the normal button appearance entries. + /// + [Category("Visuals")] + [Description("Overrides for defining normal button appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTriple StateNormal { get; } + + private bool ShouldSerializeStateNormal() + { + return !StateNormal.IsDefault; + } + + /// + /// Gets access to the hot tracking button appearance entries. + /// + [Category("Visuals")] + [Description("Overrides for defining hot tracking button appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTriple StateTracking { get; } + + private bool ShouldSerializeStateTracking() + { + return !StateTracking.IsDefault; + } + + /// + /// Gets access to the pressed button appearance entries. + /// + [Category("Visuals")] + [Description("Overrides for defining pressed button appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTriple StatePressed { get; } + + private bool ShouldSerializeStatePressed() + { + return !StatePressed.IsDefault; + } + + /// + /// Gets access to the normal button appearance when default. + /// + [Category("Visuals")] + [Description("Overrides for defining normal button appearance when default.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTripleRedirect OverrideDefault { get; } + + private bool ShouldSerializeOverrideDefault() + { + return !OverrideDefault.IsDefault; + } + + /// + /// Gets access to the button appearance when it has focus. + /// + [Category("Visuals")] + [Description("Overrides for defining button appearance when it has focus.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteTripleRedirect OverrideFocus { get; } + + private bool ShouldSerializeOverrideFocus() + { + return !OverrideFocus.IsDefault; + } + + /// + /// Gets or sets the value returned to the parent form when the button is clicked. + /// + [Category("Behavior")] + [Description("The dialog-box result produced in a modal form by clicking the button.")] + [DefaultValue(typeof(DialogResult), "None")] + public DialogResult DialogResult { get; set; } + + /// + /// Gets and sets the associated KryptonCommand. + /// + [Category("Behavior")] + [Description("Command associated with the button.")] + [DefaultValue(null)] + public virtual IKryptonCommand? KryptonCommand + { + get => _command; + + set + { + if (_command == value) + { + return; + } + + if (_command != null) + { + _command.PropertyChanged -= OnCommandPropertyChanged; + } + else + { + _wasEnabled = Enabled; + } + + _command = value; + OnKryptonCommandChanged(EventArgs.Empty); + + if (_command != null) + { + _command.PropertyChanged += OnCommandPropertyChanged; + } + else + { + Enabled = _wasEnabled; + } + } + } + + /// + /// Notifies a control that it is the default button so that its appearance and behavior is adjusted accordingly. + /// + /// true if the control should behave as a default button; otherwise false. + public void NotifyDefault(bool value) + { + if (!ViewDrawButton.IsFixed && (_isDefault != value)) + { + // Remember new default status + _isDefault = value; + + // Decide if the default overrides should be applied + _overrideNormal.Apply = value; + + // Change in default state requires a layout and repaint + PerformNeedPaint(true); + } + } + + /// + /// Generates a Click event for the control. + /// + public void PerformClick() + { + if (CanSelect) + { + OnClick(EventArgs.Empty); + } + } + + /// + /// Gets or sets a value indicating whether an ampersand is included in the text of the control. + /// + [Category("Appearance")] + [Description("When true the first character after an ampersand will be used as a mnemonic.")] + [DefaultValue(true)] + public bool UseMnemonic + { + get => _useMnemonic; + + set + { + if (_useMnemonic != value) + { + _useMnemonic = value; + _drawCommandLinkButton.UseMnemonic = value; + PerformNeedPaint(true); + } + } + } + + /// + /// Fix the control to a particular palette state. + /// + /// Palette state to fix. + public virtual void SetFixedState(PaletteState state) + { + if (state == PaletteState.NormalDefaultOverride) + { + // Setup the overrides correctly to match state + _overrideFocus.Apply = true; + _overrideNormal.Apply = true; + + // Must pass a proper drawing state to the view + state = PaletteState.Normal; + } + + // Request fixed state from the view + _drawCommandLinkButton.FixedState = state; + } + + /// + /// Determines the IME status of the object when selected. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new ImeMode ImeMode + { + get => base.ImeMode; + set => base.ImeMode = value; + } + + #endregion + + #region Protected Overrides + + /// + /// Gets the default size of the control. + /// + protected override Size DefaultSize => new Size(287, 61); + + /// + /// Gets the default Input Method Editor (IME) mode supported by this control. + /// + protected override ImeMode DefaultImeMode => ImeMode.Disable; + + /// + /// Raises the EnabledChanged event. + /// + /// An EventArgs that contains the event data. + protected override void OnEnabledChanged(EventArgs e) + { + // Change in enabled state requires a layout and repaint + PerformNeedPaint(true); + + // Let base class fire standard event + base.OnEnabledChanged(e); + } + + /// + /// Raises the GotFocus event. + /// + /// An EventArgs that contains the event data. + protected override void OnGotFocus(EventArgs e) + { + if (!ViewDrawButton.IsFixed) + { + // Apply the focus overrides + _overrideFocus.Apply = true; + _overrideTracking.Apply = true; + _overridePressed.Apply = true; + + // Change in focus requires a repaint + PerformNeedPaint(false); + } + + // Let base class fire standard event + base.OnGotFocus(e); + } + + /// + /// Raises the LostFocus event. + /// + /// An EventArgs that contains the event data. + protected override void OnLostFocus(EventArgs e) + { + if (!ViewDrawButton.IsFixed) + { + // Apply the focus overrides + _overrideFocus.Apply = false; + _overrideTracking.Apply = false; + _overridePressed.Apply = false; + + // Change in focus requires a repaint + PerformNeedPaint(false); + } + + // Let base class fire standard event + base.OnLostFocus(e); + } + + /// + /// Raises the Click event. + /// + /// An EventArgs that contains the event data. + protected override void OnClick(EventArgs e) + { + // Find the form this button is on + Form? owner = FindForm(); + + // If we find a valid owner + if (owner != null) + { + // Update owner with our dialog result setting + owner.DialogResult = DialogResult; + } + + // Let base class fire standard event + base.OnClick(e); + + // If we have an attached command then execute it + KryptonCommand?.PerformExecute(); + } + + /// + /// Processes a mnemonic character. + /// + /// The mnemonic character entered. + /// true if the mnemonic was processed; otherwise, false. + protected override bool ProcessMnemonic(char charCode) + { + // Are we allowed to process mnemonics? + if (UseMnemonic && CanProcessMnemonic()) + { + // Does the button primary text contain the mnemonic? + if (IsMnemonic(charCode, CommandLinkTextValues.Heading)) + { + // Perform default action for a button, click it! + PerformClick(); + return true; + } + } + + // No match found, let base class do standard processing + return base.ProcessMnemonic(charCode); + } + + /// + /// Called when a context menu has just been closed. + /// + protected override void ContextMenuClosed() + { + _buttonController.RemoveFixed(); + } + + /// + protected override void OnPaint(PaintEventArgs? e) + { + //if (CommandLinkImageValues.ShowUACShield) + //{ + // SendMessage(new HandleRef(this, Handle), BCM_SETSHIELD, IntPtr.Zero, + // CommandLinkImageValues.ShowUACShield); + //} + + base.OnPaint(e); + } + + #endregion + + #region WIN32 Calls + + + [DllImport(Libraries.User32, CharSet = CharSet.Unicode)] + static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, bool lParam); + + #endregion + + #region Protected Virtual + + /// + /// Update the state objects to reflect the new button style. + /// + /// New button style. + protected virtual void SetStyles(ButtonStyle buttonStyle) + { + StateCommon.SetStyles(buttonStyle); + OverrideDefault.SetStyles(buttonStyle); + OverrideFocus.SetStyles(buttonStyle); + } + + /// + /// Creates a values storage object appropriate for control. + /// + /// Set of button values. + /// Delegate for notifying paint requests. + protected virtual ButtonValues CreateButtonValues(NeedPaintHandler needPaint) => new ButtonValues(needPaint); + + /// + /// Raises the KryptonCommandChanged event. + /// + /// An EventArgs containing the event data. + protected virtual void OnKryptonCommandChanged(EventArgs e) + { + KryptonCommandChanged.Invoke(this, e); + + // Use the values from the new command + if (KryptonCommand != null) + { + Enabled = KryptonCommand.Enabled; + } + + // Redraw to update the text/extratext/image properties + PerformNeedPaint(true); + } + + /// + /// Handles a change in the property of an attached command. + /// + /// Source of the event. + /// A PropertyChangedEventArgs that contains the event data. + protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e) + { + switch (e.PropertyName) + { + case "Enabled": + Enabled = KryptonCommand!.Enabled; + break; + case "Text": + case "ExtraText": + case "ImageSmall": + case "ImageTransparentColor": + PerformNeedPaint(true); + break; + } + } + + /// + /// Gets access to the view element for the color button. + /// + protected virtual ViewDrawCommandLinkButton ViewDrawButton => _drawCommandLinkButton; + + #endregion + + #region Implementation + + private void OnButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty); + + private void OnButtonClick(object sender, MouseEventArgs e) + { + // Raise the standard click event + OnClick(EventArgs.Empty); + + // Raise event to indicate it was a mouse activated click + OnMouseClick(e); + } + + private void OnButtonSelect(object sender, MouseEventArgs e) + { + // Take the focus if allowed + if (CanFocus) + { + Focus(); + } + } + + #endregion + } +} diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs index de829ecce..0d5754468 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs @@ -10,6 +10,7 @@ */ #endregion +// Only used in this class using ContentAlignment = System.Drawing.ContentAlignment; // ReSharper disable ClassNeverInstantiated.Global diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs new file mode 100644 index 000000000..526e54f79 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs @@ -0,0 +1,168 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + internal class KryptonCommandLinkButtonActionList : DesignerActionList + { + #region Instance Fields + private readonly KryptonCommandLinkButton _button; + private readonly IComponentChangeService _service; + #endregion + + #region Identity + /// + /// Initialize a new instance of the KryptonButtonActionList class. + /// + /// Designer that owns this action list instance. + public KryptonCommandLinkButtonActionList(KryptonCommandLinkButtonDesigner owner) + : base(owner.Component) + { + // Remember the button instance + _button = owner.Component as KryptonCommandLinkButton; + + // Cache service used to notify when a property has changed + _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); + } + #endregion + + #region Public + /// + /// Gets and sets the button style. + /// + public ButtonStyle ButtonStyle + { + get => _button.ButtonStyle; + + set + { + if (_button.ButtonStyle != value) + { + _service.OnComponentChanged(_button, null, _button.ButtonStyle, value); + _button.ButtonStyle = value; + } + } + } + + /// + /// Gets and sets the visual orientation. + /// + public VisualOrientation Orientation + { + get => _button.Orientation; + + set + { + if (_button.Orientation != value) + { + _service.OnComponentChanged(_button, null, _button.Orientation, value); + _button.Orientation = value; + } + } + } + + /// + /// Gets and sets the button text. + /// + public string Heading + { + get => _button.CommandLinkTextValues.Heading; + + set + { + if (_button.CommandLinkTextValues.Heading != value) + { + _service.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Heading, value); + _button.CommandLinkTextValues.Heading = value; + } + } + } + + /// + /// Gets and sets the extra button text. + /// + public string Description + { + get => _button.CommandLinkTextValues.Description; + + set + { + if (_button.CommandLinkTextValues.Description != value) + { + _service.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Description, value); + _button.CommandLinkTextValues.Description = value; + } + } + } + + /// + /// Gets and sets the button image. + /// + public Image Image + { + get => _button.CommandLinkImageValues.Image; + + set + { + if (_button.CommandLinkImageValues.Image != value) + { + _service.OnComponentChanged(_button, null, _button.CommandLinkImageValues.Image, value); + _button.CommandLinkImageValues.Image = value; + } + } + } + + /// + /// Gets and sets the palette mode. + /// + public PaletteMode PaletteMode + { + get => _button.PaletteMode; + + set + { + if (_button.PaletteMode != value) + { + _service.OnComponentChanged(_button, null, _button.PaletteMode, value); + _button.PaletteMode = value; + } + } + } + #endregion + + #region Public Override + /// + /// Returns the collection of DesignerActionItem objects contained in the list. + /// + /// A DesignerActionItem array that contains the items in this list. + public override DesignerActionItemCollection GetSortedActionItems() + { + // Create a new collection for holding the single item we want to create + DesignerActionItemCollection actions = new DesignerActionItemCollection(); + + // This can be null when deleting a control instance at design time + if (_button != null) + { + // Add the list of button specific actions + actions.Add(new DesignerActionHeaderItem("Appearance")); + actions.Add(new DesignerActionPropertyItem("Orientation", "Orientation", "Appearance", "Button orientation")); + actions.Add(new DesignerActionHeaderItem("CommandLink")); + actions.Add(new DesignerActionPropertyItem("Heading", "Heading", "CommandLink", "Button Heading text")); + actions.Add(new DesignerActionPropertyItem("Description", "Description", "CommandLink", "Button Subscript Description text")); + actions.Add(new DesignerActionPropertyItem("Image", "Image", "CommandLink", "Button image")); + actions.Add(new DesignerActionHeaderItem("Visuals")); + actions.Add(new DesignerActionPropertyItem("ButtonStyle", "Style", "Visuals", "Button style")); + actions.Add(new DesignerActionPropertyItem("PaletteMode", "Palette", "Visuals", "Palette applied to drawing")); + } + + return actions; + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs new file mode 100644 index 000000000..a58cbccb6 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs @@ -0,0 +1,47 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + internal class KryptonCommandLinkButtonDesigner : ControlDesigner + { + #region Identity + /// + /// Initialize a new instance of the KryptonButtonDesigner class. + /// + public KryptonCommandLinkButtonDesigner() + { + // The resizing handles around the control need to change depending on the + // value of the AutoSize and AutoSizeMode properties. When in AutoSize you + // do not get the resizing handles, otherwise you do. + AutoResizeHandles = true; + } + #endregion + + #region Public Overrides + /// + /// Gets the design-time action lists supported by the component associated with the designer. + /// + public override DesignerActionListCollection ActionLists + { + get + { + // Create a collection of action lists + DesignerActionListCollection actionLists = new DesignerActionListCollection + { + // Add the button specific list + new KryptonCommandLinkButtonActionList(this) + }; + + return actionLists; + } + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/General/PlatformInvoke.cs b/Source/Krypton Components/Krypton.Toolkit/General/PlatformInvoke.cs index e90f73147..202e10986 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/PlatformInvoke.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/PlatformInvoke.cs @@ -18,9 +18,6 @@ // ReSharper disable ArrangeTypeMemberModifiers // ReSharper disable BuiltInTypeReferenceStyle // ReSharper disable ClassNeverInstantiated.Global - -using Microsoft.Win32.SafeHandles; - // ReSharper disable CommentTypo // ReSharper disable UnusedType.Local // ReSharper disable MemberHidesStaticFromOuterClass @@ -31,6 +28,9 @@ #pragma warning disable 649 +// Note: DO NOT REMOVE!!! +using Microsoft.Win32.SafeHandles; + namespace Krypton.Toolkit { @@ -2279,7 +2279,7 @@ public const int // CPL_LAUNCHED = USER + 0x1001, - OCM_CTLCOLOR = 0x2019, + OCM_CTLCOLOR = 0x2019, // if ( msg.Msg == PI.WM_.OCM_NOTIFY ) //{ // PI.NMHEADER h2 = (PI.NMHEADER)m.GetLParam(typeof(PI.NMHEADER)); diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs new file mode 100644 index 000000000..fb502378c --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs @@ -0,0 +1,123 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + public class CommandLinkImageValues : Storage, IContentValues + { + #region Static Fields + + private static readonly Image DEFAULT_IMAGE = MessageBoxImageResources.GenericQuestion; + + #endregion + + #region Instance Fields + + private Color _transparencyKey; + + private Image _image; + + #endregion + + #region Public + + //public bool ShowUACShield { get; set; } + + /// Gets and sets the heading image transparent color. + [Localizable(true)] + [Category("Visuals")] + [Description("Image transparent color.")] + [RefreshProperties(RefreshProperties.All)] + [KryptonDefaultColor()] + public Color ImageTransparentColor + { + get => _transparencyKey; + + set + { + if (_transparencyKey != value) + { + _transparencyKey = value; + PerformNeedPaint(true); + } + } + } + + private bool ShouldSerializeImageTransparentColor() => ImageTransparentColor != Color.Empty; + + /// Resets the ImageTransparentColor property to its default value. + public void ResetImageTransparentColor() => ImageTransparentColor = Color.Empty; + + /// Gets or sets the image. + /// The image. + [Localizable(true)] + [Category("Visuals")] + [Description("The image.")] + [RefreshProperties(RefreshProperties.All)] + public Image Image + { + get => _image; + set + { + if (_image != value) + { + _image = value; + PerformNeedPaint(true); + } + } + + } + + private bool ShouldSerializeImage() => Image != DEFAULT_IMAGE; + + public void ResetImage() => Image = DEFAULT_IMAGE; + + #endregion + + #region Identity + + /// Initializes a new instance of the class. + /// The need paint. + public CommandLinkImageValues(NeedPaintHandler needPaint) + { + NeedPaint = needPaint; + + ResetImage(); + + ResetImageTransparentColor(); + } + + #endregion + + #region IsDefault + + /// + [Browsable(false)] + public override bool IsDefault => ((Image == DEFAULT_IMAGE) && + (ImageTransparentColor == Color.Empty)); + + #endregion + + #region Implementation + + /// + public Image? GetImage(PaletteState state) => Image; + + /// + public Color GetImageTransparentColor(PaletteState state) => ImageTransparentColor; + + /// + public string GetShortText() => string.Empty; + + /// + public string GetLongText() => string.Empty; + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs new file mode 100644 index 000000000..4cc2b5906 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs @@ -0,0 +1,30 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + public class CommandLinkMainTextValue : NullContentValues + { + #region Public + + /// Gets or sets the short text. + /// The short text. + public string ShortText { get; set; } + + #endregion + + #region Implementation + + /// Gets the content short text. + /// String value. + public override string GetShortText() => ShortText; + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs new file mode 100644 index 000000000..ac8bc748f --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs @@ -0,0 +1,30 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + public class CommandLinkSubscriptTextValue : NullContentValues + { + #region Public + + /// Gets or sets the long text. + /// The long text. + public string LongText { get; set; } + + #endregion + + #region Implementation + + /// Gets the content long text. + /// String value. + public override string GetLongText() => LongText; + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs new file mode 100644 index 000000000..99f44acb0 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs @@ -0,0 +1,58 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + public class CommandLinkTextValues : CaptionValues + { + #region Static Fields + + private const string DEFAULT_HEADING = @"Krypton Command Link Button"; + + private const string DEFAULT_DESCRIPTION = @"Krypton Command Link Button ""Note Text"""; + + #endregion + + #region Identity + + /// Initializes a new instance of the class. + /// Delegate for notifying paint requests. + public CommandLinkTextValues(NeedPaintHandler needPaint) : base(needPaint) + { + } + + #endregion + + #region Protected + + /// + protected override string GetDescriptionDefault() => DEFAULT_DESCRIPTION; + + /// + protected override string GetHeadingDefault() => DEFAULT_HEADING; + + #endregion + + #region Implementation + + /// + [DefaultValue(DEFAULT_DESCRIPTION)] + public override string Description { get => base.Description; set => base.Description = value; } + + /// Resets the text. + public void ResetText() + { + Heading = DEFAULT_HEADING; + + Description = DEFAULT_DESCRIPTION; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs new file mode 100644 index 000000000..663e02003 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs @@ -0,0 +1,518 @@ +#region BSD License +/* + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit +{ + /// + /// View element that can draw a CommandLinkButton. + /// + public class ViewDrawCommandLinkButton : ViewComposite + { + #region Instance Fields + + private IPaletteTriple _paletteDisabled; + private IPaletteTriple _paletteNormal; + private IPaletteTriple _paletteTracking; + private IPaletteTriple _palettePressed; + private IPaletteTriple _paletteCheckedNormal; + private IPaletteTriple _paletteCheckedTracking; + private IPaletteTriple _paletteCheckedPressed; + private readonly ViewDrawCanvas _drawCanvas; + private readonly ViewDrawContent _drawContent; + private readonly ViewDrawContent _drawImageContent; + private readonly ViewLayoutCenter _drawImage; + private bool _forcePaletteUpdate; + + #endregion + + #region Identity + + /// + /// Initialize a new instance of the class. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + /// Palette source for metric values. + /// + /// + /// Visual orientation of the content. + /// Use mnemonics. + public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed, + IPaletteMetric paletteMetric, + CommandLinkImageValues imageValues, + CommandLinkTextValues commandLinkTextValues, + VisualOrientation orientation, + bool useMnemonic) + : this(paletteDisabled, paletteNormal, paletteTracking, palettePressed, + paletteNormal, paletteTracking, palettePressed, paletteMetric, + imageValues, commandLinkTextValues, orientation, useMnemonic) + { + } + + /// + /// Initialize a new instance of the ViewDrawButton class. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + /// Palette source for the normal checked state. + /// Palette source for the tracking checked state. + /// Palette source for the pressed checked state. + /// Palette source for metric values. + /// + /// + /// Visual orientation of the content. + /// Use mnemonics. + public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed, + IPaletteTriple paletteCheckedNormal, + IPaletteTriple paletteCheckedTracking, + IPaletteTriple paletteCheckedPressed, + IPaletteMetric paletteMetric, + CommandLinkImageValues imageValues, + CommandLinkTextValues commandLinkTextValues, + VisualOrientation orientation, + bool useMnemonic) + { + // Remember the source information + _paletteDisabled = paletteDisabled; + _paletteNormal = paletteNormal; + _paletteTracking = paletteTracking; + _palettePressed = palettePressed; + _paletteCheckedNormal = paletteCheckedNormal; + _paletteCheckedTracking = paletteCheckedTracking; + _paletteCheckedPressed = paletteCheckedPressed; + CurrentPalette = _paletteNormal; + + // Default to not being checked + Checked = false; + AllowUncheck = true; + + // Create the drop down view + _drawImageContent = new ViewDrawContent(_paletteNormal.PaletteContent, imageValues, orientation); + _drawImage = new ViewLayoutCenter(paletteMetric, PaletteMetricPadding.BarPaddingOnly, + orientation, _drawImageContent); + + // Our view contains background and border with content inside + _drawContent = new ViewDrawContent(_paletteNormal.PaletteContent, commandLinkTextValues, orientation) + { + // Pass the mnemonic default to the content view + UseMnemonic = useMnemonic + }; + + // Use a docker layout to organize the contents of the canvas + LayoutDocker = new ViewLayoutDocker + { + { _drawContent, ViewDockStyle.Left }, + { _drawImage, ViewDockStyle.Left } + }; + LayoutDocker.Tag = this; + + + _drawCanvas = new ViewDrawCanvas(_paletteNormal.PaletteBack, _paletteNormal.PaletteBorder, paletteMetric, + PaletteMetricPadding.BarPaddingTabs, orientation) + { + // Place the content inside the canvas + LayoutDocker + }; + + // Place the canvas inside ourself + Add(_drawCanvas); + } + + /// + /// Obtains the String representation of this instance. + /// + /// User readable name of the instance. + public override string ToString() + { + // Return the class name and instance identifier + return "ViewDrawButton:" + Id; + } + #endregion + + #region LayoutDocker + /// + /// Gets access to the contained layout docker. + /// + public ViewLayoutDocker LayoutDocker { get; } + + #endregion + + #region CurrentPalette + /// + /// Gets access to the currently selected palette. + /// + public IPaletteTriple CurrentPalette { get; private set; } + + #endregion + + #region ButtonValues + /// + /// Gets and sets the source for button values. + /// + public IContentValues? ButtonValues + { + get => _drawContent.Values; + set => _drawContent.Values = value; + } + #endregion + + #region DrawTabBorder + /// + /// Gets and sets if the border should be drawn as a tab border. + /// + public bool DrawTabBorder + { + get => _drawCanvas.DrawTabBorder; + set => _drawCanvas.DrawTabBorder = value; + } + #endregion + + #region TabBorderStyle + /// + /// Gets and sets the tab border style of the button. + /// + public TabBorderStyle TabBorderStyle + { + get => _drawCanvas.TabBorderStyle; + set => _drawCanvas.TabBorderStyle = value; + } + #endregion + + #region Enabled + /// + /// Gets and sets the enabled state of the element. + /// + public override bool Enabled + { + get => base.Enabled; + + set + { + base.Enabled = value; + + if (Enabled && (ElementState == PaletteState.Disabled)) + { + ElementState = Checked ? PaletteState.CheckedNormal : PaletteState.Normal; + } + + // Pass on the new state to the child elements + _drawCanvas.Enabled = value; + _drawContent.Enabled = value; + _drawImageContent.Enabled = value; + } + } + #endregion + + #region Orientation + /// + /// Gets and sets the visual orientation. + /// + public virtual VisualOrientation Orientation + { + get => _drawCanvas.Orientation; + set => SetOrientation(value, value); + } + + /// + /// Set the orientation of the two button components. + /// + /// Orientation of the button border and background.. + /// Orientation of the button contents. + public void SetOrientation(VisualOrientation borderBackOrient, + VisualOrientation contentOrient) + { + _drawCanvas.Orientation = borderBackOrient; + _drawContent.Orientation = contentOrient; + } + #endregion + + #region UseMnemonic + /// + /// Gets and sets usage of mnemonics. + /// + public bool UseMnemonic + { + get => _drawContent.UseMnemonic; + set => _drawContent.UseMnemonic = value; + } + #endregion + + #region Checked + /// + /// Gets and sets the checked state. + /// + public bool Checked { get; set; } + + #endregion + + #region AllowUncheck + /// + /// Gets and sets the allow uncheck state. + /// + public bool AllowUncheck { get; set; } + + #endregion + + #region DrawButtonComposition + /// + /// Gets and sets the composition usage of the button. + /// + public bool DrawButtonComposition + { + get => _drawCanvas.DrawCanvasOnComposition; + set => _drawCanvas.DrawCanvasOnComposition = value; + } + #endregion + + #region TestForFocusCues + /// + /// Gets and sets the use of focus cues for deciding if focus rects are allowed. + /// + public bool TestForFocusCues + { + get => _drawContent.TestForFocusCues; + set => _drawContent.TestForFocusCues = value; + } + #endregion + + #region Palettes + /// + /// Update the source palettes for non-checked drawing. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + public void SetPalettes(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed) + { + Debug.Assert(paletteDisabled != null); + Debug.Assert(paletteNormal != null); + Debug.Assert(paletteTracking != null); + Debug.Assert(palettePressed != null); + + // Remember the new palette settings + _paletteDisabled = paletteDisabled; + _paletteNormal = paletteNormal; + _paletteTracking = paletteTracking; + _palettePressed = palettePressed; + + // Must force update of palettes to use latest ones provided + _forcePaletteUpdate = true; + } + + /// + /// Update the source palettes for checked state drawing. + /// + /// Palette source for the normal checked state. + /// Palette source for the tracking checked state. + /// Palette source for the pressed checked state. + public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal, + IPaletteTriple paletteCheckedTracking, + IPaletteTriple paletteCheckedPressed) + { + Debug.Assert(paletteCheckedNormal != null); + Debug.Assert(paletteCheckedTracking != null); + Debug.Assert(paletteCheckedPressed != null); + + // Remember the new palette settings + _paletteCheckedNormal = paletteCheckedNormal; + _paletteCheckedTracking = paletteCheckedTracking; + _paletteCheckedPressed = paletteCheckedPressed; + + // Must force update of palettes to use latest ones provided + _forcePaletteUpdate = true; + } + #endregion + + #region Eval + /// + /// Evaluate the need for drawing transparent areas. + /// + /// Evaluation context. + /// True if transparent areas exist; otherwise false. + public override bool EvalTransparentPaint(ViewContext context) + { + Debug.Assert(context != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Ask the renderer to evaluate the given palette + return _drawCanvas.EvalTransparentPaint(context); + } + #endregion + + #region Layout + /// + /// Discover the preferred size of the element. + /// + /// Layout context. + public override Size GetPreferredSize(ViewLayoutContext context) + { + Debug.Assert(context != null); + Debug.Assert(_drawCanvas != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Delegate work to the child canvas + return _drawCanvas.GetPreferredSize(context); + } + + /// + /// Perform a layout of the elements. + /// + /// Layout context. + /// + public override void Layout(ViewLayoutContext context) + { + Debug.Assert(context != null); + + // Validate incoming reference + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + + // We take on all the available display area + ClientRectangle = context.DisplayRectangle; + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Let base class perform usual processing + base.Layout(context); + + + } + #endregion + + #region Paint + /// + /// Perform a render of the elements. + /// + /// Rendering context. + public override void Render(RenderContext context) + { + Debug.Assert(context != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Let base class perform standard rendering + base.Render(context); + } + #endregion + + #region Protected + /// + /// Check that the palette and state are correct. + /// + /// Reference to the view context. + protected virtual void CheckPaletteState(ViewContext context) + { + // Default to using this element calculated state + PaletteState buttonState = State; + + // If the actual control is not enabled, force to disabled state + if (!IsFixed && !context.Control.Enabled) + { + buttonState = PaletteState.Disabled; + } + + // Apply the checked state if not fixed + if (!IsFixed && Checked) + { + // Is the checked button allowed to become unchecked + if (AllowUncheck) + { + // Show feedback on tracking and pressed + switch (buttonState) + { + case PaletteState.Normal: + buttonState = PaletteState.CheckedNormal; + break; + case PaletteState.Tracking: + buttonState = PaletteState.CheckedTracking; + break; + case PaletteState.Pressed: + buttonState = PaletteState.CheckedPressed; + break; + } + } + else + { + // Always use the normal state as user cannot uncheck the button + buttonState = PaletteState.CheckedNormal; + } + } + + // If the child elements are not in correct state + if (_forcePaletteUpdate || (_drawCanvas.ElementState != buttonState)) + { + // No longer need to force the palettes to be updated + _forcePaletteUpdate = false; + + // Switch the child elements over to correct state + _drawCanvas.ElementState = buttonState; + _drawContent.ElementState = buttonState; + _drawImageContent.ElementState = buttonState; + + // Push the correct palettes into them + switch (buttonState) + { + case PaletteState.Disabled: + CurrentPalette = _paletteDisabled; + break; + case PaletteState.Normal: + CurrentPalette = _paletteNormal; + break; + case PaletteState.CheckedNormal: + CurrentPalette = _paletteCheckedNormal; + break; + case PaletteState.Pressed: + CurrentPalette = _palettePressed; + break; + case PaletteState.CheckedPressed: + CurrentPalette = _paletteCheckedPressed; + break; + case PaletteState.Tracking: + CurrentPalette = _paletteTracking; + break; + case PaletteState.CheckedTracking: + CurrentPalette = _paletteCheckedTracking; + break; + default: + // Should never happen! + Debug.Assert(false); + break; + } + + // Update with the correct palettes + _drawCanvas.SetPalettes(CurrentPalette.PaletteBack, CurrentPalette.PaletteBorder); + _drawContent.SetPalette(CurrentPalette.PaletteContent); + //_drawImageContent.SetPalette(CurrentPalette.PaletteContent); + } + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index a70e54e96..98791ed16 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -77,6 +77,7 @@ private void InitializeComponent() this.kryptonManager1 = new Krypton.Toolkit.KryptonManager(this.components); this.kryptonCheckSet1 = new Krypton.Toolkit.KryptonCheckSet(this.components); this.kryptonTaskDialog1 = new Krypton.Toolkit.KryptonTaskDialog(); + this.kryptonButton9 = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); @@ -85,6 +86,7 @@ private void InitializeComponent() // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kryptonButton9); this.kryptonPanel1.Controls.Add(this.kryptonButton5); this.kryptonPanel1.Controls.Add(this.kryptonButton8); this.kryptonPanel1.Controls.Add(this.kcbtnSizableToolWindow); @@ -479,6 +481,15 @@ private void InitializeComponent() this.kryptonTaskDialog1.UseNativeOSIcons = false; this.kryptonTaskDialog1.WindowTitle = null; // + // kryptonButton9 + // + this.kryptonButton9.Location = new System.Drawing.Point(15, 415); + this.kryptonButton9.Name = "kryptonButton9"; + this.kryptonButton9.Size = new System.Drawing.Size(183, 25); + this.kryptonButton9.TabIndex = 34; + this.kryptonButton9.Values.Text = "Command Links"; + this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -561,5 +572,6 @@ private void InitializeComponent() private Krypton.Toolkit.KryptonButton kryptonButton8; private Krypton.Toolkit.KryptonButton kryptonButton5; private Krypton.Toolkit.KryptonTaskDialog kryptonTaskDialog1; + private Krypton.Toolkit.KryptonButton kryptonButton9; } } \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form1.cs b/Source/Krypton Components/TestForm/Form1.cs index ba1d62a0b..344d8ca44 100644 --- a/Source/Krypton Components/TestForm/Form1.cs +++ b/Source/Krypton Components/TestForm/Form1.cs @@ -312,5 +312,12 @@ private void kryptonButton5_Click(object sender, EventArgs e) { kryptonTaskDialog1.ShowDialog(); } + + private void kryptonButton9_Click(object sender, EventArgs e) + { + Form7 commandLinks = new Form7(); + + commandLinks.ShowDialog(); + } } } \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form7.Designer.cs b/Source/Krypton Components/TestForm/Form7.Designer.cs new file mode 100644 index 000000000..adb4e6f90 --- /dev/null +++ b/Source/Krypton Components/TestForm/Form7.Designer.cs @@ -0,0 +1,227 @@ +namespace TestForm +{ + partial class Form7 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form7)); + this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonCommandLinkButton1 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonAlternateCommandLinkButton1 = new Krypton.Toolkit.KryptonAlternateCommandLinkButton(); + this.kryptonCommandLinkButton2 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton3 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton4 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton5 = new Krypton.Toolkit.KryptonCommandLinkButton(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + this.kryptonPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // kryptonPanel1 + // + this.kryptonPanel1.Controls.Add(this.kryptonCommandLinkButton5); + this.kryptonPanel1.Controls.Add(this.kryptonCommandLinkButton4); + this.kryptonPanel1.Controls.Add(this.kryptonCommandLinkButton3); + this.kryptonPanel1.Controls.Add(this.kryptonCommandLinkButton2); + this.kryptonPanel1.Controls.Add(this.kryptonAlternateCommandLinkButton1); + this.kryptonPanel1.Controls.Add(this.kryptonCommandLinkButton1); + this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonPanel1.Location = new System.Drawing.Point(0, 0); + this.kryptonPanel1.Name = "kryptonPanel1"; + this.kryptonPanel1.Size = new System.Drawing.Size(690, 386); + this.kryptonPanel1.TabIndex = 0; + // + // kryptonCommandLinkButton1 + // + this.kryptonCommandLinkButton1.CommandLinkTextValues.Description = "Here be the \"Note Text\""; + this.kryptonCommandLinkButton1.CommandLinkTextValues.Heading = "Default Ext Command Link"; + this.kryptonCommandLinkButton1.Location = new System.Drawing.Point(12, 99); + this.kryptonCommandLinkButton1.Name = "kryptonCommandLinkButton1"; + this.kryptonCommandLinkButton1.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton1.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton1.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton1.Size = new System.Drawing.Size(341, 61); + this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton1.TabIndex = 0; + // + // kryptonAlternateCommandLinkButton1 + // + this.kryptonAlternateCommandLinkButton1.Location = new System.Drawing.Point(12, 12); + this.kryptonAlternateCommandLinkButton1.Name = "kryptonAlternateCommandLinkButton1"; + this.kryptonAlternateCommandLinkButton1.Size = new System.Drawing.Size(341, 69); + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonAlternateCommandLinkButton1.TabIndex = 1; + this.kryptonAlternateCommandLinkButton1.Values.ExtraText = "Text here is forced in to the lower part of the button"; + this.kryptonAlternateCommandLinkButton1.Values.Image = ((System.Drawing.Image)(resources.GetObject("kryptonAlternateCommandLinkButton1.Values.Image"))); + this.kryptonAlternateCommandLinkButton1.Values.Text = "Normal Krypton Button"; + // + // kryptonCommandLinkButton2 + // + this.kryptonCommandLinkButton2.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; + this.kryptonCommandLinkButton2.CommandLinkTextValues.Description = " Here be the extra Text with some spaces"; + this.kryptonCommandLinkButton2.CommandLinkTextValues.Heading = "Standalone Style"; + this.kryptonCommandLinkButton2.Location = new System.Drawing.Point(12, 180); + this.kryptonCommandLinkButton2.Name = "kryptonCommandLinkButton2"; + this.kryptonCommandLinkButton2.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton2.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton2.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton2.Size = new System.Drawing.Size(341, 61); + this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton2.TabIndex = 2; + // + // kryptonCommandLinkButton3 + // + this.kryptonCommandLinkButton3.ButtonStyle = Krypton.Toolkit.ButtonStyle.NavigatorMini; + this.kryptonCommandLinkButton3.CommandLinkTextValues.Description = " Demo the Shortcut display and rounded borders"; + this.kryptonCommandLinkButton3.CommandLinkTextValues.Heading = "&Navigator Mini style"; + this.kryptonCommandLinkButton3.Location = new System.Drawing.Point(12, 247); + this.kryptonCommandLinkButton3.Name = "kryptonCommandLinkButton3"; + this.kryptonCommandLinkButton3.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton3.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton3.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton3.Size = new System.Drawing.Size(341, 61); + this.kryptonCommandLinkButton3.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton3.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton3.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton3.StateCommon.Border.Rounding = 4F; + this.kryptonCommandLinkButton3.StateCommon.Border.Width = 2; + this.kryptonCommandLinkButton3.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton3.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton3.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton3.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton3.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton3.TabIndex = 3; + // + // kryptonCommandLinkButton4 + // + this.kryptonCommandLinkButton4.ButtonStyle = Krypton.Toolkit.ButtonStyle.NavigatorMini; + this.kryptonCommandLinkButton4.CommandLinkImageValues.Image = ((System.Drawing.Image)(resources.GetObject("kryptonCommandLinkButton4.CommandLinkImageValues.Image"))); + this.kryptonCommandLinkButton4.CommandLinkTextValues.Description = " Demo the Shortcut display and rounded borders"; + this.kryptonCommandLinkButton4.CommandLinkTextValues.Heading = "&Disabled Navigator Mini style"; + this.kryptonCommandLinkButton4.Enabled = false; + this.kryptonCommandLinkButton4.Location = new System.Drawing.Point(13, 315); + this.kryptonCommandLinkButton4.Name = "kryptonCommandLinkButton4"; + this.kryptonCommandLinkButton4.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton4.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton4.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton4.Size = new System.Drawing.Size(340, 55); + this.kryptonCommandLinkButton4.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton4.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton4.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton4.StateCommon.Border.Rounding = 4F; + this.kryptonCommandLinkButton4.StateCommon.Border.Width = 2; + this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton4.TabIndex = 4; + // + // kryptonCommandLinkButton5 + // + this.kryptonCommandLinkButton5.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; + this.kryptonCommandLinkButton5.CommandLinkTextValues.Description = "What happens when the text is really long, \r\nand wants to go off the edge?\r\nThen " + + "Use a Multi-line ;-)\r\n"; + this.kryptonCommandLinkButton5.CommandLinkTextValues.Heading = "&Control the World"; + this.kryptonCommandLinkButton5.Location = new System.Drawing.Point(359, 12); + this.kryptonCommandLinkButton5.Name = "kryptonCommandLinkButton5"; + this.kryptonCommandLinkButton5.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton5.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.Size = new System.Drawing.Size(319, 86); + this.kryptonCommandLinkButton5.StateCommon.Back.Color1 = System.Drawing.SystemColors.GradientActiveCaption; + this.kryptonCommandLinkButton5.StateCommon.Back.Color2 = System.Drawing.SystemColors.ActiveCaption; + this.kryptonCommandLinkButton5.StateCommon.Back.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.StateCommon.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.kryptonCommandLinkButton5.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton5.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.StateCommon.Border.Rounding = 6F; + this.kryptonCommandLinkButton5.StateCommon.Border.Width = 2; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.Trim = Krypton.Toolkit.PaletteTextTrim.Word; + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton5.TabIndex = 5; + // + // Form7 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(690, 386); + this.Controls.Add(this.kryptonPanel1); + this.Name = "Form7"; + this.Text = "Form7"; + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + this.kryptonPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Krypton.Toolkit.KryptonPanel kryptonPanel1; + private Krypton.Toolkit.KryptonCommandLinkButton kryptonCommandLinkButton1; + private Krypton.Toolkit.KryptonCommandLinkButton kryptonCommandLinkButton5; + private Krypton.Toolkit.KryptonCommandLinkButton kryptonCommandLinkButton4; + private Krypton.Toolkit.KryptonCommandLinkButton kryptonCommandLinkButton3; + private Krypton.Toolkit.KryptonCommandLinkButton kryptonCommandLinkButton2; + private Krypton.Toolkit.KryptonAlternateCommandLinkButton kryptonAlternateCommandLinkButton1; + } +} \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form7.cs b/Source/Krypton Components/TestForm/Form7.cs new file mode 100644 index 000000000..75f30409a --- /dev/null +++ b/Source/Krypton Components/TestForm/Form7.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +using Krypton.Toolkit; + +namespace TestForm +{ + public partial class Form7 : KryptonForm + { + public Form7() + { + InitializeComponent(); + } + } +} diff --git a/Source/Krypton Components/TestForm/Form7.resx b/Source/Krypton Components/TestForm/Form7.resx new file mode 100644 index 000000000..bca833997 --- /dev/null +++ b/Source/Krypton Components/TestForm/Form7.resx @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + 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 + + + \ No newline at end of file From 1cf8e828fa5248505e079d2e056758c4af503243 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 1 Dec 2023 15:02:56 +0000 Subject: [PATCH 02/16] Update Changelog.md --- Documents/Help/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 186963ee7..0bd5d15d6 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -5,6 +5,7 @@ ## 2024-11-xx - Build 2411 - November 2024 * Resolved [#1197](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1197), `KryptonTaskDialog` Footer Images * Resolved [#1189](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1189), The Context and Next/Pervious buttons of the `KryptonDockableNavigator` cannot be used +* Implement [#1187](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1187), Bring over the `KryptonCommandLinkButtons` * Resolved [#1176](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1176), KryptonProgressBar: small values escape drawing area * Resolved [#1169](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1169), Button Spec Krypton Context Menu (Canary) * Implemented [#1166](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1166), Use a struct to contain `KryptonMessageBox` data From b012dfd559d18f56c975df474d289454373726c2 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 1 Dec 2023 16:59:01 +0000 Subject: [PATCH 03/16] * Images --- .../KryptonAlternateCommandLinkButton.cs | 2 +- .../Controls Toolkit/KryptonCommandLinkButton.cs | 2 +- .../ToolboxBitmaps/KryptonCommandLinkButton.bmp | Bin 0 -> 702 bytes 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Source/Krypton Components/Krypton.Toolkit/ToolboxBitmaps/KryptonCommandLinkButton.bmp diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs index 2c8b569d2..6ffba35e6 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit [DisplayName("Krypton Command Link")] [Description("A Krypton Command Link Button.")] [ToolboxItem(true)] - [ToolboxBitmap(typeof(KryptonButton))] + [ToolboxBitmap(typeof(KryptonAlternateCommandLinkButton), @"ToolboxBitmaps.KryptonCommandLinkButton.bmp")] public class KryptonAlternateCommandLinkButton : KryptonButton { #region Static Fields diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs index 621188ed7..d22d78500 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs @@ -11,7 +11,7 @@ namespace Krypton.Toolkit { /// Combines button functionality with the styling features of the Krypton Toolkit. /// Main code taken from KryptonButton, then trimmed out to force the CommandLink layout. - [ToolboxBitmap(typeof(KryptonButton))] + [ToolboxBitmap(typeof(KryptonCommandLinkButton), @"ToolboxBitmaps.KryptonCommandLinkButton.bmp")] [ToolboxItem(true)] [DefaultEvent("Click")] [DefaultProperty("Heading")] diff --git a/Source/Krypton Components/Krypton.Toolkit/ToolboxBitmaps/KryptonCommandLinkButton.bmp b/Source/Krypton Components/Krypton.Toolkit/ToolboxBitmaps/KryptonCommandLinkButton.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e7f1ba67482c20ee9337a74209aee429b6dd9b09 GIT binary patch literal 702 zcmYk2YebRp}5XeIQ1h&}}N zrJ|@06%>gT3WEZz#4cXSY}T6QYx9!mvM6D6qsXVDo8k|iKj%5;aL%8Tp4;rfOw%l4 z7%fFow?vGOt3dDb0GIYrJS8wdi+vQ=Ep}Y)6woM)ph@_MTH6S^oqzEDH&EX<26N9a zF16ZVasGw%2S}4R|I~`J4=u3$0y>;P*>N7H@4v)5@{cEgsqrOMJWe&V;q6br{1qsy zyNA=xjctg3{pMm@e9w+LapqqTI4ajP7kj4;wh(}dz3oMjZ73_!D#}5hT>d-~| z^QbSgaR4Gu2}EK~WIX7HhWZP7fLBy6?gKPM2jMGIAi11JXtExOM|hM9Kqu7?+W}*J z2U3pmC?5b`d?ujS?q?5Q)FkS z%av(s^{kt9>(i8~q~w+CsuUuXUA-nrrH<3ZFI&Dsr_&{{35juPZ4AdPiCxNZoQBnK zF@2iY{3jNS&($z ZeE&HF1WLTTeP;3Y^ Date: Fri, 1 Dec 2023 19:13:58 +0000 Subject: [PATCH 04/16] * Icons --- .../MessageBoxImageResources.Designer.cs | 70 ++++++++++++++++++ .../MessageBox/MessageBoxImageResources.resx | 21 ++++++ .../Resources/MessageBoxAsterisk.png | Bin 0 -> 1108 bytes .../Resources/MessageBoxCritical.png | Bin 0 -> 881 bytes .../Resources/MessageBoxHelp.png | Bin 0 -> 994 bytes .../Resources/MessageBoxInformation.png | Bin 0 -> 741 bytes .../Resources/MessageBoxOk.png | Bin 0 -> 769 bytes .../Resources/MessageBoxStop.png | Bin 0 -> 738 bytes .../Resources/MessageBoxWarning.png | Bin 0 -> 682 bytes 9 files changed, 91 insertions(+) create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxAsterisk.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxCritical.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxHelp.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxInformation.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxOk.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxStop.png create mode 100644 Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxWarning.png diff --git a/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.Designer.cs index 6c3ab827b..c825a230a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.Designer.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.Designer.cs @@ -170,6 +170,76 @@ internal static System.Drawing.Bitmap Information_Windows_11 { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxAsterisk { + get { + object obj = ResourceManager.GetObject("MessageBoxAsterisk", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxCritical { + get { + object obj = ResourceManager.GetObject("MessageBoxCritical", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxHelp { + get { + object obj = ResourceManager.GetObject("MessageBoxHelp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxInformation { + get { + object obj = ResourceManager.GetObject("MessageBoxInformation", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxOk { + get { + object obj = ResourceManager.GetObject("MessageBoxOk", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxStop { + get { + object obj = ResourceManager.GetObject("MessageBoxStop", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap MessageBoxWarning { + get { + object obj = ResourceManager.GetObject("MessageBoxWarning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.resx b/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.resx index fe39c6553..c613cce7a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.resx +++ b/Source/Krypton Components/Krypton.Toolkit/ResourceFiles/MessageBox/MessageBoxImageResources.resx @@ -151,6 +151,27 @@ ..\..\Resources\Information_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\..\Resources\MessageBoxAsterisk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxCritical.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxHelp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxInformation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxOk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxStop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\Resources\MessageBoxWarning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\..\Resources\Question_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxAsterisk.png b/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxAsterisk.png new file mode 100644 index 0000000000000000000000000000000000000000..72a010bb17b31ae34b5d2a8dbcb55b210dadffd4 GIT binary patch literal 1108 zcmV-a1grarP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1L;XbK~z{r#g;*6 z6jvC>-}h#Acd}8)sd(r?Xbw4eNI(ys8mNLIBAOJst<|b6o_i1qt@I$pqh7>QG{)K# zlSrTzduYKzpb7y43e6!0!5nfCMdK#BJM&)u@6DIldD)%K?uzvXv-5p#XXg9Q_rCew zBdxV~pGZExH#*9|>tmny=VY)?soFaVzzK+{Aqm0*0d$S z1op`P9_Dczz8!4MJbB*vp4->|U_X^n3S@Mh%H0Fk;UwBE@>b%>UU{41o?qLTWhR*Dk)t7Lp2S?iR zn|@;-l|A`pjDtuV>T^l zv$xn3Zz}=<{$k65X-Hl+B_MJ$K;9x-mbVdsUg3QInpERQnNJ(`@H#wq*O8?F*X< zFszTB-i-%NrQ2qgv|PFyreFi}`GvXa5Z>6Cvra(T=WrUz3U0{EKpITR*SO9!lXkc0 zD-eFJIDO-1_A_Zqzy`d#IgT%71b4;#9aCfrOhj`ebAOxO5%}f#c6x`QBLVM%%o_NA a5aK_f(Y+UXQM{J`0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0|rS%K~z{r<(Exp z6G0TmXEvKOLDY&0Jros;2p**e4}$gJK@_yafPq?DQbeH#iJUj9730wI3og!**4$j3jA;zJe2FVT(5MWx# z>!5fWx$N_b#m+61S$TPxjlO@Y6@mZ5IXD;B;MxFgF-PzO;J1h2yz9B_=t;51`v%w+ z)6|OaC&#(C2G@odsO5_X$oB9Aq^z`bi}q*tXhq19;~E)u(>g|`hbI8G{t%fFR3f@b z?!ftRvOIhOn$jI;ArsM6a+f|DJ=#UcdB#x*hnMEU`^wJyTN5x5aQ{#atWH+MWH9AtB$ z`sd)=7sw4DZAhRecmS`(NpjZ&bVYA6soLS#4GB_BT4!Jg)Wd4PPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D19wS8K~z{r<(6q^ z)KCz||1Y~M^(eF=SW&5hS`ZJUNEHODAb3*6A|7k&^}!3YiXw=p_`&OoVnIX%wbmB2 zbcG5k9xEz%Vg*I2mi0ti#VXYvb~n#ScFelXOB(MF{vf=WNwPCLd2eQfloJ0Ejn{vM z=M2m_i8Q|^XG>jV2_XlN$+%L45bx+W-e^8?LHH0lJPl9H7d+Bo0EttPNU zLZ-3Vjj+%~(b0TVv+jy(0ELxUNw;^C;}kY|MoLi}dx4^|)rhi5iDLi-mDob}HnaM3 zNSu#0i5X?{@rf-qlmP@Qu#dj;N>+cBaP+yD;FJm5DJZBwup{TurUtyMxr4}q+i3mp zhOLg|1~RdqWgAHuFm`&thsR{=!KNgn9z*rHs9ZH1slBo=zUVLlsqr|CtX$l)5U;Nt!^{H_bncO9+Lh=SU6L=Z zvu0vtppy@|EGlWPt3^wFExHe%Y&ka&nh!m5W|{KyS9Rv`umTX8bj^ShZH@0J{YT+XNk?Yi-fVS1B7-H1#3q#RQf8Bg zHa8-?e+BAqS7PAYT}bKPK>)%f0BR~PS@g_}^6jX*aRONd#mJtrn61u`4_h&^0-$>D zTC>}8|5_CyRXfl>Z=-TwsF1pR!lK3ZpTMzRt7v={Z+1EPYs}Rnt^u54$rG&&@e=Is zl5VbEpblvZAW?`)&@IpvZ-1usdWGhM5$)#$D+5N$BC&F>bN*@YW^h(N+x3nP4^~6^8S+&zSVX zBiT0!L)bvKx6w0xHhIF>N7SW@W6jv)=G?$F0E6I3qcne@;KG_FE>kgA9yK>S2k@t`or1s3{~iGF6>WrA$o0#S Q^Z)<=07*qoM6N<$g5T-Me*gdg literal 0 HcmV?d00001 diff --git a/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxInformation.png b/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxInformation.png new file mode 100644 index 0000000000000000000000000000000000000000..6c2475a1ca1c2420e0ed737f030b2e8f46899f73 GIT binary patch literal 741 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0(wbAK~z{r<(55Y z6+sZk|FbWVltC0y2#OyBi&R#EU>ZU312riOyd)xNgjXck*aVdnA}JymwKYaaiiDhn zV4-q~MQlV%#X>Yi3c(cS!{ptqbC+S0rde0Qes2g}XO-M#(4x!K(ztu?k2CD&~u za|XJm(A=Q(CGArykv_?JeVpb67UwEOuX!_1TxvEl3n+@jBK(*9?*f27 XB?IeB&6CVr00000NkvXXu0mjf{D@3! literal 0 HcmV?d00001 diff --git a/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxOk.png b/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxOk.png new file mode 100644 index 0000000000000000000000000000000000000000..854a8b6bacc77393c30c92f127b5e1369bcca831 GIT binary patch literal 769 zcmV+c1OEJpP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0+vZcK~z{r<(DyN z6j2a{XT;(pji^N+S6B#MWo3~<@KT6~S12|?E}ex!@FJqv1O*F0n_Ugq1%xZk$^=p< zD4Zlknh+sPKnsftq!6(%C?W9t=XUb4dv9;EySJLc55mm6-P`})+4pu|*cd|x$svsg zM(Pgu9sel8xM6de44opzA5jVUH^faQ{(v~wC^x<$rexN z2Sz^WNFs>_{0)B+;?E#l(xEKOa2ZCZv7>b?eGTBwA3^+~mU(&4NBC;vc;lzm4zUKj zj`sp#GN=Yb9?1w_=+_Bn6`<{Pgkr=6Lsio;FST-rbUN zA|1dIdxB87xX_)6*Q->ySfR?9iXI8URMX5-NC$ew>rd-6bZkhEMi|y; z2^)xg%}Oh`zHe#el0jUaL4pB89nCBv-kfMs^L{hdL?-b7=Vi2KfZc=g9Oc66@75g? zImAWdi)NN^2b}k{Tu?6DYa*ApU=j>4^Sq`J;!NZc7ZN*Aq83j0tyP3x6S>3z_6e^v zwM4!J-iG%EZMveRgS3C)`9e3Z-L7R4$IZ2;MyAHJvh;q8M)9^{8OcuqZ~A52R~=@qK_u8U z89Isl2Qv9z;G@K}!n>q4@VAJag#VKN-2l-aDJ(Xu7lKvg00000NkvXXu0mjf0cBJ3 literal 0 HcmV?d00001 diff --git a/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxStop.png b/Source/Krypton Components/Krypton.Toolkit/Resources/MessageBoxStop.png new file mode 100644 index 0000000000000000000000000000000000000000..909eb6e1c291fbfc8a85ee26c407f699efa62dec GIT binary patch literal 738 zcmV<80v-K{P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0(VJ7K~z{r<(I!} z6hRcn=gsY&cd-d*ks^gfK>QN~!LzUsZQ>>1L5xalgfu|}8&OFiVj~!^5)v&g5Dl@j zP>f)a(o#^+!oosOMEB0UyB)u?`<%OFe`L+=n!*np^WI};=euv;&b%X~l-NxqkGn?Z z418}iM$4V*8C-u*sqO?xIf0oKq0|@rK8sT6MX4t?_N*^|Q5Mmx-*4 zO7uoKoCpcADTo%Tk5}GsD3w$J&h+_t;dyspR)R=&AY`dp?ktFAv&*4a5(PN**&7(H z2j0#gQF`u_+mrj6%^w_!5G$ZnpS_3ZJi9}oUkNgCJSh{AufUl)HnY@KtQkX41h5n4W9cHw8F}&$TSFg{0aEf4n?(}Yj7$cw`@Mu!=xZRNw>YE@vFp>X0i_c6>%35& z_nu8d{}o92l+D7xk)ABTvE5Y+?Z7Jt@>bX~7yMpt*up!% zluKJaNPF_axU%F7GEzs41YHvjFFfftMV|gI@CrAJ{nXOPETAZ2i|}9azY7rJH(LMa Uynt&G761SM07*qoM6N<$g8#@Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0zXMaK~z{r#g;)! z8$lGu-#Er#rBYfHdM>S>z+(}q1Uv{m*wTWB9z1yHp@-rJki=H1w|)fs z0eX;LS|}8etn?T>wQBSFCi65|vzwh6H2Fbx-+Pdq|NQ6e?0}i6pXBu3H~KChdr{}#05H8)x?QR0k*r@&?14KTyOL#f5}dHJPpg`0ztXBzRe> zEK#k}rD0oi6=1uXMT9p60^Vrcl~e&7Z4QZq6-`4}pxVc~8mE#f0F;**1kL^&aiQ^6 z<5Us_*e*u!2c`wjajlxPbzhJu0CZ|*AN+}J2cUHg6Y1OuP4@z3*DKh<6##xhBjqoe z#pravcJI{;T!=e>oH=Sa4LFY>r!*n3?+{2N`>ui_uzwXzR190K@srXYNf Date: Fri, 1 Dec 2023 19:28:48 +0000 Subject: [PATCH 05/16] * Values --- .../Krypton.Toolkit/Values/ButtonValues.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index 46f69559b..2daf09fde 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -24,6 +24,8 @@ public class ButtonValues : Storage, #endregion #region Instance Fields + + private bool _showUACShield; private Image? _image; private Color _transparent; private string? _text; @@ -218,6 +220,27 @@ public string ExtraText public void ResetExtraText() => ExtraText = _defaultExtraText; #endregion + #region ShowUACShield + + public bool ShowUACShield + { + get => _showUACShield; + + set + { + if (_showUACShield != value) + { + _showUACShield = value; + } + } + } + + private bool ShouldSerializeShowUACShield() => !ShowUACShield; + + public void ResetShowUACShield() => ShowUACShield = false; + + #endregion + #region CreateImageStates /// /// Create the storage for the image states. From 60daaa92d138a31fb059efa051d07339c4188807 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 1 Dec 2023 19:32:49 +0000 Subject: [PATCH 06/16] Update ButtonValues.cs --- .../Krypton.Toolkit/Values/ButtonValues.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index 2daf09fde..0d54b7253 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -26,6 +26,7 @@ public class ButtonValues : Storage, #region Instance Fields private bool _showUACShield; + private bool _useAsDialogButton; private Image? _image; private Color _transparent; private string? _text; @@ -241,6 +242,18 @@ public bool ShowUACShield #endregion + #region UseAsADialogButton + + [DefaultValue(false), + Description(@"If set to true, the text will pair up with the equivalent KryptonManager's dialog button text result. (Note: You'll lose any previous text)")] + public bool UseAsADialogButton + { + get => _useAsDialogButton; + set => _useAsDialogButton = value; + } + + #endregion + #region CreateImageStates /// /// Create the storage for the image states. From 24d7fd50e444c9e85185e1cd0d1613c473dec72b Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 1 Dec 2023 19:42:42 +0000 Subject: [PATCH 07/16] * Tidy up --- .../Controls Toolkit/KryptonButton.cs | 154 ------------------ .../VisualThemeBrowserForm.Designer.cs | 4 +- .../Krypton.Toolkit/Values/ButtonValues.cs | 150 +++++++++++++++++ 3 files changed, 152 insertions(+), 156 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index a0f94f3ab..35cc292d7 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -268,65 +268,7 @@ public ButtonStyle ButtonStyle private void ResetButtonStyle() => ButtonStyle = ButtonStyle.Standalone; - [DefaultValue(false), - Description(@"If set to true, the text will pair up with the equivalent KryptonManager's dialog button text result. (Note: You'll lose any previous text)")] - public bool UseAsADialogButton - { - get => _useAsDialogButton; - set => _useAsDialogButton = value; - } - - [DefaultValue(false), - Description(@"Transforms the button into a UAC elevated button.")] - public bool UseAsUACElevationButton - { - get => _useAsUACElevationButton; - set - { - _useAsUACElevationButton = value; - - switch (_uacShieldIconSize) - { - //if (_customUACShieldSize.Height > 0 && _customUACShieldSize.Width > 0) - //{ - // ShowUACShield(value, UACShieldIconSize.Custom, _customUACShieldSize.Width, _customUACShieldSize.Height); - //} - //else if (_uacShieldIconSize != UACShieldIconSize.Custom) - //{ - // ShowUACShield(value, _uacShieldIconSize); - //} - case UACShieldIconSize.ExtraSmall: - ShowUACShield(value, UACShieldIconSize.ExtraSmall); - break; - case UACShieldIconSize.Small: - ShowUACShield(value, UACShieldIconSize.Small); - break; - case UACShieldIconSize.Medium: - ShowUACShield(value, UACShieldIconSize.Medium); - break; - case UACShieldIconSize.Large: - ShowUACShield(value, UACShieldIconSize.Large); - break; - case UACShieldIconSize.ExtraLarge: - ShowUACShield(value, UACShieldIconSize.ExtraLarge); - break; - default: - ShowUACShield(value, UACShieldIconSize.ExtraSmall); - break; - } - } - } - - /* - [DefaultValue(false), Description(@"Use the operating system UAC shield icon image.")] - public bool UseOSUACShieldIcon { get => _useOSUACShieldIcon; set { _useOSUACShieldIcon = value; UpdateOSUACShieldIcon(); } } - - [DefaultValue(null), Description(@"")] - public Size CustomUACShieldSize { get => _customUACShieldSize; set { _customUACShieldSize = value; ShowUACShield(_useAsUACElevationButton, UACShieldIconSize.Custom, value.Width, value.Height); } } - */ - [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")] - public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; set { _uacShieldIconSize = value; ShowUACShield(_useAsUACElevationButton, value); } } /// /// Gets access to the button content. @@ -1012,102 +954,6 @@ private void SetCornerRoundingRadius(float? radius) StateCommon.Border.Rounding = _cornerRoundingRadius; } - #region UAC Stuff - - /// Shows the uac shield. - /// if set to true [show uac shield]. - /// Size of the shield icon. - /// The width. - /// The height. - private void ShowUACShield(bool showUACShield, UACShieldIconSize? shieldIconSize = null, int? width = null, int? height = null) - { - if (showUACShield) - { - int h = height ?? 16, w = width ?? 16; - - Image shield = SystemIcons.Shield.ToBitmap(); - - switch (shieldIconSize) - { - //case UACShieldIconSize.Custom: - // Values.Image = GraphicsExtensions.ScaleImage(shield, w, h); - // break; - case UACShieldIconSize.ExtraSmall: - Values.Image = GraphicsExtensions.ScaleImage(shield, 16, 16); - break; - case UACShieldIconSize.Small: - Values.Image = GraphicsExtensions.ScaleImage(shield, 32, 32); - break; - case UACShieldIconSize.Medium: - Values.Image = GraphicsExtensions.ScaleImage(shield, 64, 64); - break; - case UACShieldIconSize.Large: - Values.Image = GraphicsExtensions.ScaleImage(shield, 128, 128); - break; - case UACShieldIconSize.ExtraLarge: - Values.Image = GraphicsExtensions.ScaleImage(shield, 256, 256); - break; - case null: - Values.Image = GraphicsExtensions.ScaleImage(shield, 16, 16); - break; - } - - Invalidate(); - } - else - { - Values.Image = null; - } - } - - /// Updates the UAC shield icon. - /// Size of the icon. - /// Size of the custom. - private void UpdateOSUACShieldIcon(UACShieldIconSize? iconSize = null, Size? customSize = null) - { - //if (OSUtilities.IsWindowsEleven) - //{ - // Image windowsElevenUacShieldImage = UACShieldIconResources.UACShieldWindows11; - - // if (iconSize == UACShieldIconSize.Custom) - // { - // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsElevenUacShieldImage); - // } - // else - // { - // UpdateShieldSize(iconSize, null, windowsElevenUacShieldImage); - // } - //} - //else if (OSUtilities.IsWindowsTen) - //{ - // Image windowsTenUacShieldImage = UACShieldIconResources.UACShieldWindows10; - - // if (iconSize == UACShieldIconSize.Custom) - // { - // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsTenUacShieldImage); - // } - // else - // { - // UpdateShieldSize(iconSize, null, windowsTenUacShieldImage); - // } - //} - //else if (OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight || OSUtilities.IsWindowsSeven) - //{ - // Image windowsEightUacShieldImage = UACShieldIconResources.UACShieldWindows7881; - - // if (iconSize == UACShieldIconSize.Custom) - // { - // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsEightUacShieldImage); - // } - // else - // { - // UpdateShieldSize(iconSize, null, windowsEightUacShieldImage); - // } - //} - } - - #endregion - #region Splitter Stuff private static void PaintArrow(Graphics graphics, Rectangle rectangle) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs index d2e4f8ced..33d3d0798 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs @@ -95,7 +95,7 @@ private void InitializeComponent() this.kbtnOK.Name = "kbtnOK"; this.kbtnOK.Size = new System.Drawing.Size(90, 25); this.kbtnOK.TabIndex = 3; - this.kbtnOK.UseAsADialogButton = true; + this.kbtnOK.Values.UseAsADialogButton = true; this.kbtnOK.Values.Text = "O&K"; this.kbtnOK.Click += new System.EventHandler(this.kbtnOK_Click); // @@ -106,7 +106,7 @@ private void InitializeComponent() this.kbtnCancel.Name = "kbtnCancel"; this.kbtnCancel.Size = new System.Drawing.Size(90, 25); this.kbtnCancel.TabIndex = 2; - this.kbtnCancel.UseAsADialogButton = true; + this.kbtnCancel.Values.UseAsADialogButton = true; this.kbtnCancel.Values.Text = "Cance&l"; this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click); // diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index 0d54b7253..b952678f7 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -27,6 +27,8 @@ public class ButtonValues : Storage, private bool _showUACShield; private bool _useAsDialogButton; + private bool _useAsUACElevationButton; + private UACShieldIconSize _uacShieldIconSize; private Image? _image; private Color _transparent; private string? _text; @@ -254,6 +256,58 @@ public bool UseAsADialogButton #endregion + [DefaultValue(false), + Description(@"Transforms the button into a UAC elevated button.")] + public bool UseAsUACElevationButton + { + get => _useAsUACElevationButton; + set + { + _useAsUACElevationButton = value; + + switch (_uacShieldIconSize) + { + //if (_customUACShieldSize.Height > 0 && _customUACShieldSize.Width > 0) + //{ + // ShowUACShield(value, UACShieldIconSize.Custom, _customUACShieldSize.Width, _customUACShieldSize.Height); + //} + //else if (_uacShieldIconSize != UACShieldIconSize.Custom) + //{ + // ShowUACShield(value, _uacShieldIconSize); + //} + case UACShieldIconSize.ExtraSmall: + ShowUACShieldImage(value, UACShieldIconSize.ExtraSmall); + break; + case UACShieldIconSize.Small: + ShowUACShieldImage(value, UACShieldIconSize.Small); + break; + case UACShieldIconSize.Medium: + ShowUACShieldImage(value, UACShieldIconSize.Medium); + break; + case UACShieldIconSize.Large: + ShowUACShieldImage(value, UACShieldIconSize.Large); + break; + case UACShieldIconSize.ExtraLarge: + ShowUACShieldImage(value, UACShieldIconSize.ExtraLarge); + break; + default: + ShowUACShieldImage(value, UACShieldIconSize.ExtraSmall); + break; + } + } + } + + /* + [DefaultValue(false), Description(@"Use the operating system UAC shield icon image.")] + public bool UseOSUACShieldIcon { get => _useOSUACShieldIcon; set { _useOSUACShieldIcon = value; UpdateOSUACShieldIcon(); } } + + [DefaultValue(null), Description(@"")] + public Size CustomUACShieldSize { get => _customUACShieldSize; set { _customUACShieldSize = value; ShowUACShield(_useAsUACElevationButton, UACShieldIconSize.Custom, value.Width, value.Height); } } + */ + + [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")] + public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; set { _uacShieldIconSize = value; ShowUACShieldImage(_useAsUACElevationButton, value); } } + #region CreateImageStates /// /// Create the storage for the image states. @@ -296,5 +350,101 @@ public bool UseAsADialogButton public virtual string GetLongText() => ExtraText; #endregion + + #region UAC Stuff + + /// Shows the uac shield. + /// if set to true [show uac shield]. + /// Size of the shield icon. + /// The width. + /// The height. + private void ShowUACShieldImage(bool showUACShield, UACShieldIconSize? shieldIconSize = null, int? width = null, int? height = null) + { + if (showUACShield) + { + int h = height ?? 16, w = width ?? 16; + + Image shield = SystemIcons.Shield.ToBitmap(); + + switch (shieldIconSize) + { + //case UACShieldIconSize.Custom: + // Values.Image = GraphicsExtensions.ScaleImage(shield, w, h); + // break; + case UACShieldIconSize.ExtraSmall: + Image = GraphicsExtensions.ScaleImage(shield, 16, 16); + break; + case UACShieldIconSize.Small: + Image = GraphicsExtensions.ScaleImage(shield, 32, 32); + break; + case UACShieldIconSize.Medium: + Image = GraphicsExtensions.ScaleImage(shield, 64, 64); + break; + case UACShieldIconSize.Large: + Image = GraphicsExtensions.ScaleImage(shield, 128, 128); + break; + case UACShieldIconSize.ExtraLarge: + Image = GraphicsExtensions.ScaleImage(shield, 256, 256); + break; + case null: + Image = GraphicsExtensions.ScaleImage(shield, 16, 16); + break; + } + + //Invalidate(); + } + else + { + Image = null; + } + } + + /// Updates the UAC shield icon. + /// Size of the icon. + /// Size of the custom. + private void UpdateOSUACShieldIcon(UACShieldIconSize? iconSize = null, Size? customSize = null) + { + //if (OSUtilities.IsWindowsEleven) + //{ + // Image windowsElevenUacShieldImage = UACShieldIconResources.UACShieldWindows11; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsElevenUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsElevenUacShieldImage); + // } + //} + //else if (OSUtilities.IsWindowsTen) + //{ + // Image windowsTenUacShieldImage = UACShieldIconResources.UACShieldWindows10; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsTenUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsTenUacShieldImage); + // } + //} + //else if (OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight || OSUtilities.IsWindowsSeven) + //{ + // Image windowsEightUacShieldImage = UACShieldIconResources.UACShieldWindows7881; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsEightUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsEightUacShieldImage); + // } + //} + } + + #endregion } } From 81cfeaf845261208d70174fcc643c6e55c7b2251 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 08:39:29 +0000 Subject: [PATCH 08/16] * Addressed feedback --- README.md | 12 ++++ .../Controls Toolkit/KryptonButton.cs | 8 +-- .../KryptonCommandLinkButtonActionList.cs | 44 ++++++------- .../KryptonCommandLinkButtonDesigner.cs | 2 +- .../Krypton.Toolkit/Values/ButtonValues.cs | 66 +++++++++++++++++-- .../Values/CommandLinkImageValues.cs | 2 +- .../Values/CommandLinkMainTextValue.cs | 2 +- .../Values/CommandLinkSubscriptTextValue.cs | 2 +- .../Values/CommandLinkTextValues.cs | 2 +- .../View Draw/ViewDrawCommandLinkButton.cs | 2 +- 10 files changed, 103 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index ab354015c..b48d3da10 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ * [Discord Server](#discord-server) * [Version History](#version-history) * [Breaking Changes](#breaking-changes) + * [V90.## (2024-11-xx - Build 2411 - November 2024)](v90-24-11-xx--build-2411---november-2024) + * [Support for .NET 7](#support-for-net-7) + * [`KryptonButton` Properties](#kryptonbutton-properties) * [V80.## (2023-11-14 - Build 2311 - November 2023)](#v80-2023-11-14---build-2311---november-2023) * [Support for .NET Core 3.1 and .NET 5](#support-for-net-core-31-and-net-5) * [KryptonMessageBoxButtons](#kryptonmessageboxbuttons) @@ -172,6 +175,15 @@ Follow the links to see the different objects and layouts that this framework al # Breaking Changes +## V90.## (2024-11-xx - Build 2411 - November 2024) +There are list of changes that have occurred during the development of the V90.## version + +### Support for .NET 7 +As of V90.##, support for .NET 7 has been removed due to their release cadences. + +### `KryptonButton` Properties +Some properties previously found in the root such as, `ShowDropDown`, `ShowUACShield`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section. + ## V80.## (2023-11-14 - Build 2311 - November 2023) There are list of changes that have occurred during the development of the V80.## version diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index 35cc292d7..3cfa8211d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -45,11 +45,9 @@ public class KryptonButton : VisualSimpleBase, IButtonControl, IContentValues private readonly PaletteTripleOverride _overrideTracking; private readonly PaletteTripleOverride _overridePressed; private IKryptonCommand? _command; - private bool _useAsDialogButton; private bool _isDefault; private bool _useMnemonic; private bool _wasEnabled; - private bool _useAsUACElevationButton; private bool _skipNextOpen; private bool _showSplitOption; //private bool _useOSUACShieldIcon; @@ -135,10 +133,6 @@ public KryptonButton() // Create the view manager instance ViewManager = new ViewManager(this, _drawButton); - _useAsDialogButton = false; - - _useAsUACElevationButton = false; - _uacShieldIconSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_SIZE; //_useOSUACShieldIcon = false; @@ -662,7 +656,7 @@ protected override void OnClick(EventArgs e) // If we have an attached command then execute it KryptonCommand?.PerformExecute(); - if (_useAsUACElevationButton) + if (Values.UseAsUACElevationButton) { var rawUACShield = SystemIcons.Shield.ToBitmap(); diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs index 526e54f79..480071a6e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonCommandLinkButtonActionList.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion @@ -12,8 +12,8 @@ namespace Krypton.Toolkit internal class KryptonCommandLinkButtonActionList : DesignerActionList { #region Instance Fields - private readonly KryptonCommandLinkButton _button; - private readonly IComponentChangeService _service; + private readonly KryptonCommandLinkButton? _button; + private readonly IComponentChangeService? _service; #endregion #region Identity @@ -28,7 +28,7 @@ public KryptonCommandLinkButtonActionList(KryptonCommandLinkButtonDesigner owner _button = owner.Component as KryptonCommandLinkButton; // Cache service used to notify when a property has changed - _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); + _service = GetService(typeof(IComponentChangeService)) as IComponentChangeService; } #endregion @@ -38,13 +38,13 @@ public KryptonCommandLinkButtonActionList(KryptonCommandLinkButtonDesigner owner /// public ButtonStyle ButtonStyle { - get => _button.ButtonStyle; + get => _button!.ButtonStyle; set { - if (_button.ButtonStyle != value) + if (_button!.ButtonStyle != value) { - _service.OnComponentChanged(_button, null, _button.ButtonStyle, value); + _service?.OnComponentChanged(_button, null, _button.ButtonStyle, value); _button.ButtonStyle = value; } } @@ -55,13 +55,13 @@ public ButtonStyle ButtonStyle /// public VisualOrientation Orientation { - get => _button.Orientation; + get => _button!.Orientation; set { - if (_button.Orientation != value) + if (_button!.Orientation != value) { - _service.OnComponentChanged(_button, null, _button.Orientation, value); + _service?.OnComponentChanged(_button, null, _button.Orientation, value); _button.Orientation = value; } } @@ -72,13 +72,13 @@ public VisualOrientation Orientation /// public string Heading { - get => _button.CommandLinkTextValues.Heading; + get => _button!.CommandLinkTextValues.Heading; set { - if (_button.CommandLinkTextValues.Heading != value) + if (_button!.CommandLinkTextValues.Heading != value) { - _service.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Heading, value); + _service?.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Heading, value); _button.CommandLinkTextValues.Heading = value; } } @@ -89,13 +89,13 @@ public string Heading /// public string Description { - get => _button.CommandLinkTextValues.Description; + get => _button!.CommandLinkTextValues.Description; set { - if (_button.CommandLinkTextValues.Description != value) + if (_button!.CommandLinkTextValues.Description != value) { - _service.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Description, value); + _service?.OnComponentChanged(_button, null, _button.CommandLinkTextValues.Description, value); _button.CommandLinkTextValues.Description = value; } } @@ -106,13 +106,13 @@ public string Description /// public Image Image { - get => _button.CommandLinkImageValues.Image; + get => _button!.CommandLinkImageValues.Image; set { - if (_button.CommandLinkImageValues.Image != value) + if (_button!.CommandLinkImageValues.Image != value) { - _service.OnComponentChanged(_button, null, _button.CommandLinkImageValues.Image, value); + _service?.OnComponentChanged(_button, null, _button.CommandLinkImageValues.Image, value); _button.CommandLinkImageValues.Image = value; } } @@ -123,13 +123,13 @@ public Image Image /// public PaletteMode PaletteMode { - get => _button.PaletteMode; + get => _button!.PaletteMode; set { - if (_button.PaletteMode != value) + if (_button!.PaletteMode != value) { - _service.OnComponentChanged(_button, null, _button.PaletteMode, value); + _service?.OnComponentChanged(_button, null, _button.PaletteMode, value); _button.PaletteMode = value; } } diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs index a58cbccb6..53ad668de 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonCommandLinkButtonDesigner.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index b952678f7..fbb03b6f2 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -58,6 +58,10 @@ public ButtonValues(NeedPaintHandler needPaint) _transparent = Color.Empty; _text = _defaultText; _extraText = _defaultExtraText; + _showUACShield = false; + _useAsDialogButton = false; + _useAsUACElevationButton = false; + _uacShieldIconSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_SIZE; ImageStates = CreateImageStates(); ImageStates.NeedPaint = needPaint; } @@ -70,6 +74,10 @@ public ButtonValues(NeedPaintHandler needPaint) [Browsable(false)] public override bool IsDefault => ImageStates.IsDefault && (Image == null) && + (ShowUACShield == false) && + (UseAsADialogButton == false) && + (UseAsUACElevationButton == false) && + //(UACShieldIconSize == UACShieldIconSize.ExtraSmall) (ImageTransparentColor == Color.Empty) && (Text == _defaultText) && (ExtraText == _defaultExtraText); @@ -234,6 +242,8 @@ public bool ShowUACShield if (_showUACShield != value) { _showUACShield = value; + + PerformNeedPaint(true); } } } @@ -256,6 +266,8 @@ public bool UseAsADialogButton #endregion + #region UseAsUACElevationButton + [DefaultValue(false), Description(@"Transforms the button into a UAC elevated button.")] public bool UseAsUACElevationButton @@ -297,16 +309,61 @@ public bool UseAsUACElevationButton } } + #endregion + + #region UseOSUACShieldIcon + /* [DefaultValue(false), Description(@"Use the operating system UAC shield icon image.")] - public bool UseOSUACShieldIcon { get => _useOSUACShieldIcon; set { _useOSUACShieldIcon = value; UpdateOSUACShieldIcon(); } } + public bool UseOSUACShieldIcon + { + get => _useOSUACShieldIcon; + + set + { + _useOSUACShieldIcon = value; + UpdateOSUACShieldIcon(); + } + } + */ + + #endregion + + #region CustomUACShieldSize + + /* [DefaultValue(null), Description(@"")] - public Size CustomUACShieldSize { get => _customUACShieldSize; set { _customUACShieldSize = value; ShowUACShield(_useAsUACElevationButton, UACShieldIconSize.Custom, value.Width, value.Height); } } + public Size CustomUACShieldSize + { + get => _customUACShieldSize; + + set + { _customUACShieldSize = value; + + ShowUACShield(_useAsUACElevationButton, UACShieldIconSize.Custom, value.Width, value.Height); + } + } */ + #endregion + + #region UACShieldIconSize + [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")] - public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; set { _uacShieldIconSize = value; ShowUACShieldImage(_useAsUACElevationButton, value); } } + public UACShieldIconSize UACShieldIconSize + { + get => _uacShieldIconSize; + + set + { + _uacShieldIconSize = value; + + ShowUACShieldImage(_useAsUACElevationButton, value); + } + } + + #endregion #region CreateImageStates /// @@ -391,7 +448,8 @@ private void ShowUACShieldImage(bool showUACShield, UACShieldIconSize? shieldIco break; } - //Invalidate(); + // Force a repaint + PerformNeedPaint(true); } else { diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs index fb502378c..1a843d531 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs index 4cc2b5906..e28c385a4 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkMainTextValue.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs index ac8bc748f..c8f412725 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkSubscriptTextValue.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs index 99f44acb0..0fc04cab8 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkTextValues.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs index 663e02003..e3f460ff6 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCommandLinkButton.cs @@ -2,7 +2,7 @@ /* * * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2023. All rights reserved. + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. * */ #endregion From ffb0f46c0d46a97f6274d0d1458f4259d01aa0d7 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 08:53:17 +0000 Subject: [PATCH 09/16] * Fix fallout --- .../Controls Toolkit/KryptonButton.cs | 22 ++++++++++++++++++- .../Action Lists/KryptonButtonActionList.cs | 10 ++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index 3cfa8211d..6727def5d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -702,9 +702,10 @@ protected override bool ProcessMnemonic(char charCode) /// protected override void ContextMenuClosed() => _buttonController.RemoveFixed(); + /// protected override void OnPaint(PaintEventArgs? e) { - if (_useAsDialogButton) + if (Values.UseAsADialogButton) { if (DialogResult == DialogResult.Abort) { @@ -742,6 +743,25 @@ protected override void OnPaint(PaintEventArgs? e) } } + if (Values.ShowUACShield) + { + switch (Values.UACShieldIconSize) + { + case UACShieldIconSize.ExtraSmall: + break; + case UACShieldIconSize.Small: + break; + case UACShieldIconSize.Medium: + break; + case UACShieldIconSize.Large: + break; + case UACShieldIconSize.ExtraLarge: + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + base.OnPaint(e); #region Split Code diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonButtonActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonButtonActionList.cs index aa5d05d86..9970e127d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonButtonActionList.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonButtonActionList.cs @@ -228,19 +228,19 @@ public float StateCommonCornerRoundingRadius [DefaultValue(false)] public bool UseAsUACElevatedButton { - get => _button.UseAsUACElevationButton; + get => _button.Values.UseAsUACElevationButton; set { - if (_button.UseAsUACElevationButton != value) + if (_button.Values.UseAsUACElevationButton != value) { - _service.OnComponentChanged(_button, null, _button.UseAsUACElevationButton, value); + _service.OnComponentChanged(_button, null, _button.Values.UseAsUACElevationButton, value); - _button.UseAsUACElevationButton = value; + _button.Values.UseAsUACElevationButton = value; } } } - + #endregion #region Public Override From d5ef438c555d2e2f5b0f243a46ead7d7d479338a Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:00:52 +0000 Subject: [PATCH 10/16] * Remove `ShowUACShield`, as this wasn't doing anything --- README.md | 2 +- .../Controls Toolkit/KryptonButton.cs | 2 +- .../Krypton.Toolkit/Values/ButtonValues.cs | 26 ------------ .../TestForm/Form1.Designer.cs | 40 ++++++++++++++----- 4 files changed, 32 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index b48d3da10..42949ec00 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ There are list of changes that have occurred during the development of the V90.# As of V90.##, support for .NET 7 has been removed due to their release cadences. ### `KryptonButton` Properties -Some properties previously found in the root such as, `ShowDropDown`, `ShowUACShield`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section. +Some properties previously found in the root such as, `ShowDropDown`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section. ## V80.## (2023-11-14 - Build 2311 - November 2023) There are list of changes that have occurred during the development of the V80.## version diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index 6727def5d..4d47a53fb 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -743,7 +743,7 @@ protected override void OnPaint(PaintEventArgs? e) } } - if (Values.ShowUACShield) + if (Values.UseAsUACElevationButton) { switch (Values.UACShieldIconSize) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index fbb03b6f2..5382485b6 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -25,7 +25,6 @@ public class ButtonValues : Storage, #region Instance Fields - private bool _showUACShield; private bool _useAsDialogButton; private bool _useAsUACElevationButton; private UACShieldIconSize _uacShieldIconSize; @@ -58,7 +57,6 @@ public ButtonValues(NeedPaintHandler needPaint) _transparent = Color.Empty; _text = _defaultText; _extraText = _defaultExtraText; - _showUACShield = false; _useAsDialogButton = false; _useAsUACElevationButton = false; _uacShieldIconSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_SIZE; @@ -74,7 +72,6 @@ public ButtonValues(NeedPaintHandler needPaint) [Browsable(false)] public override bool IsDefault => ImageStates.IsDefault && (Image == null) && - (ShowUACShield == false) && (UseAsADialogButton == false) && (UseAsUACElevationButton == false) && //(UACShieldIconSize == UACShieldIconSize.ExtraSmall) @@ -231,29 +228,6 @@ public string ExtraText public void ResetExtraText() => ExtraText = _defaultExtraText; #endregion - #region ShowUACShield - - public bool ShowUACShield - { - get => _showUACShield; - - set - { - if (_showUACShield != value) - { - _showUACShield = value; - - PerformNeedPaint(true); - } - } - } - - private bool ShouldSerializeShowUACShield() => !ShowUACShield; - - public void ResetShowUACShield() => ShowUACShield = false; - - #endregion - #region UseAsADialogButton [DefaultValue(false), diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index 98791ed16..ef11d0c75 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -30,6 +30,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonButton9 = new Krypton.Toolkit.KryptonButton(); this.kryptonButton5 = new Krypton.Toolkit.KryptonButton(); this.kryptonButton8 = new Krypton.Toolkit.KryptonButton(); this.kcbtnSizableToolWindow = new Krypton.Toolkit.KryptonCheckButton(); @@ -77,7 +78,6 @@ private void InitializeComponent() this.kryptonManager1 = new Krypton.Toolkit.KryptonManager(this.components); this.kryptonCheckSet1 = new Krypton.Toolkit.KryptonCheckSet(this.components); this.kryptonTaskDialog1 = new Krypton.Toolkit.KryptonTaskDialog(); - this.kryptonButton9 = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); @@ -120,12 +120,23 @@ private void InitializeComponent() this.kryptonPanel1.Size = new System.Drawing.Size(1112, 752); this.kryptonPanel1.TabIndex = 0; // + // kryptonButton9 + // + this.kryptonButton9.Location = new System.Drawing.Point(15, 415); + this.kryptonButton9.Name = "kryptonButton9"; + this.kryptonButton9.Size = new System.Drawing.Size(183, 25); + this.kryptonButton9.TabIndex = 34; + this.kryptonButton9.Values.ShowUACShield = false; + this.kryptonButton9.Values.Text = "Command Links"; + this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click); + // // kryptonButton5 // this.kryptonButton5.Location = new System.Drawing.Point(15, 384); this.kryptonButton5.Name = "kryptonButton5"; this.kryptonButton5.Size = new System.Drawing.Size(183, 25); this.kryptonButton5.TabIndex = 33; + this.kryptonButton5.Values.ShowUACShield = false; this.kryptonButton5.Values.Text = "Task Dialog"; this.kryptonButton5.Click += new System.EventHandler(this.kryptonButton5_Click); // @@ -135,6 +146,7 @@ private void InitializeComponent() this.kryptonButton8.Name = "kryptonButton8"; this.kryptonButton8.Size = new System.Drawing.Size(183, 25); this.kryptonButton8.TabIndex = 32; + this.kryptonButton8.Values.ShowUACShield = false; this.kryptonButton8.Values.Text = "About Box"; this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click); // @@ -145,6 +157,7 @@ private void InitializeComponent() this.kcbtnSizableToolWindow.Name = "kcbtnSizableToolWindow"; this.kcbtnSizableToolWindow.Size = new System.Drawing.Size(141, 25); this.kcbtnSizableToolWindow.TabIndex = 31; + this.kcbtnSizableToolWindow.Values.ShowUACShield = false; this.kcbtnSizableToolWindow.Values.Text = "SizableToolWindow"; this.kcbtnSizableToolWindow.Click += new System.EventHandler(this.kcbtnSizableToolWindow_Click); // @@ -155,6 +168,7 @@ private void InitializeComponent() this.kcbtnFixedToolWindow.Name = "kcbtnFixedToolWindow"; this.kcbtnFixedToolWindow.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedToolWindow.TabIndex = 30; + this.kcbtnFixedToolWindow.Values.ShowUACShield = false; this.kcbtnFixedToolWindow.Values.Text = "FixedToolWindow"; this.kcbtnFixedToolWindow.Click += new System.EventHandler(this.kcbtnFixedToolWindow_Click); // @@ -165,6 +179,7 @@ private void InitializeComponent() this.kcbtnSizable.Name = "kcbtnSizable"; this.kcbtnSizable.Size = new System.Drawing.Size(141, 25); this.kcbtnSizable.TabIndex = 29; + this.kcbtnSizable.Values.ShowUACShield = false; this.kcbtnSizable.Values.Text = "Sizable"; this.kcbtnSizable.Click += new System.EventHandler(this.kcbtnSizable_Click); // @@ -175,6 +190,7 @@ private void InitializeComponent() this.kcbtnFixedDialog.Name = "kcbtnFixedDialog"; this.kcbtnFixedDialog.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedDialog.TabIndex = 28; + this.kcbtnFixedDialog.Values.ShowUACShield = false; this.kcbtnFixedDialog.Values.Text = "FixedDialog"; this.kcbtnFixedDialog.Click += new System.EventHandler(this.kcbtnFixedDialog_Click); // @@ -185,6 +201,7 @@ private void InitializeComponent() this.kcbtnFixed3D.Name = "kcbtnFixed3D"; this.kcbtnFixed3D.Size = new System.Drawing.Size(141, 25); this.kcbtnFixed3D.TabIndex = 27; + this.kcbtnFixed3D.Values.ShowUACShield = false; this.kcbtnFixed3D.Values.Text = "Fixed3D"; this.kcbtnFixed3D.Click += new System.EventHandler(this.kcbtnFixed3D_Click); // @@ -195,6 +212,7 @@ private void InitializeComponent() this.kcbtnFixedSingle.Name = "kcbtnFixedSingle"; this.kcbtnFixedSingle.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedSingle.TabIndex = 26; + this.kcbtnFixedSingle.Values.ShowUACShield = false; this.kcbtnFixedSingle.Values.Text = "FixedSingle"; this.kcbtnFixedSingle.Click += new System.EventHandler(this.kcbtnFixedSingle_Click); // @@ -205,6 +223,7 @@ private void InitializeComponent() this.kcbtnNone.Name = "kcbtnNone"; this.kcbtnNone.Size = new System.Drawing.Size(141, 25); this.kcbtnNone.TabIndex = 25; + this.kcbtnNone.Values.ShowUACShield = false; this.kcbtnNone.Values.Text = "None"; this.kcbtnNone.Click += new System.EventHandler(this.kcbtnNone_Click); // @@ -215,6 +234,7 @@ private void InitializeComponent() this.kryptonButton7.Name = "kryptonButton7"; this.kryptonButton7.Size = new System.Drawing.Size(90, 25); this.kryptonButton7.TabIndex = 17; + this.kryptonButton7.Values.ShowUACShield = false; this.kryptonButton7.Values.Text = "Export"; this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click); // @@ -225,6 +245,7 @@ private void InitializeComponent() this.kryptonButton6.Name = "kryptonButton6"; this.kryptonButton6.Size = new System.Drawing.Size(90, 25); this.kryptonButton6.TabIndex = 16; + this.kryptonButton6.Values.ShowUACShield = false; this.kryptonButton6.Values.Text = "Import"; this.kryptonButton6.Click += new System.EventHandler(this.kryptonButton6_Click); // @@ -235,6 +256,7 @@ private void InitializeComponent() this.kbtnExit.Name = "kbtnExit"; this.kbtnExit.Size = new System.Drawing.Size(90, 25); this.kbtnExit.TabIndex = 15; + this.kbtnExit.Values.ShowUACShield = false; this.kbtnExit.Values.Text = "Exit"; this.kbtnExit.Click += new System.EventHandler(this.kbtnExit_Click); // @@ -244,6 +266,7 @@ private void InitializeComponent() this.kryptonButton4.Name = "kryptonButton4"; this.kryptonButton4.Size = new System.Drawing.Size(185, 25); this.kryptonButton4.TabIndex = 14; + this.kryptonButton4.Values.ShowUACShield = false; this.kryptonButton4.Values.Text = "Form 4"; this.kryptonButton4.Click += new System.EventHandler(this.kryptonButton4_Click); // @@ -253,6 +276,7 @@ private void InitializeComponent() this.kbtnVisualStudio2010Theme.Name = "kbtnVisualStudio2010Theme"; this.kbtnVisualStudio2010Theme.Size = new System.Drawing.Size(184, 25); this.kbtnVisualStudio2010Theme.TabIndex = 13; + this.kbtnVisualStudio2010Theme.Values.ShowUACShield = false; this.kbtnVisualStudio2010Theme.Values.Text = "Visual Studio 2010 Theme (Form5)"; this.kbtnVisualStudio2010Theme.Click += new System.EventHandler(this.kbtnVisualStudio2010Theme_Click); // @@ -296,6 +320,7 @@ private void InitializeComponent() this.kryptonButton3.Name = "kryptonButton3"; this.kryptonButton3.Size = new System.Drawing.Size(184, 25); this.kryptonButton3.TabIndex = 9; + this.kryptonButton3.Values.ShowUACShield = false; this.kryptonButton3.Values.Text = "ThemeBrowser Form"; this.kryptonButton3.Click += new System.EventHandler(this.kryptonButton3_Click); // @@ -305,6 +330,7 @@ private void InitializeComponent() this.kbtnIntegratedToolbar.Name = "kbtnIntegratedToolbar"; this.kbtnIntegratedToolbar.Size = new System.Drawing.Size(184, 25); this.kbtnIntegratedToolbar.TabIndex = 8; + this.kbtnIntegratedToolbar.Values.ShowUACShield = false; this.kbtnIntegratedToolbar.Values.Text = "Integrated Toolbar (Form5)"; this.kbtnIntegratedToolbar.Click += new System.EventHandler(this.kbtnIntegratedToolbar_Click); // @@ -314,6 +340,7 @@ private void InitializeComponent() this.kbtnTestMessagebox.Name = "kbtnTestMessagebox"; this.kbtnTestMessagebox.Size = new System.Drawing.Size(185, 25); this.kbtnTestMessagebox.TabIndex = 7; + this.kbtnTestMessagebox.Values.ShowUACShield = false; this.kbtnTestMessagebox.Values.Text = "Test Messagebox"; this.kbtnTestMessagebox.Click += new System.EventHandler(this.kbtnTestMessagebox_Click); // @@ -323,6 +350,7 @@ private void InitializeComponent() this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(185, 25); this.kryptonButton2.TabIndex = 6; + this.kryptonButton2.Values.ShowUACShield = false; this.kryptonButton2.Values.Text = "Ribbon (Form3)"; this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click); // @@ -350,6 +378,7 @@ private void InitializeComponent() this.kryptonButton1.ShowSplitOption = true; this.kryptonButton1.Size = new System.Drawing.Size(185, 25); this.kryptonButton1.TabIndex = 5; + this.kryptonButton1.Values.ShowUACShield = false; this.kryptonButton1.Values.Text = "Button (form2)"; this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click); // @@ -481,15 +510,6 @@ private void InitializeComponent() this.kryptonTaskDialog1.UseNativeOSIcons = false; this.kryptonTaskDialog1.WindowTitle = null; // - // kryptonButton9 - // - this.kryptonButton9.Location = new System.Drawing.Point(15, 415); - this.kryptonButton9.Name = "kryptonButton9"; - this.kryptonButton9.Size = new System.Drawing.Size(183, 25); - this.kryptonButton9.TabIndex = 34; - this.kryptonButton9.Values.Text = "Command Links"; - this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); From a723761e4112cfb285ab026b29d476ea69eba7d6 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:06:46 +0000 Subject: [PATCH 11/16] * `ShowSplitOption` --- README.md | 2 +- .../Controls Toolkit/KryptonButton.cs | 9 ++---- .../Krypton.Toolkit/Values/ButtonValues.cs | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 42949ec00..205562ff3 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ There are list of changes that have occurred during the development of the V90.# As of V90.##, support for .NET 7 has been removed due to their release cadences. ### `KryptonButton` Properties -Some properties previously found in the root such as, `ShowDropDown`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section. +Some properties previously found in the root such as, `ShowSplitOption`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section. ## V80.## (2023-11-14 - Build 2311 - November 2023) There are list of changes that have occurred during the development of the V80.## version diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index 4d47a53fb..b0e9f9dbd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -49,7 +49,7 @@ public class KryptonButton : VisualSimpleBase, IButtonControl, IContentValues private bool _useMnemonic; private bool _wasEnabled; private bool _skipNextOpen; - private bool _showSplitOption; + //private bool _showSplitOption; //private bool _useOSUACShieldIcon; private float _cornerRoundingRadius; private Size _customUACShieldSize; @@ -142,9 +142,6 @@ public KryptonButton() // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1) CornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE; - // Split settings - _showSplitOption = false; - _skipNextOpen = false; _dropDownRectangle = new Rectangle(); @@ -479,7 +476,7 @@ public virtual void SetFixedState(PaletteState state) set => base.ImeMode = value; } - /// Gets or sets a value indicating whether [show split option]. + /*/// Gets or sets a value indicating whether [show split option]. /// true if [show split option]; otherwise, false. [Category(@"Visuals")] [DefaultValue(false)] @@ -499,7 +496,7 @@ public bool ShowSplitOption Parent?.PerformLayout(); } } - } + }*/ #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs index 5382485b6..183a13ede 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs @@ -10,6 +10,8 @@ */ #endregion +using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox; + namespace Krypton.Toolkit { /// @@ -27,6 +29,7 @@ public class ButtonValues : Storage, private bool _useAsDialogButton; private bool _useAsUACElevationButton; + private bool _showSplitOption; private UACShieldIconSize _uacShieldIconSize; private Image? _image; private Color _transparent; @@ -59,6 +62,7 @@ public ButtonValues(NeedPaintHandler needPaint) _extraText = _defaultExtraText; _useAsDialogButton = false; _useAsUACElevationButton = false; + _showSplitOption = false; _uacShieldIconSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_SIZE; ImageStates = CreateImageStates(); ImageStates.NeedPaint = needPaint; @@ -74,6 +78,7 @@ public ButtonValues(NeedPaintHandler needPaint) (Image == null) && (UseAsADialogButton == false) && (UseAsUACElevationButton == false) && + (ShowSplitOption == false) && //(UACShieldIconSize == UACShieldIconSize.ExtraSmall) (ImageTransparentColor == Color.Empty) && (Text == _defaultText) && @@ -339,6 +344,32 @@ public UACShieldIconSize UACShieldIconSize #endregion + #region ShowSpltOption + + /// Gets or sets a value indicating whether [show split option]. + /// true if [show split option]; otherwise, false. + [Category(@"Visuals")] + [DefaultValue(false)] + [Description(@"Displays the split/dropdown option.")] + public bool ShowSplitOption + { + get => _showSplitOption; + + set + { + if (value != _showSplitOption) + { + _showSplitOption = value; + + PerformNeedPaint(true); + + //Parent?.PerformLayout(); + } + } + } + + #endregion + #region CreateImageStates /// /// Create the storage for the image states. From 5cc29a53e3852795dcb84e2314adb5bc254cc8ec Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:15:47 +0000 Subject: [PATCH 12/16] * Fix fallout 2 --- .../Controls Toolkit/KryptonButton.cs | 15 ++++++----- .../TestForm/Form1.Designer.cs | 26 +++---------------- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs index b0e9f9dbd..48c9d9a48 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs @@ -531,11 +531,12 @@ public Color GetImageTransparentColor(PaletteState state) => #region Public Overrides + /// public override Size GetPreferredSize(Size proposedSize) { Size preferredSize = base.GetPreferredSize(proposedSize); - if (_showSplitOption && !string.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + DEFAULT_PUSH_BUTTON_WIDTH > preferredSize.Width) + if (Values.ShowSplitOption && !string.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + DEFAULT_PUSH_BUTTON_WIDTH > preferredSize.Width) { return preferredSize + new Size(DEFAULT_PUSH_BUTTON_WIDTH + BORDER_SIZE * 2, 0); } @@ -763,12 +764,12 @@ protected override void OnPaint(PaintEventArgs? e) #region Split Code - if (!_showSplitOption) + if (!Values.ShowSplitOption) { return; } - Graphics g = e.Graphics; + Graphics g = e?.Graphics!; Rectangle bounds = ClientRectangle; @@ -816,7 +817,7 @@ protected override void OnPaint(PaintEventArgs? e) protected override bool IsInputKey(Keys keyData) { - if (keyData.Equals(Keys.Down) && _showSplitOption) + if (keyData.Equals(Keys.Down) && Values.ShowSplitOption) { return true; } @@ -828,7 +829,7 @@ protected override bool IsInputKey(Keys keyData) protected override void OnKeyDown(KeyEventArgs e) { - if (_showSplitOption && e.KeyCode.Equals(Keys.Down)) + if (Values.ShowSplitOption && e.KeyCode.Equals(Keys.Down)) { ShowContextMenuStrip(); } @@ -838,7 +839,7 @@ protected override void OnKeyDown(KeyEventArgs e) protected override void OnMouseDown(MouseEventArgs e) { - if (!_showSplitOption) + if (!Values.ShowSplitOption) { base.OnMouseDown(e); return; @@ -856,7 +857,7 @@ protected override void OnMouseDown(MouseEventArgs e) protected override void OnMouseUp(MouseEventArgs e) { - if (!_showSplitOption) + if (!Values.ShowSplitOption) { base.OnMouseUp(e); diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index ef11d0c75..dcdc828c5 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -126,7 +126,6 @@ private void InitializeComponent() this.kryptonButton9.Name = "kryptonButton9"; this.kryptonButton9.Size = new System.Drawing.Size(183, 25); this.kryptonButton9.TabIndex = 34; - this.kryptonButton9.Values.ShowUACShield = false; this.kryptonButton9.Values.Text = "Command Links"; this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click); // @@ -136,7 +135,6 @@ private void InitializeComponent() this.kryptonButton5.Name = "kryptonButton5"; this.kryptonButton5.Size = new System.Drawing.Size(183, 25); this.kryptonButton5.TabIndex = 33; - this.kryptonButton5.Values.ShowUACShield = false; this.kryptonButton5.Values.Text = "Task Dialog"; this.kryptonButton5.Click += new System.EventHandler(this.kryptonButton5_Click); // @@ -146,7 +144,6 @@ private void InitializeComponent() this.kryptonButton8.Name = "kryptonButton8"; this.kryptonButton8.Size = new System.Drawing.Size(183, 25); this.kryptonButton8.TabIndex = 32; - this.kryptonButton8.Values.ShowUACShield = false; this.kryptonButton8.Values.Text = "About Box"; this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click); // @@ -157,7 +154,6 @@ private void InitializeComponent() this.kcbtnSizableToolWindow.Name = "kcbtnSizableToolWindow"; this.kcbtnSizableToolWindow.Size = new System.Drawing.Size(141, 25); this.kcbtnSizableToolWindow.TabIndex = 31; - this.kcbtnSizableToolWindow.Values.ShowUACShield = false; this.kcbtnSizableToolWindow.Values.Text = "SizableToolWindow"; this.kcbtnSizableToolWindow.Click += new System.EventHandler(this.kcbtnSizableToolWindow_Click); // @@ -168,7 +164,6 @@ private void InitializeComponent() this.kcbtnFixedToolWindow.Name = "kcbtnFixedToolWindow"; this.kcbtnFixedToolWindow.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedToolWindow.TabIndex = 30; - this.kcbtnFixedToolWindow.Values.ShowUACShield = false; this.kcbtnFixedToolWindow.Values.Text = "FixedToolWindow"; this.kcbtnFixedToolWindow.Click += new System.EventHandler(this.kcbtnFixedToolWindow_Click); // @@ -179,7 +174,6 @@ private void InitializeComponent() this.kcbtnSizable.Name = "kcbtnSizable"; this.kcbtnSizable.Size = new System.Drawing.Size(141, 25); this.kcbtnSizable.TabIndex = 29; - this.kcbtnSizable.Values.ShowUACShield = false; this.kcbtnSizable.Values.Text = "Sizable"; this.kcbtnSizable.Click += new System.EventHandler(this.kcbtnSizable_Click); // @@ -190,7 +184,6 @@ private void InitializeComponent() this.kcbtnFixedDialog.Name = "kcbtnFixedDialog"; this.kcbtnFixedDialog.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedDialog.TabIndex = 28; - this.kcbtnFixedDialog.Values.ShowUACShield = false; this.kcbtnFixedDialog.Values.Text = "FixedDialog"; this.kcbtnFixedDialog.Click += new System.EventHandler(this.kcbtnFixedDialog_Click); // @@ -201,7 +194,6 @@ private void InitializeComponent() this.kcbtnFixed3D.Name = "kcbtnFixed3D"; this.kcbtnFixed3D.Size = new System.Drawing.Size(141, 25); this.kcbtnFixed3D.TabIndex = 27; - this.kcbtnFixed3D.Values.ShowUACShield = false; this.kcbtnFixed3D.Values.Text = "Fixed3D"; this.kcbtnFixed3D.Click += new System.EventHandler(this.kcbtnFixed3D_Click); // @@ -212,7 +204,6 @@ private void InitializeComponent() this.kcbtnFixedSingle.Name = "kcbtnFixedSingle"; this.kcbtnFixedSingle.Size = new System.Drawing.Size(141, 25); this.kcbtnFixedSingle.TabIndex = 26; - this.kcbtnFixedSingle.Values.ShowUACShield = false; this.kcbtnFixedSingle.Values.Text = "FixedSingle"; this.kcbtnFixedSingle.Click += new System.EventHandler(this.kcbtnFixedSingle_Click); // @@ -223,7 +214,6 @@ private void InitializeComponent() this.kcbtnNone.Name = "kcbtnNone"; this.kcbtnNone.Size = new System.Drawing.Size(141, 25); this.kcbtnNone.TabIndex = 25; - this.kcbtnNone.Values.ShowUACShield = false; this.kcbtnNone.Values.Text = "None"; this.kcbtnNone.Click += new System.EventHandler(this.kcbtnNone_Click); // @@ -234,7 +224,6 @@ private void InitializeComponent() this.kryptonButton7.Name = "kryptonButton7"; this.kryptonButton7.Size = new System.Drawing.Size(90, 25); this.kryptonButton7.TabIndex = 17; - this.kryptonButton7.Values.ShowUACShield = false; this.kryptonButton7.Values.Text = "Export"; this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click); // @@ -245,7 +234,6 @@ private void InitializeComponent() this.kryptonButton6.Name = "kryptonButton6"; this.kryptonButton6.Size = new System.Drawing.Size(90, 25); this.kryptonButton6.TabIndex = 16; - this.kryptonButton6.Values.ShowUACShield = false; this.kryptonButton6.Values.Text = "Import"; this.kryptonButton6.Click += new System.EventHandler(this.kryptonButton6_Click); // @@ -256,7 +244,6 @@ private void InitializeComponent() this.kbtnExit.Name = "kbtnExit"; this.kbtnExit.Size = new System.Drawing.Size(90, 25); this.kbtnExit.TabIndex = 15; - this.kbtnExit.Values.ShowUACShield = false; this.kbtnExit.Values.Text = "Exit"; this.kbtnExit.Click += new System.EventHandler(this.kbtnExit_Click); // @@ -266,7 +253,6 @@ private void InitializeComponent() this.kryptonButton4.Name = "kryptonButton4"; this.kryptonButton4.Size = new System.Drawing.Size(185, 25); this.kryptonButton4.TabIndex = 14; - this.kryptonButton4.Values.ShowUACShield = false; this.kryptonButton4.Values.Text = "Form 4"; this.kryptonButton4.Click += new System.EventHandler(this.kryptonButton4_Click); // @@ -276,7 +262,6 @@ private void InitializeComponent() this.kbtnVisualStudio2010Theme.Name = "kbtnVisualStudio2010Theme"; this.kbtnVisualStudio2010Theme.Size = new System.Drawing.Size(184, 25); this.kbtnVisualStudio2010Theme.TabIndex = 13; - this.kbtnVisualStudio2010Theme.Values.ShowUACShield = false; this.kbtnVisualStudio2010Theme.Values.Text = "Visual Studio 2010 Theme (Form5)"; this.kbtnVisualStudio2010Theme.Click += new System.EventHandler(this.kbtnVisualStudio2010Theme_Click); // @@ -320,7 +305,6 @@ private void InitializeComponent() this.kryptonButton3.Name = "kryptonButton3"; this.kryptonButton3.Size = new System.Drawing.Size(184, 25); this.kryptonButton3.TabIndex = 9; - this.kryptonButton3.Values.ShowUACShield = false; this.kryptonButton3.Values.Text = "ThemeBrowser Form"; this.kryptonButton3.Click += new System.EventHandler(this.kryptonButton3_Click); // @@ -330,7 +314,6 @@ private void InitializeComponent() this.kbtnIntegratedToolbar.Name = "kbtnIntegratedToolbar"; this.kbtnIntegratedToolbar.Size = new System.Drawing.Size(184, 25); this.kbtnIntegratedToolbar.TabIndex = 8; - this.kbtnIntegratedToolbar.Values.ShowUACShield = false; this.kbtnIntegratedToolbar.Values.Text = "Integrated Toolbar (Form5)"; this.kbtnIntegratedToolbar.Click += new System.EventHandler(this.kbtnIntegratedToolbar_Click); // @@ -340,7 +323,6 @@ private void InitializeComponent() this.kbtnTestMessagebox.Name = "kbtnTestMessagebox"; this.kbtnTestMessagebox.Size = new System.Drawing.Size(185, 25); this.kbtnTestMessagebox.TabIndex = 7; - this.kbtnTestMessagebox.Values.ShowUACShield = false; this.kbtnTestMessagebox.Values.Text = "Test Messagebox"; this.kbtnTestMessagebox.Click += new System.EventHandler(this.kbtnTestMessagebox_Click); // @@ -350,7 +332,6 @@ private void InitializeComponent() this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(185, 25); this.kryptonButton2.TabIndex = 6; - this.kryptonButton2.Values.ShowUACShield = false; this.kryptonButton2.Values.Text = "Ribbon (Form3)"; this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click); // @@ -362,8 +343,8 @@ private void InitializeComponent() this.kryptonThemeComboBox1.Location = new System.Drawing.Point(12, 12); this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1"; this.kryptonThemeComboBox1.Size = new System.Drawing.Size(185, 21); - this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; this.kryptonThemeComboBox1.TabIndex = 4; @@ -375,10 +356,9 @@ private void InitializeComponent() this.kryptonButton1.KryptonContextMenu = this.kryptonContextMenu1; this.kryptonButton1.Location = new System.Drawing.Point(12, 132); this.kryptonButton1.Name = "kryptonButton1"; - this.kryptonButton1.ShowSplitOption = true; + this.kryptonButton1.Values.ShowSplitOption = true; this.kryptonButton1.Size = new System.Drawing.Size(185, 25); this.kryptonButton1.TabIndex = 5; - this.kryptonButton1.Values.ShowUACShield = false; this.kryptonButton1.Values.Text = "Button (form2)"; this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click); // From ed4c8280ae0d539b14bd0d087f53c3807fd1f6f6 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:27:16 +0000 Subject: [PATCH 13/16] * Demo options --- .../TestForm/Form1.Designer.cs | 9 ++++++--- Source/Krypton Components/TestForm/Form1.resx | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index dcdc828c5..c1328b9ed 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -29,6 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); this.kryptonButton9 = new Krypton.Toolkit.KryptonButton(); this.kryptonButton5 = new Krypton.Toolkit.KryptonButton(); @@ -332,7 +333,9 @@ private void InitializeComponent() this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(185, 25); this.kryptonButton2.TabIndex = 6; + this.kryptonButton2.Values.Image = ((System.Drawing.Image)(resources.GetObject("kryptonButton2.Values.Image"))); this.kryptonButton2.Values.Text = "Ribbon (Form3)"; + this.kryptonButton2.Values.UseAsUACElevationButton = true; this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click); // // kryptonThemeComboBox1 @@ -343,8 +346,8 @@ private void InitializeComponent() this.kryptonThemeComboBox1.Location = new System.Drawing.Point(12, 12); this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1"; this.kryptonThemeComboBox1.Size = new System.Drawing.Size(185, 21); - this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; this.kryptonThemeComboBox1.TabIndex = 4; @@ -356,9 +359,9 @@ private void InitializeComponent() this.kryptonButton1.KryptonContextMenu = this.kryptonContextMenu1; this.kryptonButton1.Location = new System.Drawing.Point(12, 132); this.kryptonButton1.Name = "kryptonButton1"; - this.kryptonButton1.Values.ShowSplitOption = true; this.kryptonButton1.Size = new System.Drawing.Size(185, 25); this.kryptonButton1.TabIndex = 5; + this.kryptonButton1.Values.ShowSplitOption = true; this.kryptonButton1.Values.Text = "Button (form2)"; this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click); // diff --git a/Source/Krypton Components/TestForm/Form1.resx b/Source/Krypton Components/TestForm/Form1.resx index a8a986400..558f5cc03 100644 --- a/Source/Krypton Components/TestForm/Form1.resx +++ b/Source/Krypton Components/TestForm/Form1.resx @@ -117,6 +117,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAK/SURBVDhPrZJbSNNRHMfPLrDmcpuFS21u5jTNwjShBwl8 + iMKHeojyyfcgetOox9HLSKdmoYE1N28tZqSUZgmW5W3et7Y551Jzw43N4X95hUT/387mIKioHvrAl3P7 + fb/8zuGQP3GtulrYb1AeiC3/nXy9/XKWMdhVaJoO+ayHAruzpGd1gFccO/6VQt1QfH7dlDK3YepqbrPb + mNPuh6p7DwVdS9j2JAAhgl0nB2tmTnugj3cl2CFQjbYScdRcpDYcONXkcuaYfOvZJj+yXm1B9TwEuXEV + ee2zYJw0wE2ABaplDvYcXHyzcTaZj1wXIte7dL0h7njT/KaKGtNNK0h76kdamx8pLSHkGp0IO6SAi4B1 + RsSJzuEl2BzhbvWrEw9GAzJ1c6tK0yqUrT5W0bIMRfMyZIYgTrbOgLHSgBlqthOWtXPA2mjAHMHGADfc + W05ENEAdp3jkDie1rUHWGGRluiASdQGIGxio9C5sWESAgwbYCAsrNX+imiXY7idMb/kRESkpKeHl1w+6 + ThjnkW1wIFtvR1ajDelPXCgwDMNrTkV4UoLwONVYRGJ8tUrg6ZHOqYsIP/qQX14fblp3JYCZkIIZl7LM + WHSEZ0SOM48HoKh3QFVvQXrdNI5RZercyLvb2RY1R9h4QS5gjLZG78dO0lYn6ThF2C2zEPKHdvC1QQir + vBBqvRDUBCDVuJF4493FmH2flQ5+M+xcYJy+tJlqlCA8KIaydgqCCg/iKz5DpF2E9L4P8rK3LTHbDyxq + iZTp5A3BFjFTDdOADxKkVk2Ar1mC8N4C4mv8SLrVN3y2VL3/iX7GqhXJgiZ+N0YjndCA92IkV4yDaPwQ + axaRXNb7JqekMilW/nseFGcI/AaeZruL7OwMSpBSZYfwtmX36M2XlcUZGYJY2d/x1ZJzDn3y6Ok7pgFZ + 6bPzse3/DSHfAf2EqkKNe37BAAAAAElFTkSuQmCC + + 539, 16 From 2bfc63c8da2364ce69bd459df863d56fe3504731 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:42:22 +0000 Subject: [PATCH 14/16] Update CommandLinkImageValues.cs --- .../Values/CommandLinkImageValues.cs | 167 +++++++++++++++++- 1 file changed, 160 insertions(+), 7 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs index 1a843d531..6f1bdb533 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs @@ -19,15 +19,52 @@ public class CommandLinkImageValues : Storage, IContentValues #region Instance Fields + private bool _displayUACShield; + private Color _transparencyKey; - private Image _image; + private Image? _image; + + private UACShieldIconSize _uacShieldIconSize; #endregion #region Public - //public bool ShowUACShield { get; set; } + public bool DisplayUACShield + { + get => _displayUACShield; + + set + { + if (_displayUACShield != value) + { + _displayUACShield = value; + + switch (_uacShieldIconSize) + { + case UACShieldIconSize.ExtraSmall: + ShowUACShieldImage(value, UACShieldIconSize.ExtraSmall); + break; + case UACShieldIconSize.Small: + ShowUACShieldImage(value, UACShieldIconSize.Small); + break; + case UACShieldIconSize.Medium: + ShowUACShieldImage(value, UACShieldIconSize.Medium); + break; + case UACShieldIconSize.Large: + ShowUACShieldImage(value, UACShieldIconSize.Large); + break; + case UACShieldIconSize.ExtraLarge: + ShowUACShieldImage(value, UACShieldIconSize.ExtraLarge); + break; + default: + ShowUACShieldImage(value, UACShieldIconSize.ExtraSmall); + break; + } + } + } + } /// Gets and sets the heading image transparent color. [Localizable(true)] @@ -60,7 +97,7 @@ public Color ImageTransparentColor [Category("Visuals")] [Description("The image.")] [RefreshProperties(RefreshProperties.All)] - public Image Image + public Image? Image { get => _image; set @@ -78,6 +115,19 @@ public Image Image public void ResetImage() => Image = DEFAULT_IMAGE; + [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")] + public UACShieldIconSize UACShieldIconSize + { + get => _uacShieldIconSize; + + set + { + _uacShieldIconSize = value; + + ShowUACShieldImage(_displayUACShield, value); + } + } + #endregion #region Identity @@ -88,9 +138,17 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) { NeedPaint = needPaint; - ResetImage(); + _displayUACShield = false; + + _uacShieldIconSize = UACShieldIconSize.Medium; - ResetImageTransparentColor(); + _image = DEFAULT_IMAGE; + + _transparencyKey = Color.Empty; + + //ResetImage(); + + //ResetImageTransparentColor(); } #endregion @@ -99,8 +157,10 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) /// [Browsable(false)] - public override bool IsDefault => ((Image == DEFAULT_IMAGE) && - (ImageTransparentColor == Color.Empty)); + public override bool IsDefault => (DisplayUACShield.Equals(false) && + Image!.Equals(DEFAULT_IMAGE) && + ImageTransparentColor.Equals(Color.Empty) && + UACShieldIconSize.Equals(UACShieldIconSize.Medium)); #endregion @@ -118,6 +178,99 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) /// public string GetLongText() => string.Empty; + /// Shows the uac shield. + /// if set to true [show uac shield]. + /// Size of the shield icon. + /// The width. + /// The height. + private void ShowUACShieldImage(bool showUACShield, UACShieldIconSize? shieldIconSize = null, int? width = null, int? height = null) + { + if (showUACShield) + { + int h = height ?? 16, w = width ?? 16; + + Image shield = SystemIcons.Shield.ToBitmap(); + + switch (shieldIconSize) + { + //case UACShieldIconSize.Custom: + // Values.Image = GraphicsExtensions.ScaleImage(shield, w, h); + // break; + case UACShieldIconSize.ExtraSmall: + Image = GraphicsExtensions.ScaleImage(shield, 16, 16); + break; + case UACShieldIconSize.Small: + Image = GraphicsExtensions.ScaleImage(shield, 32, 32); + break; + case UACShieldIconSize.Medium: + Image = GraphicsExtensions.ScaleImage(shield, 64, 64); + break; + case UACShieldIconSize.Large: + Image = GraphicsExtensions.ScaleImage(shield, 128, 128); + break; + case UACShieldIconSize.ExtraLarge: + Image = GraphicsExtensions.ScaleImage(shield, 256, 256); + break; + case null: + Image = GraphicsExtensions.ScaleImage(shield, 16, 16); + break; + } + + // Force a repaint + PerformNeedPaint(true); + } + else + { + Image = null; + } + } + + /// Updates the UAC shield icon. + /// Size of the icon. + /// Size of the custom. + private void UpdateOSUACShieldIcon(UACShieldIconSize? iconSize = null, Size? customSize = null) + { + //if (OSUtilities.IsWindowsEleven) + //{ + // Image windowsElevenUacShieldImage = UACShieldIconResources.UACShieldWindows11; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsElevenUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsElevenUacShieldImage); + // } + //} + //else if (OSUtilities.IsWindowsTen) + //{ + // Image windowsTenUacShieldImage = UACShieldIconResources.UACShieldWindows10; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsTenUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsTenUacShieldImage); + // } + //} + //else if (OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight || OSUtilities.IsWindowsSeven) + //{ + // Image windowsEightUacShieldImage = UACShieldIconResources.UACShieldWindows7881; + + // if (iconSize == UACShieldIconSize.Custom) + // { + // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsEightUacShieldImage); + // } + // else + // { + // UpdateShieldSize(iconSize, null, windowsEightUacShieldImage); + // } + //} + } + #endregion } } \ No newline at end of file From e1f602c90ecd34b1619a3b8911bcb2757c832752 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:46:27 +0000 Subject: [PATCH 15/16] * Tesing --- .../Values/CommandLinkImageValues.cs | 14 +- .../TestForm/Form7.Designer.cs | 241 +++++++++--------- Source/Krypton Components/TestForm/Form7.resx | 4 +- 3 files changed, 134 insertions(+), 125 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs index 6f1bdb533..9919f76f0 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs @@ -115,7 +115,7 @@ public Image? Image public void ResetImage() => Image = DEFAULT_IMAGE; - [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")] + [DefaultValue(UACShieldIconSize.Small), Description(@"")] public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; @@ -140,15 +140,15 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) _displayUACShield = false; - _uacShieldIconSize = UACShieldIconSize.Medium; + _uacShieldIconSize = UACShieldIconSize.Small; - _image = DEFAULT_IMAGE; + //_image = DEFAULT_IMAGE; - _transparencyKey = Color.Empty; + //_transparencyKey = Color.Empty; - //ResetImage(); + ResetImage(); - //ResetImageTransparentColor(); + ResetImageTransparentColor(); } #endregion @@ -160,7 +160,7 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) public override bool IsDefault => (DisplayUACShield.Equals(false) && Image!.Equals(DEFAULT_IMAGE) && ImageTransparentColor.Equals(Color.Empty) && - UACShieldIconSize.Equals(UACShieldIconSize.Medium)); + UACShieldIconSize.Equals(UACShieldIconSize.Small)); #endregion diff --git a/Source/Krypton Components/TestForm/Form7.Designer.cs b/Source/Krypton Components/TestForm/Form7.Designer.cs index adb4e6f90..601d117bd 100644 --- a/Source/Krypton Components/TestForm/Form7.Designer.cs +++ b/Source/Krypton Components/TestForm/Form7.Designer.cs @@ -30,12 +30,12 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form7)); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonCommandLinkButton1 = new Krypton.Toolkit.KryptonCommandLinkButton(); - this.kryptonAlternateCommandLinkButton1 = new Krypton.Toolkit.KryptonAlternateCommandLinkButton(); - this.kryptonCommandLinkButton2 = new Krypton.Toolkit.KryptonCommandLinkButton(); - this.kryptonCommandLinkButton3 = new Krypton.Toolkit.KryptonCommandLinkButton(); - this.kryptonCommandLinkButton4 = new Krypton.Toolkit.KryptonCommandLinkButton(); this.kryptonCommandLinkButton5 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton4 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton3 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonCommandLinkButton2 = new Krypton.Toolkit.KryptonCommandLinkButton(); + this.kryptonAlternateCommandLinkButton1 = new Krypton.Toolkit.KryptonAlternateCommandLinkButton(); + this.kryptonCommandLinkButton1 = new Krypton.Toolkit.KryptonCommandLinkButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); @@ -54,77 +54,91 @@ private void InitializeComponent() this.kryptonPanel1.Size = new System.Drawing.Size(690, 386); this.kryptonPanel1.TabIndex = 0; // - // kryptonCommandLinkButton1 + // kryptonCommandLinkButton5 // - this.kryptonCommandLinkButton1.CommandLinkTextValues.Description = "Here be the \"Note Text\""; - this.kryptonCommandLinkButton1.CommandLinkTextValues.Heading = "Default Ext Command Link"; - this.kryptonCommandLinkButton1.Location = new System.Drawing.Point(12, 99); - this.kryptonCommandLinkButton1.Name = "kryptonCommandLinkButton1"; - this.kryptonCommandLinkButton1.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton1.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonCommandLinkButton5.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; + this.kryptonCommandLinkButton5.CommandLinkImageValues.DisplayUACShield = false; + this.kryptonCommandLinkButton5.CommandLinkImageValues.Image = null; + this.kryptonCommandLinkButton5.CommandLinkTextValues.Description = "What happens when the text is really long, \r\nand wants to go off the edge?\r\nThen " + + "Use a Multi-line ;-)\r\n"; + this.kryptonCommandLinkButton5.CommandLinkTextValues.Heading = "&Control the World"; + this.kryptonCommandLinkButton5.Location = new System.Drawing.Point(359, 12); + this.kryptonCommandLinkButton5.Name = "kryptonCommandLinkButton5"; + this.kryptonCommandLinkButton5.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton1.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton1.Size = new System.Drawing.Size(341, 61); - this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; - this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonCommandLinkButton1.TabIndex = 0; - // - // kryptonAlternateCommandLinkButton1 - // - this.kryptonAlternateCommandLinkButton1.Location = new System.Drawing.Point(12, 12); - this.kryptonAlternateCommandLinkButton1.Name = "kryptonAlternateCommandLinkButton1"; - this.kryptonAlternateCommandLinkButton1.Size = new System.Drawing.Size(341, 69); - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonAlternateCommandLinkButton1.TabIndex = 1; - this.kryptonAlternateCommandLinkButton1.Values.ExtraText = "Text here is forced in to the lower part of the button"; - this.kryptonAlternateCommandLinkButton1.Values.Image = ((System.Drawing.Image)(resources.GetObject("kryptonAlternateCommandLinkButton1.Values.Image"))); - this.kryptonAlternateCommandLinkButton1.Values.Text = "Normal Krypton Button"; + this.kryptonCommandLinkButton5.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.Size = new System.Drawing.Size(319, 86); + this.kryptonCommandLinkButton5.StateCommon.Back.Color1 = System.Drawing.SystemColors.GradientActiveCaption; + this.kryptonCommandLinkButton5.StateCommon.Back.Color2 = System.Drawing.SystemColors.ActiveCaption; + this.kryptonCommandLinkButton5.StateCommon.Back.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.StateCommon.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.kryptonCommandLinkButton5.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton5.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton5.StateCommon.Border.Rounding = 6F; + this.kryptonCommandLinkButton5.StateCommon.Border.Width = 2; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton5.StateCommon.Content.LongText.Trim = Krypton.Toolkit.PaletteTextTrim.Word; + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton5.TabIndex = 5; // - // kryptonCommandLinkButton2 + // kryptonCommandLinkButton4 // - this.kryptonCommandLinkButton2.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; - this.kryptonCommandLinkButton2.CommandLinkTextValues.Description = " Here be the extra Text with some spaces"; - this.kryptonCommandLinkButton2.CommandLinkTextValues.Heading = "Standalone Style"; - this.kryptonCommandLinkButton2.Location = new System.Drawing.Point(12, 180); - this.kryptonCommandLinkButton2.Name = "kryptonCommandLinkButton2"; - this.kryptonCommandLinkButton2.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton2.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonCommandLinkButton4.ButtonStyle = Krypton.Toolkit.ButtonStyle.NavigatorMini; + this.kryptonCommandLinkButton4.CommandLinkImageValues.DisplayUACShield = false; + this.kryptonCommandLinkButton4.CommandLinkImageValues.Image = ((System.Drawing.Image)(resources.GetObject("kryptonCommandLinkButton4.CommandLinkImageValues.Image"))); + this.kryptonCommandLinkButton4.CommandLinkTextValues.Description = " Demo the Shortcut display and rounded borders"; + this.kryptonCommandLinkButton4.CommandLinkTextValues.Heading = "&Disabled Navigator Mini style"; + this.kryptonCommandLinkButton4.Enabled = false; + this.kryptonCommandLinkButton4.Location = new System.Drawing.Point(13, 315); + this.kryptonCommandLinkButton4.Name = "kryptonCommandLinkButton4"; + this.kryptonCommandLinkButton4.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton4.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton2.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton2.Size = new System.Drawing.Size(341, 61); - this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; - this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonCommandLinkButton2.TabIndex = 2; + this.kryptonCommandLinkButton4.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton4.Size = new System.Drawing.Size(340, 55); + this.kryptonCommandLinkButton4.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton4.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) + | Krypton.Toolkit.PaletteDrawBorders.Right))); + this.kryptonCommandLinkButton4.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton4.StateCommon.Border.Rounding = 4F; + this.kryptonCommandLinkButton4.StateCommon.Border.Width = 2; + this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton4.TabIndex = 4; // // kryptonCommandLinkButton3 // this.kryptonCommandLinkButton3.ButtonStyle = Krypton.Toolkit.ButtonStyle.NavigatorMini; + this.kryptonCommandLinkButton3.CommandLinkImageValues.DisplayUACShield = false; + this.kryptonCommandLinkButton3.CommandLinkImageValues.Image = null; this.kryptonCommandLinkButton3.CommandLinkTextValues.Description = " Demo the Shortcut display and rounded borders"; this.kryptonCommandLinkButton3.CommandLinkTextValues.Heading = "&Navigator Mini style"; this.kryptonCommandLinkButton3.Location = new System.Drawing.Point(12, 247); this.kryptonCommandLinkButton3.Name = "kryptonCommandLinkButton3"; this.kryptonCommandLinkButton3.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton3.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonCommandLinkButton3.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); this.kryptonCommandLinkButton3.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; this.kryptonCommandLinkButton3.Size = new System.Drawing.Size(341, 61); this.kryptonCommandLinkButton3.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton3.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonCommandLinkButton3.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); this.kryptonCommandLinkButton3.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; this.kryptonCommandLinkButton3.StateCommon.Border.Rounding = 4F; @@ -136,69 +150,64 @@ private void InitializeComponent() this.kryptonCommandLinkButton3.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonCommandLinkButton3.TabIndex = 3; // - // kryptonCommandLinkButton4 + // kryptonCommandLinkButton2 // - this.kryptonCommandLinkButton4.ButtonStyle = Krypton.Toolkit.ButtonStyle.NavigatorMini; - this.kryptonCommandLinkButton4.CommandLinkImageValues.Image = ((System.Drawing.Image)(resources.GetObject("kryptonCommandLinkButton4.CommandLinkImageValues.Image"))); - this.kryptonCommandLinkButton4.CommandLinkTextValues.Description = " Demo the Shortcut display and rounded borders"; - this.kryptonCommandLinkButton4.CommandLinkTextValues.Heading = "&Disabled Navigator Mini style"; - this.kryptonCommandLinkButton4.Enabled = false; - this.kryptonCommandLinkButton4.Location = new System.Drawing.Point(13, 315); - this.kryptonCommandLinkButton4.Name = "kryptonCommandLinkButton4"; - this.kryptonCommandLinkButton4.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton4.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) - | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton4.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton4.Size = new System.Drawing.Size(340, 55); - this.kryptonCommandLinkButton4.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton4.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonCommandLinkButton2.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; + this.kryptonCommandLinkButton2.CommandLinkImageValues.DisplayUACShield = false; + this.kryptonCommandLinkButton2.CommandLinkImageValues.Image = null; + this.kryptonCommandLinkButton2.CommandLinkTextValues.Description = " Here be the extra Text with some spaces"; + this.kryptonCommandLinkButton2.CommandLinkTextValues.Heading = "Standalone Style"; + this.kryptonCommandLinkButton2.Location = new System.Drawing.Point(12, 180); + this.kryptonCommandLinkButton2.Name = "kryptonCommandLinkButton2"; + this.kryptonCommandLinkButton2.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton2.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton4.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton4.StateCommon.Border.Rounding = 4F; - this.kryptonCommandLinkButton4.StateCommon.Border.Width = 2; - this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton4.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; - this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton4.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonCommandLinkButton4.TabIndex = 4; + this.kryptonCommandLinkButton2.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton2.Size = new System.Drawing.Size(341, 61); + this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton2.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton2.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton2.TabIndex = 2; // - // kryptonCommandLinkButton5 + // kryptonAlternateCommandLinkButton1 // - this.kryptonCommandLinkButton5.ButtonStyle = Krypton.Toolkit.ButtonStyle.Standalone; - this.kryptonCommandLinkButton5.CommandLinkTextValues.Description = "What happens when the text is really long, \r\nand wants to go off the edge?\r\nThen " + - "Use a Multi-line ;-)\r\n"; - this.kryptonCommandLinkButton5.CommandLinkTextValues.Heading = "&Control the World"; - this.kryptonCommandLinkButton5.Location = new System.Drawing.Point(359, 12); - this.kryptonCommandLinkButton5.Name = "kryptonCommandLinkButton5"; - this.kryptonCommandLinkButton5.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton5.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) - | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton5.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton5.Size = new System.Drawing.Size(319, 86); - this.kryptonCommandLinkButton5.StateCommon.Back.Color1 = System.Drawing.SystemColors.GradientActiveCaption; - this.kryptonCommandLinkButton5.StateCommon.Back.Color2 = System.Drawing.SystemColors.ActiveCaption; - this.kryptonCommandLinkButton5.StateCommon.Back.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton5.StateCommon.Border.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.kryptonCommandLinkButton5.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton5.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonAlternateCommandLinkButton1.Location = new System.Drawing.Point(12, 12); + this.kryptonAlternateCommandLinkButton1.Name = "kryptonAlternateCommandLinkButton1"; + this.kryptonAlternateCommandLinkButton1.Size = new System.Drawing.Size(341, 69); + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.Image.ImageV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonAlternateCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonAlternateCommandLinkButton1.TabIndex = 1; + this.kryptonAlternateCommandLinkButton1.Values.ExtraText = "Text here is forced in to the lower part of the button"; + this.kryptonAlternateCommandLinkButton1.Values.Image = ((System.Drawing.Image)(resources.GetObject("kryptonAlternateCommandLinkButton1.Values.Image"))); + this.kryptonAlternateCommandLinkButton1.Values.Text = "Normal Krypton Button"; + // + // kryptonCommandLinkButton1 + // + this.kryptonCommandLinkButton1.CommandLinkImageValues.DisplayUACShield = false; + this.kryptonCommandLinkButton1.CommandLinkImageValues.UACShieldIconSize = Krypton.Toolkit.UACShieldIconSize.Small; + this.kryptonCommandLinkButton1.CommandLinkTextValues.Description = "Here be the \"Note Text\""; + this.kryptonCommandLinkButton1.CommandLinkTextValues.Heading = "Default Ext Command Link"; + this.kryptonCommandLinkButton1.Location = new System.Drawing.Point(12, 99); + this.kryptonCommandLinkButton1.Name = "kryptonCommandLinkButton1"; + this.kryptonCommandLinkButton1.OverrideFocus.Border.Draw = Krypton.Toolkit.InheritBool.True; + this.kryptonCommandLinkButton1.OverrideFocus.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); - this.kryptonCommandLinkButton5.StateCommon.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; - this.kryptonCommandLinkButton5.StateCommon.Border.Rounding = 6F; - this.kryptonCommandLinkButton5.StateCommon.Border.Width = 2; - this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.kryptonCommandLinkButton5.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton5.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; - this.kryptonCommandLinkButton5.StateCommon.Content.LongText.Trim = Krypton.Toolkit.PaletteTextTrim.Word; - this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonCommandLinkButton5.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonCommandLinkButton5.TabIndex = 5; + this.kryptonCommandLinkButton1.OverrideFocus.Border.GraphicsHint = Krypton.Toolkit.PaletteGraphicsHint.AntiAlias; + this.kryptonCommandLinkButton1.Size = new System.Drawing.Size(341, 61); + this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton1.StateCommon.Content.LongText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Far; + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kryptonCommandLinkButton1.StateCommon.Content.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonCommandLinkButton1.TabIndex = 0; // // Form7 // diff --git a/Source/Krypton Components/TestForm/Form7.resx b/Source/Krypton Components/TestForm/Form7.resx index bca833997..224a170ed 100644 --- a/Source/Krypton Components/TestForm/Form7.resx +++ b/Source/Krypton Components/TestForm/Form7.resx @@ -165,7 +165,7 @@ XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+ tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/ - 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEgAACxIB0t1+/AAAA2ZJREFUWEftl+lOU0EU + 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEAAACxABrSO9dQAAA2ZJREFUWEftl+lOU0EU x3kK30JfQF+D730Al0QTWQqlYIMBIVAoCFUsFgHZZAfZkRLQgFIWQYSutKUbhUJpWXOcM8lc59Jb29uE fvLDLyXnP3Pmz6znZu1durLN0TVD5lk1NG8a72bNRucMrf42qHfXZw5XPTQ49VDQX6igBrSuGvhxNAF9 vhZYOZqEF7YiyLE8h7FAJyyGhuHb4Sh89nfA78gCaJ3lVJNLi6cBpoOfYCE0BM3EhNqsFhv4TgzggEuH @@ -230,7 +230,7 @@ XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+ tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/ - 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEgAACxIB0t1+/AAAA2ZJREFUWEftl+lOU0EU + 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEAAACxABrSO9dQAAA2ZJREFUWEftl+lOU0EU x3kK30JfQF+D730Al0QTWQqlYIMBIVAoCFUsFgHZZAfZkRLQgFIWQYSutKUbhUJpWXOcM8lc59Jb29uE fvLDLyXnP3Pmz6znZu1durLN0TVD5lk1NG8a72bNRucMrf42qHfXZw5XPTQ49VDQX6igBrSuGvhxNAF9 vhZYOZqEF7YiyLE8h7FAJyyGhuHb4Sh89nfA78gCaJ3lVJNLi6cBpoOfYCE0BM3EhNqsFhv4TgzggEuH From 2fc3a341d0d0cad21e26459c09cec6babf488e6e Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Sat, 2 Dec 2023 09:51:40 +0000 Subject: [PATCH 16/16] Update CommandLinkImageValues.cs --- .../Values/CommandLinkImageValues.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs index 9919f76f0..39600a039 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Values/CommandLinkImageValues.cs @@ -66,6 +66,10 @@ public bool DisplayUACShield } } + private bool ShouldSerializeDisplayUACShield() => !DisplayUACShield; + + public void ResetDisplayUACShield() => DisplayUACShield = false; + /// Gets and sets the heading image transparent color. [Localizable(true)] [Category("Visuals")] @@ -128,6 +132,10 @@ public UACShieldIconSize UACShieldIconSize } } + private bool ShouldSerializeUACShieldIconSize() => UACShieldIconSize != UACShieldIconSize.Small; + + public void ResetUACShieldIconSize() => UACShieldIconSize = UACShieldIconSize.Small; + #endregion #region Identity @@ -138,17 +146,13 @@ public CommandLinkImageValues(NeedPaintHandler needPaint) { NeedPaint = needPaint; - _displayUACShield = false; - - _uacShieldIconSize = UACShieldIconSize.Small; - - //_image = DEFAULT_IMAGE; - - //_transparencyKey = Color.Empty; + ResetDisplayUACShield(); ResetImage(); ResetImageTransparentColor(); + + ResetUACShieldIconSize(); } #endregion