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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 330
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 206
Examples: Programming GUI Components
8-35
handles.default_radius = handles.activex1.radius;
3 In the activex1_Click callback, reset the slider’s Value each time the user
clicks the circle in the ActiveX control. The following command causes the
slider to change position corresponding to the new value of the radius.
set(handles.slider1,'Value',...
hObject.radius/handles.default_radius);
When you open the GUI and move the slider by clicking and dragging, the
radius changes to a new value between 0 and the default radius of 20, as shown
in the following figure.
Viewing the Methods for an ActiveX Control
To view the available methods for an ActiveX control, you first need to obtain
the handle to the control. One way to do this is the following:
1 In the GUI M-file, add the command keyboard on a separate line of the
activex1_Click callback. The command keyboard puts MATLAB in debug
mode and pauses at the
activex1_Click callback when you click the
ActiveX control.
2 Run the GUI and click the ActiveX control.
The handle to the control is now set to
hObject. To view the methods for the
control, enter
methodsview(hObject)
Przeglądanie stron 206
1 2 ... 202 203 204 205 206 207 208 209 210 211 212 ... 329 330

Komentarze do niniejszej Instrukcji

Brak uwag