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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 330
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 322
Icon Editor
12-45
function color = getSelectedColor
% function returns the currently selected color in this
% colorPlatte
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 and keep the
% function handle for getting its selected color for editing
% icon.
mGetColorFcn = colorPalette('parent', hPaletteContainer);
This call creates the colorPalette as a component of the iconEditor and then
returns a function handle that
iconEditor can call to get the currently selected
color.
The iconEditor’s
localEditColor helper function calls mGetColorFcn, the
function returned by
colorPalette, to execute the colorPalette’s
getSelectedColor function.
function localEditColor
% helper function that changes the color of an icon data
% point to that of the currently selected color in
% colorPalette
if mIsEditingIcon
pt = get(hIconEditAxes,'currentpoint');
x = ceil(pt(1,1));
y = ceil(pt(1,2));
color = mGetColorFcn();
% update color of the selected block
mIconCData(y, x,:) = color;
localUpdateIconPlot();
end
end
Achieving Proper Resize Behavior
The prepareLayout utility function sets the Units properties of all the GUI
components to enable the GUI to resize correctly on multiple platforms. The
Przeglądanie stron 322

Komentarze do niniejszej Instrukcji

Brak uwag