Crazy Eddie's GUI System 0.8.7
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
42namespace CEGUI
43{
44
46class CEGUI_COMMONDIALOGS_API ColourPicker : public Window
47{
48public:
50 ColourPicker(const String& type, const String& name);
53
55 static const String EventNamespace;
57 static const String WidgetTypeName;
58
59 // generated internally by Window
65 // generated internally by Window
71
72 // generated internally by Window
78
87 void setColour(const Colour& newColour);
88
94
95 // overridden from Window base class
97 void destroy(void);
98
99protected:
101 static const String ColourRectName;
102
111
112
122 void createColourPickerControlsWindow(const String& colourPickerControlsStyle);
123
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
Base class for the ColourPickerControls widget.
Definition: Controls.h:48
Base class for the ColourPicker widget.
Definition: ColourPicker.h:47
static const String WidgetTypeName
Window factory name.
Definition: ColourPicker.h:57
static const String ColourRectName
Widget name for the open button (colour rect) component.
Definition: ColourPicker.h:101
~ColourPicker(void)
Destructor for ColourPicker class.
static const String EventOpenedPicker
Definition: ColourPicker.h:64
static const String EventAcceptedColour
Definition: ColourPicker.h:77
static const String EventClosedPicker
Definition: ColourPicker.h:70
void initialiseComponents(void)
Initialises the Window based object ready for use.
ColourPicker(const String &type, const String &name)
Constructor for ColourPicker class.
void createColourPickerControlsWindow(const String &colourPickerControlsStyle)
Creates the ColourPickerControls window.
void destroy(void)
Internal destroy method which actually just adds the window and any parent destructed child windows t...
void initialiseColourPickerControlsWindow()
Initialises the properties for the creation of the ColourPickerControls window and decides if a new w...
Window * getColourRect(void)
Return a Window pointer to the ColourRect component widget for this ColourPicker.
void setColour(const Colour &newColour)
Set the current colour of the colour picker manually and refresh the ColourPicker elements accordingl...
Colour d_selectedColour
selected colour of the ColourPickerControls
Definition: ColourPicker.h:147
static const String EventNamespace
Namespace for global events.
Definition: ColourPicker.h:55
Colour getColour()
Return the current colour of the colour picker.
Class representing colour values within the system.
Definition: Colour.h:46
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
String class used within the GUI system.
Definition: String.h:64
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1