ScummVM API documentation
scrollcontainer.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_WIDGETS_SCROLLCONTAINER_H
23 #define GUI_WIDGETS_SCROLLCONTAINER_H
24 
25 #include "gui/widget.h"
26 #include "common/str.h"
27 #include "gui/widgets/scrollbar.h"
28 
29 namespace GUI {
30 
32  ScrollBarWidget *_verticalScroll;
33  int16 _scrolledX, _scrolledY;
34  int _scrollbarWidth;
35  uint16 _limitH;
36  uint32 _reflowCmd;
37  ThemeEngine::WidgetBackground _backgroundType;
38  Common::String _dialogName;
39 
40  void recalc();
41 
42 public:
43  ScrollContainerWidget(GuiObject *boss, int x, int y, int w, int h, uint32 reflowCmd = 0);
44  ScrollContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogName, uint32 reflowCmd = 0);
45  ~ScrollContainerWidget() override;
46 
47  void init();
48  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
49  void reflowLayout() override;
50 
51  bool containsWidget(Widget *) const override;
52 
53  void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
54 
55  void handleMouseWheel(int x, int y, int direction) override;
56 
57  // We overload getChildY to make sure child widgets are positioned correctly.
58  // Essentially this compensates for the space taken up by the tab title header.
59  int16 getChildX() const override;
60  int16 getChildY() const override;
61  uint16 getWidth() const override;
62  uint16 getHeight() const override;
63 
64  void draw() override;
65  void markAsDirty() override;
66 
67 protected:
68  void drawWidget() override;
69 
70  Widget *findWidget(int x, int y) override;
71 };
72 
73 } // End of namespace GUI
74 
75 #endif
void markAsDirty() override
Definition: str.h:59
WidgetBackground
Widget background type.
Definition: ThemeEngine.h:226
Definition: scrollcontainer.h:31
Definition: scrollbar.h:34
Definition: system.h:46
Definition: object.h:60
Definition: widget.h:101
Definition: object.h:40