MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual de usuario Pagina 323

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 330
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 322

Comentarios a estos manuales

Sin comentarios