Home · All Namespaces · All Classes · Functions · Coding Style · 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 
00021 #ifndef _DIALOG_HPP_
00022 #define _DIALOG_HPP_
00023 
00024 #include <QWidget>
00025 #include <QFrame>
00026 #include <QMouseEvent>
00027 
00028 
00029 class BarFrame : public QFrame
00030 {
00031 Q_OBJECT
00032 public:
00033     QPoint mousePos;
00034   
00035     BarFrame(QWidget* parent) : QFrame(parent), moving(false) {}
00036   
00037     virtual void mousePressEvent(QMouseEvent *event);
00038     virtual void mouseReleaseEvent(QMouseEvent *event);
00039     virtual void mouseMoveEvent(QMouseEvent *event);
00040 protected:
00041     bool moving;
00042 };
00043 
00044 class ResizeFrame : public QFrame
00045 {
00046 Q_OBJECT
00047 public:
00048     QPoint mousePos;
00049   
00050     ResizeFrame(QWidget* parent) : QFrame(parent) {}
00051   
00052     virtual void mousePressEvent(QMouseEvent *event) {
00053         mousePos = event->pos();
00054     }
00055     virtual void mouseMoveEvent(QMouseEvent *event);
00056 };
00057 
00058 
00059 #endif // _DIALOG_HPP_

Generated on Mon Feb 2 17:23:47 2009 for Stellarium by  doxygen 1.5.5