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

  • 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 589
12 Code a Programmatic GUI
Examples
If you are readin
g this in the MATLAB Help Browser, use the following links
to view the compl
ete code files for th e se initialization examples in the Editor:
Color Palette
Icon Editor
Declare Variables for Input and Output Arguments
These are typ
ical declarations for input and output arguments. They are
taken from ex
ample “Icon Editor” on page 15-63.
mInputArgs = varargin; % Comma nd line arguments w hen invoking
%theGUI
mOutputArgs = {}; % Variable for storing output when GUI
% returns
See the va
rargin
reference page and the Icon E ditor file for more information.
Define Custom Property/Value Pairs
The exam
ple “Icon Editor” on page 15-63 defines property value pairs to be
used as i
nput arguments.
The exa
mple defines the properties in a cell array,
mPropertyDefs,andthen
initia
lizes the properties.
mPropertyDefs = {...
'iconwidth', @localValidateInput, 'mIconWidth';
'iconheight', @localValid ateInput, 'mIconHeight';
'iconfile', @localValidateInput, 'mIconFile'};
mIconWidth = 16; % Use input property 'ic onwidth' to initialize
mIconHeight = 16; % Use input property 'ic onheight' to initialize
mIconFile = fullfile(matlabroot,'toolbox/matlab/icons/');
% Use input property 'iconfile' to initialize
Eac
h row of the cell array defines one property. It specifie s, in order, the
nam
e of the property, the routine that is called to validate the input, and the
na
me of the variable that holds the property value.
12-4
Vue de la page 589
1 2 ... 585 586 587 588 589 590 591 592 593 594 595 ... 758 759

Commentaires sur ces manuels

Pas de commentaire