Skip to content

Commit

Permalink
Merge pull request #2058 from Krypton-Suite/alpha
Browse files Browse the repository at this point in the history
* January 2025 (Canary)
  • Loading branch information
PWagner1 authored Jan 20, 2025
2 parents 5b13e67 + 6b4798b commit bcc1623
Show file tree
Hide file tree
Showing 237 changed files with 5,411 additions and 20,468 deletions.
35 changes: 34 additions & 1 deletion Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
=======

## 2025-11-xx - Build 2511 - November 2025
* Obsolete [#2022](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2022), Remove obsolete method `ThemeManager.SetTheme()`. Use `ThemeManager.ApplyTheme(...)` instead.
* Implemented [#1623](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1623), Settings custom themes only available through ThemeManager from V110 onward. Adds Obsolete warnings so the move can be prepared from V100.
* Resolved [#2053](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2053), `KryptonRichTextBox` Designer Issues
* Resolved [#2047](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2047), `KryptonForm` based MDI child windows do not respond to LayoutMDI calls
* Resolved [#2037](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2037), `KryptonDataGridView` Several bug fixes and improvements to the `KryptonDataGridView` and its components have been made. See this ticket for a complete overview.
* Reverted [#2027](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2027), Reverting `KryptonOutlookGrid` back to Extended Toolkit for another inspection.
* Resolved [#2023](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2023), `KryptonDataGridView` IconSpecs do not get a repaint when changed at run-time.
* Resolved [#2018](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2018), Corrects `KryptonDataGridView` palette switching difficulties.
* Resolved [#561](https://github.com/Krypton-Suite/Standard-Toolkit/issues/561), MenuItem images are not scaled with dpi Awareness
* Resolved [#2010](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2010), `KryptonDataGridView` columns with editing controls do not react to local palette changes.
* Resolved [#2009](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2009), `KryptonCombBox` does not display the `CueHint`
* Resolved [#1287](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1287), `KryptonToast` has "Many" Issues
- Text areas now have padding
- Content area has been replaced with a `KryptonRichTextBox`
* Resolved [#1784](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1784), `KryptonDataGridView` Auto generation of columns is not serialized correctly.
* Resolved [#1977](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1977), When a control is set to anchor to the bottom, the control can be stretched beyond the form bottom.
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Implemented [#1968](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1968), Open up 'ExceptionHandler' for public use
- To invoke, use `KryptonExceptionHandler`
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
* Resolved [#565](https://github.com/Krypton-Suite/Standard-Toolkit/issues/565), GroupBox icons are not scaled for dpi awareness
* Resolved [#559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/559), Header group icon is not scaled for dpi awareness
* Resolved [#1946](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1946), ButtonSpecs do not scale anymore!
* Resolved [#1940](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1940), In V95 KContextMenuItem no longer stores the Text value in the designer !!
* Resolved [#1938](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1938), `KryptonTextBox` CueHint Text
Expand All @@ -16,7 +38,7 @@
* Resolved [#980](https://github.com/Krypton-Suite/Standard-Toolkit/issues/980), `KryptonDockableNavigator` with pages without `AllowConfigSave` flag are incorrectly saved
* Resolved [#1909](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1909), `KryptonDataGridViewComboBoxCell` displays an empty drop-down list on the first new row.
* Resolved [#1910](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1910), `Workspace Persistence` -> "Save to array" Causes an exception in `Toolkit.XmlHelper.Image.Save`
* Implemented [#1177](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1177), Is it possible to have the KForm back colour as the KPanel colour
* Implemented [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), Is it possible to have the KForm back colour as the KPanel colour
* Resolved [#1900](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1900), Remove Obsolete `KryptonMessageBoxDep` from V100 code base
* Resolved [#1211](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1211), Button 'drop down' arrows should use palette text colour
* Resolved [#1212](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1212), **[Breaking Change]** `KColorButton` 'drop-down' arrow should be drawn
Expand All @@ -38,6 +60,12 @@
=======

## 2025-02-01 - Build 2502 (Version 95 - Patch 1) - February 2025
* Resolved [#561](https://github.com/Krypton-Suite/Standard-Toolkit/issues/561), MenuItem images are not scaled with dpi Awareness
* Resolved [#2009](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2009), `KryptonCombBox` does not display the `CueHint`
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
* Resolved [#565](https://github.com/Krypton-Suite/Standard-Toolkit/issues/565), GroupBox icons are not scaled for dpi awareness
* Resolved [#559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/559), Header group icon is not scaled for dpi awareness
* Resolved [#1946](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1946), ButtonSpecs do not scale anymore!
* Resolved [#1940](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1940), In V95 KContextMenuItem no longer stores the Text value in the designer !!
* Resolved [#1938](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1938), `KryptonTextBox` CueHint Text
Expand Down Expand Up @@ -221,6 +249,11 @@
=======

# 2025-02-01 - Build 2502 (Patch 5) - February 2025
* Resolved [#561](https://github.com/Krypton-Suite/Standard-Toolkit/issues/561), MenuItem images are not scaled with dpi Awareness
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
* Resolved [#565](https://github.com/Krypton-Suite/Standard-Toolkit/issues/565), GroupBox icons are not scaled for dpi awareness
* Resolved [#559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/559), Header group icon is not scaled for dpi awareness
* Resolved [#1946](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1946), ButtonSpecs do not scale anymore!
* Resolved [#1905](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1905), `Sparkle` Themes have an issue with the Background
* Resolved [#980](https://github.com/Krypton-Suite/Standard-Toolkit/issues/980), `KryptonDockableNavigator` with pages without `AllowConfigSave` flag are incorrectly saved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ public abstract class HeaderGroupMappingBase : HeaderValuesBase
#endregion

#region Identity

/// <summary>
/// Initialize a new instance of the HeaderGroupMappingBase class.
/// </summary>
/// <param name="navigator">Reference to owning navigator instance.</param>
/// <param name="needPaint">Delegate for notifying paint requests.</param>
/// <param name="getDpiFactor"></param>
protected HeaderGroupMappingBase([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
: base(needPaint)
NeedPaintHandler needPaint, GetDpiFactor getDpiFactor)
: base(needPaint, getDpiFactor)
{
Debug.Assert(navigator is not null);

if (navigator is null)
{
throw new ArgumentNullException(nameof(navigator));
}

// Remember back reference to owning control
_navigator = navigator;
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));

// Set initial values to the default
_mapImage = GetMapImageDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ public class HeaderGroupMappingPrimary : HeaderGroupMappingBase
#endregion

#region Identity

/// <summary>
/// Initialize a new instance of the HeaderGroupMappingPrimary class.
/// </summary>
/// <param name="navigator">Reference to owning navigator instance.</param>
/// <param name="needPaint">Delegate for notifying paint requests.</param>
/// <param name="getDpiFactor"></param>
public HeaderGroupMappingPrimary(KryptonNavigator navigator,
NeedPaintHandler needPaint)
: base(navigator, needPaint)
NeedPaintHandler needPaint,
GetDpiFactor getDpiFactor)
: base(navigator, needPaint, getDpiFactor)
{
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ public class HeaderGroupMappingSecondary : HeaderGroupMappingBase
#endregion

#region Identity

/// <summary>
/// Initialize a new instance of the HeaderGroupMappingSecondary class.
/// </summary>
/// <param name="navigator">Reference to owning navigator instance.</param>
/// <param name="needPaint">Delegate for notifying paint requests.</param>
/// <param name="getDpiFactor"></param>
public HeaderGroupMappingSecondary(KryptonNavigator navigator,
NeedPaintHandler needPaint)
: base(navigator, needPaint)
NeedPaintHandler needPaint,
GetDpiFactor getDpiFactor)
: base(navigator, needPaint, getDpiFactor)
{
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,26 @@ public NavigatorHeader([DisallowNull] KryptonNavigator navigator,
_headerVisiblePrimary = true;
_headerVisibleSecondary = true;
_headerVisibleBar = true;
HeaderValuesPrimary = new HeaderGroupMappingPrimary(_navigator, needPaint);
HeaderValuesSecondary = new HeaderGroupMappingSecondary(_navigator, needPaint);
HeaderValuesPrimary = new HeaderGroupMappingPrimary(_navigator, needPaint, GetDpiFactor);
HeaderValuesSecondary = new HeaderGroupMappingSecondary(_navigator, needPaint, GetDpiFactor);
}
#endregion

#region IsDefault
/// <summary>
/// Gets a value indicating if all values are default.
/// </summary>
[Browsable(false)]
private float GetDpiFactor()
{
#if NET462
return PI.GetDpiForWindow(_navigator.Handle) / 96F;
#else
return _navigator.DeviceDpi / 96F;
#endif
}

#endregion

#region IsDefault
/// <summary>
/// Gets a value indicating if all values are default.
/// </summary>
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((HeaderStylePrimary == HeaderStyle.Primary) &&
(HeaderStyleSecondary == HeaderStyle.Secondary) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public KeyTipControl(KryptonRibbon ribbon,
TransparencyKey = GlobalStaticValues.TRANSPARENCY_KEY_COLOR;
StateCommon!.Border.DrawBorders = PaletteDrawBorders.None;
StateCommon!.Border.Width = 0;
#pragma warning disable CS0618 // Type or member is obsolete
UseDropShadow = false;
#pragma warning restore CS0618 // Type or member is obsolete

// Disabled key tips are show semi-transparent
if (_showDisabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ public abstract class KryptonRibbonGroupItem : Component,
/// </summary>
protected KryptonRibbonGroupItem() =>
// Do the Tooltip Magic
_toolTipValues = new ToolTipValues(null/*NeedPaintDelegate*/); // Must be replaced by appropriate call
_toolTipValues = new ToolTipValues(null/*NeedPaintDelegate*/, GetDpiFactor); // Must be replaced by appropriate call

private float GetDpiFactor()
{
return (Ribbon != null)
#if NET462
? PI.GetDpiForWindow(Ribbon.Handle) / 96F
#else
? Ribbon.DeviceDpi / 96F
#endif
: 1.0f;
}

#endregion Identity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public KryptonRibbonGroupThemeComboBox()
[Description(@"The custom assigned palette mode.")]
[DefaultValue(null)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Obsolete("Deprecated and will be removed in V110. Set a global custom palette through 'ThemeManager.ApplyTheme(...)'.")]
public KryptonCustomPaletteBase? KryptonCustomPalette
{
get => _kryptonCustomPalette;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public override void RenderBefore([DisallowNull] RenderContext context)
{
// We always draw the image a 24x24 image (if dpi = 1!)
localImage = CommonHelper.ScaleImageForSizedDisplay(localImage, localImage.Width * FactorDpiX,
localImage.Height * FactorDpiY);
localImage.Height * FactorDpiY, false);

if (localImage != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private void OnClick(object? sender, MouseEventArgs e)
}
*/

_cachedImage = CommonHelper.ScaleImageForSizedDisplay(sourceImage, currentWidth, currentHeight);
_cachedImage = CommonHelper.ScaleImageForSizedDisplay(sourceImage, currentWidth, currentHeight, false);
}

return _cachedImage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,23 @@ private void CreateViewElements(PaletteRedirect redirect)
NeedPaintDelegate);

// Create the manager for handling tooltips
ToolTipManager = new ToolTipManager(new ToolTipValues(null)); // use default, as each button "could" have different values ??!!??
ToolTipManager = new ToolTipManager(new ToolTipValues(null, GetDpiFactor)); // use default, as each button "could" have different values ??!!??
ToolTipManager.ShowToolTip += OnShowToolTip;
ToolTipManager.CancelToolTip += OnCancelToolTip;
ButtonSpecManager.ToolTipManager = ToolTipManager;
}

private float GetDpiFactor()
{
return (_visualPopupToolTip != null)
#if NET462
? PI.GetDpiForWindow(_visualPopupToolTip.Handle) / 96F
#else
? _visualPopupToolTip.DeviceDpi / 96F
#endif
: 1F;
}

private void SetupParentMonitoring()
{
// We have to know when the parent of the ribbon changes, so we can then hook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ protected virtual void OnFinishDelegate(object? sender, EventArgs? e) =>
// Get value from button spec passing inheritance redirector
Image? baseImage = ButtonSpec.GetImage(_redirector, state);

float dpiFactor = _controller?.Target.FactorDpiX ?? 1f;
return (baseImage != null)
? CommonHelper.ScaleImageForSizedDisplay(baseImage, baseImage.Width * _controller!.Target.FactorDpiX,
baseImage.Height * _controller!.Target.FactorDpiY)
? CommonHelper.ScaleImageForSizedDisplay(baseImage, baseImage.Width * dpiFactor,
baseImage.Height * dpiFactor, true)
: null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ public string Text
[KryptonPersist]
[Category(@"Appearance")]
[Description(@"Check box extra text.")]
[DefaultValue(null)]
[Localizable(true)]
[AllowNull]
public string ExtraText
Expand All @@ -223,6 +222,8 @@ public string ExtraText
}
}

private bool ShouldSerializeExtraText() => !string.IsNullOrEmpty(_extraText);

/// <summary>
/// Gets and sets the check box image.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void SetCustomColors(Color[]?[]? colors)
// Each element must contain a valid reference
if (colors[i] == null)
{
throw new ArgumentOutOfRangeException(nameof(colors), "Child array cannot be null.");
throw new ArgumentOutOfRangeException(nameof(colors), @"Child array cannot be null.");
}
else
{
Expand All @@ -331,7 +331,7 @@ public void SetCustomColors(Color[]?[]? colors)
// All other child arrays must be the same length
if (colors[i]!.Length != rows)
{
throw new ArgumentOutOfRangeException(nameof(colors), "Each child color array must be the same length.");
throw new ArgumentOutOfRangeException(nameof(colors), @"Each child color array must be the same length.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public string Text
[Description(@"Heading menu item extra text.")]
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[Localizable(true)]
[DefaultValue("")]
[AllowNull]
public string ExtraText
{
Expand All @@ -180,6 +179,7 @@ public string ExtraText
}
}
}
private bool ShouldSerializeExtraText() => !string.IsNullOrEmpty(_extraText);

/// <summary>
/// Gets and sets the heading menu item image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ public string Text
[Category(@"Appearance")]
[Description(@"Standard menu item extra text.")]
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[DefaultValue(@"")]
[Localizable(true)]
[Bindable(true)]
public string ExtraText
Expand All @@ -269,6 +268,7 @@ public string ExtraText
}
}
}
private bool ShouldSerializeExtraText() => !string.IsNullOrEmpty(_extraText);

/// <summary>
/// Gets and sets the standard menu item image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class KryptonContextMenuItemBase : Component, INotifyPropertyCha
#region Instance Fields

private bool _visible;
private ToolTipValues _toolTipValues = new(null);
private ToolTipValues _toolTipValues;
private VisualPopupToolTip? _visualPopupToolTip;
private IContextMenuProvider? _provider;
#endregion
Expand Down Expand Up @@ -49,11 +49,23 @@ public abstract class KryptonContextMenuItemBase : Component, INotifyPropertyCha
protected KryptonContextMenuItemBase()
{
_visible = true;
_toolTipValues = new ToolTipValues(null, GetDpiFactor);
ToolTipManager = new ToolTipManager(_toolTipValues);
ToolTipManager.ShowToolTip += OnShowToolTip;
ToolTipManager.CancelToolTip += OnCancelToolTip;
}

private float GetDpiFactor()
{
return (_visualPopupToolTip != null)
#if NET462
? PI.GetDpiForWindow(_visualPopupToolTip.Handle) / 96F
#else
? _visualPopupToolTip.DeviceDpi / 96F
#endif
: 1F;
}

#endregion

#region Public
Expand Down
Loading

0 comments on commit bcc1623

Please sign in to comment.