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

  • 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 531
11 Lay Out a Programmatic GUI
4 Make sure that you know the handle of the component you have
manipulated. In the following code, the handle is a variable n amed
object_handle.
5 Obtain the component position vector from the Property Inspector. Type
inspect
or enter a get statement, such as:
get(object_handle, 'Position')
ans =
15.2500 333.0000 106.0000 20.0000
6 Copy the result (ans) and ins ert it in a set statement in your code file,
within square b rackets :
set(object_handle, 'Position', [15.2500 333.0000 106. 0000 20.0000])
Tip Instead of using a separate set command, after you decide upon a position
for the object, you can modify the statement in your code file that creates the
object to include the
Position parameter and value.
To position components systematically, you can create a function to manage
the process. Here is a simple exam ple function called
editpos:
function rect = editpos(handle)
% Enters plot edit mode, pauses to let user manipulate ob ject s,
% then turns the mode off. It does not tr ack what user does.
% User later needs to outpu t a Position proper ty, if changed.
if ~ishghand le(h andle)
disp(['=E= gbt_ move obj: Invalid handle : ' inputname(1)])
return
end
plotedit(handle,'on')
disp('=== Se lect , move and resize object. Use mous e and arrow keys.' )
disp('=== Wh en you are finished , press Return to continue.')
pause
11-44
Vue de la page 531
1 2 ... 527 528 529 530 531 532 533 534 535 536 537 ... 758 759

Commentaires sur ces manuels

Pas de commentaire