Subversion Repositories Scribus

Rev

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