4.75

4.8 | 4 ratings Rate this file 63 Downloads (last 30 days) File Size: 4.98 KB File ID: #15193
image thumbnail

Simple tab panel

by Panagiotis Moulos

 

04 Jun 2007 (Updated 11 Jun 2007)

A simple way to create tab panels using GUIDE

| Watch this File

File Information
Description

This script provides a template on how to create simple tab panels within a GUI. Each tab panel should be a different panel with different components and can be easily created with GUIDE. By using GUIDE, you can create as many different panels as you want and layout them in a comfortable way for building. When the script initiates, it places them one behind the other and handles their visibilities accordingly.

The main idea behind simpletab is that you can create the tab labels by creating an equal number of static text uicontrols and layout them properly over an empty panel of proper defined size (see simpletab.fig in GUIDE). You can use then their positions to create axes objects (so that an edge line can be displayed around tabs without having to define the 'CData' property) and then create text objects (which are also more customizable than static text uicontrols) inside them. The control and highlighting of different tabs is performed through properly defined object callbacks (see code). The initial static text uicontrols are invisible in the final window. They are only used inside GUIDE for positioning purposes only.

Make sure that the panel which is used for the proper placement of the static text uicontrols is the bigger one as the others will acquire its position. Ideally, the other panels should not be designed to be very different from the first one in terms of their dimensions because normally, in a multitab window all tabs should have the same size and the desired uicontrols should be fitted into them.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
a new way to tab for GUIDE

MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements Tested under Windows XP
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
08 Jun 2007 Thomas Thurnheer

Well done. Worked properly after changing testTab to simpletab in the code.

09 Mar 2008 Andres A

i am new working with guide in matlab, i have a question, i need big tabs but i cant create it because the editor size is too short for 3 or 4 big panels.
What can i do?

09 Mar 2008 Andres A

i forget vote XD

03 Jul 2008 Scott Copeland

This simple example got me quickly off and running.

22 Nov 2011 Alejandro Soto  
Please login to add a comment or rating.
Updates
11 Jun 2007

Fixed a bug remaining from the testing version: changed 'testTab' to 'simpletab' in the code.

Tag Activity for this File
Tag Applied By Date/Time
gui tools Panagiotis Moulos 22 Oct 2008 09:14:31
example Panagiotis Moulos 22 Oct 2008 09:14:31
tab Panagiotis Moulos 22 Oct 2008 09:14:31
simple tab Panagiotis Moulos 22 Oct 2008 09:14:31
tab panel Panagiotis Moulos 22 Oct 2008 09:14:31
uitab Panagiotis Moulos 22 Oct 2008 09:14:31
example Neftali 19 Jul 2009 17:59:52
simple tab Philipp 06 Oct 2009 07:34:18
simple tab Chandrasekhar Mattupalli 16 Nov 2009 04:23:20
tab Mugunth Krishnamoorthy 15 Mar 2010 10:04:44
tab panel Mugunth Krishnamoorthy 15 Mar 2010 10:04:50
tab panel Gilbert 31 Mar 2010 06:42:08
example Jonathan 22 Jun 2011 17:28:45
gui tools Khalid Hameed 22 Sep 2011 13:08:48
simple tab yassen 19 Oct 2011 12:12:59

Contact us at files@mathworks.com