Rhino C++ API  8.6
Public Member Functions | Protected Member Functions | List of all members
IRhRdkColorPicker Class Referenceabstract

#include <IRhRdkColorPicker.h>

Public Member Functions

virtual void DeleteThis (void)=0
 
virtual void * EVF (const wchar_t *, void *)=0
 
virtual bool GetCustomNamedColors (ON_ClassArray< CRhinoNamedColor > &aColorOut) const =0
 
virtual bool MenuString (ON_wString &sOut) const =0
 
virtual void NormalizeColor (CRhRdkColor &colInOut) const =0
 
virtual void SetButtonColor (const CRhRdkColor &col) const =0
 
virtual bool ShowPicker (CRhRdkColor &colInOut, HWND pParent)=0
 
virtual RDK_DEPRECATED bool ShowPicker (CRhRdkColor &colInOut, HWND pParent, class CRhRdkColorButton *pButton)
 

Protected Member Functions

virtual ~IRhRdkColorPicker ()
 

Detailed Description

This interface allows you to provide a customized color picker to use with CRhRdkColorButton. The implementation of this interface is not the picker window itself, but it instead creates and manages the picker window.

STARTING WITH RHINO 8, THIS CONTROL IS DEPRECATED AND DOES NOT WORK. See [DEPCTL]

Constructor & Destructor Documentation

◆ ~IRhRdkColorPicker()

virtual IRhRdkColorPicker::~IRhRdkColorPicker ( )
inlineprotectedvirtual

Member Function Documentation

◆ DeleteThis()

virtual void IRhRdkColorPicker::DeleteThis ( void  )
pure virtual

You must implement this method as

delete this;

◆ EVF()

virtual void* IRhRdkColorPicker::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Emergency virtual function for future expansion.

◆ GetCustomNamedColors()

virtual bool IRhRdkColorPicker::GetCustomNamedColors ( ON_ClassArray< CRhinoNamedColor > &  aColorOut) const
pure virtual

Implement this method to return an array of custom named colors to be displayed on the left side of the color picker instead of the defaults.

Parameters
aColorOutaccepts the custom colors if you plan to return true.
Returns
true to use your custom colors, false if you don't want to use custom colors.

◆ MenuString()

virtual bool IRhRdkColorPicker::MenuString ( ON_wString sOut) const
pure virtual

Optionally implement this method to return the menu string describing the picker and return true. If you just want the default text "Color Picker..." you can simply return false.

◆ NormalizeColor()

virtual void IRhRdkColorPicker::NormalizeColor ( CRhRdkColor colInOut) const
pure virtual

Called when a color is about to be applied to a color button. The implementation of this method typically does nothing, but you may wish to implement special behaviour to modify the color. For example, a grayscale picker would convert the color to grayscale.

◆ SetButtonColor()

virtual void IRhRdkColorPicker::SetButtonColor ( const CRhRdkColor col) const
pure virtual

Called when the user picks a color. This can happen once when the color picker is dismissed or it can be called many times as the user plays with the color picker, depending on how the color picker is implemented.

◆ ShowPicker() [1/2]

virtual bool IRhRdkColorPicker::ShowPicker ( CRhRdkColor colInOut,
HWND  pParent 
)
pure virtual

Display the color picker user interface.

Parameters
colInOutcontains the initial color value and accepts the user's new color choice.
pParentis the parent window of the picker. This should not be the color button itself.
Note
To update the color button during picking, you should call RhRdkGetActiveColorButton(), check for null, and update the returned button if not null. This replaces the color button pointer in the deprecated version because there is a danger that the button can be deleted during the time the picker is displayed.
Returns
true if a new color was chosen, else false.

◆ ShowPicker() [2/2]

virtual RDK_DEPRECATED bool IRhRdkColorPicker::ShowPicker ( CRhRdkColor colInOut,
HWND  pParent,
class CRhRdkColorButton *  pButton 
)
virtual

This method is deprecated in favor of the one below.