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

This class represents a modeless color picker and lets developers interact with it during its lifetime. More...

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

Inheritance diagram for ColorPicker:

Public Types

enum  Flags : uint32_t { EnableAlpha = 0 , DisableAlpha = 1 }

Public Member Functions

 ColorPicker ()
 Constructor.
virtual void Destroy ()=0
 This function will remove the color picker window and destroy the object.
virtual void RefreshUI ()=0
 This method is called when the display should update, for example when the color management settings change.
virtual void ModifyColor (const AColor &color, Flags flags)=0
 This method changes the current color in the color picker, but does not change the "reset" color.
virtual void SetNewColor (const AColor &color, Flags flags)=0
 This method changes the reset color and the current color in the color picker.
virtual void SetNewColor (const AColor &color, Flags flags, const MCHAR *name, ColorContext context=ColorContext::COLOR_SPACE_CONTEXT_NONE)=0
 This method is used to switch to a new color target with a new initial color, name and color context.
virtual void SetName (const MCHAR *name)=0
 This method changes name of the color which is displayed in the title bar.
virtual IPoint2 GetPosition () const =0
 Returns the screen position of the upper left corner of the dialog.
virtual RECT GetRect () const =0
 Returns the window rectangle of the dialog in screen coordinates.
virtual bool InColorSamplerMode () const =0
 Is this picker in color sampling (eyedropper) mode.
Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
template<class InterfaceType>
InterfaceType * GetTypedInterface ()

Protected Member Functions

virtual ~ColorPicker ()
 Hidden destructor to avoid accidental deletion.

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 class represents a modeless color picker and lets developers interact with it during its lifetime.

You can call CreateColorPicker() function to create a modeless color picker and you must pass a ColorPickerCallback object to receive notifications from it. Once the ColorPickerCallback::BeingDestroyed() function is called on the passed callback object, this color picker should be considered destroyed and any pointer to it should be set to null.

\ see Class ColorPickerCallback, CreateColorPicker

Member Enumeration Documentation

◆ Flags

enum Flags : uint32_t
Enumerator
EnableAlpha 

no flags means RGBA.

DisableAlpha 

disable alpha channel in the UI.

94 {
95 EnableAlpha = 0,
96 DisableAlpha = 1
97 };
@ DisableAlpha
disable alpha channel in the UI.
Definition ColorPicker.h:96
@ EnableAlpha
no flags means RGBA.
Definition ColorPicker.h:95

Constructor & Destructor Documentation

◆ ColorPicker()

ColorPicker ( )
inline

Constructor.

100{;}

◆ ~ColorPicker()

virtual ~ColorPicker ( )
inlineprotectedvirtual

Hidden destructor to avoid accidental deletion.

Use the Destroy() method instead.

183{;}

Member Function Documentation

◆ Destroy()

virtual void Destroy ( )
pure virtual

This function will remove the color picker window and destroy the object.

◆ RefreshUI()

virtual void RefreshUI ( )
pure virtual

This method is called when the display should update, for example when the color management settings change.

◆ ModifyColor()

virtual void ModifyColor ( const AColor & color,
Flags flags )
pure virtual

This method changes the current color in the color picker, but does not change the "reset" color.

Use SetNewColor to change both colors.

Parameters
[in]colorThe new current color.
[in]flagsColorPicker::Flags values controlling the look and behavior of the color picker (e.g. alpha enabled/disabled)

◆ SetNewColor() [1/2]

virtual void SetNewColor ( const AColor & color,
Flags flags )
pure virtual

This method changes the reset color and the current color in the color picker.

To change only the current color without changing the reset color use ModifyColor() function.

Parameters
[in]colorThe color to be used for both the reset and current color slots.
[in]flagsColorPicker::Flags values controlling the look and behavior of the color picker (e.g. alpha enabled/disabled)

◆ SetNewColor() [2/2]

virtual void SetNewColor ( const AColor & color,
Flags flags,
const MCHAR * name,
ColorContext context = ColorContext::COLOR_SPACE_CONTEXT_NONE )
pure virtual

This method is used to switch to a new color target with a new initial color, name and color context.

This method lets you reuse the same color picker for a different color target without having to destroy and re-create a new one.

Parameters
[in]colorThe new initial color.
[in]flagsColorPicker::Flags values controlling the look and behavior of the color picker (e.g. alpha enabled/disabled)
[in]nameThe new title string.
[in]contextThe new color context.
See also
ColorContext

◆ SetName()

virtual void SetName ( const MCHAR * name)
pure virtual

This method changes name of the color which is displayed in the title bar.

Parameters
[in]nameThe new name to be displayed in the title bar.

◆ GetPosition()

virtual IPoint2 GetPosition ( ) const
pure virtual

Returns the screen position of the upper left corner of the dialog.

Returns
The screen position of the upper left corner of the dialog.
See also
GetRect

◆ GetRect()

virtual RECT GetRect ( ) const
pure virtual

Returns the window rectangle of the dialog in screen coordinates.

Returns
The window rectangle of the dialog in screen coordinates.
See also
GetPosition

◆ InColorSamplerMode()

virtual bool InColorSamplerMode ( ) const
pure virtual

Is this picker in color sampling (eyedropper) mode.

Returns
true if this picker is in sampling mode, false otherwise.