Skip to content

Commit 0e9af2b

Browse files
committed
- Fix to mitigate issue where button background is briefly visible on CData update. A full fix may require migration of the UI to uifigure
1 parent c012306 commit 0e9af2b

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

Functions/@BpodObject/BpodObject.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@
278278
'BackgroundColor', [.8 .8 .8],...
279279
'CData', ImportButtonGFX,...
280280
'Callback', @(h,e)obj.folderSetupUIGet('Protocol'));
281+
figure(obj.GUIHandles.FolderConfigFig);
282+
drawnow;
281283
end
282284

283285
function obj = folderSetupUIGet(obj, type)
@@ -329,6 +331,8 @@
329331
obj.SystemSettings.DataFolder = dataFolder;
330332
obj.SaveSettings;
331333
close(obj.GUIHandles.FolderConfigFig);
334+
figure(obj.GUIHandles.MainFig);
335+
drawnow;
332336
end
333337

334338
function obj = Wiki(obj)

Functions/@BpodObject/InitializeGUI.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@
6060
'Position', [742 100 60 60],...
6161
'Callback', 'RunProtocol(''StartPause'')',...
6262
'CData', obj.GUIData.GoButton,...
63+
'BackgroundColor', [.38 .38 .38],...
6364
'TooltipString', 'Launch behavior session');
6465
obj.GUIHandles.EndButton = uicontrol('Style', 'pushbutton',...
6566
'String', '',...
6667
'Position', [742 20 60 60],...
6768
'Callback', 'RunProtocol(''Stop'')',...
6869
'CData', obj.GUIData.StopButton,...
70+
'BackgroundColor', [.38 .38 .38],...
6971
'TooltipString', 'End session');
7072

7173
obj.GUIData.OffButton = imread('ButtonOff.bmp');

Functions/Override Panels/StateMachinePanel_0_5.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
BpodSystem.GUIHandles.PortValveButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
3838
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset 30 30],...
3939
'Callback', ['ManualOverride(''OV'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
40-
'TooltipString', ['Toggle port ' num2str(i) ' valve']);
40+
'TooltipString', ['Toggle port ' num2str(i) ' valve'], 'BackgroundColor', [.38 .38 .38]);
4141
BpodSystem.GUIHandles.PortLEDButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4242
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-45 30 30],...
4343
'Callback', ['ManualOverride(''OP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
44-
'TooltipString', ['Toggle port ' num2str(i) ' LED']);
44+
'TooltipString', ['Toggle port ' num2str(i) ' LED'], 'BackgroundColor', [.38 .38 .38]);
4545
BpodSystem.GUIHandles.PortvPokeButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4646
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-90 30 30],...
4747
'Callback', ['ManualOverride(''IP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
48-
'TooltipString', ['Port ' num2str(i) ' virtual photogate']);
48+
'TooltipString', ['Port ' num2str(i) ' virtual photogate'], 'BackgroundColor', [.38 .38 .38]);
4949
xPos = xPos + 41;
5050
end
5151
xPos = xOffset+10;

Functions/Override Panels/StateMachinePanel_0_7.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
BpodSystem.GUIHandles.PortValveButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
3838
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset 30 30],...
3939
'Callback', ['ManualOverride(''OV'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
40-
'TooltipString', ['Toggle port ' num2str(i) ' valve']);
40+
'TooltipString', ['Toggle port ' num2str(i) ' valve'], 'BackgroundColor', [.38 .38 .38]);
4141
BpodSystem.GUIHandles.PortLEDButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4242
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-45 30 30],...
4343
'Callback', ['ManualOverride(''OP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
44-
'TooltipString', ['Toggle port ' num2str(i) ' LED']);
44+
'TooltipString', ['Toggle port ' num2str(i) ' LED'], 'BackgroundColor', [.38 .38 .38]);
4545
BpodSystem.GUIHandles.PortvPokeButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4646
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-90 30 30],...
4747
'Callback', ['ManualOverride(''IP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
48-
'TooltipString', ['Port ' num2str(i) ' virtual photogate']);
48+
'TooltipString', ['Port ' num2str(i) ' virtual photogate'], 'BackgroundColor', [.38 .38 .38]);
4949
xPos = xPos + 41;
5050
end
5151
if ispc

Functions/Override Panels/StateMachinePanel_2Plus.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
BpodSystem.GUIHandles.PortValveButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
3838
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset 30 30],...
3939
'Callback', ['ManualOverride(''OV'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
40-
'TooltipString', ['Toggle port ' num2str(i) ' valve']);
40+
'TooltipString', ['Toggle port ' num2str(i) ' valve'], 'BackgroundColor', [.38 .38 .38]);
4141
BpodSystem.GUIHandles.PortLEDButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4242
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-52 30 30],...
4343
'Callback', ['ManualOverride(''OP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
44-
'TooltipString', ['Toggle port ' num2str(i) ' LED']);
44+
'TooltipString', ['Toggle port ' num2str(i) ' LED'], 'BackgroundColor', [.38 .38 .38]);
4545
BpodSystem.GUIHandles.PortvPokeButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4646
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-104 30 30],...
4747
'Callback', ['ManualOverride(''IP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
48-
'TooltipString', ['Port ' num2str(i) ' virtual photogate']);
48+
'TooltipString', ['Port ' num2str(i) ' virtual photogate'], 'BackgroundColor', [.38 .38 .38]);
4949
xPos = xPos + 44;
5050
end
5151
if ispc

Functions/Override Panels/StateMachinePanel_2_0_0.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
BpodSystem.GUIHandles.PortValveButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
3838
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset 30 30],...
3939
'Callback', ['ManualOverride(''OV'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
40-
'TooltipString', ['Toggle port ' num2str(i) ' valve']);
40+
'TooltipString', ['Toggle port ' num2str(i) ' valve'], 'BackgroundColor', [.38 .38 .38]);
4141
BpodSystem.GUIHandles.PortLEDButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4242
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-52 30 30],...
4343
'Callback', ['ManualOverride(''OP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
44-
'TooltipString', ['Toggle port ' num2str(i) ' LED']);
44+
'TooltipString', ['Toggle port ' num2str(i) ' LED'], 'BackgroundColor', [.38 .38 .38]);
4545
BpodSystem.GUIHandles.PortvPokeButton(i) = uicontrol('Parent', BpodSystem.GUIHandles.OverridePanel(1),...
4646
'Style', 'pushbutton', 'String', '', 'Position', [xPos yOffset-104 30 30],...
4747
'Callback', ['ManualOverride(''IP'',' num2str(i) ');'], 'CData', BpodSystem.GUIData.OffButtonDark,...
48-
'TooltipString', ['Port ' num2str(i) ' virtual photogate']);
48+
'TooltipString', ['Port ' num2str(i) ' virtual photogate'], 'BackgroundColor', [.38 .38 .38]);
4949
xPos = xPos + 44;
5050
end
5151
if ispc

0 commit comments

Comments
 (0)