Skip to content

Commit

Permalink
Mutually exclusive radio buttons now have defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
bhvieira committed Oct 19, 2019
1 parent 2dcad5a commit a38d2bc
Showing 1 changed file with 40 additions and 15 deletions.
55 changes: 40 additions & 15 deletions Personode.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
% Main frame
P = struct(...
'Source2', 0,...
'Source4', 0,...
'Source4', 1,...
'Source5', 0,...
'BtnAll', 0,...
'BtnICAfile', 0,...
Expand All @@ -48,7 +48,8 @@
'loadImagesDone', 0,...
'CoregYes', 0,...
'radius', 4,...
'output', 0 ...
'output', 0,...
'sphere', 1 ...
);

[P.workPath, ~, ~]= fileparts(mfilename('fullpath'));
Expand Down Expand Up @@ -118,7 +119,7 @@
'FontWeight', 'bold',...
'BackgroundColor', [0.85 0.85 0.85],...
'String','Automatic (specify only first file in a series)',...
'Value', 0,...
'Value', 1,...
'pos',[leftF1+25 bottomF1+heightF1-90 widthF1-26 20],...
'callback', {@btnSource4_press},...
'Enable', 'on',...
Expand Down Expand Up @@ -147,7 +148,7 @@
'FontWeight', 'bold',...
'BackgroundColor', [0.85 0.85 0.85],...
'String','Spheres',...
'Value', 0,...
'Value', 1,...
'pos',[leftF1+25 bottomF1+heightF1-145 80 20],...
'callback', {@btnSource6_press},...
'Enable', 'on',...
Expand All @@ -166,7 +167,7 @@
'callback', {@radius_press},...
'BackgroundColor', 'white',...
'Selected', 'on',...
'Enable', 'off',...
'Enable', 'on',...
'String', 4,...
'tag', 'edRadius');
uicontrol('style', 'text', ...
Expand Down Expand Up @@ -1049,6 +1050,7 @@ function btnSource4_press(src, evt)
P.Source4=0;
P.Source5=1;
set(handles.btnSource4, 'Value', 0);
set(handles.btnSource5, 'Value', 1);
set(handles.edICAComp, 'Enable', 'off');
set(handles.edICACompBtn, 'Enable', 'off');
end
Expand All @@ -1074,6 +1076,7 @@ function btnSource5_press(src, evt)
P.Source5=0;
P.Source4=1;
set(handles.btnSource5, 'Value', 0);
set(handles.btnSource4, 'Value', 1);
set(handles.edICAComp, 'Enable', 'off');
set(handles.edICACompBtn, 'Enable', 'off');
end
Expand Down Expand Up @@ -1122,9 +1125,14 @@ function btnTXT_press(src, evt)
function btnYesCoreg_press(src, evt)
handles = guihandles(src);
P = guidata(src);
P.CoregYes=1;

set(handles.btnNoCoreg, 'Value', 0);
if P.CoregYes == 0
P.CoregYes=1;
set(handles.btnNoCoreg, 'Value', 0);
else
P.CoregYes=0;
set(handles.btnNoCoreg, 'Value', 1);
end

guidata(handles.hF, P);
loadImages(src,P.ICAgroup)
Expand All @@ -1134,9 +1142,14 @@ function btnYesCoreg_press(src, evt)
function btnNoCoreg_press(src, evt)
handles = guihandles(src);
P = guidata(src);
P.CoregYes=0;

set(handles.btnYesCoreg, 'Value', 0);
if P.CoregYes == 1
P.CoregYes=0;
set(handles.btnYesCoreg, 'Value', 0);
else
P.CoregYes=1;
set(handles.btnYesCoreg, 'Value', 1);
end

guidata(handles.hF, P);
loadImages(src,P.ICAgroup)
Expand All @@ -1146,10 +1159,16 @@ function btnNoCoreg_press(src, evt)
function btnSource6_press(src, evt)
handles = guihandles(src);
P = guidata(src);
P.sphere=1;

set(handles.btnSource7, 'Value', 0);
set(handles.edRadius, 'Enable', 'on');
if P.sphere == 0
P.sphere=1;
set(handles.btnSource7, 'Value', 0);
set(handles.edRadius, 'Enable', 'on');
else
P.sphere=0;
set(handles.btnSource7, 'Value', 1);
set(handles.edRadius, 'Enable', 'off');
end

guidata(handles.hF, P);
enable_start(src)
Expand All @@ -1158,10 +1177,16 @@ function btnSource6_press(src, evt)
function btnSource7_press(src, evt)
handles = guihandles(src);
P = guidata(src);
P.sphere=0;

set(handles.btnSource6, 'Value', 0);
set(handles.edRadius, 'Enable', 'off');
if P.sphere == 0
P.sphere = 1;
set(handles.btnSource6, 'Value', 1);
set(handles.edRadius, 'Enable', 'on');
else
P.sphere = 0;
set(handles.btnSource6, 'Value', 0);
set(handles.edRadius, 'Enable', 'off');
end

guidata(handles.hF, P);
enable_start(src)
Expand Down

0 comments on commit a38d2bc

Please sign in to comment.