Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2783 f25d…
…12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Henrik Eriksson
committed
Apr 27, 2007
1 parent
f32c8d0
commit 1bebf35
Showing
27 changed files
with
3,124 additions
and
1,268 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 |
---|---|---|
@@ -1,48 +1,106 @@ | ||
/* | ||
------------------------------------------------------------------------------------ | ||
This file is part of OpenModelica. | ||
Copyright (c) 1998-2006, Linköpings universitet, | ||
Department of Computer and Information Science, PELAB | ||
See also: www.ida.liu.se/projects/OpenModelica | ||
All rights reserved. | ||
(The new BSD license, see also | ||
http://www.opensource.org/licenses/bsd-license.php) | ||
Redistribution and use in source and binary forms, with or without | ||
modification, | ||
are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name of Linköpings universitet nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
For more information about the Qt-library visit TrollTech:s webpage regarding | ||
licence: http://www.trolltech.com/products/qt/licensing.html | ||
------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
#ifndef LEGENDLABEL_H | ||
#define LEGENDLABEL_H | ||
|
||
//Qt headers | ||
#include <QLabel> | ||
#include <QString> | ||
#include <QColor> | ||
using namespace std; | ||
#include <QMenu> | ||
#include <QPainter> | ||
#include <QAction> | ||
#include <QMessageBox> | ||
|
||
//IAEX headers | ||
#include "curve.h" | ||
#include "point.h" | ||
|
||
using namespace std; | ||
|
||
class LegendLabel: public QLabel | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
LegendLabel(QColor color_, QString& s, QWidget* parent): QLabel(s, parent) | ||
{ | ||
color = color_; | ||
LegendLabel(QColor color_, QString& s, QWidget* parent); | ||
~LegendLabel(); | ||
|
||
} | ||
~LegendLabel() | ||
void setCurve(Curve* c) | ||
{ | ||
|
||
curve = c; | ||
} | ||
|
||
protected: | ||
signals: | ||
void showLine(bool); | ||
void showPoints(bool); | ||
|
||
void paintEvent ( QPaintEvent * event ) | ||
{ | ||
public slots: | ||
void setLineVisible(bool b); | ||
void setPointsVisible(bool b); | ||
void selectColor(); | ||
|
||
QPainter painter(this); | ||
painter.setPen(Qt::black); | ||
painter.setBrush(color); | ||
painter.setRenderHints(QPainter::Antialiasing); | ||
painter.drawEllipse(1, 1, max(0,height()-2), max(0,height()-2)); | ||
|
||
// setIndent(height()+2); | ||
protected: | ||
void paintEvent ( QPaintEvent * event ); | ||
|
||
QLabel::paintEvent(event); | ||
void resizeEvent ( QResizeEvent * event ) | ||
{ | ||
setIndent(height() +2); | ||
} | ||
|
||
void resizeEvent ( QResizeEvent * event ) | ||
{ | ||
setIndent(height() +2); | ||
} | ||
public: | ||
void render(QPainter* painter, QPointF pos = QPointF()); | ||
|
||
private: | ||
QColor color; | ||
QMenu *menu; | ||
Curve* curve; | ||
bool state; | ||
}; | ||
|
||
|
||
#endif |
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.