1 /*! 2 @file 3 @author Albert Semenov 4 @date 07/2012 5 */ 6 7 #ifndef _3552b1d5_c4d6_4e3b_97b1_fbd07d4b4c38_ 8 #define _3552b1d5_c4d6_4e3b_97b1_fbd07d4b4c38_ 9 10 #include "PropertyControl.h" 11 #include "ColourPanel.h" 12 13 namespace tools 14 { 15 16 class MYGUI_EXPORT_DLL PropertyColourControl : 17 public PropertyControl 18 { 19 public: 20 PropertyColourControl(); 21 virtual ~PropertyColourControl(); 22 23 protected: 24 virtual void updateCaption(); 25 virtual void updateProperty(); 26 virtual void OnInitialise(Control* _parent, MyGUI::Widget* _place, const std::string& _layoutName); 27 28 private: 29 void notifyEditTextChange(MyGUI::EditBox* _sender); 30 void notifyMouseButtonClick(MyGUI::Widget* _sender); 31 32 void notifyEndDialog(Dialog* _sender, bool _result); 33 void notifyPreviewColour(const MyGUI::Colour& _value); 34 35 bool parseColour1(const std::string& _value, MyGUI::Colour& _resultValue); 36 bool parseColour2(const std::string& _value, MyGUI::Colour& _resultValue); 37 bool parseColour3(const std::string& _value, MyGUI::Colour& _resultValue); 38 39 bool isValidate(MyGUI::Colour& _resultValue); 40 MyGUI::UString getClearValue(); 41 void setColour(bool _validate); 42 43 void updateSetProperty(); 44 45 private: 46 MyGUI::TextBox* mName; 47 MyGUI::EditBox* mEdit; 48 MyGUI::Widget* mColour; 49 50 ColourPanel* mColourPanel; 51 52 MyGUI::Colour mCurrentColour; 53 MyGUI::Colour mPreviewColour; 54 }; 55 56 } 57 58 #endif 59