qworkspace2.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Fco. Javier M. C.                               *
00003  *   fcojavmc@todo-redes.com                                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (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                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include <QWidget>
00022 #include <QAction>
00023 
00024 #include "qworkspace2.h"
00025 #include "funcaux.h"
00026 
00027 
00029 
00031 QWorkspace2::QWorkspace2(QWidget *) {
00032     _depura("QWorkspace2::QWorkspace2", 0);
00033     _depura("END QWorkspace2::QWorkspace2", 0);
00034 }
00035 
00036 
00038 
00040 QWorkspace2::~QWorkspace2() {
00041     _depura("QWorkspace2::~QWorkspace2", 0);
00042     _depura("END QWorkspace2::~QWorkspace2", 0);
00043 }
00044 
00045 
00047 
00050 void QWorkspace2::addWindow(QWidget * w) {
00051     _depura("QWorkspace2::addWindow", 0);
00052     int tamdispW;
00053     int tamdispH;
00054     int tamventanadecoW;
00055     int tamventanadecoH;
00056     int tamventanaW;
00057     int tamventanaH;
00058     int margen = 10;
00059 
00060     QWorkspace::addWindow(w);
00061 
00065 
00067     tamdispW = this->width() - (margen * 2);
00068     tamdispH = this->height() - (margen * 2);
00069 
00071     tamventanadecoW = w->parentWidget()->frameGeometry().width();
00072     tamventanadecoH = w->parentWidget()->frameGeometry().height();
00074     tamventanaW = w->geometry().width();
00075     tamventanaH = w->geometry().height();
00076 
00078     if (tamventanadecoW > tamdispW)
00079         tamventanaW = tamdispW - (tamventanadecoW - tamventanaW);
00080     if (tamventanadecoH > tamdispH)
00081         tamventanaH = tamdispH - (tamventanadecoH - tamventanaH);
00082 
00083     w->setGeometry(0, 0, tamventanaW, tamventanaH);
00084     w->parentWidget()->move(margen, margen);
00085 
00087     QAction *accionEsc = new QAction(w);
00088     accionEsc->setShortcut(tr("Esc"));
00089     connect(accionEsc, SIGNAL(triggered()), w, SLOT(close()));
00090     w->addAction(accionEsc);
00091     _depura("END QWorkspace2::addWindow", 0);
00092 }
00093 

Generated on Sat Dec 15 00:01:23 2007 for BulmaGes by  doxygen 1.5.1