Stellarium 0.13.0
Dialog.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2008 Guillaume Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 
21 #ifndef _DIALOG_HPP_
22 #define _DIALOG_HPP_
23 
24 #include "config.h"
25 
26 #include <QWidget>
27 #include <QFrame>
28 #include <QMouseEvent>
29 
44 class BarFrame : public QFrame
45 {
46 Q_OBJECT
47 public:
48  QPoint mousePos;
49 
50  BarFrame(QWidget* parent) : QFrame(parent), moving(false) {}
51 
52  virtual void mousePressEvent(QMouseEvent *event);
53  virtual void mouseReleaseEvent(QMouseEvent *event);
54  virtual void mouseMoveEvent(QMouseEvent *event);
55 protected:
56  bool moving;
57 };
58 
59 class ResizeFrame : public QFrame
60 {
61 Q_OBJECT
62 public:
63  QPoint mousePos;
64 
65  ResizeFrame(QWidget* parent) : QFrame(parent) {}
66 
67  virtual void mousePressEvent(QMouseEvent *event) {
68  mousePos = event->pos();
69  }
70  virtual void mouseMoveEvent(QMouseEvent *event);
71 };
72 
73 
74 #endif // _DIALOG_HPP_
A title bar control used in windows derived from StelDialog.
Definition: Dialog.hpp:44
Definition: Dialog.hpp:59