1 /*! 2 @file 3 @author Albert Semenov 4 @date 12/2010 5 */ 6 7 #ifndef _c05c3f75_ceee_4525_89ac_a8462ec97634_ 8 #define _c05c3f75_ceee_4525_89ac_a8462ec97634_ 9 10 #include "EditorToolTip.h" 11 #include "BaseLayout/BaseLayout.h" 12 #include "IPropertyField.h" 13 #include "ColourPanel.h" 14 #include "sigslot.h" 15 16 namespace tools 17 { 18 19 class PropertyFieldColour : 20 public wraps::BaseLayout, 21 public IPropertyField, 22 public sigslot::has_slots<> 23 { 24 public: 25 PropertyFieldColour(MyGUI::Widget* _parent); 26 virtual ~PropertyFieldColour(); 27 28 virtual void initialise(const std::string& _type); 29 30 virtual void setTarget(MyGUI::Widget* _currentWidget); 31 virtual void setValue(const std::string& _value); 32 virtual void setName(const std::string& _value); 33 34 virtual void setVisible(bool _value); 35 virtual bool getVisible(); 36 37 virtual MyGUI::IntSize getContentSize(); 38 virtual void setCoord(const MyGUI::IntCoord& _coord); 39 40 private: 41 void notifyApplyProperties(MyGUI::Widget* _sender, bool _force); 42 void notifyTryApplyProperties(MyGUI::EditBox* _sender); 43 void notifyForceApplyProperties(MyGUI::EditBox* _widget); 44 void notifyMouseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); 45 void notifyEndDialog(Dialog* _sender, bool _result); 46 void notifyPreviewColour(const MyGUI::Colour& _value); 47 48 void updateColourPlace(bool _success); 49 MyGUI::Colour getColour(); 50 void setColour(const MyGUI::Colour& _color, bool _final); 51 void showColourDialog(); 52 53 protected: 54 virtual bool onCheckValue(); 55 virtual void onAction(const std::string& _value, bool _final); 56 57 private: 58 MyGUI::TextBox* mText; 59 MyGUI::EditBox* mField; 60 MyGUI::Widget* mColourPlace; 61 MyGUI::Widget* mCurrentWidget; 62 std::string mType; 63 std::string mName; 64 ColourPanel* mColourPanel; 65 MyGUI::Colour mPreviewColour; 66 bool mGoodData; 67 }; 68 69 } 70 71 #endif 72