1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/apps/openmw/mwgui/bookwindow.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 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 BookWindowBase
2012-05-03 01:33:33 +00:00
{
public:
BookWindow();
void setPtr(const MWWorld::Ptr& book) override;
void setInventoryAllowed(bool allowed);
void onResChange(int, int) override { center(); }
2017-09-23 20:07:30 +00:00
2023-07-09 06:42:09 +00:00
std::string_view getWindowIdForLua() const override { return "Book"; }
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 onKeyButtonPressed(MyGUI::Widget* sender, MyGUI::KeyCode key, MyGUI::Char character);
2015-03-11 19:33:55 +00:00
void nextPage();
void prevPage();
2012-05-10 09:03:27 +00:00
void updatePages();
void clearPages();
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