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

* Semi implement #728, with points 2 & 4 outstanding #730

Merged
merged 7 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
=======

## 2022-11-xx - Build 2211 - November 2022 <!--Possible August or September release?-->
* Implemented [#728](https://github.com/Krypton-Suite/Standard-Toolkit/issues/728), Bring MessageBox `States` inline with latest .Net 6
* Made enumeration `SchemeOfficeColors` public, so they can be used to make external themes
* Resolved [#722](https://github.com/Krypton-Suite/Standard-Toolkit/issues/722), KryptonRichTextBox disabled colour cannot be set
* Resolved [#662](https://github.com/Krypton-Suite/Standard-Toolkit/issues/662), Can not "Control / Set Disabled" Background Colour Of Comboboxes, in DropDown mode
* Resolved [#715](https://github.com/Krypton-Suite/Standard-Toolkit/issues/715), v65.22.4.94 - PaletteSparkleBlueBase.GetContentPadding: Specified argument was out of the range of valid values. Parameter name: style
* Implemented the `PlacementModeConverter` for `PlacementMode` enum type
* Implemented [#551](https://github.com/Krypton-Suite/Standard-Toolkit/issues/551), `DropShadow` should now be off and deprecated
Expand All @@ -24,8 +27,6 @@
* Blue dark mode themes now have a darker alternate colour
* Added new `GetPaletteModeManager()` method to the `ThemeManager` API, to return the current `PaletteModeManager` of the selected `KryptonManager`
* Update documentation for `PaletteMode` and `PaletteModeManager`
* Resolved [#722](https://github.com/Krypton-Suite/Standard-Toolkit/issues/722), KryptonRichTextBox disabled colour cannot be set
* Resolved [#662](https://github.com/Krypton-Suite/Standard-Toolkit/issues/662), Can not "Control / Set Disabled" Background Colour Of Comboboxes, in DropDown mode
* Resolved [#701](https://github.com/Krypton-Suite/Standard-Toolkit/issues/701), `CueHint` in `KryptonPalette` does not work
* Resolved [#697](https://github.com/Krypton-Suite/Standard-Toolkit/issues/697), Number 9 is handled in ribbon textbox/richtextbox.
* Resolved [#693](https://github.com/Krypton-Suite/Standard-Toolkit/issues/693), Docked controls are rendered with smaller size which hides the caption/title text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,91 @@ private void UpdateIcon()

private void UpdateButtons()
{
#if NET6_0
PWagner1 marked this conversation as resolved.
Show resolved Hide resolved
switch (_buttons)
{
case MessageBoxButtons.OK:
_button1.Text = KryptonManager.Strings.OK;
_button1.DialogResult = DialogResult.OK;
_button1.Visible = true;
_button1.Enabled = true;
break;
case MessageBoxButtons.OKCancel:
_button1.Text = KryptonManager.Strings.OK;
_button2.Text = KryptonManager.Strings.Cancel;
_button1.DialogResult = DialogResult.OK;
_button2.DialogResult = DialogResult.Cancel;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
break;
case MessageBoxButtons.CancelTryContinue:
_button1.Text = KryptonManager.Strings.Cancel;
_button2.Text = KryptonManager.Strings.TryAgain;
_button3.Text = KryptonManager.Strings.Continue;
_button1.DialogResult = DialogResult.Cancel;
_button2.DialogResult = DialogResult.TryAgain;
_button3.DialogResult = DialogResult.Continue;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
_button3.Visible = true;
_button3.Enabled = true;
break;
case MessageBoxButtons.YesNo:
_button1.Text = KryptonManager.Strings.Yes;
_button2.Text = KryptonManager.Strings.No;
_button1.DialogResult = DialogResult.Yes;
_button2.DialogResult = DialogResult.No;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
ControlBox = false;
break;
case MessageBoxButtons.YesNoCancel:
_button1.Text = KryptonManager.Strings.Yes;
_button2.Text = KryptonManager.Strings.No;
_button3.Text = KryptonManager.Strings.Cancel;
_button1.DialogResult = DialogResult.Yes;
_button2.DialogResult = DialogResult.No;
_button3.DialogResult = DialogResult.Cancel;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
_button3.Visible = true;
_button3.Enabled = true;
break;
case MessageBoxButtons.RetryCancel:
_button1.Text = KryptonManager.Strings.Retry;
_button2.Text = KryptonManager.Strings.Cancel;
_button1.DialogResult = DialogResult.Retry;
_button2.DialogResult = DialogResult.Cancel;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
break;
case MessageBoxButtons.AbortRetryIgnore:
_button1.Text = KryptonManager.Strings.Abort;
_button2.Text = KryptonManager.Strings.Retry;
_button3.Text = KryptonManager.Strings.Ignore;
_button1.DialogResult = DialogResult.Abort;
_button2.DialogResult = DialogResult.Retry;
_button3.DialogResult = DialogResult.Ignore;
_button1.Visible = true;
_button1.Enabled = true;
_button2.Visible = true;
_button2.Enabled = true;
_button3.Visible = true;
_button3.Enabled = true;
ControlBox = false;
break;
}
#else
switch (_buttons)
{
case MessageBoxButtons.OK:
Expand Down Expand Up @@ -320,6 +405,7 @@ private void UpdateButtons()
ControlBox = false;
break;
}
#endif

// Do we ignore the Alt+F4 on the buttons?
if (!ControlBox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class GlobalStrings : GlobalId
private const string DEFAULT_CLOSE = "Cl&ose";
private const string DEFAULT_TODAY = "T&oday";
private const string DEFAULT_HELP = "H&elp";

// NET 6 & newer
private const string DEFAULT_CONTINUE = "Co&ntinue";
private const string DEFAULT_TRY = "&Try Again";
#endregion

#region Instance Fields
Expand Down Expand Up @@ -62,6 +66,20 @@ public GlobalStrings()
/// </summary>
/// <returns>True if all values are defaulted; otherwise false.</returns>
[Browsable(false)]
#if NET6_0
PWagner1 marked this conversation as resolved.
Show resolved Hide resolved
public bool IsDefault => OK.Equals(DEFAULT_OK) &&
Cancel.Equals(DEFAULT_CANCEL) &&
Yes.Equals(DEFAULT_YES) &&
No.Equals(DEFAULT_NO) &&
Abort.Equals(DEFAULT_ABORT) &&
Retry.Equals(DEFAULT_RETRY) &&
Ignore.Equals(DEFAULT_IGNORE) &&
Close.Equals(DEFAULT_CLOSE) &&
Today.Equals(DEFAULT_TODAY) &&
Help.Equals(DEFAULT_HELP) &&
Continue.Equals(DEFAULT_CONTINUE) &&
TryAgain.Equals(DEFAULT_TRY);
#else
public bool IsDefault => OK.Equals(DEFAULT_OK) &&
Cancel.Equals(DEFAULT_CANCEL) &&
Yes.Equals(DEFAULT_YES) &&
Expand All @@ -72,6 +90,7 @@ public GlobalStrings()
Close.Equals(DEFAULT_CLOSE) &&
Today.Equals(DEFAULT_TODAY) &&
Help.Equals(DEFAULT_HELP);
#endif

/// <summary>
/// Reset all strings to default values.
Expand All @@ -88,6 +107,10 @@ public void Reset()
Close = DEFAULT_CLOSE;
Today = DEFAULT_TODAY;
Help = DEFAULT_HELP;

// NET 6 & newer
Continue = DEFAULT_CONTINUE;
TryAgain = DEFAULT_TRY;
}

/// <summary>
Expand Down Expand Up @@ -190,6 +213,24 @@ public void Reset()
[DefaultValue(DEFAULT_HELP)]
[RefreshProperties(RefreshProperties.All)]
public string Help { get; set; }
#endregion

/// <summary>
/// Gets and sets the Continue string used in calendars.
/// </summary>
[Localizable(true)]
[Category(@"Visuals")]
[Description(@"Continue string used for Message Box Buttons.")]
[DefaultValue(DEFAULT_CONTINUE)]
public string Continue { get; set; }

/// <summary>
/// Gets and sets the Try Again string used in calendars.
/// </summary>
[Localizable(true)]
[Category(@"Visuals")]
[Description(@"Try Again string used for Message Box Buttons.")]
[DefaultValue(DEFAULT_TRY)]
public string TryAgain { get; set; }
#endregion
}
}