COPASI API
4.16.103
Main Page
Namespaces
Classes
Files
File List
File Members
copasi
layoutUI
FontChooser.cpp
Go to the documentation of this file.
1
// Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2
// Properties, Inc., University of Heidelberg, and The University
3
// of Manchester.
4
// All rights reserved.
5
6
// Qt headers
7
#include <QtCore/QString>
8
9
// global headers
10
#include <assert.h>
11
12
// global copasi headers
13
#include "
copasi/copasi.h
"
14
15
// local copasi headers
16
#include "
FontChooser.h
"
17
#include "
CQLayoutMainWindow.h
"
18
#include "
CQGLNetworkPainter.h
"
19
20
FontChooser::FontChooser
(QWidget* parent ,
bool
modal , Qt::WindowFlags
fl
)
21
: QDialog(parent, fl)
22
{
23
setupUi(
this
);
24
this->setModal(modal);
25
QString className = QString(parentWidget()->metaObject()->className());
26
27
if
(className ==
"CQLayoutMainWindow"
)
28
{
29
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
30
assert(tmp);
31
32
if
(tmp)
33
{
34
C_INT32
currentFontSize = (
C_INT32
)(tmp->
getFontSize
());
35
spinBox1->setValue(currentFontSize);
36
}
37
}
38
else
if
(className ==
"CQGLNetworkPainter"
)
39
{
40
CQGLNetworkPainter
* tmp =
dynamic_cast<
CQGLNetworkPainter
*
>
(parentWidget());
41
assert(tmp);
42
43
if
(tmp)
44
{
45
C_INT32
currentFontSize = (
C_INT32
)(tmp->
getFontSize
());
46
spinBox1->setValue(currentFontSize);
47
}
48
}
49
}
50
51
void
FontChooser::changeFontSize
()
52
{
53
QString className = QString(parentWidget()->metaObject()->className());
54
C_INT32
val = spinBox1->value();
55
56
if
(className ==
"CQLayoutMainWindow"
)
57
{
58
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
59
assert(tmp);
60
61
if
(tmp)
62
tmp->
setFontSizeForLabels
(val);
63
}
64
else
if
(className ==
"CQGLNetworkPainter"
)
// check for another possible parent window
65
{
66
CQGLNetworkPainter
* tmp =
dynamic_cast<
CQGLNetworkPainter
*
>
(parentWidget());
67
assert(tmp);
68
69
if
(tmp)
70
tmp->
setFontSizeForLabels
((
unsigned
int
) val);
71
}
72
}
73
74
void
FontChooser::cancel
()
75
{
76
close();
77
}
CQLayoutMainWindow::setFontSizeForLabels
void setFontSizeForLabels(C_INT32 size)
Definition:
CQLayoutMainWindow.cpp:643
CQLayoutMainWindow
Definition:
CQLayoutMainWindow.h:51
FontChooser::cancel
void cancel()
Definition:
FontChooser.cpp:74
FontChooser::changeFontSize
void changeFontSize()
Definition:
FontChooser.cpp:51
C_INT32
#define C_INT32
Definition:
copasi.h:90
FontChooser.h
CQGLNetworkPainter
Definition:
CQGLNetworkPainter.h:62
copasi.h
CQGLNetworkPainter::getFontSize
C_INT16 getFontSize()
Definition:
CQGLNetworkPainter.h:126
CQLayoutMainWindow::getFontSize
C_INT16 getFontSize()
Definition:
CQLayoutMainWindow.cpp:222
CQGLNetworkPainter::setFontSizeForLabels
void setFontSizeForLabels(unsigned int fs)
Definition:
CQGLNetworkPainter.cpp:2823
CQLayoutMainWindow.h
fl
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
Definition:
CTrajectoryTask.cpp:48
FontChooser::FontChooser
FontChooser(QWidget *parent=0, bool modal=false, Qt::WindowFlags fl=0)
Definition:
FontChooser.cpp:20
CQGLNetworkPainter.h
Generated on Thu Jul 2 2015 14:50:42 for COPASI API by
1.8.6