Rev 2012 | Rev 2040 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1195 | fschmid | 1 | #include "tabtools.h" |
2 | #include "tabtools.moc" |
||
3 | #include <qtooltip.h> |
||
4 | #include <qspinbox.h> |
||
5 | #include "units.h" |
||
6 | #include "mspinbox.h" |
||
7 | #include "linecombo.h" |
||
8 | #include "fontcombo.h" |
||
9 | #include "polygonwidget.h" |
||
10 | #include "arrowchooser.h" |
||
11 | #include "linkbutton.h" |
||
12 | #include "scribusstructs.h" |
||
13 | #include "scribus.h" |
||
14 | extern QPixmap loadIcon(QString nam); |
||
15 | extern QPixmap fontSamples(QString da, int s, QString ts, QColor back); |
||
16 | extern ScribusApp* ScApp; |
||
17 | |||
1790 | cbradney | 18 | TabTools::TabTools( QWidget* parent, struct toolPrefs *prefsData, int unitIndex, ScribusDoc* doc) : QWidget( parent, "tabtools", 0 ) |
1195 | fschmid | 19 | { |
1790 | cbradney | 20 | unit = unitGetSuffixFromIndex(unitIndex); |
21 | precision = unitGetPrecisionFromIndex(unitIndex); |
||
22 | unitRatio = unitGetRatioFromIndex(unitIndex); |
||
23 | |||
1195 | fschmid | 24 | fon = &ScApp->Prefs.AvailFonts; |
1878 | cbradney | 25 | tabToolsLayout = new QHBoxLayout( this, 0, 5, "tabToolsLayout"); |
1195 | fschmid | 26 | buttonGroupTools = new QButtonGroup( this, "buttonGroupTools" ); |
27 | buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) ); |
||
28 | buttonGroupTools->setExclusive( true ); |
||
29 | buttonGroupTools->setRadioButtonExclusive( true ); |
||
30 | buttonGroupTools->setColumnLayout(0, Qt::Vertical ); |
||
31 | buttonGroupTools->layout()->setSpacing( 5 ); |
||
32 | buttonGroupTools->layout()->setMargin( 5 ); |
||
33 | buttonGroupTools->setTitle( QString::null ); |
||
34 | buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() ); |
||
35 | buttonGroupToolsLayout->setAlignment( Qt::AlignTop ); |
||
36 | toolText = new QToolButton( buttonGroupTools, "toolText" ); |
||
37 | toolText->setToggleButton( true ); |
||
38 | toolText->setText( QString::null ); |
||
39 | toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) ); |
||
40 | buttonGroupToolsLayout->addWidget( toolText ); |
||
41 | toolImage = new QToolButton( buttonGroupTools, "toolImage" ); |
||
42 | toolImage->setToggleButton( true ); |
||
43 | toolImage->setText( QString::null ); |
||
44 | toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) ); |
||
45 | buttonGroupToolsLayout->addWidget( toolImage ); |
||
46 | toolShape = new QToolButton( buttonGroupTools, "toolShape" ); |
||
47 | toolShape->setToggleButton( true ); |
||
48 | toolShape->setText( QString::null ); |
||
49 | toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) ); |
||
50 | buttonGroupToolsLayout->addWidget( toolShape); |
||
51 | toolPoly = new QToolButton( buttonGroupTools, "toolPoly" ); |
||
52 | toolPoly->setToggleButton( true ); |
||
53 | toolPoly->setText( QString::null ); |
||
54 | toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) ); |
||
55 | buttonGroupToolsLayout->addWidget( toolPoly ); |
||
56 | toolLine = new QToolButton( buttonGroupTools, "toolLine" ); |
||
57 | toolLine->setToggleButton( true ); |
||
58 | toolLine->setText( QString::null ); |
||
59 | toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) ); |
||
60 | buttonGroupToolsLayout->addWidget( toolLine ); |
||
61 | toolZoom = new QToolButton( buttonGroupTools, "toolZoom" ); |
||
62 | toolZoom->setToggleButton( true ); |
||
63 | toolZoom->setText( QString::null ); |
||
64 | toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) ); |
||
65 | buttonGroupToolsLayout->addWidget( toolZoom ); |
||
66 | tabToolsLayout->addWidget( buttonGroupTools ); |
||
67 | subStackTools = new QWidgetStack( this, "subStackTools" ); |
||
68 | subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) ); |
||
69 | subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel ); |
||
70 | subStackTools->setFrameShadow( QWidgetStack::Sunken ); |
||
71 | |||
72 | subTabText = new QWidget( subStackTools, "subTabText" ); |
||
73 | subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout"); |
||
74 | fontComboText = new FontCombo(subTabText, &ScApp->Prefs); |
||
75 | for (int fc=0; fc<fontComboText->count(); ++fc) |
||
76 | { |
||
77 | if (fontComboText->text(fc) == prefsData->defFont) |
||
78 | { |
||
79 | fontComboText->setCurrentItem(fc); |
||
80 | break; |
||
81 | } |
||
82 | } |
||
83 | subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3, Qt::AlignLeft ); |
||
84 | textLabel1b = new QLabel( fontComboText, tr( "Font:" ), subTabText, "textLabel1b" ); |
||
85 | subTabTextLayout->addWidget( textLabel1b, 0, 0 ); |
||
86 | sizeComboText = new QComboBox( true, subTabText, "SizeCombo" ); |
||
87 | sizeComboText->setEditable(false); |
||
88 | QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"}; |
||
89 | size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes); |
||
90 | for (uint s = 0; s < f_size; ++s) |
||
91 | sizeComboText->insertItem(ar_sizes[s] + tr(" pt")); |
||
92 | for (int a = 0; a < sizeComboText->count(); ++a) |
||
93 | { |
||
94 | if (sizeComboText->text(a).left(2).toInt() == prefsData->defSize / 10) |
||
95 | sizeComboText->setCurrentItem(a); |
||
96 | } |
||
97 | subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3, Qt::AlignLeft ); |
||
98 | textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" ); |
||
99 | subTabTextLayout->addWidget( textLabel2b, 1, 0 ); |
||
100 | colorComboText = new QComboBox( true, subTabText, "colorComboText" ); |
||
101 | colorComboText->setEditable(false); |
||
102 | QPixmap pmT2; |
||
103 | pmT2 = QPixmap(15, 15); |
||
104 | ColorList::Iterator itc; |
||
105 | colorComboText->insertItem( tr("None")); |
||
106 | if (prefsData->dPenText == "None") |
||
107 | colorComboText->setCurrentItem(colorComboText->count()-1); |
||
108 | if (doc != 0) |
||
109 | { |
||
110 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
111 | { |
||
112 | pmT2.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
113 | colorComboText->insertItem(pmT2, itc.key()); |
||
114 | if (itc.key() == prefsData->dPenText) |
||
115 | colorComboText->setCurrentItem(colorComboText->count()-1); |
||
116 | } |
||
117 | } |
||
118 | else |
||
119 | { |
||
120 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
121 | { |
||
122 | pmT2.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
123 | colorComboText->insertItem(pmT2, itc.key()); |
||
124 | if (itc.key() == prefsData->dPenText) |
||
125 | colorComboText->setCurrentItem(colorComboText->count()-1); |
||
126 | } |
||
127 | } |
||
128 | subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3, Qt::AlignLeft ); |
||
129 | textLabel3b = new QLabel(colorComboText, tr( "Fill Color:" ), subTabText, "textLabel3b" ); |
||
130 | subTabTextLayout->addWidget( textLabel3b, 2, 0 ); |
||
131 | colorComboStrokeText = new QComboBox( true, subTabText, "colorComboStrokeText" ); |
||
132 | colorComboStrokeText->setEditable(false); |
||
133 | colorComboStrokeText->insertItem( tr("None")); |
||
134 | if (prefsData->dStrokeText == "None") |
||
135 | colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1); |
||
136 | if (doc != 0) |
||
137 | { |
||
138 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
139 | { |
||
140 | pmT2.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
141 | colorComboStrokeText->insertItem(pmT2, itc.key()); |
||
142 | if (itc.key() == prefsData->dStrokeText) |
||
143 | colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1); |
||
144 | } |
||
145 | } |
||
146 | else |
||
147 | { |
||
148 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
149 | { |
||
150 | pmT2.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
151 | colorComboStrokeText->insertItem(pmT2, itc.key()); |
||
152 | if (itc.key() == prefsData->dStrokeText) |
||
153 | colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1); |
||
154 | } |
||
155 | } |
||
156 | subTabTextLayout->addMultiCellWidget( colorComboStrokeText, 3, 3, 1, 3, Qt::AlignLeft ); |
||
157 | textLabel3b2 = new QLabel(colorComboStrokeText, tr( "Stroke Color:" ), subTabText, "textLabel3b2" ); |
||
158 | subTabTextLayout->addWidget( textLabel3b2, 3, 0 ); |
||
159 | columnsText = new QSpinBox( subTabText, "columnsText" ); |
||
160 | columnsText->setMinValue( 1 ); |
||
161 | columnsText->setMaxValue(100); |
||
162 | columnsText->setValue(prefsData->dCols); |
||
163 | subTabTextLayout->addWidget( columnsText, 4, 1, Qt::AlignLeft ); |
||
164 | textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol"); |
||
165 | subTabTextLayout->addWidget( textLabel4b, 4, 0 ); |
||
1790 | cbradney | 166 | gapText = new MSpinBox( 0, 200, subTabText, precision ); |
1195 | fschmid | 167 | gapText->setSuffix( unit ); |
1790 | cbradney | 168 | gapText->setValue(prefsData->dGap * unitRatio); |
1195 | fschmid | 169 | subTabTextLayout->addWidget( gapText, 4, 3, Qt::AlignLeft ); |
170 | textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol"); |
||
171 | subTabTextLayout->addWidget( textLabel5b, 4, 2 ); |
||
172 | previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" ); |
||
173 | previewText->setMinimumSize( QSize( 280, 70 ) ); |
||
174 | previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) ); |
||
175 | subTabTextLayout->addMultiCellWidget( previewText, 5, 5, 0, 3 ); |
||
176 | subStackTools->addWidget( subTabText, 0 ); |
||
177 | |||
178 | subTabShape = new QWidget( subStackTools, "subTabShape" ); |
||
179 | subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout"); |
||
180 | subTabShapeLayout->setAlignment( Qt::AlignTop ); |
||
181 | colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" ); |
||
182 | colorComboLineShape->setEditable(false); |
||
183 | colorComboLineShape->insertItem( tr("None")); |
||
184 | if (prefsData->dPen == "None") |
||
185 | colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1); |
||
186 | QPixmap pm2S = QPixmap(15, 15); |
||
187 | if (doc != 0) |
||
188 | { |
||
189 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
190 | { |
||
191 | pm2S.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
192 | colorComboLineShape->insertItem(pm2S, itc.key()); |
||
193 | if (itc.key() == prefsData->dPen) |
||
194 | colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1); |
||
195 | } |
||
196 | } |
||
197 | else |
||
198 | { |
||
199 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
200 | { |
||
201 | pm2S.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
202 | colorComboLineShape->insertItem(pm2S, itc.key()); |
||
203 | if (itc.key() == prefsData->dPen) |
||
204 | colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1); |
||
205 | } |
||
206 | } |
||
207 | subTabShapeLayout->addWidget( colorComboLineShape, 0, 1, Qt::AlignLeft ); |
||
208 | textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" ); |
||
209 | subTabShapeLayout->addWidget( textLabel7b, 0, 0 ); |
||
210 | shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" ); |
||
211 | shadingLineShape->setMaxValue( 100 ); |
||
212 | shadingLineShape->setSuffix( tr( " %" ) ); |
||
213 | shadingLineShape->setMinValue( 0 ); |
||
214 | shadingLineShape->setValue(prefsData->dShade2); |
||
215 | subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft ); |
||
216 | textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" ); |
||
217 | subTabShapeLayout->addWidget( textLabel8b, 1, 0 ); |
||
218 | comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" ); |
||
219 | comboFillShape->setEditable(false); |
||
220 | comboFillShape->insertItem( tr("None")); |
||
221 | if (prefsData->dBrush == "None") |
||
222 | comboFillShape->setCurrentItem(comboFillShape->count()-1); |
||
223 | if (doc != 0) |
||
224 | { |
||
225 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
226 | { |
||
227 | pm2S.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
228 | comboFillShape->insertItem(pm2S, itc.key()); |
||
229 | if (itc.key() == prefsData->dBrush) |
||
230 | comboFillShape->setCurrentItem(comboFillShape->count()-1); |
||
231 | } |
||
232 | } |
||
233 | else |
||
234 | { |
||
235 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
236 | { |
||
237 | pm2S.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
238 | comboFillShape->insertItem(pm2S, itc.key()); |
||
239 | if (itc.key() == prefsData->dBrush) |
||
240 | comboFillShape->setCurrentItem(comboFillShape->count()-1); |
||
241 | } |
||
242 | } |
||
243 | subTabShapeLayout->addWidget( comboFillShape, 2, 1, Qt::AlignLeft ); |
||
244 | textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" ); |
||
245 | subTabShapeLayout->addWidget( textLabel9b, 2, 0 ); |
||
246 | shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" ); |
||
247 | shadingFillShape->setMaxValue( 100 ); |
||
248 | shadingFillShape->setSuffix( tr( " %" ) ); |
||
249 | shadingFillShape->setMinValue( 0 ); |
||
250 | shadingFillShape->setValue(prefsData->dShade); |
||
251 | subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft ); |
||
252 | textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" ); |
||
253 | subTabShapeLayout->addWidget( textLabel10b, 3, 0 ); |
||
254 | comboStyleShape = new LineCombo(subTabShape); |
||
255 | comboStyleShape->setEditable(false); |
||
256 | switch (prefsData->dLineArt) |
||
257 | { |
||
258 | case SolidLine: |
||
259 | comboStyleShape->setCurrentItem(0); |
||
260 | break; |
||
261 | case DashLine: |
||
262 | comboStyleShape->setCurrentItem(1); |
||
263 | break; |
||
264 | case DotLine: |
||
265 | comboStyleShape->setCurrentItem(2); |
||
266 | break; |
||
267 | case DashDotLine: |
||
268 | comboStyleShape->setCurrentItem(3); |
||
269 | break; |
||
270 | case DashDotDotLine: |
||
271 | comboStyleShape->setCurrentItem(4); |
||
272 | break; |
||
273 | default: |
||
274 | comboStyleShape->setCurrentItem(0); |
||
275 | break; |
||
276 | } |
||
277 | subTabShapeLayout->addWidget( comboStyleShape, 4, 1, Qt::AlignLeft ); |
||
278 | textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" ); |
||
279 | subTabShapeLayout->addWidget( textLabel11b, 4, 0 ); |
||
280 | lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 ); |
||
281 | lineWidthShape->setSuffix( tr( " pt" ) ); |
||
282 | lineWidthShape->setValue(prefsData->dWidth); |
||
283 | subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft ); |
||
284 | textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" ); |
||
285 | subTabShapeLayout->addWidget( textLabel12b, 5, 0 ); |
||
286 | subStackTools->addWidget( subTabShape, 1 ); |
||
287 | |||
288 | subTabLine = new QWidget( subStackTools, "subTabLine" ); |
||
289 | subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout"); |
||
290 | subTabLineLayout->setAlignment( Qt::AlignTop ); |
||
291 | colorComboLine = new QComboBox( true, subTabLine, "colorComboLine" ); |
||
292 | colorComboLine->setEditable(false); |
||
293 | QPixmap pm2L = QPixmap(15, 15); |
||
294 | colorComboLine->insertItem( tr("None")); |
||
295 | if (prefsData->dPenLine == "None") |
||
296 | colorComboLine->setCurrentItem(colorComboLine->count()-1); |
||
297 | if (doc != 0) |
||
298 | { |
||
299 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
300 | { |
||
301 | pm2L.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
302 | colorComboLine->insertItem(pm2L, itc.key()); |
||
303 | if (itc.key() == prefsData->dPenLine) |
||
304 | colorComboLine->setCurrentItem(colorComboLine->count()-1); |
||
305 | } |
||
306 | } |
||
307 | else |
||
308 | { |
||
309 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
310 | { |
||
311 | pm2L.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
312 | colorComboLine->insertItem(pm2L, itc.key()); |
||
313 | if (itc.key() == prefsData->dPenLine) |
||
314 | colorComboLine->setCurrentItem(colorComboLine->count()-1); |
||
315 | } |
||
316 | } |
||
317 | subTabLineLayout->addMultiCellWidget( colorComboLine, 0, 0, 1, 2, Qt::AlignLeft ); |
||
318 | textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" ); |
||
319 | subTabLineLayout->addWidget( textLabel13b, 0, 0 ); |
||
320 | shadingLine = new QSpinBox( subTabLine, "shadingLine" ); |
||
321 | shadingLine->setMaxValue( 100 ); |
||
322 | shadingLine->setValue(prefsData->dShadeLine); |
||
323 | shadingLine->setSuffix( tr( " %" ) ); |
||
324 | subTabLineLayout->addMultiCellWidget( shadingLine, 1, 1, 1, 2, Qt::AlignLeft ); |
||
325 | textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" ); |
||
326 | subTabLineLayout->addWidget( textLabel14b, 1, 0 ); |
||
327 | comboStyleLine = new LineCombo(subTabLine); |
||
328 | comboStyleLine->setEditable(false); |
||
329 | switch (prefsData->dLstyleLine) |
||
330 | { |
||
331 | case SolidLine: |
||
332 | comboStyleLine->setCurrentItem(0); |
||
333 | break; |
||
334 | case DashLine: |
||
335 | comboStyleLine->setCurrentItem(1); |
||
336 | break; |
||
337 | case DotLine: |
||
338 | comboStyleLine->setCurrentItem(2); |
||
339 | break; |
||
340 | case DashDotLine: |
||
341 | comboStyleLine->setCurrentItem(3); |
||
342 | break; |
||
343 | case DashDotDotLine: |
||
344 | comboStyleLine->setCurrentItem(4); |
||
345 | break; |
||
346 | default: |
||
347 | comboStyleLine->setCurrentItem(0); |
||
348 | break; |
||
349 | } |
||
350 | subTabLineLayout->addMultiCellWidget( comboStyleLine, 2, 2, 1, 2, Qt::AlignLeft ); |
||
351 | textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" ); |
||
352 | subTabLineLayout->addWidget( textLabel15b, 2, 0 ); |
||
353 | startArrow = new ArrowChooser(subTabLine, true); |
||
354 | subTabLineLayout->addWidget( startArrow, 4, 1 ); |
||
355 | endArrow = new ArrowChooser(subTabLine, false); |
||
356 | subTabLineLayout->addWidget( endArrow, 4, 2 ); |
||
357 | if (doc != 0) |
||
358 | { |
||
359 | startArrow->rebuildList(&doc->arrowStyles); |
||
360 | endArrow->rebuildList(&doc->arrowStyles); |
||
361 | } |
||
362 | else |
||
363 | { |
||
364 | startArrow->rebuildList(&ScApp->Prefs.arrowStyles); |
||
365 | endArrow->rebuildList(&ScApp->Prefs.arrowStyles); |
||
366 | } |
||
367 | startArrow->setCurrentItem(prefsData->dStartArrow); |
||
368 | endArrow->setCurrentItem(prefsData->dEndArrow); |
||
369 | arrowText = new QLabel( tr( "Arrows:" ), subTabLine, "arrowText" ); |
||
370 | subTabLineLayout->addMultiCellWidget( arrowText, 3, 4, 0, 0 ); |
||
371 | startArrowText = new QLabel( startArrow, tr( "Start:" ), subTabLine, "startArrowText" ); |
||
372 | subTabLineLayout->addWidget( startArrowText, 3, 1 ); |
||
373 | endArrowText = new QLabel( endArrow, tr( "End:" ), subTabLine, "endArrowText" ); |
||
374 | subTabLineLayout->addWidget( endArrowText, 3, 2 ); |
||
375 | lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 ); |
||
376 | lineWidthLine->setSuffix( tr( " pt" ) ); |
||
377 | lineWidthLine->setValue(prefsData->dWidthLine); |
||
378 | subTabLineLayout->addMultiCellWidget( lineWidthLine, 5, 5, 1, 2, Qt::AlignLeft ); |
||
379 | textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" ); |
||
380 | subTabLineLayout->addWidget( textLabel16b, 5, 0 ); |
||
381 | subStackTools->addWidget( subTabLine, 2 ); |
||
382 | |||
383 | subTabImage = new QWidget( subStackTools, "subTabImage" ); |
||
384 | subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout"); |
||
385 | subTabImageLayout->setAlignment( Qt::AlignTop ); |
||
386 | buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" ); |
||
387 | buttonGroup3->setCheckable( true ); |
||
388 | buttonGroup3->setChecked( prefsData->scaleType ); |
||
389 | buttonGroup3->setColumnLayout(0, Qt::Vertical ); |
||
390 | buttonGroup3->layout()->setSpacing( 6 ); |
||
391 | buttonGroup3->layout()->setMargin( 11 ); |
||
392 | buttonGroup3->setTitle( tr( "&Free Scaling" ) ); |
||
393 | buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() ); |
||
394 | buttonGroup3Layout->setAlignment( Qt::AlignTop ); |
||
395 | scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" ); |
||
396 | scalingHorizontal->setMaxValue( 1000 ); |
||
397 | scalingHorizontal->setMinValue( 1 ); |
||
398 | scalingHorizontal->setValue(qRound(prefsData->scaleX * 100)); |
||
399 | scalingHorizontal->setSuffix( tr( " %" ) ); |
||
400 | buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight ); |
||
401 | textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" ); |
||
402 | buttonGroup3Layout->addWidget( textLabel17b, 0, 0 ); |
||
403 | scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" ); |
||
404 | scalingVertical->setMaxValue( 1000 ); |
||
405 | scalingVertical->setMinValue( 1 ); |
||
406 | scalingVertical->setSuffix( tr( " %" ) ); |
||
407 | scalingVertical->setValue(qRound(prefsData->scaleY * 100)); |
||
408 | buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight ); |
||
409 | textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" ); |
||
410 | buttonGroup3Layout->addWidget( textLabel18b, 1, 0 ); |
||
411 | chainButton = new LinkButton( buttonGroup3 ); |
||
412 | chainButton->setToggleButton( true ); |
||
413 | chainButton->setAutoRaise(true); |
||
414 | buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft ); |
||
415 | subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 ); |
||
416 | buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" ); |
||
417 | buttonGroup5->setCheckable( true ); |
||
418 | buttonGroup5->setChecked( !prefsData->scaleType ); |
||
419 | buttonGroup5->setColumnLayout(0, Qt::Vertical ); |
||
420 | buttonGroup5->layout()->setSpacing( 6 ); |
||
421 | buttonGroup5->layout()->setMargin( 11 ); |
||
422 | buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) ); |
||
423 | buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() ); |
||
424 | buttonGroup5Layout->setAlignment( Qt::AlignTop ); |
||
425 | checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" ); |
||
426 | checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) ); |
||
427 | checkRatioImage->setChecked(prefsData->aspectRatio); |
||
428 | buttonGroup5Layout->addWidget( checkRatioImage ); |
||
429 | subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 ); |
||
430 | comboFillImage = new QComboBox( true, subTabImage, "comboFillImage" ); |
||
431 | comboFillImage->setEditable(false); |
||
432 | QPixmap pm2I = QPixmap(15, 15); |
||
433 | comboFillImage->insertItem( tr("None")); |
||
434 | if (prefsData->dBrushPict == "None") |
||
435 | comboFillImage->setCurrentItem(comboFillImage->count()-1); |
||
436 | if (doc != 0) |
||
437 | { |
||
438 | for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc) |
||
439 | { |
||
440 | pm2I.fill(doc->PageColors[itc.key()].getRGBColor()); |
||
441 | comboFillImage->insertItem(pm2I, itc.key()); |
||
442 | if (itc.key() == prefsData->dBrushPict) |
||
443 | comboFillImage->setCurrentItem(comboFillImage->count()-1); |
||
444 | } |
||
445 | } |
||
446 | else |
||
447 | { |
||
448 | for (itc = ScApp->Prefs.DColors.begin(); itc != ScApp->Prefs.DColors.end(); ++itc) |
||
449 | { |
||
450 | pm2I.fill(ScApp->Prefs.DColors[itc.key()].getRGBColor()); |
||
451 | comboFillImage->insertItem(pm2I, itc.key()); |
||
452 | if (itc.key() == prefsData->dBrushPict) |
||
453 | comboFillImage->setCurrentItem(comboFillImage->count()-1); |
||
454 | } |
||
455 | } |
||
456 | subTabImageLayout->addWidget( comboFillImage, 2, 1, Qt::AlignLeft ); |
||
457 | textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" ); |
||
458 | subTabImageLayout->addWidget( textLabel19b, 2, 0 ); |
||
459 | shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" ); |
||
460 | shadingFillImage->setMaxValue( 100 ); |
||
461 | shadingFillImage->setValue( prefsData->shadePict ); |
||
462 | shadingFillImage->setSuffix( tr( " %" ) ); |
||
463 | subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft ); |
||
464 | textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" ); |
||
465 | subTabImageLayout->addWidget( textLabel20b, 3, 0 ); |
||
2025 | fschmid | 466 | buttonGroupRes = new QButtonGroup( subTabImage, "buttonGroup3" ); |
467 | buttonGroupRes->setColumnLayout(0, Qt::Vertical ); |
||
468 | buttonGroupRes->layout()->setSpacing( 6 ); |
||
469 | buttonGroupRes->layout()->setMargin( 11 ); |
||
470 | buttonGroupRes->setExclusive( true ); |
||
471 | buttonGroupRes->setTitle( tr( "On Screen Preview" ) ); |
||
472 | buttonGroupResLayout = new QVBoxLayout( buttonGroupRes->layout() ); |
||
473 | buttonGroupResLayout->setAlignment( Qt::AlignTop ); |
||
474 | checkFullRes = new QRadioButton( buttonGroupRes, "checkFullRes" ); |
||
475 | checkFullRes->setText( tr( "Full Resolution Preview" ) ); |
||
476 | buttonGroupResLayout->addWidget( checkFullRes ); |
||
477 | checkNormalRes = new QRadioButton( buttonGroupRes, "checkNormalRes" ); |
||
478 | checkNormalRes->setText( tr( "Normal Resolution Preview" ) ); |
||
479 | buttonGroupResLayout->addWidget( checkNormalRes ); |
||
480 | checkHalfRes = new QRadioButton( buttonGroupRes, "checkHalfRes" ); |
||
2012 | fschmid | 481 | checkHalfRes->setText( tr( "Low Resolution Preview" ) ); |
2025 | fschmid | 482 | buttonGroupResLayout->addWidget( checkHalfRes ); |
483 | switch (prefsData->lowResType) |
||
484 | { |
||
485 | case 0: |
||
486 | checkFullRes->setChecked(true); |
||
487 | break; |
||
488 | case 1: |
||
489 | checkNormalRes->setChecked(true); |
||
490 | break; |
||
491 | case 2: |
||
492 | checkHalfRes->setChecked(true); |
||
493 | break; |
||
494 | } |
||
495 | subTabImageLayout->addMultiCellWidget( buttonGroupRes, 4, 4, 0, 1 ); |
||
1195 | fschmid | 496 | subStackTools->addWidget( subTabImage, 3 ); |
497 | |||
498 | subTabPolygon = new QWidget( subStackTools, "subTabPolygon" ); |
||
499 | subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout"); |
||
500 | subTabPolygonLayout->setAlignment( Qt::AlignTop ); |
||
501 | polyWidget = new PolygonWidget(subTabPolygon, prefsData->polyC, prefsData->polyFd, prefsData->polyF, prefsData->polyS, prefsData->polyR); |
||
502 | subTabPolygonLayout->addWidget( polyWidget ); |
||
503 | subStackTools->addWidget( subTabPolygon, 4 ); |
||
504 | |||
505 | subTabZoom = new QWidget( subStackTools, "subTabZoom" ); |
||
506 | subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout"); |
||
507 | subTabZoomLayout->setAlignment( Qt::AlignTop ); |
||
508 | minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" ); |
||
509 | minimumZoom->setMaxValue( 3200 ); |
||
510 | minimumZoom->setMinValue( 10 ); |
||
511 | minimumZoom->setValue(prefsData->magMin); |
||
512 | minimumZoom->setSuffix( tr( " %" ) ); |
||
513 | subTabZoomLayout->addWidget( minimumZoom, 0, 1, Qt::AlignLeft ); |
||
514 | textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" ); |
||
515 | subTabZoomLayout->addWidget( textLabel21b, 0, 0); |
||
516 | maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" ); |
||
517 | maximumZoom->setMaxValue( 3200 ); |
||
518 | maximumZoom->setMinValue( 10 ); |
||
519 | maximumZoom->setValue(prefsData->magMax); |
||
520 | maximumZoom->setSuffix( tr( " %" ) ); |
||
521 | subTabZoomLayout->addWidget( maximumZoom, 1, 1, Qt::AlignLeft ); |
||
522 | textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" ); |
||
523 | subTabZoomLayout->addWidget( textLabel22b, 1, 0 ); |
||
524 | zoomStep = new QSpinBox( subTabZoom, "zoomStep" ); |
||
525 | zoomStep->setMaxValue( 200 ); |
||
526 | zoomStep->setMinValue( 1 ); |
||
527 | zoomStep->setLineStep( 25 ); |
||
528 | zoomStep->setValue( prefsData->magStep ); |
||
529 | zoomStep->setSuffix( tr( " %" ) ); |
||
530 | subTabZoomLayout->addWidget( zoomStep, 2, 1, Qt::AlignLeft ); |
||
531 | textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" ); |
||
532 | subTabZoomLayout->addWidget( textLabel23b, 2, 0 ); |
||
533 | subStackTools->addWidget( subTabZoom, 5 ); |
||
534 | tabToolsLayout->addWidget( subStackTools ); |
||
535 | toolText->setOn(true); |
||
536 | setSample(); |
||
537 | QToolTip::add( toolText, tr( "Text Frame Properties" ) ); |
||
538 | QToolTip::add( toolImage, tr( "Picture Frame Properties" ) ); |
||
539 | QToolTip::add( toolShape, tr( "Shape Drawing Properties" ) ); |
||
540 | QToolTip::add( toolZoom, tr( "Magnification Level Defaults" ) ); |
||
541 | QToolTip::add( toolLine, tr( "Line Drawing Properties" ) ); |
||
542 | QToolTip::add( toolPoly, tr( "Polygon Drawing Properties" ) ); |
||
543 | QToolTip::add( fontComboText, tr( "Font for new text frames" ) ); |
||
544 | QToolTip::add( sizeComboText, tr( "Size of font for new text frames" ) ); |
||
545 | QToolTip::add( colorComboText, tr( "Color of font" ) ); |
||
546 | QToolTip::add( columnsText, tr( "Number of columns in a text frame" ) ); |
||
547 | QToolTip::add( gapText, tr( "Gap between text frame columns" ) ); |
||
548 | QToolTip::add( previewText, tr( "Sample of your font" ) ); |
||
549 | QToolTip::add( buttonGroup3, tr( "Picture frames allow pictures to scale to any size" ) ); |
||
550 | QToolTip::add( scalingHorizontal, tr( "Horizontal scaling of images" ) ); |
||
551 | QToolTip::add( scalingVertical, tr( "Vertical scaling of images" ) ); |
||
552 | QToolTip::add( chainButton, tr( "Keep horizontal and vertical scaling the same" ) ); |
||
553 | QToolTip::add( buttonGroup5, tr( "Pictures in picture frames are scaled to the size of the frame" ) ); |
||
554 | QToolTip::add( checkRatioImage, tr( "Automatically scaled pictures keep their original proportions" ) ); |
||
555 | QToolTip::add( comboFillImage, tr( "Fill color of picture frames" ) ); |
||
556 | QToolTip::add( shadingFillImage, tr( "Saturation of color of fill" ) ); |
||
557 | QToolTip::add( colorComboLineShape, tr( "Line color of shapes" ) ); |
||
558 | QToolTip::add( shadingLineShape, tr( "Saturation of color of lines" ) ); |
||
559 | QToolTip::add( comboFillShape, tr( "Fill color of shapes" ) ); |
||
560 | QToolTip::add( shadingFillShape, tr( "Saturation of color of fill" ) ); |
||
561 | QToolTip::add( comboStyleShape, tr( "Line style of shapes" ) ); |
||
562 | QToolTip::add( lineWidthShape, tr( "Line width of shapes" ) ); |
||
563 | QToolTip::add( minimumZoom, tr( "Minimum magnification allowed" ) ); |
||
564 | QToolTip::add( maximumZoom, tr( "Maximum magnification allowed" ) ); |
||
565 | QToolTip::add( zoomStep, tr( "Change in magnification for each zoom operation" ) ); |
||
566 | QToolTip::add( colorComboLine, tr( "Color of lines" ) ); |
||
567 | QToolTip::add( shadingLine, tr( "Saturation of color" ) ); |
||
568 | QToolTip::add( comboStyleLine, tr( "Style of lines" ) ); |
||
569 | QToolTip::add( lineWidthLine, tr( "Width of lines" ) ); |
||
570 | connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool())); |
||
571 | connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool())); |
||
572 | connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool())); |
||
573 | connect(toolText, SIGNAL(clicked()), this, SLOT(setTool())); |
||
574 | connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool())); |
||
575 | connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool())); |
||
576 | connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample())); |
||
577 | connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample())); |
||
578 | connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int))); |
||
579 | connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int))); |
||
580 | connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain())); |
||
581 | connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange())); |
||
582 | connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange())); |
||
583 | } |
||
584 | |||
1828 | fschmid | 585 | void TabTools::restoreDefaults() |
586 | { |
||
587 | } |
||
588 | |||
1195 | fschmid | 589 | /*! |
590 | \fn void TabTools::ToggleKette() |
||
591 | \author Franz Schmid |
||
592 | \date |
||
593 | \brief TabTools (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled |
||
594 | \param None |
||
595 | \retval None |
||
596 | */ |
||
597 | void TabTools::toggleChain() |
||
598 | { |
||
599 | if (chainButton->isOn()) |
||
600 | scalingVertical->setValue(scalingHorizontal->value()); |
||
601 | } |
||
602 | |||
603 | /*! |
||
604 | \fn void TabTools::HChange() |
||
605 | \author Franz Schmid |
||
606 | \date |
||
607 | \brief TabTools (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed |
||
608 | \param None |
||
609 | \retval None |
||
610 | */ |
||
611 | void TabTools::hChange() |
||
612 | { |
||
613 | if (chainButton->isOn()) |
||
614 | scalingVertical->setValue(scalingHorizontal->value()); |
||
615 | } |
||
616 | |||
617 | /*! |
||
618 | \fn void TabTools::vChange() |
||
619 | \author Franz Schmid |
||
620 | \date |
||
621 | \brief TabTools (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed |
||
622 | \param None |
||
623 | \retval None |
||
624 | */ |
||
625 | void TabTools::vChange() |
||
626 | { |
||
627 | if (chainButton->isOn()) |
||
628 | scalingHorizontal->setValue(scalingVertical->value()); |
||
629 | } |
||
630 | |||
631 | void TabTools::changeImageScalingFree(int) |
||
632 | { |
||
633 | if (buttonGroup3->isChecked()) |
||
634 | buttonGroup5->setChecked(false); |
||
635 | else |
||
636 | buttonGroup5->setChecked(true); |
||
637 | } |
||
638 | |||
639 | void TabTools::changeImageScalingRatio(int) |
||
640 | { |
||
641 | if (buttonGroup5->isChecked()) |
||
642 | buttonGroup3->setChecked(false); |
||
643 | else |
||
644 | buttonGroup3->setChecked(true); |
||
645 | } |
||
646 | |||
647 | /*! |
||
648 | \fn void TabTools::SetSample() |
||
649 | \author Franz Schmid |
||
650 | \date |
||
651 | \brief TabTools (Tools, Text frame), Sets the sample text in selected font in text frame preferences |
||
652 | \param None |
||
653 | \retval None |
||
654 | */ |
||
655 | void TabTools::setSample() |
||
656 | { |
||
657 | QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" ); |
||
658 | QString da = (*fon)[fontComboText->currentText()]->Datei; |
||
659 | int s = sizeComboText->currentText().left(2).toInt(); |
||
660 | QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor()); |
||
661 | previewText->setPixmap(pm); |
||
662 | } |
||
663 | |||
664 | /*! |
||
665 | \fn void TabTools::SetTool() |
||
666 | \author Franz Schmid |
||
667 | \date |
||
668 | \brief TabTools (Tools), Raises widget for selected Tool properties |
||
669 | \param None |
||
670 | \retval None |
||
671 | */ |
||
672 | void TabTools::setTool() |
||
673 | { |
||
674 | if (toolText == sender()) |
||
675 | subStackTools->raiseWidget(0); |
||
676 | if (toolShape == sender()) |
||
677 | subStackTools->raiseWidget(1); |
||
678 | if (toolLine == sender()) |
||
679 | subStackTools->raiseWidget(2); |
||
680 | if (toolImage == sender()) |
||
681 | subStackTools->raiseWidget(3); |
||
682 | if (toolPoly == sender()) |
||
683 | subStackTools->raiseWidget(4); |
||
684 | if (toolZoom == sender()) |
||
685 | subStackTools->raiseWidget(5); |
||
686 | } |