3ds Max C++ API Reference
ISliderControl Class Referenceabstract

#include <custcont.h>

+ Inheritance diagram for ISliderControl:

Public Member Functions

virtual float GetFVal ()=0
 
virtual int GetIVal ()=0
 
virtual void SetNumSegs (int num)=0
 
virtual void SetValue (float v, int notify)=0
 
virtual void SetValue (int v, int notify)=0
 
virtual void SetLimits (int min, int max, int limitCurValue=TRUE)=0
 
virtual void SetLimits (float min, float max, int limitCurValue=TRUE)=0
 
virtual void LinkToEdit (HWND hEdit, EditSpinnerType type)=0
 
virtual void SetIndeterminate (BOOL i=TRUE)=0
 
virtual BOOL IsIndeterminate ()=0
 
virtual void SetResetValue (float v)=0
 
virtual void SetResetValue (int v)=0
 
virtual void SetKeyBrackets (BOOL onOff)=0
 
- Public Member Functions inherited from ICustomControl
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. More...
 
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). More...
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class ICustomControl, Class ISpinnerControl.

Description:
Important Note: The slider control ensures that it only displays, and the user is only allowed to input, values within the specified ranges. However the slider is just a front end to a controller which actually controls the value. The user can thus circumvent the slider constraints by editing the controller directly (via function curves in track view, key info, etc.). Therefore, when a plug-in gets a value from a controller (or a parameter block, which may use a controller) it is its responsibility to clamp the value to a valid range.

Slider Control

'Bracketed' Slider Control
The custom slider control is functionality similar to the custom spinner control. It supports the following features:

  • can link to custom edit box.

  • right click reset of value.

    if not dragging, resets to default reset value.

    if dragging, resets to previous value.

  • shift+right click sets an animation key.

  • red highlight for animated key positions.

    It also supports the following functionality:

  • dynamically set tick marks segment the slider track.

  • default reset value and last value are visually indicated.

  • left click in slider track moves button to that position.

  • ctrl key snaps to nearest tick mark.
    Also Note: Developers should use the functions Get/SetSpinnerPrecision() for controlling precision of edit boxes linked to slider controls. Those functions affect both spinners and sliders.

    To initialize the pointer to the control call:
    ISliderControl *GetISlider(HWND hCtrl);
    To release the control call:
    void ReleaseISlider(ISliderControl *isc);
    The value to use in the Class field of the Custom Control Properties dialog is: SliderControl

    The following messages may be sent by the slider control:
    This message is sent when the value of a slider changes.
    CC_SLIDER_CHANGE
    lParam contains a pointer to the slider control. You can cast this pointer to a ISliderControl type and then call methods of the control.
    LOWORD(wParam) contains the ID of the slider. This is the ID established in the ID field of the Custom Control Properties dialog.
    HIWORD(wParam) is TRUE if the user is dragging the slider interactively.
    This message is sent when the user presses down on the slider.
    CC_SLIDER_BUTTONDOWN
    lParam contains a pointer to the slider control. You can cast this pointer to a ISliderControl type and then call methods of the control.
    LOWORD(wParam) contains the ID of the slider. This is the ID established in the ID field of the Custom Control Properties dialog.
    This message is sent when the user releases a slider.
    CC_SLIDER_BUTTONUP
    lParam contains a pointer to the slider control. You can cast this pointer to a ISliderControl type and then call methods of the control.
    LOWORD(wParam) contains the ID of the slider. This is the ID established in the ID field of the Custom Control Properties dialog.
    HIWORD(wParam) is FALSE if the user canceled and TRUE otherwise.

Member Function Documentation

◆ GetFVal()

virtual float GetFVal ( )
pure virtual
Remarks
Returns the floating point value of the control.

◆ GetIVal()

virtual int GetIVal ( )
pure virtual
Remarks
Returns the integer value of the control.

◆ SetNumSegs()

virtual void SetNumSegs ( int  num)
pure virtual
Remarks
Sets the number of segments (tick marks) used by the control.
Parameters:
int num

The number to set.

◆ SetValue() [1/2]

virtual void SetValue ( float  v,
int  notify 
)
pure virtual
Remarks
This method sets the value of the control to the specific floating point number passed. You may pass FALSE as the notify parameter so the control wont send a message when you set the value.
Parameters:
float v

The new value for the control.

int notify

If TRUE a message is sent indicating the control has changed; if FALSE no message is sent.

◆ SetValue() [2/2]

virtual void SetValue ( int  v,
int  notify 
)
pure virtual
Remarks
This method sets the value of the control to the specific integer number passed. You may pass FALSE as the notify parameter so the control wont send a message when you set the value.
Parameters:
int v

The new value for the control.

int notify

If TRUE a message is sent indicating the control has changed; if FALSE no message is sent.

◆ SetLimits() [1/2]

virtual void SetLimits ( int  min,
int  max,
int  limitCurValue = TRUE 
)
pure virtual
Remarks
This method establishes the allowable limits for integer values entered.
Parameters:
int min

The minimum allowable value.

int max

The maximum allowable value.

int limitCurValue = TRUE

You may pass FALSE to the this parameter so the control will not send a spinner changed message when the limits are set.

◆ SetLimits() [2/2]

virtual void SetLimits ( float  min,
float  max,
int  limitCurValue = TRUE 
)
pure virtual
Remarks
This method establishes the allowable limits for floating point values entered.
Parameters:
float min

The minimum allowable value.

float max

The maximum allowable value.

int limitCurValue = TRUE

You may pass FALSE to the this parameter so the control will not send a spinner changed message when the limits are set.

◆ LinkToEdit()

virtual void LinkToEdit ( HWND  hEdit,
EditSpinnerType  type 
)
pure virtual
Remarks
When an edit control is used in conjunction with the slider control, this method is used to link the two, so values entered using the slider are displayed in the edit control. This method is also used to set the type of value which may be entered.
Parameters:
HWND hEdit

The handle of the edit control to link.

EditSpinnerType type

The type of value that may be entered. One of the following values:

EDITTYPE_INT

Any integer value.

EDITTYPE_FLOAT

Any floating point value.

EDITTYPE_UNIVERSE

This is a value in world space units. It respects the system's unit settings (for example feet and inches).

EDITTYPE_POS_INT

Any integer >= 0

EDITTYPE_POS_FLOAT

Any floating point value >= 0.0

EDITTYPE_POS_UNIVERSE

This is a positive value in world space units. It respects the system's unit settings (for example feet and inches) .

EDITTYPE_TIME

This is a time value. It respects the system time settings (SMPTE for example).

◆ SetIndeterminate()

virtual void SetIndeterminate ( BOOL  i = TRUE)
pure virtual
Remarks
This method is used to show commonality. When several different values are being reflected by the slider, the value is indeterminate. When TRUE, the value field of the slider appears empty.
Parameters:
BOOL i=TRUE

Pass TRUE to this method to set the value to indeterminate.

◆ IsIndeterminate()

virtual BOOL IsIndeterminate ( )
pure virtual
Remarks
This method returns TRUE if the current state of the slider is indeterminate; otherwise FALSE. See SetIndeterminate() above.

◆ SetResetValue() [1/2]

virtual void SetResetValue ( float  v)
pure virtual
Remarks
A user may right click on a slider to reset it to its 'reset' value (after it has been changed). This method specifies the value used when the reset occurs.
Parameters:
float v

The reset value.

◆ SetResetValue() [2/2]

virtual void SetResetValue ( int  v)
pure virtual
Remarks
A user may right click on a slider to reset it to its 'reset' value (after it has been changed). This method specifies the value used when the reset occurs.
Parameters:
int v

The reset value.

◆ SetKeyBrackets()

virtual void SetKeyBrackets ( BOOL  onOff)
pure virtual
Remarks
Sets the display of the 'brackets' surrounding the slider control. This is used to indicate if a key exists for the parameter controlled by the slider at the current time. These brackets turned on and off automatically if you are using a parameter map and parameter block to handle the control. If not you'll need to use this method. For a slider, the 'brackets' appear as a colored dot in the position marker.
Parameters:
BOOL onOff

TRUE for on; FALSE for off.