3ds Max C++ API Reference
ColorPicker Class Referenceabstract

#include <hsv.h>

+ Inheritance diagram for ColorPicker:

Public Member Functions

 ColorPicker ()
 
virtual void ModifyColor (DWORD color)=0
 
virtual void SetNewColor (DWORD color, const MCHAR *name)=0
 
virtual DWORD GetColor ()=0
 
virtual IPoint2 GetPosition ()=0
 
virtual void Destroy ()=0
 
virtual void InstallNewCB (DWORD col, HSVCallback *pcb, const MCHAR *name)=0
 
virtual void RefreshUI ()
 
virtual void ModifyColor (AColor color)
 
virtual void SetNewColor (AColor, const MCHAR *name)
 
virtual AColor GetAColor ()
 
virtual void InstallNewCB (AColor col, HSVCallback *pcb, const MCHAR *name)
 
virtual CoreExport RECT GetRect () const
 
virtual CoreExport bool IsColorSamplerMode () const
 Is this picker in color sampling (eyedropper) mode. More...
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Protected Member Functions

 ~ColorPicker ()
 

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 HSVCallback, COLORREF - DWORD, Class IPoint2.

Description:
This class allows a plug-in to create a modeless color picker dialog box.

Developers may also create a modal version of this dialog box. The function HSVDlg_Do is defined for this purpose. Note that this is not a class method but a global function.

To use these APIs you need to #include "hsv.h".

Constructor & Destructor Documentation

◆ ~ColorPicker()

~ColorPicker ( )
inlineprotected
Remarks
Destructor.
183 {}

◆ ColorPicker()

ColorPicker ( )
inline
Remarks
Constructor.
186 {}

Member Function Documentation

◆ ModifyColor() [1/2]

virtual void ModifyColor ( DWORD  color)
pure virtual
Remarks
This method changes the current color in the color picker, but does not change the "reset" color.
Parameters:
DWORD color

The current color.

◆ SetNewColor() [1/2]

virtual void SetNewColor ( DWORD  color,
const MCHAR name 
)
pure virtual
Remarks
Sets a new color as current in the dialog.
Parameters:
DWORD color

The color to set.

MCHAR *name

A new name to display in the title bar.

◆ GetColor()

virtual DWORD GetColor ( )
pure virtual
Remarks
Returns the current color.

◆ GetPosition()

virtual IPoint2 GetPosition ( )
pure virtual
Remarks
Returns the screen position of the upper left corner of the dialog as a IPoint2.

◆ Destroy()

virtual void Destroy ( )
pure virtual
Remarks
This is called when the parent is going away.

◆ InstallNewCB() [1/2]

virtual void InstallNewCB ( DWORD  col,
HSVCallback pcb,
const MCHAR name 
)
pure virtual
Remarks
This method is used to add a different callback, set a new initial color and update the title string.
Parameters:
DWORD col

The new initial color.

HSVCallback *pcb

The new callback.

MCHAR *name

The new title string.

◆ RefreshUI()

virtual void RefreshUI ( )
inlinevirtual
Remarks
This method is available in release 4.0 and later only.

This method is called when the display gamma changes.
222 {} // Called when display gamma changes

◆ ModifyColor() [2/2]

virtual void ModifyColor ( AColor  color)
inlinevirtual
Remarks
This method changes the current color in the color picker, but does not change the "reset" color.
Parameters:
AColor color

The current color.
231 {}

◆ SetNewColor() [2/2]

virtual void SetNewColor ( AColor  ,
const MCHAR name 
)
inlinevirtual
Remarks
Sets a new color as current in the dialog.
Parameters:
AColor color

The color to set.

MCHAR *name

A new name to display in the title bar.
239 {}

◆ GetAColor()

virtual AColor GetAColor ( )
inlinevirtual
Remarks
Returns the current color as an Acolor from the color picker. Default implementation returns AColor(0,0,0,0).
244 {return AColor(0,0,0,0);}
Definition: acolor.h:32

◆ InstallNewCB() [2/2]

virtual void InstallNewCB ( AColor  col,
HSVCallback pcb,
const MCHAR name 
)
inlinevirtual
Remarks
This method is used to add a different callback, set a new initial color and update the title string.
Parameters:
Acolor col

The new initial color.

HSVCallback *pcb

The new callback.

MCHAR *name

The new title string.
255 {}

◆ GetRect()

virtual CoreExport RECT GetRect ( ) const
virtual
Remarks
Call this function to get the rectangle of current dialog of color picker.
Returns
Default implementation returns RECT(0,0,0,0).

◆ IsColorSamplerMode()

virtual CoreExport bool IsColorSamplerMode ( ) const
virtual

Is this picker in color sampling (eyedropper) mode.

Default implementation returns false.

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