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

Tooltip.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_TOOLTIP_H
00024 #define GUI_TOOLTIP_H
00025 
00026 #include "common/keyboard.h"
00027 #include "common/str-array.h"
00028 #include "gui/dialog.h"
00029 
00030 namespace GUI {
00031 
00032 class Widget;
00033 
00034 class Tooltip : public Dialog {
00035 private:
00036     Dialog *_parent;
00037 
00038 public:
00039     Tooltip();
00040 
00041     void setup(Dialog *parent, Widget *widget, int x, int y);
00042 
00043     void drawDialog(DrawLayer layerToDraw) override;
00044 
00045     virtual void receivedFocus(int x = -1, int y = -1) override {}
00046 protected:
00047     virtual void handleMouseDown(int x, int y, int button, int clickCount) override {
00048         close();
00049         _parent->handleMouseDown(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
00050     }
00051     virtual void handleMouseUp(int x, int y, int button, int clickCount) override {
00052         close();
00053         _parent->handleMouseUp(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
00054     }
00055     virtual void handleMouseWheel(int x, int y, int direction) override {
00056         close();
00057         _parent->handleMouseWheel(x + (getAbsX() - _parent->getAbsX()), y + (getAbsX() - _parent->getAbsX()), direction);
00058     }
00059     virtual void handleKeyDown(Common::KeyState state) override {
00060         close();
00061         _parent->handleKeyDown(state);
00062     }
00063     virtual void handleKeyUp(Common::KeyState state) override {
00064         close();
00065         _parent->handleKeyUp(state);
00066     }
00067     virtual void handleMouseMoved(int x, int y, int button) override {
00068         close();
00069     }
00070 
00071     int _maxWidth;
00072     int _xdelta, _ydelta;
00073 
00074     Common::StringArray _wrappedLines;
00075 };
00076 
00077 } // End of namespace GUI
00078 
00079 #endif // GUI_TOOLTIP_H


Generated on Sat Mar 16 2019 05:01:56 for ResidualVM by doxygen 1.7.1
curved edge   curved edge