MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manuel d'utilisateur Page 268

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 330
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 267
10 Examples of GUIDE GUIs
10-44
save(File,'Addresses')
handles.LastFile = File;
guidata(hObject, handles)
end
end
The Create New Menu
The Create New menu simply clears the Contact Name and Contact Phone #
text fields to facilitate adding a new name and number. After making the new
entries, the user must then save the address book with the
Save or Save As
menus. This callback sets the text
String properties to empty strings:
function New_Callback(hObject, eventdata, handles)
set(handles.Contact_Name,'String','')
set(handles.Contact_Phone,'String','')
The Address Book Resize Function
The address book defines its own resize function. To use this resize function,
you must set the
Application Options dialog Resize behavior to
User-specified, which in turn sets the figure’s ResizeFcn property to:
address_book('ResizeFcn',gcbo,[],guidata(gcbo))
Whenever the user resizes the figure, MATLAB calls the ResizeFcn
subfunction in the address book M-file (
address_book.m)
Behavior of the Resize Function
The resize function allows users to make the figure wider, to accommodate
long names and numbers, but does not allow the figure to be made narrower
than its original width. Also, users cannot change the height. These
restrictions do not limit the usefulness of the GUI and simplify the
resize
function, which must maintain the proper proportions between the figure size
and the components in the GUI.
When the user resizes the figure and releases the mouse, the resize function
executes. At that point, the resized figure’s dimensions are saved. The
following sections describe how the
resize function handles the various
possibilities.
Vue de la page 267
1 2 ... 263 264 265 266 267 268 269 270 271 272 273 ... 329 330

Commentaires sur ces manuels

Pas de commentaire