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
 
enum  CURSORTYPE
 

Public Member Functions

 CBCGPColorPickerCtrlConstructs a CBCGPColorPickerCtrl object.
 
 AreLinesToCenterTells whether to draw the lines from the color's cursor to the picker center (PICKER_WHEEL exclusively).
 
 EnableLinesToCenterSpecifies whether to draw the lines from the color's cursor to the picker center (PICKER_WHEEL exclusively).
 
 GetBaseColorIndexRetrieves an index of the "base" color.
 
 GetColorReturns the selected color
 
 GetHLSRetrieves the hue, luminance and saturation values of the selected color
 
 GetHorizontalAlignmentRetrieves a picker horizontal alignment.
 
 GetHueRetrieves the hue component of the selected color
 
 GetHueDirectionRetrieved a color wheel hue direction.
 
 GetInternalPaddingRetrieves a color wheel internal padding
 
 GetLuminanceRetrieves the luminance component of the selected color
 
 GetRGBReturns the selected color
 
 GetSaturationRetrieves the saturation component of the selected color
 
 GetSelectedColorIndexRetrieves the selected color index (PICKER_WHEEL only).
 
 GetStartAngleRetrieved a color wheel start angle.
 
 GetVerticalAlignmentRetrieves a picker vertical alignment.
 
 IsSyncLuminosityWithSelectedColorTells whether the color wheel luminosity will be the same as the luminosity of the selected color (PICKER_WHEEL exclusively).
 
 SelectCellHexagonGiven the RGB values selects a new color
 
 SetColorForces the current selection to the specified RGB color
 
 SetColorsSpecifies array of RGB values (PICKER_WHEEL only).
 
 SetColorsHLSSpecifies array of HLS values (PICKER_WHEEL only).
 
 SetHLSForces the current selection to the specified HLS values
 
 SetHorizontalAlignmentSpecifies a picker horizontal alignment (PICKER_WHEEL type only).
 
 SetHueChanges the hue component of the selected color
 
 SetInternalPaddingSpecifies a color wheel internal padding
 
 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
 
 SetSelectedColorIndexSpecifies the selected color index (PICKER_WHEEL only).
 
 SetStartAngleSets a color wheel start angle (PICKER_WHEEL type only).
 
 SetSyncLuminosityWithSelectedColorSpecifies whether the color wheel luminosity will be the same as the luminosity of the selected color (PICKER_WHEEL exclusively).
 
 SetTypeSets the color picker control type
 
 SetVerticalAlignmentSpecifies a picker vertical alignment (PICKER_WHEEL type only).
 

Public Attributes

 m_bUseSystemPaletteByDefaultSpecifies whether a control uses a default (system) palette.
 
 m_bVisualManagerStyleSpecifies whether a control has a Visual Manager style look.
 

Static Public Attributes

 m_bDefaultWheelHueDirectionThis parameter sets the hue's default direction for all color wheel controls (PICKER_WHEEL type only).
 
 m_dblDefaultWheelStartAngleThis parameter specifies a default start angle that is used in all color wheel controls (in degrees, 0-360, PICKER_WHEEL type only).
 

Protected Member Functions

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