BCGControlBar Pro for MFC
CBCGPColorPickerCtrl

Detailed Description

The CBCGPColorPickerCtrl class implementation will help you to change the look & feel of the standard color-selection dialog. A CBCGPColorPickerCtrl object is a control with a list of colors in the hexagon form or luminance bar. The user can select a particular color from the list or luminance bar, which is then reported back to the application. The following is the picture of several CBCGPColorPickerCtrl objects:

The CBCGPColorPickerCtrl supports four styles:

  • HEX and HEX_GREYSCALE - are suitable for the "standard" color selection.
  • PICKER and LUMINANCE - are good for the custom color selection.

To incorporate the CBCGPColorPickerCtrl control into your dialog box template you have to perform the following steps:

  • Insert a new button control (because CBCGPColorPickerCtrl class inherited from the CButton class) into your dialog box template.
  • Insert a new member variable into your dialog box class associated with the new button. If you're using the ClassWizard, you will have to change the variable's type from CButton to CBCGPColorPickerCtrl.
  • Insert the WM_INITDIALOG message handler for the dialog box class. This is the best place to define the actual type of the CBCGPColorPickerCtrl control, set its palette and initially displayed color.

If you want to take advantage of CBCGPColorPickerCtrl controls without addition programming efforts you may want to use CBCGPColorDialog.

See also
CBCGPColorDialog

Inherits CButton.

Public Types

enum  COLORTYPE
 

Public Member Functions

 CBCGPColorPickerCtrlConstructs a CBCGPColorPickerCtrl object.
 
 GetColorReturns the selected color
 
 GetHLSRetrieves the hue, luminance and saturation values of the selected color
 
 GetHueRetrieves the hue component of the selected color
 
 GetLuminanceRetrieves the luminance component of the selected color
 
 GetRGBReturns the selected color
 
 GetSaturationRetrieves the saturation component of the selected color
 
 SelectCellHexagonGiven the RGB values selects a new color
 
 SetColorForces the current selection to the specified RGB color
 
 SetHLSForces the current selection to the specified HLS values
 
 SetHueChanges the hue component of the selected color
 
 SetLuminanceChanges the luminance component of the selected color
 
 SetLuminanceBarWidthSets a new luminance bar width
 
 SetOriginalColorSets the initial selected color. Call this function when a control is initialized.
 
 SetPaletteSets the current color palette
 
 SetRGBSelects a color in a color picker.
 
 SetSaturationChanges the saturation component of the selected color
 
 SetTypeSets the color picker control type
 

Public Attributes

 m_bVisualManagerStyleSpecifies whether a control has a Visual Manager style look.
 

Protected Member Functions

 DrawCursorCalled by the framework when a cursor that points to the selected color should be displayed