Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
302 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR | ||
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, | ||
* ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the Open Source Modelica | ||
* Consortium (OSMC) Public License (OSMC-PL) are obtained | ||
* from OSMC, 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. | ||
* | ||
*/ | ||
/* | ||
* @author Adeel Asghar <adeel.asghar@liu.se> | ||
*/ | ||
|
||
#include "AnimationWindowContainer.h" | ||
|
||
|
||
/*! | ||
\class AnimationWindowContainer | ||
\brief A MDI area for animation windows. | ||
*/ | ||
/*! | ||
* \brief AnimationWindowContainer::AnimationWindowContainer | ||
* \param pParent | ||
*/ | ||
AnimationWindowContainer::AnimationWindowContainer(MainWindow *pParent) | ||
: MdiArea(pParent) | ||
{ | ||
if (mpMainWindow->getOptionsDialog()->getAnimationPage()->getAnimationViewMode().compare(Helper::subWindow) == 0) { | ||
setViewMode(QMdiArea::SubWindowView); | ||
} else { | ||
setViewMode(QMdiArea::TabbedView); | ||
} | ||
// dont show this widget at startup | ||
setVisible(false); | ||
} | ||
|
||
/*! | ||
* \brief AnimationWindowContainer::getUniqueName | ||
* Returns a unique name for new animation window. | ||
* \param name | ||
* \param number | ||
* \return | ||
*/ | ||
QString AnimationWindowContainer::getUniqueName(QString name, int number) | ||
{ | ||
QString newName; | ||
newName = name + QString::number(number); | ||
|
||
foreach (QMdiSubWindow *pWindow, subWindowList()) { | ||
if (pWindow->widget()->windowTitle().compare(newName) == 0) { | ||
newName = getUniqueName(name, ++number); | ||
break; | ||
} | ||
} | ||
return newName; | ||
} | ||
|
||
|
||
|
||
|
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,50 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR | ||
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, | ||
* ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the Open Source Modelica | ||
* Consortium (OSMC) Public License (OSMC-PL) are obtained | ||
* from OSMC, 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. | ||
* | ||
*/ | ||
/* | ||
* @author Adeel Asghar <adeel.asghar@liu.se> | ||
*/ | ||
|
||
#ifndef ANIMATIONWINDOWCONTAINER_H | ||
#define ANIMATIONWINDOWCONTAINER_H | ||
|
||
#include "MainWindow.h" | ||
|
||
class MainWindow; | ||
|
||
class AnimationWindowContainer : public MdiArea | ||
{ | ||
Q_OBJECT | ||
public: | ||
AnimationWindowContainer(MainWindow *pParent); | ||
QString getUniqueName(QString name = QString("Animation"), int number = 4); | ||
}; | ||
|
||
#endif // ANIMATIONWINDOWCONTAINER_H |
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
Oops, something went wrong.