From d38d96f4ea1136870afcf04e43db7429b4231dc5 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 17 Nov 2023 09:58:01 +0000 Subject: [PATCH] * V80 Patch 1 --- Documents/Help/Changelog.md | 8 + .../KryptonRibbonGroupThemeComboBox.cs | 37 +++- .../Controls Toolkit/KryptonForm.cs | 2 - .../Controls Toolkit/KryptonThemeComboBox.cs | 44 ++++- .../Controls Visuals/VisualForm.cs | 128 -------------- .../Sparkle/Base/PaletteSparkleBase.cs | 74 ++++++++ .../TestForm/Form1.Designer.cs | 52 +++--- .../TestForm/Form3.Designer.cs | 160 +----------------- Source/Krypton Components/TestForm/Form3.cs | 12 +- 9 files changed, 190 insertions(+), 327 deletions(-) diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 36b3d7259..be737c6fb 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -2,6 +2,14 @@ ======= +## 2023-11-17 - Build 2311 (Patch 1) - November 2023 +* Resolved issue where an assertion is made when using `KryptonThemeComboBox` or `KryptonRibbonGroupThemeComboBox` +* Resolved issue where `Sparkle` themes would crash when using certain `ButtonSpecs` +* Resolved [#1174](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1174), Unable to adjust height of `KryptonForm` when `KryptonRibbon` is added + - _Note:_ This disables features from [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), until further testing is completed + +======= + ## 2023-11-14 - Build 2311 - November 2023 * 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 [#1153](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1153), Whilst investigating #1152 found that "Start drag" in certain application causes an exception. diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs index f771f28bb..d8a80ddce 100644 --- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs +++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs @@ -23,27 +23,48 @@ namespace Krypton.Ribbon public class KryptonRibbonGroupThemeComboBox : KryptonRibbonGroupComboBox { #region Instance Fields + private int _selectedIndex; + + private readonly int _defaultPaletteIndex = (int)PaletteMode.Microsoft365Blue; + + private PaletteMode _defaultPalette; + #endregion #region Public + /// Gets or sets the default palette mode. + /// The default palette mode. + [Category(@"Visuals")] + [Description(@"The default palette mode.")] + [DefaultValue(PaletteMode.Microsoft365Blue)] + public PaletteMode DefaultPalette + { + get => _defaultPalette; + set + { + _defaultPalette = value; + UpdateDefaultPaletteIndex(value); + } + } + /// /// Gets and sets the ThemeSelectedIndex. /// [Category(@"Visuals")] [Description(@"Theme Selected Index. (Default = `Office 365 - Blue`)")] - [DefaultValue(33)] + [DefaultValue((int)PaletteMode.Microsoft365Blue)] public int ThemeSelectedIndex { get => _selectedIndex; - set => SelectedIndex = value; + private set => SelectedIndex = value; } - private void ResetThemeSelectedIndex() => _selectedIndex = 33; + private void ResetThemeSelectedIndex() => _selectedIndex = (int)PaletteMode.Microsoft365Blue; - private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != 33; + private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != (int)PaletteMode.Microsoft365Blue; /// /// Gets and sets the ThemeSelectedIndex. @@ -75,14 +96,18 @@ public KryptonRibbonGroupThemeComboBox() } var cnvtr = new PaletteModeConverter(); Text = cnvtr.ConvertToString(PaletteMode.Microsoft365Blue)!; - _selectedIndex = SelectedIndex; - Debug.Assert(_selectedIndex == 33, "Microsoft365Blue needs to be at the 33rd index for backward compatibility"); + + _selectedIndex = SelectedIndex = _defaultPaletteIndex; + _defaultPalette = PaletteMode.Microsoft365Blue; + Debug.Assert(_selectedIndex == _defaultPaletteIndex, $@"Microsoft365Blue needs to be at the index position of {_defaultPaletteIndex} for backward compatibility"); } #endregion #region Implementation + private void UpdateDefaultPaletteIndex(PaletteMode mode) => _selectedIndex = (int)mode; + /// Returns the palette mode. /// ///
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs index 6e24fde56..bcca89211 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs @@ -199,8 +199,6 @@ public KryptonForm() #pragma warning disable CS0618 _useDropShadow = false; #pragma warning restore CS0618 - - BackStyle = PaletteBackStyle.PanelClient; } /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs index 9a2565d61..f4b7cf62f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs @@ -20,26 +20,47 @@ public class KryptonThemeComboBox : KryptonComboBox private int _selectedIndex; + private readonly int _defaultPaletteIndex = (int)PaletteMode.Microsoft365Blue; + + private PaletteMode _defaultPalette; + #endregion #region Public + /// Gets or sets the default palette mode. + /// The default palette mode. + [Category(@"Visuals")] + [Description(@"The default palette mode.")] + [DefaultValue(PaletteMode.Microsoft365Blue)] + public PaletteMode DefaultPalette + { + get => _defaultPalette; + + set + { + _defaultPalette = value; + + UpdateDefaultPaletteIndex(value); + } + } + /// /// Gets and sets the ThemeSelectedIndex. /// [Category(@"Visuals")] [Description(@"Theme Selected Index. (Default = `Office 365 - Blue`)")] - [DefaultValue(33)] + [DefaultValue((int)PaletteMode.Microsoft365Blue)] public int ThemeSelectedIndex { - get => _selectedIndex; + get => _selectedIndex = _defaultPaletteIndex; - set => _selectedIndex = SelectedIndex = value; + private set => _selectedIndex = SelectedIndex = value; } - private void ResetThemeSelectedIndex() => _selectedIndex = 33; + private void ResetThemeSelectedIndex() => _selectedIndex = _defaultPaletteIndex; - private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != 33; + private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != _defaultPaletteIndex; /// /// Gets and sets the ThemeSelectedIndex. @@ -69,13 +90,18 @@ public KryptonThemeComboBox() Items.Add(kvp.Key); } Text = ThemeManager.ReturnPaletteModeAsString(PaletteMode.Microsoft365Blue); - _selectedIndex = SelectedIndex; - Debug.Assert(_selectedIndex == 33, "Microsoft365Blue needs to be at the 33rd index for backward compatibility"); + _selectedIndex = SelectedIndex = _defaultPaletteIndex; + + _defaultPalette = PaletteMode.Microsoft365Blue; + + Debug.Assert(_selectedIndex == _defaultPaletteIndex, $@"Microsoft365Blue needs to be at the index position of {_defaultPaletteIndex} for backward compatibility"); } #endregion #region Implementation + private void UpdateDefaultPaletteIndex(PaletteMode mode) => ThemeSelectedIndex = (int)mode + 1; + /// Returns the palette mode. /// ///
@@ -165,6 +191,10 @@ public override string Text set => base.AutoCompleteCustomSource = value; } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int SelectedIndex { get => base.SelectedIndex; set => base.SelectedIndex = value; } + #endregion } diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs index efefcbe3f..8a0a1797b 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs @@ -28,8 +28,6 @@ public abstract class VisualForm : Form, private const int DEFAULT_COMPOSITION_HEIGHT = 30; private static readonly bool _themedApp; private readonly PaletteDoubleRedirect _stateCommon; - private readonly PaletteContentInheritRedirect ItemShortcutTextRedirect; - private readonly PaletteContentJustShortText ItemShortcutText; #endregion @@ -107,8 +105,6 @@ public VisualForm() { InitializeComponent(); - base.DoubleBuffered = true; - // Automatically redraw whenever the size of the window changes SetStyle(ControlStyles.ResizeRedraw, true); @@ -136,9 +132,6 @@ public VisualForm() _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ButtonCustom1, PaletteBorderStyle.ButtonCustom1, NeedPaintDelegate); - ItemShortcutTextRedirect = new PaletteContentInheritRedirect(Redirector, PaletteContentStyle.LabelNormalPanel); - ItemShortcutText = new PaletteContentJustShortText(ItemShortcutTextRedirect, NeedPaintDelegate); - // Hook into global static events KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; @@ -192,120 +185,6 @@ protected override void Dispose(bool disposing) #region Public - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - protected override bool DoubleBuffered - { - get => true; - set - { - // Do Nothing - } - } - - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color BackColor - { - get - { - Color rawBackColor = _stateCommon.Back.GetBackColor1(Enabled ? PaletteState.Disabled : PaletteState.Normal); - return !rawBackColor.IsEmpty ? rawBackColor : Control.DefaultBackColor; - } - set - { - //Do Nothing; - } - } - - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [AmbientValue(null)] - public override Font Font - { - get => ItemShortcutText.GetContentShortTextFont(Enabled ? PaletteState.Disabled : PaletteState.Normal); - set - { - //Do Nothing; - } - } - - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color ForeColor - { - get => ItemShortcutText.GetContentShortTextColor1(Enabled ? PaletteState.Disabled : PaletteState.Normal); - set - { - //Do Nothing; - } - } - - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [DefaultValue(null)] - public override Image? BackgroundImage - { - get => _stateCommon.Back.GetBackImage(Enabled ? PaletteState.Disabled : PaletteState.Normal); - set - { - //Do Nothing; - } - } - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [DefaultValue(ImageLayout.Tile)] - public override ImageLayout BackgroundImageLayout - { - get - { - return _stateCommon.Back.GetBackImageStyle(Enabled ? PaletteState.Disabled : PaletteState.Normal) switch - { - PaletteImageStyle.TopMiddle => ImageLayout.Center, - PaletteImageStyle.CenterLeft => ImageLayout.Center, - PaletteImageStyle.CenterMiddle => ImageLayout.Center, - PaletteImageStyle.CenterRight => ImageLayout.Center, - PaletteImageStyle.Stretch => ImageLayout.Stretch, - PaletteImageStyle.Tile => ImageLayout.Tile, - _ => ImageLayout.None - }; - } - set - { - //Do Nothing; - } - } - - /// Sets the default panel backcolor source i.e. PanelClient. - [DefaultValue(typeof(PaletteBackStyle), @"PaletteBackStyle.PanelClient")] - [Description(@"Sets the default panel backcolor source i.e. PanelClient.")] - public PaletteBackStyle BackStyle - { - get => _stateCommon.BackStyle; - - set - { - if (_stateCommon.BackStyle != value) - { - _stateCommon.BackStyle = value; - - PerformNeedPaint(true); - } - } - } - /// /// Gets the DpiX of the view. /// @@ -1205,13 +1084,6 @@ protected virtual void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEven InvalidateNonClient(); } } - - // Force repaint of Background etc. - OnBackColorChanged(EventArgs.Empty); - OnBackgroundImageChanged(EventArgs.Empty); - OnBackgroundImageLayoutChanged(EventArgs.Empty); - OnFontChanged(EventArgs.Empty); - OnForeColorChanged(EventArgs.Empty); } /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs index 091582007..2a0533cfd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs @@ -18,6 +18,9 @@ namespace Krypton.Toolkit public class PaletteSparkleBase : PaletteBase { #region Static Fields + + #region Padding + private static readonly Padding _contentPaddingGrid = new Padding(2, 1, 2, 1); private static readonly Padding _contentPaddingHeader1 = new Padding(3, 2, 2, 2); private static readonly Padding _contentPaddingHeader2 = new Padding(3, 2, 2, 2); @@ -56,6 +59,10 @@ public class PaletteSparkleBase : PaletteBase private static readonly Padding _metricPaddingPageButtons = new Padding(1, 3, 1, 3); private static readonly Padding _metricPaddingContextMenuItemHighlight = new Padding(1, 0, 1, 0); + #endregion + + #region Images + private static readonly Image _disabledDropDown = DropDownArrowImageResources.DisabledDropDownButton2; private static readonly Image _disabledDropUp = DropDownArrowImageResources.DisabledDropUpButton; private static readonly Image _disabledGalleryDrop = GalleryImageResources.DisabledGalleryDropButton; @@ -99,6 +106,42 @@ public class PaletteSparkleBase : PaletteBase private static readonly Image? _treeExpandWhite = TreeItemImageResources.TreeExpandWhite; private static readonly Image? _treeCollapseBlack = TreeItemImageResources.TreeCollapseBlack; + #region Integrated Tool Bar Images + + private static readonly Image _integratedToolbarNewNormal = Office2010ToolbarImageResources.Office2010ToolbarNewNormal; + + private static readonly Image _integratedToolbarOpenNormal = Office2010ToolbarImageResources.Office2010ToolbarOpenNormal; + + private static readonly Image _integratedToolbarSaveAllNormal = Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal; + + private static readonly Image _integratedToolbarSaveAsNormal = Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal; + + private static readonly Image _integratedToolbarSaveNormal = Office2010ToolbarImageResources.Office2010ToolbarSaveNormal; + + private static readonly Image _integratedToolbarCutNormal = Office2010ToolbarImageResources.Office2010ToolbarCutNormal; + + private static readonly Image _integratedToolbarCopyNormal = Office2010ToolbarImageResources.Office2010ToolbarCopyNormal; + + private static readonly Image _integratedToolbarPasteNormal = Office2010ToolbarImageResources.Office2010ToolbarPasteNormal; + + private static readonly Image _integratedToolbarUndoNormal = Office2010ToolbarImageResources.Office2010ToolbarUndoNormal; + + private static readonly Image _integratedToolbarRedoNormal = Office2010ToolbarImageResources.Office2010ToolbarRedoNormal; + + private static readonly Image _integratedToolbarPageSetupNormal = Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal; + + private static readonly Image _integratedToolbarPrintPreviewNormal = Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal; + + private static readonly Image _integratedToolbarPrintNormal = Office2010ToolbarImageResources.Office2010ToolbarPrintNormal; + + private static readonly Image _integratedToolbarQuickPrintNormal = Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal; + + #endregion + + #endregion + + #region Colours + private static readonly Color _disabledText = Color.FromArgb(120, 120, 120); private static readonly Color _disabledBack = Color.FromArgb(224, 224, 224); private static readonly Color _disabledBack2 = Color.FromArgb(240, 240, 240); @@ -141,6 +184,9 @@ public class PaletteSparkleBase : PaletteBase private static readonly Color _menuItemDisabledBack2 = Color.FromArgb(164, 190, 190, 190); private static readonly Color _menuItemDisabledBorder = Color.FromArgb(164, 172, 172, 172); private static readonly Color _menuItemDisabledImageBorder = Color.FromArgb(200, 200, 200); + + #endregion + #endregion #region Instance Fields @@ -3149,6 +3195,34 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin return _buttonSpecRibbonMinimize; case PaletteButtonSpecStyle.RibbonExpand: return _buttonSpecRibbonExpand; + case PaletteButtonSpecStyle.New: + return _integratedToolbarNewNormal; + case PaletteButtonSpecStyle.Open: + return _integratedToolbarOpenNormal; + case PaletteButtonSpecStyle.Save: + return _integratedToolbarSaveNormal; + case PaletteButtonSpecStyle.SaveAs: + return _integratedToolbarSaveAsNormal; + case PaletteButtonSpecStyle.SaveAll: + return _integratedToolbarSaveAllNormal; + case PaletteButtonSpecStyle.Cut: + return _integratedToolbarCutNormal; + case PaletteButtonSpecStyle.Copy: + return _integratedToolbarCopyNormal; + case PaletteButtonSpecStyle.Paste: + return _integratedToolbarPasteNormal; + case PaletteButtonSpecStyle.Undo: + return _integratedToolbarUndoNormal; + case PaletteButtonSpecStyle.Redo: + return _integratedToolbarRedoNormal; + case PaletteButtonSpecStyle.PageSetup: + return _integratedToolbarPageSetupNormal; + case PaletteButtonSpecStyle.PrintPreview: + return _integratedToolbarPrintPreviewNormal; + case PaletteButtonSpecStyle.Print: + return _integratedToolbarPrintNormal; + case PaletteButtonSpecStyle.QuickPrint: + return _integratedToolbarQuickPrintNormal; case PaletteButtonSpecStyle.Generic: return null; default: diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index 39f9c1f7e..abcc994c2 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -30,6 +30,8 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonButton7 = new Krypton.Toolkit.KryptonButton(); + this.kryptonButton6 = new Krypton.Toolkit.KryptonButton(); this.kbtnExit = new Krypton.Toolkit.KryptonButton(); this.kryptonButton5 = new Krypton.Toolkit.KryptonButton(); this.kryptonButton4 = new Krypton.Toolkit.KryptonButton(); @@ -66,8 +68,6 @@ private void InitializeComponent() this.buttonSpecAny10 = new Krypton.Toolkit.ButtonSpecAny(); this.kryptonIntegratedToolbarPrintCommand1 = new Krypton.Toolkit.KryptonIntegratedToolbarPrintCommand(); this.kryptonManager1 = new Krypton.Toolkit.KryptonManager(this.components); - this.kryptonButton6 = new Krypton.Toolkit.KryptonButton(); - this.kryptonButton7 = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); @@ -100,6 +100,24 @@ private void InitializeComponent() this.kryptonPanel1.Size = new System.Drawing.Size(600, 563); this.kryptonPanel1.TabIndex = 0; // + // kryptonButton7 + // + this.kryptonButton7.Location = new System.Drawing.Point(300, 456); + this.kryptonButton7.Name = "kryptonButton7"; + this.kryptonButton7.Size = new System.Drawing.Size(90, 25); + this.kryptonButton7.TabIndex = 17; + this.kryptonButton7.Values.Text = "Export"; + this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click); + // + // kryptonButton6 + // + this.kryptonButton6.Location = new System.Drawing.Point(203, 456); + this.kryptonButton6.Name = "kryptonButton6"; + this.kryptonButton6.Size = new System.Drawing.Size(90, 25); + this.kryptonButton6.TabIndex = 16; + this.kryptonButton6.Values.Text = "Import"; + this.kryptonButton6.Click += new System.EventHandler(this.kryptonButton6_Click); + // // kbtnExit // this.kbtnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -195,17 +213,19 @@ private void InitializeComponent() this.kryptonButton2.Size = new System.Drawing.Size(185, 25); this.kryptonButton2.TabIndex = 6; this.kryptonButton2.Values.Text = "Ribbon (Form3)"; + this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click); // // kryptonThemeComboBox1 // + this.kryptonThemeComboBox1.DefaultPalette = Krypton.Toolkit.PaletteMode.Microsoft365Blue; this.kryptonThemeComboBox1.DisplayMember = "Key"; this.kryptonThemeComboBox1.DropDownWidth = 121; this.kryptonThemeComboBox1.IntegralHeight = false; this.kryptonThemeComboBox1.Location = new System.Drawing.Point(12, 12); this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1"; this.kryptonThemeComboBox1.Size = new System.Drawing.Size(185, 21); - this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) - | Krypton.Toolkit.PaletteDrawBorders.Left) + this.kryptonThemeComboBox1.StateCommon.ComboBox.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom) + | Krypton.Toolkit.PaletteDrawBorders.Left) | Krypton.Toolkit.PaletteDrawBorders.Right))); this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; this.kryptonThemeComboBox1.TabIndex = 4; @@ -331,23 +351,9 @@ private void InitializeComponent() // this.kryptonIntegratedToolbarPrintCommand1.Text = "Print"; // - // kryptonButton6 + // kryptonManager1 // - this.kryptonButton6.Location = new System.Drawing.Point(203, 456); - this.kryptonButton6.Name = "kryptonButton6"; - this.kryptonButton6.Size = new System.Drawing.Size(90, 25); - this.kryptonButton6.TabIndex = 16; - this.kryptonButton6.Values.Text = "Import"; - this.kryptonButton6.Click += new System.EventHandler(this.kryptonButton6_Click); - // - // kryptonButton7 - // - this.kryptonButton7.Location = new System.Drawing.Point(300, 456); - this.kryptonButton7.Name = "kryptonButton7"; - this.kryptonButton7.Size = new System.Drawing.Size(90, 25); - this.kryptonButton7.TabIndex = 17; - this.kryptonButton7.Values.Text = "Export"; - this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click); + this.kryptonManager1.GlobalPaletteMode = Krypton.Toolkit.PaletteMode.SparklePurpleLightMode; // // Form1 // @@ -366,14 +372,10 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(600, 563); this.Controls.Add(this.kryptonPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.FormMain; - this.GroupBorderStyle = Krypton.Toolkit.PaletteBorderStyle.FormMain; - this.HeaderStyle = Krypton.Toolkit.HeaderStyle.Form; + this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.Margin = new System.Windows.Forms.Padding(2); this.Name = "Form1"; this.Text = "Form1"; - this.TitleStyle = Krypton.Toolkit.KryptonFormTitleStyle.Inherit; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); diff --git a/Source/Krypton Components/TestForm/Form3.Designer.cs b/Source/Krypton Components/TestForm/Form3.Designer.cs index 86a92dd5f..6fc6e9793 100644 --- a/Source/Krypton Components/TestForm/Form3.Designer.cs +++ b/Source/Krypton Components/TestForm/Form3.Designer.cs @@ -29,37 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.kryptonRibbon1 = new Krypton.Ribbon.KryptonRibbon(); - this.kryptonRibbonTab1 = new Krypton.Ribbon.KryptonRibbonTab(); - this.kryptonRibbonGroup1 = new Krypton.Ribbon.KryptonRibbonGroup(); - this.kryptonRibbonGroupTriple1 = new Krypton.Ribbon.KryptonRibbonGroupTriple(); - this.kryptonRibbonGroupButton1 = new Krypton.Ribbon.KryptonRibbonGroupButton(); - this.kryptonRibbonGroupButton2 = new Krypton.Ribbon.KryptonRibbonGroupButton(); - this.kryptonRibbonGroupButton3 = new Krypton.Ribbon.KryptonRibbonGroupButton(); - this.kryptonRibbonGroup2 = new Krypton.Ribbon.KryptonRibbonGroup(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonRibbonGroupSeparator1 = new Krypton.Ribbon.KryptonRibbonGroupSeparator(); - this.kryptonRibbonGroupTriple2 = new Krypton.Ribbon.KryptonRibbonGroupTriple(); - this.kryptonRibbonGroupThemeComboBox1 = new Krypton.Ribbon.KryptonRibbonGroupThemeComboBox(); - this.kryptonRibbonGroupSeparator1 = new Krypton.Ribbon.KryptonRibbonGroupSeparator(); - this.kryptonRibbonGroupTriple2 = new Krypton.Ribbon.KryptonRibbonGroupTriple(); - this.kryptonRibbonGroupThemeComboBox1 = new Krypton.Ribbon.KryptonRibbonGroupThemeComboBox(); - this.kryptonRibbonGroup2 = new Krypton.Ribbon.KryptonRibbonGroup(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonContextMenuItem1 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem2 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem3 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem4 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem5 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem6 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonContextMenuItem7 = new Krypton.Toolkit.KryptonContextMenuItem(); - this.kryptonRibbonRecentDoc1 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); - this.kryptonRibbonRecentDoc2 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); - this.kryptonRibbonRecentDoc3 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); - this.kryptonRibbonRecentDoc4 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); - this.kryptonRibbonRecentDoc5 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); - this.kryptonRibbonRecentDoc6 = new Krypton.Ribbon.KryptonRibbonRecentDoc(); ((System.ComponentModel.ISupportInitialize)(this.kryptonRibbon1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.SuspendLayout(); // // kryptonRibbon1 @@ -67,122 +37,20 @@ private void InitializeComponent() this.kryptonRibbon1.AllowFormIntegrate = true; this.kryptonRibbon1.InDesignHelperMode = true; this.kryptonRibbon1.Name = "kryptonRibbon1"; - this.kryptonRibbon1.RibbonTabs.AddRange(new Krypton.Ribbon.KryptonRibbonTab[] { - this.kryptonRibbonTab1}); - this.kryptonRibbon1.RibbonAppButton.AppButtonMenuItems.AddRange(new Krypton.Toolkit.KryptonContextMenuItemBase[] { - this.kryptonContextMenuItem1, - this.kryptonContextMenuItem2, - this.kryptonContextMenuItem3, - this.kryptonContextMenuItem4, - this.kryptonContextMenuItem5, - this.kryptonContextMenuItem6, - this.kryptonContextMenuItem7}); - this.kryptonRibbon1.RibbonAppButton.AppButtonRecentDocs.AddRange(new Krypton.Ribbon.KryptonRibbonRecentDoc[] { - this.kryptonRibbonRecentDoc1, - this.kryptonRibbonRecentDoc2, - this.kryptonRibbonRecentDoc3, - this.kryptonRibbonRecentDoc4, - this.kryptonRibbonRecentDoc5, - this.kryptonRibbonRecentDoc6}); - this.kryptonRibbon1.RibbonTabs.AddRange(new Krypton.Ribbon.KryptonRibbonTab[] { - this.kryptonRibbonTab1}); this.kryptonRibbon1.SelectedContext = null; - this.kryptonRibbon1.SelectedTab = this.kryptonRibbonTab1; - this.kryptonRibbon1.Size = new System.Drawing.Size(800, 115); + this.kryptonRibbon1.SelectedTab = null; + this.kryptonRibbon1.Size = new System.Drawing.Size(800, 143); this.kryptonRibbon1.TabIndex = 0; // - // kryptonRibbonTab1 - // - this.kryptonRibbonTab1.Groups.AddRange(new Krypton.Ribbon.KryptonRibbonGroup[] { - this.kryptonRibbonGroup1, - this.kryptonRibbonGroup2}); - // - // kryptonRibbonGroup1 - // - this.kryptonRibbonGroup1.Items.AddRange(new Krypton.Ribbon.KryptonRibbonGroupContainer[] { - this.kryptonRibbonGroupTriple1, - this.kryptonRibbonGroupSeparator1, - this.kryptonRibbonGroupTriple2}); - // - // kryptonRibbonGroupTriple1 - // - this.kryptonRibbonGroupTriple1.Items.AddRange(new Krypton.Ribbon.KryptonRibbonGroupItem[] { - this.kryptonRibbonGroupButton1, - this.kryptonRibbonGroupButton2, - this.kryptonRibbonGroupButton3}); - // - // kryptonRibbonGroupTriple2 - // - this.kryptonRibbonGroupTriple2.Items.AddRange(new Krypton.Ribbon.KryptonRibbonGroupItem[] { - this.kryptonRibbonGroupThemeComboBox1}); - // - // kryptonRibbonGroupThemeComboBox1 - // - this.kryptonRibbonGroupThemeComboBox1.DisplayMember = "Key"; - this.kryptonRibbonGroupThemeComboBox1.DropDownWidth = 200; - this.kryptonRibbonGroupThemeComboBox1.FormattingEnabled = false; - this.kryptonRibbonGroupThemeComboBox1.ItemHeight = 15; - this.kryptonRibbonGroupThemeComboBox1.MaximumSize = new System.Drawing.Size(200, 0); - this.kryptonRibbonGroupThemeComboBox1.ValueMember = "Value"; - // - // kryptonPanel1 - // - this.kryptonPanel1.Location = new System.Drawing.Point(193, 194); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.Size = new System.Drawing.Size(100, 100); - this.kryptonPanel1.TabIndex = 1; - // - // kryptonRibbonGroupTriple2 - // - this.kryptonRibbonGroupTriple2.Items.AddRange(new Krypton.Ribbon.KryptonRibbonGroupItem[] { - this.kryptonRibbonGroupThemeComboBox1}); - // - // kryptonRibbonGroupThemeComboBox1 - // - this.kryptonRibbonGroupThemeComboBox1.DisplayMember = "Key"; - this.kryptonRibbonGroupThemeComboBox1.DropDownWidth = 121; - this.kryptonRibbonGroupThemeComboBox1.FormattingEnabled = false; - this.kryptonRibbonGroupThemeComboBox1.ItemHeight = 15; - this.kryptonRibbonGroupThemeComboBox1.ValueMember = "Value"; - // kryptonContextMenuItem1 - // - this.kryptonContextMenuItem1.Text = "Menu Item"; - // - // kryptonContextMenuItem2 - // - this.kryptonContextMenuItem2.Text = "Menu Item"; - // - // kryptonContextMenuItem3 - // - this.kryptonContextMenuItem3.Text = "Menu Item"; - // - // kryptonContextMenuItem4 - // - this.kryptonContextMenuItem4.Text = "Menu Item"; - // - // kryptonContextMenuItem5 - // - this.kryptonContextMenuItem5.Text = "Menu Item"; - // - // kryptonContextMenuItem6 - // - this.kryptonContextMenuItem6.Text = "Menu Item"; - // - // kryptonContextMenuItem7 - // - this.kryptonContextMenuItem7.Text = "Menu Item"; - // // Form3 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.kryptonPanel1); this.Controls.Add(this.kryptonRibbon1); this.Name = "Form3"; this.Text = "Form3"; ((System.ComponentModel.ISupportInitialize)(this.kryptonRibbon1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -191,29 +59,5 @@ private void InitializeComponent() #endregion private Krypton.Ribbon.KryptonRibbon kryptonRibbon1; - private Krypton.Ribbon.KryptonRibbonTab kryptonRibbonTab1; - private Krypton.Ribbon.KryptonRibbonGroup kryptonRibbonGroup1; - private Krypton.Ribbon.KryptonRibbonGroupTriple kryptonRibbonGroupTriple1; - private Krypton.Ribbon.KryptonRibbonGroupButton kryptonRibbonGroupButton1; - private Krypton.Ribbon.KryptonRibbonGroupButton kryptonRibbonGroupButton2; - private Krypton.Ribbon.KryptonRibbonGroupButton kryptonRibbonGroupButton3; - private Krypton.Ribbon.KryptonRibbonGroup kryptonRibbonGroup2; - private Krypton.Toolkit.KryptonPanel kryptonPanel1; - private Krypton.Ribbon.KryptonRibbonGroupSeparator kryptonRibbonGroupSeparator1; - private Krypton.Ribbon.KryptonRibbonGroupTriple kryptonRibbonGroupTriple2; - private Krypton.Ribbon.KryptonRibbonGroupThemeComboBox kryptonRibbonGroupThemeComboBox1; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem1; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem2; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem3; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem4; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem5; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem6; - private Krypton.Toolkit.KryptonContextMenuItem kryptonContextMenuItem7; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc1; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc2; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc3; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc4; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc5; - private Krypton.Ribbon.KryptonRibbonRecentDoc kryptonRibbonRecentDoc6; } } \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form3.cs b/Source/Krypton Components/TestForm/Form3.cs index 3550c6a5b..732f14909 100644 --- a/Source/Krypton Components/TestForm/Form3.cs +++ b/Source/Krypton Components/TestForm/Form3.cs @@ -1,4 +1,14 @@ -using Krypton.Toolkit; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +using Krypton.Toolkit; namespace TestForm {