2 |
#define PG_COLORSELECTOR_H |
#define PG_COLORSELECTOR_H |
3 |
|
|
4 |
#include "pgthemewidget.h" |
#include "pgthemewidget.h" |
|
#include "pgeventobject.h" |
|
5 |
#include "pgslider.h" |
#include "pgslider.h" |
6 |
|
|
7 |
class DECLSPEC PG_ColorSelector : public PG_ThemeWidget, public PG_EventObject { |
class DECLSPEC PG_ColorSelector : public PG_ThemeWidget { |
8 |
protected: |
protected: |
9 |
|
|
10 |
class PG_ColorBox : public PG_ThemeWidget { |
class PG_ColorBox : public PG_ThemeWidget { |
16 |
return static_cast<PG_ColorSelector*>(PG_ThemeWidget::GetParent()); |
return static_cast<PG_ColorSelector*>(PG_ThemeWidget::GetParent()); |
17 |
} |
} |
18 |
|
|
19 |
SDL_Color GetBaseColor(); |
PG_Color GetBaseColor(); |
20 |
|
|
21 |
protected: |
protected: |
22 |
|
|
37 |
PG_ColorSelector(PG_Widget* parent, const PG_Rect&r, const char* style="colorselector"); |
PG_ColorSelector(PG_Widget* parent, const PG_Rect&r, const char* style="colorselector"); |
38 |
~PG_ColorSelector(); |
~PG_ColorSelector(); |
39 |
|
|
40 |
void SetColor(const SDL_Color& c); |
void SetColor(const PG_Color& c); |
41 |
|
|
42 |
inline void SetColorGradient(PG_Gradient g) { |
inline void SetColorGradient(PG_Gradient g) { |
43 |
my_colorbox->SetGradient(g); |
my_colorbox->SetGradient(g); |
47 |
|
|
48 |
bool handle_colorslide(long data); |
bool handle_colorslide(long data); |
49 |
|
|
50 |
void SetBaseColor(const SDL_Color& c); |
void SetBaseColor(const PG_Color& c); |
51 |
|
|
52 |
PG_ColorBox* my_colorbox; |
PG_ColorBox* my_colorbox; |
53 |
PG_Slider* my_colorslider; |
PG_Slider* my_colorslider; |
54 |
PG_ThemeWidget* my_colorresult; |
PG_ThemeWidget* my_colorresult; |
55 |
|
|
56 |
SDL_Color my_color; |
PG_Color my_color; |
57 |
SDL_Color my_basecolor; |
PG_Color my_basecolor; |
58 |
|
|
59 |
friend class PG_ColorBox; |
friend class PG_ColorBox; |
60 |
}; |
}; |