Thread Subject: button group issues

Subject: button group issues

From: Travis

Date: 6 May, 2009 21:52:00

Message: 1 of 1

I have a buttongroup with three radio buttons that I am trying to get to work. I would like the first button to enable an editable text field and a button; the second button to enable another set editable text field and another button; and the third radion button to enable both editable text fields and buttons. I have something similar with a checkbox in a panel. The code I have so far...

function ProTools_SelectionChangeFcn(hObject,eventdata, handles)
switch get(eventdata.NewValue,'Tag') % Get Tag of selected object.
    case 'Abs'
        ABS = 1;
        handles.ABS = ABS;
        
        
    case 'Fl'
        FL = 1;
        handles.FL = FL;
       
        
    case 'FlAbs'
        ABS = 1;
        FL = 1;
        handles.ABS = ABS;
        handles.FL = FL;
        
end
guidata(hObject,handles)

function AbsLoc_Callback(hObject, eventdata, handles)
% hObject handle to AbsLoc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of AbsLoc as text
% str2double(get(hObject,'String')) returns contents of AbsLoc as a double
if handles.ABS==1;
    set(handles.AbsLoc, 'Enable', 'on')
    ABSPath = get(hObject,'String');
    handles.ABSPath = ABSPath;
    guidata(hObject,handles)
end


% --- Executes during object creation, after setting all properties.
function AbsLoc_CreateFcn(hObject, eventdata, handles)
% hObject handle to AbsLoc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in AbsBrowse.
function AbsBrowse_Callback(hObject, eventdata, handles)
% hObject handle to AbsBrowse (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.ABS==1;
    set(handles.AbsBrowse, 'Enable', 'on')
    AbsPath = uigetdir(cd);
end
set(handles.AbsLoc,'String',AbsPath)



function FlLoc_Callback(hObject, eventdata, handles)
% hObject handle to FlLoc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of FlLoc as text
% str2double(get(hObject,'String')) returns contents of FlLoc as a double
if handles.FL ==1
    set(handles.FlLoc, 'Enable', 'on')
    FLPath = get(hObject,'String');
    handles.FLPath = FLPath;
    guidata(hObject,handles);
end


% --- Executes during object creation, after setting all properties.
function FlLoc_CreateFcn(hObject, eventdata, handles)
% hObject handle to FlLoc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in FlBrowse.
function FlBrowse_Callback(hObject, eventdata, handles)
% hObject handle to FlBrowse (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.FL ==1;
     set(handles.FlBrowse, 'Enable', 'on')
     FlPath = uigetdir(cd);
end
set(handles.FlLoc,'String',FlPath)

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
button group Travis 6 May, 2009 17:54:02
gui Travis 6 May, 2009 17:54:02
rssFeed for this Thread

Contact us at files@mathworks.com