Page MenuHomec4science

Getting_Started2.html
No OneTemporary

File Metadata

Created
Fri, Jun 7, 06:12

Getting_Started2.html

<html xmlns:saxon="http://icl.com/saxon">
<head>
<link rel="stylesheet" type="text/css" href="doc.css"/>
<link rel="stylesheet" type="text/css" href=""/>
<meta author="The MathWorks Ltd."/>
<meta copyright="2017 The MathWorks Ltd."/>
<title>Compatibility considerations</title>
</head>
<body>
<table class="header" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#e4f0f8"><A href="Getting_Started.html"><font face="Arial" bgcolor="#e4f0f8" size="+0" underline="0" color="#000000"><b>Getting_Started</b></font></A></td>
<td width="36" bgcolor="#e4f0f8"><A HREF="Getting_Started1.html"><IMG SRC="Images/leftarrow.png" BORDER="0" ALT="previous page"/></A><A HREF="Getting_Started3.html"><IMG SRC="Images/rightarrow.png" BORDER="0" ALT="next page"/></A></td>
</tr>
</table>
<h2>2: Compatibility considerations&nbsp;<A href="Getting_Started.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></A></h2>
<h3>Section contents:</h3>
<ul class="contents">
<li>2.1. <a href="#1">Minimum MATLAB version</a></li>
<li>2.2. <a href="#2">Compatibility with version 1</a></li>
</ul>
<ul class="contents">
</ul>
<ul class="contents">
</ul>
<br clear="all"/><hr/>
<h2><a name="1">&nbsp;</a>2.1: Minimum MATLAB version&nbsp;<a href="Getting_Started2.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
<p>This is version 2 of GUI Layout Toolbox, designed to work with the new
MATLAB graphics system that was introduced in R2014b.</p>
<p>Version 1 works with MATLAB releases prior to R2014b that use the old
graphics system.</p>
<br clear="all"/><hr/>
<h2><a name="2">&nbsp;</a>2.2: Compatibility with version 1&nbsp;<a href="Getting_Started2.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
<p>If you are upgrading from version 1, there are a number of compatibility
considerations:</p>
<h4>Package name</h4>
<p>Version 1 classes were contained in the package "uiextras". Version 2 classes are
contained in the package "uix". In version 2, a package "uiextras" is included
to provide support for legacy code. Classes in "uiextras" extend
corresponding classes in "uix", and contain only compatibility-related
code.</p>
<h4>Contents property</h4>
<p>The contents of version 1 objects were accessible via the property <code>Children</code>.
The contents of version 2 objects are accessible via the property <code>Contents</code>.
Version 2 objects also provide a property <code>Children</code>, but this controls the
vertical stacking order rather than the layout order. Legacy code that accesses
<code>Children</code> will run without error, but will not achieve the desired change in
layout order, and should be modified to access <code>Contents</code> instead.</p>
<p>An upcoming release of version 1 will include support for code that references
contents via <code>Contents</code>. That way, code modified to work in version 2 will also
work in version 1.</p>
<p>The background to this change is as follows. Version 1 objects were wrappers
for built-in graphics objects, and presented contents in layout order via
the property <code>Children</code>. Version 2 objects extend built-in graphics objects,
and as such, inherit properties, methods and events. One such property is
<code>Children</code> which is used to control the top-to-bottom stacking order.
MATLAB stacking rules, e.g. controls are always on top of axes, mean that
some reasonable layout orders may be invalid stacking orders, so a new
property for layout order is required.</p>
<h4>Auto-parenting</h4>
<p>The new MATLAB graphics system introduces unparented objects, i.e. those with property <code>Parent</code>
empty. The new system also introduces a separation between formal class constructors, e.g.
<code>matlab.ui.container.Panel</code>, and informal construction functions, e.g. <code>uipanel</code>.
Construction functions are auto-parenting, i.e. if <code>Parent</code> is not specified then it is set to
<a href="matlab:doc gcf"><code class="FUNCTION">gcf</code></a>, whereas class constructors return objects with <code>Parent</code> empty unless
explicitly specified. Version 2 presents a formal interface of class constructors which follow this new
convention.</p>
<p>Classes in "uiextras" are auto-parenting so the behavior of legacy code is
unchanged. However, best practice is to specify parent explicitly during
construction.</p>
<h4>Defaults mechanism</h4>
<p>Version 1 provided a defaults mechanism (<code>uiextras.get</code>, <code>uiextras.set</code>
and <code>uiextras.unset</code>) that mimicked <code>get</code> and <code>set</code> in the MATLAB
graphics system itself. This feature has been removed from version 2. Users should use an
alternative programming pattern, e.g. factory function, to create objects with standard settings.</p>
<h4>Enable and disable</h4>
<p>Version 1 provided a mechanism to enable and disable container contents using the property
<code>Enable</code>. This feature has been removed from version 2. Users should enable and disable
controls directly rather than via containers.</p>
<p>For more commentary, see <a href="http://goo.gl/j0KmTR">this article</a>.</p>
<h4>Other property name changes</h4>
<p>A number of property names have changed to achieve greater consistency
across the package. For example, <code>RowSizes</code> and <code>ColumnSizes</code> in
uiextras.Grid are now <code>Heights</code> and <code>Widths</code> in uix.Grid. The package
"uiextras" provides support for legacy property names.</p>
<ul>
<li><code>RowSizes</code> in "uiextras" is <code>Heights</code> in "uix"</li>
<li><code>ColumnSizes</code> in "uiextras" is <code>Widths</code> in "uix"</li>
<li><code>ShowMarkings</code> in "uiextras" is <code>DividerMarkings</code> in "uix"</li>
</ul>
<h4>Property shape changes</h4>
<p>Version 2 contents companion properties are now of the same size as <code>Contents</code>,
i.e. column vectors. In version 1, these properties were row vectors. The
package "uiextras" provides support for legacy property values.</p>
<h4>Tab selection behavior</h4>
<p>In version 1, after adding a tab to a tab panel, the new tab is selected.</p>
<p>In version 2, the original selection is preserved, except if the tab panel was
empty, in which case the new tab is selected. This is consistent with the
behavior of <a href="matlab:doc uitabgroup"><code class="FUNCTION">uitabgroup</code></a>.</p>
<br clear="ALL"/>
<table class="footer" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" height="15" bgcolor="#e4f0f8" align="left"><a href="Getting_Started1.html"><img src="images/leftarrow.png" border="0" alt="previous page"/></a></td>
<td width="40%" height="15" bgcolor="#e4f0f8" align="left"><a href="Getting_Started1.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">What is GUI Layout Toolbox?</font></a></td>
<td width="20%" height="15" bgcolor="#e4f0f8" align="center"><a href="index.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">[Top]</font></a></td>
<td width="40%" height="15" bgcolor="#e4f0f8" align="right"><a href="Getting_Started3.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Release notes</font></a></td>
<td width="18" height="15" bgcolor="#e4f0f8" align="right"><a href="Getting_Started3.html"><img src="images/rightarrow.png" border="0" alt="next page"/></a></td>
</tr>
</table>
<font face="Arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">&copy; 2017 The MathWorks Ltd</font>
<TT>&#149; </TT><a href="matlab: termsOfUse">Terms of Use</a>
<TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/patents.txt'])">Patents</a>
<TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/trademarks.txt'])">Trademarks</a>
</body>
</html>

Event Timeline