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

  • 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 477
14 Examples of UIs Created Programmatically
14-34
mGetColorFcn = colorPalette('Parent',hPaletteContainer)
The colorPalette function accepts property name-value pairs as input arguments.
Only the Parent is supported. This property specifies the handle of the parent figure
or panel that contains the color palette. If the call to colorPalette does not specify a
parent, it uses the current figure, gcf. Unrecognized property names or invalid values
are ignored.
Copy and View the Color Palette Code
To obtain copies of the program files for this example, follow these steps:
1
Set your current folder to one for which you have write access.
2
Copy the example code to your folder. Then, open colorPalette.m in the Editor:
copyfile(fullfile(docroot, 'techdoc','creating_guis','examples',...
'colorPalette.m')), fileattrib('colorPalette.m', '+w');
copyfile(fullfile(docroot, 'techdoc','creating_guis','examples',...
'iconRead.m')), fileattrib('iconRead.m', '+w');
copyfile(fullfile(docroot, 'techdoc','creating_guis','examples',...
'eraser.gif')), fileattrib('eraser.gif', '+w');
edit colorPalette.m
Caution Do not modify and save the files to the examples folder from which you copied
them.
Local Function Summary for Color Palette
The color palette example includes the callbacks listed in the following table.
Function Description
colorCellCallback Called by hPalettePanelSelectionChanged when any
color cell is clicked.
eraserToolCallback Called by hPalettePanelSelectionChanged when the
Eraser button is clicked.
hMoreColorButtonCallback Executes when the More Colors button is clicked. It calls
uisetcolor to open the standard color-selection dialog box,
and calls localUpdateColor to update the preview.
Vue de la page 477
1 2 ... 473 474 475 476 477 478 479 480 481 482 483 ... 499 500

Commentaires sur ces manuels

Pas de commentaire