3ds Max C++ API Reference
Loading...
Searching...
No Matches
ColPick Class Referenceabstract

This is the base class for the creation of plug-in color selectors. More...

#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/ColorPicker.h>

Inheritance diagram for ColPick:

Public Member Functions

virtual INT_PTR ModalColorPicker (HWND hwndOwner, AColor &color, ColorPicker::Flags flags, IPoint2 *pPos, ColorPickerCallback *callBack, const MCHAR *name, ColorContext context=ColorContext::COLOR_SPACE_CONTEXT_NONE)=0
 This function puts up the "modal" color picker dialog box.
virtual ColorPickerCreateColorPicker (HWND hwndOwner, const AColor &initColor, ColorPicker::Flags flags, IPoint2 *pPos, ColorPickerCallback *callback, const MCHAR *name, ColorContext context=ColorContext::COLOR_SPACE_CONTEXT_NONE, BOOL objClr=FALSE)=0
 Creates and shows the modeless color picker dialog.
virtual const MCHARClassName ()=0
 Returns the name of the class.
virtual Class_ID ClassID ()=0
 Returns the unique ClassID of this plug-in.
virtual void DeleteThis ()=0
 This method is called to delete this instance of the plug-in class.
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)=0
 This method is used for future expansion and is currently not used.
Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
static UtilExport voidmalloc_nullchecked (size_t size)
 Allocates memory via malloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidcalloc_nullchecked (size_t num, size_t size)
 Allocates memory via calloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidrealloc_nullchecked (void *memblock, size_t size)
 Reallocates memory via realloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidLocalAlloc_nullchecked (unsigned int uFlags, size_t size)
 Allocates memory via LocalAlloc without invoking 3dsmax's out of memory handler with potential CER.

Detailed Description

This is the base class for the creation of plug-in color selectors.

The list of available color pickers appear in the 3ds Max user interface in the General page of the Preferences dialog. The chosen picker will be called whenever a user clicks on a 3ds Max color swatch control or a color picker launched through the API.

Super Class ID COLPICK_CLASS_ID
Standard File Name Extension DLU

Member Function Documentation

◆ ModalColorPicker()

virtual INT_PTR ModalColorPicker ( HWND hwndOwner,
AColor & color,
ColorPicker::Flags flags,
IPoint2 * pPos,
ColorPickerCallback * callBack,
const MCHAR * name,
ColorContext context = ColorContext::COLOR_SPACE_CONTEXT_NONE )
pure virtual

This function puts up the "modal" color picker dialog box.

This is a blocking call, that means the function won't return until the user closes the color picker.

Parameters
[in]hwndOwnerOwner (parent) window handle.
[in,out]colorReference to the color to be edited. Value of this parameter will be used as the initial color. When the function returns, it will contain the color selected by the user if the user pressed OK.
[in]flagsColorPicker::Flags values controlling the look and behavior of the color picker (e.g. alpha enabled/disabled)
[in,out]pPosPointer to the starting position of the upper left corner of the dialog window. This is set to the ending position when the user is done. If null, color picker will be displayed in the current mouse position.
[in]callBackCallback object whose procs are called when user interacts with the color picker. See Class ColorPickerCallback.
[in]nameThe name of color being edited to appear in the title bar.
[in]contextThe color context to be used by the color picker. see ColorContext for details.
Returns
Returns TRUE if the user exists the dialog with OK, otherwise returns FALSE.

◆ CreateColorPicker()

virtual ColorPicker * CreateColorPicker ( HWND hwndOwner,
const AColor & initColor,
ColorPicker::Flags flags,
IPoint2 * pPos,
ColorPickerCallback * callback,
const MCHAR * name,
ColorContext context = ColorContext::COLOR_SPACE_CONTEXT_NONE,
BOOL objClr = FALSE )
pure virtual

Creates and shows the modeless color picker dialog.

This picker remains open allowing interactive color updates through the supplied callback until it is closed by the user or programmatically via ColorPicker::Destroy(). Unlike ModalColorPicker(), this call returns immediately with a pointer to the live ColorPicker instance. The returned object is owned by the system. When the picker is closed ColorPickerCallback::BeingDestroyed() is invoked and any stored pointer to it must be cleared.

Parameters
[in]hwndOwnerOwner (parent) window handle.
[in]initColorValue of this parameter will be used as the initial color, which also becomes the reset color in the UI.
[in]flagsColorPicker::Flags values controlling the look and behavior of the color picker (e.g. alpha enabled/disabled)
[in,out]pPosPointer to the starting position of the upper left corner of the dialog window. This is set to the ending position when the user is done. If null, color picker will be displayed in the current mouse position.
[in]callbackCallback object whose functions are called when user interacts with the color picker. See Class ColorPickerCallback.
[in]nameThe name of color being edited to appear in the title bar.
[in]contextThe color context to be used by the color picker. see ColorContext for details.
[in]objClrif TRUE, object color picker variant is created with "Add %Color" button.
Returns
Pointer to the modeless ColorPicker. May become dangling after ColorPickerCallback::BeingDestroyed() is called; do not delete it.

◆ ClassName()

virtual const MCHAR * ClassName ( )
pure virtual

Returns the name of the class.

This name appears in the drop down list of color picker choices.

◆ ClassID()

virtual Class_ID ClassID ( )
pure virtual

Returns the unique ClassID of this plug-in.

◆ DeleteThis()

virtual void DeleteThis ( )
pure virtual

This method is called to delete this instance of the plug-in class.

◆ Execute()

virtual INT_PTR Execute ( int cmd,
ULONG_PTR arg1 = 0,
ULONG_PTR arg2 = 0,
ULONG_PTR arg3 = 0 )
pure virtual

This method is used for future expansion and is currently not used.