blob: 5048627365608fa4ef8bad06f296daddeb57d8f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#pragma once
#include "Widget.hpp"
#include <memory>
#include <vector>
namespace gsr {
class ScrollablePage : public Widget {
public:
ScrollablePage(mgl::vec2f size);
ScrollablePage(const ScrollablePage&) = delete;
ScrollablePage& operator=(const ScrollablePage&) = delete;
bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override;
void draw(mgl::Window &window, mgl::vec2f offset) override;
mgl::vec2f get_size() override;
void set_size(mgl::vec2f size);
void add_widget(std::unique_ptr<Widget> widget);
private:
mgl::vec2f size;
std::vector<std::unique_ptr<Widget>> widgets;
};
}
|