2012-05-03 03:33:33 +02:00
|
|
|
#ifndef MWGUI_BOOKWINDOW_H
|
|
|
|
#define MWGUI_BOOKWINDOW_H
|
|
|
|
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowbase.hpp"
|
2012-05-03 03:33:33 +02:00
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2014-09-12 05:14:21 +02:00
|
|
|
#include <components/widgets/imagebutton.hpp>
|
2013-01-03 01:09:03 +01:00
|
|
|
|
2012-05-03 03:33:33 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class BookWindow : public WindowBase
|
|
|
|
{
|
|
|
|
public:
|
2013-04-10 14:46:21 -04:00
|
|
|
BookWindow();
|
2012-05-15 18:05:53 +02:00
|
|
|
|
2014-05-26 23:13:37 -04:00
|
|
|
virtual void exit();
|
|
|
|
|
2015-06-04 20:31:28 +02:00
|
|
|
void openBook(MWWorld::Ptr book, bool showTakeButton);
|
2013-02-17 15:56:22 +01:00
|
|
|
void setInventoryAllowed(bool allowed);
|
|
|
|
|
2012-05-03 05:26:05 +02:00
|
|
|
protected:
|
2013-01-03 01:09:03 +01:00
|
|
|
void onNextPageButtonClicked (MyGUI::Widget* sender);
|
|
|
|
void onPrevPageButtonClicked (MyGUI::Widget* sender);
|
|
|
|
void onCloseButtonClicked (MyGUI::Widget* sender);
|
|
|
|
void onTakeButtonClicked (MyGUI::Widget* sender);
|
2014-01-04 01:13:19 +01:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
2015-03-11 20:33:55 +01:00
|
|
|
void setTakeButtonShow(bool show);
|
|
|
|
|
|
|
|
void nextPage();
|
|
|
|
void prevPage();
|
2012-05-03 05:26:05 +02:00
|
|
|
|
2012-05-10 11:03:27 +02:00
|
|
|
void updatePages();
|
|
|
|
void clearPages();
|
2014-09-12 05:14:21 +02:00
|
|
|
void adjustButton(Gui::ImageButton* button);
|
2012-05-10 11:03:27 +02:00
|
|
|
|
2012-05-03 05:26:05 +02:00
|
|
|
private:
|
2014-09-20 00:11:04 +02:00
|
|
|
typedef std::pair<int, int> Page;
|
|
|
|
typedef std::vector<Page> Pages;
|
|
|
|
|
2014-09-12 05:14:21 +02:00
|
|
|
Gui::ImageButton* mCloseButton;
|
|
|
|
Gui::ImageButton* mTakeButton;
|
|
|
|
Gui::ImageButton* mNextPageButton;
|
|
|
|
Gui::ImageButton* mPrevPageButton;
|
2014-09-20 00:11:04 +02:00
|
|
|
|
2012-05-10 11:03:27 +02:00
|
|
|
MyGUI::TextBox* mLeftPageNumber;
|
|
|
|
MyGUI::TextBox* mRightPageNumber;
|
|
|
|
MyGUI::Widget* mLeftPage;
|
|
|
|
MyGUI::Widget* mRightPage;
|
|
|
|
|
|
|
|
unsigned int mCurrentPage; // 0 is first page
|
2014-09-20 00:11:04 +02:00
|
|
|
Pages mPages;
|
2012-05-03 05:26:05 +02:00
|
|
|
|
|
|
|
MWWorld::Ptr mBook;
|
2013-02-17 15:56:22 +01:00
|
|
|
|
|
|
|
bool mTakeButtonShow;
|
|
|
|
bool mTakeButtonAllowed;
|
2012-05-03 03:33:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|