OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itemchargeview.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_ITEMCHARGEVIEW_H
2 #define MWGUI_ITEMCHARGEVIEW_H
3 
4 #include <vector>
5 #include <memory>
6 
7 #include <MyGUI_Widget.h>
8 
9 #include "../mwworld/ptr.hpp"
10 
11 #include "widgets.hpp"
12 
13 namespace MyGUI
14 {
15  class TextBox;
16  class ScrollView;
17 }
18 
19 namespace MWGui
20 {
21  class ItemModel;
22  class ItemWidget;
23 
24  class ItemChargeView : public MyGUI::Widget
25  {
26  MYGUI_RTTI_DERIVED(ItemChargeView)
27  public:
29  {
32  };
33 
35 
37  static void registerComponents();
38 
39  virtual void initialiseOverride();
40 
42  void setModel(ItemModel* model);
43 
44  void setDisplayMode(DisplayMode type);
45 
46  void update();
47  void layoutWidgets();
48  void resetScrollbars();
49 
50  virtual void setSize(const MyGUI::IntSize& value);
51  virtual void setCoord(const MyGUI::IntCoord& value);
52 
53  MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, const MWWorld::Ptr&> eventItemClicked;
54 
55  private:
56  struct Line
57  {
59  MyGUI::TextBox* mText;
62  };
63 
64  void updateLine(const Line& line);
65 
66  void onIconClicked(MyGUI::Widget* sender);
67  void onMouseWheelMoved(MyGUI::Widget* sender, int rel);
68 
69  typedef std::vector<Line> Lines;
71 
72  std::auto_ptr<ItemModel> mModel;
73  MyGUI::ScrollView* mScrollView;
75  };
76 }
77 
78 #endif
MyGUI::delegates::CMultiDelegate2< MyGUI::Widget *, const MWWorld::Ptr & > eventItemClicked
Definition: itemchargeview.hpp:53
The base class that all item models should derive from.
Definition: itemmodel.hpp:43
ItemChargeView()
Definition: itemchargeview.cpp:23
Definition: itemchargeview.hpp:30
void onIconClicked(MyGUI::Widget *sender)
Definition: itemchargeview.cpp:200
void update()
Definition: itemchargeview.cpp:56
DisplayMode mDisplayMode
Definition: itemchargeview.hpp:74
void resetScrollbars()
Definition: itemchargeview.cpp:149
std::vector< Line > Lines
Definition: itemchargeview.hpp:69
void layoutWidgets()
Definition: itemchargeview.cpp:129
Lines mLines
Definition: itemchargeview.hpp:70
std::auto_ptr< ItemModel > mModel
Definition: itemchargeview.hpp:72
ItemWidget * mIcon
Definition: itemchargeview.hpp:60
void onMouseWheelMoved(MyGUI::Widget *sender, int rel)
Definition: itemchargeview.cpp:205
void setModel(ItemModel *model)
Takes ownership of model.
Definition: itemchargeview.cpp:45
virtual void initialiseOverride()
Definition: itemchargeview.cpp:34
MyGUI::ScrollView * mScrollView
Definition: itemchargeview.hpp:73
static void registerComponents()
Register needed components with MyGUI's factory manager.
Definition: itemchargeview.cpp:29
Definition: itemchargeview.hpp:56
virtual void setSize(const MyGUI::IntSize &value)
Definition: itemchargeview.cpp:154
Widgets::MWDynamicStatPtr mCharge
Definition: itemchargeview.hpp:61
void updateLine(const Line &line)
Definition: itemchargeview.cpp:170
Definition: widgets.hpp:277
MWWorld::Ptr mItemPtr
Definition: itemchargeview.hpp:58
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
DisplayMode
Definition: itemchargeview.hpp:28
MyGUI::TextBox * mText
Definition: itemchargeview.hpp:59
Definition: itemchargeview.hpp:24
void setDisplayMode(DisplayMode type)
Definition: itemchargeview.cpp:50
A widget that shows an icon for an MWWorld::Ptr.
Definition: itemwidget.hpp:15
virtual void setCoord(const MyGUI::IntCoord &value)
Definition: itemchargeview.cpp:162