MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics) MATLAB Function Reference (Volume 2: Graphics)

12.07.2015 Views

uicontrol PropertiesUicontrolProperties2uicontrol PropertiesYou can set default uicontrol properties on the root and figure levels:set(0,'DefaultUicontrolProperty',PropertyValue...)set(gcf,'DefaultUicontrolProperty',PropertyValue...)where Property is the name of the uicontrol property whose default value youwant to set and PropertyValue is the value you are specifying. Use set and getto access uicontrol properties.Curly braces { } enclose the default value.BackgroundColorColorSpecObject background color. The color used to fill the uicontrol rectangle. Specifya color using a three-element RGB vector or one of MATLAB’s predefinednames. The default color is determined by system settings. See ColorSpec formore information on specifying color.BusyActioncancel | {queue}Callback routine interruption. If a callback is executing and the user triggersan event (such as a mouse click) on an object for which a callback is defined,that callback attempts to interrupt the first callback. The first callback can beinterrupted only at a drawnow, figure, getframe, pause, or waitfor command;if the callback does not contain any of these commands, it cannot beinterrupted.If the Interruptible property of the object whose callback is executing is off(the default value is on), the callback cannot be interrupted (except by certaincallbacks; see the note below). The BusyAction property of the object whosecallback is waiting to execute determines what happens to the callback:• If the value is queue, the callback is added to the event queue and executesafter the first callback finishes execution.• If the value is cancel, the event is discarded and the callback is not executed.Note If the interrupting callback is a DeleteFcn or CreateFcn callback or afigure’s CloseRequest or ResizeFcn callback, it interrupts an executingcallback regardless of the value of that object’s Interruptible property. The2-542

uicontrol Propertiesinterrupting callback starts execution at the next drawnow, figure, getframe,pause, or waitfor statement.ButtonDownFcn stringButton press callback routine. A callback routine that executes whenever youpress a mouse button while the pointer is in a five-pixel wide border around theuicontrol. When the uicontrol’s Enable property is set to inactive or off, theButtonDownFcn executes when you click the mouse in the five-pixel border oron the control itself. This is useful for implementing actions to interactivelymodify control object properties, such as size and position, when they areclicked on (using selectmoveresize, for example).Define this routine as a string that is a valid MATLAB expression or the nameof an M-file. The expression executes in the MATLAB workspace.The Callback property defines the callback routine that executes when youactivate the enabled uicontrol (e.g., click on a push button).CallbackstringControl action. A routine that executes whenever you activate the uicontrolobject (e.g., when you click on a push button or move a slider). Define thisroutine as a string that is a valid MATLAB expression or the name of an M-file.The expression executes in the MATLAB workspace.To execute the callback routine for an editable text control, type in the desiredtext, then either:• Move the focus off the object (click the mouse someplace else in the GUI),• For a single line editable text box, press Return, or• For a multiline editable text box, press Ctl-Return.Callback routines defined for frames and static text do not execute because noaction is associated with these objects.CDatamatrixTruecolor image displayed on control. A three-dimensional matrix of RGBvalues that defines a truecolor image displayed on either a push button ortoggle button. Each value must be between 0.0 and 1.0. More information aboutthis property.2-543

uicontrol Propertiesinterrupting callback starts execution at the next drawnow, figure, getframe,pause, or waitfor statement.ButtonDownFcn stringButton press callback routine. A callback routine that executes whenever youpress a mouse button while the pointer is in a five-pixel wide border around theuicontrol. When the uicontrol’s Enable property is set to inactive or off, theButtonDownFcn executes when you click the mouse in the five-pixel border oron the control itself. This is useful for implementing actions to interactivelymodify control object properties, such as size and position, when they areclicked on (using selectmoveresize, for example).Define this routine as a string that is a valid <strong>MATLAB</strong> expression or the nameof an M-file. The expression executes in the <strong>MATLAB</strong> workspace.The Callback property defines the callback routine that executes when youactivate the enabled uicontrol (e.g., click on a push button).CallbackstringControl action. A routine that executes whenever you activate the uicontrolobject (e.g., when you click on a push button or move a slider). Define thisroutine as a string that is a valid <strong>MATLAB</strong> expression or the name of an M-file.The expression executes in the <strong>MATLAB</strong> workspace.To execute the callback routine for an editable text control, type in the desiredtext, then either:• Move the focus off the object (click the mouse someplace else in the GUI),• For a single line editable text box, press Return, or• For a multiline editable text box, press Ctl-Return.Callback routines defined for frames and static text do not execute because noaction is associated with these objects.CDatamatrixTruecolor image displayed on control. A three-dimensional matrix of RGBvalues that defines a truecolor image displayed on either a push button ortoggle button. Each value must be between 0.0 and 1.0. More information aboutthis property.2-543

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!