Skip to content

Commit

Permalink
* Partly implement #1204
Browse files Browse the repository at this point in the history
  • Loading branch information
PWagner1 committed Dec 5, 2023
1 parent 3006ee0 commit 5ef5141
Show file tree
Hide file tree
Showing 16 changed files with 454 additions and 56 deletions.
5 changes: 4 additions & 1 deletion Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
=======

## 2024-11-xx - Build 2411 - November 2024
* Implemented [#1204](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1204), Build on `KryptonCommandLinkButtons`
- [#1216](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1216), Add support for fonts
- [#1217](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1217), Add support for text alignment
* Resolved [#996](https://github.com/Krypton-Suite/Standard-Toolkit/issues/996), DataGridView ComboBox Adding list over and over
* Resolved [#1207](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1207), Microsoft 365 - Black (Dark Mode) Drop button is not visible
* Resolved [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the Font Size (as it is already covered by the actual font !)
* 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`
* Implemented [#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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,6 +75,7 @@ public KryptonCommandLinkButton()

// Create content storage
CommandLinkImageValues = new CommandLinkImageValues(NeedPaintDelegate);
CommandLinkImageValues.Image = CommandLinkImageResources.Windows_11_CommandLink_Arrow;
CommandLinkTextValues = new CommandLinkTextValues(NeedPaintDelegate);

// Create the palette storage
Expand Down Expand Up @@ -182,19 +183,14 @@ public override string Text
set => CommandLinkTextValues.Heading = value;
}

private bool ShouldSerializeText()
{
private bool ShouldSerializeText() =>
// Never serialize, let the button values serialize instead
return false;
}
false;

/// <summary>
/// Resets the Text property to its default value.
/// </summary>
public override void ResetText()
{
CommandLinkTextValues.ResetText();
}
public override void ResetText() => CommandLinkTextValues.ResetText();

/// <summary>
/// Gets and sets the visual orientation of the control.
Expand Down Expand Up @@ -240,15 +236,9 @@ public ButtonStyle ButtonStyle
}
}

private bool ShouldSerializeButtonStyle()
{
return (ButtonStyle != ButtonStyle.Command);
}
private bool ShouldSerializeButtonStyle() => (ButtonStyle != ButtonStyle.Command);

private void ResetButtonStyle()
{
ButtonStyle = ButtonStyle.Command;
}
private void ResetButtonStyle() => ButtonStyle = ButtonStyle.Command;

/// <summary>
/// Gets access to the button content.
Expand All @@ -266,10 +256,7 @@ private void ResetButtonStyle()
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public CommandLinkImageValues CommandLinkImageValues { get; }

private bool ShouldSerializeValues()
{
return false;
}
private bool ShouldSerializeValues() => false;

/// <summary>
/// Gets access to the common button appearance that other states can override.
Expand All @@ -279,10 +266,7 @@ private bool ShouldSerializeValues()
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteTripleRedirect StateCommon { get; }

private bool ShouldSerializeStateCommon()
{
return !StateCommon.IsDefault;
}
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;

/// <summary>
/// Gets access to the disabled button appearance entries.
Expand Down Expand Up @@ -499,7 +483,7 @@ public virtual void SetFixedState(PaletteState state)
/// <summary>
/// Gets the default size of the control.
/// </summary>
protected override Size DefaultSize => new Size(287, 61);
protected override Size DefaultSize => new Size(319, 61);

/// <summary>
/// Gets the default Input Method Editor (IME) mode supported by this control.
Expand Down Expand Up @@ -618,11 +602,59 @@ protected override void ContextMenuClosed()
/// <inheritdoc />
protected override void OnPaint(PaintEventArgs? e)
{
//if (CommandLinkImageValues.ShowUACShield)
//{
// SendMessage(new HandleRef(this, Handle), BCM_SETSHIELD, IntPtr.Zero,
// CommandLinkImageValues.ShowUACShield);
//}
if (CommandLinkTextValues.DescriptionFont != null)
{
StateCommon.Content.LongText.Font = CommandLinkTextValues.DescriptionFont;
}
else
{
StateCommon.Content.LongText.Font = null;
}

if (CommandLinkTextValues.HeadingFont != null)
{
StateCommon.Content.ShortText.Font = CommandLinkTextValues.HeadingFont;
}
else
{
StateCommon.Content.ShortText.Font = null;
}

if (CommandLinkTextValues.DescriptionTextHAlignment != null)
{
StateCommon.Content.LongText.TextH = CommandLinkTextValues.DescriptionTextHAlignment ?? PaletteRelativeAlign.Near;
}
else
{
StateCommon.Content.LongText.TextH = PaletteRelativeAlign.Near;
}

if (CommandLinkTextValues.DescriptionTextVAlignment != null)
{
StateCommon.Content.LongText.TextV = CommandLinkTextValues.DescriptionTextVAlignment ?? PaletteRelativeAlign.Far;
}
else
{
StateCommon.Content.LongText.TextV = PaletteRelativeAlign.Far;
}

if (CommandLinkTextValues.HeadingTextHAlignment != null)
{
StateCommon.Content.ShortText.TextH = CommandLinkTextValues.HeadingTextHAlignment ?? PaletteRelativeAlign.Near;
}
else
{
StateCommon.Content.ShortText.TextH = PaletteRelativeAlign.Near;
}

if (CommandLinkTextValues.HeadingTextVAlignment != null)
{
StateCommon.Content.ShortText.TextV = CommandLinkTextValues.HeadingTextVAlignment ?? PaletteRelativeAlign.Center;
}
else
{
StateCommon.Content.ShortText.TextV = PaletteRelativeAlign.Center;
}

base.OnPaint(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
global using Krypton.Toolkit.ResourceFiles.Arrows;
global using Krypton.Toolkit.ResourceFiles.ButtonSpecs;
global using Krypton.Toolkit.ResourceFiles.CheckBoxes;
global using Krypton.Toolkit.ResourceFiles.CommandLink;
global using Krypton.Toolkit.ResourceFiles.ControlBox;
global using Krypton.Toolkit.ResourceFiles.Dialogs;
global using Krypton.Toolkit.ResourceFiles.DropDown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>ColourScaleImageResources.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\CommandLink\CommandLinkImageResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CommandLinkImageResources.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\ControlBox\Microsoft365ControlBoxResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -633,6 +638,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ColourScaleImageResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\CommandLink\CommandLinkImageResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>CommandLinkImageResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\ControlBox\Microsoft365ControlBoxResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Microsoft365ControlBoxResources.Designer.cs</LastGenOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public virtual PaletteTextHotkeyPrefix Prefix
}
}
#endregion

#region TextH
/// <summary>
/// Gets the horizontal relative alignment of the text.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ef5141

Please sign in to comment.