Simple GUI Library
scroll_pane.cpp
Go to the documentation of this file.
1/**
2 * @author Nikita Mochalov (github.com/tralf-strues)
3 * @file scroll_pane.cpp
4 * @date 2021-12-13
5 *
6 * @copyright Copyright (c) 2021
7 */
8
11
12using namespace Sgl;
13
14ScrollPane::ScrollPane()
15{
16 m_DefaultSkin = new DefaultSkins::ScrollPaneSkin(this);
17 setSkin(m_DefaultSkin);
18}
19
20Component* ScrollPane::getContent() { return m_Content; }
21void ScrollPane::setContent(Component* content) { assert(content); m_Content = content; }
22
23const Sml::Rectangle<int32_t>& ScrollPane::getViewport() const { return m_Viewport; }
24void ScrollPane::setViewport(const Sml::Rectangle<int32_t>& viewport) { m_Viewport = viewport; }
25
26int32_t ScrollPane::getViewportX() const { return m_Viewport.pos.x; }
27void ScrollPane::setViewportX(int32_t x) { m_Viewport.pos.x = x; }
28
29int32_t ScrollPane::getViewportY() const { return m_Viewport.pos.y; }
30void ScrollPane::setViewportY(int32_t y) { m_Viewport.pos.y = y; }
31
32int32_t ScrollPane::getViewportWidth() const { return m_Viewport.width; }
33void ScrollPane::setViewportWidth(int32_t width) { m_Viewport.width = width; }
34
35int32_t ScrollPane::getViewportHeight() const { return m_Viewport.height; }
36void ScrollPane::setViewportHeight(int32_t height) { m_Viewport.height = height; }