Detailed Description
- See also:
- Class ICustomControl, Custom Controls, COLORREF.
- Description:
- The color swatch control puts up the standard 3ds Max modeless
color selector when the control is clicked on. The plug-in may be
notified as the user interactively selects new colors.
To initialize the pointer to the control call:
*GetIColorSwatch(HWND hCtrl, COLORREF col, MCHAR
*name);
For example: custCSw = GetIColorSwatch(GetDlgItem(hDlg,
IDC_CSWATCH), RGB(255,255,255), _M("New Wireframe
Color"));
This returns the pointer to the control, sets the initial color
selected, and displays the text string passed in the title bar of
the selection dialog.
To release the control call: ReleaseIColorSwatch(IColowSwatch
ics);
The value to use in the Class field of the Custom Control Properties dialog is:
ColorSwatch This message is sent as the color is being
adjusted in the ColorPicker.
CC_COLOR_CHANGE
lParam = pointer to ColorSwatchControl
LOWORD(wParam) contains the ID of the control. This is the
named established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) contains 1 if button UP, or 0 if mouse
drag.
This message is sent if the color has been clicked on, before
bringing up the color picker.
CC_COLOR_SEL
lParam contains a pointer to the ColorSwatch Control.
LOWORD(wParam) contains the ID of the control. This is the
named established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) contains 0.
This message is sent if another color swatch has been dragged and
dropped on this swatch.
CC_COLOR_DROP
lParam contains a pointer to the ColorSwatch Control.
LOWORD(wParam) contains the ID of the control. This is the
named established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) contains 0.
This message is sent when the color picker is closed.
CC_COLOR_CLOSE
lParam contains a pointer to the ColorSwatch Control.
LOWORD(wParam) contains the ID of the control. This is the
named established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) contains 0.
#include <custcont.h>
List of all
members.
Member Function Documentation
virtual COLORREF SetColor |
( |
COLORREF |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[pure virtual] |
- Parameters:
- COLORREF c
You can pass specific RGB values in using the RGB macro. For
example, to pass in pure blue you would use
RGB(0,0,255).
int notify=FALSE
If you pass TRUE for this parameter, the dialog proc for the dialog
will receive the CC_COLOR_CHANGE message each time the color
is changed.
- Returns:
- This method returns the old color.
COLORREF SetColor |
( |
Color |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[inline] |
virtual AColor SetAColor |
( |
AColor |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[pure virtual] |
virtual COLORREF InitColor |
( |
COLORREF |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[pure virtual] |
COLORREF InitColor |
( |
Color |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[inline] |
virtual AColor InitAColor |
( |
AColor |
c, |
|
|
int |
notify =
FALSE |
|
) |
|
[pure virtual] |
virtual void SetUseAlpha |
( |
BOOL |
onOff |
) |
[pure virtual] |
virtual BOOL GetUseAlpha |
( |
|
) |
[pure virtual] |
virtual COLORREF GetColor |
( |
|
) |
[pure virtual] |
- Returns:
- The COLORREF structure returned may be broken down into
individual RGB values by using the GetRValue(color),
GetGValue(color), and GetBValue(color) macros.
virtual AColor GetAColor |
( |
|
) |
[pure virtual] |
virtual void ForceDitherMode |
( |
BOOL |
onOff |
) |
[pure virtual] |
- Parameters:
- BOOL onOff
TRUE to force the color to be dithered; otherwise FALSE.
virtual void SetModal |
( |
|
) |
[pure virtual] |
virtual void Activate |
( |
int |
onOff |
) |
[pure virtual] |
- Parameters:
- int onOff
If TRUE the color swatch is in an active dialog. If FALSE the
control is in an inactive dialog.
virtual void EditThis |
( |
BOOL |
startNew = TRUE |
) |
[pure virtual] |
- Parameters:
- BOOL startNew=TRUE
If there was no color picker up, if this parameter is set to TRUE,
then a color picker is created. If this parameter is set to FALSE,
and there was no color picker up, then nothing happens.
virtual void SetKeyBrackets |
( |
BOOL |
onOff |
) |
[pure virtual] |
virtual void SetNotifyAfterAccept |
( |
BOOL |
onOff |
) |
[pure virtual] |
- Parameters:
- BOOL onOff
If you pass FALSE for this parameter, the dialog proc for the
dialog will receive multiple CC_COLOR_CHANGE messages as the
user makes changes interactively in the color picker. If you pass
TRUE for this parameter, the dialog proc for the dialog will
receive only one CC_COLOR_CHANGE message, when the color
picker is closed, and only if the user clicks OK instead of
Cancel.
virtual BOOL GetNotifyAfterAccept |
( |
|
) |
[pure virtual] |
- Returns:
- FALSE indicates the dialog proc for the dialog receives
multiple CC_COLOR_CHANGE messages as the user makes changes
interactively in the color picker. TRUE indicates the dialog proc
for the dialog receives only one CC_COLOR_CHANGE message,
when the color picker is closed, and only if the user clicks OK
instead of Cancel.
IColorSwatch IColorSwatch IColorSwatch
IColorSwatch IColorSwatch IColorSwatch IColorSwatch IColorSwatch
IColorSwatch IColorSwatch
IColorSwatch IColorSwatch IColorSwatch
IColorSwatch IColorSwatch IColorSwatch IColorSwatch IColorSwatch
IColorSwatch IColorSwatch