23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

actxcontrol<br />

Note There are two ways to handle events. You can create a single callback<br />

or you can specify a cell array that contains pairs of events and event<br />

handlers. In the cell array format, specify events by either number or name.<br />

Each control defines event numbers and names. There is no limit to the<br />

number of pairs that can be specified in the cell array. Although using the<br />

single callback method may be easier in some cases, using the cell array<br />

technique creates more efficient code that results in better performance.<br />

Returns A <strong>MATLAB</strong> activex object that represents the default interface for this control<br />

or server. Use the get, set, invoke, propedit, release, and delete methods<br />

on this object. A <strong>MATLAB</strong> error will be generated if this call fails.<br />

Description Create an ActiveX control at a particular location within a figure window. If the<br />

parent figure window is invisible, the control will be invisible. The returned<br />

<strong>MATLAB</strong> activex object represents the default interface for the control. This<br />

interface must be released through a call to release when it is no longer<br />

needed to free the memory and resources used by the interface. Note that<br />

releasing the interface does not delete the control itself (use the delete<br />

command to delete the control.)<br />

Example Callback style:<br />

For an example callback event handler, see the file sampev.m in the<br />

toolbox\matlab\winfun directory.<br />

f = figure ('pos', [100 200 200 200]);<br />

% create the control to fill the figure<br />

h = actxcontrol ('MWSAMP.MwsampCtrl.1', [0 0 200 200], ...<br />

gcf, 'sampev')<br />

Cell array style:<br />

h = actxcontrol ('SELECTOR.SelectorCtrl.l', ...<br />

[0 0 200 200], f, {-600 'myclick'; -601 'my2click'; ...<br />

-605 'mymoused'})<br />

h = actxcontrol ('SELECTOR.SelectorCtrl.l', ...<br />

[0 0 200 200], f, {'Click' 'myclick'; ...<br />

2-35

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

Saved successfully!

Ooh no, something went wrong!