Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henrik Eriksson committed Apr 27, 2007
1 parent f32c8d0 commit 1bebf35
Show file tree
Hide file tree
Showing 27 changed files with 3,124 additions and 1,268 deletions.
104 changes: 81 additions & 23 deletions OMNotebook/Pltpkg2/LegendLabel.h
@@ -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
61 changes: 55 additions & 6 deletions OMNotebook/Pltpkg2/Pltpkg2.vcproj
Expand Up @@ -76,7 +76,7 @@
InlineFunctionExpansion="2"
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="c:\Qt\4.2.1-vc\include\QtCore,c:\Qt\4.2.1-vc\include\QtCore,c:\Qt\4.2.1-vc\include\QtGui,c:\Qt\4.2.1-vc\include\QtGui,c:\Qt\4.2.1-vc\include,.,c:\Qt\4.2.1-vc\include\ActiveQt,release,.,..\..\..\..\Qt\4.2.1-vc\mkspecs\win32-msvc.net"
AdditionalIncludeDirectories="&quot;$(QTHOME)\include\QtCore&quot;;&quot;$(QTHOME)\include\QtGui&quot;;&quot;$(QTHOME)\include&quot;;.;&quot;$(QTHOME)\include\ActiveQt&quot;;release;&quot;$(QTHOME)\mkspecs\win32-msvc.net&quot;"
PreprocessorDefinitions="NDEBUG,_WINDOWS,UNICODE,QT_LARGEFILE_SUPPORT,WIN32,QT_DLL,QT_NO_DEBUG,QT_GUI_LIB,QT_CORE_LIB,QT_THREAD_SUPPORT"
GeneratePreprocessedFile="0"
ExceptionHandling="TRUE"
Expand Down Expand Up @@ -126,6 +126,9 @@
<File
RelativePath="compoundWidget.cpp">
</File>
<File
RelativePath=".\curve.cpp">
</File>
<File
RelativePath="dataSelect.cpp">
</File>
Expand All @@ -135,6 +138,9 @@
<File
RelativePath="graphWindow.cpp">
</File>
<File
RelativePath=".\legendLabel.cpp">
</File>
<File
RelativePath="line2D.cpp">
</File>
Expand Down Expand Up @@ -169,18 +175,18 @@
</FileConfiguration>
</File>
<File
RelativePath="debug\moc_graphWidget.cpp">
RelativePath="release\moc_graphWidget.cpp">
<FileConfiguration
Name="Release|Win32"
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="release\moc_graphWidget.cpp">
RelativePath="debug\moc_graphWidget.cpp">
<FileConfiguration
Name="Debug|Win32"
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
Expand All @@ -205,7 +211,10 @@
</FileConfiguration>
</File>
<File
RelativePath=".\release\moc_preferenceWindow.cpp">
RelativePath=".\debug\moc_legendLabel.cpp">
</File>
<File
RelativePath=".\debug\moc_preferenceWindow.cpp">
</File>
<File
RelativePath="Point.cpp">
Expand Down Expand Up @@ -243,6 +252,14 @@
Outputs="release\moc_compoundWidget.cpp"/>
</FileConfiguration>
</File>
<File
RelativePath=".\curve.h">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"/>
</FileConfiguration>
</File>
<File
RelativePath="dataSelect.h">
</File>
Expand Down Expand Up @@ -295,8 +312,29 @@
Outputs="release\moc_graphWindow.cpp"/>
</FileConfiguration>
</File>
<File
RelativePath=".\label.h">
</File>
<File
RelativePath=".\LegendLabel.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="c:\Qt\4.2.1-vc\bin\moc.exe -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include&quot; -I &quot;.&quot; -I &quot;C:\Qt\4.2.1-vc\include\ActiveQt&quot; -I &quot;debug&quot; -I &quot;.&quot; -I&quot;..\..\..\..\Qt\4.2.1-vc\mkspecs\win32-msvc.net&quot; legendLabel.h -o debug\moc_legendLabel.cpp
"
AdditionalDependencies="c:\Qt\4.2.1-vc\bin\moc.exe"
Outputs="debug\moc_legendLabel.cpp"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="c:\Qt\4.2.1-vc\bin\moc.exe -DNDEBUG -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include&quot; -I &quot;.&quot; -I &quot;C:\Qt\4.2.1-vc\include\ActiveQt&quot; -I &quot;release&quot; -I &quot;.&quot; -I&quot;..\..\..\..\Qt\4.2.1-vc\mkspecs\win32-msvc.net&quot; legendLabel.h -o release\moc_legendLabel.cpp
"
AdditionalDependencies="c:\Qt\4.2.1-vc\bin\moc.exe"
Outputs="release\moc_legendLabel.cpp"/>
</FileConfiguration>
</File>
<File
RelativePath="line2D.h">
Expand All @@ -309,6 +347,17 @@
</File>
<File
RelativePath=".\preferenceWindow.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="MOC preferenceWindow.h"
CommandLine="c:\Qt\4.2.1-vc\bin\moc.exe -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtCore&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include\QtGui&quot; -I &quot;C:\Qt\4.2.1-vc\include&quot; -I &quot;.&quot; -I &quot;C:\Qt\4.2.1-vc\include\ActiveQt&quot; -I &quot;debug&quot; -I &quot;.&quot; -I&quot;..\..\..\..\Qt\4.2.1-vc\mkspecs\win32-msvc.net&quot; preferenceWindow.h -o debug\moc_preferenceWindow.cpp
"
AdditionalDependencies="c:\Qt\4.2.1-vc\bin\moc.exe"
Outputs="debug\moc_preferenceWindow.cpp"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Expand Down

0 comments on commit 1bebf35

Please sign in to comment.