Tải bản đầy đủ

Getting Started with GUIDE


1
Getting Started with
GUIDE
What Is GUIDE? (p. 1-2) An introduction to GUIDE
Starting GUIDE (p. 1-3) How to start GUIDE and use the Quick Start dialog
The Layout Editor (p. 1-4) The Layout Editor enables you to lay out the GUI
components quickly and easily
GUIDE Templates (p. 1-6) GUIDE templates are simple, pre-constructed GUIs that
you can modify for your own purposes
Running a GUI (p. 1-8) How to run a GUI
GUI FIG-Files and M-Files (p. 1-9) GUIDE stores GUIs in two files, a FIG-file that contains
the layout, and an M-file that controls the GUI
Programming the GUI M-file (p. 1-10) The GUI M-file controls how the GUI functions
Editing Version 5 GUIs with Version 7
GUIDE (p. 1-12)
Editing GUIs created in GUIDE Version 5
1
Getting Started with GUIDE
1-2
What Is GUIDE?

GUIDE, the MATLAB® Graphical User Interface development environment,
provides a set of tools for creating graphical user interfaces (GUIs). These tools
greatly simplify the process of designing and building GUIs. You can use the
GUIDE tools to
• Lay out the GUI
Using the GUIDE Layout Editor, you can lay out a GUI easily by clicking and
dragging GUI components — such as panels, buttons, text fields, sliders,
menus, and so on — into the layout area.
• Program the GUI
GUIDE automatically generates an M-file that controls how the GUI
operates. The M-file initializes the GUI and contains a framework for all the
GUI callbacks — the commands that are executed when a user clicks a GUI
component. Using the M-file editor, you can add code to the callbacks to
perform the functions you want them to.
The following sections provide an overview of creating GUIs with GUIDE.
Starting GUIDE
1-3
Starting GUIDE
To start GUIDE, enter
guide
at the MATLAB prompt. This displays the
GUIDE Quick Start
dialog, as shown in the following figure.
From the Quick Start dialog, you can
• Create a new GUI from one of the GUIDE templates — prebuilt GUIs that
you can modify for your own purposes.
• Open an existing GUI.
Once you have selected one of these options, clicking
OK
opens the GUI in the
Layout Editor.
1
Getting Started with GUIDE
1-4
The Layout Editor
When you open a GUI in GUIDE, it is displayed in the Layout Editor, which is
the control panel for all of the GUIDE tools. The following figure shows the
Layout Editor with a blank GUI template.
You can lay out your GUI by dragging components, such as push buttons,
pop-up menus, or axes, from the component palette, at the left side of the


Layout Editor, into the layout area. For example, if you drag a push button into
the layout area, it appears as in the following figure.
Component
Palette
Layout Area
The Layout Editor
1-5
You can also use the Layout Editor to set basic properties of the GUI
components.
To learn more about the Layout Editor, see “Using the Layout Editor” on
page 3-9. See “Laying Out the GUI” on page 2-3 for a detailed example of laying
out a GUI.

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay

×