Simple GUI Library
scroll_pane.h
Go to the documentation of this file.
1/**
2 * @author Nikita Mochalov (github.com/tralf-strues)
3 * @file scroll_pane.h
4 * @date 2021-12-13
5 *
6 * @copyright Copyright (c) 2021
7 */
8
9#pragma once
10
11#include "control.h"
12
13namespace Sgl
14{
15 class ScrollPane : public Control
16 {
17 public:
18 ScrollPane();
19
20 Component* getContent();
21 void setContent(Component* content);
22
23 const Sml::Rectangle<int32_t>& getViewport() const;
24 void setViewport(const Sml::Rectangle<int32_t>& viewport);
25
26 int32_t getViewportX() const;
27 void setViewportX(int32_t x);
28
29 int32_t getViewportY() const;
30 void setViewportY(int32_t y);
31
32 int32_t getViewportWidth() const;
33 void setViewportWidth(int32_t width);
34
35 int32_t getViewportHeight() const;
36 void setViewportHeight(int32_t height);
37
38 private:
39 Component* m_Content = nullptr;
40 Sml::Rectangle<int32_t> m_Viewport;
41 };
42};