<h2>2: Compatibility considerations <Ahref="Getting_Started.html"><imgsrc="Images/uparrow.png"border="0"align="top"alt="Go back up one level"/></A></h2>
<li>2.2. <ahref="#2">Compatibility with version 1</a></li>
</ul>
<ulclass="contents">
</ul>
<ulclass="contents">
</ul>
<brclear="all"/><hr/>
<h2><aname="1"> </a>2.1: Minimum MATLAB version <ahref="Getting_Started2.html"><imgsrc="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>
<brclear="all"/><hr/>
<h2><aname="2"> </a>2.2: Compatibility with version 1 <ahref="Getting_Started2.html"><imgsrc="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
<ahref="matlab:doc gcf"><codeclass="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 <ahref="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 <ahref="matlab:doc uitabgroup"><codeclass="FUNCTION">uitabgroup</code></a>.</p>
<tdwidth="40%"height="15"bgcolor="#e4f0f8"align="left"><ahref="Getting_Started1.html"><fontface="arial"bgcolor="#e4f0f8"size="normal"underline="0"color="#000000">What is GUI Layout Toolbox?</font></a></td>