bulmatpv.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Tomeu Borras Riera                              *
00003  *   tborras@conetxia.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 <QImage>
00022 #include <QPixmap>
00023 #include <QToolButton>
00024 #include <QMenuBar>
00025 #include <QFile>
00026 #include <QStatusBar>
00027 #include <QMessageBox>
00028 #include <QPrinter>
00029 #include <QApplication>
00030 #include <QTextStream>
00031 #include <QPainter>
00032 #include <QWorkspace>
00033 #include <QMainWindow>
00034 #include <QProgressBar>
00035 
00036 #include "qworkspace2.h"
00037 #include "bulmatpv.h"
00038 #include "listventanas.h"
00039 #include "funcaux.h"
00040 #include "aboutview.h"
00041 #include "busquedaperiodo.h"
00042 
00043 
00052 BulmaTPV::BulmaTPV(QString bd) : QMainWindow() {
00053     _depura("BulmaTPV::BulmaTPV", 0);
00054     setupUi(this);
00055     setUpdatesEnabled(TRUE);
00056     pWorkspace = new QWorkspace2(this);
00057     pWorkspace->setScrollBarsEnabled(TRUE);
00058     QFrame *m_frame1 = new QFrame();
00059     QProgressBar *m_pb = new QProgressBar();
00060     m_pb->setMaximum(100);
00061     m_pb->setMinimum(0);
00062     m_pb->setValue(0);
00064     m_pb->setVisible(FALSE);
00065     setCentralWidget(m_frame1);
00067     QVBoxLayout *vboxlayout = new QVBoxLayout(this->centralWidget());
00068     vboxlayout->setSpacing(0);
00069     vboxlayout->setMargin(0);
00070     vboxlayout->addWidget(pWorkspace);
00071     vboxlayout->addWidget(m_pb);
00072 
00073 
00074     m_empresaTPV = new EmpresaTPV(this);
00075     m_empresaTPV->setProgressBar(m_pb);
00076     m_empresaTPV->init(bd, "BulmaFact");
00077     m_empresaTPV->setWorkspace(pWorkspace);
00078 
00079 
00080     //connect(pWorkspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(informaindexador(QWidget *)));
00081 
00082     setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
00083     setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
00084     setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
00085     setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
00086 
00087 
00088 
00089     QDockWidget *widgetPrueba = new QDockWidget(NULL);
00090     addDockWidget(Qt::LeftDockWidgetArea, widgetPrueba);
00091 //    m_company->setListVentanas(m_list);
00092 
00093     m_pb->setVisible(FALSE);
00094     statusBar()->showMessage(bd, 2000);
00095     setWindowTitle(bd);
00096     _depura("END BulmaTPV::BulmaTPV", 0);
00097 }
00098 
00099 
00105 void BulmaTPV::createMainWindows(Splash *splashScr) {
00106     _depura("BulmaTPV::createMainWindows", 0);
00107     m_empresaTPV->createMainWindows(splashScr);
00108     _depura("END BulmaTPV::createMainWindows", 0);
00109 }
00110 
00111 
00116 BulmaTPV::~BulmaTPV() {
00117     _depura("BulmaTPV::~BulmaTPV", 0);
00118     delete pWorkspace;
00121 #ifdef WINDOWS
00122 
00123     exit(0);
00124 #endif
00125 
00126     _depura("END BulmaTPV::~BulmaTPV", 0);
00127 }
00128 
00129 
00130 
00135 void BulmaTPV::s_ventanaCompleta() {
00136     _depura("BulmaTPV::s_ventanaCompleta", 0);
00137     if (isFullScreen()) {
00138         showNormal();
00139     } else {
00140         showFullScreen();
00141     } // end if
00142     _depura("END BulmaTPV::s_ventanaCompleta", 0);
00143 }
00144 
00145 
00151 void BulmaTPV::s_About() {
00152     _depura("BulmaTPV::s_About", 0);
00153     AboutView about;
00154     about.exec();
00155     _depura("END BulmaTPV::s_About", 0);
00156 }
00157 
00158 
00164 void BulmaTPV::closeEvent(QCloseEvent *) {
00165     _depura("BulmaTPV::closeEvent", 0);
00166 //    delete m_company;
00167 //    m_company = NULL;
00168 #ifdef WINDOWS
00169 
00170     exit(0);
00171 #endif
00172 
00173     _depura("END BulmaTPV::closeEvent", 0);
00174 }
00175 
00176 
00178 
00181 QWorkspace2 * BulmaTPV::workspace() {
00182     _depura("BulmaTPV::workspace", 0);
00183     _depura("END BulmaTPV::workspace", 0);
00184     return pWorkspace;
00185 }
00186 
00187 
00188 void BulmaTPV::keyPressEvent ( QKeyEvent * e ) {
00189         m_empresaTPV->keyPressEvent(e);
00190 }
00191 
00192 
00193 EmpresaTPV *BulmaTPV::empresaTPV() {
00194         return m_empresaTPV;
00195 }
00196 

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