Class ICustomControl

3DS Max Plug-In SDK

Class ICustomControl

See Also: Custom Controls.

class ICustomControl : public InterfaceServer

Description:

This is the base class from which the 3ds max custom controls are derived. All methods of this class are implemented by the system.

Methods:

Prototype:

virtual HWND GetHwnd()=0;

Remarks:

Returns the handle of the control.

Prototype:

virtual void Enable(BOOL onOff=TRUE)=0;

Remarks:

This method is used to enable the control so it may be operated by the user.

Parameters:

BOOL onOff=TRUE

This parameter is available in release 2.0 and later only.

TRUE to enable; FALSE to disable.

Prototype:

virtual void Enable2(BOOL onOff=TRUE)=0;

Remarks:

This method is available in release 2.0 and later only.

This method is used internally and should not be called by plug-in developers. This second enable function is used to disable and enable custom controls when the associated parameter has a non-keyframable parameter. The effective enable state is the AND of these two enable bits.

For example, when a parameter has a controller plugged into it, and the controller is not keyframable, any spinner control associated with it won't be effective. That's because the controller doesn't take input -- it only outputs values. To prevent the user from being confused by the ineffectiveness of the spinner the control it's automatically disabled by the system using this method.

Parameters:

BOOL onOff=TRUE

TRUE to enable; FALSE to disable.

Prototype:

virtual void Disable()=0;

Remarks:

This method is used to disable the control so it may not be selected or used. When disabled, the control usually appears grayed out.

Prototype:

virtual BOOL IsEnabled()=0;

Remarks:

This returns TRUE if the control is enabled and FALSE if it is disabled.

Prototype:

virtual INT_PTR Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0);

Remarks:

This method is available in release 3.0 and later only.

This is a general purpose function that allows the API to be extended in the future. The 3ds max development team can assign new cmd numbers and continue to add functionality to this class without having to 'break' the API.

This is reserved for future use.

Parameters:

int cmd

The command to execute.

ULONG arg1=0

Optional argument 1 (defined uniquely for each cmd).

ULONG arg2=0

Optional argument 2.

ULONG arg3=0

Optional argument 3.

Return Value:

An integer return value (defined uniquely for each cmd).

Default Implementation:

{ return 0; }