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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 500
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 406
Create Menus for Programmatic UIs
10-75
mh1 = uimenu(cmenu,'Label','Item 1');
mh2 = uimenu(cmenu,'Label','Item 2');
mh3 = uimenu(cmenu,'Label','Item 3');
You can specify any applicable Uimenu Properties when you define the context menu
items. See the uimenu reference page and “Add Menu Bar Menus” on page 10-66 for
information about using uimenu to create menu items. Note that context menus do not
have an Accelerator property.
Note After you have created the context menu and all its items, set their
HandleVisibility properties to 'off' by executing the following statements:
cmenuhandles = findall(figurehandle,'type','uicontextmenu');
cmenuhandles.HandleVisibility = 'off';
menuitemhandles = findall(cmenuhandles,'type','uimenu');
menuitemhandles.HandleVisibility = 'off';
Associate the Context Menu with Graphics Objects
You can associate a context menu with the figure itself and with all components that
have a UIContextMenu property. This includes axes, panel, button group, all user
interface controls (uicontrols).
This code adds a panel and an axes to the figure. The panel contains a single push
button.
ph = uipanel('Parent',fh,'Units','pixels',...
'Position',[20 40 150 150]);
bh1 = uicontrol(ph,'String','Button 1',...
'Position',[20 20 60 40]);
ah = axes('Parent',fh,'Units','pixels',...
'Position',[220 40 150 150]);
Przeglądanie stron 406
1 2 ... 402 403 404 405 406 407 408 409 410 411 412 ... 499 500

Komentarze do niniejszej Instrukcji

Brak uwag