1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 17:49:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/bookwindow.hpp

63 lines
1.6 KiB
C++
Raw Normal View History

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