1 /*! 2 @file 3 @author Albert Semenov 4 @date 08/2012 5 */ 6 7 #ifndef _4eddcc54_41d1_4881_8840_89c6f0894589_ 8 #define _4eddcc54_41d1_4881_8840_89c6f0894589_ 9 10 #include "Control.h" 11 12 namespace tools 13 { 14 class SeparatePanel : 15 public Control 16 { 17 public: 18 SeparatePanel(); 19 virtual ~SeparatePanel(); 20 21 void setPanelAlign(MyGUI::Align _value); 22 MyGUI::Align getPanelAlign() const; 23 24 protected: 25 virtual void OnInitialise(Control* _parent, MyGUI::Widget* _place, const std::string& _layoutName); 26 27 private: 28 void notifyChangeCoord(MyGUI::Widget* _sender); 29 void notifyMouseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); 30 void notifyMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); 31 32 void invalidateSize(const MyGUI::IntCoord& _firstPanel, const MyGUI::IntCoord& _separatorH, const MyGUI::IntCoord& _separatorV, const MyGUI::IntCoord& _secondPanel); 33 void updateSize(int& _firstCoord, int& _secondCoord, int _separatorWidth, int _mainSize, int _defaultSize); 34 void moveSeparator(const MyGUI::IntPoint& _mousePosition); 35 void loadDefaultSize(); 36 void saveDefaultSize(); 37 38 private: 39 MyGUI::Widget* mFirstPanel; 40 MyGUI::Widget* mSecondPanel; 41 MyGUI::Widget* mSeparatorH; 42 MyGUI::Widget* mSeparatorV; 43 int mMinSize; 44 MyGUI::Align mPanelAlign; 45 MyGUI::IntSize mDefaultPanelSize; 46 MyGUI::IntPoint mMousePressedOffset; 47 std::string mSaveAs; 48 }; 49 50 } 51 52 #endif 53