ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

scrollcontainer.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GUI_WIDGETS_SCROLLCONTAINER_H
00024 #define GUI_WIDGETS_SCROLLCONTAINER_H
00025 
00026 #include "gui/widget.h"
00027 #include "common/str.h"
00028 #include "scrollbar.h"
00029 
00030 namespace GUI {
00031 
00032 class ScrollContainerWidget: public Widget, public CommandSender {
00033     ScrollBarWidget *_verticalScroll;
00034     int16 _scrolledX, _scrolledY;
00035     uint16 _limitH;
00036     uint32 _reflowCmd;
00037     ThemeEngine::DialogBackground _backgroundType;
00038 
00039     void recalc();
00040 
00041 public:
00042     ScrollContainerWidget(GuiObject *boss, int x, int y, int w, int h, uint32 reflowCmd = 0);
00043     ScrollContainerWidget(GuiObject *boss, const Common::String &name, uint32 reflowCmd = 0);
00044     ~ScrollContainerWidget() override;
00045 
00046     void init();
00047     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
00048     void reflowLayout() override;
00049 
00050     bool containsWidget(Widget *) const override;
00051 
00052     Common::Rect getClipRect() const override;
00053 
00054     void setBackgroundType(ThemeEngine::DialogBackground backgroundType);
00055 
00056     void handleMouseWheel(int x, int y, int direction) override;
00057 
00058 protected:
00059     // We overload getChildY to make sure child widgets are positioned correctly.
00060     // Essentially this compensates for the space taken up by the tab title header.
00061     int16   getChildX() const override;
00062     int16   getChildY() const override;
00063     uint16  getWidth() const override;
00064     uint16  getHeight() const override;
00065 
00066     void drawWidget() override;
00067 
00068     Widget *findWidget(int x, int y) override;
00069 };
00070 
00071 } // End of namespace GUI
00072 
00073 #endif


Generated on Sat May 18 2019 05:01:19 for ResidualVM by doxygen 1.7.1
curved edge   curved edge