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