MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Instrukcja Użytkownika Strona 420

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 500
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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.
Przeglądanie stron 419
1 2 ... 415 416 417 418 419 420 421 422 423 424 425 ... 499 500

Komentarze do niniejszej Instrukcji

Brak uwag