Subversion Repositories Scribus

Rev

Rev 823 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
788 fschmid 1
#include "tabtypography.h"
2
#include "tabtypography.moc"
3
#include <qlayout.h>
4
#include <qgroupbox.h>
5
#include <qlabel.h>
6
#include <qtooltip.h>
7
#include <qspinbox.h>
8
#include "mspinbox.h"
9
 
10
 
11
TabTypograpy::TabTypograpy( QWidget* parent , int subD, int subS, int superD, int superS, int capsS, double baseG, double baseO, int autoS, QString unit)
12
                                                        : QWidget( parent, "tabtypo", 0 )
13
{
14
        tabTypoLayout = new QGridLayout( this, 1, 1, 11, 6, "tabTypoLayout");
15
        groupBox1a = new QGroupBox( this, "groupBox1a" );
16
        groupBox1a->setColumnLayout(0, Qt::Vertical );
17
        groupBox1a->layout()->setSpacing( 6 );
18
        groupBox1a->layout()->setMargin( 11 );
19
        groupBox1a->setTitle( tr( "Subscript" ) );
20
        groupBox1aLayout = new QGridLayout( groupBox1a->layout() );
21
        groupBox1aLayout->setAlignment( Qt::AlignTop );
22
        subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" );
23
        subDisplacement->setMaxValue( 100 );
24
        subDisplacement->setValue( subD );
25
        subDisplacement->setSuffix( tr( " %" ) );
26
        groupBox1aLayout->addWidget( subDisplacement, 0, 1, Qt::AlignLeft );
27
        textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" );
28
        groupBox1aLayout->addWidget( textLabel1a, 0, 0 );
29
        subScaling = new QSpinBox( groupBox1a, "subScaling" );
30
        subScaling->setMaxValue( 100 );
31
        subScaling->setMinValue( 1 );
32
        subScaling->setValue( subS );
33
        subScaling->setSuffix( tr( " %" ) );
34
        groupBox1aLayout->addWidget( subScaling, 0, 3, Qt::AlignLeft );
35
        textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" );
36
        groupBox1aLayout->addWidget( textLabel2a, 0, 2 );
37
        tabTypoLayout->addWidget( groupBox1a, 0, 0 );
38
        groupBox2a = new QGroupBox( this, "groupBox2a" );
39
        groupBox2a->setColumnLayout(0, Qt::Vertical );
40
        groupBox2a->layout()->setSpacing( 6 );
41
        groupBox2a->layout()->setMargin( 11 );
42
        groupBox2a->setTitle( tr( "Superscript" ) );
43
        groupBox2aLayout = new QGridLayout( groupBox2a->layout() );
44
        groupBox2aLayout->setAlignment( Qt::AlignTop );
45
        superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" );
46
        superDisplacement->setMaxValue( 100 );
47
        superDisplacement->setValue( superD );
48
        superDisplacement->setSuffix( tr( " %" ) );
49
        groupBox2aLayout->addWidget( superDisplacement, 0, 1, Qt::AlignLeft );
50
        textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" );
51
        groupBox2aLayout->addWidget( textLabel3a, 0, 0 );
52
        superScaling = new QSpinBox( groupBox2a, "superScaling" );
53
        superScaling->setMaxValue( 100 );
54
        superScaling->setMinValue( 1 );
55
        superScaling->setValue( superS );
56
        superScaling->setSuffix( tr( " %" ) );
57
        groupBox2aLayout->addWidget( superScaling, 0, 3, Qt::AlignLeft );
58
        textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" );
59
        groupBox2aLayout->addWidget( textLabel4a, 0, 2 );
60
        tabTypoLayout->addWidget( groupBox2a, 1, 0 );
61
        groupBox3a = new QGroupBox( this, "groupBox3a" );
62
        groupBox3a->setColumnLayout(0, Qt::Vertical );
63
        groupBox3a->layout()->setSpacing( 6 );
64
        groupBox3a->layout()->setMargin( 11 );
65
        groupBox3a->setTitle( tr( "Small Caps" ) );
66
        groupBox3aLayout = new QGridLayout( groupBox3a->layout() );
67
        groupBox3aLayout->setAlignment( Qt::AlignTop );
68
        capsScaling = new QSpinBox( groupBox3a, "capsScaling" );
69
        capsScaling->setMaxValue( 100 );
70
        capsScaling->setMinValue( 1 );
71
        capsScaling->setValue( capsS );
72
        capsScaling->setSuffix( tr( " %" ) );
73
        groupBox3aLayout->addWidget( capsScaling, 0, 1, Qt::AlignLeft );
74
        textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" );
75
        groupBox3aLayout->addWidget( textLabel5a, 0, 0 );
76
        tabTypoLayout->addWidget( groupBox3a, 2, 0 );
77
        groupBox4a = new QGroupBox( this, "groupBox4a" );
78
        groupBox4a->setColumnLayout(0, Qt::Vertical );
79
        groupBox4a->layout()->setSpacing( 6 );
80
        groupBox4a->layout()->setMargin( 11 );
81
        groupBox4a->setTitle( tr( "Other" ) );
82
        groupBox4aLayout = new QGridLayout( groupBox4a->layout() );
83
        groupBox4aLayout->setAlignment( Qt::AlignTop );
84
        baseGrid = new MSpinBox( 1, 1000, groupBox4a, 1 );
85
        baseGrid->setSuffix( unit );
86
        baseGrid->setValue(baseG);
87
        groupBox4aLayout->addWidget( baseGrid, 0, 1, Qt::AlignLeft );
88
        textLabel6a = new QLabel(baseGrid, tr( "Baseline &Grid:" ),groupBox4a, "textLabel6a" );
89
        groupBox4aLayout->addWidget( textLabel6a, 0, 0 );
90
        baseOffset = new MSpinBox( 0, 1000, groupBox4a, 1 );
91
        baseOffset->setSuffix( unit );
92
        baseOffset->setValue(baseO);
93
        groupBox4aLayout->addWidget( baseOffset, 1, 1, Qt::AlignLeft );
94
        textLabel7a = new QLabel(baseOffset, tr( "Baseline &Offset:" ),groupBox4a, "textLabel7a" );
95
        groupBox4aLayout->addWidget( textLabel7a, 1, 0 );
96
        autoLine = new QSpinBox( groupBox4a, "autoLine" );
97
        autoLine->setMaxValue( 100 );
98
        autoLine->setMinValue( 1 );
99
        autoLine->setValue( autoS );
100
        autoLine->setSuffix( tr( " %" ) );
101
        groupBox4aLayout->addWidget( autoLine, 2, 1, Qt::AlignLeft );
102
        textLabel8a = new QLabel( autoLine, tr( "Automatic &Line Spacing:" ), groupBox4a, "textLabel8a" );
103
        groupBox4aLayout->addWidget( textLabel8a, 2, 0 );
104
        tabTypoLayout->addWidget( groupBox4a, 3, 0 );
105
        QToolTip::add( superDisplacement, tr( "Displacement above the baseline of the font on a line" ) );
106
        QToolTip::add( superScaling, tr( "Relative size of the superscript compared to the normal font" ) );
107
        QToolTip::add( subDisplacement, tr( "Displacement below the baseline of the normal font on a line" ) );
108
        QToolTip::add( subScaling, tr( "Relative size of the subscript compared to the normal font" ) );
109
        QToolTip::add( capsScaling, tr( "Relative size of the small caps font compared to the normal font" ) );
110
        QToolTip::add( autoLine, tr( "Percentage increase over the font size for the line spacing" ) );
111
}