1 // Copyright (C) 2002-2012 Nikolaus Gebhardt 2 // This file is part of the "Irrlicht Engine". 3 // For conditions of distribution and use, see copyright notice in irrlicht.h 4 5 #ifndef __C_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__ 6 #define __C_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__ 7 8 #include "IrrCompileConfig.h" 9 #ifdef _IRR_COMPILE_WITH_GUI_ 10 11 #include "IGUIColorSelectDialog.h" 12 #include "IGUIButton.h" 13 #include "IGUISpinBox.h" 14 #include "IGUIImage.h" 15 #include "irrArray.h" 16 17 18 namespace irr 19 { 20 namespace gui 21 { 22 23 class CGUIColorSelectDialog : public IGUIColorSelectDialog 24 { 25 public: 26 27 //! constructor 28 CGUIColorSelectDialog(const wchar_t* title, IGUIEnvironment* environment, IGUIElement* parent, s32 id); 29 30 //! destructor 31 virtual ~CGUIColorSelectDialog(); 32 33 //! called if an event happened. 34 virtual bool OnEvent(const SEvent& event); 35 36 //! draws the element and its children 37 virtual void draw(); 38 39 virtual video::SColor getColor(); 40 virtual video::SColorHSL getColorHSL(); 41 42 private: 43 44 //! sends the event that the file has been selected. 45 void sendSelectedEvent(); 46 47 //! sends the event that the file choose process has been canceld 48 void sendCancelEvent(); 49 50 core::position2d<s32> DragStart; 51 bool Dragging; 52 IGUIButton* CloseButton; 53 IGUIButton* OKButton; 54 IGUIButton* CancelButton; 55 56 core::array<IGUISpinBox*> Battery; 57 58 struct SColorCircle 59 { 60 IGUIImage * Control; 61 video::ITexture * Texture; 62 }; 63 SColorCircle ColorRing; 64 65 void buildColorRing( const core::dimension2d<u32> & dim, s32 supersample, const video::SColor& borderColor ); 66 }; 67 68 69 } // end namespace gui 70 } // end namespace irr 71 72 #endif // _IRR_COMPILE_WITH_GUI_ 73 74 #endif // __C_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__ 75