Using Tabs in Combination of Panels with Guide

9 views (last 30 days)
I have created a GUI (with Guide) and added code to add tabs to the guide. In addition I will add a panel that corresponds to each tab. Basically I want to set the 'parent' of each panel to the corresponding tab when the gui is created. I have found a way to disable the tabs and all their 'children' including the objects in each corresponding panel. There's only 1 problem in Guide. I would have to create each panel consecutively (on top of each other - they'd be the same size) with all the controls completely added in each panel. Then, move to the next panel, hoping I don't have to go back to the previous panel to adjust any uiobjects or properties. I know I can add code at the beginning of the program, but it is much easier to change these visually. Is there a way to navigate through panels or some type of "layers" that bring certain objects & their corresponding 'children' to the front in Guide? I saw the object browser, but there is not a way to separate or move objects from on panel to the next with this. Is there a better way to visually manage this "layering" issue that I am not aware of?
Here's the code for creating the tabs and assigning the corresponding tab as a 'parent' to the panel:
% % Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Menu_Tabs_Ideas_OpeningFcn, ...
'gui_OutputFcn', @Menu_Tabs_Ideas_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 Menu_Tabs_Ideas is made visible. function Menu_Tabs_Ideas_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 Menu_Tabs_Ideas (see VARARGIN)
% Choose default command line output for Menu_Tabs_Ideas handles.output = hObject;
% -------------------------------------------------------------------- % Inserting Tabs for Program \/ \/ \/ \/ \/ % -------------------------------------------------------------------- % 1) Creating Tab Group & Handles handles.hTabGroup = uitabgroup('Parent',hObject); % 2) Supressing Warning (newer matlab versions will handle tabs differently) s = warning('off', 'MATLAB:uitabgroup:OldVersion'); % 3) Creating Tabs & Handles handles.tab1 = uitab(handles.hTabGroup, 'title','Bridge Selection'); handles.tab2 = uitab(handles.hTabGroup, 'title','Date'); handles.tab3 = uitab(handles.hTabGroup, 'title','FFT Sensors'); handles.tab4 = uitab(handles.hTabGroup, 'title','Temperature Sensors'); handles.tab5 = uitab(handles.hTabGroup, 'title','Analysis Options'); handles.tab6 = uitab(handles.hTabGroup, 'title','Output Options'); % 4) Created Panels for Each Tab (Every other object will be placed in % these in order to handle parent child relationships better) % Each Tab must be created with guide in order from beginning to % end or one can not set(handles.Tab1_Panel,'Parent',handles.tab1);
% I haven't created these panels yet \/ I want to see if these can be visually % managed % set(handles.Tab2_Panel,'Parent',handles.tab2); % set(handles.Tab3_Panel,'Parent',handles.tab3); % set(handles.Tab4_Panel,'Parent',handles.tab4); % set(handles.Tab5_Panel,'Parent',handles.tab5); % set(handles.Tab6_Panel,'Parent',handles.tab6);
% ****************************************************************** % -------------------------------------------------------------------- % Code I don't want to use in this program!!! \/ \/ \/ \/ \/ % -------------------------------------------------------------------- % This is a radio button I want to move to tab 2 potentially but was % created in Tab1_Panel set(handles.Select_All_Bridges_Radio,'Parent',handles.tab2);

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!