OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bookwindow.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_BOOKWINDOW_H
2 #define MWGUI_BOOKWINDOW_H
3 
4 #include "windowbase.hpp"
5 
6 #include "../mwworld/ptr.hpp"
7 
9 
10 namespace MWGui
11 {
12  class BookWindow : public WindowBase
13  {
14  public:
15  BookWindow();
16 
17  virtual void exit();
18 
19  void openBook(MWWorld::Ptr book, bool showTakeButton);
20  void setInventoryAllowed(bool allowed);
21 
22  protected:
23  void onNextPageButtonClicked (MyGUI::Widget* sender);
24  void onPrevPageButtonClicked (MyGUI::Widget* sender);
25  void onCloseButtonClicked (MyGUI::Widget* sender);
26  void onTakeButtonClicked (MyGUI::Widget* sender);
27  void onMouseWheel(MyGUI::Widget* _sender, int _rel);
28  void setTakeButtonShow(bool show);
29 
30  void nextPage();
31  void prevPage();
32 
33  void updatePages();
34  void clearPages();
35  void adjustButton(Gui::ImageButton* button);
36 
37  private:
38  typedef std::pair<int, int> Page;
39  typedef std::vector<Page> Pages;
40 
45 
46  MyGUI::TextBox* mLeftPageNumber;
47  MyGUI::TextBox* mRightPageNumber;
48  MyGUI::Widget* mLeftPage;
49  MyGUI::Widget* mRightPage;
50 
51  unsigned int mCurrentPage; // 0 is first page
53 
55 
58  };
59 
60 }
61 
62 #endif
void onMouseWheel(MyGUI::Widget *_sender, int _rel)
Definition: bookwindow.cpp:65
void clearPages()
Definition: bookwindow.cpp:73
BookWindow()
Definition: bookwindow.cpp:21
bool mTakeButtonShow
Definition: bookwindow.hpp:56
Gui::ImageButton * mNextPageButton
Definition: bookwindow.hpp:43
Gui::ImageButton * mCloseButton
Definition: bookwindow.hpp:41
void onNextPageButtonClicked(MyGUI::Widget *sender)
Definition: bookwindow.cpp:133
void setTakeButtonShow(bool show)
Definition: bookwindow.cpp:106
void prevPage()
Definition: bookwindow.cpp:205
Definition: bookwindow.hpp:12
MyGUI::Widget * mRightPage
Definition: bookwindow.hpp:49
void adjustButton(Gui::ImageButton *button)
Definition: bookwindow.cpp:185
void onTakeButtonClicked(MyGUI::Widget *sender)
Definition: bookwindow.cpp:123
Gui::ImageButton * mPrevPageButton
Definition: bookwindow.hpp:44
void openBook(MWWorld::Ptr book, bool showTakeButton)
Definition: bookwindow.cpp:78
bool mTakeButtonAllowed
Definition: bookwindow.hpp:57
void updatePages()
Definition: bookwindow.cpp:143
MyGUI::Widget * mLeftPage
Definition: bookwindow.hpp:48
Gui::ImageButton * mTakeButton
Definition: bookwindow.hpp:42
virtual void exit()
Gracefully exits the window.
Definition: bookwindow.cpp:98
TypesetBook::Ptr book
Definition: journalbooks.cpp:156
Definition: windowbase.hpp:16
MyGUI::TextBox * mLeftPageNumber
Definition: bookwindow.hpp:46
allows using different image textures depending on the button state
Definition: imagebutton.hpp:12
MWWorld::Ptr mBook
Definition: bookwindow.hpp:54
void onCloseButtonClicked(MyGUI::Widget *sender)
Definition: bookwindow.cpp:118
void setInventoryAllowed(bool allowed)
Definition: bookwindow.cpp:112
unsigned int mCurrentPage
Definition: bookwindow.hpp:51
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void nextPage()
Definition: bookwindow.cpp:194
std::pair< int, int > Page
Definition: bookwindow.hpp:38
void onPrevPageButtonClicked(MyGUI::Widget *sender)
Definition: bookwindow.cpp:138
Pages mPages
Definition: bookwindow.hpp:52
MyGUI::TextBox * mRightPageNumber
Definition: bookwindow.hpp:47
std::vector< Page > Pages
Definition: bookwindow.hpp:39