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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 216
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 204
An Address Book Reader
5-39
Code Listing
function Contact_Phone_Callback(hObject, eventdata, handles)
Current_Phone = get(handles.Contact_Phone,'string');
% If either one is empty then return
if isempty(Current_Phone)
return
end
% Get the current list of addresses from the handles structure
Addresses = handles.Addresses;
Answer=questdlg('Do you want to change the phone number?', ...
'Change Phone Number', ...
'Yes','Cancel','Yes');
switch Answer
case 'Yes'
% If no name match was found create a new contact
Addresses(handles.Index).Phone = Current_Phone;
handles.Addresses = Addresses;
guidata(hObject, handles)
return
case 'Cancel'
% Revert back to the original number
set(handles.Contact_Phone,'String',Addresses(handles.Index).Phone)
return
end
Paging Through the Address Book — Prev/Next
The Prev and Next buttons page back and forth through the entries in the
address book. Both push buttons use the same callback,
Prev_Next_Callback.
You must set the
Callback property of both push buttons to call this
subfunction, as the following illustration of the
Prev push button Callback
property setting shows.
Vista de página 204
1 2 ... 200 201 202 203 204 205 206 207 208 209 210 ... 215 216

Comentários a estes Manuais

Sem comentários