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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 330
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 197
8 Programming the GUI
8-26
Note To set Resize behavior for the figure to Other (Use ResizeFcn), select
GUI Options from the Layout Editor Tools menu.
1 This example of a ResizeFcn callback retrieves the handles of its children
from its
Children property.
The order in which components appear in a child list is the reverse of the
order in which they tab. See “Setting Tab Order” on page 6-45 for
information about using the Tab Order Editor to determine the tab order.
2 It then modifies the Position properties of the child components relative to
the panel’s new size. The
Position property is a four-element vector that
specifies the size of the component and its location with respect to the bottom
left corner of its parent. The vector is of the form:
[left bottom width height]
The example assumes the panel Units property is normalized. That is, units
map the lower-left corner of the panel to (0,0) and the upper-right corner to
(1.0,1.0). Because of this, the example can modify the component size
relative to the panel size without knowing the actual size of the panel. It
positions the left edge of a button 20% of the panel’s width from the left edge
of the panel and its bottom edge 40% of the panel’s height from the bottom
of the panel. It sets the button’s height to be 50% of the panel’s width and
20% of its height.
function uipanel1_ResizeFcn(hObject, eventdata, handles)
children = get(hObject,'Children');
child_position = get(children(1);'Position');
child_position = [.20,.40,.50,.20];
set(children(1),'Position',child_position);
% Proceed with callback...
Button Group
Button groups are like panels, but can be used to manage exclusive selection
behavior for radio buttons and toggle buttons. The button group’s
SelectionChangeFcn callback is called whenever a selection is made.
Vista de pagina 197
1 2 ... 193 194 195 196 197 198 199 200 201 202 203 ... 329 330

Comentarios a estos manuales

Sin comentarios