Subversion Repositories Scribus

Rev

Rev 726 | Rev 731 | 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;
727 fschmid 549
        if (doc->DpenText == "None")
550
                colorComboText->setCurrentItem(colorComboText->count()-1);
726 fschmid 551
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
552
        {
553
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
554
                colorComboText->insertItem(pmT2, itc.key());
555
                if (itc.key() == doc->DpenText)
556
                        colorComboText->setCurrentItem(colorComboText->count()-1);
557
        }
558
    subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3 );
559
        gapText = new MSpinBox( 0, 200, subTabText, decimals );
560
        gapText->setSuffix( tr( " pt" ) );
561
        gapText->setValue(doc->DGap);
562
    subTabTextLayout->addWidget( gapText, 3, 3 );
563
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
564
    subTabTextLayout->addWidget( textLabel5b, 3, 2 );
565
    subStackTools->addWidget( subTabText, 0 );
566
 
567
    subTabShape = new QWidget( subStackTools, "subTabShape" );
568
    subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
727 fschmid 569
        colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" );
570
        colorComboLineShape->setEditable(false);
571
        colorComboLineShape->insertItem( tr("None"));
572
        if (doc->Dpen == "None")
573
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
574
        QPixmap pm2S = QPixmap(15, 15);
575
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
576
        {
577
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
578
                colorComboLineShape->insertItem(pm2S, itc.key());
579
                if (itc.key() == doc->Dpen)
580
                        colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
581
        }
582
    subTabShapeLayout->addWidget( colorComboLineShape, 0, 1 );
583
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
584
    subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
585
    shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
586
    shadingLineShape->setMaxValue( 100 );
587
    shadingLineShape->setSuffix( tr( " %" ) );
588
        shadingLineShape->setMinValue( 0 );
589
        shadingLineShape->setValue(doc->Dshade2);
590
    subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
591
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
592
    subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
593
        comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" );
594
        comboFillShape->setEditable(false);
595
        comboFillShape->insertItem( tr("None"));
596
        if (doc->Dbrush == "None")
597
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
598
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
599
        {
600
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
601
                comboFillShape->insertItem(pm2S, itc.key());
602
                if (itc.key() == doc->Dbrush)
603
                        comboFillShape->setCurrentItem(comboFillShape->count()-1);
604
        }
605
    subTabShapeLayout->addWidget( comboFillShape, 2, 1 );
606
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
726 fschmid 607
    subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
608
    shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
609
    shadingFillShape->setMaxValue( 100 );
610
    shadingFillShape->setSuffix( tr( " %" ) );
727 fschmid 611
        shadingFillShape->setMinValue( 0 );
612
        shadingFillShape->setValue(doc->Dshade);
613
    subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
614
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
615
    subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
616
        comboStyleShape = new LineCombo(subTabShape);
617
        comboStyleShape->setEditable(false);
618
        switch (doc->DLineArt)
619
        {
620
        case SolidLine:
621
                comboStyleShape->setCurrentItem(0);
622
                break;
623
        case DashLine:
624
                comboStyleShape->setCurrentItem(1);
625
                break;
626
        case DotLine:
627
                comboStyleShape->setCurrentItem(2);
628
                break;
629
        case DashDotLine:
630
                comboStyleShape->setCurrentItem(3);
631
                break;
632
        case DashDotDotLine:
633
                comboStyleShape->setCurrentItem(4);
634
                break;
635
        default:
636
                comboStyleShape->setCurrentItem(0);
637
                break;
638
        }
639
    subTabShapeLayout->addWidget( comboStyleShape, 4, 1 );
640
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
641
    subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
642
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
643
        lineWidthShape->setSuffix( tr( " pt" ) );
644
        lineWidthShape->setValue(doc->Dwidth);
645
    subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
646
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
647
    subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
726 fschmid 648
    subStackTools->addWidget( subTabShape, 1 );
727 fschmid 649
 
726 fschmid 650
    subTabLine = new QWidget( subStackTools, "subTabLine" );
651
    subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
652
    lineWidthLine = new QSpinBox( subTabLine, "lineWidthLine" );
653
    lineWidthLine->setMaxValue( 36 );
654
    lineWidthLine->setSuffix( tr( " pt" ) );
655
    subTabLineLayout->addWidget( lineWidthLine, 3, 1 );
656
    shadingLine = new QSpinBox( subTabLine, "shadingLine" );
657
    shadingLine->setMaxValue( 100 );
658
    shadingLine->setSuffix( tr( " %" ) );
659
    subTabLineLayout->addWidget( shadingLine, 1, 1 );
660
    colorComboLine = new QComboBox( FALSE, subTabLine, "colorComboLine" );
661
    subTabLineLayout->addWidget( colorComboLine, 0, 1 );
662
    textLabel13b = new QLabel( subTabLine, "textLabel13b" );
663
    textLabel13b->setText( tr( "Line Color:" ) );
664
    subTabLineLayout->addWidget( textLabel13b, 0, 0 );
665
    textLabel14b = new QLabel( subTabLine, "textLabel14b" );
666
    textLabel14b->setText( tr( "Shading:" ) );
667
    subTabLineLayout->addWidget( textLabel14b, 1, 0 );
668
    textLabel15b = new QLabel( subTabLine, "textLabel15b" );
669
    textLabel15b->setText( tr( "Line Style:" ) );
670
    subTabLineLayout->addWidget( textLabel15b, 2, 0 );
671
    textLabel16b = new QLabel( subTabLine, "textLabel16b" );
672
    textLabel16b->setText( tr( "Line Width:" ) );
673
    subTabLineLayout->addWidget( textLabel16b, 3, 0 );
674
    comboStyleLine = new QComboBox( FALSE, subTabLine, "comboStyleLine" );
675
    subTabLineLayout->addWidget( comboStyleLine, 2, 1 );
676
    subStackTools->addWidget( subTabLine, 2 );
727 fschmid 677
 
726 fschmid 678
    subTabImage = new QWidget( subStackTools, "subTabImage" );
679
    subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
680
    comboFillImage = new QComboBox( FALSE, subTabImage, "comboFillImage" );
727 fschmid 681
    subTabImageLayout->addWidget( comboFillImage, 2, 1 );
726 fschmid 682
    textLabel19b = new QLabel( subTabImage, "textLabel19b" );
683
    textLabel19b->setText( tr( "Fill Color:" ) );
727 fschmid 684
    subTabImageLayout->addWidget( textLabel19b, 2, 0 );
726 fschmid 685
    shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
686
    shadingFillImage->setMaxValue( 100 );
687
    shadingFillImage->setSuffix( tr( " %" ) );
727 fschmid 688
    subTabImageLayout->addWidget( shadingFillImage, 3, 1 );
726 fschmid 689
    textLabel20b = new QLabel( subTabImage, "textLabel20b" );
690
    textLabel20b->setText( tr( "Shading:" ) );
727 fschmid 691
    subTabImageLayout->addWidget( textLabel20b, 3, 0 );
692
    buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
726 fschmid 693
    buttonGroup3->setCheckable( TRUE );
694
    buttonGroup3->setColumnLayout(0, Qt::Vertical );
695
    buttonGroup3->layout()->setSpacing( 6 );
696
    buttonGroup3->layout()->setMargin( 11 );
697
    buttonGroup3->setTitle( tr( "Free Scaling" ) );
698
    buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
699
    buttonGroup3Layout->setAlignment( Qt::AlignTop );
700
    textLabel17b = new QLabel( buttonGroup3, "textLabel17b" );
701
    textLabel17b->setText( tr( "Horizontal Scaling:" ) );
702
    buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
703
    textLabel18b = new QLabel( buttonGroup3, "textLabel18b" );
704
    textLabel18b->setText( tr( "Vertical Scaling:" ) );
705
    buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
706
    scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
707
    scalingHorizontal->setMaxValue( 100 );
708
    scalingHorizontal->setMinValue( 1 );
709
    scalingHorizontal->setSuffix( tr( " %" ) );
710
    buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1 );
711
    scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
712
    scalingVertical->setMaxValue( 100 );
713
    scalingVertical->setMinValue( 1 );
714
    scalingVertical->setSuffix( tr( " %" ) );
715
    buttonGroup3Layout->addWidget( scalingVertical, 1, 1 );
716
        chainButton = new LinkButton( buttonGroup3 );
717
        chainButton->setToggleButton( true );
718
        chainButton->setAutoRaise(true);
727 fschmid 719
    buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
720
    subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
721
    buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
726 fschmid 722
    buttonGroup5->setCheckable( TRUE );
723
    buttonGroup5->setChecked( FALSE );
724
    buttonGroup5->setColumnLayout(0, Qt::Vertical );
725
    buttonGroup5->layout()->setSpacing( 6 );
726
    buttonGroup5->layout()->setMargin( 11 );
727
    buttonGroup5->setTitle( tr( "Scale Picture to Frame Size" ) );
728
    buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
729
    buttonGroup5Layout->setAlignment( Qt::AlignTop );
730
    checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
731
    checkRatioImage->setText( tr( "Keep Aspect Ratio" ) );
732
    buttonGroup5Layout->addWidget( checkRatioImage );
727 fschmid 733
    subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
726 fschmid 734
    subStackTools->addWidget( subTabImage, 3 );
727 fschmid 735
 
726 fschmid 736
    subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
737
    subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
738
    textLabel16du = new QLabel( subTabPolygon, "textLabel16" );
739
    textLabel16du->setText( tr( "<p align=\"center\">Dummy</p>" ) );
740
    subTabPolygonLayout->addWidget( textLabel16du );
741
    subStackTools->addWidget( subTabPolygon, 4 );
727 fschmid 742
 
726 fschmid 743
    subTabZoom = new QWidget( subStackTools, "subTabZoom" );
744
    subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
745
    minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
746
    minimumZoom->setMaxValue( 3200 );
747
    minimumZoom->setMinValue( 10 );
727 fschmid 748
        minimumZoom->setValue(doc->MagMin);
726 fschmid 749
    minimumZoom->setSuffix( tr( " %" ) );
750
    subTabZoomLayout->addWidget( minimumZoom, 0, 1 );
727 fschmid 751
    textLabel21b = new QLabel( subTabZoom, "textLabel21b" );
752
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
753
    subTabZoomLayout->addWidget( textLabel21b, 0, 0, Qt::AlignLeft );
726 fschmid 754
    maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
755
    maximumZoom->setMaxValue( 3200 );
756
    maximumZoom->setMinValue( 10 );
727 fschmid 757
        maximumZoom->setValue(doc->MagMax);
726 fschmid 758
    maximumZoom->setSuffix( tr( " %" ) );
759
    subTabZoomLayout->addWidget( maximumZoom, 1, 1 );
727 fschmid 760
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
761
    subTabZoomLayout->addWidget( textLabel22b, 1, 0, Qt::AlignLeft );
726 fschmid 762
    zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
763
    zoomStep->setMaxValue( 200 );
764
    zoomStep->setMinValue( 1 );
765
    zoomStep->setLineStep( 25 );
727 fschmid 766
    zoomStep->setValue( doc->MagStep );
726 fschmid 767
    zoomStep->setSuffix( tr( " %" ) );
768
    subTabZoomLayout->addWidget( zoomStep, 2, 1 );
727 fschmid 769
    textLabel23b = new QLabel( subTabZoom, "textLabel23b" );
770
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
771
    subTabZoomLayout->addWidget( textLabel23b, 2, 0, Qt::AlignLeft );
726 fschmid 772
    subStackTools->addWidget( subTabZoom, 5 );
773
    tabToolsLayout->addWidget( subStackTools );
774
    // buddies
775
    textLabel3b->setBuddy( colorComboText );
776
    textLabel1b->setBuddy( fontComboText );
777
    textLabel2b->setBuddy( sizeComboText );
778
    textLabel5b->setBuddy( gapText );
779
    textLabel9b->setBuddy( comboFillShape );
780
    textLabel10b->setBuddy( shadingFillShape );
781
    textLabel12b->setBuddy( lineWidthShape );
782
    textLabel11b->setBuddy( comboStyleShape );
783
    textLabel7b->setBuddy( colorComboLineShape );
784
    textLabel8b->setBuddy( shadingLineShape );
785
    textLabel13b->setBuddy( colorComboLineShape );
786
    textLabel14b->setBuddy( shadingLine );
787
    textLabel15b->setBuddy( comboStyleLine );
788
    textLabel16b->setBuddy( lineWidthLine );
789
    textLabel19b->setBuddy( comboFillImage );
790
    textLabel20b->setBuddy( shadingFillImage );
791
    textLabel17b->setBuddy( scalingHorizontal );
792
    textLabel18b->setBuddy( scalingVertical );
793
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
794
 
795
        rightR->setMaxValue(pageWidth - leftR->value());
796
        leftR->setMaxValue(pageWidth - rightR->value());
797
        topR->setMaxValue(pageHeight - bottomR->value());
798
        bottomR->setMaxValue(pageHeight - topR->value());
799
        toolText->setOn(true);
727 fschmid 800
        setSample();
249 Franz 801
        //tooltips
726 fschmid 802
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
803
        QToolTip::add( firstPage, tr( "Make the first page the left page of the document" ) );
804
        QToolTip::add( topR, tr( "Distance between the top margin guide and the edge of the page" ) );
805
        QToolTip::add( bottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
806
        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" ) );
807
        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 808
 
249 Franz 809
        // signals and slots connections
726 fschmid 810
        connect( facingPages, SIGNAL( clicked() ), this, SLOT( setDS() ) );
693 fschmid 811
        connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
812
        connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
726 fschmid 813
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
814
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
815
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
816
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 817
        connect(majorGridColor, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
818
        connect(minorGridColor, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
819
        connect(baselineColor, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
820
        connect(guideColor, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
821
        connect(marginColor, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
822
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
727 fschmid 823
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
824
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
825
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
826
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
827
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
828
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
829
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
830
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
831
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
832
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
833
 
693 fschmid 834
        prefsWidgets->raiseWidget(0);
835
        resize( minimumSizeHint() );
836
        clearWState( WState_Polished );
3 paul 837
}
838
 
727 fschmid 839
void ReformDoc::changeImageScalingFree(int)
840
{
841
        if (buttonGroup3->isChecked())
842
                buttonGroup5->setChecked(false);
843
        else
844
                buttonGroup5->setChecked(true);
845
}
846
 
847
void ReformDoc::changeImageScalingRatio(int)
848
{
849
        if (buttonGroup5->isChecked())
850
                buttonGroup3->setChecked(false);
851
        else
852
                buttonGroup3->setChecked(true);
853
}
854
 
726 fschmid 855
/*!
856
 \fn void ReformDoc::SetSample()
857
 \author Franz Schmid
858
 \date  
859
 \brief ReformDoc (Tools, Text frame), Sets the sample text in selected font in text frame preferences
860
 \param None
861
 \retval None
862
 */
727 fschmid 863
void ReformDoc::setSample()
726 fschmid 864
{
865
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
866
        QString da = (*fon)[fontComboText->currentText()]->Datei;
867
        int s = sizeComboText->currentText().left(2).toInt();
868
        QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor());
869
        previewText->setPixmap(pm);
870
}
871
 
872
/*!
873
 \fn void ReformDoc::SetTool()
874
 \author Franz Schmid
875
 \date  
876
 \brief ReformDoc (Tools), Raises widget for selected Tool properties
877
 \param None
878
 \retval None
879
 */
727 fschmid 880
void ReformDoc::setTool()
726 fschmid 881
{
882
        if (toolText == sender())
883
                subStackTools->raiseWidget(0);
884
        if (toolShape == sender())
885
                subStackTools->raiseWidget(1);
886
        if (toolLine == sender())
887
                subStackTools->raiseWidget(2);
888
        if (toolImage == sender())
889
                subStackTools->raiseWidget(3);
890
        if (toolPoly == sender())
891
                subStackTools->raiseWidget(4);
892
        if (toolZoom == sender())
893
                subStackTools->raiseWidget(5);
894
}
895
 
705 fschmid 896
void ReformDoc::changeMajorColor()
897
{
898
        QColor neu = QColor();
899
        neu = QColorDialog::getColor(colorMajorGrid, this);
900
        if (neu.isValid())
901
        {
902
                QPixmap pm = QPixmap(54, 14);
903
                pm.fill(neu);
904
                colorMajorGrid = neu;
905
                majorGridColor->setPixmap(pm);
906
        }
907
}
908
 
909
void ReformDoc::changeMinorColor()
910
{
911
        QColor neu = QColor();
912
        neu = QColorDialog::getColor(colorMinorGrid, this);
913
        if (neu.isValid())
914
        {
915
                QPixmap pm = QPixmap(54, 14);
916
                pm.fill(neu);
917
                colorMinorGrid = neu;
918
                minorGridColor->setPixmap(pm);
919
        }
920
}
921
 
922
void ReformDoc::changePaperColor()
923
{
924
        QColor neu = QColor();
925
        neu = QColorDialog::getColor(colorPaper, this);
926
        if (neu.isValid())
927
        {
928
                QPixmap pm = QPixmap(54, 14);
929
                pm.fill(neu);
930
                colorPaper = neu;
931
                backColor->setPixmap(pm);
932
        }
933
}
934
 
935
void ReformDoc::changeBaselineColor()
936
{
937
        QColor neu = QColor();
938
        neu = QColorDialog::getColor(colorBaselineGrid, this);
939
        if (neu.isValid())
940
        {
941
                QPixmap pm = QPixmap(54, 14);
942
                pm.fill(neu);
943
                colorBaselineGrid = neu;
944
                baselineColor->setPixmap(pm);
945
        }
946
}
947
 
948
void ReformDoc::changeGuideColor()
949
{
950
        QColor neu = QColor();
951
        neu = QColorDialog::getColor(colorGuides, this);
952
        if (neu.isValid())
953
        {
954
                QPixmap pm = QPixmap(54, 14);
955
                pm.fill(neu);
956
                colorGuides = neu;
957
                guideColor->setPixmap(pm);
958
        }
959
}
960
 
961
void ReformDoc::changeMarginColor()
962
{
963
        QColor neu = QColor();
964
        neu = QColorDialog::getColor(colorMargin, this);
965
        if (neu.isValid())
966
        {
967
                QPixmap pm = QPixmap(54, 14);
968
                pm.fill(neu);
969
                colorMargin = neu;
970
                marginColor->setPixmap(pm);
971
        }
972
}
973
 
693 fschmid 974
void ReformDoc::setTop(int )
36 Franz 975
{
726 fschmid 976
        bottomR->setMaxValue(pageHeight - topR->value());
36 Franz 977
}
3 paul 978
 
693 fschmid 979
void ReformDoc::setBottom(int )
36 Franz 980
{
726 fschmid 981
        topR->setMaxValue(pageHeight - bottomR->value());
36 Franz 982
}
983
 
693 fschmid 984
void ReformDoc::setLeft(int )
36 Franz 985
{
726 fschmid 986
        rightR->setMaxValue(pageWidth - leftR->value());
36 Franz 987
}
988
 
693 fschmid 989
void ReformDoc::setRight(int )
36 Franz 990
{
726 fschmid 991
        leftR->setMaxValue(pageWidth - rightR->value());
36 Franz 992
}
993
 
3 paul 994
void ReformDoc::setDS()
995
{
726 fschmid 996
        if (facingPages->isChecked())
249 Franz 997
        {
340 Franz 998
                Links->setText( tr( "&Inside:" ) );
999
                Rechts->setText( tr( "&Outside:" ) );
726 fschmid 1000
                firstPage->setEnabled(true);
249 Franz 1001
        }
1002
        else
1003
        {
340 Franz 1004
                Links->setText( tr( "&Left:" ) );
1005
                Rechts->setText( tr( "&Right:" ) );
726 fschmid 1006
                firstPage->setEnabled(false);
249 Franz 1007
        }
348 Franz 1008
}