MATLAB Creating Graphical User Interfaces
Example of a Simple Layout Here is the code for a simple app containing an axes and a button. To see how it works, copy and past ...
returns to the calling function. Doing this delays the figure display until after MATLAB adds all the components. Thus, the resu ...
The container becomes visible for the first time. The container is visible while its drawable area changes. The container becom ...
plot(hs.ax,theta,y); end function resizeui(hObject,event) % Get figure width and height figwidth = hs.fig.Position(3); figheight ...
Also, it is important to delay the display of the entire UI window until after all the variables that a SizeChangedFcn callback ...
Customize Tabbing Behavior in a Programmatic App In this section... “How Tabbing Works” on page 9-34 “Default Tab Order” on page ...
'Position',[290 200 130 20]); sth = uicontrol(fh,'Style','text','String','Select Data',... 'Position',[290 230 60 20]); ph = uip ...
3x1 UIControl array: UIControl (Surf) UIControl (Mesh) UIControl (Contour) The default tab order is the reverse of the child ord ...
The tab order of the three buttons is now Contour, then Surf, then Mesh. This command shows the new child order. ph.Children ans ...
Create Menus for Programmatic Apps In this section... “Add Menu Bar Menus” on page 9-38 “Add Context Menus to a Programmatic App ...
If you use the standard menu bar menus, any menus you create are added to it. If you choose not to display the standard menu bar ...
contain a menu bar or a toolbar. This is because docking is controlled by the docking icon, a small curved arrow near the upper- ...
For more information, see the DockControls, MenuBar, ToolBar, and WindowStyle property descriptions on the Figure page. Menu Bar ...
If your UI does not display the standard menu bar, MATLAB creates a menu bar if none exists and then adds the menu to it. 9 Lay ...
This command adds a separator line preceding the second menu item. eh2.Separator = 'on'; Create Menus for Programmatic Apps ...
The following statements add two menu subitems to Item 1, assign each subitem a keyboard accelerator, and disable the first subi ...
The Accelerator property adds keyboard accelerators to the menu items. Some accelerators may be used for other purposes on your ...
Add Context Menus to a Programmatic App Context menus appear when the user right-clicks on a figure or UI component. Follow thes ...
using uimenu to create menu items. Note that context menus do not have an Accelerator property. NoteAfter you have created the c ...
This code associates the context menu with the figure and with the axes by setting the UIContextMenu property of the figure and ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf