Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Creating Graphical User Interfaces (GUIs), MATLAB Version 7.6 (R2008a)

New features and changes introduced in this version are:

New GUI Table Component

The new uitable component allows you to show data in a table. This component replaces the undocumented MATLAB uitable implementation. If you are using the old uitable component, please refer to the uitable Migration Document for help migrating to the supported uitable component.

Event Data Input to GUIDE Callbacks

Auto-generated callbacks of GUIDE GUIs can now access event data for Handle Graphics callbacks. The following Handle Graphics callbacks provide event data when triggered:

For example, the event data for keypress provides information on the key that is pressed. See the Callback Templates documentation for more information.

uigetfile and uiputfile Support of '.', '..', and '/'

Starting in R2007b, the uigetfile and uiputfile functions interpret '.', '..', and '/' the same way as does the cd command. '.' is interpreted as the current directory, '..' is the directory above the current directory, and '/' is the top level directory. When specifying a directory rather than a filename for either the Filterspec or DefaultName argument, you no longer need to end the string with a '/'. However, such strings ending with a '/' are interpreted as they were in previous releases.

hidegui Function Being Obsoleted

The hidegui function is being obsoleted and will be removed in a future version. Instead of this function use the set function to set the figure handle's handlevisibility property to on or off:

set(figurehandle, ‘handlevisibility', 'on') 

Changes to How uicontrols Set Figure SelectionType

SelectionType is a figure property that user interface components set when you click them. It is a read-only property that describes the gesture used when clicking the most recently selected object. For single mouse clicks, components no longer set the figure SelectionType property to anything but 'normal' when they are enabled. By default, all components are enabled (their Enable property is 'on'). Previously, enabled components responded to modifier keys (Ctrl, Alt, Shift, and Cmd) by setting SelectionType to 'alt' or 'extend'. Now all key modifiers set SelectionType to 'normal' for UI components.

Disabled components (those with their Enable property set to 'off') set SelectionType to 'alt' or 'extend' in response to modifier keys.

When Enable is 'on', the control is active and your Callback responds to clicks. When Enable is 'off', the control is not active, and your ButtonDownFcn responds to clicks. You can provide components with a ButtonDownFcn to detect changes in SelectionType.

An additional change affects how list box uicontrol components respond to double-clicking. The second of two successive clicks sets the SelectionType property of an enabled list box to 'open'. Other types of uicontrols set their SelectionType to 'normal' after both the first and the second clicks unless key modifiers were used.

The following table describes the click responses for uicontrol components.

Enable StatusMouse Button PressedKey Modifier PressedSelectionType
on First Click
SelectionType
on Second Click
onleft 'normal''normal'*
onright 'alt''open'
onleftCtrl'normal''normal'*
onrightCtrl'alt''open'
onleftShift'normal''normal'*
onrightShift'extend''open'
offleft 'normal''open'
offright 'alt''open'
offleftCtrl'alt''open'
offrightCtrl'alt''open'
offleftShift'extend''open'
offrightShift'extend''open'

* Double-click result is 'open' for list boxes.

For a two-button mouse, pressing the left and right buttons together (without key modifiers) can set SelectionType to either 'normal' or 'extend'; the results are unpredictable, possibly depending on which button you actually depressed first.

uipushtool and uitoggletool toolbar buttons do not set SelectionType at all, no matter what keys or mouse buttons you press. When they are disabled, uipushtool and uitoggletool controls do not execute their ClickedCallback (or OnCallback/OffCallback), nor does using them trigger a WindowButtonDownFcn callback.

Compatibility Considerations

If your callback code depends on the value for SelectionType, be aware that for the left mouse button, pressing Ctrl no longer sets it to 'alt' and that Shift-clicking no longer sets it to 'extend'.

Te SelectionType behavior for the right mouse button has not changed.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS