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

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 500
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 419
11 Code a Programmatic UI
11-2
Initialize a Programmatic UI
Programs that present a UI might perform these tasks when you launch them:
Define default values
Set UI component property values
Process input arguments
Hide the figure window until all the components are created
When you develop a UI, consider grouping these tasks together in your code file. If an
initialization task involves several steps, consider creating a separate function for that
task.
Examples
Declare Variables for Input and Output Arguments
These are typical declarations for input and output arguments.
mInputArgs = varargin; % Command line arguments
mOutputArgs = {}; % Variable for storing output
See the varargin reference page for more information.
Define Custom Property/Value Pairs
This example defines the properties in a cell array, mPropertyDefs, and then initializes
the properties.
mPropertyDefs = {...
'iconwidth', @localValidateInput, 'mIconWidth';
'iconheight', @localValidateInput, 'mIconHeight';
'iconfile', @localValidateInput, 'mIconFile'};
mIconWidth = 16; % Use input property 'iconwidth' to initialize
mIconHeight = 16; % Use input property 'iconheight' to initialize
mIconFile = fullfile(matlabroot,'toolbox/matlab/icons/');
% Use input property 'iconfile' to initialize
Each row of the cell array defines one property. It specifies, in order, the name of the
property, the routine that is called to validate the input, and the name of the variable
that holds the property value.
Vue de la page 419
1 2 ... 415 416 417 418 419 420 421 422 423 424 425 ... 499 500

Commentaires sur ces manuels

Pas de commentaire