MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guida Utente Pagina 741

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 759
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 740
Icon Editor
Share Data Between Two GUIs
The iconEditor embeds a GUI, the colorPalette, to enable the user to select
colors for the icon cells. The colorPalette returns the selected color to the
iconEditor via a function handle.
The colorPalette GUI. Like the iconEditor, the colorPalette defines a cell
array,
mOutputArgs, to hold its output arguments.
mOutputArgs = {}; % Variable for storing output when GUI returns
Just before returning, colorPalette assigns mOutputArgs the function
handle for its
getSelectedColor helper function and then assigns
mOutputArgs to varargout to return the arguments.
% Return user defined output i f it is requested
mOutputArgs{1} =@getSelectedColor;
if nargout>0
[varargout{1:nargout}] = mOutputAr gs{:};
end
The iconEditor e xecutes the colorPalette’s getSeclectedColor function
whenever it invokes the function that colorPalette returns to it.
function color = getSelectedColor
% function returns the curr ently selected colo r in this
% colorPlatt e
color = mSelectedColor;
The iconEditor GUI. The iconEditor function calls colorPalette only once
and specifies its parent to be a panel in the iconEditor.
% Host the ColorPalette in the PaletteContainer a nd keep the
% function handle for getti ng its selected col or for editing
% icon.
mGetColorFcn = colorPalette('parent', hPaletteContainer);
This call creates the colorPalette as a com ponent of the iconEditor and then
returns a function handle that
iconEditor can call to get the currently
selected color.
15-77
Vedere la pagina 740
1 2 ... 736 737 738 739 740 741 742 743 744 745 746 ... 758 759

Commenti su questo manuale

Nessun commento