gui popupmenu_нужна_помощь
Модератор: Admin
gui popupmenu_нужна_помощь
Добрый день , форумчане .
Мне нужна Ваша помощь .
есть такая заготовка для gui (файл gui1.jpg) ; как дописать код таким образом , чтобы при активации первой строки активировалась вставка (на рисунке справа) в файле gui.jpg ?
Буду рад , если мне кто-нибудь поможет , если нужен код то могу выложить ( завтра )
Мне нужна Ваша помощь .
есть такая заготовка для gui (файл gui1.jpg) ; как дописать код таким образом , чтобы при активации первой строки активировалась вставка (на рисунке справа) в файле gui.jpg ?
Буду рад , если мне кто-нибудь поможет , если нужен код то могу выложить ( завтра )
Re: gui popupmenu_нужна_помощь
Где вложения?
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
[img][img][/img][/img]
Jey писал(а):Где вложения?
Re: gui popupmenu_нужна_помощь
Jey , добрый день. не знаю как выложить фото , опишу вопрос : есть кнопки radiobutton1 и radiobutton2 , при нажатии каждого из радиобаттонов должны вылезать popupmenu1 и popupmenu2 . popupmenu1 и popupmenu2 - разные и независимые . Могли бы Вы написать простенький вариант как при нажатии одного из радиобатонов вылезал соответствующий popupmenu , а второй radiobutton и popupmenu становились невидимыми. исходно радиобаттоны пустые , а popupmenu (оба) невидимые .
Заранее благодарен .
вот заготовка :
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2(varargin)
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 MATLAB code for radiobutton1popupmenu1radiobutton2ppupmenu2.fig
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2, by itself, creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the existing
% singleton*.
%
% H = RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 returns the handle to a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or the handle to
% the existing singleton*.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2.M with the given input arguments.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('Property','Value',...) creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help radiobutton1popupmenu1radiobutton2ppupmenu2
% Last Modified by GUIDE v2.5 04-Jul-2019 13:18:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn, ...
'gui_OutputFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before radiobutton1popupmenu1radiobutton2ppupmenu2 is made visible.
function radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to radiobutton1popupmenu1radiobutton2ppupmenu2 (see VARARGIN)
% Choose default command line output for radiobutton1popupmenu1radiobutton2ppupmenu2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes radiobutton1popupmenu1radiobutton2ppupmenu2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
Заранее благодарен .
вот заготовка :
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2(varargin)
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 MATLAB code for radiobutton1popupmenu1radiobutton2ppupmenu2.fig
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2, by itself, creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the existing
% singleton*.
%
% H = RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 returns the handle to a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or the handle to
% the existing singleton*.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2.M with the given input arguments.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('Property','Value',...) creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help radiobutton1popupmenu1radiobutton2ppupmenu2
% Last Modified by GUIDE v2.5 04-Jul-2019 13:18:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn, ...
'gui_OutputFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before radiobutton1popupmenu1radiobutton2ppupmenu2 is made visible.
function radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to radiobutton1popupmenu1radiobutton2ppupmenu2 (see VARARGIN)
% Choose default command line output for radiobutton1popupmenu1radiobutton2ppupmenu2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes radiobutton1popupmenu1radiobutton2ppupmenu2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
Re: gui popupmenu_нужна_помощь
Примерно так:
Код: Выделить всё
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
set(handles.popupmenu1, 'Visible', 'off');
set(handles.popupmenu2, 'Visible', 'off');
if (get(hObject,'Value') == 1)
set(handles.popupmenu1, 'Visible', 'on');
end
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
set(handles.popupmenu1, 'Visible', 'off');
set(handles.popupmenu2, 'Visible', 'off');
if (get(hObject,'Value') == 1)
set(handles.popupmenu2, 'Visible', 'on');
end
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
[quote="Jey"]Примерно так:
вариант не рабочий : сначала показывается popupmenu , а когда нажимаешь на радиобатон , вылезают ошибки . сами можете проверить
вариант не рабочий : сначала показывается popupmenu , а когда нажимаешь на радиобатон , вылезают ошибки . сами можете проверить
Re: gui popupmenu_нужна_помощь
Какой текст ошибки?
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
Jey писал(а):Какой текст ошибки?
вот я так попробовал :
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
knopkaradiobutton2=0;
knopkaradiobutton2=(set(handles.radiobutton2,'Value'));
knopkaradiobutton2=get(hObject,'Value')
t=knopkaradiobutton2
global knopkaradiobutton2;
set(handles.popupmenu2, 'Value',t);%%, 1
% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
global knopkaradiobutton2;
% Hint: popupmenu 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
set(handles.popupmenu2, 'Value', knopkaradiobutton2);
так работает , только сначала вылезает ошибка : Struct contents reference from a non-struct array object.
напротив радиобатон2 показывается pоpupmenu2 ; нажимаешь радиобатон2 - pоpupmenu2 снова остается , нажимаешь радиобатон2 снова - pоpupmenu2 исчезает ; снова нажимаешь радиобатон2 - pоpupmenu2 появляется
Re: gui popupmenu_нужна_помощь
Jey писал(а):Какой текст ошибки?
Jey (не знаю как Вас звать , поэтому так обращаюсь) , меня звать Артемий . Ваш вариант set(handles.popupmenu1, 'Visible', 'off'); - не работает с выводом ошибки : Struct contents reference from a non-struct array object.
Re: gui popupmenu_нужна_помощь
Это что за каша? Логика отсутствует.
Покажите полностью содержание м-файла с моим вариантом. Также скажите, чему равно св-во Tag у элементов popupmenu1 и popupmenu2?
При написании сообщения на форуме, над текстом нажмите кнопку Code и вставляйте код программы внутрь появившихся атрибутов, так код будет смотреться как у меня, а не как у Вас, что лучше, ИМХО.
Код: Выделить всё
knopkaradiobutton2=0;
knopkaradiobutton2=(set(handles.radiobutton2,'Value'));
knopkaradiobutton2=get(hObject,'Value')
t=knopkaradiobutton2
global knopkaradiobutton2;
set(handles.popupmenu2, 'Value',t);%%, 1
foxic3532 писал(а):Ваш вариант set(handles.popupmenu1, 'Visible', 'off'); - не работает с выводом ошибки : Struct contents reference from a non-struct array object.
Покажите полностью содержание м-файла с моим вариантом. Также скажите, чему равно св-во Tag у элементов popupmenu1 и popupmenu2?
При написании сообщения на форуме, над текстом нажмите кнопку Code и вставляйте код программы внутрь появившихся атрибутов, так код будет смотреться как у меня, а не как у Вас, что лучше, ИМХО.
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
Jey писал(а):.Код: Выделить всё
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2(varargin)
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 MATLAB code for radiobutton1popupmenu1radiobutton2ppupmenu2.fig
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2, by itself, creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the existing
% singleton*.
%
% H = RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 returns the handle to a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or the handle to
% the existing singleton*.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2.M with the given input arguments.
%
% RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2('Property','Value',...) creates a new RADIOBUTTON1POPUPMENU1RADIOBUTTON2PPUPMENU2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help radiobutton1popupmenu1radiobutton2ppupmenu2
% Last Modified by GUIDE v2.5 04-Jul-2019 13:18:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn, ...
'gui_OutputFcn', @radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before radiobutton1popupmenu1radiobutton2ppupmenu2 is made visible.
function radiobutton1popupmenu1radiobutton2ppupmenu2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to radiobutton1popupmenu1radiobutton2ppupmenu2 (see VARARGIN)
% Choose default command line output for radiobutton1popupmenu1radiobutton2ppupmenu2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes radiobutton1popupmenu1radiobutton2ppupmenu2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = radiobutton1popupmenu1radiobutton2ppupmenu2_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in radiobutton1.
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
set(handles.popupmenu1, 'Visible', 'off');
set(handles.popupmenu2, 'Visible', 'off');
if (get(hObject,'Value') == 1)
set(handles.popupmenu1, 'Visible', 'on');
end
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
set(handles.popupmenu1, 'Visible', 'off');
set(handles.popupmenu2, 'Visible', 'off');
if (get(hObject,'Value') == 1)
set(handles.popupmenu2, 'Visible', 'on');
end
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
Re: gui popupmenu_нужна_помощь
Нужен скриншот Вашего GUI-интерфейса.
Радиобатоны могут быть сами по себе, а могут быть внутри компонента Button Group, у Вас как?
Мой код рабочий и, глядя на него, можно легко сделать то, что Вам нужно. Мой код показывает работу с необходимыми функциями, а дальше задача просто их выстроить так, как Вам надо.
И еще раз напишите четко логику, что нужно. Радиобатон может быть выбран, может быть нет. Выше Вы написали, что надо скрывать радиобатон, если я его скрою, то как я потом его выберу?
Радиобатоны могут быть сами по себе, а могут быть внутри компонента Button Group, у Вас как?
Мой код рабочий и, глядя на него, можно легко сделать то, что Вам нужно. Мой код показывает работу с необходимыми функциями, а дальше задача просто их выстроить так, как Вам надо.
И еще раз напишите четко логику, что нужно. Радиобатон может быть выбран, может быть нет. Выше Вы написали, что надо скрывать радиобатон, если я его скрою, то как я потом его выберу?
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
Jey писал(а):Нужен скриншот Вашего GUI-интерфейса.
Радиобатоны могут быть сами по себе, а могут быть внутри компонента Button Group, у Вас как?
Мой код рабочий и, глядя на него, можно легко сделать то, что Вам нужно. Мой код показывает работу с необходимыми функциями, а дальше задача просто их выстроить так, как Вам надо.
И еще раз напишите четко логику, что нужно. Радиобатон может быть выбран, может быть нет. Выше Вы написали, что надо скрывать радиобатон, если я его скрою, то как я потом его выберу?
завтра буду на работе пришлю скриншот
Re: gui popupmenu_нужна_помощь
Лучше выложите куда-нибудь m-файл и fig-файл и скажите какая логика должна быть.
Помощь в Матлабе / Matlab, Qt за деньги.
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Помощь в html, css, jquery, MVC за деньги.
Помощь в C# / C sharp / Си шарп за деньги.
Вконтакте: https://vk.com/id122995106
или Личное сообщение на форуме.
http://ПунктыПроката.рф
Re: gui popupmenu_нужна_помощь
Jey писал(а):вот ссылка на картинку - http://i.piccy.info/i9/4b27d0b25024072f ... iannyi.jpg.