MATLAB Creating Graphical User Interfaces

(ff) #1

Use the Property Inspector to Align Components


The Property Inspector enables you to align components by setting their Position
properties. A component's Position property is a four-element vector that specifies the
size and location of the component: [distance from left, distance from bottom, width,
height]. The values are given in the units specified by the Units property of the
component.


(^1) Select the components you want to align.
(^2) Select View > Property Inspector or click the Property Inspector button.
3 In the Property Inspector, scroll to the Units property and note its current setting,
then change the setting to inches.
(^4) Scroll to the Position property. This figure shows the Position property for
multiple components of the same size.
(^5) Change the value of x to align their left sides. Change the value of y to align their
bottom edges. For example, setting x to 2.0 aligns the left sides of the components 2
inches from the left side of the window.
(^6) When the components are aligned, change the Units property back to its original
setting.
Grid and Rulers
The layout area displays a grid and rulers to facilitate component layout. Grid lines are
spaced at 50-pixel intervals by default. The size of each pixel is 1/96th of an inch on
Windows systems and 1/72nd of an inch on Macintosh systems. On Linux® systems, the
size of a pixel is determined by your system resolution.
Align GUIDE UI Components

Free download pdf