B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function #765

2 changed files with 45 additions and 7 deletions
Showing only changes of commit a0e0b1e788 - Show all commits
@@ -1,3 +1,4 @@
using System.Drawing;
Review

Is this using necessary to be added?

Is this using necessary to be added?
Review

if commenting out , should remove

if commenting out , should remove
using System.Security.Cryptography;
using VEPROMS.CSLA.Library;
@@ -34,7 +35,8 @@ namespace Volian.Controls.Library
{
this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel();
this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel();
this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem();
this.gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel();
//this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem();
mschill marked this conversation as resolved Outdated
Outdated
Review

Should not keep commented out code.

Should not keep commented out code.
this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.gpItem.SuspendLayout();
@@ -42,11 +44,11 @@ namespace Volian.Controls.Library
//
// btnApplicabilitychg
//
this.btnApplicabilitychg.Location = new System.Drawing.Point(60, 8);
this.btnApplicabilitychg.Location = new System.Drawing.Point(90, 8);
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4);
this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control;
this.btnApplicabilitychg.Name = "btnApplicabilitychg";
this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22);
this.btnApplicabilitychg.Size = new System.Drawing.Size(85, 22);
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2);
this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
2
@@ -112,7 +114,8 @@ namespace Volian.Controls.Library
this.gpItem.Location = new System.Drawing.Point(0, 49);
this.gpItem.Margin = new System.Windows.Forms.Padding(4);
this.gpItem.Name = "gpItem";
this.gpItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37);
//this.gpItem.Padding = new System.Windows.Forms.Padding(13, 20, 13, 37);
Outdated
Review

Should not keep commented out code.

Should not keep commented out code.
this.gpItem.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0);
this.gpItem.Size = new System.Drawing.Size(432, 85);
//
//
@@ -144,6 +147,31 @@ namespace Volian.Controls.Library
this.gpItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.gpItem.TabIndex = 1;
this.gpItem.Text = "Item Mode";
//
// gpSubItem
//
gpSubItem.AutoSize = true;
gpSubItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
gpSubItem.CanvasColor = System.Drawing.SystemColors.Control;
gpSubItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
gpSubItem.DisabledBackColor = System.Drawing.Color.Empty;
gpSubItem.Dock = System.Windows.Forms.DockStyle.Top;
gpSubItem.Location = new System.Drawing.Point(0, 49);
gpSubItem.Margin = new System.Windows.Forms.Padding(4);
gpSubItem.Name = "gpSubItem";
gpSubItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37);
gpSubItem.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
gpSubItem.Style.BackColorGradientAngle = 90;
gpSubItem.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
mschill marked this conversation as resolved
Review

should not keep commented out code

should not keep commented out code
Review

Removed

Removed
gpSubItem.TabIndex = 1;
gpSubItem.Text = "";
gpSubItem.Location = new System.Drawing.Point(0, 49);
gpSubItem.Size = new System.Drawing.Size(400, 250);
//
// DisplayApplicability
//
@@ -169,7 +197,8 @@ namespace Volian.Controls.Library
private DevComponents.DotNetBar.Controls.GroupPanel gpMode;
private DevComponents.DotNetBar.Controls.GroupPanel gpItem;
private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2;
private DevComponents.DotNetBar.Controls.GroupPanel gpSubItem;
//private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2;
Review

Should not keep commented out code.

Should not keep commented out code.
private DevComponents.DotNetBar.ButtonX btnApplicabilitychg;
private DevComponents.DotNetBar.SuperTooltip superTooltip1;
@@ -31,6 +31,7 @@ namespace Volian.Controls.Library
_MyDisplayTabItem = value;
gpMode.Controls.Clear();
gpItem.Controls.Clear();
gpSubItem.Controls.Clear();
MyCheckBoxes.Clear();
if (_MyDisplayTabItem != null)
{
1
@@ -59,6 +60,8 @@ namespace Volian.Controls.Library
foreach (string name in names)
AddItemMode(name.Trim(), (++i).ToString());
AddItemMode("None", "0");
gpItem.Controls.Add(gpSubItem);
mschill marked this conversation as resolved
Review

gpSubItem is a pre-existing control - i.e. it is created in the Designer.
gpItem is also a pre-existing control.

Not sure that these should Adding one to another one like this (like it was a dynamic / built on the fly control) here.

Would be difficult to test for --- but
What happens if gpSubItem gets destroyed / garbage collected and you try to add it to gpItem
unlike dynamic controls (like the checkboxes / buttons created here in the code behind, this is not being dynamically created each time the code behind executes.)?

Thinking it (gpSubItem) should either entirely be created dynamically in the code behind or never removed/re-added from the parent control (gpItem) to avoid any issues with garbage collection....

Also, another possibility ---- instead of adding / removing, is it possible to use properties on gpSubItem like Visible and Enabled?

gpSubItem is a pre-existing control - i.e. it is created in the Designer. gpItem is also a pre-existing control. Not sure that these should Adding one to another one like this (like it was a dynamic / built on the fly control) here. Would be difficult to test for --- but What happens if gpSubItem gets destroyed / garbage collected and you try to add it to gpItem unlike dynamic controls (like the checkboxes / buttons created here in the code behind, this is not being dynamically created each time the code behind executes.)? Thinking it (gpSubItem) should either entirely be created dynamically in the code behind or never removed/re-added from the parent control (gpItem) to avoid any issues with garbage collection.... Also, another possibility ---- instead of adding / removing, is it possible to use properties on gpSubItem like Visible and Enabled?
gpSubItem.BringToFront();
gpItem.Controls.Add(btnApplicabilitychg);
btnApplicabilitychg.BringToFront();
if (_MyDisplayTabItem.MyStepTabPanel != null)
@@ -131,11 +134,17 @@ namespace Volian.Controls.Library
private void AddItemMode(string name, string value)
{
CheckBox cb = new CheckBox();
//cb.BackColor = Color.Beige;
Review

Should not keep commented out code.

Should not keep commented out code.
cb.BackColor = Color.Transparent;
cb.Height = 24;
cb.Width = 75;
cb.AutoSize = true;
cb.Text = name;
cb.Tag = value;
cb.Dock = DockStyle.Top;
gpItem.Controls.Add(cb);
//cb.Dock = DockStyle.Left;
Review

Should not keep commented out code.

Should not keep commented out code.
//gpItem.Controls.Add(cb);
Review

Should not keep commented out code.

Should not keep commented out code.
gpSubItem.Controls.Add(cb);
cb.BringToFront();
cb.CheckedChanged += new EventHandler(cb_CheckedChanged);
MyCheckBoxes.Add(value == null ? -1 : int.Parse(value), cb);
@@ -401,7 +410,7 @@ namespace Volian.Controls.Library
else
{
btnApplicabilitychg.Enabled = true;
}
}
IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig;
List<int> apples = cfg.MasterSlave_Applicability.GetFlags();
UnwireCheckboxes(true);