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 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
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
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ Follow the links to see the different objects and layouts that this framework al

<a href="https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Documents/Help/Changelog.md"><img src="https://img.shields.io/badge/Version History-Changelog-brightgreen.svg?style=flat-square" /></a>

## Breaking Changes
There are list of changes that have occurred during the development of the V6.## version
=======

# Breaking Changes
There are list of changes that have occurred during the development of the V70.## version

### Ribbon Tooltips
- https://github.com/Krypton-Suite/Standard-Toolkit/issues/382
Expand All @@ -149,7 +151,15 @@ There are list of changes that have occurred during the development of the V6.##
### `dpiAware`
If you are getting scaling problems in high dpi monitors, then please add an application manifest to your MainForm application, and uncomment the section that covers the `dpiAware` setting.

## Known Issues & Workarounds
## `KryptonTaskDialog`
As of v70.xx, the `KryptonTaskDialog` now uses the built-in `KryptonMessageBoxIcon` instead of the standard `System.Windows.Forms.MessageBoxIcon`. This will cause errors within your project. To resolve, simply replace `MessageBoxIcon` with the `KryptonMessageBoxIcon` equivalent.

## `KryptonPalette`
Both ***Font1*** & ***Font2*** have been removed from `Cargo`, as they were not used.

=======

# Known Issues & Workarounds

- [#665](https://github.com/Krypton-Suite/Standard-Toolkit/issues/665) - Workaround add `net48` to your `<TargetFrameworks>` if using .NET Core 3.1 or .NET 5/6 or 7

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Krypton.Toolkit
{
[EditorBrowsable(EditorBrowsableState.Never), ToolboxItem(false)]
public class KryptonButtonPanel : UserControl
{
private KryptonPanel kpnlContainer;
private KryptonBorderEdge kbeTopDivider;
private void InitializeComponent()
{
this.kpnlContainer = new Krypton.Toolkit.KryptonPanel();
this.kbeTopDivider = new Krypton.Toolkit.KryptonBorderEdge();
((System.ComponentModel.ISupportInitialize)(this.kpnlContainer)).BeginInit();
this.kpnlContainer.SuspendLayout();
this.SuspendLayout();
//
// kpnlContainer
//
this.kpnlContainer.Controls.Add(this.kbeTopDivider);
this.kpnlContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.kpnlContainer.Location = new System.Drawing.Point(0, 0);
this.kpnlContainer.Name = "kpnlContainer";
this.kpnlContainer.Size = new System.Drawing.Size(280, 50);
this.kpnlContainer.TabIndex = 0;
//
// kbeTopDivider
//
this.kbeTopDivider.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
this.kbeTopDivider.Dock = System.Windows.Forms.DockStyle.Top;
this.kbeTopDivider.Location = new System.Drawing.Point(0, 0);
this.kbeTopDivider.Name = "kbeTopDivider";
this.kbeTopDivider.Size = new System.Drawing.Size(280, 1);
this.kbeTopDivider.Text = "kbeTopDivider";
//
// KryptonButtonPanel
//
this.Controls.Add(kpnlContainer);
this.Name = "KryptonButtonPanel";
this.Size = new System.Drawing.Size(247, 50);
((System.ComponentModel.ISupportInitialize)(this.kpnlContainer)).EndInit();
this.kpnlContainer.ResumeLayout(false);
this.kpnlContainer.PerformLayout();
this.ResumeLayout(false);

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ private class ImageDictionary : Dictionary<Bitmap, string> { }
private class ImageReverseDictionary : Dictionary<string, Bitmap> { }
#endregion

#region Static Fields
private static readonly int _paletteVersion = 19;
#region Constants

private const int CURRENT_PALETTE_VERSION = 19;

#endregion

#region Instance Fields
Expand Down Expand Up @@ -121,6 +123,7 @@ public KryptonPalette()
ContextMenu = new KryptonPaletteContextMenu(_redirectCommon, _needPaintDelegate);
DragDrop = new PaletteDragDrop(_redirectCommon, _needPaintDelegate);
FormStyles = new KryptonPaletteForms(_redirectCommon, _needPaintDelegate);
//Font = new KryptonPaletteFont(_redirectCommon, _needPaintDelegate);
GridStyles = new KryptonPaletteGrids(_redirectCommon, _needPaintDelegate);
HeaderStyles = new KryptonPaletteHeaders(_redirectCommon, _needPaintDelegate);
HeaderGroup = new KryptonPaletteHeaderGroup(_redirector, _needPaintDelegate);
Expand Down Expand Up @@ -363,6 +366,22 @@ public KryptonPaletteCheckButtons ButtonStyles

#endregion

#region Font
/*
/// <summary>
/// Gets access to defining the font and colour values for text.
/// </summary>
[KryptonPersist]
[Category(@"Visuals")]
[Description(@"Overrides the font and colour values for text.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public KryptonPaletteFont Font { get; set; }

//public bool ShouldSerializeFont() => !Font.IsDefault;
*/

#endregion

#region HeaderGroup
/// <summary>
/// Gets access to the HeaderGroup appearance entries.
Expand Down Expand Up @@ -3049,9 +3068,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 +3192,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
Loading