MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guide de l'utilisateur Page 541

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 759
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 540
Compose and Code GUIs with Interactive Tools
5 Place your cursor between the empty brackets and type Ctrl+V,or
right-click and select Paste. Allowing for differences in coordinate values,
the statem ent looks like this one:
btn1 = uicontrol('Style','pushbutt on','String','Push Me',...
'Position',[55 253 65 25]);
Remember that rbbox returns coordinates in figure units ('pixels',inthis
example). If the default
Units valueofacomponentisnotthesameasthe
figure, specify it to be the same w he n you make the component. For example,
the default
Units of a uipanel is 'norm alized'. To sketch a uipanel position,
use code that uses figure
Units, as in the following example:
pnl1 = uipanel('Title','Inputs',.. .
'Units',get(gcf,'Units'),...
'Position',getrect)
Two MATLAB u tilities for compos ing GU Is can assist you in specifying
positions. Use
getpixelposition to obtain a position vector for a component
in units of pixels regardless of its
Units setting. The position origin is
with respect to the parent of the component or the enclosing figure. Use
setpixelposition to specify a new component position in pixels. The Units
property of the component remains unchanged after calling either of these
functions.
Align Components
“Use the align Function” on page 11-53
“Use Align Distribute Tools” on page 11-57
After you position components, they still m ight not line up perfectly. To make
final adjustments, use the
align function from the Command Window. As an
interactive alternative, use the Align Distribute tool, a GUI available from
the figure menu. The following sections describe both approaches.
Use the align Function
Use the alig n function to align user interface controls and axes. This function
enables you to line up the components vertically and horizontally. You can
11-53
Vue de la page 540
1 2 ... 536 537 538 539 540 541 542 543 544 545 546 ... 758 759

Commentaires sur ces manuels

Pas de commentaire