MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Especificações Página 200

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 216
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 199
5 GUI Applications
5-34
elseif (length(varargin) == 2 & strcmpi(varargin{1},'book') & (2 ==
exist(varargin{2},'file')))
Check_And_Load(varargin{2},handles);
else
errordlg('File Not Found','File Load Error')
set(handles.Contact_Name,'String','')
set(handles.Contact_Phone,'String','')
end
Loading an Address Book Into the Reader
There are two ways in which an address book (i.e., a MAT-file) is loaded into
the GUI:
When running the GUI, you can specify a MAT-file as an argument. If you
do not specify an argument, the GUI loads the default address book
(
addrbook.mat).
The user can select
Open under the File menu to browse for other MAT-files.
Validating the MAT-file
To be a valid address book, the MAT-file must contain a structure called
Addresses that has two fields called Name and Phone. The Check_And_Load
subfunction validates and loads the data with the following steps:
Loads (
load) the specified file or the default if none is specified.
Determines if the MAT-file is a valid address book.
Displays the data if it is valid. If it is not valid, displays an error dialog
(
errordlg).
Returns
1 for valid MAT-files and 0 if invalid (used by the Open menu
callback)
Saves the following items in the
handles structure:
- The name of the MAT-file
- The
Addresses structure
- An index pointer indicating which name and phone number are currently
displayed
Vista de página 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 215 216

Comentários a estes Manuais

Sem comentários