Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- OMPlot is a MDI application now. You can switch between tabbedview …
…and subwindowview through the menu. - Only one instance of OMPlot is allowed at a time. The active window with in the OMPlot application recieves the new plot commands from omc. - New icon for OMPlot. - few more updates as well. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8451 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Showing
15 changed files
with
434 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-CurrentYear, Linkoping University, | ||
* Department of Computer and Information Science, | ||
* SE-58183 Linkoping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 | ||
* AND THIS OSMC PUBLIC LICENSE (OSMC-PL). | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S | ||
* ACCEPTANCE OF THE OSMC PUBLIC LICENSE. | ||
* | ||
* The OpenModelica software and the Open Source Modelica | ||
* Consortium (OSMC) Public License (OSMC-PL) are obtained | ||
* from Linkoping University, either from the above address, | ||
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or | ||
* http://www.openmodelica.org, and in the OpenModelica distribution. | ||
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH | ||
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS | ||
* OF OSMC-PL. | ||
* | ||
* See the full OSMC Public License conditions for more details. | ||
* | ||
* Main Author 2011: Adeel Asghar | ||
* | ||
*/ | ||
|
||
#include "PlotMainWindow.h" | ||
|
||
using namespace OMPlot; | ||
|
||
PlotMainWindow::PlotMainWindow(QWidget *pParent) | ||
: QMainWindow(pParent) | ||
{ | ||
mpPlotWindowContainer = new PlotWindowContainer(this); | ||
|
||
setWindowTitle(tr("OMPlot - OpenModelica Plot")); | ||
setWindowIcon(QIcon(":/Resources/icons/omplot.png")); | ||
|
||
createActions(); | ||
createMenus(); | ||
|
||
//Create the Statusbar | ||
mpStatusBar = new QStatusBar(); | ||
mpStatusBar->setObjectName("statusBar"); | ||
setStatusBar(mpStatusBar); | ||
// set plotwindowcontainer as central widget | ||
setCentralWidget(mpPlotWindowContainer); | ||
} | ||
|
||
PlotWindowContainer* PlotMainWindow::getPlotWindowContainer() | ||
{ | ||
return mpPlotWindowContainer; | ||
} | ||
|
||
void PlotMainWindow::addPlotWindow(QStringList arguments) | ||
{ | ||
mpPlotWindowContainer->addPlotWindow(arguments); | ||
} | ||
|
||
void PlotMainWindow::createActions() | ||
{ | ||
mpCloseAction = new QAction(tr("Close"), this); | ||
mpCloseAction->setShortcut(QKeySequence("Ctrl+q")); | ||
connect(mpCloseAction, SIGNAL(triggered()), SLOT(close())); | ||
|
||
mpTabViewAction = new QAction(tr("Tab View"), this); | ||
mpTabViewAction->setCheckable(true); | ||
mpTabViewAction->setChecked(true); | ||
connect(mpTabViewAction, SIGNAL(triggered(bool)), SLOT(switchWindowsView(bool))); | ||
} | ||
|
||
void PlotMainWindow::createMenus() | ||
{ | ||
//Create the menubar | ||
mpMenuBar = new QMenuBar(); | ||
mpMenuBar->setGeometry(QRect(0,0,800,25)); | ||
mpMenuBar->setObjectName("menubar"); | ||
|
||
//Create the File menu | ||
mpMenuFile = new QMenu(mpMenuBar); | ||
mpMenuFile->setObjectName("menuFile"); | ||
mpMenuFile->setTitle("&File"); | ||
//Add the actions to file menu | ||
mpMenuFile->addAction(mpCloseAction); | ||
// add file menu to menubar | ||
mpMenuBar->addAction(mpMenuFile->menuAction()); | ||
//Create the Options menu | ||
mpMenuOptions = new QMenu(mpMenuBar); | ||
mpMenuOptions->setObjectName("menuFile"); | ||
mpMenuOptions->setTitle("&Options"); | ||
//Add the actions to Options menu | ||
mpMenuOptions->addAction(mpTabViewAction); | ||
// add options menu to menubar | ||
mpMenuBar->addAction(mpMenuOptions->menuAction()); | ||
// add menubar to mainwindow | ||
setMenuBar(mpMenuBar); | ||
} | ||
|
||
void PlotMainWindow::switchWindowsView(bool mode) | ||
{ | ||
if (mode) | ||
{ | ||
getPlotWindowContainer()->setViewMode(QMdiArea::TabbedView); | ||
} | ||
else | ||
{ | ||
getPlotWindowContainer()->setViewMode(QMdiArea::SubWindowView); | ||
getPlotWindowContainer()->getCurrentWindow()->show(); | ||
} | ||
} |
Oops, something went wrong.