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

Alpha kryptonpalette #772

Merged
merged 5 commits into from
Jul 6, 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
3 changes: 2 additions & 1 deletion Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

=======

## 2022-11-xx - Build 2211 - November 2022 <!--Possible August or September release?-->
## 2022-11-xx - Build 2211 - November 2022
* Updated the `KryptonTaskDialog` to use the `KryptonMessageBoxIcon` instead of the standard `System.Windows.Forms.MessageBoxIcon`
* Resolved [#764](https://github.com/Krypton-Suite/Standard-Toolkit/issues/764), `Development-Workflow.md` needs to state what the builds are (i.e. nightly)
* Implemented [#761](https://github.com/Krypton-Suite/Standard-Toolkit/issues/761), Can TFM also include .NET Framework 4.8.1? (**Note:** This only currently applies to users of Visual Studio 2022, until a redistributable becomes available)
* Resolved `ArgumentNullException` when saving `palette.xml` files with serialized Image objects (thanks to [hopla](https://github.com/hopla))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ private class ImageReverseDictionary : Dictionary<string, Bitmap> { }
#endregion

#region Static Fields
private static readonly int _paletteVersion = 19;
//private static readonly int _paletteVersion = 19;
PWagner1 marked this conversation as resolved.
Show resolved Hide resolved
#endregion

#region Constants

private const int CURRENT_PALETTE_VERSION = 19;

#endregion

#region Instance Fields
Expand Down Expand Up @@ -3049,9 +3055,9 @@ private void ImportFromXmlDocument(XmlDocument doc)
// Grab the version number of the format being loaded
var version = int.Parse(root.GetAttribute("Version"));

if (version < _paletteVersion)
if (version < CURRENT_PALETTE_VERSION)
{
throw new ArgumentException("Version '" + version + "' number is incompatible, only version " + _paletteVersion.ToString() +
throw new ArgumentException("Version '" + version + "' number is incompatible, only version " + CURRENT_PALETTE_VERSION +
" or above can be imported.\nUse the PaletteUpgradeTool from the Application tab of the KryptonExplorer to upgrade.");
}

Expand Down Expand Up @@ -3173,7 +3179,7 @@ private XmlDocument ExportToXmlDocument(bool ignoreDefaults)
// Create a root node with version and the date information, by
// having a version number the loading of older version is easier
XmlElement root = doc.CreateElement("KryptonPalette");
root.SetAttribute("Version", _paletteVersion.ToString());
root.SetAttribute("Version", CURRENT_PALETTE_VERSION.ToString());
root.SetAttribute("Generated", DateTime.Now.ToLongDateString() + ", @" + DateTime.Now.ToShortTimeString());
doc.AppendChild(root);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class KryptonTaskDialog : Component, INotifyPropertyChanged
private string _mainInstruction;
private string _content;
private Image _customIcon;
private MessageBoxIcon _icon;
private KryptonMessageBoxIcon _icon;
private KryptonTaskDialogCommand _defaultRadioButton;
private TaskDialogButtons _commonButtons;
private TaskDialogButtons _defaultButton;
private MessageBoxIcon _footerIcon;
private KryptonMessageBoxIcon _footerIcon;
private Image _customFooterIcon;
private string _footerText;
private string _footerHyperlink;
Expand Down Expand Up @@ -163,8 +163,8 @@ public string Content
/// </summary>
[Category(@"Appearance")]
[Description(@"Predefined icon.")]
[DefaultValue(typeof(MessageBoxIcon), "None")]
public MessageBoxIcon Icon
[DefaultValue(typeof(KryptonMessageBoxIcon), "None")]
public KryptonMessageBoxIcon Icon
{
get => _icon;

Expand Down Expand Up @@ -285,8 +285,8 @@ public TaskDialogButtons DefaultButton
/// </summary>
[Category(@"Appearance")]
[Description(@"Predefined footer icon.")]
[DefaultValue(typeof(MessageBoxIcon), "None")]
public MessageBoxIcon FooterIcon
[DefaultValue(typeof(KryptonMessageBoxIcon), "None")]
public KryptonMessageBoxIcon FooterIcon
{
get => _footerIcon;

Expand Down Expand Up @@ -504,7 +504,7 @@ public DialogResult ShowDialog(IWin32Window owner)
public static DialogResult Show(string windowTitle,
string mainInstruction,
string content,
MessageBoxIcon icon,
KryptonMessageBoxIcon icon,
TaskDialogButtons commonButtons)
{
// Create a temporary task dialog for storing definition whilst showing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void ResetColor5()
public Font Font1 { get; set; }

/// <summary>
/// esets the Font1 property to its default value.
/// Resets the Font1 property to its default value.
/// </summary>
public void ResetFont1()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#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 - 2022. All rights reserved.
*
*/
#endregion


namespace Krypton.Toolkit
{
/// <summary>Storage of user supplied font values, not used by Krypton.</summary>
public class KryptonPaletteFont : Storage
{
#region Identity

/// <summary>Initializes a new instance of the <see cref="KryptonPaletteFont" /> class.</summary>
/// <param name="needPaint">Delegate for notifying paint requests.</param>
public KryptonPaletteFont(NeedPaintHandler needPaint)
{
NeedPaint = needPaint;
}

#endregion

#region IsDefault
/// <summary>
/// Gets a value indicating if all values are default.
/// </summary>
[Browsable(false)]
public override bool IsDefault => (Font1 == new Font("Segoe UI", 9f)) && (Font2 == new Font("Segoe UI", 9f));

#endregion

#region Font1
/// <summary>
/// Gets and sets a user supplied font value.
/// </summary>
[KryptonPersist(false)]
[Category(@"Visuals")]
[Description(@"User supplied font value.")]
[DefaultValue(null)]
[RefreshProperties(RefreshProperties.All)]
public Font Font1 { get; set; }

/// <summary>
/// Resets the Font1 property to its default value.
/// </summary>
public void ResetFont1() => Font1 = new Font("Segoe UI", 9f);

#endregion

#region Font2
/// <summary>
/// Gets and sets a user supplied font value.
/// </summary>
[KryptonPersist(false)]
[Category(@"Visuals")]
[Description(@"User supplied font value.")]
[DefaultValue(null)]
[RefreshProperties(RefreshProperties.All)]
public Font Font2 { get; set; }

/// <summary>
/// Resets the Font2 property to its default value.
/// </summary>
public void ResetFont2() => Font2 = new Font("Segoe UI", 9f);

#endregion
}
}