| [bcf653] | 1 | /*
|
|---|
| 2 | * Project: MoleCuilder
|
|---|
| 3 | * Description: creates and alters molecular systems
|
|---|
| 4 | * Copyright (C) 2010 University of Bonn. All rights reserved.
|
|---|
| 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| [3027f8] | 8 | /*
|
|---|
| [4cf323d] | 9 | * QtMainWindow.cpp
|
|---|
| [3027f8] | 10 | *
|
|---|
| 11 | * Created on: Jan 14, 2010
|
|---|
| 12 | * Author: crueger
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| [bf3817] | 15 | // include config.h
|
|---|
| 16 | #ifdef HAVE_CONFIG_H
|
|---|
| 17 | #include <config.h>
|
|---|
| 18 | #endif
|
|---|
| [bbbad5] | 19 |
|
|---|
| [4cf323d] | 20 | #include "QtMainWindow.hpp"
|
|---|
| [3027f8] | 21 |
|
|---|
| [8f67e2] | 22 | #include<Qt/qapplication.h>
|
|---|
| [fa27ed] | 23 | #include<Qt/qlabel.h>
|
|---|
| 24 | #include<Qt/qstring.h>
|
|---|
| 25 | #include<Qt/qmenubar.h>
|
|---|
| [cef1d7] | 26 | #include<Qt/qsplitter.h>
|
|---|
| [8f67e2] | 27 |
|
|---|
| [3027f8] | 28 | #include<iostream>
|
|---|
| [b2531f] | 29 | #include<map>
|
|---|
| 30 |
|
|---|
| [fa27ed] | 31 | #include<boost/bind.hpp>
|
|---|
| 32 |
|
|---|
| [bbbad5] | 33 | #include "Helpers/MemDebug.hpp"
|
|---|
| 34 |
|
|---|
| [fa27ed] | 35 | #include "atom.hpp"
|
|---|
| 36 | #include "molecule.hpp"
|
|---|
| [952f38] | 37 | #include "Helpers/Verbose.hpp"
|
|---|
| [b2531f] | 38 | #include "Actions/Action.hpp"
|
|---|
| 39 | #include "Actions/ActionRegistry.hpp"
|
|---|
| [e4afb4] | 40 | #include "Actions/ValueStorage.hpp"
|
|---|
| [4cf323d] | 41 | #include "Menu/Qt4/QtMenu.hpp"
|
|---|
| 42 | #include "Views/Qt4/QtWorldView.hpp"
|
|---|
| 43 | #include "Views/Qt4/GLMoleculeView.hpp"
|
|---|
| 44 | #include "Views/Qt4/QtMoleculeView.hpp"
|
|---|
| 45 | #include "Views/Qt4/QtStatusBar.hpp"
|
|---|
| [3027f8] | 46 |
|
|---|
| [4cf323d] | 47 | QtMainWindow::QtMainWindow(QApplication *_theApp) :
|
|---|
| [8f67e2] | 48 | theApp(_theApp)
|
|---|
| [fa27ed] | 49 | {
|
|---|
| [cef1d7] | 50 | QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
|
|---|
| 51 | QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
|
|---|
| 52 |
|
|---|
| [4cf323d] | 53 | worldDisplay = new QtWorldView(splitter2);
|
|---|
| [cef1d7] | 54 |
|
|---|
| [4cf323d] | 55 | moleculeDisplay = new QtMoleculeView();
|
|---|
| [cef1d7] | 56 | molecule3dDisplay = new GLMoleculeView();
|
|---|
| 57 |
|
|---|
| [b59da6] | 58 | MainMenu = new QtMenu<QMenuBar>(menuBar(), "");
|
|---|
| 59 | MainMenu->init();
|
|---|
| [b80021] | 60 |
|
|---|
| [cef1d7] | 61 | setCentralWidget(splitter1);
|
|---|
| 62 | splitter1->addWidget(splitter2);
|
|---|
| [a77c96] | 63 | splitter1->addWidget(moleculeDisplay);
|
|---|
| [cef1d7] | 64 | splitter2->addWidget(molecule3dDisplay);
|
|---|
| [63b56a7] | 65 | splitter2->addWidget(worldDisplay);
|
|---|
| [cef1d7] | 66 |
|
|---|
| [4cf323d] | 67 | statusBar = new QtStatusBar(this);
|
|---|
| [326a43b] | 68 | setStatusBar(statusBar);
|
|---|
| [fa27ed] | 69 |
|
|---|
| [a77c96] | 70 | connect(worldDisplay,SIGNAL(moleculeSelected(molecule*)),moleculeDisplay,SLOT(moleculeSelected(molecule*)));
|
|---|
| 71 | connect(worldDisplay,SIGNAL(moleculeUnSelected(molecule*)),moleculeDisplay,SLOT(moleculeUnSelected(molecule*)));
|
|---|
| [fa27ed] | 72 | }
|
|---|
| [3027f8] | 73 |
|
|---|
| [4cf323d] | 74 | QtMainWindow::~QtMainWindow()
|
|---|
| [992fd7] | 75 | {
|
|---|
| 76 | menuBar()->clear();
|
|---|
| 77 | }
|
|---|
| [3027f8] | 78 |
|
|---|
| [4cf323d] | 79 | void QtMainWindow::display() {
|
|---|
| [8f67e2] | 80 | this->show();
|
|---|
| 81 | theApp->exec();
|
|---|
| [3027f8] | 82 | }
|
|---|
| [b2531f] | 83 |
|
|---|