Subversion Repositories Scribus

Rev

Rev 731 | Rev 735 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 paul 1
#include "reformdoc.h"
2
#include "reformdoc.moc"
249 Franz 3
#include <qtooltip.h>
705 fschmid 4
#include <qcolordialog.h>
726 fschmid 5
#include "fontcombo.h"
731 fschmid 6
#include "polygonwidget.h"
3 paul 7
extern QPixmap loadIcon(QString nam);
726 fschmid 8
extern QPixmap fontSamples(QString da, int s, QString ts, QColor back);
80 Franz 9
extern double UmReFaktor;
3 paul 10
 
726 fschmid 11
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc, preV *prefsData ) : PrefsDialogBase( parent )
3 paul 12
{
693 fschmid 13
        einheit = doc->Einheit;
734 fschmid 14
        docc = doc;
726 fschmid 15
        fon = &prefsData->AvailFonts;
734 fschmid 16
        Umrech = UmReFaktor;
274 Franz 17
        QString units[] = { tr(" pt"), tr(" mm"), tr(" in"), tr(" p")};
693 fschmid 18
        QString ein = units[doc->Einheit];
274 Franz 19
        int dp[] = {100, 1000, 10000, 100};
734 fschmid 20
        decimals = dp[doc->Einheit];
519 cbradney 21
        int i=-1;
726 fschmid 22
        pageWidth = doc->PageB * UmReFaktor;
23
        pageHeight = doc->PageH * UmReFaktor;
249 Franz 24
        setCaption( tr( "Document Setup" ) );
693 fschmid 25
        tabPage = new QWidget( prefsWidgets, "tab" );
26
        ReformDocLayout = new QVBoxLayout( tabPage );
249 Franz 27
        ReformDocLayout->setSpacing( 6 );
28
        ReformDocLayout->setMargin( 10 );
693 fschmid 29
        dsGroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
519 cbradney 30
        dsGroupBox7->setTitle( tr( "Page Size" ) );
31
        dsGroupBox7->setColumnLayout(0, Qt::Vertical );
32
        dsGroupBox7->layout()->setSpacing( 0 );
33
        dsGroupBox7->layout()->setMargin( 0 );
34
        dsGroupBox7Layout = new QHBoxLayout( dsGroupBox7->layout() );
35
        dsGroupBox7Layout->setAlignment( Qt::AlignTop );
36
        dsGroupBox7Layout->setSpacing( 0 );
37
        dsGroupBox7Layout->setMargin( 10 );
38
        dsLayout4 = new QGridLayout;
39
        dsLayout4->setSpacing( 6 );
40
        dsLayout4->setMargin( 0 );
693 fschmid 41
        sizeQComboBox = new QComboBox( true, dsGroupBox7, "sizeQComboBox" );
42
        sizeQLabel = new QLabel( sizeQComboBox, tr( "&Size:" ), dsGroupBox7, "sizeQLabel" );
43
        QString sizelist[] = {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4",
44
                              "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio",
45
                              "Ledger", tr("Legal"), tr("Letter"), tr("Tabloid"), tr("Custom")};
46
        size_t const num_mappings = (sizeof sizelist)/(sizeof *sizelist);
47
        for (uint m = 0; m < num_mappings; ++m)
48
        {
49
                sizeQComboBox->insertItem(sizelist[m]);
50
                if (sizelist[m]==doc->PageSize)
519 cbradney 51
                        i=m;
52
        }
53
        //set Custom if we dont have one already as old docs wont have this attribute
54
        if (i==-1)
55
                i=num_mappings-1;
693 fschmid 56
        sizeQComboBox->setEnabled(false);
57
        sizeQComboBox->setCurrentItem(i);
58
        dsLayout4->addWidget( sizeQLabel, 0, 0 );
59
        dsLayout4->addWidget( sizeQComboBox, 0, 1 );
60
        orientationQComboBox = new QComboBox( true, dsGroupBox7, "orientationQComboBox" );
61
        orientationQLabel = new QLabel( orientationQComboBox, tr( "Orie&ntation:" ), dsGroupBox7, "orientationQLabel" );
62
        orientationQComboBox->insertItem( tr( "Portrait" ) );
63
        orientationQComboBox->insertItem( tr( "Landscape" ) );
64
        orientationQComboBox->setEnabled(false);
65
        orientationQComboBox->setCurrentItem(doc->PageOri);
66
        dsLayout4->addWidget( orientationQLabel, 0, 2 );
519 cbradney 67
        dsLayout4->addWidget( orientationQComboBox, 0, 3 );
693 fschmid 68
        widthMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
69
        widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
70
        widthMSpinBox->setEnabled( false );
71
        widthMSpinBox->setSuffix(ein);
726 fschmid 72
        widthMSpinBox->setValue(pageWidth);
693 fschmid 73
        widthQLabel->setBuddy(widthMSpinBox);
74
        dsLayout4->addWidget( widthQLabel, 1, 0 );
75
        dsLayout4->addWidget( widthMSpinBox, 1, 1 );
76
        heightMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
77
        heightQLabel = new QLabel( tr( "&Height:" ), dsGroupBox7, "heightLabel" );
78
        heightMSpinBox->setEnabled( false );
79
        heightMSpinBox->setSuffix(ein);
726 fschmid 80
        heightMSpinBox->setValue(pageHeight);
693 fschmid 81
        heightQLabel->setBuddy(heightMSpinBox);
82
        dsLayout4->addWidget( heightQLabel, 1, 2 );
83
        dsLayout4->addWidget( heightMSpinBox, 1, 3 );
519 cbradney 84
        dsGroupBox7Layout->addLayout( dsLayout4 );
85
        ReformDocLayout->addWidget( dsGroupBox7 );
693 fschmid 86
        GroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
249 Franz 87
        GroupBox7->setTitle( tr( "Margin Guides" ) );
88
        GroupBox7->setColumnLayout(0, Qt::Vertical );
89
        GroupBox7->layout()->setSpacing( 0 );
90
        GroupBox7->layout()->setMargin( 0 );
91
        GroupBox7Layout = new QHBoxLayout( GroupBox7->layout() );
92
        GroupBox7Layout->setAlignment( Qt::AlignTop );
93
        GroupBox7Layout->setSpacing( 0 );
94
        GroupBox7Layout->setMargin( 10 );
95
        Layout4 = new QGridLayout;
96
        Layout4->setSpacing( 6 );
97
        Layout4->setMargin( 0 );
726 fschmid 98
        topR = new MSpinBox( GroupBox7, 4 );
99
        topR->setSuffix( ein );
100
        topR->setDecimals( decimals );
101
        topR->setMaxValue(pageHeight);
102
        topR->setValue(doc->PageM.Top * UmReFaktor);
103
        Layout4->addWidget( topR, 0, 1 );
340 Franz 104
        TextLabel5 = new QLabel( tr( "&Top:" ), GroupBox7, "TextLabel5" );
726 fschmid 105
        TextLabel5->setBuddy(topR);
340 Franz 106
        Layout4->addWidget( TextLabel5, 0, 0 );
726 fschmid 107
        leftR = new MSpinBox( GroupBox7, 4 );
108
        leftR->setSuffix( ein );
109
        leftR->setDecimals( decimals );
110
        leftR->setMaxValue(pageWidth);
111
        leftR->setValue(doc->PageM.Left * UmReFaktor);
112
        Layout4->addWidget( leftR, 0, 3 );
340 Franz 113
        Links = new QLabel( tr( "&Left:" ), GroupBox7, "Links" );
726 fschmid 114
        Links->setBuddy(leftR);
340 Franz 115
        Layout4->addWidget( Links, 0, 2 );
726 fschmid 116
        bottomR = new MSpinBox( GroupBox7, 4 );
117
        bottomR->setSuffix( ein );
118
        bottomR->setDecimals( decimals );
119
        bottomR->setMaxValue(pageHeight);
120
        bottomR->setValue(doc->PageM.Bottom * UmReFaktor);
121
        Layout4->addWidget( bottomR, 1, 1 );
340 Franz 122
        TextLabel7 = new QLabel( tr( "&Bottom:" ), GroupBox7, "TextLabel7" );
726 fschmid 123
        TextLabel7->setBuddy(bottomR);
340 Franz 124
        Layout4->addWidget( TextLabel7, 1, 0 );
726 fschmid 125
        rightR = new MSpinBox( GroupBox7, 4 );
126
        rightR->setSuffix( ein );
127
        rightR->setDecimals( decimals );
128
        rightR->setMaxValue(pageWidth);
129
        rightR->setValue(doc->PageM.Right * UmReFaktor);
130
        Layout4->addWidget( rightR, 1, 3 );
340 Franz 131
        Rechts = new QLabel( tr( "&Right:" ), GroupBox7, "Rechts" );
726 fschmid 132
        Rechts->setBuddy(rightR);
340 Franz 133
        Layout4->addWidget( Rechts, 1, 2 );
734 fschmid 134
        GroupBox7Layout->addLayout( Layout4 );
135
        ReformDocLayout->addWidget( GroupBox7 );
136
        GroupBox7a = new QGroupBox( tabPage, "GroupBox7" );
137
        GroupBox7a->setTitle( tr( "Layout" ) );
138
        GroupBox7a->setColumnLayout(0, Qt::Vertical );
139
        GroupBox7a->layout()->setSpacing( 0 );
140
        GroupBox7a->layout()->setMargin( 0 );
141
        GroupBox7aLayout = new QHBoxLayout( GroupBox7a->layout() );
142
        GroupBox7aLayout->setAlignment( Qt::AlignTop );
143
        GroupBox7aLayout->setSpacing( 0 );
144
        GroupBox7aLayout->setMargin( 10 );
145
        Layout4a = new QGridLayout;
146
        Layout4a->setSpacing( 6 );
147
        Layout4a->setMargin( 0 );
148
        facingPages = new QCheckBox( tr( "&Facing Pages" ),GroupBox7a, "facingPages" );
726 fschmid 149
        facingPages->setChecked( doc->PageFP );
734 fschmid 150
        Layout4a->addMultiCellWidget( facingPages, 2, 2, 0, 1 );
151
        firstPage = new QCheckBox( tr( "Left &Page First" ), GroupBox7a, "n" );
726 fschmid 152
        firstPage->setChecked( doc->FirstPageLeft );
734 fschmid 153
        Layout4a->addMultiCellWidget( firstPage, 2, 2, 2, 3 );
693 fschmid 154
        if (!doc->PageFP)
726 fschmid 155
                firstPage->setEnabled(false);
249 Franz 156
        setDS();
734 fschmid 157
        TextLabel1_3 = new QLabel( tr( "F&irst Page Number:" ), GroupBox7a, "TextLabel1_3" );
158
        Layout4a->addMultiCellWidget( TextLabel1_3, 3, 3, 0, 1 );
159
        pageNumber = new QSpinBox( GroupBox7a, "pageNumber" );
726 fschmid 160
        pageNumber->setMaxValue( 10000 );
161
        pageNumber->setMinValue( 1 );
162
        pageNumber->setValue(doc->FirstPnum);
734 fschmid 163
        Layout4a->addWidget( pageNumber, 3, 2, Qt::AlignRight );
726 fschmid 164
        TextLabel1_3->setBuddy(pageNumber);
734 fschmid 165
        GroupBox7aLayout->addLayout( Layout4a );
166
        ReformDocLayout->addWidget( GroupBox7a );
715 fschmid 167
        addItem( tr("Page"), loadIcon("page.png"), tabPage);
693 fschmid 168
 
705 fschmid 169
        tabGuides = new QWidget( prefsWidgets, "tabView" );
170
        tabGuidesLayout = new QVBoxLayout( tabGuides, 10, 5, "tabViewLayout");
171
        checkGrid = new QGroupBox( tabGuides, "checkGrid" );
172
        checkGrid->setTitle( tr( "ShowGrid" ) );
173
        checkGrid->setCheckable( TRUE );
174
        checkGrid->setChecked(doc->GridShown);
175
        checkGrid->setColumnLayout(0, Qt::Vertical );
176
        checkGrid->layout()->setSpacing( 5 );
177
        checkGrid->layout()->setMargin( 10 );
178
        checkGridLayout = new QGridLayout( checkGrid->layout() );
179
        checkGridLayout->setAlignment( Qt::AlignTop );
180
        groupBox1 = new QGroupBox( checkGrid, "groupBox1" );
181
        groupBox1->setColumnLayout(0, Qt::Vertical );
182
        groupBox1->layout()->setSpacing( 5 );
183
        groupBox1->layout()->setMargin( 10 );
184
        groupBox1->setTitle( tr( "Major Grid" ) );
185
        groupBox1Layout = new QGridLayout( groupBox1->layout() );
186
        groupBox1Layout->setAlignment( Qt::AlignTop );
187
        majorGridColor = new QPushButton( groupBox1, "majorGridColor" );
188
        majorGridColor->setMinimumSize( QSize( 60, 20 ) );
189
        majorGridColor->setMaximumSize( QSize( 60, 20 ) );
190
        majorGridColor->setFlat( false );
191
        majorGridColor->setAutoDefault( false );
192
        QPixmap pm1 = QPixmap(54, 14);
193
        pm1.fill(doc->majorColor);
194
        colorMajorGrid = doc->majorColor;
195
        majorGridColor->setPixmap(pm1);
196
        majorGridColor->setText( QString::null );
197
        groupBox1Layout->addWidget( majorGridColor, 1, 1 );
198
        textLabel4 = new QLabel( groupBox1, "textLabel4" );
199
        textLabel4->setText( tr( "Color:" ) );
200
        groupBox1Layout->addWidget( textLabel4, 1, 0 );
201
        textLabel6 = new QLabel( groupBox1, "textLabel6" );
202
        textLabel6->setText( tr( "Spacing:" ) );
203
        groupBox1Layout->addWidget( textLabel6, 0, 0 );
204
        majorSpace = new MSpinBox( 1, 10000, groupBox1, 2 );
205
        majorSpace->setValue( doc->majorGrid * UmReFaktor );
206
        majorSpace->setSuffix( ein );
207
        groupBox1Layout->addWidget( majorSpace, 0, 1 );
208
        checkGridLayout->addWidget( groupBox1, 0, 0 );
209
        groupBox2 = new QGroupBox( checkGrid, "groupBox2" );
210
        groupBox2->setColumnLayout(0, Qt::Vertical );
211
        groupBox2->layout()->setSpacing( 5 );
212
        groupBox2->layout()->setMargin( 10 );
213
        groupBox2->setTitle( tr( "Minor Grid" ) );
214
        groupBox2Layout = new QGridLayout( groupBox2->layout() );
215
        groupBox2Layout->setAlignment( Qt::AlignTop );
216
        textLabel5 = new QLabel( groupBox2, "textLabel5" );
217
        textLabel5->setText( tr( "Color:" ) );
218
        groupBox2Layout->addWidget( textLabel5, 1, 0 );
219
        minorGridColor = new QPushButton( groupBox2, "minorGridColor" );
220
        minorGridColor->setMinimumSize( QSize( 60, 20 ) );
221
        minorGridColor->setMaximumSize( QSize( 60, 20 ) );
222
        minorGridColor->setFlat( false );
223
        minorGridColor->setAutoDefault( false );
224
        QPixmap pm = QPixmap(54, 14);
225
        pm.fill(doc->minorColor);
226
        colorMinorGrid = doc->minorColor;
227
        minorGridColor->setPixmap(pm);
228
        minorGridColor->setText( QString::null );
229
        groupBox2Layout->addWidget( minorGridColor, 1, 1 );
230
        textLabel7 = new QLabel( groupBox2, "textLabel7" );
231
        textLabel7->setText( tr( "Spacing:" ) );
232
        groupBox2Layout->addWidget( textLabel7, 0, 0 );
233
        minorSpace = new MSpinBox( 1, 10000, groupBox2, 2 );
234
        minorSpace->setValue( doc->minorGrid  * UmReFaktor);
235
        minorSpace->setSuffix( ein );
236
        groupBox2Layout->addWidget( minorSpace, 0, 1 );
237
        checkGridLayout->addWidget( groupBox2, 0, 1 );
238
        tabGuidesLayout->addWidget( checkGrid );
239
        layout11 = new QGridLayout( 0, 1, 1, 0, 5, "layout11");
240
        textLabel8 = new QLabel( tabGuides, "textLabel8" );
241
        textLabel8->setText( tr( "Guide Snap Distance:" ) );
242
        layout11->addWidget( textLabel8, 0, 0 );
243
        snapDistance = new MSpinBox( 1, 10000, tabGuides, 2 );
244
        snapDistance->setValue( doc->GuideRad * UmReFaktor );
245
        snapDistance->setSuffix( ein );
246
        layout11->addWidget( snapDistance, 0, 1, Qt::AlignLeft );
247
        checkMargin = new QCheckBox( tabGuides, "checkMargin" );
693 fschmid 248
        checkMargin->setText( tr( "Show Margins" ) );
249
        checkMargin->setChecked(doc->MarginsShown);
705 fschmid 250
        layout11->addWidget( checkMargin, 1, 0 );
251
        checkGuides = new QCheckBox( tabGuides, "checkGuides" );
252
        checkGuides->setText( tr( "Show Guides" ) );
253
        checkGuides->setChecked(doc->GuidesShown);
254
        layout11->addWidget( checkGuides, 2, 0 );
255
        checkBaseline = new QCheckBox( tabGuides, "checkBaseline" );
256
        checkBaseline->setText( tr( "Show Baseline Grid" ) );
257
        checkBaseline->setChecked(doc->BaseShown);
258
        layout11->addWidget( checkBaseline, 3, 0 );
259
        layout2 = new QHBoxLayout( 0, 0, 5, "layout2");
260
        textLabel2 = new QLabel( tabGuides, "textLabel2" );
261
        textLabel2->setText( tr( "Color:" ) );
262
        layout2->addWidget( textLabel2 );
263
        baselineColor = new QPushButton( tabGuides, "baselineColor" );
264
        baselineColor->setMinimumSize( QSize( 60, 20 ) );
265
        baselineColor->setMaximumSize( QSize( 60, 20 ) );
266
        baselineColor->setFlat( false );
267
        baselineColor->setAutoDefault( false );
268
        QPixmap pm4 = QPixmap(54, 14);
269
        pm4.fill(doc->baseColor);
270
        colorBaselineGrid = doc->baseColor;
271
        baselineColor->setPixmap(pm4);
272
        baselineColor->setText( QString::null );
273
        layout2->addWidget( baselineColor );
274
        layout11->addLayout( layout2, 3, 1 );
275
        layout3 = new QHBoxLayout( 0, 0, 5, "layout3");
276
        textLabel3 = new QLabel( tabGuides, "textLabel3" );
277
        textLabel3->setText( tr( "Color:" ) );
278
        layout3->addWidget( textLabel3 );
279
        guideColor = new QPushButton( tabGuides, "guideColor" );
280
        guideColor->setMinimumSize( QSize( 60, 20 ) );
281
        guideColor->setMaximumSize( QSize( 60, 20 ) );
282
        guideColor->setFlat( false );
283
        guideColor->setAutoDefault( false );
284
        QPixmap pm3 = QPixmap(54, 14);
285
        pm3.fill(doc->guideColor);
286
        colorGuides = doc->guideColor;
287
        guideColor->setPixmap(pm3);
288
        guideColor->setText( QString::null );
289
        layout3->addWidget( guideColor );
290
        layout11->addLayout( layout3, 2, 1 );
291
        layout9 = new QHBoxLayout( 0, 0, 5, "layout9");
292
        textLabel1 = new QLabel( tabGuides, "textLabel1" );
293
        textLabel1->setText( tr( "Color:" ) );
294
        layout9->addWidget( textLabel1 );
295
        marginColor = new QPushButton( tabGuides, "marginColor" );
296
        marginColor->setMinimumSize( QSize( 60, 20 ) );
297
        marginColor->setMaximumSize( QSize( 60, 20 ) );
298
        marginColor->setAutoDefault( false );
299
        QPixmap pm6 = QPixmap(54, 14);
300
        pm6.fill(doc->margColor);
301
        colorMargin = doc->margColor;
302
        marginColor->setPixmap(pm6);
303
        marginColor->setFlat( false );
304
        marginColor->setText( QString::null );
305
        layout9->addWidget( marginColor );
306
        layout11->addLayout( layout9, 1, 1 );
307
        tabGuidesLayout->addLayout( layout11 );
308
        layout12 = new QGridLayout( 0, 1, 1, 0, 5, "layout12");
309
        checkLink = new QCheckBox( tabGuides, "checkLink" );
310
        checkLink->setText( tr( "Show Text Chains" ) );
311
        checkLink->setChecked(doc->linkShown);
312
        layout12->addWidget( checkLink, 1, 0 );
313
        checkFrame = new QCheckBox( tabGuides, "checkFrame" );
693 fschmid 314
        checkFrame->setText( tr( "Show Frames" ) );
315
        checkFrame->setChecked(doc->FramesShown);
705 fschmid 316
        layout12->addWidget( checkFrame, 0, 0 );
317
        checkPictures = new QCheckBox( tabGuides, "checkPictures" );
693 fschmid 318
        checkPictures->setText( tr( "Show Pictures" ) );
705 fschmid 319
        layout12->addWidget( checkPictures, 0, 1 );
693 fschmid 320
        checkPictures->setChecked(doc->ShowPic);
705 fschmid 321
        tabGuidesLayout->addLayout( layout12 );
715 fschmid 322
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
693 fschmid 323
 
705 fschmid 324
        tabView = new QWidget( prefsWidgets, "tabView" );
325
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
326
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
327
        pageBackground->setTitle( tr( "Page Background" ) );
328
        pageBackground->setColumnLayout(0, Qt::Vertical );
329
        pageBackground->layout()->setSpacing( 5 );
330
        pageBackground->layout()->setMargin( 10 );
331
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
332
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
333
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
334
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
335
        textLabel9->setText( tr( "Color:" ) );
336
        layout10->addWidget( textLabel9 );
337
        backColor = new QPushButton( pageBackground, "backColor" );
338
        backColor->setMinimumSize( QSize( 60, 20 ) );
339
        backColor->setMaximumSize( QSize( 60, 20 ) );
340
        backColor->setFlat( false );
341
        backColor->setAutoDefault( false );
342
        QPixmap pm5 = QPixmap(54, 14);
343
        pm5.fill(doc->papColor);
344
        colorPaper = doc->papColor;
345
        backColor->setPixmap(pm5);
346
        backColor->setText( QString::null );
347
        layout10->addWidget( backColor );
348
        spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
349
        layout10->addItem( spacer3 );
350
        pageBackgroundLayout->addLayout( layout10 );
351
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
352
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
353
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
354
        checkUnprintable->setChecked( doc->RandFarbig );
355
        pageBackgroundLayout->addWidget( checkUnprintable );
356
        tabViewLayout->addWidget( pageBackground );
734 fschmid 357
 
358
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
359
        groupScratch->setTitle( tr( "Scratch Space" ) );
360
        groupScratch->setColumnLayout(0, Qt::Vertical );
361
        groupScratch->layout()->setSpacing( 0 );
362
        groupScratch->layout()->setMargin( 0 );
363
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
364
        groupScratchLayout->setAlignment( Qt::AlignTop );
365
        groupScratchLayout->setSpacing( 0 );
366
        groupScratchLayout->setMargin( 10 );
367
        Layout4s = new QGridLayout;
368
        Layout4s->setSpacing( 6 );
369
        Layout4s->setMargin( 0 );
370
        topScratch = new MSpinBox( groupScratch, 4 );
371
        topScratch->setSuffix( ein );
372
        topScratch->setDecimals( decimals );
373
        topScratch->setMaxValue(1000);
374
        topScratch->setValue(doc->ScratchTop * UmReFaktor);
375
        Layout4s->addWidget( topScratch, 0, 1 );
376
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
377
        Layout4s->addWidget( TextLabel5s, 0, 0 );
378
        leftScratch = new MSpinBox( groupScratch, 4 );
379
        leftScratch->setSuffix( ein );
380
        leftScratch->setDecimals( decimals );
381
        leftScratch->setMaxValue(1000);
382
        leftScratch->setValue(doc->ScratchLeft * UmReFaktor);
383
        Layout4s->addWidget( leftScratch, 0, 3 );
384
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
385
        Layout4s->addWidget( Linkss, 0, 2 );
386
        bottomScratch = new MSpinBox( groupScratch, 4 );
387
        bottomScratch->setSuffix( ein );
388
        bottomScratch->setDecimals( decimals );
389
        bottomScratch->setMaxValue(1000);
390
        bottomScratch->setValue(doc->ScratchBottom * UmReFaktor);
391
        Layout4s->addWidget( bottomScratch, 1, 1 );
392
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
393
        Layout4s->addWidget( TextLabel7s, 1, 0 );
394
        rightScratch = new MSpinBox( groupScratch, 4 );
395
        rightScratch->setSuffix( ein );
396
        rightScratch->setDecimals( decimals );
397
        rightScratch->setMaxValue(1000);
398
        rightScratch->setValue(doc->ScratchRight * UmReFaktor);
399
        Layout4s->addWidget( rightScratch, 1, 3 );
400
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
401
        Layout4s->addWidget( Rechtss, 1, 2 );
402
        groupScratchLayout->addLayout( Layout4s );
403
        tabViewLayout->addWidget( groupScratch );
404
 
705 fschmid 405
        buttonGroup1 = new QButtonGroup( tabView, "buttonGroup1" );
406
        buttonGroup1->setExclusive( true );
407
        buttonGroup1->setColumnLayout(0, Qt::Vertical );
408
        buttonGroup1->layout()->setSpacing( 5 );
409
        buttonGroup1->layout()->setMargin( 10 );
410
        buttonGroup1->setTitle( tr( "Placing of Guides" ) );
411
        buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
412
        buttonGroup1Layout->setAlignment( Qt::AlignTop );
413
        inBackground = new QRadioButton( buttonGroup1, "inBackground" );
414
        inBackground->setText( tr( "In the Background" ) );
415
        buttonGroup1Layout->addWidget( inBackground );
416
        inForeground = new QRadioButton( buttonGroup1, "inForeground" );
417
        inForeground->setText( tr( "In the Foreground" ) );
418
        buttonGroup1Layout->addWidget( inForeground );
419
        inBackground->setChecked( doc->Before );
420
        inForeground->setChecked( !doc->Before );
421
        tabViewLayout->addWidget( buttonGroup1 );
715 fschmid 422
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
423
 
424
 
425
        tabTypo = new QWidget( prefsWidgets, "tabTypo" );
426
        tabTypoLayout = new QGridLayout( tabTypo, 1, 1, 11, 6, "tabTypoLayout");
427
        groupBox1a = new QGroupBox( tabTypo, "groupBox1a" );
428
        groupBox1a->setColumnLayout(0, Qt::Vertical );
429
        groupBox1a->layout()->setSpacing( 6 );
430
        groupBox1a->layout()->setMargin( 11 );
431
        groupBox1a->setTitle( tr( "Subscript" ) );
432
        groupBox1aLayout = new QGridLayout( groupBox1a->layout() );
433
        groupBox1aLayout->setAlignment( Qt::AlignTop );
434
        subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" );
435
        subDisplacement->setMaxValue( 100 );
436
        subDisplacement->setValue( doc->VTief );
437
        subDisplacement->setSuffix( tr( " %" ) );
438
        groupBox1aLayout->addWidget( subDisplacement, 0, 1 );
439
        textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" );
440
        groupBox1aLayout->addWidget( textLabel1a, 0, 0 );
441
        subScaling = new QSpinBox( groupBox1a, "subScaling" );
442
        subScaling->setMaxValue( 100 );
443
        subScaling->setMinValue( 1 );
444
        subScaling->setValue( doc->VTiefSc );
445
        subScaling->setSuffix( tr( " %" ) );
726 fschmid 446
        groupBox1aLayout->addWidget( subScaling, 0, 3 );
715 fschmid 447
        textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" );
726 fschmid 448
        groupBox1aLayout->addWidget( textLabel2a, 0, 2 );
715 fschmid 449
        tabTypoLayout->addWidget( groupBox1a, 0, 0 );
450
        groupBox2a = new QGroupBox( tabTypo, "groupBox2a" );
451
        groupBox2a->setColumnLayout(0, Qt::Vertical );
452
        groupBox2a->layout()->setSpacing( 6 );
453
        groupBox2a->layout()->setMargin( 11 );
454
        groupBox2a->setTitle( tr( "Superscript" ) );
455
        groupBox2aLayout = new QGridLayout( groupBox2a->layout() );
456
        groupBox2aLayout->setAlignment( Qt::AlignTop );
457
        superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" );
458
        superDisplacement->setMaxValue( 100 );
459
        superDisplacement->setValue( doc->VHoch );
460
        superDisplacement->setSuffix( tr( " %" ) );
461
        groupBox2aLayout->addWidget( superDisplacement, 0, 1 );
462
        textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" );
463
        groupBox2aLayout->addWidget( textLabel3a, 0, 0 );
464
        superScaling = new QSpinBox( groupBox2a, "superScaling" );
465
        superScaling->setMaxValue( 100 );
466
        superScaling->setMinValue( 1 );
467
        superScaling->setValue( doc->VHochSc );
468
        superScaling->setSuffix( tr( " %" ) );
726 fschmid 469
        groupBox2aLayout->addWidget( superScaling, 0, 3 );
715 fschmid 470
        textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" );
726 fschmid 471
        groupBox2aLayout->addWidget( textLabel4a, 0, 2 );
715 fschmid 472
        tabTypoLayout->addWidget( groupBox2a, 1, 0 );
473
        groupBox3a = new QGroupBox( tabTypo, "groupBox3a" );
474
        groupBox3a->setColumnLayout(0, Qt::Vertical );
475
        groupBox3a->layout()->setSpacing( 6 );
476
        groupBox3a->layout()->setMargin( 11 );
477
        groupBox3a->setTitle( tr( "Small Caps" ) );
478
        groupBox3aLayout = new QGridLayout( groupBox3a->layout() );
479
        groupBox3aLayout->setAlignment( Qt::AlignTop );
480
        capsScaling = new QSpinBox( groupBox3a, "capsScaling" );
481
        capsScaling->setMaxValue( 100 );
482
        capsScaling->setMinValue( 1 );
483
        capsScaling->setValue( doc->VKapit );
484
        capsScaling->setSuffix( tr( " %" ) );
485
        groupBox3aLayout->addWidget( capsScaling, 0, 1 );
486
        textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" );
487
        groupBox3aLayout->addWidget( textLabel5a, 0, 0 );
726 fschmid 488
        tabTypoLayout->addWidget( groupBox3a, 2, 0 );
715 fschmid 489
        groupBox4a = new QGroupBox( tabTypo, "groupBox4a" );
490
        groupBox4a->setColumnLayout(0, Qt::Vertical );
491
        groupBox4a->layout()->setSpacing( 6 );
492
        groupBox4a->layout()->setMargin( 11 );
493
        groupBox4a->setTitle( tr( "Other" ) );
494
        groupBox4aLayout = new QGridLayout( groupBox4a->layout() );
495
        groupBox4aLayout->setAlignment( Qt::AlignTop );
496
        baseGrid = new MSpinBox( 1, doc->PageH, groupBox4a, 1 );
497
        baseGrid->setSuffix( ein );
498
        baseGrid->setValue(doc->BaseGrid * UmReFaktor);
499
        groupBox4aLayout->addWidget( baseGrid, 0, 1 );
500
        textLabel6a = new QLabel(baseGrid, tr( "Baseline &Grid:" ),groupBox4a, "textLabel6a" );
501
        groupBox4aLayout->addWidget( textLabel6a, 0, 0 );
502
        baseOffset = new MSpinBox( 0, doc->PageH, groupBox4a, 1 );
503
        baseOffset->setSuffix( ein );
504
        baseOffset->setValue(doc->BaseOffs * UmReFaktor);
505
        groupBox4aLayout->addWidget( baseOffset, 1, 1 );
506
        textLabel7a = new QLabel(baseOffset, tr( "Baseline &Offset:" ),groupBox4a, "textLabel7a" );
507
        groupBox4aLayout->addWidget( textLabel7a, 1, 0 );
508
        autoLine = new QSpinBox( groupBox4a, "autoLine" );
509
        autoLine->setMaxValue( 100 );
510
        autoLine->setMinValue( 1 );
511
        autoLine->setValue( doc->AutoLine );
512
        autoLine->setSuffix( tr( " %" ) );
513
        groupBox4aLayout->addWidget( autoLine, 2, 1 );
514
        textLabel8a = new QLabel( autoLine, tr( "Automatic &Line Spacing:" ), groupBox4a, "textLabel8a" );
515
        groupBox4aLayout->addWidget( textLabel8a, 2, 0 );
726 fschmid 516
        tabTypoLayout->addWidget( groupBox4a, 3, 0 );
715 fschmid 517
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
518
 
726 fschmid 519
        tabTools = new QWidget( prefsWidgets, "tabTools" );
731 fschmid 520
        tabToolsLayout = new QHBoxLayout( tabTools, 11, 6, "tabToolsLayout");
521
        buttonGroupTools = new QButtonGroup( tabTools, "buttonGroupTools" );
734 fschmid 522
        buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 523
        buttonGroupTools->setExclusive( true );
524
        buttonGroupTools->setRadioButtonExclusive( true );
525
        buttonGroupTools->setColumnLayout(0, Qt::Vertical );
526
        buttonGroupTools->layout()->setSpacing( 5 );
527
        buttonGroupTools->layout()->setMargin( 5 );
528
        buttonGroupTools->setTitle( QString::null );
529
        buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() );
530
        buttonGroupToolsLayout->setAlignment( Qt::AlignTop );
531
        toolText = new QToolButton( buttonGroupTools, "toolText" );
532
        toolText->setToggleButton( true );
533
        toolText->setText( QString::null );
534
        toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) );
535
        buttonGroupToolsLayout->addWidget( toolText );
536
        toolImage = new QToolButton( buttonGroupTools, "toolImage" );
537
        toolImage->setToggleButton( true );
538
        toolImage->setText( QString::null );
539
        toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) );
540
        buttonGroupToolsLayout->addWidget( toolImage );
541
        toolShape = new QToolButton( buttonGroupTools, "toolShape" );
542
        toolShape->setToggleButton( true );
543
        toolShape->setText( QString::null );
544
        toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) );
545
        buttonGroupToolsLayout->addWidget( toolShape);
546
        toolPoly = new QToolButton( buttonGroupTools, "toolPoly" );
547
        toolPoly->setToggleButton( true );
548
        toolPoly->setText( QString::null );
549
        toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) );
550
        buttonGroupToolsLayout->addWidget( toolPoly );
551
        toolLine = new QToolButton( buttonGroupTools, "toolLine" );
552
        toolLine->setToggleButton( true );
553
        toolLine->setText( QString::null );
554
        toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) );
555
        buttonGroupToolsLayout->addWidget( toolLine );
556
        toolZoom = new QToolButton( buttonGroupTools, "toolZoom" );
557
        toolZoom->setToggleButton( true );
558
        toolZoom->setText( QString::null );
559
        toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) );
560
        buttonGroupToolsLayout->addWidget( toolZoom );
561
        tabToolsLayout->addWidget( buttonGroupTools );
562
        subStackTools = new QWidgetStack( tabTools, "subStackTools" );
734 fschmid 563
        subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 564
        subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel );
565
        subStackTools->setFrameShadow( QWidgetStack::Sunken );
566
        subTabText = new QWidget( subStackTools, "subTabText" );
567
        subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout");
568
        textLabel3b = new QLabel( subTabText, "textLabel3b" );
569
        textLabel3b->setText( tr( "Color:" ) );
570
        subTabTextLayout->addWidget( textLabel3b, 2, 0 );
571
        textLabel1b = new QLabel( subTabText, "textLabel1b" );
572
        textLabel1b->setText( tr( "Font:" ) );
573
        subTabTextLayout->addWidget( textLabel1b, 0, 0 );
574
        textLabel2b = new QLabel( subTabText, "textLabel2b" );
575
        textLabel2b->setText( tr( "Size:" ) );
576
        subTabTextLayout->addWidget( textLabel2b, 1, 0 );
577
        columnsText = new QSpinBox( subTabText, "columnsText" );
578
        columnsText->setMinValue( 1 );
726 fschmid 579
        columnsText->setMaxValue(100);
580
        columnsText->setValue(doc->DCols);
731 fschmid 581
        subTabTextLayout->addWidget( columnsText, 3, 1 );
726 fschmid 582
        textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol");
731 fschmid 583
        subTabTextLayout->addWidget( textLabel4b, 3, 0 );
726 fschmid 584
        previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" );
731 fschmid 585
        previewText->setMinimumSize( QSize( 280, 70 ) );
726 fschmid 586
        previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
731 fschmid 587
        subTabTextLayout->addMultiCellWidget( previewText, 4, 4, 0, 3 );
726 fschmid 588
        fontComboText = new FontCombo(subTabText, prefsData);
589
        for (int fc=0; fc<fontComboText->count(); ++fc)
590
        {
591
                if (fontComboText->text(fc) == doc->Dfont)
592
                {
593
                        fontComboText->setCurrentItem(fc);
594
                        break;
595
                }
596
        }
731 fschmid 597
        subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3 );
726 fschmid 598
        sizeComboText = new QComboBox( true, subTabText, "SizeCombo" );
599
        sizeComboText->setEditable(false);
600
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
601
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
602
        for (uint s = 0; s < f_size; ++s)
603
                sizeComboText->insertItem(ar_sizes[s] + tr(" pt"));
604
        for (int a = 0; a < sizeComboText->count(); ++a)
605
        {
606
                if (sizeComboText->text(a).left(2).toInt() == doc->Dsize / 10)
607
                        sizeComboText->setCurrentItem(a);
608
        }
731 fschmid 609
        subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3 );
726 fschmid 610
        colorComboText = new QComboBox( true, subTabText, "colorComboText" );
611
        colorComboText->setEditable(false);
612
        QPixmap pmT2;
613
        pmT2 = QPixmap(15, 15);
614
        CListe::Iterator itc;
727 fschmid 615
        if (doc->DpenText == "None")
616
                colorComboText->setCurrentItem(colorComboText->count()-1);
726 fschmid 617
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
618
        {
619
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
620
                colorComboText->insertItem(pmT2, itc.key());
621
                if (itc.key() == doc->DpenText)
622
                        colorComboText->setCurrentItem(colorComboText->count()-1);
623
        }
731 fschmid 624
        subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3 );
726 fschmid 625
        gapText = new MSpinBox( 0, 200, subTabText, decimals );
626
        gapText->setSuffix( tr( " pt" ) );
734 fschmid 627
        gapText->setValue(doc->DGap * UmReFaktor);
731 fschmid 628
        subTabTextLayout->addWidget( gapText, 3, 3 );
726 fschmid 629
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
731 fschmid 630
        subTabTextLayout->addWidget( textLabel5b, 3, 2 );
631
        subStackTools->addWidget( subTabText, 0 );
726 fschmid 632
 
731 fschmid 633
        subTabShape = new QWidget( subStackTools, "subTabShape" );
634
        subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
727 fschmid 635
        colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" );
636
        colorComboLineShape->setEditable(false);
637
        colorComboLineShape->insertItem( tr("None"));
638
        if (doc->Dpen == "None")
639
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
640
        QPixmap pm2S = QPixmap(15, 15);
641
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
642
        {
643
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
644
                colorComboLineShape->insertItem(pm2S, itc.key());
645
                if (itc.key() == doc->Dpen)
646
                        colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
647
        }
731 fschmid 648
        subTabShapeLayout->addWidget( colorComboLineShape, 0, 1 );
727 fschmid 649
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
731 fschmid 650
        subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
651
        shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
652
        shadingLineShape->setMaxValue( 100 );
653
        shadingLineShape->setSuffix( tr( " %" ) );
727 fschmid 654
        shadingLineShape->setMinValue( 0 );
655
        shadingLineShape->setValue(doc->Dshade2);
731 fschmid 656
        subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
727 fschmid 657
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
731 fschmid 658
        subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
727 fschmid 659
        comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" );
660
        comboFillShape->setEditable(false);
661
        comboFillShape->insertItem( tr("None"));
662
        if (doc->Dbrush == "None")
663
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
664
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
665
        {
666
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
667
                comboFillShape->insertItem(pm2S, itc.key());
668
                if (itc.key() == doc->Dbrush)
669
                        comboFillShape->setCurrentItem(comboFillShape->count()-1);
670
        }
731 fschmid 671
        subTabShapeLayout->addWidget( comboFillShape, 2, 1 );
727 fschmid 672
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
731 fschmid 673
        subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
674
        shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
675
        shadingFillShape->setMaxValue( 100 );
676
        shadingFillShape->setSuffix( tr( " %" ) );
727 fschmid 677
        shadingFillShape->setMinValue( 0 );
678
        shadingFillShape->setValue(doc->Dshade);
731 fschmid 679
        subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
727 fschmid 680
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
731 fschmid 681
        subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
727 fschmid 682
        comboStyleShape = new LineCombo(subTabShape);
683
        comboStyleShape->setEditable(false);
684
        switch (doc->DLineArt)
685
        {
686
        case SolidLine:
687
                comboStyleShape->setCurrentItem(0);
688
                break;
689
        case DashLine:
690
                comboStyleShape->setCurrentItem(1);
691
                break;
692
        case DotLine:
693
                comboStyleShape->setCurrentItem(2);
694
                break;
695
        case DashDotLine:
696
                comboStyleShape->setCurrentItem(3);
697
                break;
698
        case DashDotDotLine:
699
                comboStyleShape->setCurrentItem(4);
700
                break;
701
        default:
702
                comboStyleShape->setCurrentItem(0);
703
                break;
704
        }
731 fschmid 705
        subTabShapeLayout->addWidget( comboStyleShape, 4, 1 );
727 fschmid 706
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
731 fschmid 707
        subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
727 fschmid 708
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
709
        lineWidthShape->setSuffix( tr( " pt" ) );
710
        lineWidthShape->setValue(doc->Dwidth);
731 fschmid 711
        subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
727 fschmid 712
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
731 fschmid 713
        subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
714
        subStackTools->addWidget( subTabShape, 1 );
727 fschmid 715
 
731 fschmid 716
        subTabLine = new QWidget( subStackTools, "subTabLine" );
717
        subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
718
        colorComboLine = new QComboBox( true, subTabLine, "colorComboLine" );
719
        colorComboLine->setEditable(false);
720
        QPixmap pm2L = QPixmap(15, 15);
721
        comboFillShape->insertItem( tr("None"));
722
        if (doc->DpenLine == "None")
723
                colorComboLine->setCurrentItem(colorComboLine->count()-1);
724
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
725
        {
726
                pm2L.fill(doc->PageColors[itc.key()].getRGBColor());
727
                colorComboLine->insertItem(pm2L, itc.key());
728
                if (itc.key() == doc->DpenLine)
729
                        colorComboLine->setCurrentItem(colorComboLine->count()-1);
730
        }
731
        subTabLineLayout->addWidget( colorComboLine, 0, 1 );
732
        textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" );
733
        subTabLineLayout->addWidget( textLabel13b, 0, 0 );
734
        shadingLine = new QSpinBox( subTabLine, "shadingLine" );
735
        shadingLine->setMaxValue( 100 );
736
        shadingLine->setValue(doc->DshadeLine);
737
        shadingLine->setSuffix( tr( " %" ) );
738
        subTabLineLayout->addWidget( shadingLine, 1, 1, Qt::AlignLeft );
739
        textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" );
740
        subTabLineLayout->addWidget( textLabel14b, 1, 0 );
741
        comboStyleLine = new LineCombo(subTabLine);
742
        comboStyleLine->setEditable(false);
743
        switch (doc->DLstyleLine)
744
        {
745
        case SolidLine:
746
                comboStyleLine->setCurrentItem(0);
747
                break;
748
        case DashLine:
749
                comboStyleLine->setCurrentItem(1);
750
                break;
751
        case DotLine:
752
                comboStyleLine->setCurrentItem(2);
753
                break;
754
        case DashDotLine:
755
                comboStyleLine->setCurrentItem(3);
756
                break;
757
        case DashDotDotLine:
758
                comboStyleLine->setCurrentItem(4);
759
                break;
760
        default:
761
                comboStyleLine->setCurrentItem(0);
762
                break;
763
        }
764
        subTabLineLayout->addWidget( comboStyleLine, 2, 1 );
765
        textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" );
766
        subTabLineLayout->addWidget( textLabel15b, 2, 0 );
767
        lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 );
768
        lineWidthLine->setSuffix( tr( " pt" ) );
769
        lineWidthLine->setValue(doc->DwidthLine);
770
        subTabLineLayout->addWidget( lineWidthLine, 3, 1, Qt::AlignLeft );
771
        textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" );
772
        subTabLineLayout->addWidget( textLabel16b, 3, 0 );
773
        subStackTools->addWidget( subTabLine, 2 );
727 fschmid 774
 
731 fschmid 775
        subTabImage = new QWidget( subStackTools, "subTabImage" );
776
        subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
777
        buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
778
        buttonGroup3->setCheckable( true );
779
        buttonGroup3->setChecked( doc->ScaleType );
780
        buttonGroup3->setColumnLayout(0, Qt::Vertical );
781
        buttonGroup3->layout()->setSpacing( 6 );
782
        buttonGroup3->layout()->setMargin( 11 );
783
        buttonGroup3->setTitle( tr( "&Free Scaling" ) );
784
        buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
785
        buttonGroup3Layout->setAlignment( Qt::AlignTop );
786
        scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
787
        scalingHorizontal->setMaxValue( 1000 );
788
        scalingHorizontal->setMinValue( 1 );
789
        scalingHorizontal->setValue(qRound(doc->ScaleX * 100));
790
        scalingHorizontal->setSuffix( tr( " %" ) );
791
        buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight );
792
        textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" );
793
        buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
794
        scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
795
        scalingVertical->setMaxValue( 1000 );
796
        scalingVertical->setMinValue( 1 );
797
        scalingVertical->setSuffix( tr( " %" ) );
798
        scalingVertical->setValue(qRound(doc->ScaleY * 100));
799
        buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight );
800
        textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" );
801
        buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
726 fschmid 802
        chainButton = new LinkButton( buttonGroup3 );
803
        chainButton->setToggleButton( true );
804
        chainButton->setAutoRaise(true);
731 fschmid 805
        buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
806
        subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
807
        buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
808
        buttonGroup5->setCheckable( true );
809
        buttonGroup5->setChecked( !doc->ScaleType );
810
        buttonGroup5->setColumnLayout(0, Qt::Vertical );
811
        buttonGroup5->layout()->setSpacing( 6 );
812
        buttonGroup5->layout()->setMargin( 11 );
813
        buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) );
814
        buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
815
        buttonGroup5Layout->setAlignment( Qt::AlignTop );
816
        checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
817
        checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) );
818
        checkRatioImage->setChecked(doc->AspectRatio);
819
        buttonGroup5Layout->addWidget( checkRatioImage );
820
        subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
821
        comboFillImage = new QComboBox( true, subTabImage, "comboFillImage" );
822
        comboFillImage->setEditable(false);
823
        QPixmap pm2I = QPixmap(15, 15);
824
        comboFillImage->insertItem( tr("None"));
825
        if (doc->DbrushPict == "None")
826
                comboFillImage->setCurrentItem(comboFillImage->count()-1);
827
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
828
        {
829
                pm2I.fill(doc->PageColors[itc.key()].getRGBColor());
830
                comboFillImage->insertItem(pm2I, itc.key());
831
                if (itc.key() == doc->DbrushPict)
832
                        comboFillImage->setCurrentItem(comboFillImage->count()-1);
833
        }
834
        subTabImageLayout->addWidget( comboFillImage, 2, 1 );
835
        textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" );
836
        subTabImageLayout->addWidget( textLabel19b, 2, 0 );
837
        shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
838
        shadingFillImage->setMaxValue( 100 );
839
        shadingFillImage->setValue( doc->ShadePict );
840
        shadingFillImage->setSuffix( tr( " %" ) );
841
        subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
842
        textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
843
        subTabImageLayout->addWidget( textLabel20b, 3, 0 );
844
        subStackTools->addWidget( subTabImage, 3 );
727 fschmid 845
 
731 fschmid 846
        subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
847
        subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
848
        polyWidget = new PolygonWidget(subTabPolygon, doc->PolyC, doc->PolyFd, doc->PolyF, doc->PolyS, doc->PolyR);
849
        subTabPolygonLayout->addWidget( polyWidget );
850
        subStackTools->addWidget( subTabPolygon, 4 );
727 fschmid 851
 
731 fschmid 852
        subTabZoom = new QWidget( subStackTools, "subTabZoom" );
853
        subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
854
        minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
855
        minimumZoom->setMaxValue( 3200 );
856
        minimumZoom->setMinValue( 10 );
727 fschmid 857
        minimumZoom->setValue(doc->MagMin);
731 fschmid 858
        minimumZoom->setSuffix( tr( " %" ) );
859
        subTabZoomLayout->addWidget( minimumZoom, 0, 1 );
860
        textLabel21b = new QLabel( subTabZoom, "textLabel21b" );
727 fschmid 861
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
731 fschmid 862
        subTabZoomLayout->addWidget( textLabel21b, 0, 0, Qt::AlignLeft );
863
        maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
864
        maximumZoom->setMaxValue( 3200 );
865
        maximumZoom->setMinValue( 10 );
727 fschmid 866
        maximumZoom->setValue(doc->MagMax);
731 fschmid 867
        maximumZoom->setSuffix( tr( " %" ) );
868
        subTabZoomLayout->addWidget( maximumZoom, 1, 1 );
727 fschmid 869
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
731 fschmid 870
        subTabZoomLayout->addWidget( textLabel22b, 1, 0, Qt::AlignLeft );
871
        zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
872
        zoomStep->setMaxValue( 200 );
873
        zoomStep->setMinValue( 1 );
874
        zoomStep->setLineStep( 25 );
875
        zoomStep->setValue( doc->MagStep );
876
        zoomStep->setSuffix( tr( " %" ) );
877
        subTabZoomLayout->addWidget( zoomStep, 2, 1 );
878
        textLabel23b = new QLabel( subTabZoom, "textLabel23b" );
727 fschmid 879
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
731 fschmid 880
        subTabZoomLayout->addWidget( textLabel23b, 2, 0, Qt::AlignLeft );
881
        subStackTools->addWidget( subTabZoom, 5 );
882
        tabToolsLayout->addWidget( subStackTools );
726 fschmid 883
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
884
 
734 fschmid 885
        tabMisc = new QWidget( prefsWidgets, "tabMisc" );
886
        tabMiscLayout = new QVBoxLayout( tabMisc, 11, 6, "tabMiscLayout");
887
        groupAutoSave = new QGroupBox( tabMisc, "groupAutoSave" );
888
        groupAutoSave->setTitle( tr( "Autosave" ) );
889
        groupAutoSave->setCheckable( true );
890
        groupAutoSave->setChecked( doc->AutoSave );
891
        groupAutoSave->setColumnLayout(0, Qt::Vertical );
892
        groupAutoSave->layout()->setSpacing( 6 );
893
        groupAutoSave->layout()->setMargin( 11 );
894
        groupAutoSaveLayout = new QHBoxLayout( groupAutoSave->layout() );
895
        groupAutoSaveLayout->setAlignment( Qt::AlignTop );
896
        autoSaveTime = new QSpinBox( groupAutoSave, "autoSaveTime" );
897
        autoSaveTime->setMinValue( 1 );
898
        autoSaveTime->setMaxValue( 60 );
899
        autoSaveTime->setSuffix( " " + tr("min") );
900
        autoSaveTime->setValue(doc->AutoSaveTime / 1000 / 60);
901
        groupAutoSaveLayout->addWidget( autoSaveTime );
902
        textLabel1m = new QLabel(autoSaveTime, tr( "&Interval:" ), groupAutoSave, "textLabel1m" );
903
        groupAutoSaveLayout->addWidget( textLabel1m );
904
        tabMiscLayout->addWidget( groupAutoSave );
905
        groupUnit = new QGroupBox( tabMisc, "groupUnit" );
906
        groupUnit->setTitle( tr( "Units" ) );
907
        groupUnit->setColumnLayout(0, Qt::Vertical );
908
        groupUnit->layout()->setSpacing( 6 );
909
        groupUnit->layout()->setMargin( 11 );
910
        groupUnitLayout = new QHBoxLayout( groupUnit->layout() );
911
        groupUnitLayout->setAlignment( Qt::AlignTop );
912
        unitCombo = new QComboBox( true, groupUnit, "unitCombo" );
913
        unitCombo->insertItem( tr( "Points (pt)" ) );
914
        unitCombo->insertItem( tr( "Millimetres (mm)" ) );
915
        unitCombo->insertItem( tr( "Inches (in)" ) );
916
        unitCombo->insertItem( tr( "Picas (p)" ) );
917
        unitCombo->setEditable(false);
918
        unitCombo->setCurrentItem(doc->Einheit);
919
        groupUnitLayout->addWidget( unitCombo );
920
        tabMiscLayout->addWidget( groupUnit );
921
        addItem(  tr("Misc."), loadIcon("misc.png"), tabMisc);
922
 
726 fschmid 923
        rightR->setMaxValue(pageWidth - leftR->value());
924
        leftR->setMaxValue(pageWidth - rightR->value());
925
        topR->setMaxValue(pageHeight - bottomR->value());
926
        bottomR->setMaxValue(pageHeight - topR->value());
927
        toolText->setOn(true);
727 fschmid 928
        setSample();
249 Franz 929
        //tooltips
726 fschmid 930
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
931
        QToolTip::add( firstPage, tr( "Make the first page the left page of the document" ) );
932
        QToolTip::add( topR, tr( "Distance between the top margin guide and the edge of the page" ) );
933
        QToolTip::add( bottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
934
        QToolTip::add( leftR, tr( "Distance between the left margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
935
        QToolTip::add( rightR, tr( "Distance between the right margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
3 paul 936
 
249 Franz 937
        // signals and slots connections
726 fschmid 938
        connect( facingPages, SIGNAL( clicked() ), this, SLOT( setDS() ) );
693 fschmid 939
        connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
940
        connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
726 fschmid 941
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
942
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
943
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
944
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 945
        connect(majorGridColor, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
946
        connect(minorGridColor, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
947
        connect(baselineColor, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
948
        connect(guideColor, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
949
        connect(marginColor, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
950
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
727 fschmid 951
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
952
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
953
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
954
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
955
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
956
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
957
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
958
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
959
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
960
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
731 fschmid 961
        connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
962
        connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
963
        connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
734 fschmid 964
        connect(unitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
731 fschmid 965
 
693 fschmid 966
        prefsWidgets->raiseWidget(0);
967
        resize( minimumSizeHint() );
968
        clearWState( WState_Polished );
3 paul 969
}
970
 
734 fschmid 971
void ReformDoc::unitChange()
972
{
973
        disconnect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
974
        disconnect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
975
        disconnect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
976
        disconnect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
977
        int decimalsOld;
978
        double AltUmrech = Umrech;
979
        double oldMin, oldMax, val;
980
        QString einh;
981
        einheit = unitCombo->currentItem();
982
        switch (unitCombo->currentItem())
983
        {
984
        case 0:
985
                Umrech = 1.0;
986
                decimals = 100;
987
                einh = tr( " pt" );
988
                break;
989
        case 1:
990
                Umrech = 0.3527777;
991
                decimals = 1000;
992
                einh = tr( " mm" );
993
                break;
994
        case 2:
995
                Umrech = 1.0 / 72.0;
996
                decimals = 10000;
997
                einh = tr( " in" );
998
                break;
999
        case 3:
1000
                Umrech = 1.0 / 12.0;
1001
                decimals = 100;
1002
                einh = tr( " p" );
1003
                break;
1004
        }
1005
        widthMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1006
        widthMSpinBox->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, docc->PageB * Umrech);
1007
        widthMSpinBox->setSuffix(einh);
1008
        heightMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1009
        heightMSpinBox->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, docc->PageH * Umrech);
1010
        heightMSpinBox->setSuffix(einh);
1011
        topR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1012
        topR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1013
        topR->setSuffix(einh);
1014
        bottomR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1015
        bottomR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1016
        bottomR->setSuffix(einh);
1017
        leftR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1018
        leftR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1019
        leftR->setSuffix(einh);
1020
        rightR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1021
        rightR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1022
        rightR->setSuffix(einh);
1023
        minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1024
        minorSpace->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1025
        minorSpace->setSuffix(einh);
1026
        majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1027
        majorSpace->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1028
        majorSpace->setSuffix(einh);
1029
        snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1030
        snapDistance->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1031
        snapDistance->setSuffix(einh);
1032
        baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1033
        baseGrid->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1034
        baseGrid->setSuffix(einh);
1035
        baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1036
        baseOffset->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1037
        baseOffset->setSuffix(einh);
1038
        gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1039
        gapText->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1040
        gapText->setSuffix(einh);
1041
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1042
        topScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1043
        topScratch->setSuffix(einh);
1044
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1045
        bottomScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1046
        bottomScratch->setSuffix(einh);
1047
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1048
        leftScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1049
        leftScratch->setSuffix(einh);
1050
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1051
        rightScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1052
        rightScratch->setSuffix(einh);
1053
        pageWidth = docc->PageB * Umrech;
1054
        pageHeight = docc->PageH * Umrech;
1055
        rightR->setMaxValue(pageWidth - leftR->value());
1056
        leftR->setMaxValue(pageWidth - rightR->value());
1057
        topR->setMaxValue(pageHeight - bottomR->value());
1058
        bottomR->setMaxValue(pageHeight - topR->value());
1059
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1060
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1061
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1062
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1063
}
1064
 
731 fschmid 1065
/*!
1066
 \fn void ReformDoc::ToggleKette()
1067
 \author Franz Schmid
1068
 \date  
1069
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled
1070
 \param None
1071
 \retval None
1072
 */
1073
void ReformDoc::toggleChain()
1074
{
1075
        if (chainButton->isOn())
1076
                scalingVertical->setValue(scalingHorizontal->value());
1077
}
1078
 
1079
/*!
1080
 \fn void ReformDoc::HChange()
1081
 \author Franz Schmid
1082
 \date  
1083
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed
1084
 \param None
1085
 \retval None
1086
 */
1087
void ReformDoc::hChange()
1088
{
1089
        if (chainButton->isOn())
1090
                scalingVertical->setValue(scalingHorizontal->value());
1091
}
1092
 
1093
/*!
1094
 \fn void ReformDoc::vChange()
1095
 \author Franz Schmid
1096
 \date  
1097
 \brief ReformDoc (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed
1098
 \param None
1099
 \retval None
1100
 */
1101
void ReformDoc::vChange()
1102
{
1103
        if (chainButton->isOn())
1104
                scalingHorizontal->setValue(scalingVertical->value());
1105
}
1106
 
727 fschmid 1107
void ReformDoc::changeImageScalingFree(int)
1108
{
1109
        if (buttonGroup3->isChecked())
1110
                buttonGroup5->setChecked(false);
1111
        else
1112
                buttonGroup5->setChecked(true);
1113
}
1114
 
1115
void ReformDoc::changeImageScalingRatio(int)
1116
{
1117
        if (buttonGroup5->isChecked())
1118
                buttonGroup3->setChecked(false);
1119
        else
1120
                buttonGroup3->setChecked(true);
1121
}
1122
 
726 fschmid 1123
/*!
1124
 \fn void ReformDoc::SetSample()
1125
 \author Franz Schmid
1126
 \date  
1127
 \brief ReformDoc (Tools, Text frame), Sets the sample text in selected font in text frame preferences
1128
 \param None
1129
 \retval None
1130
 */
727 fschmid 1131
void ReformDoc::setSample()
726 fschmid 1132
{
1133
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
1134
        QString da = (*fon)[fontComboText->currentText()]->Datei;
1135
        int s = sizeComboText->currentText().left(2).toInt();
1136
        QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor());
1137
        previewText->setPixmap(pm);
1138
}
1139
 
1140
/*!
1141
 \fn void ReformDoc::SetTool()
1142
 \author Franz Schmid
1143
 \date  
1144
 \brief ReformDoc (Tools), Raises widget for selected Tool properties
1145
 \param None
1146
 \retval None
1147
 */
727 fschmid 1148
void ReformDoc::setTool()
726 fschmid 1149
{
1150
        if (toolText == sender())
1151
                subStackTools->raiseWidget(0);
1152
        if (toolShape == sender())
1153
                subStackTools->raiseWidget(1);
1154
        if (toolLine == sender())
1155
                subStackTools->raiseWidget(2);
1156
        if (toolImage == sender())
1157
                subStackTools->raiseWidget(3);
1158
        if (toolPoly == sender())
1159
                subStackTools->raiseWidget(4);
1160
        if (toolZoom == sender())
1161
                subStackTools->raiseWidget(5);
1162
}
1163
 
705 fschmid 1164
void ReformDoc::changeMajorColor()
1165
{
1166
        QColor neu = QColor();
1167
        neu = QColorDialog::getColor(colorMajorGrid, this);
1168
        if (neu.isValid())
1169
        {
1170
                QPixmap pm = QPixmap(54, 14);
1171
                pm.fill(neu);
1172
                colorMajorGrid = neu;
1173
                majorGridColor->setPixmap(pm);
1174
        }
1175
}
1176
 
1177
void ReformDoc::changeMinorColor()
1178
{
1179
        QColor neu = QColor();
1180
        neu = QColorDialog::getColor(colorMinorGrid, this);
1181
        if (neu.isValid())
1182
        {
1183
                QPixmap pm = QPixmap(54, 14);
1184
                pm.fill(neu);
1185
                colorMinorGrid = neu;
1186
                minorGridColor->setPixmap(pm);
1187
        }
1188
}
1189
 
1190
void ReformDoc::changePaperColor()
1191
{
1192
        QColor neu = QColor();
1193
        neu = QColorDialog::getColor(colorPaper, this);
1194
        if (neu.isValid())
1195
        {
1196
                QPixmap pm = QPixmap(54, 14);
1197
                pm.fill(neu);
1198
                colorPaper = neu;
1199
                backColor->setPixmap(pm);
1200
        }
1201
}
1202
 
1203
void ReformDoc::changeBaselineColor()
1204
{
1205
        QColor neu = QColor();
1206
        neu = QColorDialog::getColor(colorBaselineGrid, this);
1207
        if (neu.isValid())
1208
        {
1209
                QPixmap pm = QPixmap(54, 14);
1210
                pm.fill(neu);
1211
                colorBaselineGrid = neu;
1212
                baselineColor->setPixmap(pm);
1213
        }
1214
}
1215
 
1216
void ReformDoc::changeGuideColor()
1217
{
1218
        QColor neu = QColor();
1219
        neu = QColorDialog::getColor(colorGuides, this);
1220
        if (neu.isValid())
1221
        {
1222
                QPixmap pm = QPixmap(54, 14);
1223
                pm.fill(neu);
1224
                colorGuides = neu;
1225
                guideColor->setPixmap(pm);
1226
        }
1227
}
1228
 
1229
void ReformDoc::changeMarginColor()
1230
{
1231
        QColor neu = QColor();
1232
        neu = QColorDialog::getColor(colorMargin, this);
1233
        if (neu.isValid())
1234
        {
1235
                QPixmap pm = QPixmap(54, 14);
1236
                pm.fill(neu);
1237
                colorMargin = neu;
1238
                marginColor->setPixmap(pm);
1239
        }
1240
}
1241
 
693 fschmid 1242
void ReformDoc::setTop(int )
36 Franz 1243
{
726 fschmid 1244
        bottomR->setMaxValue(pageHeight - topR->value());
36 Franz 1245
}
3 paul 1246
 
693 fschmid 1247
void ReformDoc::setBottom(int )
36 Franz 1248
{
726 fschmid 1249
        topR->setMaxValue(pageHeight - bottomR->value());
36 Franz 1250
}
1251
 
693 fschmid 1252
void ReformDoc::setLeft(int )
36 Franz 1253
{
726 fschmid 1254
        rightR->setMaxValue(pageWidth - leftR->value());
36 Franz 1255
}
1256
 
693 fschmid 1257
void ReformDoc::setRight(int )
36 Franz 1258
{
726 fschmid 1259
        leftR->setMaxValue(pageWidth - rightR->value());
36 Franz 1260
}
1261
 
3 paul 1262
void ReformDoc::setDS()
1263
{
726 fschmid 1264
        if (facingPages->isChecked())
249 Franz 1265
        {
340 Franz 1266
                Links->setText( tr( "&Inside:" ) );
1267
                Rechts->setText( tr( "&Outside:" ) );
726 fschmid 1268
                firstPage->setEnabled(true);
249 Franz 1269
        }
1270
        else
1271
        {
340 Franz 1272
                Links->setText( tr( "&Left:" ) );
1273
                Rechts->setText( tr( "&Right:" ) );
726 fschmid 1274
                firstPage->setEnabled(false);
249 Franz 1275
        }
348 Franz 1276
}