MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual do Utilizador Página 351

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 500
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 350
Add Components to a Programmatic UI
10-19
The first uicontrol argument, f, specifies the parent container. In this case, the parent
is a figure, but you can also specify the parent to be any container, such as a panel or
button group.
The name-value pair arguments, Style,'popupmenu', specify the uicontrol to be a pop-
up menu.
'String',{'one','two','three','four'} defines the menu items.
'Value',1 sets the index of the item that is selected by default. Set Value to a scalar
that indicates the index of the selected item. A value of 1 selects the first item.
'Position',[30 80 130 20] specifies the location and size of the pop-up menu. In
this example, the pop-up menu is 130 pixels wide. It is positioned 30 pixels from the left
of the figure and 80 pixels from the bottom. The height of a pop-up menu is determined
by the font size; the height you set in the position vector is ignored.
List Box
This code creates a list box:
f = figure;
lb = uicontrol(f,'Style','listbox',...
'String',{'one','two','three','four'},...
'Position',[30 20 130 80],'Value',1);
Vista de página 350
1 2 ... 346 347 348 349 350 351 352 353 354 355 356 ... 499 500

Comentários a estes Manuais

Sem comentários