Public Member Functions

ICustomControl Class Reference

This reference page is linked to from the following overview topics: Incremental Improvements, What's New: 3ds Max 2009 SDK, Methods and Classes of Custom Controls.


Search for all occurrences

Detailed Description

See also:
Custom Controls.

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.

#include <custcont.h>

Inheritance diagram for ICustomControl:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual HWND  GetHwnd ()=0
virtual void  Enable (BOOL onOff=TRUE)=0
virtual void  Disable ()=0
virtual BOOL  IsEnabled ()=0
virtual void  Enable2 (BOOL onOff=TRUE)=0
virtual INT_PTR  Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
virtual void  SetTooltip (bool bEnable, const MCHAR *text)=0
  Sets a tooltip for the custom control.
virtual void  SetTooltip (bool bEnable, MCHAR *text)
  Deprecated method - implement void SetTooltip(bool bEnable, const MCHAR* text)
CoreExport void  UpdateEnableState (Animatable *anim, int subNum)
  Helper function to disable or enable this UI control based on whether the Animatable associated with it is keyframable or not (locked parameter or scripted parameters are not keyframable).

Member Function Documentation

virtual HWND GetHwnd ( ) [pure virtual]
Remarks:
Returns the handle of the control.
virtual void Enable ( BOOL  onOff = TRUE ) [pure virtual]
Remarks:
This method is used to enable the control so it may be operated by the user.
Parameters:
onOff TRUE to enable; FALSE to disable.
virtual void Disable ( ) [pure virtual]
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.
virtual BOOL IsEnabled ( ) [pure virtual]
Remarks:
This returns TRUE if the control is enabled and FALSE if it is disabled.
virtual void Enable2 ( BOOL  onOff = TRUE ) [pure virtual]
Remarks:
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:
onOff TRUE to enable; FALSE to disable.
virtual INT_PTR Execute ( int  cmd,
ULONG_PTR  arg1 = 0,
ULONG_PTR  arg2 = 0,
ULONG_PTR  arg3 = 0 
) [inline, virtual]
Remarks:
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:
cmd The command to execute.
arg1 Optional argument 1 (defined uniquely for each cmd).
arg2 Optional argument 2.
arg3 Optional argument 3.
Returns:
An integer return value (defined uniquely for each cmd).
Default Implementation:
{ return 0; }
{ return 0; }
virtual void SetTooltip ( bool  bEnable,
const MCHAR *  text 
) [pure virtual]

Sets a tooltip for the custom control.

This method allows for turning on or off the tooltip for a custom control.

Parameters:
bEnable - if true, the tooltip is enabled, otherwise disabled. When disabled, the tooltip won't be displayed when the the mouse hovers on top of the control. Enabling the tooltip repeatedly will have the same effect as enabling it once.
text - pointer to a string representing the text to be displayed in the tooltip window. This parameter is ignored when the tooltip is being disabled.
virtual void SetTooltip ( bool  bEnable,
MCHAR *  text 
) [inline, virtual]

Deprecated method - implement void SetTooltip(bool bEnable, const MCHAR* text)

{ SetTooltip(bEnable, const_cast<const MCHAR*>(text)); }
CoreExport void UpdateEnableState ( Animatable anim,
int  subNum 
)

Helper function to disable or enable this UI control based on whether the Animatable associated with it is keyframable or not (locked parameter or scripted parameters are not keyframable).

When a UI control is associated with a parameter residing within a parameter block with the optional p_ui tag then the control will be automatically disabled when the parameter is non-keyframable and this method does not need to be used. When the control is not using that automatic association this helper method can be used. Caller needs to identify the parameter associated to the control as the subanim number of an Animatable.

Parameters:
[in] anim The parent of the Animatable this control is associated with (if NULL, this method will do nothing).
[in] subNum The subanim number of the Animatable associated with this control. For IParamBlock2 use IParamBlock2::GetAnimNum to get subNum from ParamID (see sample code, for instance maxsdk\samples\materials\stdShaders.cpp).

ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl
ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl ICustomControl