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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 500
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 128
Add Components to the GUIDE Layout Area
6-43
Create the toggle button with the button selected (depressed) by setting its Value
property to the value of its Max property (default is 1). Set Value to Min (default is 0)
to leave the toggle button unselected (raised). Correspondingly, when the user selects
the toggle button, MATLAB software sets Value to Max, and to Min when the user
deselects it. The following figure shows the toggle button in the depressed position.
If you want to set the position or size of the component to an exact value, then modify
its Position property. See “Locate and Move Components” on page 6-74 and
“Resize GUIDE UI Components” on page 6-67 for details.
To add an image to a toggle button, assign the button's CData property an m-
by-n-by-3 array of RGB values that defines a truecolor image. You must do this
programmatically in the opening function of the UI code file. For example, the array
img defines a 16-by-64-by-3 truecolor image using random values between 0 and 1
(generated by rand).
img = rand(16,64,3);
set(handles.togglebutton1,'CData',img);
where togglebutton1 is the toggle button's Tag property.
Vista de pagina 128
1 2 ... 124 125 126 127 128 129 130 131 132 133 134 ... 499 500

Comentarios a estos manuales

Sin comentarios