OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itemwidget.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_MWGUI_ITEMWIDGET_H
2 #define OPENMW_MWGUI_ITEMWIDGET_H
3 
4 #include <MyGUI_Widget.h>
5 
6 namespace MWWorld
7 {
8  class Ptr;
9 }
10 
11 namespace MWGui
12 {
13 
15  class ItemWidget : public MyGUI::Widget
16  {
17  MYGUI_RTTI_DERIVED(ItemWidget)
18  public:
19  ItemWidget();
20 
22  static void registerComponents ();
23 
24  enum ItemState
25  {
30  };
31 
33  void setCount(int count);
34 
36  void setItem (const MWWorld::Ptr& ptr, ItemState state = None);
37 
38  // Set icon and frame manually
39  void setIcon (const std::string& icon);
40  void setIcon (const MWWorld::Ptr& ptr);
41  void setFrame (const std::string& frame, const MyGUI::IntCoord& coord);
42 
43  private:
44  virtual void initialiseOverride();
45 
46  MyGUI::ImageBox* mItem;
47  MyGUI::ImageBox* mItemShadow;
48  MyGUI::ImageBox* mFrame;
49  MyGUI::TextBox* mText;
50  };
51 
52 }
53 
54 #endif
void setCount(int count)
Set count to be displayed in a textbox over the item.
Definition: itemwidget.cpp:61
void setItem(const MWWorld::Ptr &ptr, ItemState state=None)
ptr may be empty
Definition: itemwidget.cpp:95
void setFrame(const std::string &frame, const MyGUI::IntCoord &coord)
Definition: itemwidget.cpp:76
Definition: itemwidget.hpp:26
MyGUI::ImageBox * mItem
Definition: itemwidget.hpp:46
Definition: itemwidget.hpp:29
virtual void initialiseOverride()
Definition: itemwidget.cpp:43
Definition: itemwidget.hpp:27
Definition: itemwidget.hpp:28
MyGUI::TextBox * mText
Definition: itemwidget.hpp:49
static void registerComponents()
Register needed components with MyGUI's factory manager.
Definition: itemwidget.cpp:38
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void setIcon(const std::string &icon)
Definition: itemwidget.cpp:68
ItemWidget()
Definition: itemwidget.cpp:29
MyGUI::ImageBox * mFrame
Definition: itemwidget.hpp:48
A widget that shows an icon for an MWWorld::Ptr.
Definition: itemwidget.hpp:15
ItemState
Definition: itemwidget.hpp:24
MyGUI::ImageBox * mItemShadow
Definition: itemwidget.hpp:47