Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CScrollPanel.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_CSCROLLPANEL
19#define INCLUDED_CSCROLLPANEL
20
21#include "gui/CGUISetting.h"
26#include "ps/CStr.h"
27
28#include <vector>
29
30class CGUI;
31
33{
35public:
36 CScrollPanel(CGUI& pGUI);
37
38 virtual void ResetStates();
39
41
42protected:
43 /**
44 * @see IGUIObject#HandleMessage()
45 */
46 virtual void HandleMessage(SGUIMessage& Message);
47
48 virtual void RecalculateActualSize() const;
49
50 void UpdateScrollBars();
51
54
55 virtual void Draw(CCanvas2D& canvas);
56
57 virtual void CreateJSObject();
58
63};
64
65#endif // INCLUDED_CSCROLLPANEL
EScrollOrientation
Definition: EScrollOrientation.h:22
#define GUI_OBJECT(obj)
Definition: IGUIObject.h:53
Definition: Canvas2D.h:36
The main object that represents a whole GUI page.
Definition: CGUI.h:80
Definition: CScrollPanel.h:33
CGUISimpleSetting< EScrollOrientation > m_Orientation
Definition: CScrollPanel.h:59
virtual void HandleMessage(SGUIMessage &Message)
Definition: CScrollPanel.cpp:91
virtual void RecalculateActualSize() const
Recompute the actual (absolute) size from scratch again and cache it.
Definition: CScrollPanel.cpp:59
CGUISimpleSetting< int > m_MinWidth
Definition: CScrollPanel.h:61
bool HasHorizontalScrollBar() const
Definition: CScrollPanel.h:52
CGUISimpleSetting< CStr > m_ScrollBarStyle
Definition: CScrollPanel.h:60
virtual void Draw(CCanvas2D &canvas)
Definition: CScrollPanel.cpp:140
void UpdateScrollBars()
Definition: CScrollPanel.cpp:160
void ResetScrollPosition(EScrollOrientation orientation=EScrollOrientation::BOTH)
Definition: CScrollPanel.cpp:221
virtual void CreateJSObject()
Creates the JS object representing this page upon first use.
CGUISimpleSetting< int > m_MinHeight
Definition: CScrollPanel.h:62
bool HasVerticalScrollBar() const
Definition: CScrollPanel.h:53
virtual void ResetStates()
Definition: CScrollPanel.cpp:53
CScrollPanel(CGUI &pGUI)
Definition: CScrollPanel.cpp:36
Definition: IGUIPanel.h:27
Base-class this if you want an object to contain one, or several, scroll-bars.
Definition: IGUIScrollBarOwner.h:38
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
Definition: SGUIMessage.h:73