1 /*!
2 	@file
3 	@author		Georgiy Evmenov
4 	@date		09/2008
5 */
6 
7 #ifndef _f8e3cc5e_1360_4275_b9d9_3295570d5149_
8 #define _f8e3cc5e_1360_4275_b9d9_3295570d5149_
9 
10 #include "BaseLayout/BaseLayout.h"
11 #include "PanelView/BasePanelViewItem.h"
12 #include "WidgetContainer.h"
13 
14 namespace tools
15 {
16 
17 	class PanelItems :
18 		public wraps::BasePanelViewItem
19 	{
20 	public:
21 		PanelItems();
22 
23 		virtual void initialise();
24 		virtual void shutdown();
25 
26 		void update(MyGUI::Widget* _currentWidget);
27 
28 	private:
29 		void updateList();
30 		void addItem(const std::string& _value);
31 		void removeItem(size_t _index);
32 
33 		void notifyAddItem(MyGUI::Widget* _sender = nullptr);
34 		void notifyDeleteItem(MyGUI::Widget* _sender);
35 		void notifyUpdateItem(MyGUI::EditBox* _widget);
36 		void notifySelectItem(MyGUI::ListBox* _widget, size_t _position);
37 		virtual void notifyChangeWidth(int _width);
38 
39 		void selectItem(MyGUI::Widget* _widget);
40 
41 		void setContainerProperty(MyGUI::Widget* _widget, const std::string& _key, const std::string& _value);
42 
43 		void setPropertyValue(MyGUI::Widget* _widget, size_t _index, const std::string& _propertyName, const std::string& _propertyValue);
44 		void erasePropertyValue(MyGUI::Widget* _widget, size_t _index, const std::string& _propertyName);
45 		void addPropertyValue(MyGUI::Widget* _widget, const std::string& _propertyName, const std::string& _propertyValue);
46 
47 	private:
48 		MyGUI::EditBox* mEdit;
49 		MyGUI::ListBox* mList;
50 		MyGUI::Button* mButtonAdd;
51 		MyGUI::Button* mButtonDelete;
52 
53 		MyGUI::Widget* mCurrentWidget;
54 
55 		int mButtonLeft;
56 		int mButtonRight;
57 		int mButtonSpace;
58 	};
59 
60 }
61 
62 #endif
63