Skip to content

Commit db3ea4f

Browse files
committed
Makes buttons disable instead of becoming invisiable
Makes the extension more consistent.
1 parent 1ee3620 commit db3ea4f

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

FRC-Extension/Buttons/DeployDebugButton.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private void DisableAllButtons()
2727
{
2828
foreach (var oleMenuCommand in s_deployCommands)
2929
{
30-
oleMenuCommand.Visible = false;
30+
oleMenuCommand.Enabled = false;
3131
}
3232
s_deploying = true;
3333
}
@@ -36,7 +36,7 @@ private void EnableAllButtons()
3636
{
3737
foreach (var oleMenuCommand in s_deployCommands)
3838
{
39-
oleMenuCommand.Visible = true;
39+
oleMenuCommand.Enabled = true;
4040
}
4141
s_deploying = false;
4242
}
@@ -151,11 +151,9 @@ public override void QueryCallback(object sender, EventArgs e)
151151
if (s_deploying)
152152
visable = false;
153153

154-
menuCommand.Visible = visable;
155-
if (menuCommand.Visible)
156-
{
157-
menuCommand.Enabled = true;
158-
}
154+
menuCommand.Enabled = visable;
155+
156+
menuCommand.Visible = true;
159157
}
160158
}
161159
}

FRC-Extension/Buttons/NetConsoleButton.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ public override void QueryCallback(object sender, EventArgs e)
2323
bool visable = File.Exists(@"C:\Program Files\NetConsole for cRIO\NetConsole.exe") ||
2424
File.Exists(@"C:\Program Files (x86)\NetConsole for cRIO\NetConsole.exe");
2525

26+
menuCommand.Enabled = visable;
2627

27-
28-
menuCommand.Visible = visable;
29-
if (menuCommand.Visible)
30-
{
31-
menuCommand.Enabled = true;
32-
}
28+
menuCommand.Visible = true;
3329
}
3430
}
3531

FRC-Extension/FRC-Extension.vsct

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<Button guid="guidFRC_ExtensionCmdSet" id="cmdidDeployCode" priority="0x0100" type="Button">
9898
<Parent guid="guidFRC_ExtensionCmdSet" id="FRCMainMenuGroup" />
9999
<CommandFlag>DynamicVisibility</CommandFlag>
100-
<CommandFlag>DefaultInvisible</CommandFlag>
100+
<CommandFlag>DefaultDisabled</CommandFlag>
101101
<Strings>
102102
<ButtonText>Deploy Code</ButtonText>
103103
</Strings>
@@ -106,15 +106,15 @@
106106
<Button guid="guidFRC_ExtensionCmdSet" id="cmdidDebugCode" priority="0x0101" type="Button">
107107
<Parent guid="guidFRC_ExtensionCmdSet" id="FRCMainMenuGroup"/>
108108
<CommandFlag>DynamicVisibility</CommandFlag>
109-
<CommandFlag>DefaultInvisible</CommandFlag>
109+
<CommandFlag>DefaultDisabled</CommandFlag>
110110
<Strings>
111111
<ButtonText>Debug Code</ButtonText>
112112
</Strings>
113113
</Button>
114114

115115
<Button guid="guidFRC_ExtensionCmdSet" id="cmdidKillCode" priority="0x0102" type="Button">
116116
<Parent guid="guidFRC_ExtensionCmdSet" id="FRCMainMenuGroup"/>
117-
<CommandFlag>DynamicVisibility</CommandFlag>
117+
<CommandFlag>DefaultDisabled</CommandFlag>
118118
<Strings>
119119
<ButtonText>Kill Robot Code</ButtonText>
120120
</Strings>
@@ -175,7 +175,7 @@
175175
type="Button">
176176
<Parent guid="guidFRC_ExtensionCmdSet" id="MonoSubMenuGroup" />
177177
<CommandFlag>DynamicVisibility</CommandFlag>
178-
<CommandFlag>DefaultInvisible</CommandFlag>
178+
<CommandFlag>DefaultDisabled</CommandFlag>
179179
<Strings>
180180
<CommandName>cmdidSaveMonoFile</CommandName>
181181
<ButtonText>Save Mono File</ButtonText>

0 commit comments

Comments
 (0)