Redraw Circle in mwsamp Control

This example shows how to call a method of the mwsamp control to redraw a circle.

Create the control. MATLAB® opens a figure window and displays a circle and text label.

myfigure = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200]);

Display the properties of the control.

get(myfigure)
            Label: 'Label'
           Radius: 20
    Ret_IDispatch: [1x1 Interface.mwsamp2_ActiveX_Control_module._DMwsamp2]

You can change the text displayed in the Label property and the radius of the circle.

Display the methods for the mwsamp control. MATLAB displays the list alphabetically; methods with initial uppercase names are listed before methods with lowercase names.

methods(myfigure)
Methods for class COM.mwsamp_mwsampctrl_1:

AboutBox          GetR8Array        SetR8             invoke            
Beep              GetR8Vector       SetR8Array        load              
FireClickEvent    GetVariantArray   SetR8Vector       move              
GetBSTR           GetVariantVector  addproperty       propedit          
GetBSTRArray      Redraw            constructorargs   release           
GetI4             SetBSTR           delete            save              
GetI4Array        SetBSTRArray      deleteproperty    send              
GetI4Vector       SetI4             events            set               
GetIDispatch      SetI4Array        get               
GetR8             SetI4Vector       interfaces   

To use the Redraw method, display the method signatures which specify the input and output arguments. The input argument for the Redraw method is the object handle.

methods(myfigure,'-full')
Methods for class COM.mwsamp_mwsampctrl_2:

AboutBox(handle)
double AddDouble(handle, double, double)
Beep(handle)
FireClickEvent(handle)
FireEventArgs(handle)
FireMouseDownEvent(handle)
Fire_Double_Click(handle)
ustring GetBSTR(handle)
Variant GetBSTRArray(handle)
int32 GetI4(handle)
Variant GetI4Array(handle)
Variant GetI4Vector(handle)
handle GetIDispatch(handle)
double GetR8(handle)
Variant GetR8Array(handle)
Variant GetR8Vector(handle)
Variant GetVariantArray(handle)
Variant GetVariantVector(handle)
Redraw(handle)
ustring RetErrorInfo(handle)
Variant ReturnVTError(handle)
ustring SetBSTR(handle, ustring)
Variant SetBSTRArray(handle, Variant)
int32 SetI4(handle, int32)
Variant SetI4Array(handle, Variant)
Variant SetI4Vector(handle, Variant)
bool SetIDispatch(handle, handle)
double SetR8(handle, double)
Variant SetR8Array(handle, Variant)
Variant SetR8Vector(handle, Variant)
Variant ShowVariant(handle, int16, Variant, Variant, Variant, Variant)
bool VariantOfTypeHandle(handle, Variant)
addproperty(handle, string)
MATLAB array constructorargs(handle)
delete(handle, MATLAB array)
deleteproperty(handle, string)
MATLAB array events(handle, MATLAB array)
MATLAB array get(handle vector, MATLAB array, MATLAB array)
MATLAB array get(handle, MATLAB array, MATLAB array)
MATLAB array get(handle)
MATLAB array interfaces(handle)
MATLAB array invoke(handle, string, MATLAB array)
MATLAB array invoke(handle)
load(handle, string)
MATLAB array move(handle, MATLAB array)
MATLAB array move(handle)
propedit(handle)
release(handle, MATLAB array)
save(handle, string)
MATLAB array send(handle)
MATLAB array set(handle vector, MATLAB array, MATLAB array)
MATLAB array set(handle, MATLAB array, MATLAB array)
MATLAB array set(handle)

Change the radius of circle myfigure to 100.

myfigure.Radius = 100;
Redraw(myfigure)

Close the figure window.

Related Topics