Public Member Functions | Protected Member Functions

ColorPicker Class Reference

Search for all occurrences

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".

#include <hsv.h>

Inheritance diagram for ColorPicker:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  ColorPicker ()
virtual void  ModifyColor (DWORD color)=0
virtual void  SetNewColor (DWORD color, MCHAR *name)=0
virtual DWORD  GetColor ()=0
virtual IPoint2  GetPosition ()=0
virtual void  Destroy ()=0
virtual void  InstallNewCB (DWORD col, HSVCallback *pcb, MCHAR *name)=0
virtual void  RefreshUI ()
virtual void  ModifyColor (AColor color)
virtual void  SetNewColor (AColor, MCHAR *name)
virtual AColor  GetAColor ()
virtual void  InstallNewCB (AColor col, HSVCallback *pcb, MCHAR *name)
virtual CoreExport RECT  GetRect () const
virtual CoreExport bool  IsColorSamplerMode () const
  Is this picker in color sampling (eyedropper) mode.

Protected Member Functions

  ~ColorPicker ()

Constructor & Destructor Documentation

~ColorPicker ( ) [inline, protected]
Remarks:
Destructor.
{}
ColorPicker ( ) [inline]
Remarks:
Constructor.
{}

Member Function Documentation

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.
virtual void SetNewColor ( DWORD  color,
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.
virtual DWORD GetColor ( ) [pure virtual]
Remarks:
Returns the current color.
virtual IPoint2 GetPosition ( ) [pure virtual]
Remarks:
Returns the screen position of the upper left corner of the dialog as a IPoint2.
virtual void Destroy ( ) [pure virtual]
Remarks:
This is called when the parent is going away.
virtual void InstallNewCB ( DWORD  col,
HSVCallback pcb,
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.
virtual void RefreshUI ( ) [inline, virtual]
Remarks:
This method is available in release 4.0 and later only.

This method is called when the display gamma changes.
{}  // Called when display gamma changes
virtual void ModifyColor ( AColor  color ) [inline, virtual]
Remarks:
This method changes the current color in the color picker, but does not change the "reset" color.
Parameters:
AColor color

The current color.
{}
virtual void SetNewColor ( AColor  ,
MCHAR *  name 
) [inline, virtual]
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.
{}
virtual AColor GetAColor ( ) [inline, virtual]
Remarks:
Returns the current color as an Acolor from the color picker. Default implementation returns AColor(0,0,0,0).
{return AColor(0,0,0,0);}
virtual void InstallNewCB ( AColor  col,
HSVCallback pcb,
MCHAR *  name 
) [inline, virtual]
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.
{}
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).
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.

ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker
ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker ColorPicker