Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Restore KryptonMessageBox back to "Winform Override" simularity #1456

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=======

## 2024-11-xx - Build 2411 - November 2024
* Implemented [#1435](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1435), **Breaking Change** Take KMB back to the Winform override (Remove Checkbox etc)
* Implemented [#1432](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1432), Copy `KryptonMessageBox` to `KryptonMessageBoxDep`
* Resolved [#1424](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1424), **Breaking Change** `KryptonMessageBox` does not obey tab characters like `MessageBox`
* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1381), **[Regression]** Docking Persistence broken since build ##.23.10.303
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ Follow the links to see the different objects and layouts that this framework al

## V90.## (2024-11-xx - Build 2411 - November 2024)
There are list of changes that have occurred during the development of the V90.## version
- [#1432](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1432), **Breaking Change placeholder** Copy `KryptonMessageBox` to `KryptonMessageBoxDep`
- [#1435](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1435), **Breaking Change** Take KMB back to the Winform override (Remove Checkbox etc)
- and [#1432](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1432), **Breaking Change placeholder** Copy `KryptonMessageBox` to `KryptonMessageBoxDep`
- The introduction of new Parameters elements to the `KryptonMessageBox` is now supported in the `KryptonMessageBoxDep` class
- This is so that the `KryptonMessageBox` gets back to being a drop in replacement for the winform `MessageBox`
- And a start of the introduction of the `KryptonMessageDialog` implementation of the UWP `MessageDialog`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2381,8 +2381,15 @@ private void RecreateView()
ViewDrawBorderEdge? buttonEdge = _buttonEdgeLookup?[page];

// Add to the end of the collection
if (buttonEdge != null) _viewLayout.Add(buttonEdge, dockFar);
if (checkButton != null) _viewLayout.Add(checkButton, dockFar);
if (buttonEdge != null)
{
_viewLayout.Add(buttonEdge, dockFar);
}

if (checkButton != null)
{
_viewLayout.Add(checkButton, dockFar);
}
}
}
#endregion
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#region BSD License
/*
*
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* 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. 2017 - 2024. All rights reserved.
* Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2024 - 2024. All rights reserved.
*
*/
#endregion
Expand Down Expand Up @@ -321,7 +317,7 @@ public static DialogResult Show(IWin32Window? owner, string text, string caption
/// <summary>Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator, and Help topic.</summary>
/// <param name="messageBoxData">The message box data.</param>
/// <returns>One of the System.Windows.Forms.DialogResult values.</returns>
public static DialogResult Show(KryptonMessageBoxData messageBoxData) => ShowCore(messageBoxData);
public static DialogResult Show(KryptonMessageBoxDataDep messageBoxData) => ShowCore(messageBoxData);

#endregion

Expand Down Expand Up @@ -396,7 +392,7 @@ private static DialogResult ShowCore(IWin32Window? owner,
}
}

private static DialogResult ShowCore(KryptonMessageBoxData messageBoxData)
private static DialogResult ShowCore(KryptonMessageBoxDataDep messageBoxData)
{
messageBoxData.Caption = string.IsNullOrEmpty(messageBoxData.Caption) ? @" " : messageBoxData.Caption;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public PaletteMode DefaultPalette

set
{
if (_defaultPalette == value) return;
if (_defaultPalette == value)
{
return;
}

if (_handleCreated)
{
// Safe to directly access UI thread now
Expand Down Expand Up @@ -149,15 +153,22 @@ public KryptonThemeComboBox()
private void KryptonThemeComboBox_HandleCreated(object sender, EventArgs e)
{
_handleCreated = true;
if (!_pendingPaletteUpdate) return;
if (!_pendingPaletteUpdate)
{
return;
}

_pendingPaletteUpdate = false;
DefaultPalette = _pendingPaletteMode;
}

private void UpdateDefaultPaletteIndex(PaletteMode mode)
{
if (_isUpdating) return;
if (_isUpdating)
{
return;
}

_isUpdating = true;

var selectedText = ThemeManager.ReturnPaletteModeAsString(mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -142,7 +142,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -141,7 +141,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -161,7 +161,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -133,7 +133,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -137,7 +137,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -159,7 +159,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -144,7 +144,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -143,7 +143,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -143,7 +143,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -135,7 +135,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -139,7 +139,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -140,7 +140,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -139,7 +139,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void UpdateIcon()
SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
break;
case KryptonToastNotificationIcon.Shield:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
}
Expand All @@ -152,7 +152,7 @@ private void UpdateIcon()
}
break;
case KryptonToastNotificationIcon.WindowsLogo:
if (OSUtilities.IsWindowsEleven)
if (OSUtilities.IsAtLeastWindowsEleven)
{
SetIcon(WindowsLogoImageResources.Windows_11_128_128);
}
Expand Down
Loading