Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ColourPicker.h
1 /***********************************************************************
2  created: 30/10/2010
3  author: Lukas E Meindl
4 
5  purpose: Interface to base class for ColourPicker Widget
6 *************************************************************************/
7 /***************************************************************************
8 * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining
11 * a copy of this software and associated documentation files (the
12 * "Software"), to deal in the Software without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sublicense, and/or sell copies of the Software, and to
15 * permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
28 ***************************************************************************/
29 #ifndef _CEGUIColourPicker_h_
30 #define _CEGUIColourPicker_h_
31 
32 #include "CEGUI/CommonDialogs/Module.h"
33 #include "CEGUI/CommonDialogs/ColourPicker/Controls.h"
34 #include "CEGUI/Window.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // Start of CEGUI namespace section
42 namespace CEGUI
43 {
44 
46 class CEGUI_COMMONDIALOGS_API ColourPicker : public Window
47 {
48 public:
50  ColourPicker(const String& type, const String& name);
52  ~ColourPicker(void);
53 
55  static const String EventNamespace;
57  static const String WidgetTypeName;
58 
59  // generated internally by Window
64  static const String EventOpenedPicker;
65  // generated internally by Window
70  static const String EventClosedPicker;
71 
72  // generated internally by Window
78 
87  void setColour(const Colour& newColour);
88 
93  Colour getColour();
94 
95  // overridden from Window base class
96  void initialiseComponents(void);
97 
98 protected:
100  static const String ColourRectName;
101 
109  void initialiseColourPickerControlsWindow();
110 
111 
121  void createColourPickerControlsWindow(const String& colourPickerControlsStyle);
122 
134  Window* getColourRect(void);
135 
136  bool colourRect_ColourRectClickedHandler(const EventArgs& e);
137  virtual void onColourRectClicked(WindowEventArgs& e);
138 
139  static std::map<Window*, int> s_colourPickerWindows;
140 
141  bool d_shareColourPickerControlsWindow;
142 
143  ColourPickerControls* d_colourPickerControlsWindow;
144 
147 };
148 
149 }
150 
151 #if defined(_MSC_VER)
152 # pragma warning(pop)
153 #endif
154 
155 #endif
156