MQColorPanel class

(new in Rev4.00)

MQColorPanel class manages a color panel to select a color. It inherits a MQWidgetBase class.

Please refer the inherited class about member functions declared in the inherited class.

Class
MQColorPanel Constructor
~MQColorPanel Destructor
Member functions
GetColor Get a RGB color
SetColor Set a RGB color
GetHSV Get a HSV color
SetHSV Set a HSV color
Events
AddChangedEvent Add an event after finishing to change a value
AddChangingEvent Add an event while changing a value

MQColorPanel::MQColorPanel();

MQColorPanel::MQColorPanel(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQColorPanel::~MQColorPanel();

This method is a destructor. It is defined as a virtual function.


void MQColorPanel::GetColor(int& r, int& g, int& b);

r
Red (0-255)
g
Green (0-255)
b
Blue (0-255)

It returns a color.


void MQColorPanel::SetColor(int r, int g, int b);

r
Red (from 0 to 255)
g
Green (from 0 to 255)
b
Blue (from 0 to 255)

It specifies a color.


void MQColorPanel::GetHSV(double& h, double& s, double& v);

h
Hue (from 0 to 360)
s
Saturation (from 0 to 1)
v
Value (from 0 to 1)

It returns a color by HSV.


void MQColorPanel::SetHSV(double h, double s, double v);

h
Hue (from 0 to 360)
s
Saturation (from 0 to 1)
v
Value (from 0 to 1)

It specifies a color by HSV.


template<typename T> void MQColorPanel::AddChangedEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

It adds events notified when a color has been changed by user's operation.

An event by AddChangingEvent() is invoked while dragging, and an event by AddChangedEvent() is invoked when a mouse button is released.


template<typename T> void MQColorPanel::AddChangingEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

It adds events notified when a color is changing by user's operation.

An event by AddChangingEvent() is invoked while dragging, and an event by AddChangedEvent() is invoked when a mouse button is released.