Subversion Repositories Scribus

Rev

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