Stellarium 0.11.3
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

gui/Dialog.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2008 Guillaume Chereau
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00018  */
00019 
00020 
00021 #ifndef _DIALOG_HPP_
00022 #define _DIALOG_HPP_
00023 
00024 #include <QWidget>
00025 #include <QFrame>
00026 #include <QMouseEvent>
00027 
00042 class BarFrame : public QFrame
00043 {
00044 Q_OBJECT
00045 public:
00046     QPoint mousePos;
00047   
00048     BarFrame(QWidget* parent) : QFrame(parent), moving(false) {}
00049   
00050     virtual void mousePressEvent(QMouseEvent *event);
00051     virtual void mouseReleaseEvent(QMouseEvent *event);
00052     virtual void mouseMoveEvent(QMouseEvent *event);
00053 protected:
00054     bool moving;
00055 };
00056 
00057 class ResizeFrame : public QFrame
00058 {
00059 Q_OBJECT
00060 public:
00061     QPoint mousePos;
00062   
00063     ResizeFrame(QWidget* parent) : QFrame(parent) {}
00064   
00065     virtual void mousePressEvent(QMouseEvent *event) {
00066         mousePos = event->pos();
00067     }
00068     virtual void mouseMoveEvent(QMouseEvent *event);
00069 };
00070 
00071 
00072 #endif // _DIALOG_HPP_
Generated on Thu May 31 10:37:19 2012 for Stellarium by  doxygen 1.6.3