Creating Graphical User Interfaces    

Creating GUIs with MATLAB

Introduction

Creating GUIs with GUIDE

GUI Development Environment

Editing Version 5 GUIs with Version 6 GUIDE

Selecting GUIDE Application Options

Configuring the Application M-file

Resize Behavior

Making Your GUI Nonresizable

Allowing Proportional GUI Resizing

User-Specified Resize Operation

Command-Line Accessibility

Access Options

Figure Properties That Control Access

Electing to Generate Only the FIG-File

Generating the FIG-File and the M-File

Generating Callback Function Prototypes

Application Allows Only One Instance to Run

Using the System Background Colors

Waiting for User Input

Renaming Application Files and Tags

Using Save As

Getting Everything Right

Changing Component Tag Properties

Changing the Name of Callback Subfunctions

Changing the Name of the M-file and FIG-file

GUI Building Tools

GUI Layout Tools

Saving Your Layout

Displaying Your GUI

Laying Out GUIs - The Layout Editor

Placing an Object In the Layout Area

Activating the Figure

Layout Editor Context Menus

Aligning Components in the Layout Editor

Aligning Groups of Components - The Alignment Tool

Grids and Rulers

Aligning Components to Guide Lines

Front to Back Positioning

Setting Component Properties - The Property Inspector

Viewing the Object Hierarchy - The Object Browser

Creating Menus - The Menu Editor

Defining Menus for the Menubar

The Menu Callback

Defining Context Menus

User Interface Controls

Push Buttons

Toggle Buttons

Radio Buttons

Checkboxes

Edit Text

Static Text

Sliders

Frames

List Boxes

Popup Menus

Enable or Disabling Controls

Axes

Figure

Saving the GUI

FIG-Files

Programming GUIs

GUI Programming Topics

Understanding the Application M-File

Automatic Naming of Callback Routines

Execution Paths in the Application M-File

Initializing the GUI

Managing GUI Data

Passing Data in the Handles Structure

If You Are Not Using a Handle Structure

Application-Defined Data

Designing for Cross-Platform Compatibility

Using the System Font

Using Standard Background Color

Cross-Platform Compatible Figure Units

Types of Callbacks

Callback Properties for All Graphics Objects

Callback Properties for Figures

Which Callback Executes

Interrupting Executing Callbacks

Controlling Interruptibility

The Event Queue

Event Processing During Callback Execution

Controlling GUI Figure Window Behavior

Using Modal Figure Windows

Application Techniques

Example Applications

Launching a Dialog to Confirm an Operation

Dialog Requirements

View the Layout and Application M-File

Implementing the GUI

The Close Button Callback

The Confirmation Dialog Application M-file

Launch the Dialog

Specify the Location of the Dialog

Wait for User Response

Executing a Callback

Defining the Yes and No Buttons Callbacks

Protecting the GUI with a Close Request Function

List Box Directory Reader

View the Layout and Application M-File

Implementing the GUI

Specifying the Directory to List

Loading the List Box

The List Box Callback

Accessing Workspace Variables from a List Box

Techniques Used in This Example

View the Layout and Application M-File

Reading Workspace Variables

Reading the Selections from the List Box

A GUI to Set Simulink Model Parameters

Techniques Used in This Example

View the Layout and Application M-File

How to Use the GUI (Text of GUI Help)

Launching the GUI

Programming the Slider and Edit Text Components

Running the Simulation from the GUI

Removing Results from the List Box

Plotting the Results Data

The GUI Help Button

Closing the GUI

The List Box Callback

An Address Book Reader

Techniques Used in This Example

View the Layout and Application M-File

Managing Global Data

Launching the GUI

Loading an Address Book Into the Reader

The Contact Name Callback

The Contact Phone # Callback

Paging Through the Address Book - Prev/Next

Saving Changes to the Address Book from the Menu

The Create New Menu

The Address Book Resize Function


 Creating Graphical User Interfaces Creating GUIs with MATLAB