Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qt
CanvasSettings.cxx
Go to the documentation of this file.
1
12
#include "
CanvasSettings.h
"
13
14
#include <qspinbox.h>
15
#include <qcheckbox.h>
16
#include <qradiobutton.h>
17
18
using namespace
hippodraw;
19
20
// #if QT_VERSION < 0x040000
21
CanvasSettings::
22
CanvasSettings
(
QWidget
* parent,
23
const
char
* name,
24
bool
modal,
25
Qt::WFlags flags )
26
:
CanvasSettingsBase
( parent, name, modal, flags )
27
{
28
// #else
29
// CanvasSettings::
30
// CanvasSettings ( QWidget * parent )
31
// : QDialog ( parent )
32
// {
33
// setupUi ( this );
34
// #endif
35
}
36
37
void
38
CanvasSettings::
39
cancel
()
40
{
41
done
(
CanvasSettings::Rejected
);
42
}
43
44
void
45
CanvasSettings::
46
saveRetile
()
47
{
48
done
(
CanvasSettings::AcceptedAndRetile
);
49
}
50
51
void
52
CanvasSettings::
53
retile_clicked
()
54
{
55
done
(
CanvasSettings::Retile
);
56
}
57
58
int
59
CanvasSettings::
60
getWidthNumber
()
const
61
{
62
return
m_h_spin
-> value();
63
}
64
65
void
66
CanvasSettings::
67
setWidthNumber
(
int
number )
68
{
69
m_h_spin
-> setValue ( number );
70
}
71
72
int
73
CanvasSettings::
74
getHeightNumber
()
const
75
{
76
return
m_v_spin
-> value();
77
}
78
79
void
80
CanvasSettings::
81
setHeightNumber
(
int
number )
82
{
83
m_v_spin
-> setValue ( number );
84
}
85
86
void
87
CanvasSettings::
88
portraitRadioButton_toggled
(
bool
)
89
{
90
orientationChanged
();
91
}
92
93
void
94
CanvasSettings::
95
orientationChanged
()
96
{
97
int
vSpinNumber =
getHeightNumber
();
98
int
hSpinNumber =
getWidthNumber
();
99
100
setHeightNumber
( hSpinNumber );
101
setWidthNumber
( vSpinNumber );
102
103
}
104
105
QPrinter::Orientation
106
CanvasSettings::orientation
()
107
{
108
if
(
portraitRadioButton
-> isChecked() ) {
109
return
QPrinter::Portrait;
110
}
111
else
{
112
return
QPrinter::Landscape;
113
}
114
115
return
QPrinter::Portrait;
116
}
117
118
void
CanvasSettings::setOrientation
( QPrinter::Orientation orientation )
119
{
120
if
( orientation == QPrinter::Portrait ) {
121
portraitRadioButton
-> setChecked(
true
);
122
}
123
else
{
124
landscapeRadioButton
-> setChecked(
true
);
125
}
126
}
127
128
bool
CanvasSettings::printerBounds
()
129
{
130
return
m_visibleMarginRadioButton
-> isChecked();
131
}
132
133
void
CanvasSettings::setPrinterBounds
(
bool
flag )
134
{
135
if
( flag ==
true
)
136
m_visibleMarginRadioButton
-> setChecked(
true
);
137
else
138
m_invisibleMarginRadioButton
-> setChecked(
true
);
139
}
140
141
bool
142
CanvasSettings::
143
getAddSelected
()
const
144
{
145
return
m_add_selected
-> isChecked ();
146
}
147
148
void
149
CanvasSettings::
150
setAddSelected
(
bool
yes )
151
{
152
m_add_selected
-> setChecked ( yes );
153
}
154
155
bool
156
CanvasSettings::
157
ignorePrinterMargin
()
const
158
{
159
return
ignore_margin
-> isChecked ();
160
}
161
162
void
163
CanvasSettings::
164
setIgnorePrinterMargin
(
bool
yes )
165
{
166
ignore_margin
-> setChecked ( yes );
167
}
Generated for HippoDraw Class Library by