1 /*! 2 @file 3 @author Albert Semenov 4 @date 12/2010 5 */ 6 7 #ifndef _267e3805_b900_4be2_a0bd_6f6ea3d0262d_ 8 #define _267e3805_b900_4be2_a0bd_6f6ea3d0262d_ 9 10 #include "EditorToolTip.h" 11 #include "BaseLayout/BaseLayout.h" 12 #include "IPropertyField.h" 13 #include "sigslot.h" 14 15 namespace tools 16 { 17 18 class PropertyFieldPosition : 19 public wraps::BaseLayout, 20 public IPropertyField, 21 public sigslot::has_slots<> 22 { 23 public: 24 PropertyFieldPosition(MyGUI::Widget* _parent); 25 virtual ~PropertyFieldPosition(); 26 27 virtual void initialise(const std::string& _type); 28 29 virtual void setTarget(MyGUI::Widget* _currentWidget); 30 virtual void setValue(const std::string& _value); 31 virtual void setName(const std::string& _value); 32 33 virtual void setVisible(bool _value); 34 virtual bool getVisible(); 35 36 virtual MyGUI::IntSize getContentSize(); 37 virtual void setCoord(const MyGUI::IntCoord& _coord); 38 39 private: 40 void notifyApplyProperties(MyGUI::Widget* _sender, bool _force); 41 void notifyTryApplyProperties(MyGUI::EditBox* _sender); 42 void notifyForceApplyProperties(MyGUI::EditBox* _widget); 43 void notifyMouseButtonClick(MyGUI::Widget* _sender); 44 void notifyToggleRelativeMode(); 45 46 void commandToggleRelativeMode(const MyGUI::UString& _commandName, bool& _result); 47 void notifyPropertyChangeCoord(MyGUI::Widget* _widget, const MyGUI::IntCoord& _coordValue, const std::string& _owner); 48 void updatePositionCaption(); 49 void updateButton(); 50 51 protected: 52 virtual bool onCheckValue(); 53 virtual void onAction(const std::string& _value, bool _force); 54 55 protected: 56 MyGUI::TextBox* mText; 57 MyGUI::EditBox* mField; 58 MyGUI::Button* mButton; 59 MyGUI::Widget* mCurrentWidget; 60 std::string mType; 61 std::string mName; 62 }; 63 64 } 65 66 #endif 67