Crazy Eddie's GUI System  0.8.4
ColourPicker.h
00001 /***********************************************************************
00002     created:    30/10/2010
00003     author:     Lukas E Meindl
00004 
00005     purpose:    Interface to base class for ColourPicker Widget
00006 *************************************************************************/
00007 /***************************************************************************
00008 *   Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
00009 *
00010 *   Permission is hereby granted, free of charge, to any person obtaining
00011 *   a copy of this software and associated documentation files (the
00012 *   "Software"), to deal in the Software without restriction, including
00013 *   without limitation the rights to use, copy, modify, merge, publish,
00014 *   distribute, sublicense, and/or sell copies of the Software, and to
00015 *   permit persons to whom the Software is furnished to do so, subject to
00016 *   the following conditions:
00017 *
00018 *   The above copyright notice and this permission notice shall be
00019 *   included in all copies or substantial portions of the Software.
00020 *
00021 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00022 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00023 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00024 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00025 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00026 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00027 *   OTHER DEALINGS IN THE SOFTWARE.
00028 ***************************************************************************/
00029 #ifndef _CEGUIColourPicker_h_
00030 #define _CEGUIColourPicker_h_
00031 
00032 #include "CEGUI/CommonDialogs/Module.h"
00033 #include "CEGUI/CommonDialogs/ColourPicker/Controls.h"
00034 #include "CEGUI/Window.h"
00035 
00036 #if defined(_MSC_VER)
00037 #   pragma warning(push)
00038 #   pragma warning(disable : 4251)
00039 #endif
00040 
00041 // Start of CEGUI namespace section
00042 namespace CEGUI
00043 {
00044 
00046 class CEGUI_COMMONDIALOGS_API ColourPicker : public Window
00047 {
00048 public:
00050     ColourPicker(const String& type, const String& name);
00052     ~ColourPicker(void);
00053 
00055     static const String EventNamespace;
00057     static const String WidgetTypeName;
00058 
00059     // generated internally by Window
00064     static const String EventOpenedPicker;
00065     // generated internally by Window
00070     static const String EventClosedPicker;
00071 
00072     // generated internally by Window
00077     static const String EventAcceptedColour;
00078 
00087     void setColour(const Colour& newColour);
00088 
00093     Colour getColour();
00094 
00095     // overridden from Window base class
00096     void initialiseComponents(void);
00097 
00098 protected:
00100     static const String ColourRectName;
00101 
00109     void initialiseColourPickerControlsWindow();
00110 
00111 
00121     void createColourPickerControlsWindow(const String& colourPickerControlsStyle);
00122 
00134     Window* getColourRect(void);
00135 
00136     bool colourRect_ColourRectClickedHandler(const EventArgs& e);
00137     virtual void onColourRectClicked(WindowEventArgs& e);
00138 
00139     static std::map<Window*, int> s_colourPickerWindows;
00140 
00141     bool d_shareColourPickerControlsWindow;
00142 
00143     ColourPickerControls* d_colourPickerControlsWindow;
00144 
00146     Colour d_selectedColour;
00147 };
00148 
00149 }
00150 
00151 #if defined(_MSC_VER)
00152 #   pragma warning(pop)
00153 #endif
00154 
00155 #endif
00156 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends