Skip to content

Commit

Permalink
Merge pull request #1213 from Krypton-Suite/alpha-996-KDatagridViewCo…
Browse files Browse the repository at this point in the history
…mboBoxAdd

- When Re-adding Items, then make sure Collection has been cleared.
  • Loading branch information
PWagner1 authored Dec 3, 2023
2 parents 9a566e3 + c17a713 commit 3006ee0
Show file tree
Hide file tree
Showing 72 changed files with 131 additions and 234 deletions.
2 changes: 2 additions & 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
* Resolved [#996](https://github.com/Krypton-Suite/Standard-Toolkit/issues/996), DataGridView ComboBox Adding list over and over
* Resolved [#1207](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1207), Microsoft 365 - Black (Dark Mode) Drop button is not visible
* Resolved [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the Font Size (as it is already covered by the actual font !)
* Resolved [#1197](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1197), `KryptonTaskDialog` Footer Images
Expand All @@ -29,6 +30,7 @@
* 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
* Backed-out [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), Is it possible to have the KForm back colour as the KPanel colour

=======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public KryptonGallery()

// Create content storage
Images = new GalleryImages(NeedPaintDelegate);
DropButtonRanges = new KryptonGalleryRangeCollection();
DropButtonRanges = [];

// Create the palette storage
StateCommon = new PaletteGalleryRedirect(Redirector!, NeedPaintDelegate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2647,19 +2647,19 @@ private void CreateInternal()

private void CreateRibbonCollections()
{
RibbonContexts = new KryptonRibbonContextCollection();
RibbonContexts = [];
RibbonContexts.Clearing += OnRibbonContextsClearing;
RibbonContexts.Cleared += OnRibbonContextsCleared;
RibbonContexts.Inserted += OnRibbonContextsInserted;
RibbonContexts.Removed += OnRibbonContextsRemoved;

RibbonTabs = new KryptonRibbonTabCollection();
RibbonTabs = [];
RibbonTabs.Clearing += OnRibbonTabsClearing;
RibbonTabs.Cleared += OnRibbonTabsCleared;
RibbonTabs.Inserted += OnRibbonTabsInserted;
RibbonTabs.Removed += OnRibbonTabsRemoved;

QATButtons = new KryptonRibbonQATButtonCollection();
QATButtons = [];
QATButtons.Clearing += OnRibbonQATButtonsClearing;
QATButtons.Cleared += OnRibbonQATButtonsCleared;
QATButtons.Inserted += OnRibbonQATButtonsInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public KryptonRibbonGroup()
_maximumWidth = -1;

// Create collection for holding child items
Items = new KryptonRibbonGroupContainerCollection();
Items = [];
Items.Clearing += OnRibbonGroupItemsClearing;
Items.Cleared += OnRibbonGroupItemsCleared;
Items.Inserted += OnRibbonGroupItemsInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public KryptonRibbonTab()
_visible = true;

// Create the collection for defining groups
Groups = new KryptonRibbonGroupCollection();
Groups = [];
Groups.Clearing += OnRibbonGroupsClearing;
Groups.Cleared += OnRibbonGroupsCleared;
Groups.Inserted += OnRibbonGroupsInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public KeyTipControl(KryptonRibbon ribbon,
public void SetKeyTips(KeyTipInfoList keyTips)
{
// Create a new list of key tip views
_viewList = new List<ViewDrawRibbonKeyTip>();
_viewList = [];

var enclosingRect = Rectangle.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public override DesignerVerbCollection Verbs
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_addTabVerb = new DesignerVerb(@"Add Tab", OnAddTab);
_clearTabsVerb = new DesignerVerb(@"Clear Tabs", OnClearTabs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Button Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move CheckBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move CheckBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Button Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster Color Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Color Button Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Color Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Color Button Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move ComboBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move ComboBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Custom Control First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Custom Control Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move DateTimePicker First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move DateTimePicker Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Group First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Group Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move DomainUpDown First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move DomainUpDown Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Gallery First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Gallery Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Label First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Label Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Lines First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Lines Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TextBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move NumericUpDown First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move NumericUpDown Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move RadioButton First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move RadioButton Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move RichTextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move RichTextBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Separator First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Separator Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TextBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move ComboBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move ComboBox Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TrackBar First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TrackBar Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Triple First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Triple Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Previous", OnMovePrevious);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public KryptonRibbonGroupCluster()
_visible = true;

// Create collection for holding triple items
Items = new KryptonRibbonGroupClusterCollection();
Items = [];
Items.Clearing += OnRibbonGroupClusterClearing;
Items.Cleared += OnRibbonGroupClusterCleared;
Items.Inserted += OnRibbonGroupClusterInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public KryptonRibbonGroupClusterColorButton()
_imageSmall = _defaultButtonImageSmall;
_buttonType = GroupButtonType.Split;
_maxRecentColors = 10;
_recentColors = new List<Color>();
_recentColors = [];

// Create the context menu items
_kryptonContextMenu = new KryptonContextMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public KryptonRibbonGroupColorButton()
_itemSizeMin = GroupItemSize.Small;
_itemSizeCurrent = GroupItemSize.Large;
_maxRecentColors = 10;
_recentColors = new List<Color>();
_recentColors = [];

// Create the context menu items
_kryptonContextMenu = new KryptonContextMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected bool ChainVisible
[AllowNull]
public BindingContext BindingContext
{
get => _bindingContext ??= new BindingContext();
get => _bindingContext ??= [];
set => _bindingContext = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public KryptonRibbonGroupLines()
_itemSizeCurrent = GroupItemSize.Large;

// Create collection for holding triple items
Items = new KryptonRibbonGroupLinesCollection();
Items = [];
Items.Clearing += OnRibbonGroupLineClearing;
Items.Cleared += OnRibbonGroupLineCleared;
Items.Inserted += OnRibbonGroupLineInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public KryptonRibbonGroupTriple()
_itemAlignment = RibbonItemAlignment.Near;

// Create collection for holding triple items
Items = new KryptonRibbonGroupTripleCollection();
Items = [];
Items.Clearing += OnRibbonGroupTripleClearing;
Items.Cleared += OnRibbonGroupTripleCleared;
Items.Inserted += OnRibbonGroupTripleInserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public RibbonAppButton([DisallowNull] KryptonRibbon ribbon)
};
_appButtonImage = _defaultAppImage;
AppButtonSpecs = new AppMenuButtonSpecCollection(ribbon);
AppButtonRecentDocs = new KryptonRibbonRecentDocCollection();
AppButtonRecentDocs = [];
AppButtonToolTipTitle = string.Empty;
AppButtonToolTipBody = string.Empty;
AppButtonToolTipImageTransparentColor = Color.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ViewLayoutRibbonContextTitles([DisallowNull] KryptonRibbon ribbon,
_captionArea = captionArea;

// Create cache of draw elements
_contextTitlesCache = new ViewDrawRibbonContextTitleList();
_contextTitlesCache = [];
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public GroupSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
SyncChildrenToRibbonGroupItems();

// Get the permutations available for each child container
_listWidths = new List<ItemSizeWidth[]>();
_listWidths = [];

// Scan all child containers
var pixelGaps = 0;
Expand Down
Loading

0 comments on commit 3006ee0

Please sign in to comment.