SCV
4.2.1
Simple Components for Visual
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
ColorPicker.h
Go to the documentation of this file.
1
7
#ifndef __SCV_COLORPICKER_H__
8
#define __SCV_COLORPICKER_H__
9
10
#include "
MatrixTemplate.h
"
11
#include "
ToggleButton.h
"
12
#include "
Panel.h
"
13
#include "
Spinner.h
"
14
15
namespace
scv {
16
17
class
ColorPicker
:
public
scv::Panel
,
public
scv::MatrixTemplate
<ColorRGBA> {
18
public
:
19
ColorPicker
(
const
scv::Point
&p);
20
21
/*callback*/
22
virtual
void
onColorChange
(
void
) {}
23
24
ColorRGBA
getColor
(
void
)
const
;
25
void
setColor
(
const
ColorRGBA
&color);
26
27
void
processMouse
(
const
scv::MouseEvent
&evt);
28
29
virtual
void
display
(
void
);
30
31
protected
:
32
class
EyeDropper
:
public
ToggleButton
{
33
public
:
34
EyeDropper
(
ColorPicker
*picker);
35
void
onMouseUp
(
const
scv::MouseEvent
&evt);
36
private
:
37
ColorPicker
*_picker;
38
};
39
40
void
createTexture
(
void
);
41
42
void
createColors
(
void
);
43
void
refreshColor
(
void
);
44
void
setSpinsColor
(
void
);
45
46
Point
foundHSL
(
void
);
47
48
Point
_currentColorPosition
;
49
bool
_pickerWaitingColor
;
50
51
double
_saturation
;
52
ColorRGBA
_currentColor
,
_currentPickerColor
;
53
54
Spinner
*
_rgbs
[4];
55
EyeDropper
*
_btPicker
;
56
57
ComponentTexture
*
_cpTexture
;
58
};
59
60
}
// namespace scv
61
62
63
#endif // __SCV_COLORPICKER_H__
include
SCV
ColorPicker.h
Generated on Fri Dec 14 2012 09:44:48 for SCV by
1.8.2