1 /*!
2 	@file
3 	@author		Georgiy Evmenov
4 	@date		12/2009
5 */
6 
7 #ifndef _7e90e850_b99c_4d13_9681_3bfb0e9c11c0_
8 #define _7e90e850_b99c_4d13_9681_3bfb0e9c11c0_
9 
10 #include "BaseLayout/BaseLayout.h"
11 #include "PanelView/BasePanelViewItem.h"
12 #include "IPropertyField.h"
13 
14 namespace tools
15 {
16 
17 	class PanelControllers :
18 		public wraps::BasePanelViewItem
19 	{
20 	public:
21 		PanelControllers();
22 
23 		virtual void initialise();
24 		virtual void shutdown();
25 
26 		void update(MyGUI::Widget* _currentWidget);
27 
28 	private:
29 		void notifyAction(const std::string& _name, const std::string& _value, bool _final);
30 
31 		virtual void notifyChangeWidth(int _width);
32 
33 		void notifyAdd(MyGUI::Widget* _sender = nullptr);
34 		void notifyDelete(MyGUI::Widget* _sender);
35 		void notifySelectItem(MyGUI::ListBox* _sender, size_t _index);
36 
37 		void loadControllerTypes(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version);
38 		void destroyPropertyFields();
39 
40 		void updateSize();
41 
42 	private:
43 		MyGUI::ComboBox* mControllerName;
44 		MyGUI::Button* mButtonAdd;
45 		MyGUI::Button* mButtonDelete;
46 		MyGUI::ListBox* mList;
47 
48 		MyGUI::Widget* mCurrentWidget;
49 
50 		int mButtonLeft;
51 		int mButtonRight;
52 		int mButtonSpace;
53 
54 		typedef std::map<std::string, MyGUI::MapString> MapMapString;
55 		MapMapString mControllersProperties;
56 
57 		typedef std::vector<IPropertyField*> VectorPropertyField;
58 		VectorPropertyField mFields;
59 
60 		size_t mIndexSelected;
61 	};
62 
63 }
64 
65 #endif
66